cropper

view callbacks.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 6aaba3a61563
line source
1 #include <gtk/gtk.h>
3 #include "main.h"
4 #include "callbacks.h"
5 #include "interface.h"
6 #include "support.h"
10 void on_ratio_none_activate (GtkMenuItem* menuitem, gpointer user_data) {
11 ratio = 0;
12 }
15 void on_ratio_square_activate (GtkMenuItem* menuitem, gpointer user_data) {
16 ratio = 1;
17 }
20 void on_ratio_4x3_activate (GtkMenuItem* menuitem, gpointer user_data) {
21 ratio = 4/3;
22 }
25 void on_ratio_3x2_activate (GtkMenuItem* menuitem, gpointer user_data) {
26 ratio = 3/2;
27 }
30 void on_ratio_custom_activate (GtkMenuItem* menuitem, gpointer user_data) {
32 }
38 void on_ratio_w_spinbutton_value_changed (GtkSpinButton* spinbutton, gpointer user_data) {
40 }
43 void on_ratio_w_spinbutton_change_value (GtkSpinButton* spinbutton, GtkScrollType scroll, gpointer user_data) {
45 }
48 void on_ratio_h_spinbutton_change_value (GtkSpinButton* spinbutton, GtkScrollType scroll, gpointer user_data) {
50 }
53 void on_ratio_h_spinbutton_value_changed (GtkSpinButton* spinbutton, gpointer user_data) {
55 }
58 void on_ratio_swap_button_clicked (GtkButton* button, gpointer user_data) {
59 gint h;
61 h = gtk_spin_button_get_value_as_int(lookup_widget(cropper_window, "ratio_w_spinbutton"));
62 gtk_spin_button_set_value(lookup_widget(cropper_window, "ratio_w_spinbutton"), gtk_spin_button_get_value(lookup_widget(cropper_window, "ratio_h_spinbutton")));
63 gtk_spin_button_set_value(lookup_widget(cropper_window, "ratio_h_spinbutton"), h);
64 }
70 gboolean on_cropper_window_delete_event (GtkWidget* widget, GdkEvent *event, gpointer user_data) {
71 /* g_print("thanks for using the program - visit http://prog.marmaro.de\n"); */
72 return FALSE;
73 }
75 void on_cropper_window_destroy (GtkObject* object, gpointer user_data) {
76 gtk_main_quit();
77 }