Mercurial > cropper
comparison callbacks.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 |
comparison
equal
deleted
inserted
replaced
13:13bc21684b8a | 14:da18f2d4f92f |
---|---|
145 | 145 |
146 gth_image_selector_set_ratio(GTH_IMAGE_SELECTOR(lookup_widget(cropper_window, | 146 gth_image_selector_set_ratio(GTH_IMAGE_SELECTOR(lookup_widget(cropper_window, |
147 "crop_image")), TRUE, (double) h / w); | 147 "crop_image")), TRUE, (double) h / w); |
148 } | 148 } |
149 | 149 |
150 */ | 150 |
151 | 151 |
152 | 152 |
153 | 153 |
154 | 154 |
155 | 155 |
156 | 156 |
157 | |
158 | |
159 /* | |
160 void | 157 void |
161 on_ratio_w_spinbutton_value_changed(GtkSpinButton* spinbutton, gpointer user_data) | 158 on_ratio_w_spinbutton_value_changed(GtkSpinButton* spinbutton, gpointer user_data) |
162 { | 159 { |
163 g_print("spinbutton W - ratio: %f\n", ratio); | 160 g_print("spinbutton W - ratio: %f\n", ratio); |
164 gtk_spin_button_set_value(lookup_widget(cropper_window, "ratio_h_spinbutton"), | 161 gtk_spin_button_set_value(lookup_widget(cropper_window, "ratio_h_spinbutton"), |
266 | 263 |
267 | 264 |
268 | 265 |
269 | 266 |
270 void | 267 void |
271 on_crop_clicked(GtkButton* button, gpointer user_data) | 268 crop(void) |
272 { | 269 { |
273 char crop_call[256]; | 270 char crop_call[256]; |
274 | 271 |
275 sprintf(crop_call, "echo \"convert -crop %ix%i+%i+%i %s cropped_%s\"", | 272 sprintf(crop_call, "echo \"convert -crop %ix%i+%i+%i %s cropped_%s\"", |
276 gtk_spin_button_get_value_as_int((GtkSpinButton*) lookup_widget(cropper_window, | 273 gtk_spin_button_get_value_as_int((GtkSpinButton*) lookup_widget(cropper_window, |
325 { | 322 { |
326 if (pKey->type != GDK_KEY_PRESS) { | 323 if (pKey->type != GDK_KEY_PRESS) { |
327 return FALSE; | 324 return FALSE; |
328 } | 325 } |
329 switch (pKey->keyval) { | 326 switch (pKey->keyval) { |
327 case GDK_q: | |
328 gtk_main_quit(); | |
329 break; | |
330 case GDK_Return: | |
331 crop(); | |
332 break; | |
330 case GDK_plus: | 333 case GDK_plus: |
331 on_zoom_in_button_clicked(NULL, userdata); | 334 on_zoom_in_button_clicked(NULL, userdata); |
332 break; | 335 break; |
333 case GDK_minus: | 336 case GDK_minus: |
334 on_zoom_out_button_clicked(NULL, userdata); | 337 on_zoom_out_button_clicked(NULL, userdata); |