Mercurial > cropper
annotate 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 |
rev | line source |
---|---|
0 | 1 #include <gtk/gtk.h> |
2 | |
2
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
3 #include "main.h" |
0 | 4 #include "callbacks.h" |
5 #include "interface.h" | |
6 #include "support.h" | |
7 | |
8 | |
9 | |
2
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
10 void on_ratio_none_activate (GtkMenuItem* menuitem, gpointer user_data) { |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
11 ratio = 0; |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
12 } |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
13 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
14 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
15 void on_ratio_square_activate (GtkMenuItem* menuitem, gpointer user_data) { |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
16 ratio = 1; |
0 | 17 } |
18 | |
19 | |
2
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
20 void on_ratio_4x3_activate (GtkMenuItem* menuitem, gpointer user_data) { |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
21 ratio = 4/3; |
0 | 22 } |
23 | |
24 | |
2
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
25 void on_ratio_3x2_activate (GtkMenuItem* menuitem, gpointer user_data) { |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
26 ratio = 3/2; |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
27 } |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
28 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
29 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
30 void on_ratio_custom_activate (GtkMenuItem* menuitem, gpointer user_data) { |
0 | 31 |
32 } | |
33 | |
34 | |
35 | |
36 | |
37 | |
1 | 38 void on_ratio_w_spinbutton_value_changed (GtkSpinButton* spinbutton, gpointer user_data) { |
0 | 39 |
40 } | |
41 | |
42 | |
1 | 43 void on_ratio_w_spinbutton_change_value (GtkSpinButton* spinbutton, GtkScrollType scroll, gpointer user_data) { |
0 | 44 |
45 } | |
46 | |
47 | |
1 | 48 void on_ratio_h_spinbutton_change_value (GtkSpinButton* spinbutton, GtkScrollType scroll, gpointer user_data) { |
0 | 49 |
50 } | |
51 | |
52 | |
1 | 53 void on_ratio_h_spinbutton_value_changed (GtkSpinButton* spinbutton, gpointer user_data) { |
0 | 54 |
55 } | |
56 | |
57 | |
2
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
58 void on_ratio_swap_button_clicked (GtkButton* button, gpointer user_data) { |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
59 gint h; |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
60 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
61 h = gtk_spin_button_get_value_as_int(lookup_widget(cropper_window, "ratio_w_spinbutton")); |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
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"))); |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
63 gtk_spin_button_set_value(lookup_widget(cropper_window, "ratio_h_spinbutton"), h); |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
64 } |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
65 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
66 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
67 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
68 |
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
69 |
1 | 70 gboolean on_cropper_window_delete_event (GtkWidget* widget, GdkEvent *event, gpointer user_data) { |
2
e359bea4c8ac
added code for ratio swap; new names for ratio operations; added main.h; some more
meillo@marmaro.de
parents:
1
diff
changeset
|
71 /* g_print("thanks for using the program - visit http://prog.marmaro.de\n"); */ |
1 | 72 return FALSE; |
0 | 73 } |
74 | |
1 | 75 void on_cropper_window_destroy (GtkObject* object, gpointer user_data) { |
0 | 76 gtk_main_quit(); |
77 } | |
78 |