cropper

diff interface.c @ 2:e359bea4c8ac

added code for ratio swap; new names for ratio operations; added main.h; some more
author meillo@marmaro.de
date Tue, 04 Dec 2007 23:20:51 +0100
parents 80535e4deaa4
children 2f11ab3e6047
line diff
     1.1 --- a/interface.c	Tue Dec 04 20:23:25 2007 +0100
     1.2 +++ b/interface.c	Tue Dec 04 23:20:51 2007 +0100
     1.3 @@ -62,13 +62,11 @@
     1.4    GtkWidget *ratio_h_spinbutton;
     1.5    GtkWidget *ratio_optionmenu;
     1.6    GtkWidget *menu1;
     1.7 -  GtkWidget *none1;
     1.8 -  GtkWidget *square1;
     1.9 -  GtkWidget *_4x3__book__dvd_1;
    1.10 -  GtkWidget *_4x6__postcard_1;
    1.11 -  GtkWidget *_5x1;
    1.12 -  GtkWidget *_8x1;
    1.13 -  GtkWidget *custom1;
    1.14 +  GtkWidget *ratio_none;
    1.15 +  GtkWidget *ratio_square;
    1.16 +  GtkWidget *ratio_4x3;
    1.17 +  GtkWidget *ratio_3x2;
    1.18 +  GtkWidget *ratio_custom;
    1.19    GtkWidget *vbox5;
    1.20    GtkWidget *frame1;
    1.21    GtkWidget *vbox7;
    1.22 @@ -298,40 +296,30 @@
    1.23    menu1 = gtk_menu_new ();
    1.24    gtk_widget_set_name (menu1, "menu1");
    1.25  
    1.26 -  none1 = gtk_menu_item_new_with_mnemonic ("None");
    1.27 -  gtk_widget_set_name (none1, "none1");
    1.28 -  gtk_widget_show (none1);
    1.29 -  gtk_container_add (GTK_CONTAINER (menu1), none1);
    1.30 +  ratio_none = gtk_menu_item_new_with_mnemonic ("None");
    1.31 +  gtk_widget_set_name (ratio_none, "ratio_none");
    1.32 +  gtk_widget_show (ratio_none);
    1.33 +  gtk_container_add (GTK_CONTAINER (menu1), ratio_none);
    1.34  
    1.35 -  square1 = gtk_menu_item_new_with_mnemonic ("Square");
    1.36 -  gtk_widget_set_name (square1, "square1");
    1.37 -  gtk_widget_show (square1);
    1.38 -  gtk_container_add (GTK_CONTAINER (menu1), square1);
    1.39 +  ratio_square = gtk_menu_item_new_with_mnemonic ("Square");
    1.40 +  gtk_widget_set_name (ratio_square, "ratio_square");
    1.41 +  gtk_widget_show (ratio_square);
    1.42 +  gtk_container_add (GTK_CONTAINER (menu1), ratio_square);
    1.43  
    1.44 -  _4x3__book__dvd_1 = gtk_menu_item_new_with_mnemonic ("4 x 3 (Book, DVD)");
    1.45 -  gtk_widget_set_name (_4x3__book__dvd_1, "_4x3__book__dvd_1");
    1.46 -  gtk_widget_show (_4x3__book__dvd_1);
    1.47 -  gtk_container_add (GTK_CONTAINER (menu1), _4x3__book__dvd_1);
    1.48 +  ratio_4x3 = gtk_menu_item_new_with_mnemonic ("4 x 3 (Book, DVD)");
    1.49 +  gtk_widget_set_name (ratio_4x3, "ratio_4x3");
    1.50 +  gtk_widget_show (ratio_4x3);
    1.51 +  gtk_container_add (GTK_CONTAINER (menu1), ratio_4x3);
    1.52  
    1.53 -  _4x6__postcard_1 = gtk_menu_item_new_with_mnemonic ("4 x 6 (Postcard)");
    1.54 -  gtk_widget_set_name (_4x6__postcard_1, "_4x6__postcard_1");
    1.55 -  gtk_widget_show (_4x6__postcard_1);
    1.56 -  gtk_container_add (GTK_CONTAINER (menu1), _4x6__postcard_1);
    1.57 +  ratio_3x2 = gtk_menu_item_new_with_mnemonic ("4 x 6 (Postcard)");
    1.58 +  gtk_widget_set_name (ratio_3x2, "ratio_3x2");
    1.59 +  gtk_widget_show (ratio_3x2);
    1.60 +  gtk_container_add (GTK_CONTAINER (menu1), ratio_3x2);
    1.61  
    1.62 -  _5x1 = gtk_menu_item_new_with_mnemonic ("5 x 7");
    1.63 -  gtk_widget_set_name (_5x1, "_5x1");
    1.64 -  gtk_widget_show (_5x1);
    1.65 -  gtk_container_add (GTK_CONTAINER (menu1), _5x1);
    1.66 -
    1.67 -  _8x1 = gtk_menu_item_new_with_mnemonic ("8 x 10");
    1.68 -  gtk_widget_set_name (_8x1, "_8x1");
    1.69 -  gtk_widget_show (_8x1);
    1.70 -  gtk_container_add (GTK_CONTAINER (menu1), _8x1);
    1.71 -
    1.72 -  custom1 = gtk_menu_item_new_with_mnemonic ("Custom");
    1.73 -  gtk_widget_set_name (custom1, "custom1");
    1.74 -  gtk_widget_show (custom1);
    1.75 -  gtk_container_add (GTK_CONTAINER (menu1), custom1);
    1.76 +  ratio_custom = gtk_menu_item_new_with_mnemonic ("Custom");
    1.77 +  gtk_widget_set_name (ratio_custom, "ratio_custom");
    1.78 +  gtk_widget_show (ratio_custom);
    1.79 +  gtk_container_add (GTK_CONTAINER (menu1), ratio_custom);
    1.80  
    1.81    gtk_option_menu_set_menu (GTK_OPTION_MENU (ratio_optionmenu), menu1);
    1.82  
    1.83 @@ -411,12 +399,17 @@
    1.84    gtk_container_add (GTK_CONTAINER (crop_zoom_fit_button), image1);
    1.85  
    1.86  
    1.87 +
    1.88 +
    1.89 +
    1.90 +
    1.91    g_signal_connect ((gpointer) cropper_window, "delete_event",
    1.92                      G_CALLBACK (on_cropper_window_delete_event),
    1.93                      NULL);
    1.94    g_signal_connect ((gpointer) cropper_window, "destroy",
    1.95                      G_CALLBACK (on_cropper_window_destroy),
    1.96                      NULL);
    1.97 +
    1.98    g_signal_connect ((gpointer) ratio_w_spinbutton, "value_changed",
    1.99                      G_CALLBACK (on_ratio_w_spinbutton_value_changed),
   1.100                      NULL);
   1.101 @@ -432,27 +425,23 @@
   1.102    g_signal_connect ((gpointer) ratio_h_spinbutton, "value_changed",
   1.103                      G_CALLBACK (on_ratio_h_spinbutton_value_changed),
   1.104                      NULL);
   1.105 -  g_signal_connect ((gpointer) none1, "activate",
   1.106 -                    G_CALLBACK (on_none1_activate),
   1.107 +
   1.108 +  g_signal_connect ((gpointer) ratio_none, "activate",
   1.109 +                    G_CALLBACK (on_ratio_none_activate),
   1.110                      NULL);
   1.111 -  g_signal_connect ((gpointer) square1, "activate",
   1.112 -                    G_CALLBACK (on_square1_activate),
   1.113 +  g_signal_connect ((gpointer) ratio_square, "activate",
   1.114 +                    G_CALLBACK (on_ratio_square_activate),
   1.115                      NULL);
   1.116 -  g_signal_connect ((gpointer) _4x3__book__dvd_1, "activate",
   1.117 -                    G_CALLBACK (on_4x3__book__dvd_1_activate),
   1.118 +  g_signal_connect ((gpointer) ratio_4x3, "activate",
   1.119 +                    G_CALLBACK (on_ratio_4x3_activate),
   1.120                      NULL);
   1.121 -  g_signal_connect ((gpointer) _4x6__postcard_1, "activate",
   1.122 -                    G_CALLBACK (on_4x6__postcard_1_activate),
   1.123 +  g_signal_connect ((gpointer) ratio_3x2, "activate",
   1.124 +                    G_CALLBACK (on_ratio_3x2_activate),
   1.125                      NULL);
   1.126 -  g_signal_connect ((gpointer) _5x1, "activate",
   1.127 -                    G_CALLBACK (on_5x1_activate),
   1.128 +  g_signal_connect ((gpointer) ratio_custom, "activate",
   1.129 +                    G_CALLBACK (on_ratio_custom_activate),
   1.130                      NULL);
   1.131 -  g_signal_connect ((gpointer) _8x1, "activate",
   1.132 -                    G_CALLBACK (on_8x1_activate),
   1.133 -                    NULL);
   1.134 -  g_signal_connect ((gpointer) custom1, "activate",
   1.135 -                    G_CALLBACK (on_custom1_activate),
   1.136 -                    NULL);
   1.137 +
   1.138  
   1.139    /* Store pointers to all widgets, for use by lookup_widget(). */
   1.140    GLADE_HOOKUP_OBJECT_NO_REF (cropper_window, cropper_window, "cropper_window");
   1.141 @@ -490,13 +479,11 @@
   1.142    GLADE_HOOKUP_OBJECT (cropper_window, ratio_h_spinbutton, "ratio_h_spinbutton");
   1.143    GLADE_HOOKUP_OBJECT (cropper_window, ratio_optionmenu, "ratio_optionmenu");
   1.144    GLADE_HOOKUP_OBJECT (cropper_window, menu1, "menu1");
   1.145 -  GLADE_HOOKUP_OBJECT (cropper_window, none1, "none1");
   1.146 -  GLADE_HOOKUP_OBJECT (cropper_window, square1, "square1");
   1.147 -  GLADE_HOOKUP_OBJECT (cropper_window, _4x3__book__dvd_1, "_4x3__book__dvd_1");
   1.148 -  GLADE_HOOKUP_OBJECT (cropper_window, _4x6__postcard_1, "_4x6__postcard_1");
   1.149 -  GLADE_HOOKUP_OBJECT (cropper_window, _5x1, "_5x1");
   1.150 -  GLADE_HOOKUP_OBJECT (cropper_window, _8x1, "_8x1");
   1.151 -  GLADE_HOOKUP_OBJECT (cropper_window, custom1, "custom1");
   1.152 +  GLADE_HOOKUP_OBJECT (cropper_window, ratio_none, "ratio_none");
   1.153 +  GLADE_HOOKUP_OBJECT (cropper_window, ratio_square, "ratio_square");
   1.154 +  GLADE_HOOKUP_OBJECT (cropper_window, ratio_4x3, "ratio_4x3");
   1.155 +  GLADE_HOOKUP_OBJECT (cropper_window, ratio_3x2, "ratio_3x2");
   1.156 +  GLADE_HOOKUP_OBJECT (cropper_window, ratio_custom, "ratio_custom");
   1.157    GLADE_HOOKUP_OBJECT (cropper_window, vbox5, "vbox5");
   1.158    GLADE_HOOKUP_OBJECT (cropper_window, frame1, "frame1");
   1.159    GLADE_HOOKUP_OBJECT (cropper_window, vbox7, "vbox7");