Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 327179 | Differences between
and this patch

Collapse All | Expand All

(-)refocus-0.9.0/configure.in (-7 lines)
Lines 96-108 Link Here
96
   AC_DEFINE(PREVIEW_DEBUG)
96
   AC_DEFINE(PREVIEW_DEBUG)
97
fi
97
fi
98
98
99
# If we have gcc set the CFLAGS
100
# This is done here because otherwise configure would use
101
# these flags for compiling test-programs.
102
if test "$GCC" = yes; then
103
   CFLAGS="-Wall -ansi -pedantic -ggdb -fomit-frame-pointer -O3 -funroll-all-loops"
104
fi
105
106
#Check if erf is defined in the mathlibrary
99
#Check if erf is defined in the mathlibrary
107
AC_CHECK_LIB(m, erf, AC_DEFINE(HAVE_ERF))
100
AC_CHECK_LIB(m, erf, AC_DEFINE(HAVE_ERF))
108
101
(-)refocus-0.9.0/src/gimppreview.c (-49 / +49 lines)
Lines 36-53 Link Here
36
#include "gimppreview.h"
36
#include "gimppreview.h"
37
37
38
38
39
static void gimp_preview_init (GimpPreview * preview);
39
static void gimp_preview_init (myGimpPreview * preview);
40
static void gimp_preview_class_init (GimpPreviewClass * klass);
40
static void gimp_preview_class_init (myGimpPreviewClass * klass);
41
41
42
static void gimp_preview_plus_callback (GtkWidget * widget, gpointer data);
42
static void gimp_preview_plus_callback (GtkWidget * widget, gpointer data);
43
static void gimp_preview_minus_callback (GtkWidget * widget, gpointer data);
43
static void gimp_preview_minus_callback (GtkWidget * widget, gpointer data);
44
static gint gimp_preview_event (GtkWidget * widget, GdkEvent * event,
44
static gint gimp_preview_event (GtkWidget * widget, GdkEvent * event,
45
                                gpointer data);
45
                                gpointer data);
46
static void gimp_preview_recompute_sizes (GimpPreview * preview,
46
static void gimp_preview_recompute_sizes (myGimpPreview * preview,
47
                                          gdouble newscale);
47
                                          gdouble newscale);
48
static void gimp_preview_update_preview (GimpPreview * preview);
48
static void gimp_preview_update_preview (myGimpPreview * preview);
49
49
50
static void gimp_preview_image_set_size (GimpPreview * preview, gint width,
50
static void gimp_preview_image_set_size (myGimpPreview * preview, gint width,
51
                                         gint height);
51
                                         gint height);
52
static void gimp_preview_size_request (GtkWidget * widget,
52
static void gimp_preview_size_request (GtkWidget * widget,
53
                                       GtkRequisition * requisition);
53
                                       GtkRequisition * requisition);
Lines 58-64 Link Here
58
                                 GtkCallback callback,
58
                                 GtkCallback callback,
59
                                 gpointer callback_data);
59
                                 gpointer callback_data);
60
gboolean gimp_preview_update_preview_idle_fun (gpointer data);
60
gboolean gimp_preview_update_preview_idle_fun (gpointer data);
61
void gimp_preview_schedule_update (GimpPreview * preview);
61
void gimp_preview_schedule_update (myGimpPreview * preview);
62
62
63
#define PROGRESS_BAR_HEIGHT (10)
63
#define PROGRESS_BAR_HEIGHT (10)
64
#define PREVIEW_SIZE (100)
64
#define PREVIEW_SIZE (100)
Lines 94-104 Link Here
94
94
95
95
96
/*
96
/*
97
 * Apps which use a GimpPreview widget should not be accessing the private
97
 * Apps which use a myGimpPreview widget should not be accessing the private
98
 * data!
98
 * data!
99
 */
99
 */
100
#define PREVIEW_DATA(preview) \
100
#define PREVIEW_DATA(preview) \
101
        ((GimpPreviewData*)(GIMP_PREVIEW (preview)->private_data))
101
        ((myGimpPreviewData*)(MY_GIMP_PREVIEW (preview)->private_data))
