Commit f4f106ad authored by Michael Natterer's avatar Michael Natterer 😴

libimp*: add private pointers to all instance structs

even if we don't have private members (yet). Also make class padding 8
pointers in all headers. This commit moves nothing to private, it just
makes all headers consistent and adjusts .c files accordigly.
parent 4afb7ca4
......@@ -49,21 +49,18 @@ enum
PROP_DRAWABLE_ID
};
typedef struct
struct _GimpAspectPreviewPrivate
{
gint32 drawable_ID;
} GimpAspectPreviewPrivate;
};
typedef struct
{
gboolean update;
} PreviewSettings;
#define GET_PRIVATE(obj) (((GimpAspectPreview *) (obj))->priv)
#define GIMP_ASPECT_PREVIEW_GET_PRIVATE(obj) \
G_TYPE_INSTANCE_GET_PRIVATE (preview, \
GIMP_TYPE_ASPECT_PREVIEW, \
GimpAspectPreviewPrivate)
static void gimp_aspect_preview_constructed (GObject *object);
static void gimp_aspect_preview_dispose (GObject *object);
......@@ -144,6 +141,10 @@ gimp_aspect_preview_class_init (GimpAspectPreviewClass *klass)
static void
gimp_aspect_preview_init (GimpAspectPreview *preview)
{
preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
GIMP_TYPE_ASPECT_PREVIEW,
GimpAspectPreviewPrivate);
g_object_set (GIMP_PREVIEW (preview)->area,
"check-size", gimp_check_size (),
"check-type", gimp_check_type (),
......@@ -197,7 +198,7 @@ gimp_aspect_preview_get_property (GObject *object,
GParamSpec *pspec)
{
GimpAspectPreview *preview = GIMP_ASPECT_PREVIEW (object);
GimpAspectPreviewPrivate *priv = GIMP_ASPECT_PREVIEW_GET_PRIVATE (preview);
GimpAspectPreviewPrivate *priv = GET_PRIVATE (preview);
switch (property_id)
{
......@@ -241,7 +242,7 @@ gimp_aspect_preview_style_updated (GtkWidget *widget)
if (preview->area)
{
GimpAspectPreviewPrivate *priv = GIMP_ASPECT_PREVIEW_GET_PRIVATE (preview);
GimpAspectPreviewPrivate *priv = GET_PRIVATE (preview);
gint width;
gint height;
gint size;
......@@ -286,7 +287,7 @@ gimp_aspect_preview_draw_buffer (GimpPreview *preview,
const guchar *buffer,
gint rowstride)
{
GimpAspectPreviewPrivate *priv = GIMP_ASPECT_PREVIEW_GET_PRIVATE (preview);
GimpAspectPreviewPrivate *priv = GET_PRIVATE (preview);
gint32 image_ID;
image_ID = gimp_item_get_image (priv->drawable_ID);
......@@ -337,7 +338,7 @@ gimp_aspect_preview_transform (GimpPreview *preview,
gint *dest_x,
gint *dest_y)
{
GimpAspectPreviewPrivate *priv = GIMP_ASPECT_PREVIEW_GET_PRIVATE (preview);
GimpAspectPreviewPrivate *priv = GET_PRIVATE (preview);
*dest_x = (gdouble) src_x * preview->width / gimp_drawable_width (priv->drawable_ID);
*dest_y = (gdouble) src_y * preview->height / gimp_drawable_height (priv->drawable_ID);
......@@ -350,7 +351,7 @@ gimp_aspect_preview_untransform (GimpPreview *preview,
gint *dest_x,
gint *dest_y)
{
GimpAspectPreviewPrivate *priv = GIMP_ASPECT_PREVIEW_GET_PRIVATE (preview);
GimpAspectPreviewPrivate *priv = GET_PRIVATE (preview);
*dest_x = (gdouble) src_x * gimp_drawable_width (priv->drawable_ID) / preview->width;
*dest_y = (gdouble) src_y * gimp_drawable_height (priv->drawable_ID) / preview->height;
......@@ -360,7 +361,7 @@ static void
gimp_aspect_preview_set_drawable_id (GimpAspectPreview *preview,
gint32 drawable_ID)
{
GimpAspectPreviewPrivate *priv = GIMP_ASPECT_PREVIEW_GET_PRIVATE (preview);
GimpAspectPreviewPrivate *priv = GET_PRIVATE (preview);
gint d_width;
gint d_height;
gint width;
......
......@@ -39,11 +39,14 @@ G_BEGIN_DECLS
#define GIMP_ASPECT_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_ASPECT_PREVIEW, GimpAspectPreviewClass))
typedef struct _GimpAspectPreviewClass GimpAspectPreviewClass;
typedef struct _GimpAspectPreviewPrivate GimpAspectPreviewPrivate;
typedef struct _GimpAspectPreviewClass GimpAspectPreviewClass;
struct _GimpAspectPreview
{
GimpPreview parent_instance;
GimpPreview parent_instance;
GimpAspectPreviewPrivate *priv;
};
struct _GimpAspectPreviewClass
......@@ -55,6 +58,10 @@ struct _GimpAspectPreviewClass
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
void (* _gimp_reserved5) (void);
void (* _gimp_reserved6) (void);
void (* _gimp_reserved7) (void);
void (* _gimp_reserved8) (void);
};
......
......@@ -47,9 +47,22 @@
#define CELL_SIZE 20
#define GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_BRUSH_SELECT_BUTTON, GimpBrushSelectButtonPrivate))
enum
{
BRUSH_SET,
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_TITLE,
PROP_BRUSH_NAME,
PROP_BRUSH_OPACITY,
PROP_BRUSH_SPACING,
PROP_BRUSH_PAINT_MODE
};
typedef struct _GimpBrushSelectButtonPrivate GimpBrushSelectButtonPrivate;
struct _GimpBrushSelectButtonPrivate
{
......@@ -68,21 +81,7 @@ struct _GimpBrushSelectButtonPrivate
GtkWidget *popup;
};
enum
{
BRUSH_SET,
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_TITLE,
PROP_BRUSH_NAME,
PROP_BRUSH_OPACITY,
PROP_BRUSH_SPACING,
PROP_BRUSH_PAINT_MODE
};
#define GET_PRIVATE(obj) (((GimpBrushSelectButton *) (obj))->priv)
/* local function prototypes */
......@@ -284,7 +283,12 @@ gimp_brush_select_button_init (GimpBrushSelectButton *button)
gint color_data_size;
guint8 *color_data;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
GIMP_TYPE_BRUSH_SELECT_BUTTON,
GimpBrushSelectButtonPrivate);
priv = GET_PRIVATE (button);
priv->brush_name = gimp_context_get_brush ();
gimp_brush_get_pixels (priv->brush_name,
......@@ -374,7 +378,7 @@ gimp_brush_select_button_get_brush (GimpBrushSelectButton *button,
g_return_val_if_fail (GIMP_IS_BRUSH_SELECT_BUTTON (button), NULL);
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
priv = GET_PRIVATE (button);
if (opacity)
*opacity = priv->opacity;
......@@ -476,9 +480,7 @@ gimp_brush_select_button_set_brush (GimpBrushSelectButton *button,
static void
gimp_brush_select_button_finalize (GObject *object)
{
GimpBrushSelectButtonPrivate *priv;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (object);
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (object);
g_free (priv->brush_name);
priv->brush_name = NULL;
......@@ -499,13 +501,11 @@ gimp_brush_select_button_set_property (GObject *object,
GParamSpec *pspec)
{
GimpBrushSelectButton *button = GIMP_BRUSH_SELECT_BUTTON (object);
GimpBrushSelectButtonPrivate *priv;
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
gdouble opacity;
gint32 spacing;
gint32 paint_mode;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
switch (property_id)
{
case PROP_TITLE:
......@@ -544,9 +544,7 @@ gimp_brush_select_button_get_property (GObject *object,
GParamSpec *pspec)
{
GimpBrushSelectButton *button = GIMP_BRUSH_SELECT_BUTTON (object);
GimpBrushSelectButtonPrivate *priv;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
switch (property_id)
{
......@@ -582,14 +580,9 @@ gimp_brush_select_button_callback (const gchar *name,
gboolean dialog_closing,
gpointer data)
{
GimpBrushSelectButton *button;
GimpBrushSelectButtonPrivate *priv;
GimpSelectButton *select_button;
button = GIMP_BRUSH_SELECT_BUTTON (data);
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
select_button = GIMP_SELECT_BUTTON (button);
GimpBrushSelectButton *button = GIMP_BRUSH_SELECT_BUTTON (data);
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
GimpSelectButton *select_button = GIMP_SELECT_BUTTON (button);
g_free (priv->brush_name);
g_free (priv->mask_data);
......@@ -617,11 +610,8 @@ gimp_brush_select_button_callback (const gchar *name,
static void
gimp_brush_select_button_clicked (GimpBrushSelectButton *button)
{
GimpBrushSelectButtonPrivate *priv;
GimpSelectButton *select_button;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
select_button = GIMP_SELECT_BUTTON (button);
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
GimpSelectButton *select_button = GIMP_SELECT_BUTTON (button);
if (select_button->temp_callback)
{
......@@ -645,9 +635,7 @@ gimp_brush_select_button_clicked (GimpBrushSelectButton *button)
static void
gimp_brush_select_preview_resize (GimpBrushSelectButton *button)
{
GimpBrushSelectButtonPrivate *priv;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
if (priv->width > 0 && priv->height > 0)
gimp_brush_select_preview_update (priv->preview,
......@@ -661,11 +649,9 @@ gimp_brush_select_preview_events (GtkWidget *widget,
GdkEvent *event,
GimpBrushSelectButton *button)
{
GimpBrushSelectButtonPrivate *priv;
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
GdkEventButton *bevent;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
if (priv->mask_data)
{
switch (event->type)
......@@ -773,7 +759,7 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
gint x,
gint y)
{
GimpBrushSelectButtonPrivate *priv;
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
GtkWidget *frame;
GtkWidget *preview;
GdkMonitor *monitor;
......@@ -781,8 +767,6 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
gint x_org;
gint y_org;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
if (priv->popup)
gimp_brush_select_button_close_popup (button);
......@@ -830,9 +814,7 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
static void
gimp_brush_select_button_close_popup (GimpBrushSelectButton *button)
{
GimpBrushSelectButtonPrivate *priv;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (button);
if (priv->popup)
{
......@@ -883,12 +865,10 @@ gimp_brush_select_drag_data_received (GimpBrushSelectButton *button,
static GtkWidget *
gimp_brush_select_button_create_inside (GimpBrushSelectButton *brush_button)
{
GimpBrushSelectButtonPrivate *priv = GET_PRIVATE (brush_button);
GtkWidget *hbox;
GtkWidget *frame;
GtkWidget *button;
GimpBrushSelectButtonPrivate *priv;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (brush_button);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
......
......@@ -40,11 +40,14 @@ G_BEGIN_DECLS
#define GIMP_BRUSH_SELECT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_BRUSH_SELECT_BUTTON, GimpBrushSelectButtonClass))
typedef struct _GimpBrushSelectButtonPrivate GimpBrushSelectButtonPrivate;
typedef struct _GimpBrushSelectButtonClass GimpBrushSelectButtonClass;
struct _GimpBrushSelectButton
{
GimpSelectButton parent_instance;
GimpSelectButton parent_instance;
GimpBrushSelectButtonPrivate *priv;
};
struct _GimpBrushSelectButtonClass
......@@ -67,6 +70,10 @@ struct _GimpBrushSelectButtonClass
void (*_gimp_reserved2) (void);
void (*_gimp_reserved3) (void);
void (*_gimp_reserved4) (void);
void (*_gimp_reserved5) (void);
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
};
......
......@@ -49,11 +49,6 @@ enum
PROP_DRAWABLE_ID
};
typedef struct
{
gint32 drawable_ID;
} GimpDrawablePreviewPrivate;
typedef struct
{
gint x;
......@@ -62,10 +57,13 @@ typedef struct
} PreviewSettings;
#define GIMP_DRAWABLE_PREVIEW_GET_PRIVATE(obj) \
G_TYPE_INSTANCE_GET_PRIVATE (preview, \
GIMP_TYPE_DRAWABLE_PREVIEW, \
GimpDrawablePreviewPrivate)
struct _GimpDrawablePreviewPrivate
{
gint32 drawable_ID;
};
#define GET_PRIVATE(obj) (((GimpDrawablePreview *) (obj))->priv)
static void gimp_drawable_preview_constructed (GObject *object);
static void gimp_drawable_preview_dispose (GObject *object);
......@@ -142,6 +140,10 @@ gimp_drawable_preview_class_init (GimpDrawablePreviewClass *klass)
static void
gimp_drawable_preview_init (GimpDrawablePreview *preview)
{
preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
GIMP_TYPE_DRAWABLE_PREVIEW,
GimpDrawablePreviewPrivate);
g_object_set (GIMP_PREVIEW (preview)->area,
"check-size", gimp_check_size (),
"check-type", gimp_check_type (),
......@@ -259,7 +261,7 @@ gimp_drawable_preview_style_updated (GtkWidget *widget)
static void
gimp_drawable_preview_draw_original (GimpPreview *preview)
{
GimpDrawablePreviewPrivate *priv = GIMP_DRAWABLE_PREVIEW_GET_PRIVATE (preview);
GimpDrawablePreviewPrivate *priv = GET_PRIVATE (preview);
guchar *buffer;
gint width, height;
gint bpp;
......@@ -304,7 +306,7 @@ gimp_drawable_preview_draw_thumb (GimpPreview *preview,
gint width,
gint height)
{
GimpDrawablePreviewPrivate *priv = GIMP_DRAWABLE_PREVIEW_GET_PRIVATE (preview);
GimpDrawablePreviewPrivate *priv = GET_PRIVATE (preview);
if (priv->drawable_ID > 0)
_gimp_drawable_preview_area_draw_thumb (area, priv->drawable_ID,
......@@ -398,7 +400,7 @@ gimp_drawable_preview_draw_area (GimpDrawablePreview *preview,
const guchar *buf,
gint rowstride)
{
GimpDrawablePreviewPrivate *priv = GIMP_DRAWABLE_PREVIEW_GET_PRIVATE (preview);
GimpDrawablePreviewPrivate *priv = GET_PRIVATE (preview);
GimpPreview *gimp_preview = GIMP_PREVIEW (preview);
gint32 image_ID;
......@@ -510,7 +512,7 @@ gimp_drawable_preview_set_drawable_id (GimpDrawablePreview *drawable_preview,
gint32 drawable_ID)
{
GimpPreview *preview = GIMP_PREVIEW (drawable_preview);
GimpDrawablePreviewPrivate *priv = GIMP_DRAWABLE_PREVIEW_GET_PRIVATE (preview);
GimpDrawablePreviewPrivate *priv = GET_PRIVATE (preview);
gint x1, y1, x2, y2;
g_return_if_fail (priv->drawable_ID < 1);
......@@ -607,7 +609,7 @@ gimp_drawable_preview_get_drawable_id (GimpDrawablePreview *preview)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_PREVIEW (preview), -1);
return GIMP_DRAWABLE_PREVIEW_GET_PRIVATE (preview)->drawable_ID;
return GET_PRIVATE (preview)->drawable_ID;
}
/**
......@@ -626,7 +628,7 @@ gimp_drawable_preview_draw_region (GimpDrawablePreview *preview,
g_return_if_fail (GIMP_IS_DRAWABLE_PREVIEW (preview));
g_return_if_fail (region != NULL);
priv = GIMP_DRAWABLE_PREVIEW_GET_PRIVATE (preview);
priv = GET_PRIVATE (preview);
g_return_if_fail (priv->drawable_ID > 0);
......
......@@ -39,11 +39,14 @@ G_BEGIN_DECLS
#define GIMP_DRAWABLE_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DRAWABLE_PREVIEW, GimpDrawablePreviewClass))
typedef struct _GimpDrawablePreviewClass GimpDrawablePreviewClass;
typedef struct _GimpDrawablePreviewPrivate GimpDrawablePreviewPrivate;
typedef struct _GimpDrawablePreviewClass GimpDrawablePreviewClass;
struct _GimpDrawablePreview
{
GimpScrolledPreview parent_instance;
GimpScrolledPreview parent_instance;
GimpDrawablePreviewPrivate *priv;
};
struct _GimpDrawablePreviewClass
......@@ -55,6 +58,10 @@ struct _GimpDrawablePreviewClass
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
void (* _gimp_reserved5) (void);
void (* _gimp_reserved6) (void);
void (* _gimp_reserved7) (void);
void (* _gimp_reserved8) (void);
};
......
......@@ -44,20 +44,6 @@
**/
#define GIMP_FONT_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_FONT_SELECT_BUTTON, GimpFontSelectButtonPrivate))
typedef struct _GimpFontSelectButtonPrivate GimpFontSelectButtonPrivate;
struct _GimpFontSelectButtonPrivate
{
gchar *title;
gchar *font_name; /* local copy */
GtkWidget *inside;
GtkWidget *label;
};
enum
{
FONT_SET,
......@@ -72,6 +58,19 @@ enum
};
struct _GimpFontSelectButtonPrivate
{
gchar *title;
gchar *font_name; /* local copy */
GtkWidget *inside;
GtkWidget *label;
};
#define GET_PRIVATE(obj) (((GimpFontSelectButton *) (obj))->priv)
/* local function prototypes */
static void gimp_font_select_button_finalize (GObject *object);
......@@ -184,7 +183,11 @@ gimp_font_select_button_init (GimpFontSelectButton *button)
{
GimpFontSelectButtonPrivate *priv;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
GIMP_TYPE_FONT_SELECT_BUTTON,
GimpFontSelectButtonPrivate);
priv = GET_PRIVATE (button);
priv->font_name = NULL;
......@@ -237,12 +240,9 @@ gimp_font_select_button_new (const gchar *title,
const gchar *
gimp_font_select_button_get_font (GimpFontSelectButton *button)
{
GimpFontSelectButtonPrivate *priv;
g_return_val_if_fail (GIMP_IS_FONT_SELECT_BUTTON (button), NULL);
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
return priv->font_name;
return GET_PRIVATE (button)->font_name;
}
/**
......@@ -276,9 +276,7 @@ gimp_font_select_button_set_font (GimpFontSelectButton *button,
static void
gimp_font_select_button_finalize (GObject *object)
{
GimpFontSelectButtonPrivate *priv;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (object);
GimpFontSelectButtonPrivate *priv = GET_PRIVATE (object);
g_free (priv->font_name);
priv->font_name = NULL;
......@@ -296,9 +294,7 @@ gimp_font_select_button_set_property (GObject *object,
GParamSpec *pspec)
{
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object);
GimpFontSelectButtonPrivate *priv;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
GimpFontSelectButtonPrivate *priv = GET_PRIVATE (button);
switch (property_id)
{
......@@ -309,6 +305,7 @@ gimp_font_select_button_set_property (GObject *object,
gimp_font_select_button_set_font (button,
g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -322,9 +319,7 @@ gimp_font_select_button_get_property (GObject *object,
GParamSpec *pspec)
{
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (object);
GimpFontSelectButtonPrivate *priv;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
GimpFontSelectButtonPrivate *priv = GET_PRIVATE (button);
switch (property_id)
{
......@@ -334,6 +329,7 @@ gimp_font_select_button_get_property (GObject *object,
case PROP_FONT_NAME:
g_value_set_string (value, priv->font_name);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -345,14 +341,9 @@ gimp_font_select_button_callback (const gchar *font_name,
gboolean dialog_closing,
gpointer user_data)
{
GimpFontSelectButton *button;
GimpFontSelectButtonPrivate *priv;
GimpSelectButton *select_button;
button = GIMP_FONT_SELECT_BUTTON (user_data);
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
select_button = GIMP_SELECT_BUTTON (button);
GimpFontSelectButton *button = GIMP_FONT_SELECT_BUTTON (user_data);
GimpFontSelectButtonPrivate *priv = GET_PRIVATE (button);
GimpSelectButton *select_button = GIMP_SELECT_BUTTON (button);
g_free (priv->font_name);
priv->font_name = g_strdup (font_name);
......@@ -370,11 +361,8 @@ gimp_font_select_button_callback (const gchar *font_name,
static void
gimp_font_select_button_clicked (GimpFontSelectButton *button)
{
GimpFontSelectButtonPrivate *priv;
GimpSelectButton *select_button;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (button);
select_button = GIMP_SELECT_BUTTON (button);
GimpFontSelectButtonPrivate *priv = GET_PRIVATE (button);
GimpSelectButton *select_button = GIMP_SELECT_BUTTON (button);
if (select_button->temp_callback)
{
......@@ -433,12 +421,10 @@ gimp_font_select_drag_data_received (GimpFontSelectButton *button,
static GtkWidget *
gimp_font_select_button_create_inside (GimpFontSelectButton *font_button)
{
GimpFontSelectButtonPrivate *priv = GET_PRIVATE (font_button);
GtkWidget *button;
GtkWidget *hbox;
GtkWidget *image;
GimpFontSelectButtonPrivate *priv;
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (font_button);
button = gtk_button_new ();
......
......@@ -40,11 +40,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
{
GimpSelectButton parent_instance;
GimpSelectButton parent_instance;
GimpFontSelectButtonPrivate *priv;
};
struct _GimpFontSelectButtonClass
......@@ -61,6 +64,10 @@ struct _GimpFontSelectButtonClass
void (*_gimp_reserved2) (void);
void (*_gimp_reserved3) (void);
void (*_gimp_reserved4) (void);
void (*_gimp_reserved5) (void);
void (*_gimp_reserved6) (void);
void (*_gimp_reserved7) (void);
void (*_gimp_reserved8) (void);
};
......
......@@ -47,10 +47,19 @@
#define CELL_HEIGHT 18
#define CELL_WIDTH 84
enum
{
GRADIENT_SET,
LAST_SIGNAL
};
#define GIMP_GRADIENT_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_GRADIENT_SELECT_BUTTON, GimpGradientSelectButtonPrivate))
enum
{
PROP_0,
PROP_TITLE,
PROP_GRADIENT_NAME
};
typedef struct _GimpGradientSelectButtonPrivate GimpGradientSelectButtonPrivate;
struct _GimpGradientSelectButtonPrivate
{
......@@ -66,18 +75,7 @@ struct _GimpGradientSelectButtonPrivate
GtkWidget *preview;
};
enum
{
GRADIENT_SET,
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_TITLE,
PROP_GRADIENT_NAME
};
#define GET_PRIVATE(obj) (((GimpGradientSelectButton *) (obj))->priv)
/* local function prototypes */
......@@ -206,7 +204,11 @@ gimp_gradient_select_button_init (GimpGradientSelectButton *button)
{
GimpGradientSelectButtonPrivate *priv;
priv = GIMP_GRADIENT_SELECT_BUTTON_GET_PRIVATE (button);
button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
GIMP_TYPE_GRADIENT_SELECT_BUTTON,
GimpGradientSelectButtonPrivate);
priv = GET_PRIVATE (button);
priv->gradient_name = gimp_context_get_gradient ();
priv->sample_size = CELL_WIDTH;
......@@ -261,12 +263,9 @@ gimp_gradient_select_button_new (const gchar *title,
const gchar *
gimp_gradient_select_button_get_gradient (GimpGradientSelectButton *button)
{
GimpGradientSelectButtonPrivate *priv;
g_return_val_if_fail (GIMP_IS_GRADIENT_SELECT_BUTTON (button), NULL);
priv = GIMP_GRADIENT_SELECT_BUTTON_GET_PRIVATE (button);
return priv->gradient_name;
return GET_PRIVATE (button)->gradient_name;
}
/**
......@@ -287,7 +286,7 @@ gimp_gradient_select_button_set_gradient (GimpGradientSelectButton *button,
g_return_if_fail (GIMP_IS_GRADIENT_SELECT_BUTTON (button));