comparison callbacks.c @ 10:5e282003f0c1

minor changes; besser indenting
author meillo@marmaro.de
date Thu, 04 Mar 2010 13:54:17 +0100
parents 7e1cf00de1df
children c18ba4ea1514
comparison
equal deleted inserted replaced
9:7e1cf00de1df 10:5e282003f0c1
5 #include "callbacks.h" 5 #include "callbacks.h"
6 #include "support.h" 6 #include "support.h"
7 7
8 int image_width; 8 int image_width;
9 int image_height; 9 int image_height;
10 float inc = 0.1; 10 float inc = 0.3;
11 /* 11 /*
12 void update_spin_button_ratio(GtkWidget* spinbutton) { 12 void update_spin_button_ratio(GtkWidget* spinbutton) {
13 g_print("ratio change: %f\n", ratio); 13 g_print("ratio change: %f\n", ratio);
14 on_ratio_w_spinbutton_value_changed(spinbutton, NULL); 14 on_ratio_w_spinbutton_value_changed(spinbutton, NULL);
15 } 15 }
167 /* zoom */ 167 /* zoom */
168 void set_zoom() { 168 void set_zoom() {
169 static GdkPixbuf* pixbuf_new; 169 static GdkPixbuf* pixbuf_new;
170 g_object_unref(pixbuf_new); 170 g_object_unref(pixbuf_new);
171 171
172 pixbuf_new = gdk_pixbuf_scale_simple(image_buffer, image_width, image_height, GDK_INTERP_HYPER); 172 pixbuf_new = gdk_pixbuf_scale_simple(image_buffer, image_width, image_height, GDK_INTERP_BILINEAR);
173 gtk_image_set_from_pixbuf((GtkImage*) lookup_widget(cropper_window, "image_area"), pixbuf_new); 173 gtk_image_set_from_pixbuf((GtkImage*) lookup_widget(cropper_window, "image_area"), pixbuf_new);
174 } 174 }
175 175
176 void on_zoom_in_button_clicked(GtkObject* object, gpointer user_data) { 176 void on_zoom_in_button_clicked(GtkObject* object, gpointer user_data) {
177 image_width *= 1 + inc; 177 image_width *= 1 + inc;
225 } 225 }
226 226
227 void on_cropper_window_create(GtkObject* object, gpointer user_data) { 227 void on_cropper_window_create(GtkObject* object, gpointer user_data) {
228 image_width = gdk_pixbuf_get_width(image_buffer); 228 image_width = gdk_pixbuf_get_width(image_buffer);
229 image_height = gdk_pixbuf_get_height(image_buffer); 229 image_height = gdk_pixbuf_get_height(image_buffer);
230
231 /*
232 image_buffer = gdk_pixbuf_new_from_file(image_filename, NULL);
233 image_area = gtk_image_new_from_pixbuf(image_buffer);
234
235 int w, h;
236 GtkWidget* image_a;
237
238 image_a = (GtkWidget*) lookup_widget(cropper_window, "image_area");
239 gdk_drawable_get_size (image_a->window, &w, &h);
240
241 image_width = w - 200;
242 image_height = h - 150;
243 set_zoom();
244 */
230 } 245 }
231 246
232 void on_cropper_window_destroy(GtkObject* object, gpointer user_data) { 247 void on_cropper_window_destroy(GtkObject* object, gpointer user_data) {
233 gtk_main_quit(); 248 gtk_main_quit();
234 } 249 }