Commit b614bf5e authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

libgimpwidgets/gimpintcombobox.[ch] libgimpwidgets/gimppageselector.[ch]

2006-01-25  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpintcombobox.[ch]
	* libgimpwidgets/gimppageselector.[ch]
	* libgimpwidgets/gimpzoommodel.[ch]: added a priv pointer to the
	instance struct and changed the GET_PRIVATE() macro to access the
	private data via that pointer.

	* libgimpwidgets/gimpscrolledpreview.[ch]
	* libgimpwidgets/gimpwidgets.def: added a priv pointer to the
	instance struct and moved all private data to the
	GimpScrolledPreviewPrivate struct. Added freeze/thaw methods so
	that derived widgets can be implemented without accessing private
	data.

	* libgimp/gimpzoompreview.c: changed accordingly.

	* libgimp/gimpfontselectbutton.[ch]: let the priv pointer be an
	anonymous void pointer.
parent 597aa225
2006-01-25 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpintcombobox.[ch]
* libgimpwidgets/gimppageselector.[ch]
* libgimpwidgets/gimpzoommodel.[ch]: added a priv pointer to the
instance struct and changed the GET_PRIVATE() macro to access the
private data via that pointer.
* libgimpwidgets/gimpscrolledpreview.[ch]
* libgimpwidgets/gimpwidgets.def: added a priv pointer to the
instance struct and moved all private data to the
GimpScrolledPreviewPrivate struct. Added freeze/thaw methods so
that derived widgets can be implemented without accessing private
data.
* libgimp/gimpzoompreview.c: changed accordingly.
* libgimp/gimpfontselectbutton.[ch]: let the priv pointer be an
anonymous void pointer.
2006-01-25 Sven Neumann <sven@gimp.org>
* docs/gimp.1.in: document some more environment variables.
......
......@@ -29,18 +29,20 @@
#include "libgimp-intl.h"
#define GIMP_FONT_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_FONT_SELECT_BUTTON, GimpFontSelectButtonPrivate))
struct _GimpFontSelectButtonPrivate
typedef struct
{
gchar *title;
gchar *font_name; /* Local copy */
gchar *title;
gchar *font_name; /* local copy */
GtkWidget *inside;
GtkWidget *label;
GtkWidget *inside;
GtkWidget *label;
const gchar *temp_font_callback;
} GimpFontSelectButtonPrivate;
#define GIMP_FONT_SELECT_BUTTON_GET_PRIVATE(obj) \
((GimpFontSelectButtonPrivate *) ((GimpFontSelectButton *) (obj))->priv)
const gchar *temp_font_callback;
};
enum
{
......@@ -164,14 +166,20 @@ gimp_font_select_button_class_init (GimpFontSelectButtonClass *klass)
static void
gimp_font_select_button_init (GimpFontSelectButton *button)
{
button->priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
GimpFontSelectButtonPrivate *priv;
button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
GIMP_TYPE_FONT_SELECT_BUTTON,
GimpFontSelectButtonPrivate);
button->priv->title = g_strdup(_("Font Selection"));
button->priv->font_name = g_strdup(_("Sans"));
button->priv->temp_font_callback = NULL;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
button->priv->inside = gimp_font_select_button_create_inside (button);
gtk_container_add (GTK_CONTAINER (button), button->priv->inside);
priv->title = g_strdup(_("Font Selection"));
priv->font_name = g_strdup(_("Sans"));
priv->temp_font_callback = NULL;
priv->inside = gimp_font_select_button_create_inside (button);
gtk_container_add (GTK_CONTAINER (button), priv->inside);
gtk_drag_dest_set (GTK_WIDGET (button),
GTK_DEST_DEFAULT_HIGHLIGHT |
......@@ -221,12 +229,16 @@ gimp_font_select_button_new (const gchar *title,
void
gimp_font_select_button_close_popup (GimpFontSelectButton *button)
{
GimpFontSelectButtonPrivate *priv;
g_return_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button));
if (button->priv->temp_font_callback)
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
if (priv->temp_font_callback)
{
gimp_font_select_destroy (button->priv->temp_font_callback);
button->priv->temp_font_callback = NULL;
gimp_font_select_destroy (priv->temp_font_callback);
priv->temp_font_callback = NULL;
}
}
......@@ -245,7 +257,7 @@ gimp_font_select_button_get_font_name (GimpFontSelectButton *button)
{
g_return_val_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button), NULL);
return button->priv->font_name;
return GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button)->font_name;
}
/**
......@@ -261,10 +273,14 @@ void
gimp_font_select_button_set_font_name (GimpFontSelectButton *button,
const gchar *font_name)
{
GimpFontSelectButtonPrivate *priv;
g_return_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button));
if (button->priv->temp_font_callback)
gimp_fonts_set_popup (button->priv->temp_font_callback, font_name);
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
if (priv->temp_font_callback)
gimp_fonts_set_popup (priv->temp_font_callback, font_name);
else
gimp_font_select_button_callback (font_name, FALSE, button);
}
......@@ -278,18 +294,18 @@ gimp_font_select_button_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object);
GimpFontSelectButtonPrivate *priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (object);
switch (property_id)
{
case PROP_TITLE:
g_free (button->priv->title);
button->priv->title = g_value_dup_string (value);
g_free (priv->title);
priv->title = g_value_dup_string (value);
g_object_notify (object, "title");
break;
case PROP_FONT_NAME:
gimp_font_select_button_set_font_name (button,
gimp_font_select_button_set_font_name (GIMP_FONT_SELECT_BUTTON (object),
g_value_get_string (value));
break;
......@@ -305,16 +321,16 @@ gimp_font_select_button_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object);
GimpFontSelectButtonPrivate *priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (object);
switch (property_id)
{
case PROP_TITLE:
g_value_set_string (value, button->priv->title);
g_value_set_string (value, priv->title);
break;
case PROP_FONT_NAME:
g_value_set_string (value, button->priv->font_name);
g_value_set_string (value, priv->font_name);
break;
default:
......@@ -328,15 +344,16 @@ gimp_font_select_button_callback (const gchar *name,
gboolean closing,
gpointer data)
{
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (data);
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (data);
GimpFontSelectButtonPrivate *priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
g_free (button->priv->font_name);
button->priv->font_name = g_strdup (name);
g_free (priv->font_name);
priv->font_name = g_strdup (name);
gtk_label_set_text (GTK_LABEL (button->priv->label), name);
gtk_label_set_text (GTK_LABEL (priv->label), name);
if (closing)
button->priv->temp_font_callback = NULL;
priv->temp_font_callback = NULL;
g_signal_emit (button, font_button_signals[FONT_SET], 0, name, closing);
g_object_notify (G_OBJECT (button), "font-name");
......@@ -345,19 +362,17 @@ gimp_font_select_button_callback (const gchar *name,
static void
gimp_font_select_button_clicked (GtkButton *button)
{
GimpFontSelectButton *font_button = GIMP_FONT_SELECT_BUTTON (button);
GimpFontSelectButtonPrivate *priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
if (font_button->priv->temp_font_callback)
if (priv->temp_font_callback)
{
/* calling gimp_fonts_set_popup() raises the dialog */
gimp_fonts_set_popup (font_button->priv->temp_font_callback,
font_button->priv->font_name);
gimp_fonts_set_popup (priv->temp_font_callback, priv->font_name);
}
else
{
font_button->priv->temp_font_callback =
gimp_font_select_new (font_button->priv->title,
font_button->priv->font_name,
priv->temp_font_callback =
gimp_font_select_new (priv->title, priv->font_name,
gimp_font_select_button_callback,
button);
}
......@@ -366,19 +381,19 @@ gimp_font_select_button_clicked (GtkButton *button)
static void
gimp_font_select_button_destroy (GtkObject *object)
{
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object);
GimpFontSelectButtonPrivate *priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (object);
if (button->priv->temp_font_callback)
if (priv->temp_font_callback)
{
gimp_font_select_destroy (button->priv->temp_font_callback);
button->priv->temp_font_callback = NULL;
gimp_font_select_destroy (priv->temp_font_callback);
priv->temp_font_callback = NULL;
}
g_free (button->priv->title);
button->priv->title = NULL;
g_free (priv->title);
priv->title = NULL;
g_free (button->priv->font_name);
button->priv->font_name = NULL;
g_free (priv->font_name);
priv->font_name = NULL;
GTK_OBJECT_CLASS (gimp_font_select_button_parent_class)->destroy (object);
}
......@@ -424,6 +439,7 @@ gimp_font_select_drag_data_received (GtkWidget *widget,
static GtkWidget *
gimp_font_select_button_create_inside (GimpFontSelectButton *button)
{
GimpFontSelectButtonPrivate *priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
GtkWidget *hbox;
GtkWidget *image;
......@@ -434,8 +450,8 @@ gimp_font_select_button_create_inside (GimpFontSelectButton *button)
image = gtk_image_new_from_stock (GIMP_STOCK_FONT, GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
button->priv->label = gtk_label_new (button->priv->font_name);
gtk_box_pack_start (GTK_BOX (hbox), button->priv->label, TRUE, TRUE, 4);
priv->label = gtk_label_new (priv->font_name);
gtk_box_pack_start (GTK_BOX (hbox), priv->label, TRUE, TRUE, 4);
gtk_widget_show_all (hbox);
......
......@@ -35,15 +35,14 @@ G_BEGIN_DECLS
#define GIMP_FONT_SELECT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_FONT_SELECT_BUTTON, GimpFontSelectButtonClass))
typedef struct _GimpFontSelectButtonClass GimpFontSelectButtonClass;
typedef struct _GimpFontSelectButtonPrivate GimpFontSelectButtonPrivate;
typedef struct _GimpFontSelectButtonClass GimpFontSelectButtonClass;
struct _GimpFontSelectButton
{
GtkButton parent_instance;
GtkButton parent_instance;
/*< private >*/
GimpFontSelectButtonPrivate *priv;
gpointer priv;
};
struct _GimpFontSelectButtonClass
......
......@@ -154,7 +154,7 @@ gimp_zoom_preview_set_adjustments (GimpZoomPreview *preview,
gdouble height;
gdouble ratio;
scrolled_preview->in_drag = TRUE;
gimp_scrolled_preview_freeze (scrolled_preview);
width = GIMP_PREVIEW (preview)->width;
height = GIMP_PREVIEW (preview)->height;
......@@ -183,10 +183,9 @@ gimp_zoom_preview_set_adjustments (GimpZoomPreview *preview,
- height / 2.0,
adj->lower, adj->upper - height);
gtk_adjustment_changed (adj);
scrolled_preview->in_drag = FALSE;
gtk_adjustment_value_changed (adj);
gimp_scrolled_preview_thaw (scrolled_preview);
}
static void
......@@ -259,7 +258,7 @@ gimp_zoom_preview_scroll_event (GtkWidget *widget,
{
GimpZoomPreviewPrivate *priv = GIMP_ZOOM_PREVIEW_GET_PRIVATE (preview);
GIMP_SCROLLED_PREVIEW (preview)->in_drag = TRUE;
gimp_scrolled_preview_freeze (GIMP_SCROLLED_PREVIEW (preview));
switch (event->direction)
{
......@@ -275,7 +274,7 @@ gimp_zoom_preview_scroll_event (GtkWidget *widget,
break;
}
GIMP_SCROLLED_PREVIEW (preview)->in_drag = FALSE;
gimp_scrolled_preview_thaw (GIMP_SCROLLED_PREVIEW (preview));
}
return FALSE;
......
......@@ -49,8 +49,8 @@ typedef struct
GDestroyNotify sensitivity_destroy;
} GimpIntComboBoxPrivate;
#define GIMP_INT_COMBO_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_INT_COMBO_BOX, GimpIntComboBoxPrivate))
#define GIMP_INT_COMBO_BOX_GET_PRIVATE(obj) \
((GimpIntComboBoxPrivate *) ((GimpIntComboBox *) (obj))->priv)
static void gimp_int_combo_box_finalize (GObject *object);
......@@ -106,10 +106,16 @@ gimp_int_combo_box_class_init (GimpIntComboBoxClass *klass)
static void
gimp_int_combo_box_init (GimpIntComboBox *combo_box)
{
GimpIntComboBoxPrivate *priv = GIMP_INT_COMBO_BOX_GET_PRIVATE (combo_box);
GimpIntComboBoxPrivate *priv;
GtkListStore *store;
GtkCellRenderer *cell;
combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
GIMP_TYPE_INT_COMBO_BOX,
GimpIntComboBoxPrivate);
priv = GIMP_INT_COMBO_BOX_GET_PRIVATE (combo_box);
store = gimp_int_store_new ();
gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (store));
g_object_unref (store);
......
......@@ -42,8 +42,10 @@ struct _GimpIntComboBox
{
GtkComboBox parent_instance;
/*< private >*/
gpointer priv;
/* Padding for future expansion (should have gone to the class) */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
......
......@@ -60,9 +60,7 @@ enum
};
typedef struct _GimpPageSelectorPrivate GimpPageSelectorPrivate;
struct _GimpPageSelectorPrivate
typedef struct
{
gint n_pages;
GimpPageSelectorTarget target;
......@@ -78,9 +76,10 @@ struct _GimpPageSelectorPrivate
gint default_item_width;
gint max_item_width;
guint item_width_idle_id;
};
} GimpPageSelectorPrivate;
#define GIMP_PAGE_SELECTOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_PAGE_SELECTOR, GimpPageSelectorPrivate))
#define GIMP_PAGE_SELECTOR_GET_PRIVATE(obj) \
((GimpPageSelectorPrivate *) ((GimpPageSelector *) (obj))->priv)
static void gimp_page_selector_dispose (GObject *object);
......@@ -209,7 +208,7 @@ gimp_page_selector_class_init (GimpPageSelectorClass *klass)
static void
gimp_page_selector_init (GimpPageSelector *selector)
{
GimpPageSelectorPrivate *priv = GIMP_PAGE_SELECTOR_GET_PRIVATE (selector);
GimpPageSelectorPrivate *priv;
GtkWidget *vbox;
GtkWidget *sw;
GtkWidget *hbox;
......@@ -218,6 +217,12 @@ gimp_page_selector_init (GimpPageSelector *selector)
GtkWidget *label;
GtkWidget *combo;
selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (selector,
GIMP_TYPE_PAGE_SELECTOR,
GimpPageSelectorPrivate);
priv = GIMP_PAGE_SELECTOR_GET_PRIVATE (selector);
priv->n_pages = 0;
priv->target = GIMP_PAGE_SELECTOR_TARGET_LAYERS;
......
......@@ -39,7 +39,9 @@ typedef struct _GimpPageSelectorClass GimpPageSelectorClass;
struct _GimpPageSelector
{
GtkVBox parent_instance;
GtkVBox parent_instance;
gpointer priv;
};
struct _GimpPageSelectorClass
......
......@@ -40,9 +40,16 @@ typedef struct
{
GtkPolicyType hscr_policy;
GtkPolicyType vscr_policy;
gint drag_x;
gint drag_y;
gint drag_xoff;
gint drag_yoff;
gboolean in_drag;
gint frozen;
} GimpScrolledPreviewPrivate;
#define GIMP_SCROLLED_PREVIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_SCROLLED_PREVIEW, GimpScrolledPreviewPrivate))
#define GIMP_SCROLLED_PREVIEW_GET_PRIVATE(obj) \
((GimpScrolledPreviewPrivate *) ((GimpScrolledPreview *) (obj))->priv)
static void gimp_scrolled_preview_class_init (GimpScrolledPreviewClass *klass);
......@@ -132,16 +139,24 @@ gimp_scrolled_preview_class_init (GimpScrolledPreviewClass *klass)
static void
gimp_scrolled_preview_init (GimpScrolledPreview *preview)
{
GimpScrolledPreviewPrivate *priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
GtkWidget *image;
GtkObject *adj;
GimpScrolledPreviewPrivate *priv;
GtkWidget *image;
GtkObject *adj;
preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
GIMP_TYPE_SCROLLED_PREVIEW,
GimpScrolledPreviewPrivate);
priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
preview->in_drag = FALSE;
preview->nav_popup = NULL;
priv->hscr_policy = GTK_POLICY_AUTOMATIC;
priv->vscr_policy = GTK_POLICY_AUTOMATIC;
priv->in_drag = FALSE;
priv->frozen = 0;
/* scrollbars */
adj = gtk_adjustment_new (0, 0, GIMP_PREVIEW (preview)->width - 1, 1.0,
GIMP_PREVIEW (preview)->width,
......@@ -361,7 +376,8 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
GdkEvent *event,
GimpScrolledPreview *preview)
{
GdkEventButton *button_event = (GdkEventButton *) event;
GimpScrolledPreviewPrivate *priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
GdkEventButton *button_event = (GdkEventButton *) event;
switch (event->type)
{
......@@ -369,12 +385,11 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
switch (button_event->button)
{
case 1:
gtk_widget_get_pointer (area, &preview->drag_x, &preview->drag_y);
gtk_widget_get_pointer (area, &priv->drag_x, &priv->drag_y);
preview->drag_xoff = GIMP_PREVIEW (preview)->xoff;
preview->drag_yoff = GIMP_PREVIEW (preview)->yoff;
preview->in_drag = TRUE;
priv->drag_xoff = GIMP_PREVIEW (preview)->xoff;
priv->drag_yoff = GIMP_PREVIEW (preview)->yoff;
priv->in_drag = TRUE;
gtk_grab_add (area);
break;
......@@ -387,15 +402,15 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
break;
case GDK_BUTTON_RELEASE:
if (preview->in_drag && button_event->button == 1)
if (priv->in_drag && button_event->button == 1)
{
gtk_grab_remove (area);
preview->in_drag = FALSE;
priv->in_drag = FALSE;
}
break;
case GDK_MOTION_NOTIFY:
if (preview->in_drag)
if (priv->in_drag)
{
gint x, y;
gint dx, dy;
......@@ -403,15 +418,15 @@ gimp_scrolled_preview_area_event (GtkWidget *area,
gtk_widget_get_pointer (area, &x, &y);
dx = x - preview->drag_x;
dy = y - preview->drag_y;
dx = x - priv->drag_x;
dy = y - priv->drag_y;
xoff = CLAMP (preview->drag_xoff - dx,
xoff = CLAMP (priv->drag_xoff - dx,
0,
GIMP_PREVIEW (preview)->xmax -
GIMP_PREVIEW (preview)->xmin -
GIMP_PREVIEW (preview)->width);
yoff = CLAMP (preview->drag_yoff - dy,
yoff = CLAMP (priv->drag_yoff - dy,
0,
GIMP_PREVIEW (preview)->ymax -
GIMP_PREVIEW (preview)->ymin -
......@@ -495,12 +510,14 @@ static void
gimp_scrolled_preview_h_scroll (GtkAdjustment *hadj,
GimpPreview *preview)
{
GimpScrolledPreviewPrivate *priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
preview->xoff = hadj->value;
gimp_preview_area_set_offsets (GIMP_PREVIEW_AREA (preview->area),
preview->xoff, preview->yoff);
if (! GIMP_SCROLLED_PREVIEW (preview)->in_drag)
if (! (priv->in_drag || priv->frozen))
{
gimp_preview_draw (preview);
gimp_preview_invalidate (preview);
......@@ -511,12 +528,14 @@ static void
gimp_scrolled_preview_v_scroll (GtkAdjustment *vadj,
GimpPreview *preview)
{
GimpScrolledPreviewPrivate *priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
preview->yoff = vadj->value;
gimp_preview_area_set_offsets (GIMP_PREVIEW_AREA (preview->area),
preview->xoff, preview->yoff);
if (! GIMP_SCROLLED_PREVIEW (preview)->in_drag)
if (! (priv->in_drag || priv->frozen))
{
gimp_preview_draw (preview);
gimp_preview_invalidate (preview);
......@@ -801,3 +820,60 @@ gimp_scrolled_preview_set_policy (GimpScrolledPreview *preview,
gtk_widget_queue_resize (GIMP_PREVIEW (preview)->area);
}
/**
* gimp_scrolled_preview_freeze:
* @preview: a #GimpScrolledPreview
*
* While the @preview is frozen, it is not going to redraw itself in
* response to scroll events.
*
* This function should only be used to implement widgets derived from
* #GimpScrolledPreview. There is no point in calling this from a plug-in.
*
* Since: GIMP 2.4
**/
void
gimp_scrolled_preview_freeze (GimpScrolledPreview *preview)
{
GimpScrolledPreviewPrivate *priv;
g_return_if_fail (GIMP_IS_SCROLLED_PREVIEW (preview));
priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
priv->frozen++;
}
/**
* gimp_scrolled_preview_thaw:
* @preview: a #GimpScrolledPreview
*
* While the @preview is frozen, it is not going to redraw itself in
* response to scroll events.
*
* This function should only be used to implement widgets derived from
* #GimpScrolledPreview. There is no point in calling this from a plug-in.
*
* Since: GIMP 2.4
**/
void
gimp_scrolled_preview_thaw (GimpScrolledPreview *preview)
{
GimpScrolledPreviewPrivate *priv;
g_return_if_fail (GIMP_IS_SCROLLED_PREVIEW (preview));
priv = GIMP_SCROLLED_PREVIEW_GET_PRIVATE (preview);
g_return_if_fail (priv->frozen > 0);
priv->frozen--;
if (! priv->frozen)
{
gimp_preview_draw (GIMP_PREVIEW (preview));
gimp_preview_invalidate (GIMP_PREVIEW (preview));
}
}
......@@ -53,10 +53,7 @@ struct _GimpScrolledPreview
GdkGC *nav_gc;
/*< private >*/
gint drag_x, drag_y;
gint drag_xoff, drag_yoff;
gboolean in_drag;
gpointer priv;
};
struct _GimpScrolledPreviewClass
......@@ -80,6 +77,11 @@ void gimp_scrolled_preview_set_policy (GimpScrolledPreview *preview,
GtkPolicyType hscrollbar_policy,
GtkPolicyType vscrollbar_policy);
/* only for use from derived widgets */
void gimp_scrolled_preview_freeze (GimpScrolledPreview *preview);
void gimp_scrolled_preview_thaw (GimpScrolledPreview *preview);
G_END_DECLS
#endif /* __GIMP_SCROLLED_PREVIEW_H__ */