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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
1 #include <gtk/gtk.h>
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
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
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
4 #include "callbacks.h"
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
5 #include "interface.h"
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
6 #include "support.h"
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
7
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
8
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
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
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
17 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
18
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
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
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
22 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
23
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
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
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
31
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
32 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
33
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
34
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
35
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
36
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
37
1
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
38 void on_ratio_w_spinbutton_value_changed (GtkSpinButton* spinbutton, gpointer user_data) {
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
39
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
40 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
41
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
42
1
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
43 void on_ratio_w_spinbutton_change_value (GtkSpinButton* spinbutton, GtkScrollType scroll, gpointer user_data) {
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
44
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
45 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
46
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
47
1
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
48 void on_ratio_h_spinbutton_change_value (GtkSpinButton* spinbutton, GtkScrollType scroll, gpointer user_data) {
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
49
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
50 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
51
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
52
1
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
53 void on_ratio_h_spinbutton_value_changed (GtkSpinButton* spinbutton, gpointer user_data) {
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
54
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
55 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
56
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
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
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
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
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
72 return FALSE;
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
73 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
74
1
80535e4deaa4 nicer code formating
meillo@marmaro.de
parents: 0
diff changeset
75 void on_cropper_window_destroy (GtkObject* object, gpointer user_data) {
0
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
76 gtk_main_quit();
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
77 }
ca9155129253 initial commit
meillo@marmaro.de
parents:
diff changeset
78