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