1 diff -ur refocus-0.9.0/configure.in refocus-0.9.0-patched/configure.in
2 --- refocus-0.9.0/configure.in 2010-07-04 16:33:24.307364434 +0200
3 +++ refocus-0.9.0-patched/configure.in 2010-07-04 16:34:09.679615391 +0200
5 AC_DEFINE(PREVIEW_DEBUG)
8 -# If we have gcc set the CFLAGS
9 -# This is done here because otherwise configure would use
10 -# these flags for compiling test-programs.
11 -if test "$GCC" = yes; then
12 - CFLAGS="-Wall -ansi -pedantic -ggdb -fomit-frame-pointer -O3 -funroll-all-loops"
15 #Check if erf is defined in the mathlibrary
16 AC_CHECK_LIB(m, erf, AC_DEFINE(HAVE_ERF))
18 diff -ur refocus-0.9.0/src/gimppreview.c refocus-0.9.0-patched/src/gimppreview.c
19 --- refocus-0.9.0/src/gimppreview.c 2010-07-04 16:33:24.310366565 +0200
20 +++ refocus-0.9.0-patched/src/gimppreview.c 2010-07-04 16:42:46.016366709 +0200
22 #include "gimppreview.h"
25 -static void gimp_preview_init (GimpPreview * preview);
26 -static void gimp_preview_class_init (GimpPreviewClass * klass);
27 +static void gimp_preview_init (myGimpPreview * preview);
28 +static void gimp_preview_class_init (myGimpPreviewClass * klass);
30 static void gimp_preview_plus_callback (GtkWidget * widget, gpointer data);
31 static void gimp_preview_minus_callback (GtkWidget * widget, gpointer data);
32 static gint gimp_preview_event (GtkWidget * widget, GdkEvent * event,
34 -static void gimp_preview_recompute_sizes (GimpPreview * preview,
35 +static void gimp_preview_recompute_sizes (myGimpPreview * preview,
37 -static void gimp_preview_update_preview (GimpPreview * preview);
38 +static void gimp_preview_update_preview (myGimpPreview * preview);
40 -static void gimp_preview_image_set_size (GimpPreview * preview, gint width,
41 +static void gimp_preview_image_set_size (myGimpPreview * preview, gint width,
43 static void gimp_preview_size_request (GtkWidget * widget,
44 GtkRequisition * requisition);
47 gpointer callback_data);
48 gboolean gimp_preview_update_preview_idle_fun (gpointer data);
49 -void gimp_preview_schedule_update (GimpPreview * preview);
50 +void gimp_preview_schedule_update (myGimpPreview * preview);
52 #define PROGRESS_BAR_HEIGHT (10)
53 #define PREVIEW_SIZE (100)
58 - * Apps which use a GimpPreview widget should not be accessing the private
59 + * Apps which use a myGimpPreview widget should not be accessing the private
62 #define PREVIEW_DATA(preview) \
63 - ((GimpPreviewData*)(GIMP_PREVIEW (preview)->private_data))
64 + ((myGimpPreviewData*)(MY_GIMP_PREVIEW (preview)->private_data))
70 GtkWidget *progress_bar;
76 /* Convert coordinate in preview space to image coordinates */
80 GTypeInfo preview_info = {
81 - sizeof (GimpPreviewClass),
82 + sizeof (myGimpPreviewClass),
84 (GBaseFinalizeFunc) NULL,
85 (GClassInitFunc) gimp_preview_class_init,
86 (GClassFinalizeFunc) NULL,
87 (gconstpointer) NULL, /* class_data */
88 - sizeof (GimpPreview),
89 + sizeof (myGimpPreview),
91 (GInstanceInitFunc) gimp_preview_init,
92 (GTypeValueTable *) NULL /* value_table */
96 - g_type_register_static (GTK_TYPE_CONTAINER, "GimpPreview",
97 + g_type_register_static (GTK_TYPE_CONTAINER, "myGimpPreview",
102 * by GTK's internal mechanisms.
105 -gimp_preview_class_init (GimpPreviewClass * klass)
106 +gimp_preview_class_init (myGimpPreviewClass * klass)
108 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
109 GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
111 g_signal_new ("update_preview",
112 G_TYPE_FROM_CLASS (klass),
114 - G_STRUCT_OFFSET (GimpPreviewClass, update_preview),
115 + G_STRUCT_OFFSET (myGimpPreviewClass, update_preview),
118 g_cclosure_marshal_VOID__POINTER,
120 g_signal_new ("preview_changed",
121 G_TYPE_FROM_CLASS (klass),
123 - G_STRUCT_OFFSET (GimpPreviewClass, preview_changed),
124 + G_STRUCT_OFFSET (myGimpPreviewClass, preview_changed),
125 NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
127 klass->update_preview = NULL;
132 -gimp_preview_set_scale_amount(GimpPreview *preview, gdouble scale_amount)
133 +gimp_preview_set_scale_amount(myGimpPreview *preview, gdouble scale_amount)
136 * If the caller wants to set the scale amount, let them do so.
138 * by GTK's internal mechanisms.
141 -gimp_preview_init (GimpPreview * preview)
142 +gimp_preview_init (myGimpPreview * preview)
147 GTK_WIDGET_SET_FLAGS (preview, GTK_NO_WINDOW);
148 GTK_CONTAINER (preview)->resize_mode = GTK_RESIZE_IMMEDIATE;
150 - preview->private_data = g_malloc0 (sizeof (GimpPreviewData));
151 + preview->private_data = g_malloc0 (sizeof (myGimpPreviewData));
154 PREVIEW_DATA (preview)->label = gtk_label_new ("");
156 gimp_preview_new_with_args (GimpDrawable * drawable, gint cb_preview_size,
157 gdouble cb_scale_amount, gint cb_allow_scale)
159 - GimpPreview *preview;
160 + myGimpPreview *preview;
163 GtkWidget *event_box;
167 /* Now allocate the actual preview window. */
168 - preview = GIMP_PREVIEW (g_object_new (gimp_preview_get_type (), NULL));
169 + preview = MY_GIMP_PREVIEW (g_object_new (gimp_preview_get_type (), NULL));
171 /* Set the scale amount. */
172 gimp_preview_set_scale_amount(preview, cb_scale_amount);
174 preview_width = i2p (drawable->width, preview->scale);
175 preview_height = i2p (drawable->height, preview->scale);
177 - GIMP_PREVIEW (preview)->width = preview_width;
178 - GIMP_PREVIEW (preview)->height = preview_height;
179 + MY_GIMP_PREVIEW (preview)->width = preview_width;
180 + MY_GIMP_PREVIEW (preview)->height = preview_height;
186 gimp_preview_size_request (GtkWidget * widget, GtkRequisition * requisition)
188 - GimpPreview *preview = GIMP_PREVIEW (widget);
189 + myGimpPreview *preview = MY_GIMP_PREVIEW (widget);
190 GtkRequisition resize_box_requisition;
195 gimp_preview_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
197 - GimpPreview *preview = GIMP_PREVIEW (widget);
198 + myGimpPreview *preview = MY_GIMP_PREVIEW (widget);
199 GtkAllocation resize_box_allocation, progress_bar_allocation,
200 event_box_allocation;
201 GtkRequisition resize_box_requisition;
203 gboolean include_internals,
204 GtkCallback callback, gpointer callback_data)
206 - GimpPreview *preview = GIMP_PREVIEW (container);
207 + myGimpPreview *preview = MY_GIMP_PREVIEW (container);
209 if (PREVIEW_DATA (preview)->resize_box)
212 * Plug-ins call this to do an update of the preview area.
215 -gimp_preview_update (GimpPreview * preview)
216 +gimp_preview_update (myGimpPreview * preview)
218 gimp_preview_recompute_sizes (preview, preview->scale);
219 gimp_preview_update_preview (preview);
220 @@ -579,11 +579,11 @@
222 gimp_preview_plus_callback (GtkWidget * widget, gpointer data)
224 - GimpPreview *preview;
225 + myGimpPreview *preview;
229 - preview = GIMP_PREVIEW (data);
230 + preview = MY_GIMP_PREVIEW (data);
231 if (PREVIEW_DATA (preview)->scale_n == PREVIEW_SCALE_LAST)
234 @@ -616,11 +616,11 @@
236 gimp_preview_minus_callback (GtkWidget * widget, gpointer data)
238 - GimpPreview *preview;
239 + myGimpPreview *preview;
243 - preview = GIMP_PREVIEW (data);
244 + preview = MY_GIMP_PREVIEW (data);
245 if (PREVIEW_DATA (preview)->scale_n == 0)
248 @@ -651,12 +651,12 @@
250 gimp_preview_event (GtkWidget * widget, GdkEvent * event, gpointer data)
252 - GimpPreview *preview;
253 + myGimpPreview *preview;
254 GdkEventButton *button_event;
258 - preview = GIMP_PREVIEW (data);
259 + preview = MY_GIMP_PREVIEW (data);
260 button_event = (GdkEventButton *) event;
264 * This function is also used for initializing the preview.
267 -gimp_preview_recompute_sizes (GimpPreview * preview, gdouble new_scale)
268 +gimp_preview_recompute_sizes (myGimpPreview * preview, gdouble new_scale)
271 /* The center of the preview in image coordinates.
276 -gimp_preview_generate_update_event (GimpPreview * preview)
277 +gimp_preview_generate_update_event (myGimpPreview * preview)
278 /* Signal the user that the preview must be updated */
280 const gdouble scale = preview->scale;
283 preview->drawable->height - image_y);
285 - GimpPreviewEvent preview_event;
286 + myGimpPreviewEvent preview_event;
288 preview_event.event_id = PREVIEW_DATA (preview)->current_event_id;
289 preview_event.scale = preview->scale;
291 * to step through source and destination!
294 -gimp_preview_update_preview (GimpPreview * preview)
295 +gimp_preview_update_preview (myGimpPreview * preview)
298 guchar *image_data = NULL;
299 @@ -1012,7 +1012,7 @@
303 -gimp_preview_force_redraw (GimpPreview * preview)
304 +gimp_preview_force_redraw (myGimpPreview * preview)
306 gtk_widget_queue_draw (GTK_WIDGET (PREVIEW_DATA (preview)->image));
308 @@ -1022,7 +1022,7 @@
310 gimp_preview_update_preview_idle_fun (gpointer data)
312 - GimpPreview *preview = GIMP_PREVIEW (data);
313 + myGimpPreview *preview = MY_GIMP_PREVIEW (data);
314 gint event_id = PREVIEW_DATA (preview)->current_event_id;
317 @@ -1041,7 +1041,7 @@
321 -gimp_preview_schedule_update (GimpPreview * preview)
322 +gimp_preview_schedule_update (myGimpPreview * preview)
324 PREVIEW_DATA (preview)->current_event_id++;
326 @@ -1082,7 +1082,7 @@
330 -gimp_preview_image_set_size (GimpPreview * preview, gint width, gint height)
331 +gimp_preview_image_set_size (myGimpPreview * preview, gint width, gint height)
333 const gint real_width = MIN (preview->max_width, width);
334 const gint real_height = MIN (preview->max_height, height);
335 @@ -1120,8 +1120,8 @@
338 * gimp_preview_draw_row:
339 - * @preview: the #GimpPreview
340 - * @event_id: event_id that was sent with the #GimpPreviewEvent.
341 + * @preview: the #myGimpPreview
342 + * @event_id: event_id that was sent with the #myGimpPreviewEvent.
343 * @type: the format of the data (e.g. %GIMP_RGBA_IMAGE).
344 * @row:the relative number of the row within the preview.
345 * The top row of the preview is number 0.
346 @@ -1137,7 +1137,7 @@
347 * with the same event-id will be ignored by the preview.
350 -gimp_preview_draw_row (GimpPreview * preview, const gint event_id,
351 +gimp_preview_draw_row (myGimpPreview * preview, const gint event_id,
352 GimpImageType type, gint row,
353 const guchar * const data)
355 @@ -1247,8 +1247,8 @@
358 * gimp_preview_draw_unscaled_row:
359 - * @preview: the #GimpPreview
360 - * @event_id: event_id that was sent with the #GimpPreviewEvent.
361 + * @preview: the #myGimpPreview
362 + * @event_id: event_id that was sent with the #myGimpPreviewEvent.
363 * @type: the format of the data (e.g. %GIMP_RGBA_IMAGE).
364 * @row:row is the relative position of the row w.r.t. preview_event->image_y.
365 * The top row has number 0.
366 @@ -1267,7 +1267,7 @@
367 * with the same event-id will be ignored by the preview.
370 -gimp_preview_draw_unscaled_row (GimpPreview * preview, const gint event_id,
371 +gimp_preview_draw_unscaled_row (myGimpPreview * preview, const gint event_id,
372 GimpImageType type, const gint row,
373 const guchar * const data)
375 @@ -1445,8 +1445,8 @@
378 * gimp_preview_progress_set_fraction:
379 - * @preview: the #GimpPreview.
380 - * @event_id: event_id that was sent with the #GimpPreviewEvent.
381 + * @preview: the #myGimpPreview.
382 + * @event_id: event_id that was sent with the #myGimpPreviewEvent.
383 * @fraction: the fraction completed.
385 * Set the progress bar of the preview to @fraction completed.
386 @@ -1456,7 +1456,7 @@
387 * with the same event-id will be ignored by the preview.
390 -gimp_preview_progress_set_fraction (GimpPreview * preview,
391 +gimp_preview_progress_set_fraction (myGimpPreview * preview,
392 const gint event_id, double fraction)
394 const gboolean return_status =
395 diff -ur refocus-0.9.0/src/gimppreview.h refocus-0.9.0-patched/src/gimppreview.h
396 --- refocus-0.9.0/src/gimppreview.h 2003-01-30 22:30:18.000000000 +0100
397 +++ refocus-0.9.0-patched/src/gimppreview.h 2010-07-04 16:42:33.885366354 +0200
400 #define PREVIEW_FIXED_SIZE 0
401 #define PREVIEW_DEFAULT_SIZE -1
402 -#define GIMP_TYPE_PREVIEW (gimp_preview_get_type ())
403 -#define GIMP_PREVIEW(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PREVIEW, GimpPreview))
404 -#define GIMP_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW, GimpPreviewClass))
405 -#define GIMP_IS_PREVIEW(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PREVIEW))
406 -#define GIMP_IS_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW))
407 -typedef struct _GimpPreview GimpPreview;
408 -typedef struct _GimpPreviewClass GimpPreviewClass;
409 -typedef struct _GimpPreviewEvent GimpPreviewEvent;
410 +//#define GIMP_TYPE_PREVIEW (gimp_preview_get_type ())
411 +#define MY_GIMP_PREVIEW(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_PREVIEW, myGimpPreview))
412 +#define MY_GIMP_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW, myGimpPreviewClass))
413 +//#define GIMP_IS_PREVIEW(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PREVIEW))
414 +//#define GIMP_IS_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW))
415 +typedef struct _myGimpPreview myGimpPreview;
416 +typedef struct _myGimpPreviewClass myGimpPreviewClass;
417 +typedef struct _myGimpPreviewEvent myGimpPreviewEvent;
419 -struct _GimpPreviewClass
420 +struct _myGimpPreviewClass
422 GtkContainerClass parent_class;
424 - void (*update_preview) (GimpPreview * preview, GimpPreviewEvent * event);
425 - void (*preview_changed) (GimpPreview * preview);
426 + void (*update_preview) (myGimpPreview * preview, myGimpPreviewEvent * event);
427 + void (*preview_changed) (myGimpPreview * preview);
432 +struct _myGimpPreview
440 - * GimpPreviewEvent:
441 + * myGimpPreviewEvent:
442 * @event_id: Id of this event. This is needed for gimp_preview_draw_row,
443 * gimp_preview_draw_unscaled_row and gimp_preview_progress_set_fraction.
444 * @scale: Current scale of the preview.
447 -struct _GimpPreviewEvent
448 +struct _myGimpPreviewEvent
450 gint event_id; /* Id of this event */
451 gdouble scale; /* Scale of preview */
452 @@ -113,20 +113,20 @@
454 gdouble scale_amount,
456 -void gimp_preview_update (GimpPreview * preview);
457 +void gimp_preview_update (myGimpPreview * preview);
459 -gboolean gimp_preview_draw_row (GimpPreview * preview, const gint event_id,
460 +gboolean gimp_preview_draw_row (myGimpPreview * preview, const gint event_id,
461 GimpImageType type, const gint row,
462 const guchar * const data);
464 -gboolean gimp_preview_draw_unscaled_row (GimpPreview * preview,
465 +gboolean gimp_preview_draw_unscaled_row (myGimpPreview * preview,
467 GimpImageType type, const gint row,
468 const guchar * const data);
470 -void gimp_preview_force_redraw (GimpPreview * preview);
471 +void gimp_preview_force_redraw (myGimpPreview * preview);
473 -gboolean gimp_preview_progress_set_fraction (GimpPreview * preview,
474 +gboolean gimp_preview_progress_set_fraction (myGimpPreview * preview,
478 diff -ur refocus-0.9.0/src/refocus.c refocus-0.9.0-patched/src/refocus.c
479 --- refocus-0.9.0/src/refocus.c 2010-07-04 16:33:24.312364787 +0200
480 +++ refocus-0.9.0-patched/src/refocus.c 2010-07-04 16:43:02.753363951 +0200
483 set_busy_cursor (widget, TRUE);
485 - gimp_preview_update (GIMP_PREVIEW (my_widgets.preview));
486 + gimp_preview_update (MY_GIMP_PREVIEW (my_widgets.preview));
487 set_busy_cursor (widget, FALSE);
490 @@ -368,11 +368,11 @@
492 gint event_id = GPOINTER_TO_INT (data);
493 return (gimp_preview_progress_set_fraction
494 - (GIMP_PREVIEW (my_widgets.preview), event_id, arg));
495 + (MY_GIMP_PREVIEW (my_widgets.preview), event_id, arg));
499 -preview_callback (GtkWidget * widget, GimpPreviewEvent * event, gpointer data)
500 +preview_callback (GtkWidget * widget, myGimpPreviewEvent * event, gpointer data)
505 im_width, im_height);
506 tile_sink_init_for_preview (&sink, drawable, image_x, image_y,
507 im_width, im_height);
508 - gimp_preview_progress_set_fraction (GIMP_PREVIEW (my_widgets.preview),
509 + gimp_preview_progress_set_fraction (MY_GIMP_PREVIEW (my_widgets.preview),
511 bd_closure_init (&update_progress_closure,
512 preview_progress_update_fun,
515 tile_sink_get_row (&sink, buf, image_x, image_y + row, im_width);
517 - gimp_preview_draw_unscaled_row (GIMP_PREVIEW (my_widgets.preview),
518 + gimp_preview_draw_unscaled_row (MY_GIMP_PREVIEW (my_widgets.preview),
520 gimp_drawable_type (drawable->drawable_id),
524 gtk_widget_show (dlg);
526 - gimp_preview_update (GIMP_PREVIEW (preview));
527 + gimp_preview_update (MY_GIMP_PREVIEW (preview));