cropper

diff interface.c @ 14:da18f2d4f92f

removed all buttons and stuff from the window; cleaned up
author meillo@marmaro.de
date Thu, 04 Mar 2010 18:31:28 +0100
parents 13bc21684b8a
children 7dbf3879939a
line diff
     1.1 --- a/interface.c	Thu Mar 04 17:05:38 2010 +0100
     1.2 +++ b/interface.c	Thu Mar 04 18:31:28 2010 +0100
     1.3 @@ -24,316 +24,96 @@
     1.4  {
     1.5    GtkWidget *cropper_window;
     1.6    GtkWidget *dialog_vbox1;
     1.7 -  GtkWidget *hbox1;
     1.8 -  GtkWidget *vbox1;
     1.9 -  GtkWidget *vbox2;
    1.10 +  GtkWidget *status;
    1.11    GtkWidget *label1;
    1.12 -  GtkWidget *hbox2;
    1.13    GtkWidget *label2;
    1.14 -  GtkWidget *table2;
    1.15 -  GtkWidget *label3;
    1.16 -  GtkWidget *label5;
    1.17 -  GtkWidget *label4;
    1.18 -  GtkWidget *label6;
    1.19 -  GtkWidget *hbox5;
    1.20 -  GtkObject *crop_x_spinbutton_adj;
    1.21 -  GtkWidget *crop_x_spinbutton;
    1.22 -  GtkWidget *hbox6;
    1.23 -  GtkObject *crop_y_spinbutton_adj;
    1.24 -  GtkWidget *crop_y_spinbutton;
    1.25 -  GtkWidget *hbox7;
    1.26 -  GtkObject *crop_width_spinbutton_adj;
    1.27 -  GtkWidget *crop_width_spinbutton;
    1.28 -  GtkWidget *hbox8;
    1.29 -  GtkObject *crop_height_spinbutton_adj;
    1.30 -  GtkWidget *crop_height_spinbutton;
    1.31 -  GtkWidget *vbox4;
    1.32 -  GtkWidget *label7;
    1.33 -  GtkWidget *hbox3;
    1.34 -  GtkWidget *label8;
    1.35 -  GtkWidget *table3;
    1.36 -  GtkWidget *hbox10;
    1.37 -  GtkWidget *custom_ratio_box;
    1.38 -  GtkObject *ratio_w_spinbutton_adj;
    1.39 -  GtkWidget *ratio_w_spinbutton;
    1.40 -  GtkWidget *ratio_swap_button;
    1.41 -  GtkWidget *eventbox1;
    1.42 -  GtkWidget *ratio_swap_image;
    1.43 -  GtkObject *ratio_h_spinbutton_adj;
    1.44 -  GtkWidget *ratio_h_spinbutton;
    1.45 -  GtkWidget *ratio_optionmenu;
    1.46 -  GtkWidget *menu1;
    1.47 -  GtkWidget *ratio_none;
    1.48 -  GtkWidget *ratio_square;
    1.49 -  GtkWidget *ratio_4x3;
    1.50 -  GtkWidget *ratio_3x2;
    1.51 -  GtkWidget *ratio_custom;
    1.52 -  GtkWidget *vbox5;
    1.53 -  GtkWidget *frame1;
    1.54 -  GtkWidget *vbox7;
    1.55 -  GtkWidget *nav_container;
    1.56 -  GtkWidget *hbox16;
    1.57 -  GtkWidget *hbox17;
    1.58 -  GtkWidget *crop_zoom_in_button;
    1.59 -  GtkWidget *image2;
    1.60 -  GtkWidget *crop_zoom_out_button;
    1.61 -  GtkWidget *image4;
    1.62 -  GtkWidget *crop_zoom_100_button;
    1.63 -  GtkWidget *image3;
    1.64 -  GtkWidget *crop_zoom_fit_button;
    1.65 -  GtkWidget *image1;
    1.66 -	GtkWidget *dialog_action_area1;
    1.67 -	GtkWidget *crop_okbutton;
    1.68 -	GtkWidget *alignment1;
    1.69 -	GtkWidget *hbox11;
    1.70 -	GtkWidget *crop_image;
    1.71 -	GtkWidget *label12;
    1.72  
    1.73  
    1.74    cropper_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    1.75    gtk_widget_set_name(cropper_window, "cropper_window");
    1.76    gtk_container_set_border_width(GTK_CONTAINER(cropper_window), 6);
    1.77 -  gtk_window_set_title(GTK_WINDOW(cropper_window), "Cropper");
    1.78 +  gtk_window_set_title(GTK_WINDOW(cropper_window), "cropper-0.2");
    1.79  
    1.80    dialog_vbox1 = gtk_vbox_new(FALSE, 6);
    1.81    gtk_widget_set_name(dialog_vbox1, "dialog_vbox1");
    1.82    gtk_widget_show(dialog_vbox1);
    1.83    gtk_container_add(GTK_CONTAINER(cropper_window), dialog_vbox1);
    1.84  
    1.85 -  hbox1 = gtk_hbox_new(FALSE, 12);
    1.86 -  gtk_widget_set_name(hbox1, "hbox1");
    1.87 -  gtk_widget_show(hbox1);
    1.88 -  gtk_box_pack_start(GTK_BOX(dialog_vbox1), hbox1, TRUE, TRUE, 0);
    1.89 +
    1.90 +  status = gtk_hbox_new(FALSE, 0);
    1.91 +  gtk_widget_set_name(status, "status");
    1.92 +  gtk_widget_show(status);
    1.93 +  gtk_box_pack_end(GTK_BOX(dialog_vbox1), status, FALSE, FALSE, 0);
    1.94 +
    1.95 +  label1 = gtk_label_new("zoom:");
    1.96 +  gtk_widget_set_name(label1, "label1");
    1.97 +  gtk_widget_show(label1);
    1.98 +  gtk_box_pack_start(GTK_BOX(status), label1, FALSE, FALSE, 0);
    1.99 +
   1.100 +  label2 = gtk_label_new("1.0");
   1.101 +  gtk_widget_set_name(label2, "label2");
   1.102 +  gtk_widget_show(label2);
   1.103 +  gtk_box_pack_start(GTK_BOX(status), label2, FALSE, FALSE, 0);
   1.104 +
   1.105 +/* image_area */
   1.106 +  image_buffer = gdk_pixbuf_new_from_file(image_filename, NULL);
   1.107 +  image_area = gtk_image_new_from_pixbuf(image_buffer);
   1.108 +
   1.109 +  gtk_widget_set_name(image_area, "image_area");
   1.110 +  gtk_widget_show(image_area);
   1.111 +  gtk_box_pack_start(GTK_BOX(dialog_vbox1), image_area, TRUE, TRUE, 0);
   1.112 +
   1.113 +
   1.114 +
   1.115 +
   1.116 +
   1.117 +g_signal_connect(G_OBJECT(cropper_window), "show",
   1.118 +                 G_CALLBACK(on_cropper_window_create), NULL);
   1.119 +
   1.120 +g_signal_connect(G_OBJECT(cropper_window), "destroy",
   1.121 +                 G_CALLBACK(on_cropper_window_destroy), NULL);
   1.122 +
   1.123 +g_signal_connect(cropper_window, "key-press-event",
   1.124 +                 G_CALLBACK(on_key_press), NULL);
   1.125 +
   1.126 +
   1.127 +  /* Store pointers to all widgets, for use by lookup_widget(). */
   1.128 +
   1.129 +  GLADE_HOOKUP_OBJECT_NO_REF(cropper_window, cropper_window, "cropper_window");
   1.130 +  GLADE_HOOKUP_OBJECT(cropper_window, dialog_vbox1, "dialog_vbox1");
   1.131 +
   1.132 +  GLADE_HOOKUP_OBJECT(cropper_window, label1, "label1");
   1.133 +  GLADE_HOOKUP_OBJECT(cropper_window, label2, "label2");
   1.134 +  GLADE_HOOKUP_OBJECT(cropper_window, status, "status");
   1.135 +  GLADE_HOOKUP_OBJECT(cropper_window, image_area, "image_area");
   1.136 +  GLADE_HOOKUP_OBJECT(cropper_window,(GtkWidget*) image_buffer, "image_buffer");
   1.137 +
   1.138 +
   1.139 +  return cropper_window;
   1.140 +}
   1.141 +
   1.142 +
   1.143 +
   1.144 +
   1.145 +
   1.146 +
   1.147 +
   1.148 +
   1.149 +
   1.150 +/*
   1.151    gtk_container_set_border_width(GTK_CONTAINER(hbox1), 5);
   1.152  
   1.153 -  vbox1 = gtk_vbox_new(FALSE, 12);
   1.154 -  gtk_widget_set_name(vbox1, "vbox1");
   1.155 -  gtk_widget_show(vbox1);
   1.156 -  gtk_box_pack_start(GTK_BOX(hbox1), vbox1, FALSE, TRUE, 0);
   1.157 -
   1.158 -  vbox2 = gtk_vbox_new(FALSE, 6);
   1.159 -  gtk_widget_set_name(vbox2, "vbox2");
   1.160 -  gtk_widget_show(vbox2);
   1.161 -  gtk_box_pack_start(GTK_BOX(vbox1), vbox2, FALSE, TRUE, 0);
   1.162 -
   1.163    label1 = gtk_label_new("<b>Selection</b>");
   1.164 -  gtk_widget_set_name(label1, "label1");
   1.165 -  gtk_widget_show(label1);
   1.166 -  gtk_box_pack_start(GTK_BOX(vbox2), label1, FALSE, FALSE, 0);
   1.167    gtk_label_set_use_markup(GTK_LABEL(label1), TRUE);
   1.168    gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
   1.169  
   1.170 -  hbox2 = gtk_hbox_new(FALSE, 0);
   1.171 -  gtk_widget_set_name(hbox2, "hbox2");
   1.172 -  gtk_widget_show(hbox2);
   1.173 -  gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, TRUE, 0);
   1.174 -
   1.175 -  label2 = gtk_label_new("    ");
   1.176 -  gtk_widget_set_name(label2, "label2");
   1.177 -  gtk_widget_show(label2);
   1.178 -  gtk_box_pack_start(GTK_BOX(hbox2), label2, FALSE, FALSE, 0);
   1.179 -
   1.180 -  table2 = gtk_table_new(4, 2, FALSE);
   1.181 -  gtk_widget_set_name(table2, "table2");
   1.182 -  gtk_widget_show(table2);
   1.183 -  gtk_box_pack_start(GTK_BOX(hbox2), table2, TRUE, TRUE, 0);
   1.184    gtk_table_set_row_spacings(GTK_TABLE(table2), 6);
   1.185    gtk_table_set_col_spacings(GTK_TABLE(table2), 6);
   1.186  
   1.187 -  label3 = gtk_label_new_with_mnemonic("_X:");
   1.188 -  gtk_widget_set_name(label3, "label3");
   1.189 -  gtk_widget_show(label3);
   1.190    gtk_table_attach(GTK_TABLE(table2), label3, 0, 1, 0, 1,(GtkAttachOptions)(GTK_FILL),
   1.191                    (GtkAttachOptions)(0), 0, 0);
   1.192    gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
   1.193  
   1.194 -  label5 = gtk_label_new_with_mnemonic("_Y:");
   1.195 -  gtk_widget_set_name(label5, "label5");
   1.196 -  gtk_widget_show(label5);
   1.197 -  gtk_table_attach(GTK_TABLE(table2), label5, 0, 1, 1, 2,
   1.198 -                   (GtkAttachOptions)(GTK_FILL),
   1.199 -                   (GtkAttachOptions)(0), 0, 0);
   1.200 -  gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5);
   1.201 -
   1.202 -  label4 = gtk_label_new_with_mnemonic("_Width:");
   1.203 -  gtk_widget_set_name(label4, "label4");
   1.204 -  gtk_widget_show(label4);
   1.205 -  gtk_table_attach(GTK_TABLE(table2), label4, 0, 1, 2, 3,
   1.206 -                   (GtkAttachOptions)(GTK_FILL),
   1.207 -                   (GtkAttachOptions)(0), 0, 0);
   1.208 -  gtk_misc_set_alignment(GTK_MISC(label4), 0, 0.5);
   1.209 -
   1.210 -  label6 = gtk_label_new_with_mnemonic("_Height:");
   1.211 -  gtk_widget_set_name(label6, "label6");
   1.212 -  gtk_widget_show(label6);
   1.213 -  gtk_table_attach(GTK_TABLE(table2), label6, 0, 1, 3, 4,
   1.214 -                   (GtkAttachOptions)(GTK_FILL),
   1.215 -                   (GtkAttachOptions)(0), 0, 0);
   1.216 -  gtk_misc_set_alignment(GTK_MISC(label6), 0, 0.5);
   1.217 -
   1.218 -  hbox5 = gtk_hbox_new(FALSE, 0);
   1.219 -  gtk_widget_set_name(hbox5, "hbox5");
   1.220 -  gtk_widget_show(hbox5);
   1.221 -  gtk_table_attach(GTK_TABLE(table2), hbox5, 1, 2, 0, 1,
   1.222 -                   (GtkAttachOptions)(GTK_FILL),
   1.223 -                   (GtkAttachOptions)(GTK_FILL), 0, 0);
   1.224 -
   1.225 -  crop_x_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
   1.226 -  crop_x_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_x_spinbutton_adj), 1, 0);
   1.227 -  gtk_widget_set_name(crop_x_spinbutton, "crop_x_spinbutton");
   1.228 -  gtk_widget_show(crop_x_spinbutton);
   1.229 -  gtk_box_pack_start(GTK_BOX(hbox5), crop_x_spinbutton, FALSE, TRUE, 0);
   1.230 -
   1.231 -  hbox6 = gtk_hbox_new(FALSE, 0);
   1.232 -  gtk_widget_set_name(hbox6, "hbox6");
   1.233 -  gtk_widget_show(hbox6);
   1.234 -  gtk_table_attach(GTK_TABLE(table2), hbox6, 1, 2, 1, 2,
   1.235 -                   (GtkAttachOptions)(GTK_FILL),
   1.236 -                   (GtkAttachOptions)(GTK_FILL), 0, 0);
   1.237 -
   1.238 -  crop_y_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
   1.239 -  crop_y_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_y_spinbutton_adj), 1, 0);
   1.240 -  gtk_widget_set_name(crop_y_spinbutton, "crop_y_spinbutton");
   1.241 -  gtk_widget_show(crop_y_spinbutton);
   1.242 -  gtk_box_pack_start(GTK_BOX(hbox6), crop_y_spinbutton, FALSE, TRUE, 0);
   1.243 -
   1.244 -  hbox7 = gtk_hbox_new(FALSE, 0);
   1.245 -  gtk_widget_set_name(hbox7, "hbox7");
   1.246 -  gtk_widget_show(hbox7);
   1.247 -  gtk_table_attach(GTK_TABLE(table2), hbox7, 1, 2, 2, 3,
   1.248 -                   (GtkAttachOptions)(GTK_FILL),
   1.249 -                   (GtkAttachOptions)(GTK_FILL), 0, 0);
   1.250 -
   1.251 -  crop_width_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
   1.252 -  crop_width_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_width_spinbutton_adj), 1, 0);
   1.253 -  gtk_widget_set_name(crop_width_spinbutton, "crop_width_spinbutton");
   1.254 -  gtk_widget_show(crop_width_spinbutton);
   1.255 -  gtk_box_pack_start(GTK_BOX(hbox7), crop_width_spinbutton, FALSE, FALSE, 0);
   1.256 -
   1.257 -  hbox8 = gtk_hbox_new(FALSE, 0);
   1.258 -  gtk_widget_set_name(hbox8, "hbox8");
   1.259 -  gtk_widget_show(hbox8);
   1.260 -  gtk_table_attach(GTK_TABLE(table2), hbox8, 1, 2, 3, 4,
   1.261 -                   (GtkAttachOptions)(GTK_FILL),
   1.262 -                   (GtkAttachOptions)(GTK_FILL), 0, 0);
   1.263 -
   1.264 -  crop_height_spinbutton_adj = gtk_adjustment_new(1, 0, 300, 1, 10, 1);
   1.265 -  crop_height_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(crop_height_spinbutton_adj), 1, 0);
   1.266 -  gtk_widget_set_name(crop_height_spinbutton, "crop_height_spinbutton");
   1.267 -  gtk_widget_show(crop_height_spinbutton);
   1.268 -  gtk_box_pack_start(GTK_BOX(hbox8), crop_height_spinbutton, FALSE, FALSE, 0);
   1.269 -
   1.270 -  vbox4 = gtk_vbox_new(FALSE, 6);
   1.271 -  gtk_widget_set_name(vbox4, "vbox4");
   1.272 -  gtk_widget_show(vbox4);
   1.273 -  gtk_box_pack_start(GTK_BOX(vbox1), vbox4, FALSE, TRUE, 0);
   1.274 -
   1.275 -  label7 = gtk_label_new("<b>Aspect ratio</b>");
   1.276 -  gtk_widget_set_name(label7, "label7");
   1.277 -  gtk_widget_show(label7);
   1.278 -  gtk_box_pack_start(GTK_BOX(vbox4), label7, FALSE, FALSE, 0);
   1.279 -  gtk_label_set_use_markup(GTK_LABEL(label7), TRUE);
   1.280 -  gtk_misc_set_alignment(GTK_MISC(label7), 0, 0.5);
   1.281 -
   1.282 -  hbox3 = gtk_hbox_new(FALSE, 0);
   1.283 -  gtk_widget_set_name(hbox3, "hbox3");
   1.284 -  gtk_widget_show(hbox3);
   1.285 -  gtk_box_pack_start(GTK_BOX(vbox4), hbox3, FALSE, FALSE, 0);
   1.286 -
   1.287 -  label8 = gtk_label_new("    ");
   1.288 -  gtk_widget_set_name(label8, "label8");
   1.289 -  gtk_widget_show(label8);
   1.290 -  gtk_box_pack_start(GTK_BOX(hbox3), label8, FALSE, FALSE, 0);
   1.291 -
   1.292 -  table3 = gtk_table_new(2, 2, FALSE);
   1.293 -  gtk_widget_set_name(table3, "table3");
   1.294 -  gtk_widget_show(table3);
   1.295 -  gtk_box_pack_start(GTK_BOX(hbox3), table3, TRUE, TRUE, 0);
   1.296 -  gtk_table_set_row_spacings(GTK_TABLE(table3), 6);
   1.297 -  gtk_table_set_col_spacings(GTK_TABLE(table3), 6);
   1.298 -
   1.299 -  hbox10 = gtk_hbox_new(FALSE, 6);
   1.300 -  gtk_widget_set_name(hbox10, "hbox10");
   1.301 -  gtk_widget_show(hbox10);
   1.302 -  gtk_table_attach(GTK_TABLE(table3), hbox10, 0, 2, 1, 2,
   1.303 -                   (GtkAttachOptions)(GTK_FILL),
   1.304 -                   (GtkAttachOptions)(GTK_EXPAND | GTK_FILL), 0, 0);
   1.305 -
   1.306 -  custom_ratio_box = gtk_hbox_new(FALSE, 6);
   1.307 -  gtk_widget_set_name(custom_ratio_box, "custom_ratio_box");
   1.308 -  gtk_widget_show(custom_ratio_box);
   1.309 -  gtk_box_pack_start(GTK_BOX(hbox10), custom_ratio_box, TRUE, TRUE, 0);
   1.310 -
   1.311 -  ratio_w_spinbutton_adj = gtk_adjustment_new(1, 1, 9999, 1, 10, 10);
   1.312 -  ratio_w_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(ratio_w_spinbutton_adj), 1, 0);
   1.313 -  gtk_widget_set_name(ratio_w_spinbutton, "ratio_w_spinbutton");
   1.314 -  gtk_widget_show(ratio_w_spinbutton);
   1.315 -  gtk_box_pack_start(GTK_BOX(custom_ratio_box), ratio_w_spinbutton, FALSE, TRUE, 0);
   1.316 -
   1.317 -  ratio_swap_button = gtk_button_new();
   1.318 -  gtk_widget_set_name(ratio_swap_button, "ratio_swap_button");
   1.319 -  gtk_widget_show(ratio_swap_button);
   1.320 -  gtk_box_pack_start(GTK_BOX(custom_ratio_box), ratio_swap_button, FALSE, FALSE, 0);
   1.321 -  gtk_button_set_relief(GTK_BUTTON(ratio_swap_button), GTK_RELIEF_NONE);
   1.322 -
   1.323 -  eventbox1 = gtk_event_box_new();
   1.324 -  gtk_widget_set_name(eventbox1, "eventbox1");
   1.325 -  gtk_widget_show(eventbox1);
   1.326 -  gtk_container_add(GTK_CONTAINER(ratio_swap_button), eventbox1);
   1.327 -
   1.328 -  ratio_swap_image = gtk_image_new_from_stock("gtk-refresh", GTK_ICON_SIZE_BUTTON);
   1.329 -  gtk_widget_set_name(ratio_swap_image, "ratio_swap_image");
   1.330 -  gtk_widget_show(ratio_swap_image);
   1.331 -  gtk_container_add(GTK_CONTAINER(eventbox1), ratio_swap_image);
   1.332 -
   1.333 -  ratio_h_spinbutton_adj = gtk_adjustment_new(1, 1, 9999, 1, 10, 10);
   1.334 -  ratio_h_spinbutton = gtk_spin_button_new(GTK_ADJUSTMENT(ratio_h_spinbutton_adj), 1, 0);
   1.335 -  gtk_widget_set_name(ratio_h_spinbutton, "ratio_h_spinbutton");
   1.336 -  gtk_widget_show(ratio_h_spinbutton);
   1.337 -  gtk_box_pack_start(GTK_BOX(custom_ratio_box), ratio_h_spinbutton, FALSE, TRUE, 0);
   1.338 -  gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(ratio_h_spinbutton), GTK_UPDATE_IF_VALID);
   1.339 -
   1.340 -  ratio_optionmenu = gtk_option_menu_new();
   1.341 -  gtk_widget_set_name(ratio_optionmenu, "ratio_optionmenu");
   1.342 -  gtk_widget_show(ratio_optionmenu);
   1.343 -  gtk_table_attach(GTK_TABLE(table3), ratio_optionmenu, 0, 2, 0, 1,
   1.344 -                   (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0);
   1.345 -
   1.346 -  menu1 = gtk_menu_new();
   1.347 -  gtk_widget_set_name(menu1, "menu1");
   1.348 -
   1.349 -  ratio_none = gtk_menu_item_new_with_mnemonic("None");
   1.350 -  gtk_widget_set_name(ratio_none, "ratio_none");
   1.351 -  gtk_widget_show(ratio_none);
   1.352 -  gtk_container_add(GTK_CONTAINER(menu1), ratio_none);
   1.353 -
   1.354 -  ratio_square = gtk_menu_item_new_with_mnemonic("Square");
   1.355 -  gtk_widget_set_name(ratio_square, "ratio_square");
   1.356 -  gtk_widget_show(ratio_square);
   1.357 -  gtk_container_add(GTK_CONTAINER(menu1), ratio_square);
   1.358 -
   1.359 -  ratio_4x3 = gtk_menu_item_new_with_mnemonic("4 x 3(Book, DVD)");
   1.360 -  gtk_widget_set_name(ratio_4x3, "ratio_4x3");
   1.361 -  gtk_widget_show(ratio_4x3);
   1.362 -  gtk_container_add(GTK_CONTAINER(menu1), ratio_4x3);
   1.363 -
   1.364 -  ratio_3x2 = gtk_menu_item_new_with_mnemonic("4 x 6(Postcard)");
   1.365 -  gtk_widget_set_name(ratio_3x2, "ratio_3x2");
   1.366 -  gtk_widget_show(ratio_3x2);
   1.367 -  gtk_container_add(GTK_CONTAINER(menu1), ratio_3x2);
   1.368 -
   1.369 -  ratio_custom = gtk_menu_item_new_with_mnemonic("Custom");
   1.370 -  gtk_widget_set_name(ratio_custom, "ratio_custom");
   1.371 -  gtk_widget_show(ratio_custom);
   1.372 -  gtk_container_add(GTK_CONTAINER(menu1), ratio_custom);
   1.373 -
   1.374 -  gtk_option_menu_set_menu(GTK_OPTION_MENU(ratio_optionmenu), menu1);
   1.375 -
   1.376 -  vbox5 = gtk_vbox_new(FALSE, 0);
   1.377 -  gtk_widget_set_name(vbox5, "vbox5");
   1.378 -  gtk_widget_show(vbox5);
   1.379 -  gtk_box_pack_start(GTK_BOX(hbox1), vbox5, TRUE, TRUE, 0);
   1.380 -
   1.381    frame1 = gtk_frame_new(NULL);
   1.382    gtk_widget_set_name(frame1, "frame1");
   1.383    gtk_widget_show(frame1);
   1.384 @@ -345,262 +125,14 @@
   1.385    gtk_widget_show(vbox7);
   1.386    gtk_container_add(GTK_CONTAINER(frame1), vbox7);
   1.387  
   1.388 -  nav_container = gtk_hbox_new(FALSE, 0);
   1.389 -  gtk_widget_set_name(nav_container, "nav_container");
   1.390 -  gtk_widget_show(nav_container);
   1.391 -  gtk_box_pack_start(GTK_BOX(vbox7), nav_container, TRUE, TRUE, 0);
   1.392 -
   1.393 -/* image_area */
   1.394 -  image_buffer = gdk_pixbuf_new_from_file(image_filename, NULL);
   1.395 -  image_area = gtk_image_new_from_pixbuf(image_buffer);
   1.396 -
   1.397 -  gtk_widget_set_name(image_area, "image_area");
   1.398 -  gtk_widget_show(image_area);
   1.399 -  gtk_box_pack_start(GTK_BOX(nav_container), image_area, TRUE, TRUE, 0);
   1.400 -
   1.401 -  hbox16 = gtk_hbox_new(FALSE, 6);
   1.402 -  gtk_widget_set_name(hbox16, "hbox16");
   1.403 -  gtk_widget_show(hbox16);
   1.404 -  gtk_box_pack_start(GTK_BOX(vbox7), hbox16, FALSE, TRUE, 0);
   1.405 -
   1.406 -  hbox17 = gtk_hbox_new(FALSE, 0);
   1.407 -  gtk_widget_set_name(hbox17, "hbox17");
   1.408 -  gtk_widget_show(hbox17);
   1.409 -  gtk_box_pack_end(GTK_BOX(hbox16), hbox17, FALSE, TRUE, 0);
   1.410 -
   1.411 -  crop_zoom_in_button = gtk_button_new();
   1.412 -  gtk_widget_set_name(crop_zoom_in_button, "crop_zoom_in_button");
   1.413 -  gtk_widget_show(crop_zoom_in_button);
   1.414 -  gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_in_button, FALSE, FALSE, 0);
   1.415 -  gtk_button_set_relief(GTK_BUTTON(crop_zoom_in_button), GTK_RELIEF_NONE);
   1.416 -
   1.417 -  image2 = gtk_image_new_from_stock("gtk-zoom-in", GTK_ICON_SIZE_BUTTON);
   1.418 -  gtk_widget_set_name(image2, "image2");
   1.419 -  gtk_widget_show(image2);
   1.420 -  gtk_container_add(GTK_CONTAINER(crop_zoom_in_button), image2);
   1.421 -
   1.422 -  crop_zoom_out_button = gtk_button_new();
   1.423 -  gtk_widget_set_name(crop_zoom_out_button, "crop_zoom_out_button");
   1.424 -  gtk_widget_show(crop_zoom_out_button);
   1.425 -  gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_out_button, FALSE, FALSE, 0);
   1.426 -  gtk_button_set_relief(GTK_BUTTON(crop_zoom_out_button), GTK_RELIEF_NONE);
   1.427 -
   1.428 -  image4 = gtk_image_new_from_stock("gtk-zoom-out", GTK_ICON_SIZE_BUTTON);
   1.429 -  gtk_widget_set_name(image4, "image4");
   1.430 -  gtk_widget_show(image4);
   1.431 -  gtk_container_add(GTK_CONTAINER(crop_zoom_out_button), image4);
   1.432 -
   1.433 -  crop_zoom_100_button = gtk_button_new();
   1.434 -  gtk_widget_set_name(crop_zoom_100_button, "crop_zoom_100_button");
   1.435 -  gtk_widget_show(crop_zoom_100_button);
   1.436 -  gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_100_button, FALSE, FALSE, 0);
   1.437 -  gtk_button_set_relief(GTK_BUTTON(crop_zoom_100_button), GTK_RELIEF_NONE);
   1.438 -
   1.439 -  image3 = gtk_image_new_from_stock("gtk-zoom-100", GTK_ICON_SIZE_BUTTON);
   1.440 -  gtk_widget_set_name(image3, "image3");
   1.441 -  gtk_widget_show(image3);
   1.442 -  gtk_container_add(GTK_CONTAINER(crop_zoom_100_button), image3);
   1.443 -
   1.444 -  crop_zoom_fit_button = gtk_button_new();
   1.445 -  gtk_widget_set_name(crop_zoom_fit_button, "crop_zoom_fit_button");
   1.446 -  gtk_widget_show(crop_zoom_fit_button);
   1.447 -  gtk_box_pack_start(GTK_BOX(hbox17), crop_zoom_fit_button, FALSE, FALSE, 0);
   1.448 -  gtk_button_set_relief(GTK_BUTTON(crop_zoom_fit_button), GTK_RELIEF_NONE);
   1.449 -
   1.450 -  image1 = gtk_image_new_from_stock("gtk-zoom-fit", GTK_ICON_SIZE_BUTTON);
   1.451 -  gtk_widget_set_name(image1, "image1");
   1.452 -  gtk_widget_show(image1);
   1.453 -  gtk_container_add(GTK_CONTAINER(crop_zoom_fit_button), image1);
   1.454 -
   1.455 -
   1.456 -
   1.457 -/*
   1.458 -  okay_box = gtk_hbox_new(FALSE, 0);
   1.459 -  gtk_widget_set_name(okay_box, "okay_box");
   1.460 -  gtk_widget_show(okay_box);
   1.461 -  gtk_box_pack_end(GTK_BOX(hbox16), okay_box, FALSE, TRUE, 0);
   1.462 -*/
   1.463 -
   1.464 -	crop_okbutton = gtk_button_new();
   1.465 -	gtk_widget_set_name(crop_okbutton, "crop_okbutton");
   1.466 -	gtk_widget_show(crop_okbutton);
   1.467 -	gtk_box_pack_end(GTK_BOX(dialog_vbox1), crop_okbutton, FALSE, FALSE, 0);
   1.468 -	GTK_WIDGET_SET_FLAGS(crop_okbutton, GTK_CAN_DEFAULT);
   1.469 -
   1.470 -	alignment1 = gtk_alignment_new(0.5, 0.5, 0, 0);
   1.471 -	gtk_widget_set_name(alignment1, "alignment1");
   1.472 -	gtk_widget_show(alignment1);
   1.473 -	gtk_container_add(GTK_CONTAINER(crop_okbutton), alignment1);
   1.474 -
   1.475 -	hbox11 = gtk_hbox_new(FALSE, 2);
   1.476 -	gtk_widget_set_name(hbox11, "hbox11");
   1.477 -	gtk_widget_show(hbox11);
   1.478 -	gtk_container_add(GTK_CONTAINER(alignment1), hbox11);
   1.479 -
   1.480 -	crop_image = gtk_image_new_from_stock("gtk-ok", GTK_ICON_SIZE_BUTTON);
   1.481 -	gtk_widget_set_name(crop_image, "crop_image");
   1.482 -	gtk_widget_show(crop_image);
   1.483 -	gtk_box_pack_start(GTK_BOX(hbox11), crop_image, FALSE, FALSE, 0);
   1.484 -
   1.485 -	label12 = gtk_label_new_with_mnemonic("_Crop");
   1.486 -	gtk_widget_set_name(label12, "label12");
   1.487 -	gtk_widget_show(label12);
   1.488 -	gtk_box_pack_start(GTK_BOX(hbox11), label12, FALSE, FALSE, 0);
   1.489 -
   1.490 -
   1.491 -
   1.492 -
   1.493 -
   1.494 -  g_signal_connect(G_OBJECT(cropper_window), "show",
   1.495 -                    G_CALLBACK(on_cropper_window_create), NULL);
   1.496 -/* destroy */
   1.497 -  g_signal_connect(G_OBJECT(cropper_window), "destroy",
   1.498 -                    G_CALLBACK(on_cropper_window_destroy), NULL);
   1.499 -
   1.500 -
   1.501 -/* crop */
   1.502 -  g_signal_connect(G_OBJECT(crop_okbutton), "clicked",
   1.503 -                    G_CALLBACK(on_crop_clicked), NULL);
   1.504 -
   1.505 -
   1.506 -/* zoom */
   1.507 -	g_signal_connect(G_OBJECT(crop_zoom_in_button), "clicked",
   1.508 -	                 G_CALLBACK(on_zoom_in_button_clicked), NULL);
   1.509 -	g_signal_connect(G_OBJECT(crop_zoom_out_button), "clicked",
   1.510 -	                 G_CALLBACK(on_zoom_out_button_clicked), NULL);
   1.511 -	g_signal_connect(G_OBJECT(crop_zoom_100_button), "clicked",
   1.512 -	                 G_CALLBACK(on_zoom_100_button_clicked), NULL);
   1.513 -	g_signal_connect(G_OBJECT(crop_zoom_fit_button), "clicked",
   1.514 -	                 G_CALLBACK(on_zoom_fit_button_clicked), NULL);
   1.515 -
   1.516 -
   1.517 -/* aspect ratio */
   1.518 -/*
   1.519 -  g_signal_connect(G_OBJECT(ratio_w_spinbutton), "value_changed",
   1.520 -                   G_CALLBACK(on_ratio_w_spinbutton_value_changed), NULL);
   1.521 -  g_signal_connect(G_OBJECT(ratio_swap_button), "clicked",
   1.522 -                   G_CALLBACK(on_ratio_swap_button_clicked), NULL);
   1.523 -  g_signal_connect(G_OBJECT(ratio_h_spinbutton), "value_changed",
   1.524 -                   G_CALLBACK(on_ratio_h_spinbutton_value_changed), NULL);
   1.525 -
   1.526 +g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_x_spinbutton")), "value_changed",
   1.527 +                 G_CALLBACK(selection_x_value_changed_cb), data);
   1.528 +g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_image")), "selection_changed",
   1.529 +                 G_CALLBACK(selection_changed_cb), data);
   1.530 +g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_swap_button")), "clicked",
   1.531 +                 G_CALLBACK(ratio_swap_button_cb), NULL);
   1.532 +g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_optionmenu")), "changed",
   1.533 +                 G_CALLBACK(ratio_optionmenu_changed_cb), NULL);
   1.534    g_signal_connect(G_OBJECT(ratio_none), "activate",
   1.535                     G_CALLBACK(on_ratio_none_activate), NULL);
   1.536 -  g_signal_connect(G_OBJECT(ratio_square), "activate",
   1.537 -                   G_CALLBACK(on_ratio_square_activate), NULL);
   1.538 -  g_signal_connect(G_OBJECT(ratio_4x3), "activate",
   1.539 -                   G_CALLBACK(on_ratio_4x3_activate), NULL);
   1.540 -  g_signal_connect(G_OBJECT(ratio_3x2), "activate",
   1.541 -                   G_CALLBACK(on_ratio_3x2_activate), NULL);
   1.542 -  g_signal_connect(G_OBJECT(ratio_custom), "activate",
   1.543 -                   G_CALLBACK(on_ratio_custom_activate), NULL);
   1.544 -
   1.545 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_optionmenu")), "changed",
   1.546 -                 G_CALLBACK(ratio_optionmenu_changed_cb), NULL);
   1.547 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_w_spinbutton")), "value_changed",
   1.548 -                 G_CALLBACK(ratio_value_changed_cb), NULL);
   1.549 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_h_spinbutton")), "value_changed",
   1.550 -                 G_CALLBACK(ratio_value_changed_cb), NULL);
   1.551 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "ratio_swap_button")), "clicked",
   1.552 -                 G_CALLBACK(ratio_swap_button_cb), NULL);
   1.553  */
   1.554 -
   1.555 -
   1.556 -/* selection */
   1.557 -/*
   1.558 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_x_spinbutton")), "value_changed",
   1.559 -                 G_CALLBACK(selection_x_value_changed_cb), data);
   1.560 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_y_spinbutton")), "value_changed",
   1.561 -                 G_CALLBACK(selection_y_value_changed_cb), data);
   1.562 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_width_spinbutton")), "value_changed",
   1.563 -                 G_CALLBACK(selection_width_value_changed_cb), data);
   1.564 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_height_spinbutton")), "value_changed",
   1.565 -                 G_CALLBACK(selection_height_value_changed_cb), data);
   1.566 -g_signal_connect(G_OBJECT(lookup_widget(cropper_window, "crop_image")), "selection_changed",
   1.567 -                 G_CALLBACK(selection_changed_cb), data);
   1.568 -*/
   1.569 -
   1.570 -
   1.571 -
   1.572 -
   1.573 -
   1.574 -
   1.575 -
   1.576 -
   1.577 -	g_signal_connect(cropper_window, "key-press-event", G_CALLBACK(on_key_press), NULL);
   1.578 -
   1.579 -
   1.580 -
   1.581 -
   1.582 -
   1.583 -
   1.584 -
   1.585 -
   1.586 -
   1.587 -  /* Store pointers to all widgets, for use by lookup_widget(). */
   1.588 -  GLADE_HOOKUP_OBJECT_NO_REF(cropper_window, cropper_window, "cropper_window");
   1.589 -  GLADE_HOOKUP_OBJECT(cropper_window, dialog_vbox1, "dialog_vbox1");
   1.590 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox1, "hbox1");
   1.591 -  GLADE_HOOKUP_OBJECT(cropper_window, vbox1, "vbox1");
   1.592 -  GLADE_HOOKUP_OBJECT(cropper_window, vbox2, "vbox2");
   1.593 -  GLADE_HOOKUP_OBJECT(cropper_window, label1, "label1");
   1.594 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox2, "hbox2");
   1.595 -  GLADE_HOOKUP_OBJECT(cropper_window, label2, "label2");
   1.596 -  GLADE_HOOKUP_OBJECT(cropper_window, table2, "table2");
   1.597 -  GLADE_HOOKUP_OBJECT(cropper_window, label3, "label3");
   1.598 -  GLADE_HOOKUP_OBJECT(cropper_window, label5, "label5");
   1.599 -  GLADE_HOOKUP_OBJECT(cropper_window, label4, "label4");
   1.600 -  GLADE_HOOKUP_OBJECT(cropper_window, label6, "label6");
   1.601 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox5, "hbox5");
   1.602 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_x_spinbutton, "crop_x_spinbutton");
   1.603 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox6, "hbox6");
   1.604 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_y_spinbutton, "crop_y_spinbutton");
   1.605 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox7, "hbox7");
   1.606 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_width_spinbutton, "crop_width_spinbutton");
   1.607 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox8, "hbox8");
   1.608 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_height_spinbutton, "crop_height_spinbutton");
   1.609 -  GLADE_HOOKUP_OBJECT(cropper_window, vbox4, "vbox4");
   1.610 -  GLADE_HOOKUP_OBJECT(cropper_window, label7, "label7");
   1.611 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox3, "hbox3");
   1.612 -  GLADE_HOOKUP_OBJECT(cropper_window, label8, "label8");
   1.613 -  GLADE_HOOKUP_OBJECT(cropper_window, table3, "table3");
   1.614 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox10, "hbox10");
   1.615 -  GLADE_HOOKUP_OBJECT(cropper_window, custom_ratio_box, "custom_ratio_box");
   1.616 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_w_spinbutton, "ratio_w_spinbutton");
   1.617 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_swap_button, "ratio_swap_button");
   1.618 -  GLADE_HOOKUP_OBJECT(cropper_window, eventbox1, "eventbox1");
   1.619 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_swap_image, "ratio_swap_image");
   1.620 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_h_spinbutton, "ratio_h_spinbutton");
   1.621 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_optionmenu, "ratio_optionmenu");
   1.622 -  GLADE_HOOKUP_OBJECT(cropper_window, menu1, "menu1");
   1.623 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_none, "ratio_none");
   1.624 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_square, "ratio_square");
   1.625 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_4x3, "ratio_4x3");
   1.626 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_3x2, "ratio_3x2");
   1.627 -  GLADE_HOOKUP_OBJECT(cropper_window, ratio_custom, "ratio_custom");
   1.628 -  GLADE_HOOKUP_OBJECT(cropper_window, vbox5, "vbox5");
   1.629 -  GLADE_HOOKUP_OBJECT(cropper_window, frame1, "frame1");
   1.630 -  GLADE_HOOKUP_OBJECT(cropper_window, vbox7, "vbox7");
   1.631 -  GLADE_HOOKUP_OBJECT(cropper_window, nav_container, "nav_container");
   1.632 -  GLADE_HOOKUP_OBJECT(cropper_window, image_area, "image_area");
   1.633 -  GLADE_HOOKUP_OBJECT(cropper_window,(GtkWidget*) image_buffer, "image_buffer");
   1.634 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox16, "hbox16");
   1.635 -  GLADE_HOOKUP_OBJECT(cropper_window, hbox17, "hbox17");
   1.636 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_in_button, "crop_zoom_in_button");
   1.637 -  GLADE_HOOKUP_OBJECT(cropper_window, image2, "image2");
   1.638 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_out_button, "crop_zoom_out_button");
   1.639 -  GLADE_HOOKUP_OBJECT(cropper_window, image4, "image4");
   1.640 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_100_button, "crop_zoom_100_button");
   1.641 -  GLADE_HOOKUP_OBJECT(cropper_window, image3, "image3");
   1.642 -  GLADE_HOOKUP_OBJECT(cropper_window, crop_zoom_fit_button, "crop_zoom_fit_button");
   1.643 -  GLADE_HOOKUP_OBJECT(cropper_window, image1, "image1");
   1.644 -	/*GLADE_HOOKUP_OBJECT_NO_REF(cropper_window, dialog_action_area1, "dialog_action_area1"); */
   1.645 -	GLADE_HOOKUP_OBJECT(cropper_window, crop_okbutton, "crop_okbutton");
   1.646 -	GLADE_HOOKUP_OBJECT(cropper_window, alignment1, "alignment1");
   1.647 -	GLADE_HOOKUP_OBJECT(cropper_window, hbox11, "hbox11");
   1.648 -	GLADE_HOOKUP_OBJECT(cropper_window, crop_image, "crop_image");
   1.649 -	GLADE_HOOKUP_OBJECT(cropper_window, label12, "label12");
   1.650 -
   1.651 -
   1.652 -  return cropper_window;
   1.653 -}
   1.654 -