102
102
103
typedef struct
103
typedef struct
104
{
104
{
Lines 126-132 Link Here
126
  GtkWidget *image;
126
  GtkWidget *image;
127
  GtkWidget *progress_bar;
127
  GtkWidget *progress_bar;
128
}
128
}
129
GimpPreviewData;
129
myGimpPreviewData;
130
130
131
131
132
/* Convert coordinate in preview space to image coordinates */
132
/* Convert coordinate in preview space to image coordinates */
Lines 155-174 Link Here
155
  if (!preview_type)
155
  if (!preview_type)
156
    {
156
    {
157
      GTypeInfo preview_info = {
157
      GTypeInfo preview_info = {
158
        sizeof (GimpPreviewClass),
158
        sizeof (myGimpPreviewClass),
159
        (GBaseInitFunc) NULL,
159
        (GBaseInitFunc) NULL,
160
        (GBaseFinalizeFunc) NULL,
160
        (GBaseFinalizeFunc) NULL,
161
        (GClassInitFunc) gimp_preview_class_init,
161
        (GClassInitFunc) gimp_preview_class_init,
162
        (GClassFinalizeFunc) NULL,
162
        (GClassFinalizeFunc) NULL,
163
        (gconstpointer) NULL,   /* class_data */
163
        (gconstpointer) NULL,   /* class_data */
164
        sizeof (GimpPreview),
164
        sizeof (myGimpPreview),
165
        0,                      /* n_preallocs */
165
        0,                      /* n_preallocs */
166
        (GInstanceInitFunc) gimp_preview_init,
166
        (GInstanceInitFunc) gimp_preview_init,
167
        (GTypeValueTable *) NULL /* value_table */
167
        (GTypeValueTable *) NULL /* value_table */
168
      };
168
      };
169
169
170
      preview_type =
170
      preview_type =
171
        g_type_register_static (GTK_TYPE_CONTAINER, "GimpPreview",
171
        g_type_register_static (GTK_TYPE_CONTAINER, "myGimpPreview",
172
                                &preview_info, 0);
172
                                &preview_info, 0);
173
    }
173
    }
174
174
Lines 181-187 Link Here
181
 * by GTK's internal mechanisms.
181
 * by GTK's internal mechanisms.
182
 */
182
 */
