Commit 3b0040c0 authored by Ell's avatar Ell

app, libgimp*, modules: don't use g_type_class_add_private() ...

... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
parent d5586ed9
......@@ -121,9 +121,7 @@ struct _GimpDialogConfigPrivate
};
#define GET_PRIVATE(config) \
G_TYPE_INSTANCE_GET_PRIVATE (config, \
GIMP_TYPE_DIALOG_CONFIG, \
GimpDialogConfigPrivate)
((GimpDialogConfigPrivate *) gimp_dialog_config_get_instance_private ((GimpDialogConfig *) (config)))
static void gimp_dialog_config_constructed (GObject *object);
......@@ -145,7 +143,8 @@ static void gimp_dialog_config_stroke_options_notify (GObject *object,
gpointer data);
G_DEFINE_TYPE (GimpDialogConfig, gimp_dialog_config, GIMP_TYPE_GUI_CONFIG)
G_DEFINE_TYPE_WITH_PRIVATE (GimpDialogConfig, gimp_dialog_config,
GIMP_TYPE_GUI_CONFIG)
#define parent_class gimp_dialog_config_parent_class
......@@ -524,8 +523,6 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
GIMP_TYPE_STROKE_OPTIONS,
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_AGGREGATE);
g_type_class_add_private (klass, sizeof (GimpDialogConfigPrivate));
}
static void
......
......@@ -112,6 +112,7 @@ static void gimp_async_run_callbacks (GimpAsync *async
G_DEFINE_TYPE_WITH_CODE (GimpAsync, gimp_async, G_TYPE_OBJECT,
G_ADD_PRIVATE (GimpAsync)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_WAITABLE,
gimp_async_waitable_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CANCELABLE,
......@@ -134,8 +135,6 @@ gimp_async_class_init (GimpAsyncClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_async_finalize;
g_type_class_add_private (klass, sizeof (GimpAsyncPrivate));
}
static void
......@@ -155,9 +154,7 @@ gimp_async_cancelable_iface_init (GimpCancelableInterface *iface)
static void
gimp_async_init (GimpAsync *async)
{
async->priv = G_TYPE_INSTANCE_GET_PRIVATE (async,
GIMP_TYPE_ASYNC,
GimpAsyncPrivate);
async->priv = gimp_async_get_instance_private (async);
g_mutex_init (&async->priv->mutex);
g_cond_init (&async->priv->cond);
......
......@@ -73,6 +73,7 @@ static void gimp_async_set_async_callback (GimpAsync
G_DEFINE_TYPE_WITH_CODE (GimpAsyncSet, gimp_async_set, G_TYPE_OBJECT,
G_ADD_PRIVATE (GimpAsyncSet)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_WAITABLE,
gimp_async_set_waitable_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CANCELABLE,
......@@ -99,8 +100,6 @@ gimp_async_set_class_init (GimpAsyncSetClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READABLE));
g_type_class_add_private (klass, sizeof (GimpAsyncSetPrivate));
}
static void
......@@ -120,9 +119,7 @@ gimp_async_set_cancelable_iface_init (GimpCancelableInterface *iface)
static void
gimp_async_set_init (GimpAsyncSet *async_set)
{
async_set->priv = G_TYPE_INSTANCE_GET_PRIVATE (async_set,
GIMP_TYPE_ASYNC_SET,
GimpAsyncSetPrivate);
async_set->priv = gimp_async_set_get_instance_private (async_set);
async_set->priv->asyncs = g_hash_table_new (NULL, NULL);
}
......
......@@ -53,7 +53,7 @@ static void gimp_aux_item_set_property (GObject *object,
GParamSpec *pspec);
G_DEFINE_ABSTRACT_TYPE (GimpAuxItem, gimp_aux_item, G_TYPE_OBJECT)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GimpAuxItem, gimp_aux_item, G_TYPE_OBJECT)
static guint gimp_aux_item_signals[LAST_SIGNAL] = { 0 };
......@@ -82,16 +82,12 @@ gimp_aux_item_class_init (GimpAuxItemClass *klass)
0, G_MAXUINT32, 0,
G_PARAM_CONSTRUCT_ONLY |
GIMP_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GimpAuxItemPrivate));
}
static void
gimp_aux_item_init (GimpAuxItem *aux_item)
{
aux_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (aux_item,
GIMP_TYPE_AUX_ITEM,
GimpAuxItemPrivate);
aux_item->priv = gimp_aux_item_get_instance_private (aux_item);
}
static void
......
......@@ -96,6 +96,7 @@ static gchar * gimp_brush_get_checksum (GimpTagged *tag
G_DEFINE_TYPE_WITH_CODE (GimpBrush, gimp_brush, GIMP_TYPE_DATA,
G_ADD_PRIVATE (GimpBrush)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_TAGGED,
gimp_brush_tagged_iface_init))
......@@ -151,8 +152,6 @@ gimp_brush_class_init (GimpBrushClass *klass)
1.0, 5000.0, 20.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_type_class_add_private (klass, sizeof (GimpBrushPrivate));
}
static void
......@@ -164,9 +163,7 @@ gimp_brush_tagged_iface_init (GimpTaggedInterface *iface)
static void
gimp_brush_init (GimpBrush *brush)
{
brush->priv = G_TYPE_INSTANCE_GET_PRIVATE (brush,
GIMP_TYPE_BRUSH,
GimpBrushPrivate);
brush->priv = gimp_brush_get_instance_private (brush);
brush->priv->spacing = 20;
brush->priv->x_axis.x = 15.0;
......
......@@ -69,7 +69,7 @@ typedef struct
GQuark quark; /* used to attach the signal id's of child signals */
} GimpContainerHandler;
struct _GimpContainerPriv
struct _GimpContainerPrivate
{
GType children_type;
GimpContainerPolicy policy;
......@@ -116,6 +116,7 @@ static void gimp_container_disconnect_callback (GimpObject *object,
G_DEFINE_TYPE_WITH_CODE (GimpContainer, gimp_container, GIMP_TYPE_OBJECT,
G_ADD_PRIVATE (GimpContainer)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_container_config_iface_init))
......@@ -212,8 +213,6 @@ gimp_container_class_init (GimpContainerClass *klass)
GIMP_CONTAINER_POLICY_STRONG,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (klass, sizeof (GimpContainerPriv));
}
static void
......@@ -226,9 +225,7 @@ gimp_container_config_iface_init (GimpConfigInterface *iface)
static void
gimp_container_init (GimpContainer *container)
{
container->priv = G_TYPE_INSTANCE_GET_PRIVATE (container,
GIMP_TYPE_CONTAINER,
GimpContainerPriv);
container->priv = gimp_container_get_instance_private (container);
container->priv->handlers = NULL;
container->priv->freeze_count = 0;
......
......@@ -34,13 +34,13 @@
typedef struct _GimpContainerClass GimpContainerClass;
typedef struct _GimpContainerPriv GimpContainerPriv;
typedef struct _GimpContainerPrivate GimpContainerPrivate;
struct _GimpContainer
{
GimpObject parent_instance;
GimpContainerPriv *priv;
GimpContainerPrivate *priv;
};
struct _GimpContainerClass
......
......@@ -106,7 +106,8 @@ static GFile * gimp_data_factory_get_save_dir (GimpDataFactory *fa
GError **error);
G_DEFINE_ABSTRACT_TYPE (GimpDataFactory, gimp_data_factory, GIMP_TYPE_OBJECT)
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GimpDataFactory, gimp_data_factory,
GIMP_TYPE_OBJECT)
#define parent_class gimp_data_factory_parent_class
......@@ -174,16 +175,12 @@ gimp_data_factory_class_init (GimpDataFactoryClass *klass)
NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_type_class_add_private (klass, sizeof (GimpDataFactoryPrivate));
}
static void
gimp_data_factory_init (GimpDataFactory *factory)
{
factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory,
GIMP_TYPE_DATA_FACTORY,
GimpDataFactoryPrivate);
factory->priv = gimp_data_factory_get_instance_private (factory);
factory->priv->async_set = gimp_async_set_new ();
}
......
......@@ -99,7 +99,7 @@ static GimpDataLoader * gimp_data_loader_new (const gchar *name,
static void gimp_data_loader_free (GimpDataLoader *loader);
G_DEFINE_TYPE (GimpDataLoaderFactory, gimp_data_loader_factory,
G_DEFINE_TYPE_WITH_PRIVATE (GimpDataLoaderFactory, gimp_data_loader_factory,
GIMP_TYPE_DATA_FACTORY)
#define parent_class gimp_data_loader_factory_parent_class
......@@ -115,16 +115,12 @@ gimp_data_loader_factory_class_init (GimpDataLoaderFactoryClass *klass)
factory_class->data_init = gimp_data_loader_factory_data_init;
factory_class->data_refresh = gimp_data_loader_factory_data_refresh;
g_type_class_add_private (klass, sizeof (GimpDataLoaderFactoryPrivate));
}
static void
gimp_data_loader_factory_init (GimpDataLoaderFactory *factory)
{
factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory,
GIMP_TYPE_DATA_LOADER_FACTORY,
GimpDataLoaderFactoryPrivate);
factory->priv = gimp_data_loader_factory_get_instance_private (factory);
}
static void
......
......@@ -199,6 +199,7 @@ static GeglNode * gimp_drawable_real_get_source_node (GimpDrawable *drawable)
G_DEFINE_TYPE_WITH_CODE (GimpDrawable, gimp_drawable, GIMP_TYPE_ITEM,
G_ADD_PRIVATE (GimpDrawable)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_COLOR_MANAGED,
gimp_color_managed_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PICKABLE,
......@@ -277,16 +278,12 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
klass->get_source_node = gimp_drawable_real_get_source_node;
g_object_class_override_property (object_class, PROP_BUFFER, "buffer");
g_type_class_add_private (klass, sizeof (GimpDrawablePrivate));
}
static void
gimp_drawable_init (GimpDrawable *drawable)
{
drawable->private = G_TYPE_INSTANCE_GET_PRIVATE (drawable,
GIMP_TYPE_DRAWABLE,
GimpDrawablePrivate);
drawable->private = gimp_drawable_get_instance_private (drawable);
drawable->private->filter_stack = gimp_filter_stack_new (GIMP_TYPE_FILTER);
}
......
......@@ -74,9 +74,7 @@ struct _GimpDynamicsPrivate
};
#define GET_PRIVATE(output) \
G_TYPE_INSTANCE_GET_PRIVATE (output, \
GIMP_TYPE_DYNAMICS, \
GimpDynamicsPrivate)
((GimpDynamicsPrivate *) gimp_dynamics_get_instance_private ((GimpDynamics *) (output)))
static void gimp_dynamics_finalize (GObject *object);
......@@ -106,8 +104,7 @@ static void gimp_dynamics_output_notify (GObject *output,
GimpDynamics *dynamics);
G_DEFINE_TYPE (GimpDynamics, gimp_dynamics,
GIMP_TYPE_DATA)
G_DEFINE_TYPE_WITH_PRIVATE (GimpDynamics, gimp_dynamics, GIMP_TYPE_DATA)
#define parent_class gimp_dynamics_parent_class
......@@ -201,8 +198,6 @@ gimp_dynamics_class_init (GimpDynamicsClass *klass)
NULL, NULL,
GIMP_TYPE_DYNAMICS_OUTPUT,
GIMP_CONFIG_PARAM_AGGREGATE);
g_type_class_add_private (klass, sizeof (GimpDynamicsPrivate));
}
static void
......
......@@ -91,9 +91,7 @@ struct _GimpDynamicsOutputPrivate
};
#define GET_PRIVATE(output) \
G_TYPE_INSTANCE_GET_PRIVATE (output, \
GIMP_TYPE_DYNAMICS_OUTPUT, \
GimpDynamicsOutputPrivate)
((GimpDynamicsOutputPrivate *) gimp_dynamics_output_get_instance_private ((GimpDynamicsOutput *) (output)))
static void gimp_dynamics_output_finalize (GObject *object);
......@@ -117,6 +115,7 @@ static void gimp_dynamics_output_curve_dirty (GimpCurve *curve,
G_DEFINE_TYPE_WITH_CODE (GimpDynamicsOutput, gimp_dynamics_output,
GIMP_TYPE_OBJECT,
G_ADD_PRIVATE (GimpDynamicsOutput)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_dynamics_output_parent_class
......@@ -222,8 +221,6 @@ gimp_dynamics_output_class_init (GimpDynamicsOutputClass *klass)
NULL, NULL,
GIMP_TYPE_CURVE,
GIMP_CONFIG_PARAM_AGGREGATE);
g_type_class_add_private (klass, sizeof (GimpDynamicsOutputPrivate));
}
static void
......
......@@ -108,7 +108,7 @@ static void appstream_text_characters (GMarkupParseContext *contex
gpointer user_data,
GError **error);
G_DEFINE_TYPE (GimpExtension, gimp_extension, GIMP_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GimpExtension, gimp_extension, GIMP_TYPE_OBJECT)
#define parent_class gimp_extension_parent_class
......@@ -136,16 +136,12 @@ gimp_extension_class_init (GimpExtensionClass *klass)
g_param_spec_boolean ("running",
NULL, NULL, FALSE,
GIMP_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GimpExtensionPrivate));
}
static void
gimp_extension_init (GimpExtension *extension)
{
extension->p = G_TYPE_INSTANCE_GET_PRIVATE (extension,
GIMP_TYPE_EXTENSION,
GimpExtensionPrivate);
extension->p = gimp_extension_get_instance_private (extension);
}
static void
......
......@@ -115,7 +115,9 @@ static void gimp_extension_manager_extension_running (GimpExtension
GParamSpec *pspec,
GimpExtensionManager *manager);
G_DEFINE_TYPE_WITH_CODE (GimpExtensionManager, gimp_extension_manager, GIMP_TYPE_OBJECT,
G_DEFINE_TYPE_WITH_CODE (GimpExtensionManager, gimp_extension_manager,
GIMP_TYPE_OBJECT,
G_ADD_PRIVATE (GimpExtensionManager)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_extension_manager_config_iface_init))
......@@ -176,16 +178,12 @@ gimp_extension_manager_class_init (GimpExtensionManagerClass *klass)
g_param_spec_pointer ("plug-in-paths",
NULL, NULL,
GIMP_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GimpExtensionManagerPrivate));
}
static void
gimp_extension_manager_init (GimpExtensionManager *manager)
{
manager->p = G_TYPE_INSTANCE_GET_PRIVATE (manager,
GIMP_TYPE_EXTENSION_MANAGER,
GimpExtensionManagerPrivate);
manager->p = gimp_extension_manager_get_instance_private (manager);
manager->p->extensions = NULL;
manager->p->sys_extensions = NULL;
}
......
......@@ -64,9 +64,7 @@ struct _GimpFillOptionsPrivate
};
#define GET_PRIVATE(options) \
G_TYPE_INSTANCE_GET_PRIVATE (options, \
GIMP_TYPE_FILL_OPTIONS, \
GimpFillOptionsPrivate)
((GimpFillOptionsPrivate *) gimp_fill_options_get_instance_private ((GimpFillOptions *) (options)))
static void gimp_fill_options_config_init (GimpConfigInterface *iface);
......@@ -86,6 +84,7 @@ static gboolean gimp_fill_options_serialize (GimpConfig *config,
G_DEFINE_TYPE_WITH_CODE (GimpFillOptions, gimp_fill_options, GIMP_TYPE_CONTEXT,
G_ADD_PRIVATE (GimpFillOptions)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_fill_options_config_init))
......@@ -129,8 +128,6 @@ gimp_fill_options_class_init (GimpFillOptionsClass *klass)
GIMP_VIEW_SIZE_SMALL,
G_PARAM_CONSTRUCT |
GIMP_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GimpFillOptionsPrivate));
}
static void
......
......@@ -56,9 +56,7 @@ struct _GimpFilterPrivate
GimpApplicator *applicator;
};
#define GET_PRIVATE(filter) G_TYPE_INSTANCE_GET_PRIVATE (filter, \
GIMP_TYPE_FILTER, \
GimpFilterPrivate)
#define GET_PRIVATE(filter) ((GimpFilterPrivate *) gimp_filter_get_instance_private ((GimpFilter *) (filter)))
/* local function prototypes */
......@@ -79,7 +77,7 @@ static gint64 gimp_filter_get_memsize (GimpObject *object,
static GeglNode * gimp_filter_real_get_node (GimpFilter *filter);
G_DEFINE_TYPE (GimpFilter, gimp_filter, GIMP_TYPE_VIEWABLE)
G_DEFINE_TYPE_WITH_PRIVATE (GimpFilter, gimp_filter, GIMP_TYPE_VIEWABLE)
#define parent_class gimp_filter_parent_class
......@@ -120,8 +118,6 @@ gimp_filter_class_init (GimpFilterClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (GimpFilterPrivate));
}
static void
......
......@@ -74,9 +74,7 @@ struct _GimpGroupLayerPrivate
gint reallocate_height;
};
#define GET_PRIVATE(item) G_TYPE_INSTANCE_GET_PRIVATE (item, \
GIMP_TYPE_GROUP_LAYER, \
GimpGroupLayerPrivate)
#define GET_PRIVATE(item) ((GimpGroupLayerPrivate *) gimp_group_layer_get_instance_private ((GimpGroupLayer *) (item)))
static void gimp_projectable_iface_init (GimpProjectableInterface *iface);
......@@ -232,6 +230,7 @@ static void gimp_group_layer_proj_update (GimpProjection *proj,
G_DEFINE_TYPE_WITH_CODE (GimpGroupLayer, gimp_group_layer, GIMP_TYPE_LAYER,
G_ADD_PRIVATE (GimpGroupLayer)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROJECTABLE,
gimp_projectable_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PICKABLE,
......@@ -302,8 +301,6 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
layer_class->get_effective_mode = gimp_group_layer_get_effective_mode;
layer_class->get_excludes_backdrop = gimp_group_layer_get_excludes_backdrop;
g_type_class_add_private (klass, sizeof (GimpGroupLayerPrivate));
if (g_getenv ("GIMP_NO_PASS_THROUGH_STRENGTH_REDUCTION"))
no_pass_through_strength_reduction = TRUE;
}
......
......@@ -58,7 +58,7 @@ static void gimp_guide_set_property (GObject *object,
GParamSpec *pspec);
G_DEFINE_TYPE (GimpGuide, gimp_guide, GIMP_TYPE_AUX_ITEM)
G_DEFINE_TYPE_WITH_PRIVATE (GimpGuide, gimp_guide, GIMP_TYPE_AUX_ITEM)
static void
......@@ -90,15 +90,12 @@ gimp_guide_class_init (GimpGuideClass *klass)
GIMP_TYPE_GUIDE_STYLE,
GIMP_GUIDE_STYLE_NONE,
0);
g_type_class_add_private (klass, sizeof (GimpGuidePrivate));
}
static void
gimp_guide_init (GimpGuide *guide)
{
guide->priv = G_TYPE_INSTANCE_GET_PRIVATE (guide, GIMP_TYPE_GUIDE,
GimpGuidePrivate);
guide->priv = gimp_guide_get_instance_private (guide);
}
static void
......
......@@ -115,7 +115,7 @@ static void gimp_histogram_calculate_async_callback (GimpAsync *a
CalculateContext *context);
G_DEFINE_TYPE (GimpHistogram, gimp_histogram, GIMP_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GimpHistogram, gimp_histogram, GIMP_TYPE_OBJECT)
#define parent_class gimp_histogram_parent_class
......@@ -147,16 +147,12 @@ gimp_histogram_class_init (GimpHistogramClass *klass)
g_param_spec_boolean ("values", NULL, NULL,
FALSE,
G_PARAM_READABLE));
g_type_class_add_private (klass, sizeof (GimpHistogramPrivate));
}
static void
gimp_histogram_init (GimpHistogram *histogram)
{
histogram->priv = G_TYPE_INSTANCE_GET_PRIVATE (histogram,
GIMP_TYPE_HISTOGRAM,
GimpHistogramPrivate);
histogram->priv = gimp_histogram_get_instance_private (histogram);
histogram->priv->n_bins = 256;
}
......
......@@ -33,7 +33,7 @@
#define GIMP_ID_TABLE_END_ID G_MAXINT
struct _GimpIdTablePriv
struct _GimpIdTablePrivate
{
GHashTable *id_table;
gint next_id;
......@@ -45,7 +45,7 @@ static gint64 gimp_id_table_get_memsize (GimpObject *object,
gint64 *gui_size);
G_DEFINE_TYPE (GimpIdTable, gimp_id_table, GIMP_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (GimpIdTable, gimp_id_table, GIMP_TYPE_OBJECT)
#define parent_class gimp_id_table_parent_class
......@@ -55,22 +55,16 @@ gimp_id_table_class_init (GimpIdTableClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpIdTableClass *gimp_id_table_class = GIMP_ID_TABLE_CLASS (klass);
object_class->finalize = gimp_id_table_finalize;
gimp_object_class->get_memsize = gimp_id_table_get_memsize;
g_type_class_add_private (gimp_id_table_class,
sizeof (GimpIdTablePriv));
}
static void
gimp_id_table_init (GimpIdTable *id_table)
{
id_table->priv = G_TYPE_INSTANCE_GET_PRIVATE (id_table,
GIMP_TYPE_ID_TABLE,
GimpIdTablePriv);
id_table->priv = gimp_id_table_get_instance_private (id_table);
id_table->priv->id_table = g_hash_table_new (g_direct_hash, NULL);
id_table->priv->next_id = GIMP_ID_TABLE_START_ID;
......
......@@ -34,13 +34,13 @@
typedef struct _GimpIdTableClass GimpIdTableClass;
typedef struct _GimpIdTablePriv GimpIdTablePriv;
typedef struct _GimpIdTablePrivate GimpIdTablePrivate;
struct _GimpIdTable
{
GimpObject parent_instance;
GimpIdTablePriv *priv;
GimpIdTablePrivate *priv;
};
struct _GimpIdTableClass
......
......@@ -30,8 +30,6 @@ struct _GimpImageFlushAccumulator
};
typedef struct _GimpImagePrivate GimpImagePrivate;
struct _GimpImagePrivate
{
gint ID; /* provides a unique ID */
......@@ -132,10 +130,7 @@ struct _GimpImagePrivate
GimpImageFlushAccumulator flush_accum;
};
#define GIMP_IMAGE_GET_PRIVATE(image) \
G_TYPE_INSTANCE_GET_PRIVATE (image, \
GIMP_TYPE_IMAGE, \
GimpImagePrivate)
#define GIMP_IMAGE_GET_PRIVATE(image) (((GimpImage *) (image))->priv)
void gimp_image_take_mask (GimpImage *image,
GimpChannel *mask);
......
......@@ -250,6 +250,7 @@ static void gimp_image_active_vectors_notify (GimpItemTree *tree,
G_DEFINE_TYPE_WITH_CODE (GimpImage, gimp_image, GIMP_TYPE_VIEWABLE,
G_ADD_PRIVATE (GimpImage)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_COLOR_MANAGED,
gimp_color_managed_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROJECTABLE,
......@@ -650,8 +651,6 @@ gimp_image_class_init (GimpImageClass *klass)
GIMP_TYPE_SYMMETRY,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
g_type_class_add_private (klass, sizeof (GimpImagePrivate));
}
static void
......@@ -691,9 +690,11 @@ gimp_pickable_iface_init (GimpPickableInterface *iface)
static void
gimp_image_init (GimpImage *image)
{
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
GimpImagePrivate *private = gimp_image_get_instance_private (image);
gint i;
image->priv = private;
private->ID = 0;
private->load_proc = NULL;
......
......@@ -34,12 +34,15 @@
typedef struct _GimpImageClass GimpImageClass;
typedef struct _GimpImagePrivate GimpImagePrivate;
struct _GimpImage
{
GimpViewable parent_instance;
Gimp *gimp; /* the GIMP the image belongs to */
GimpImagePrivate *priv;
};
struct _GimpImageClass
......
......@@ -73,9 +73,7 @@ struct _GimpImagefilePrivate
gboolean static_desc;
};
#define GET_PRIVATE(imagefile) G_TYPE_INSTANCE_GET_PRIVATE (imagefile, \
GIMP_TYPE_IMAGEFILE, \
GimpImagefilePrivate)
#define GET_PRIVATE(imagefile) ((GimpImagefilePrivate *) gimp_imagefile_get_instance_private ((GimpImagefile *) (imagefile)))
static void gimp_imagefile_dispose (GObject *object);
......@@ -118,7 +116,7 @@ static void gimp_thumbnail_set_info (GimpThumbnail *thumbnail,
gint num_layers);
G_DEFINE_TYPE (GimpImagefile, gimp_imagefile, GIMP_TYPE_VIEWABLE)
G_DEFINE_TYPE_WITH_PRIVATE (GimpImagefile, gimp_imagefile, GIMP_TYPE_VIEWABLE)
#define parent_class gimp_imagefile_parent_class
......@@ -159,8 +157,6 @@ gimp_imagefile_class_init (GimpImagefileClass *klass)
gimp_thumb_init (creator, NULL);
g_free (creator);
g_type_class_add_private (klass, sizeof (GimpImagefilePrivate));