cropper

diff interface.c @ 4:2f11ab3e6047

added option handling; added output for convert; commented all ratio code cause it is not really important now
author meillo@marmaro.de
date Fri, 07 Dec 2007 17:40:08 +0100
parents e359bea4c8ac
children 61e5a1727231
line diff
     1.1 --- a/interface.c	Wed Dec 05 00:08:39 2007 +0100
     1.2 +++ b/interface.c	Fri Dec 07 17:40:08 2007 +0100
     1.3 @@ -81,6 +81,13 @@
     1.4    GtkWidget *image3;
     1.5    GtkWidget *crop_zoom_fit_button;
     1.6    GtkWidget *image1;
     1.7 +	GtkWidget *dialog_action_area1;
     1.8 +	GtkWidget *crop_okbutton;
     1.9 +	GtkWidget *alignment1;
    1.10 +	GtkWidget *hbox11;
    1.11 +	GtkWidget *crop_image;
    1.12 +	GtkWidget *label12;
    1.13 +
    1.14  
    1.15    cropper_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    1.16    gtk_widget_set_name (cropper_window, "cropper_window");
    1.17 @@ -400,48 +407,148 @@
    1.18  
    1.19  
    1.20  
    1.21 +/*
    1.22 +  okay_box = gtk_hbox_new (FALSE, 0);
    1.23 +  gtk_widget_set_name (okay_box, "okay_box");
    1.24 +  gtk_widget_show (okay_box);
    1.25 +  gtk_box_pack_end (GTK_BOX (hbox16), okay_box, FALSE, TRUE, 0);
    1.26 +*/
    1.27  
    1.28 +	crop_okbutton = gtk_button_new (); 
    1.29 +	gtk_widget_set_name (crop_okbutton, "crop_okbutton"); 
    1.30 +	gtk_widget_show (crop_okbutton); 
    1.31 +	gtk_box_pack_end (GTK_BOX (dialog_vbox1), crop_okbutton, FALSE, FALSE, 0); 
    1.32 +	GTK_WIDGET_SET_FLAGS (crop_okbutton, GTK_CAN_DEFAULT); 
    1.33  
    1.34 +	alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0); 
    1.35 +	gtk_widget_set_name (alignment1, "alignment1"); 
    1.36 +	gtk_widget_show (alignment1); 
    1.37 +	gtk_container_add (GTK_CONTAINER (crop_okbutton), alignment1); 
    1.38  
    1.39 -  g_signal_connect ((gpointer) cropper_window, "delete_event",
    1.40 -                    G_CALLBACK (on_cropper_window_delete_event),
    1.41 -                    NULL);
    1.42 -  g_signal_connect ((gpointer) cropper_window, "destroy",
    1.43 +	hbox11 = gtk_hbox_new (FALSE, 2); 
    1.44 +	gtk_widget_set_name (hbox11, "hbox11"); 
    1.45 +	gtk_widget_show (hbox11); 
    1.46 +	gtk_container_add (GTK_CONTAINER (alignment1), hbox11); 
    1.47 +
    1.48 +	crop_image = gtk_image_new_from_stock ("gtk-ok", GTK_ICON_SIZE_BUTTON); 
    1.49 +	gtk_widget_set_name (crop_image, "crop_image"); 
    1.50 +	gtk_widget_show (crop_image); 
    1.51 +	gtk_box_pack_start (GTK_BOX (hbox11), crop_image, FALSE, FALSE, 0); 
    1.52 +
    1.53 +	label12 = gtk_label_new_with_mnemonic ("_Crop"); 
    1.54 +	gtk_widget_set_name (label12, "label12"); 
    1.55 +	gtk_widget_show (label12); 
    1.56 +	gtk_box_pack_start (GTK_BOX (hbox11), label12, FALSE, FALSE, 0); 
    1.57 +
    1.58 +
    1.59 +
    1.60 +
    1.61 +
    1.62 +/* destroy */
    1.63 +  g_signal_connect (G_OBJECT (cropper_window), "destroy",
    1.64                      G_CALLBACK (on_cropper_window_destroy),
    1.65                      NULL);
    1.66  
    1.67 -  g_signal_connect ((gpointer) ratio_w_spinbutton, "value_changed",
    1.68 +
    1.69 +/* crop */
    1.70 +  g_signal_connect (G_OBJECT (crop_okbutton), "clicked",
    1.71 +                    G_CALLBACK (on_crop_clicked),
    1.72 +                    NULL);
    1.73 +
    1.74 +
    1.75 +
    1.76 +/* aspect ratio */
    1.77 +/*
    1.78 +  g_signal_connect (G_OBJECT (ratio_w_spinbutton), "value_changed",
    1.79                      G_CALLBACK (on_ratio_w_spinbutton_value_changed),
    1.80                      NULL);
    1.81 -  g_signal_connect ((gpointer) ratio_w_spinbutton, "change_value",
    1.82 -                    G_CALLBACK (on_ratio_w_spinbutton_change_value),
    1.83 -                    NULL);
    1.84 -  g_signal_connect ((gpointer) ratio_swap_button, "clicked",
    1.85 +  g_signal_connect (G_OBJECT (ratio_swap_button), "clicked",
    1.86                      G_CALLBACK (on_ratio_swap_button_clicked),
    1.87                      NULL);
    1.88 -  g_signal_connect ((gpointer) ratio_h_spinbutton, "change_value",
    1.89 -                    G_CALLBACK (on_ratio_h_spinbutton_change_value),
    1.90 -                    NULL);
    1.91 -  g_signal_connect ((gpointer) ratio_h_spinbutton, "value_changed",
    1.92 +  g_signal_connect (G_OBJECT (ratio_h_spinbutton), "value_changed",
    1.93                      G_CALLBACK (on_ratio_h_spinbutton_value_changed),
    1.94                      NULL);
    1.95  
    1.96 -  g_signal_connect ((gpointer) ratio_none, "activate",
    1.97 +  g_signal_connect (G_OBJECT (ratio_none), "activate",
    1.98                      G_CALLBACK (on_ratio_none_activate),
    1.99                      NULL);
   1.100 -  g_signal_connect ((gpointer) ratio_square, "activate",
   1.101 +  g_signal_connect (G_OBJECT (ratio_square), "activate",
   1.102                      G_CALLBACK (on_ratio_square_activate),
   1.103                      NULL);
   1.104 -  g_signal_connect ((gpointer) ratio_4x3, "activate",
   1.105 +  g_signal_connect (G_OBJECT (ratio_4x3), "activate",
   1.106                      G_CALLBACK (on_ratio_4x3_activate),
   1.107                      NULL);
   1.108 -  g_signal_connect ((gpointer) ratio_3x2, "activate",
   1.109 +  g_signal_connect (G_OBJECT (ratio_3x2), "activate",
   1.110                      G_CALLBACK (on_ratio_3x2_activate),
   1.111                      NULL);
   1.112 -  g_signal_connect ((gpointer) ratio_custom, "activate",
   1.113 +  g_signal_connect (G_OBJECT (ratio_custom), "activate",
   1.114                      G_CALLBACK (on_ratio_custom_activate),
   1.115                      NULL);
   1.116  
   1.117 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "ratio_optionmenu")), "changed",
   1.118 +	G_CALLBACK (ratio_optionmenu_changed_cb),
   1.119 +	NULL);
   1.120 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "ratio_w_spinbutton")), "value_changed",
   1.121 +	G_CALLBACK (ratio_value_changed_cb),
   1.122 +	NULL);
   1.123 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "ratio_h_spinbutton")), "value_changed",
   1.124 +	G_CALLBACK (ratio_value_changed_cb),
   1.125 +	NULL);
   1.126 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "ratio_swap_button")), "clicked",
   1.127 +	G_CALLBACK (ratio_swap_button_cb),
   1.128 +	NULL);
   1.129 +*/
   1.130 +
   1.131 +
   1.132 +/* selection */
   1.133 +/*
   1.134 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "crop_x_spinbutton")), "value_changed",
   1.135 +	G_CALLBACK (selection_x_value_changed_cb),
   1.136 +	data);
   1.137 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "crop_y_spinbutton")), "value_changed",
   1.138 +	G_CALLBACK (selection_y_value_changed_cb),
   1.139 +	data);
   1.140 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "crop_width_spinbutton")), "value_changed",
   1.141 +	G_CALLBACK (selection_width_value_changed_cb),
   1.142 +	data);
   1.143 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "crop_height_spinbutton")), "value_changed",
   1.144 +	G_CALLBACK (selection_height_value_changed_cb),
   1.145 +	data);
   1.146 +g_signal_connect (G_OBJECT (lookup_widget(cropper_window, "crop_image")), "selection_changed",
   1.147 +	G_CALLBACK (selection_changed_cb),
   1.148 +	data);
   1.149 +*/
   1.150 +
   1.151 +
   1.152 +/* zoom */
   1.153 +/*
   1.154 +g_signal_connect (G_OBJECT (zoom_in_button), "clicked",
   1.155 +	G_CALLBACK (zoom_in_button_clicked_cb),
   1.156 +	data);
   1.157 +g_signal_connect (G_OBJECT (zoom_out_button), "clicked",
   1.158 +	G_CALLBACK (zoom_out_button_clicked_cb),
   1.159 +	data);
   1.160 +g_signal_connect (G_OBJECT (zoom_100_button), "clicked",
   1.161 +	G_CALLBACK (zoom_100_button_clicked_cb),
   1.162 +	data);
   1.163 +g_signal_connect (G_OBJECT (zoom_fit_button), "clicked",
   1.164 +	G_CALLBACK (zoom_fit_button_clicked_cb),
   1.165 +	data);
   1.166 +*/
   1.167 +
   1.168 +
   1.169 +
   1.170 +
   1.171 +
   1.172 +
   1.173 +
   1.174 +
   1.175 +
   1.176 +
   1.177 +
   1.178 +
   1.179 +
   1.180 +
   1.181  
   1.182    /* Store pointers to all widgets, for use by lookup_widget(). */
   1.183    GLADE_HOOKUP_OBJECT_NO_REF (cropper_window, cropper_window, "cropper_window");
   1.184 @@ -498,6 +605,13 @@
   1.185    GLADE_HOOKUP_OBJECT (cropper_window, image3, "image3");
   1.186    GLADE_HOOKUP_OBJECT (cropper_window, crop_zoom_fit_button, "crop_zoom_fit_button");
   1.187    GLADE_HOOKUP_OBJECT (cropper_window, image1, "image1");
   1.188 +	/*GLADE_HOOKUP_OBJECT_NO_REF (cropper_window, dialog_action_area1, "dialog_action_area1"); */
   1.189 +	GLADE_HOOKUP_OBJECT (cropper_window, crop_okbutton, "crop_okbutton"); 
   1.190 +	GLADE_HOOKUP_OBJECT (cropper_window, alignment1, "alignment1");
   1.191 +	GLADE_HOOKUP_OBJECT (cropper_window, hbox11, "hbox11");
   1.192 +	GLADE_HOOKUP_OBJECT (cropper_window, crop_image, "crop_image");
   1.193 +	GLADE_HOOKUP_OBJECT (cropper_window, label12, "label12");
   1.194 +
   1.195  
   1.196    return cropper_window;
   1.197  }