183
static void
183
static void
184
gimp_preview_class_init (GimpPreviewClass * klass)
184
gimp_preview_class_init (myGimpPreviewClass * klass)
185
{
185
{
186
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
186
  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
187
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
187
  GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
Lines 190-196 Link Here
190
    g_signal_new ("update_preview",
190
    g_signal_new ("update_preview",
191
                  G_TYPE_FROM_CLASS (klass),
191
                  G_TYPE_FROM_CLASS (klass),
192
                  G_SIGNAL_RUN_FIRST,
192
                  G_SIGNAL_RUN_FIRST,
193
                  G_STRUCT_OFFSET (GimpPreviewClass, update_preview),
193
                  G_STRUCT_OFFSET (myGimpPreviewClass, update_preview),
194
                  NULL,
194
                  NULL,
195
                  NULL,
195
                  NULL,
196
                  g_cclosure_marshal_VOID__POINTER,
196
                  g_cclosure_marshal_VOID__POINTER,
Lines 200-206 Link Here
200
    g_signal_new ("preview_changed",
200
    g_signal_new ("preview_changed",
201
                  G_TYPE_FROM_CLASS (klass),
201
                  G_TYPE_FROM_CLASS (klass),
202
                  G_SIGNAL_RUN_FIRST,
202
                  G_SIGNAL_RUN_FIRST,
203
                  G_STRUCT_OFFSET (GimpPreviewClass, preview_changed),
203
                  G_STRUCT_OFFSET (myGimpPreviewClass, preview_changed),
204
                  NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
204
                  NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
205
205
206
  klass->update_preview = NULL;
206
  klass->update_preview = NULL;
Lines 212-218 Link Here
212
212
213
213
214
void
214
void
215
gimp_preview_set_scale_amount(GimpPreview *preview, gdouble scale_amount)
215
gimp_preview_set_scale_amount(myGimpPreview *preview, gdouble scale_amount)
216
{
216
{
217
  /*
217
  /*
218
   * If the caller wants to set the scale amount, let them do so.
218
   * If the caller wants to set the scale amount, let them do so.
Lines 269-275 Link Here
269
 * by GTK's internal mechanisms.
269
 * by GTK's internal mechanisms.
270
 */
270
 */
271
static void
271
static void
272
gimp_preview_init (GimpPreview * preview)
272
gimp_preview_init (myGimpPreview * preview)
273
{
273
{
274
  gchar buffer[10];
274
  gchar buffer[10];
275
275
Lines 277-283 Link Here
277
  GTK_WIDGET_SET_FLAGS (preview, GTK_NO_WINDOW);
277
  GTK_WIDGET_SET_FLAGS (preview, GTK_NO_WINDOW);
278
  GTK_CONTAINER (preview)->resize_mode = GTK_RESIZE_IMMEDIATE;
278
  GTK_CONTAINER (preview)->resize_mode = GTK_RESIZE_IMMEDIATE;
279
279
280
  preview->private_data = g_malloc0 (sizeof (GimpPreviewData));
280
  preview->private_data = g_malloc0 (sizeof (myGimpPreviewData));
281
281
282
282
283
  PREVIEW_DATA (preview)->label = gtk_label_new ("");
283
  PREVIEW_DATA (preview)->label = gtk_label_new ("");
Lines 307-313 Link Here
307
gimp_preview_new_with_args (GimpDrawable * drawable, gint cb_preview_size,
307
gimp_preview_new_with_args (GimpDrawable * drawable, gint cb_preview_size,
308
                            gdouble cb_scale_amount, gint cb_allow_scale)
308
                            gdouble cb_scale_amount, gint cb_allow_scale)
309
{
309
{
310
  GimpPreview *preview;
310
  myGimpPreview *preview;
311
  GtkWidget *frame;
311
  GtkWidget *frame;
312
  GtkWidget *hbox;
312
  GtkWidget *hbox;
313
  GtkWidget *event_box;
313
  GtkWidget *event_box;
Lines 337-343 Link Here
337
337
338
338
339
  /* Now allocate the actual preview window. */
339
  /* Now allocate the actual preview window. */
340
  preview = GIMP_PREVIEW (g_object_new (gimp_preview_get_type (), NULL));
340
  preview = MY_GIMP_PREVIEW (g_object_new (gimp_preview_get_type (), NULL));
341
341
342
  /* Set the scale amount. */
342
  /* Set the scale amount. */
343
  gimp_preview_set_scale_amount(preview, cb_scale_amount);
343
  gimp_preview_set_scale_amount(preview, cb_scale_amount);
Lines 352-359 Link Here
352
      preview_width = i2p (drawable->width, preview->scale);
352
      preview_width = i2p (drawable->width, preview->scale);
353
      preview_height = i2p (drawable->height, preview->scale);
353
      preview_height = i2p (drawable->height, preview->scale);
354
354
355
      GIMP_PREVIEW (preview)->width = preview_width;
355
      MY_GIMP_PREVIEW (preview)->width = preview_width;
356
      GIMP_PREVIEW (preview)->height = preview_height;
356
      MY_GIMP_PREVIEW (preview)->height = preview_height;
357
    }
357
    }
358
  else
358
  else
359
    {
359
    {
Lines 454-460 Link Here
454
static void
454
static void
455
gimp_preview_size_request (GtkWidget * widget, GtkRequisition * requisition)
455
gimp_preview_size_request (GtkWidget * widget, GtkRequisition * requisition)
456
{
456
{
457
  GimpPreview *preview = GIMP_PREVIEW (widget);
457
  myGimpPreview *preview = MY_GIMP_PREVIEW (widget);
458
  GtkRequisition resize_box_requisition;
458
  GtkRequisition resize_box_requisition;
459
459
460
#ifdef PREVIEW_DEBUG
460
#ifdef PREVIEW_DEBUG
Lines 478-484 Link Here
478
static void
478
static void
479
gimp_preview_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
479
gimp_preview_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
480
{
480
{
481
  GimpPreview *preview = GIMP_PREVIEW (widget);
481
  myGimpPreview *preview = MY_GIMP_PREVIEW (widget);
482
  GtkAllocation resize_box_allocation, progress_bar_allocation,
482
  GtkAllocation resize_box_allocation, progress_bar_allocation,
483
    event_box_allocation;
483
    event_box_allocation;
484
  GtkRequisition resize_box_requisition;
484
  GtkRequisition resize_box_requisition;
Lines 543-549 Link Here
543
                     gboolean include_internals,
543
                     gboolean include_internals,
544
                     GtkCallback callback, gpointer callback_data)
544
                     GtkCallback callback, gpointer callback_data)
545
{
545
{
546
  GimpPreview *preview = GIMP_PREVIEW (container);
546
  myGimpPreview *preview = MY_GIMP_PREVIEW (container);
547
547
548
  if (PREVIEW_DATA (preview)->resize_box)
548
  if (PREVIEW_DATA (preview)->resize_box)
549
    {
549
    {
Lines 564-570 Link Here
564
 * Plug-ins call this to do an update of the preview area.
564
 * Plug-ins call this to do an update of the preview area.
565
 */
565
 */
566
void
566
void
567
gimp_preview_update (GimpPreview * preview)
567
gimp_preview_update (myGimpPreview * preview)
568
{
568
{
569
  gimp_preview_recompute_sizes (preview, preview->scale);
569
  gimp_preview_recompute_sizes (preview, preview->scale);
570
  gimp_preview_update_preview (preview);
570
  gimp_preview_update_preview (preview);
Lines 579-589 Link Here
579
static void
579
static void
580
gimp_preview_plus_callback (GtkWidget * widget, gpointer data)
580
gimp_preview_plus_callback (GtkWidget * widget, gpointer data)
581
{
581
{
582
  GimpPreview *preview;
582
  myGimpPreview *preview;
583
  gchar buffer[10];
583
  gchar buffer[10];
584
  gdouble new_scale;
584
  gdouble new_scale;
585
585
586
  preview = GIMP_PREVIEW (data);
586
  preview = MY_GIMP_PREVIEW (data);
587
  if (PREVIEW_DATA (preview)->scale_n == PREVIEW_SCALE_LAST)
587
  if (PREVIEW_DATA (preview)->scale_n == PREVIEW_SCALE_LAST)
588
    return;
588
    return;
589
589
Lines 616-626 Link Here
616
static void
616
static void
617
gimp_preview_minus_callback (GtkWidget * widget, gpointer data)
617
gimp_preview_minus_callback (GtkWidget * widget, gpointer data)
618
{
618
{
619
  GimpPreview *preview;
619
  myGimpPreview *preview;
620
  gchar buffer[10];
620
  gchar buffer[10];
621
  gdouble new_scale;
621
  gdouble new_scale;
622
622
623
  preview = GIMP_PREVIEW (data);
623
  preview = MY_GIMP_PREVIEW (data);
624
  if (PREVIEW_DATA (preview)->scale_n == 0)
624
  if (PREVIEW_DATA (preview)->scale_n == 0)
625
    return;
625
    return;
626
626
Lines 651-662 Link Here
651
static gint
651
static gint
652
gimp_preview_event (GtkWidget * widget, GdkEvent * event, gpointer data)
652
gimp_preview_event (GtkWidget * widget, GdkEvent * event, gpointer data)
653
{
653
{
654
  GimpPreview *preview;
654
  myGimpPreview *preview;
655
  GdkEventButton *button_event;
655
  GdkEventButton *button_event;
656
  gint x, y;
656
  gint x, y;
657
  gint dx, dy;
657
  gint dx, dy;
658
658
659
  preview = GIMP_PREVIEW (data);
659
  preview = MY_GIMP_PREVIEW (data);
660
  button_event = (GdkEventButton *) event;
660
  button_event = (GdkEventButton *) event;
661
661
662
  switch (event->type)
662
  switch (event->type)
Lines 733-739 Link Here
733
 * This function is also used for initializing the preview.
733
 * This function is also used for initializing the preview.
734
 */
734
 */
735
static void
735
static void
736
gimp_preview_recompute_sizes (GimpPreview * preview, gdouble new_scale)
736
gimp_preview_recompute_sizes (myGimpPreview * preview, gdouble new_scale)
737
{
737
{
738
738
739
  /* The center of the preview in image coordinates.
739
  /* The center of the preview in image coordinates.
Lines 765-771 Link Here
765
}
765
}
766
766
767
void
767
void
768
gimp_preview_generate_update_event (GimpPreview * preview)
768
gimp_preview_generate_update_event (myGimpPreview * preview)
769
     /* Signal the user that the preview must be updated */
769
     /* Signal the user that the preview must be updated */
770
{
770
{
771
  const gdouble scale = preview->scale;
771
  const gdouble scale = preview->scale;
Lines 783-789 Link Here
783
           0,
783
           0,
784
           preview->drawable->height - image_y);
784
           preview->drawable->height - image_y);
785
785
786
  GimpPreviewEvent preview_event;
786
  myGimpPreviewEvent preview_event;
787
787
788
  preview_event.event_id = PREVIEW_DATA (preview)->current_event_id;
788
  preview_event.event_id = PREVIEW_DATA (preview)->current_event_id;
789
  preview_event.scale = preview->scale;
789
  preview_event.scale = preview->scale;
Lines 814-820 Link Here
814
 * to step through source and destination!
814
 * to step through source and destination!
815
 */
815
 */
816
static void
816
static void
817
gimp_preview_update_preview (GimpPreview * preview)
817
gimp_preview_update_preview (myGimpPreview * preview)
818
{
818
{
819
  GimpPixelRgn region;
819
  GimpPixelRgn region;
820
  guchar *image_data = NULL;
820
  guchar *image_data = NULL;
Lines 1012-1018 Link Here
1012
1012
1013
1013
1014
void
1014
void
1015
gimp_preview_force_redraw (GimpPreview * preview)
1015
gimp_preview_force_redraw (myGimpPreview * preview)
1016
{
1016
{
1017
  gtk_widget_queue_draw (GTK_WIDGET (PREVIEW_DATA (preview)->image));
1017
  gtk_widget_queue_draw (GTK_WIDGET (PREVIEW_DATA (preview)->image));
1018
}
1018
}
Lines 1022-1028 Link Here
1022
gboolean
1022
gboolean
1023
gimp_preview_update_preview_idle_fun (gpointer data)
1023
gimp_preview_update_preview_idle_fun (gpointer data)
1024
{
1024
{
1025
  GimpPreview *preview = GIMP_PREVIEW (data);
1025
  myGimpPreview *preview = MY_GIMP_PREVIEW (data);
1026
  gint event_id = PREVIEW_DATA (preview)->current_event_id;
1026
  gint event_id = PREVIEW_DATA (preview)->current_event_id;
1027
1027
1028
#ifdef PREVIEW_DEBUG
1028
#ifdef PREVIEW_DEBUG
Lines 1041-1047 Link Here
1041
}
1041
}
1042
1042
1043
void
1043
void
1044
gimp_preview_schedule_update (GimpPreview * preview)
1044
gimp_preview_schedule_update (myGimpPreview * preview)
1045
{
1045
{
1046
  PREVIEW_DATA (preview)->current_event_id++;
1046
  PREVIEW_DATA (preview)->current_event_id++;
1047
1047
Lines 1082-1088 Link Here
1082
}
1082
}
1083
1083
1084
void
1084
void
1085
gimp_preview_image_set_size (GimpPreview * preview, gint width, gint height)
1085
gimp_preview_image_set_size (myGimpPreview * preview, gint width, gint height)
1086
{
1086
{
1087
  const gint real_width = MIN (preview->max_width, width);
1087
  const gint real_width = MIN (preview->max_width, width);
1088
  const gint real_height = MIN (preview->max_height, height);
1088
  const gint real_height = MIN (preview->max_height, height);
Lines 1120-1127 Link Here
1120
1120
1121
/**
1121
/**
1122
 * gimp_preview_draw_row:
1122
 * gimp_preview_draw_row:
1123
 * @preview: the #GimpPreview
1123
 * @preview: the #myGimpPreview
1124
 * @event_id: event_id that was sent with the #GimpPreviewEvent.
1124
 * @event_id: event_id that was sent with the #myGimpPreviewEvent.
1125
 * @type: the format of the data (e.g. %GIMP_RGBA_IMAGE).
1125
 * @type: the format of the data (e.g. %GIMP_RGBA_IMAGE).
1126
 * @row:the relative number of the row within the preview.
1126
 * @row:the relative number of the row within the preview.
1127
 * The top row of the preview is number 0.
1127
 * The top row of the preview is number 0.
Lines 1137-1143 Link Here
1137
 * with the same event-id will be ignored by the preview.
1137
 * with the same event-id will be ignored by the preview.
1138
 **/
1138
 **/
1139
gboolean
1139
gboolean
1140
gimp_preview_draw_row (GimpPreview * preview, const gint event_id,
1140
gimp_preview_draw_row (myGimpPreview * preview, const gint event_id,
1141
                       GimpImageType type, gint row,
1141
                       GimpImageType type, gint row,
1142
                       const guchar * const data)
1142
                       const guchar * const data)
1143
{
1143
{
Lines 1247-1254 Link Here
1247
1247
1248
/**
1248
/**
1249
 * gimp_preview_draw_unscaled_row:
1249
 * gimp_preview_draw_unscaled_row:
1250
 * @preview: the #GimpPreview
1250
 * @preview: the #myGimpPreview
1251
 * @event_id: event_id that was sent with the #GimpPreviewEvent.
1251
 * @event_id: event_id that was sent with the #myGimpPreviewEvent.
1252
 * @type: the format of the data (e.g. %GIMP_RGBA_IMAGE).
1252
 * @type: the format of the data (e.g. %GIMP_RGBA_IMAGE).
1253
 * @row:row is the relative position of the row w.r.t. preview_event->image_y.
1253
 * @row:row is the relative position of the row w.r.t. preview_event->image_y.
1254
 * The top row has number 0.
1254
 * The top row has number 0.
Lines 1267-1273 Link Here
1267
 * with the same event-id will be ignored by the preview.
1267
 * with the same event-id will be ignored by the preview.
1268
 **/
1268
 **/
1269
gboolean
1269
gboolean
1270
gimp_preview_draw_unscaled_row (GimpPreview * preview, const gint event_id,
1270
gimp_preview_draw_unscaled_row (myGimpPreview * preview, const gint event_id,
1271
                                GimpImageType type, const gint row,
1271
                                GimpImageType type, const gint row,
1272
                                const guchar * const data)
1272
                                const guchar * const data)
1273
{
1273
{
Lines 1445-1452 Link Here
1445
1445
1446
/**
1446
/**
1447
 * gimp_preview_progress_set_fraction:
1447
 * gimp_preview_progress_set_fraction:
1448
 * @preview: the #GimpPreview.
1448
 * @preview: the #myGimpPreview.
1449
 * @event_id: event_id that was sent with the #GimpPreviewEvent.
1449
 * @event_id: event_id that was sent with the #myGimpPreviewEvent.
1450
 * @fraction: the fraction completed.
1450
 * @fraction: the fraction completed.
1451
 *
1451
 *
1452
 * Set the progress bar of the preview to @fraction completed.
1452
 * Set the progress bar of the preview to @fraction completed.
Lines 1456-1462 Link Here
1456
 * with the same event-id will be ignored by the preview.
1456
 * with the same event-id will be ignored by the preview.
1457
 **/
1457
 **/
1458
gboolean
1458
gboolean
1459
gimp_preview_progress_set_fraction (GimpPreview * preview,
1459
gimp_preview_progress_set_fraction (myGimpPreview * preview,
1460
                                    const gint event_id, double fraction)
1460
                                    const gint event_id, double fraction)
1461
{
1461
{
1462
  const gboolean return_status =
1462
  const gboolean return_status =
(-)refocus-0.9.0/src/gimppreview.h (-19 / +19 lines)
Lines 32-56 Link Here
32
32
33
#define PREVIEW_FIXED_SIZE           0
33
#define PREVIEW_FIXED_SIZE           0
34
#define PREVIEW_DEFAULT_SIZE         -1
34
#define PREVIEW_DEFAULT_SIZE         -1
35
#define GIMP_TYPE_PREVIEW            (gimp_preview_get_type ())
35
//#define GIMP_TYPE_PREVIEW            (gimp_preview_get_type ())
36
#define GIMP_PREVIEW(obj)            (GTK_CHECK_CAST ((obj), GIMP_TYPE_PREVIEW, GimpPreview))
36
#define MY_GIMP_PREVIEW(obj)            (GTK_CHECK_CAST ((obj), GIMP_TYPE_PREVIEW, myGimpPreview))
37
#define GIMP_PREVIEW_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW, GimpPreviewClass))
37
#define MY_GIMP_PREVIEW_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PREVIEW, myGimpPreviewClass))
38
#define GIMP_IS_PREVIEW(obj)         (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PREVIEW))
38
//#define GIMP_IS_PREVIEW(obj)         (GTK_CHECK_TYPE ((obj), GIMP_TYPE_PREVIEW))
39
#define GIMP_IS_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW))
39
//#define GIMP_IS_PREVIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PREVIEW))
40
typedef struct _GimpPreview GimpPreview;
40
typedef struct _myGimpPreview myGimpPreview;
41
typedef struct _GimpPreviewClass GimpPreviewClass;
41
typedef struct _myGimpPreviewClass myGimpPreviewClass;
42
typedef struct _GimpPreviewEvent GimpPreviewEvent;
42
typedef struct _myGimpPreviewEvent myGimpPreviewEvent;
43
43
44
struct _GimpPreviewClass
44
struct _myGimpPreviewClass
45
{
45
{
46
  GtkContainerClass parent_class;
46
  GtkContainerClass parent_class;
47
47
48
  void (*update_preview) (GimpPreview * preview, GimpPreviewEvent * event);
48
  void (*update_preview) (myGimpPreview * preview, myGimpPreviewEvent * event);
49
  void (*preview_changed) (GimpPreview * preview);
49
  void (*preview_changed) (myGimpPreview * preview);
50
};
50
};
51
51
52
52
53
struct _GimpPreview
53
struct _myGimpPreview
54
{
54
{
55
  GtkContainer parent;
55
  GtkContainer parent;
56
56
Lines 75-87 Link Here
75
};
75
};
76
76
77
/**
77
/**
78
 * GimpPreviewEvent:
78
 * myGimpPreviewEvent:
79
 * @event_id: Id of this event. This is needed for gimp_preview_draw_row,
79
 * @event_id: Id of this event. This is needed for gimp_preview_draw_row,
80
 * gimp_preview_draw_unscaled_row and gimp_preview_progress_set_fraction.
80
 * gimp_preview_draw_unscaled_row and gimp_preview_progress_set_fraction.
81
 * @scale: Current scale of the preview.
81
 * @scale: Current scale of the preview.
82
 *
82
 *
83
 **/
83
 **/
84
struct _GimpPreviewEvent
84
struct _myGimpPreviewEvent
85
{
85
{
86
  gint event_id;                /* Id of this event */
86
  gint event_id;                /* Id of this event */
87
  gdouble scale;                /* Scale of preview */
87
  gdouble scale;                /* Scale of preview */
Lines 113-132 Link Here
113
                                       gint preview_size,
113
                                       gint preview_size,
114
                                       gdouble scale_amount,
114
                                       gdouble scale_amount,
115
                                       gint allow_scale);
115
                                       gint allow_scale);
116
void gimp_preview_update (GimpPreview * preview);
116
void gimp_preview_update (myGimpPreview * preview);
117
117
118
gboolean gimp_preview_draw_row (GimpPreview * preview, const gint event_id,
118
gboolean gimp_preview_draw_row (myGimpPreview * preview, const gint event_id,
119
                                GimpImageType type, const gint row,
119
                                GimpImageType type, const gint row,
120
                                const guchar * const data);
120
                                const guchar * const data);
121
121
122
gboolean gimp_preview_draw_unscaled_row (GimpPreview * preview,
122
gboolean gimp_preview_draw_unscaled_row (myGimpPreview * preview,
123
                                         const gint event_id,
123
                                         const gint event_id,
124
                                         GimpImageType type, const gint row,
124
                                         GimpImageType type, const gint row,
125
                                         const guchar * const data);
125
                                         const guchar * const data);
126
126
127
void gimp_preview_force_redraw (GimpPreview * preview);
127
void gimp_preview_force_redraw (myGimpPreview * preview);
128
128
129
gboolean gimp_preview_progress_set_fraction (GimpPreview * preview,
129
gboolean gimp_preview_progress_set_fraction (myGimpPreview * preview,
130
                                             const gint event_id,
130
                                             const gint event_id,
131
                                             double fraction);
131
                                             double fraction);
132
132
(-)refocus-0.9.0/src/refocus.c (-6 / +6 lines)
Lines 335-341 Link Here
335
  (void) data;
335
  (void) data;
336
  set_busy_cursor (widget, TRUE);
336
  set_busy_cursor (widget, TRUE);
337
  update_matrix ();
337
  update_matrix ();
338
  gimp_preview_update (GIMP_PREVIEW (my_widgets.preview));
338
  gimp_preview_update (MY_GIMP_PREVIEW (my_widgets.preview));
339
  set_busy_cursor (widget, FALSE);
339
  set_busy_cursor (widget, FALSE);
340
}
340
}
341
341
Lines 368-378 Link Here
368
{
368
{
369
  gint event_id = GPOINTER_TO_INT (data);
369
  gint event_id = GPOINTER_TO_INT (data);
370
  return (gimp_preview_progress_set_fraction
370
  return (gimp_preview_progress_set_fraction
371
          (GIMP_PREVIEW (my_widgets.preview), event_id, arg));
371
          (MY_GIMP_PREVIEW (my_widgets.preview), event_id, arg));
372
}
372
}
373
373
374
static void
374
static void
375
preview_callback (GtkWidget * widget, GimpPreviewEvent * event, gpointer data)
375
preview_callback (GtkWidget * widget, myGimpPreviewEvent * event, gpointer data)
376
{
376
{
377
  TileSource source;
377
  TileSource source;
378
  TileSink sink;
378
  TileSink sink;
Lines 392-398 Link Here
392
                                      im_width, im_height);
392
                                      im_width, im_height);
393
      tile_sink_init_for_preview (&sink, drawable, image_x, image_y,
393
      tile_sink_init_for_preview (&sink, drawable, image_x, image_y,
394
                                  im_width, im_height);
394
                                  im_width, im_height);
395
      gimp_preview_progress_set_fraction (GIMP_PREVIEW (my_widgets.preview),
395
      gimp_preview_progress_set_fraction (MY_GIMP_PREVIEW (my_widgets.preview),
396
                                          event->event_id, 0);
396
                                          event->event_id, 0);
397
      bd_closure_init (&update_progress_closure,
397
      bd_closure_init (&update_progress_closure,
398
                       preview_progress_update_fun,
398
                       preview_progress_update_fun,
Lines 408-414 Link Here
408
        {
408
        {
409
          tile_sink_get_row (&sink, buf, image_x, image_y + row, im_width);
409
          tile_sink_get_row (&sink, buf, image_x, image_y + row, im_width);
410
          event_is_current =
410
          event_is_current =
411
            gimp_preview_draw_unscaled_row (GIMP_PREVIEW (my_widgets.preview),
411
            gimp_preview_draw_unscaled_row (MY_GIMP_PREVIEW (my_widgets.preview),
412
                                            event->event_id,
412
                                            event->event_id,
413
                                            gimp_drawable_type (drawable->drawable_id),
413
                                            gimp_drawable_type (drawable->drawable_id),
414
                                            row, buf);
414
                                            row, buf);
Lines 582-588 Link Here
582
582
583
  gtk_widget_show (dlg);
583
  gtk_widget_show (dlg);
584
  redraw_all ();
584
  redraw_all ();
585
  gimp_preview_update (GIMP_PREVIEW (preview));
585
  gimp_preview_update (MY_GIMP_PREVIEW (preview));
586
  gtk_main ();
586
  gtk_main ();
587
  gdk_flush ();
587
  gdk_flush ();
588
  return run_flag;
588
  return run_flag;

Return to bug 327179