# HG changeset patch
# User meillo@marmaro.de
# Date 1267723888 -3600
# Node ID da18f2d4f92fca9551fb5e3b857885382338744f
# Parent 13bc21684b8a7387aff63795d4fa10c94450005d
removed all buttons and stuff from the window; cleaned up
diff -r 13bc21684b8a -r da18f2d4f92f callbacks.c
--- a/callbacks.c Thu Mar 04 17:05:38 2010 +0100
+++ b/callbacks.c Thu Mar 04 18:31:28 2010 +0100
@@ -147,7 +147,6 @@
"crop_image")), TRUE, (double) h / w);
}
-*/
@@ -155,8 +154,6 @@
-
-/*
void
on_ratio_w_spinbutton_value_changed(GtkSpinButton* spinbutton, gpointer user_data)
{
@@ -268,7 +265,7 @@
void
-on_crop_clicked(GtkButton* button, gpointer user_data)
+crop(void)
{
char crop_call[256];
@@ -327,6 +324,12 @@
return FALSE;
}
switch (pKey->keyval) {
+ case GDK_q:
+ gtk_main_quit();
+ break;
+ case GDK_Return:
+ crop();
+ break;
case GDK_plus:
on_zoom_in_button_clicked(NULL, userdata);
break;
diff -r 13bc21684b8a -r da18f2d4f92f callbacks.h
--- a/callbacks.h Thu Mar 04 17:05:38 2010 +0100
+++ b/callbacks.h Thu Mar 04 18:31:28 2010 +0100
@@ -5,7 +5,21 @@
double ratio;
+void crop(void);
+gboolean on_key_press(GtkWidget* window, GdkEventKey* pKey, gpointer userdata);
+void on_cropper_window_create(GtkObject* object, gpointer user_data);
+void on_cropper_window_destroy(GtkObject* object, gpointer user_data);
+
+
+
/*
+gboolean on_cropper_window_delete_event(GtkWidget* widget, GdkEvent *event, gpointer user_data);
+
+void on_zoom_in_button_clicked(GtkObject* object, gpointer user_data);
+void on_zoom_out_button_clicked(GtkObject* object, gpointer user_data);
+void on_zoom_100_button_clicked(GtkObject* object, gpointer user_data);
+void on_zoom_fit_button_clicked(GtkObject* object, gpointer user_data);
+
void on_ratio_none_activate(GtkMenuItem* menuitem, gpointer user_data);
void on_ratio_square_activate(GtkMenuItem* menuitem, gpointer user_data);
void on_ratio_4x3_activate(GtkMenuItem* menuitem, gpointer user_data);
@@ -23,17 +37,5 @@
void on_ratio_swap_button_clicked(GtkButton* button, gpointer user_data);
*/
-void on_crop_clicked(GtkButton* button, gpointer user_data);
-
-void on_cropper_window_create(GtkObject* object, gpointer user_data);
-void on_cropper_window_destroy(GtkObject* object, gpointer user_data);
-/*gboolean on_cropper_window_delete_event(GtkWidget* widget, GdkEvent *event, gpointer user_data);*/
-
-void on_zoom_in_button_clicked(GtkObject* object, gpointer user_data);
-void on_zoom_out_button_clicked(GtkObject* object, gpointer user_data);
-void on_zoom_100_button_clicked(GtkObject* object, gpointer user_data);
-void on_zoom_fit_button_clicked(GtkObject* object, gpointer user_data);
-
-gboolean on_key_press(GtkWidget* window, GdkEventKey* pKey, gpointer userdata);
#endif
diff -r 13bc21684b8a -r da18f2d4f92f interface.c
--- a/interface.c Thu Mar 04 17:05:38 2010 +0100
+++ b/interface.c Thu Mar 04 18:31:28 2010 +0100
@@ -24,316 +24,96 @@
{
GtkWidget *cropper_window;
GtkWidget *dialog_vbox1;
- GtkWidget *hbox1;
- GtkWidget *vbox1;
- GtkWidget *vbox2;
+ GtkWidget *status;
GtkWidget *label1;
- GtkWidget *hbox2;
GtkWidget *label2;
- GtkWidget *table2;
- GtkWidget *label3;
- GtkWidget *label5;
- GtkWidget *label4;
- GtkWidget *label6;
- GtkWidget *hbox5;
- GtkObject *crop_x_spinbutton_adj;
- GtkWidget *crop_x_spinbutton;
- GtkWidget *hbox6;
- GtkObject *crop_y_spinbutton_adj;
- GtkWidget *crop_y_spinbutton;
- GtkWidget *hbox7;
- GtkObject *crop_width_spinbutton_adj;
- GtkWidget *crop_width_spinbutton;
- GtkWidget *hbox8;
- GtkObject *crop_height_spinbutton_adj;
- GtkWidget *crop_height_spinbutton;
- GtkWidget *vbox4;
- GtkWidget *label7;
- GtkWidget *hbox3;
- GtkWidget *label8;
- GtkWidget *table3;
- GtkWidget *hbox10;
- GtkWidget *custom_ratio_box;
- GtkObject *ratio_w_spinbutton_adj;
- GtkWidget *ratio_w_spinbutton;
- GtkWidget *ratio_swap_button;
- GtkWidget *eventbox1;
- GtkWidget *ratio_swap_image;
- GtkObject *ratio_h_spinbutton_adj;
- GtkWidget *ratio_h_spinbutton;
- GtkWidget *ratio_optionmenu;
- GtkWidget *menu1;
- GtkWidget *ratio_none;
- GtkWidget *ratio_square;
- GtkWidget *ratio_4x3;
- GtkWidget *ratio_3x2;
- GtkWidget *ratio_custom;
- GtkWidget *vbox5;
- GtkWidget *frame1;
- GtkWidget *vbox7;
- GtkWidget *nav_container;
- GtkWidget *hbox16;
- GtkWidget *hbox17;
- GtkWidget *crop_zoom_in_button;
- GtkWidget *image2;
- GtkWidget *crop_zoom_out_button;
- GtkWidget *image4;
- GtkWidget *crop_zoom_100_button;
- GtkWidget *image3;
- GtkWidget *crop_zoom_fit_button;
- GtkWidget *image1;
- GtkWidget *dialog_action_area1;
- GtkWidget *crop_okbutton;
- GtkWidget *alignment1;
- GtkWidget *hbox11;
- GtkWidget *crop_image;
- GtkWidget *label12;
cropper_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_name(cropper_window, "cropper_window");
gtk_container_set_border_width(GTK_CONTAINER(cropper_window), 6);
- gtk_window_set_title(GTK_WINDOW(cropper_window), "Cropper");
+ gtk_window_set_title(GTK_WINDOW(cropper_window), "cropper-0.2");
dialog_vbox1 = gtk_vbox_new(FALSE, 6);
gtk_widget_set_name(dialog_vbox1, "dialog_vbox1");
gtk_widget_show(dialog_vbox1);
gtk_container_add(GTK_CONTAINER(cropper_window), dialog_vbox1);
- hbox1 = gtk_hbox_new(FALSE, 12);
- gtk_widget_set_name(hbox1, "hbox1");
- gtk_widget_show(hbox1);
- gtk_box_pack_start(GTK_BOX(dialog_vbox1), hbox1, TRUE, TRUE, 0);
+
+ status = gtk_hbox_new(FALSE, 0);
+ gtk_widget_set_name(status, "status");
+ gtk_widget_show(status);
+ gtk_box_pack_end(GTK_BOX(dialog_vbox1), status, FALSE, FALSE, 0);
+
+ label1 = gtk_label_new("zoom:");
+ gtk_widget_set_name(label1, "label1");
+ gtk_widget_show(label1);
+ gtk_box_pack_start(GTK_BOX(status), label1, FALSE, FALSE, 0);
+
+ label2 = gtk_label_new("1.0");
+ gtk_widget_set_name(label2, "label2");
+ gtk_widget_show(label2);
+ gtk_box_pack_start(GTK_BOX(status), label2, FALSE, FALSE, 0);
+
+/* image_area */
+ image_buffer = gdk_pixbuf_new_from_file(image_filename, NULL);
+ image_area = gtk_image_new_from_pixbuf(image_buffer);
+
+ gtk_widget_set_name(image_area, "image_area");
+ gtk_widget_show(image_area);
+ gtk_box_pack_start(GTK_BOX(dialog_vbox1), image_area, TRUE, TRUE, 0);
+
+
+
+
+
+g_signal_connect(G_OBJECT(cropper_window), "show",
+ G_CALLBACK(on_cropper_window_create), NULL);
+
+g_signal_connect(G_OBJECT(cropper_window), "destroy",
+ G_CALLBACK(on_cropper_window_destroy), NULL);
+
+g_signal_connect(cropper_window, "key-press-event",
+ G_CALLBACK(on_key_press), NULL);
+
+
+ /* Store pointers to all widgets, for use by lookup_widget(). */
+
+ GLADE_HOOKUP_OBJECT_NO_REF(cropper_window, cropper_window, "cropper_window");
+ GLADE_HOOKUP_OBJECT(cropper_window, dialog_vbox1, "dialog_vbox1");
+
+ GLADE_HOOKUP_OBJECT(cropper_window, label1, "label1");
+ GLADE_HOOKUP_OBJECT(cropper_window, label2, "label2");
+ GLADE_HOOKUP_OBJECT(cropper_window, status, "status");
+ GLADE_HOOKUP_OBJECT(cropper_window, image_area, "image_area");
+ GLADE_HOOKUP_OBJECT(cropper_window,(GtkWidget*) image_buffer, "image_buffer");
+
+
+ return cropper_window;
+}
+
+
+
+
+
+
+
+
+
+/*
gtk_container_set_border_width(GTK_CONTAINER(hbox1), 5);
- vbox1 = gtk_vbox_new(FALSE, 12);
- gtk_widget_set_name(vbox1, "vbox1");
- gtk_widget_show(vbox1);
- gtk_box_pack_start(GTK_BOX(hbox1), vbox1, FALSE, TRUE, 0);
-
- vbox2 = gtk_vbox_new(FALSE, 6);
- gtk_widget_set_name(vbox2, "vbox2");
- gtk_widget_show(vbox2);
- gtk_box_pack_start(GTK_BOX(vbox1), vbox2, FALSE, TRUE, 0);
-
label1 = gtk_label_new("Selection");
- gtk_widget_set_name(label1, "label1");
- gtk_widget_show(label1);
- gtk_box_pack_start(GTK_BOX(vbox2), label1, FALSE, FALSE, 0);
gtk_label_set_use_markup(GTK_LABEL(label1), TRUE);
gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
- hbox2 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox2, "hbox2");
- gtk_widget_show(hbox2);
- gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, TRUE, 0);
-
- label2 = gtk_label_new(" ");
- gtk_widget_set_name(label2, "label2");
- gtk_widget_show(label2);
- gtk_box_pack_start(GTK_BOX(hbox2), label2, FALSE, FALSE, 0);
-
- table2 = gtk_table_new(4, 2, FALSE);
- gtk_widget_set_name(table2, "table2");
- gtk_widget_show(table2);
- gtk_box_pack_start(GTK_BOX(hbox2), table2, TRUE, TRUE, 0);
gtk_table_set_row_spacings(GTK_TABLE(table2), 6);
gtk_table_set_col_spacings(GTK_TABLE(table2), 6);
- label3 = gtk_label_new_with_mnemonic("_X:");
- gtk_widget_set_name(label3, "label3");
- gtk_widget_show(label3);
gtk_table_attach(GTK_TABLE(table2), label3, 0, 1, 0, 1,(GtkAttachOptions)(GTK_FILL),
(GtkAttachOptions)(0), 0, 0);
gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
- label5 = gtk_label_new_with_mnemonic("_Y:");
- gtk_widget_set_name(label5, "label5");
- gtk_widget_show(label5);
- gtk_table_attach(GTK_TABLE(table2), label5, 0, 1, 1, 2,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(0), 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5);
-
- label4 = gtk_label_new_with_mnemonic("_Width:");
- gtk_widget_set_name(label4, "label4");
- gtk_widget_show(label4);
- gtk_table_attach(GTK_TABLE(table2), label4, 0, 1, 2, 3,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(0), 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label4), 0, 0.5);
-
- label6 = gtk_label_new_with_mnemonic("_Height:");
- gtk_widget_set_name(label6, "label6");
- gtk_widget_show(label6);
- gtk_table_attach(GTK_TABLE(table2), label6, 0, 1, 3, 4,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(0), 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5);
-
- hbox5 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox5, "hbox5");
- gtk_widget_show(hbox5);
- gtk_table_attach(GTK_TABLE(table2), hbox5, 1, 2, 0, 1,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(GTK_FILL), 0, 0);
-
- crop_x_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
- crop_x_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_x_spinbutton_adj), 1, 0);
- gtk_widget_set_name(crop_x_spinbutton, "crop_x_spinbutton");
- gtk_widget_show(crop_x_spinbutton);
- gtk_box_pack_start(GTK_BOX(hbox5), crop_x_spinbutton, FALSE, TRUE, 0);
-
- hbox6 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox6, "hbox6");
- gtk_widget_show(hbox6);
- gtk_table_attach(GTK_TABLE(table2), hbox6, 1, 2, 1, 2,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(GTK_FILL), 0, 0);
-
- crop_y_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
- crop_y_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_y_spinbutton_adj), 1, 0);
- gtk_widget_set_name(crop_y_spinbutton, "crop_y_spinbutton");
- gtk_widget_show(crop_y_spinbutton);
- gtk_box_pack_start(GTK_BOX(hbox6), crop_y_spinbutton, FALSE, TRUE, 0);
-
- hbox7 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox7, "hbox7");
- gtk_widget_show(hbox7);
- gtk_table_attach(GTK_TABLE(table2), hbox7, 1, 2, 2, 3,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(GTK_FILL), 0, 0);
-
- crop_width_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
- crop_width_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_width_spinbutton_adj), 1, 0);
- gtk_widget_set_name(crop_width_spinbutton, "crop_width_spinbutton");
- gtk_widget_show(crop_width_spinbutton);
- gtk_box_pack_start(GTK_BOX(hbox7), crop_width_spinbutton, FALSE, FALSE, 0);
-
- hbox8 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox8, "hbox8");
- gtk_widget_show(hbox8);
- gtk_table_attach(GTK_TABLE(table2), hbox8, 1, 2, 3, 4,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(GTK_FILL), 0, 0);
-
- crop_height_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
- crop_height_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_height_spinbutton_adj), 1, 0);
- gtk_widget_set_name(crop_height_spinbutton, "crop_height_spinbutton");
- gtk_widget_show(crop_height_spinbutton);
- gtk_box_pack_start(GTK_BOX(hbox8), crop_height_spinbutton, FALSE, FALSE, 0);
-
- vbox4 = gtk_vbox_new(FALSE, 6);
- gtk_widget_set_name(vbox4, "vbox4");
- gtk_widget_show(vbox4);
- gtk_box_pack_start(GTK_BOX(vbox1), vbox4, FALSE, TRUE, 0);
-
- label7 = gtk_label_new("Aspect ratio");
- gtk_widget_set_name(label7, "label7");
- gtk_widget_show(label7);
- gtk_box_pack_start(GTK_BOX(vbox4), label7, FALSE, FALSE, 0);
- gtk_label_set_use_markup(GTK_LABEL(label7), TRUE);
- gtk_misc_set_alignment(GTK_MISC(label7), 0, 0.5);
-
- hbox3 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox3, "hbox3");
- gtk_widget_show(hbox3);
- gtk_box_pack_start(GTK_BOX(vbox4), hbox3, FALSE, FALSE, 0);
-
- label8 = gtk_label_new(" ");
- gtk_widget_set_name(label8, "label8");
- gtk_widget_show(label8);
- gtk_box_pack_start(GTK_BOX(hbox3), label8, FALSE, FALSE, 0);
-
- table3 = gtk_table_new(2, 2, FALSE);
- gtk_widget_set_name(table3, "table3");
- gtk_widget_show(table3);
- gtk_box_pack_start(GTK_BOX(hbox3), table3, TRUE, TRUE, 0);
- gtk_table_set_row_spacings(GTK_TABLE(table3), 6);
- gtk_table_set_col_spacings(GTK_TABLE(table3), 6);
-
- hbox10 = gtk_hbox_new(FALSE, 6);
- gtk_widget_set_name(hbox10, "hbox10");
- gtk_widget_show(hbox10);
- gtk_table_attach(GTK_TABLE(table3), hbox10, 0, 2, 1, 2,
- (GtkAttachOptions)(GTK_FILL),
- (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
-
- custom_ratio_box = gtk_hbox_new(FALSE, 6);
- gtk_widget_set_name(custom_ratio_box, "custom_ratio_box");
- gtk_widget_show(custom_ratio_box);
- gtk_box_pack_start(GTK_BOX(hbox10), custom_ratio_box, TRUE, TRUE, 0);
-
- ratio_w_spinbutton_adj = gtk_adjustment_new(1, 1, 9999, 1, 10, 10);
- ratio_w_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(ratio_w_spinbutton_adj), 1, 0);
- gtk_widget_set_name(ratio_w_spinbutton, "ratio_w_spinbutton");
- gtk_widget_show(ratio_w_spinbutton);
- gtk_box_pack_start(GTK_BOX(custom_ratio_box), ratio_w_spinbutton, FALSE, TRUE, 0);
-
- ratio_swap_button = gtk_button_new();
- gtk_widget_set_name(ratio_swap_button, "ratio_swap_button");
- gtk_widget_show(ratio_swap_button);
- gtk_box_pack_start(GTK_BOX(custom_ratio_box), ratio_swap_button, FALSE, FALSE, 0);
- gtk_button_set_relief(GTK_BUTTON(ratio_swap_button), GTK_RELIEF_NONE);
-
- eventbox1 = gtk_event_box_new();
- gtk_widget_set_name(eventbox1, "eventbox1");
- gtk_widget_show(eventbox1);
- gtk_container_add(GTK_CONTAINER(ratio_swap_button), eventbox1);
-
- ratio_swap_image = gtk_image_new_from_stock("gtk-refresh", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_name(ratio_swap_image, "ratio_swap_image");
- gtk_widget_show(ratio_swap_image);
- gtk_container_add(GTK_CONTAINER(eventbox1), ratio_swap_image);
-
- ratio_h_spinbutton_adj = gtk_adjustment_new(1, 1, 9999, 1, 10, 10);
- ratio_h_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(ratio_h_spinbutton_adj), 1, 0);
- gtk_widget_set_name(ratio_h_spinbutton, "ratio_h_spinbutton");
- gtk_widget_show(ratio_h_spinbutton);
- gtk_box_pack_start(GTK_BOX(custom_ratio_box), ratio_h_spinbutton, FALSE, TRUE, 0);
- gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(ratio_h_spinbutton), GTK_UPDATE_IF_VALID);
-
- ratio_optionmenu = gtk_option_menu_new();
- gtk_widget_set_name(ratio_optionmenu, "ratio_optionmenu");
- gtk_widget_show(ratio_optionmenu);
- gtk_table_attach(GTK_TABLE(table3), ratio_optionmenu, 0, 2, 0, 1,
- (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
-
- menu1 = gtk_menu_new();
- gtk_widget_set_name(menu1, "menu1");
-
- ratio_none = gtk_menu_item_new_with_mnemonic("None");
- gtk_widget_set_name(ratio_none, "ratio_none");
- gtk_widget_show(ratio_none);
- gtk_container_add(GTK_CONTAINER(menu1), ratio_none);
-
- ratio_square = gtk_menu_item_new_with_mnemonic("Square");
- gtk_widget_set_name(ratio_square, "ratio_square");
- gtk_widget_show(ratio_square);
- gtk_container_add(GTK_CONTAINER(menu1), ratio_square);
-
- ratio_4x3 = gtk_menu_item_new_with_mnemonic("4 x 3(Book, DVD)");
- gtk_widget_set_name(ratio_4x3, "ratio_4x3");
- gtk_widget_show(ratio_4x3);
- gtk_container_add(GTK_CONTAINER(menu1), ratio_4x3);
-
- ratio_3x2 = gtk_menu_item_new_with_mnemonic("4 x 6(Postcard)");
- gtk_widget_set_name(ratio_3x2, "ratio_3x2");
- gtk_widget_show(ratio_3x2);
- gtk_container_add(GTK_CONTAINER(menu1), ratio_3x2);
-
- ratio_custom = gtk_menu_item_new_with_mnemonic("Custom");
- gtk_widget_set_name(ratio_custom, "ratio_custom");
- gtk_widget_show(ratio_custom);
- gtk_container_add(GTK_CONTAINER(menu1), ratio_custom);
-
- gtk_option_menu_set_menu(GTK_OPTION_MENU(ratio_optionmenu), menu1);
-
- vbox5 = gtk_vbox_new(FALSE, 0);
- gtk_widget_set_name(vbox5, "vbox5");
- gtk_widget_show(vbox5);
- gtk_box_pack_start(GTK_BOX(hbox1), vbox5, TRUE, TRUE, 0);
-
frame1 = gtk_frame_new(NULL);
gtk_widget_set_name(frame1, "frame1");
gtk_widget_show(frame1);
@@ -345,262 +125,14 @@
gtk_widget_show(vbox7);
gtk_container_add(GTK_CONTAINER(frame1), vbox7);
- nav_container = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(nav_container, "nav_container");
- gtk_widget_show(nav_container);
- gtk_box_pack_start(GTK_BOX(vbox7), nav_container, TRUE, TRUE, 0);
-
-/* image_area */
- image_buffer = gdk_pixbuf_new_from_file(image_filename, NULL);
- image_area = gtk_image_new_from_pixbuf(image_buffer);
-
- gtk_widget_set_name(image_area, "image_area");
- gtk_widget_show(image_area);
- gtk_box_pack_start(GTK_BOX(nav_container), image_area, TRUE, TRUE, 0);
-
- hbox16 = gtk_hbox_new(FALSE, 6);
- gtk_widget_set_name(hbox16, "hbox16");
- gtk_widget_show(hbox16);
- gtk_box_pack_start(GTK_BOX(vbox7), hbox16, FALSE, TRUE, 0);
-
- hbox17 = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(hbox17, "hbox17");
- gtk_widget_show(hbox17);
- gtk_box_pack_end(GTK_BOX(hbox16), hbox17, FALSE, TRUE, 0);
-
- crop_zoom_in_button = gtk_button_new();
- gtk_widget_set_name(crop_zoom_in_button, "crop_zoom_in_button");
- gtk_widget_show(crop_zoom_in_button);
- gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_in_button, FALSE, FALSE, 0);
- gtk_button_set_relief(GTK_BUTTON(crop_zoom_in_button), GTK_RELIEF_NONE);
-
- image2 = gtk_image_new_from_stock("gtk-zoom-in", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_name(image2, "image2");
- gtk_widget_show(image2);
- gtk_container_add(GTK_CONTAINER(crop_zoom_in_button), image2);
-
- crop_zoom_out_button = gtk_button_new();
- gtk_widget_set_name(crop_zoom_out_button, "crop_zoom_out_button");
- gtk_widget_show(crop_zoom_out_button);
- gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_out_button, FALSE, FALSE, 0);
- gtk_button_set_relief(GTK_BUTTON(crop_zoom_out_button), GTK_RELIEF_NONE);
-
- image4 = gtk_image_new_from_stock("gtk-zoom-out", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_name(image4, "image4");
- gtk_widget_show(image4);
- gtk_container_add(GTK_CONTAINER(crop_zoom_out_button), image4);
-
- crop_zoom_100_button = gtk_button_new();
- gtk_widget_set_name(crop_zoom_100_button, "crop_zoom_100_button");
- gtk_widget_show(crop_zoom_100_button);
- gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_100_button, FALSE, FALSE, 0);
- gtk_button_set_relief(GTK_BUTTON(crop_zoom_100_button), GTK_RELIEF_NONE);
-
- image3 = gtk_image_new_from_stock("gtk-zoom-100", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_name(image3, "image3");
- gtk_widget_show(image3);
- gtk_container_add(GTK_CONTAINER(crop_zoom_100_button), image3);
-
- crop_zoom_fit_button = gtk_button_new();
- gtk_widget_set_name(crop_zoom_fit_button, "crop_zoom_fit_button");
- gtk_widget_show(crop_zoom_fit_button);
- gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_fit_button, FALSE, FALSE, 0);
- gtk_button_set_relief(GTK_BUTTON(crop_zoom_fit_button), GTK_RELIEF_NONE);
-
- image1 = gtk_image_new_from_stock("gtk-zoom-fit", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_name(image1, "image1");
- gtk_widget_show(image1);
- gtk_container_add(GTK_CONTAINER(crop_zoom_fit_button), image1);
-
-
-
-/*
- okay_box = gtk_hbox_new(FALSE, 0);
- gtk_widget_set_name(okay_box, "okay_box");
- gtk_widget_show(okay_box);
- gtk_box_pack_end(GTK_BOX(hbox16), okay_box, FALSE, TRUE, 0);
-*/
-
- crop_okbutton = gtk_button_new();
- gtk_widget_set_name(crop_okbutton, "crop_okbutton");
- gtk_widget_show(crop_okbutton);
- gtk_box_pack_end(GTK_BOX(dialog_vbox1), crop_okbutton, FALSE, FALSE, 0);
- GTK_WIDGET_SET_FLAGS(crop_okbutton, GTK_CAN_DEFAULT);
-
- alignment1 = gtk_alignment_new(0.5, 0.5, 0, 0);
- gtk_widget_set_name(alignment1, "alignment1");
- gtk_widget_show(alignment1);
- gtk_container_add(GTK_CONTAINER(crop_okbutton), alignment1);
-
- hbox11 = gtk_hbox_new(FALSE, 2);
- gtk_widget_set_name(hbox11, "hbox11");
- gtk_widget_show(hbox11);
- gtk_container_add(GTK_CONTAINER(alignment1), hbox11);
-
- crop_image = gtk_image_new_from_stock("gtk-ok", GTK_ICON_SIZE_BUTTON);
- gtk_widget_set_name(crop_image, "crop_image");
- gtk_widget_show(crop_image);
- gtk_box_pack_start(GTK_BOX(hbox11), crop_image, FALSE, FALSE, 0);
-
- label12 = gtk_label_new_with_mnemonic("_Crop");
- gtk_widget_set_name(label12, "label12");
- gtk_widget_show(label12);
- gtk_box_pack_start(GTK_BOX(hbox11), label12, FALSE, FALSE, 0);
-
-
-
-
-
- g_signal_connect(G_OBJECT(cropper_window), "show",
- G_CALLBACK(on_cropper_window_create), NULL);
-/* destroy */
- g_signal_connect(G_OBJECT(cropper_window), "destroy",
- G_CALLBACK(on_cropper_window_destroy), NULL);
-
-
-/* crop */
- g_signal_connect(G_OBJECT(crop_okbutton), "clicked",
- G_CALLBACK(on_crop_clicked), NULL);
-
-
-/* zoom */
- g_signal_connect(G_OBJECT(crop_zoom_in_button), "clicked",
- G_CALLBACK(on_zoom_in_button_clicked), NULL);
- g_signal_connect(G_OBJECT(crop_zoom_out_button), "clicked",
- G_CALLBACK(on_zoom_out_button_clicked), NULL);
- g_signal_connect(G_OBJECT(crop_zoom_100_button), "clicked",
- G_CALLBACK(on_zoom_100_button_clicked), NULL);
- g_signal_connect(G_OBJECT(crop_zoom_fit_button), "clicked",
- G_CALLBACK(on_zoom_fit_button_clicked), NULL);
-
-
-/* aspect ratio */
-/*
- g_signal_connect(G_OBJECT(ratio_w_spinbutton), "value_changed",
- G_CALLBACK(on_ratio_w_spinbutton_value_changed), NULL);
- g_signal_connect(G_OBJECT(ratio_swap_button), "clicked",
- G_CALLBACK(on_ratio_swap_button_clicked), NULL);
- g_signal_connect(G_OBJECT(ratio_h_spinbutton), "value_changed",
- G_CALLBACK(on_ratio_h_spinbutton_value_changed), NULL);
-
+g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_x_spinbutton")), "value_changed",
+ G_CALLBACK(selection_x_value_changed_cb), data);
+g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_image")), "selection_changed",
+ G_CALLBACK(selection_changed_cb), data);
+g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_swap_button")), "clicked",
+ G_CALLBACK(ratio_swap_button_cb), NULL);
+g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_optionmenu")), "changed",
+ G_CALLBACK(ratio_optionmenu_changed_cb), NULL);
g_signal_connect(G_OBJECT(ratio_none), "activate",
G_CALLBACK(on_ratio_none_activate), NULL);
- g_signal_connect(G_OBJECT(ratio_square), "activate",
- G_CALLBACK(on_ratio_square_activate), NULL);
- g_signal_connect(G_OBJECT(ratio_4x3), "activate",
- G_CALLBACK(on_ratio_4x3_activate), NULL);
- g_signal_connect(G_OBJECT(ratio_3x2), "activate",
- G_CALLBACK(on_ratio_3x2_activate), NULL);
- g_signal_connect(G_OBJECT(ratio_custom), "activate",
- G_CALLBACK(on_ratio_custom_activate), NULL);
-
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_optionmenu")), "changed",
- G_CALLBACK(ratio_optionmenu_changed_cb), NULL);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_w_spinbutton")), "value_changed",
- G_CALLBACK(ratio_value_changed_cb), NULL);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_h_spinbutton")), "value_changed",
- G_CALLBACK(ratio_value_changed_cb), NULL);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_swap_button")), "clicked",
- G_CALLBACK(ratio_swap_button_cb), NULL);
*/
-
-
-/* selection */
-/*
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_x_spinbutton")), "value_changed",
- G_CALLBACK(selection_x_value_changed_cb), data);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_y_spinbutton")), "value_changed",
- G_CALLBACK(selection_y_value_changed_cb), data);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_width_spinbutton")), "value_changed",
- G_CALLBACK(selection_width_value_changed_cb), data);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_height_spinbutton")), "value_changed",
- G_CALLBACK(selection_height_value_changed_cb), data);
-g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_image")), "selection_changed",
- G_CALLBACK(selection_changed_cb), data);
-*/
-
-
-
-
-
-
-
-
- g_signal_connect(cropper_window, "key-press-event", G_CALLBACK(on_key_press), NULL);
-
-
-
-
-
-
-
-
-
- /* Store pointers to all widgets, for use by lookup_widget(). */
- GLADE_HOOKUP_OBJECT_NO_REF(cropper_window, cropper_window, "cropper_window");
- GLADE_HOOKUP_OBJECT(cropper_window, dialog_vbox1, "dialog_vbox1");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox1, "hbox1");
- GLADE_HOOKUP_OBJECT(cropper_window, vbox1, "vbox1");
- GLADE_HOOKUP_OBJECT(cropper_window, vbox2, "vbox2");
- GLADE_HOOKUP_OBJECT(cropper_window, label1, "label1");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox2, "hbox2");
- GLADE_HOOKUP_OBJECT(cropper_window, label2, "label2");
- GLADE_HOOKUP_OBJECT(cropper_window, table2, "table2");
- GLADE_HOOKUP_OBJECT(cropper_window, label3, "label3");
- GLADE_HOOKUP_OBJECT(cropper_window, label5, "label5");
- GLADE_HOOKUP_OBJECT(cropper_window, label4, "label4");
- GLADE_HOOKUP_OBJECT(cropper_window, label6, "label6");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox5, "hbox5");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_x_spinbutton, "crop_x_spinbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox6, "hbox6");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_y_spinbutton, "crop_y_spinbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox7, "hbox7");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_width_spinbutton, "crop_width_spinbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox8, "hbox8");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_height_spinbutton, "crop_height_spinbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, vbox4, "vbox4");
- GLADE_HOOKUP_OBJECT(cropper_window, label7, "label7");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox3, "hbox3");
- GLADE_HOOKUP_OBJECT(cropper_window, label8, "label8");
- GLADE_HOOKUP_OBJECT(cropper_window, table3, "table3");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox10, "hbox10");
- GLADE_HOOKUP_OBJECT(cropper_window, custom_ratio_box, "custom_ratio_box");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_w_spinbutton, "ratio_w_spinbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_swap_button, "ratio_swap_button");
- GLADE_HOOKUP_OBJECT(cropper_window, eventbox1, "eventbox1");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_swap_image, "ratio_swap_image");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_h_spinbutton, "ratio_h_spinbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_optionmenu, "ratio_optionmenu");
- GLADE_HOOKUP_OBJECT(cropper_window, menu1, "menu1");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_none, "ratio_none");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_square, "ratio_square");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_4x3, "ratio_4x3");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_3x2, "ratio_3x2");
- GLADE_HOOKUP_OBJECT(cropper_window, ratio_custom, "ratio_custom");
- GLADE_HOOKUP_OBJECT(cropper_window, vbox5, "vbox5");
- GLADE_HOOKUP_OBJECT(cropper_window, frame1, "frame1");
- GLADE_HOOKUP_OBJECT(cropper_window, vbox7, "vbox7");
- GLADE_HOOKUP_OBJECT(cropper_window, nav_container, "nav_container");
- GLADE_HOOKUP_OBJECT(cropper_window, image_area, "image_area");
- GLADE_HOOKUP_OBJECT(cropper_window,(GtkWidget*) image_buffer, "image_buffer");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox16, "hbox16");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox17, "hbox17");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_in_button, "crop_zoom_in_button");
- GLADE_HOOKUP_OBJECT(cropper_window, image2, "image2");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_out_button, "crop_zoom_out_button");
- GLADE_HOOKUP_OBJECT(cropper_window, image4, "image4");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_100_button, "crop_zoom_100_button");
- GLADE_HOOKUP_OBJECT(cropper_window, image3, "image3");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_fit_button, "crop_zoom_fit_button");
- GLADE_HOOKUP_OBJECT(cropper_window, image1, "image1");
- /*GLADE_HOOKUP_OBJECT_NO_REF(cropper_window, dialog_action_area1, "dialog_action_area1"); */
- GLADE_HOOKUP_OBJECT(cropper_window, crop_okbutton, "crop_okbutton");
- GLADE_HOOKUP_OBJECT(cropper_window, alignment1, "alignment1");
- GLADE_HOOKUP_OBJECT(cropper_window, hbox11, "hbox11");
- GLADE_HOOKUP_OBJECT(cropper_window, crop_image, "crop_image");
- GLADE_HOOKUP_OBJECT(cropper_window, label12, "label12");
-
-
- return cropper_window;
-}
-
diff -r 13bc21684b8a -r da18f2d4f92f main.c
--- a/main.c Thu Mar 04 17:05:38 2010 +0100
+++ b/main.c Thu Mar 04 18:31:28 2010 +0100
@@ -16,10 +16,14 @@
image_filename = argv[1];
+/*
gtk_set_locale();
+*/
gtk_init(&argc, &argv);
+/*
add_pixmap_directory("/usr/share/pixmaps");
+*/
cropper_window = create_cropper_window();
gtk_widget_show(cropper_window);