[gimp/gimp-2-10] app, libgimp*, modules: don't use g_type_class_add_private() ...
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app, libgimp*, modules: don't use g_type_class_add_private() ...
- Date: Tue, 18 Sep 2018 18:45:02 +0000 (UTC)
commit 31b369d09f50340f4b5d6a4674597b11c1689d5e
Author: Ell <ell_se yahoo com>
Date: Tue Sep 18 12:09:39 2018 -0400
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.
app/config/gimpdialogconfig.c | 9 +++------
app/core/gimpasync.c | 7 ++-----
app/core/gimpasyncset.c | 7 ++-----
app/core/gimpauxitem.c | 8 ++------
app/core/gimpbrush.c | 7 ++-----
app/core/gimpcontainer.c | 9 +++------
app/core/gimpcontainer.h | 8 ++++----
app/core/gimpdatafactory.c | 9 +++------
app/core/gimpdataloaderfactory.c | 10 +++-------
app/core/gimpdrawable.c | 7 ++-----
app/core/gimpdynamics.c | 9 ++-------
app/core/gimpdynamicsoutput.c | 7 ++-----
app/core/gimpfilloptions.c | 7 ++-----
app/core/gimpfilter.c | 8 ++------
app/core/gimpgrouplayer.c | 7 ++-----
app/core/gimpguide.c | 7 ++-----
app/core/gimphistogram.c | 8 ++------
app/core/gimpidtable.c | 16 +++++-----------
app/core/gimpidtable.h | 8 ++++----
app/core/gimpimage-private.h | 7 +------
app/core/gimpimage.c | 7 ++++---
app/core/gimpimage.h | 9 ++++++---
app/core/gimpimagefile.c | 8 ++------
app/core/gimpitem.c | 8 ++------
app/core/gimpitemtree.c | 8 ++------
app/core/gimpmybrush.c | 7 ++-----
app/core/gimpprojection.c | 7 ++-----
app/core/gimpsamplepoint.c | 9 +++------
app/core/gimpstrokeoptions.c | 7 ++-----
app/core/gimptagcache.c | 16 +++++-----------
app/core/gimptagcache.h | 8 ++++----
app/core/gimptemplate.c | 7 ++-----
app/core/gimpviewable.c | 7 ++-----
app/display/gimpcanvasarc.c | 10 +++-------
app/display/gimpcanvasboundary.c | 10 +++-------
app/display/gimpcanvasbufferpreview.c | 10 +++-------
app/display/gimpcanvascorner.c | 10 +++-------
app/display/gimpcanvascursor.c | 10 +++-------
app/display/gimpcanvasgrid.c | 9 +++------
app/display/gimpcanvasgroup.c | 9 +++------
app/display/gimpcanvasguide.c | 9 +++------
app/display/gimpcanvashandle.c | 10 +++-------
app/display/gimpcanvasitem.c | 9 ++-------
app/display/gimpcanvaslayerboundary.c | 10 +++-------
app/display/gimpcanvasline.c | 9 +++------
app/display/gimpcanvaspassepartout.c | 10 +++-------
app/display/gimpcanvaspath.c | 10 +++-------
app/display/gimpcanvaspen.c | 10 +++-------
app/display/gimpcanvaspolygon.c | 10 +++-------
app/display/gimpcanvasprogress.c | 7 ++-----
app/display/gimpcanvasproxygroup.c | 10 +++-------
app/display/gimpcanvasrectangle.c | 10 +++-------
app/display/gimpcanvasrectangleguides.c | 10 +++-------
app/display/gimpcanvassamplepoint.c | 10 +++-------
app/display/gimpcanvastextcursor.c | 10 +++-------
app/display/gimpcanvastransformguides.c | 10 +++-------
app/display/gimpcanvastransformpreview.c | 11 ++++-------
app/display/gimpcursorview.c | 9 +++------
app/display/gimpcursorview.h | 8 ++++----
app/display/gimpdisplay.c | 7 ++-----
app/display/gimpimagewindow.c | 7 ++-----
app/display/gimptoolcompass.c | 9 +++------
app/display/gimptooldialog.c | 9 +++------
app/display/gimptoolgui.c | 8 ++------
app/display/gimptoolgyroscope.c | 9 +++------
app/display/gimptoolhandlegrid.c | 10 +++-------
app/display/gimptoolline.c | 8 ++------
app/display/gimptoolpath.c | 8 ++------
app/display/gimptoolpolygon.c | 9 +++------
app/display/gimptoolrectangle.c | 10 +++-------
app/display/gimptoolrotategrid.c | 10 +++-------
app/display/gimptoolsheargrid.c | 10 +++-------
app/display/gimptooltransformgrid.c | 10 +++-------
app/display/gimptoolwidget.c | 8 ++------
app/display/gimptoolwidgetgroup.c | 9 +++------
app/gui/gimpuiconfigurer.c | 9 +++------
app/paint/gimpmybrushcore.c | 9 +++------
app/text/gimpfontfactory.c | 9 +++------
app/text/gimptextlayer.c | 8 ++------
app/tools/gimpfreeselecttool.c | 10 +++-------
app/tools/gimprectangleselecttool.c | 10 +++-------
app/widgets/gimpbuffersourcebox.c | 10 +++-------
app/widgets/gimpchanneltreeview.c | 9 +++------
app/widgets/gimpchanneltreeview.h | 8 ++++----
app/widgets/gimpcircle.c | 8 ++------
app/widgets/gimpcontainereditor.c | 7 ++-----
app/widgets/gimpcontainericonview.c | 9 +++------
app/widgets/gimpcontainericonview.h | 20 ++++++++++----------
app/widgets/gimpcontainertreestore.c | 10 +++-------
app/widgets/gimpcontainertreeview-private.h | 2 +-
app/widgets/gimpcontainertreeview.c | 7 ++-----
app/widgets/gimpcontainertreeview.h | 22 +++++++++++-----------
app/widgets/gimpdashboard.c | 7 ++-----
app/widgets/gimpdatafactoryview.c | 19 ++++++++-----------
app/widgets/gimpdatafactoryview.h | 8 ++++----
app/widgets/gimpdeviceeditor.c | 9 +++------
app/widgets/gimpdeviceinfoeditor.c | 9 +++------
app/widgets/gimpdevicemanager.c | 9 +++------
app/widgets/gimpdial.c | 8 ++------
app/widgets/gimpdialogfactory.c | 9 +++------
app/widgets/gimpdock.c | 8 ++------
app/widgets/gimpdockable.c | 7 ++-----
app/widgets/gimpdockbook.c | 8 ++------
app/widgets/gimpdockcolumns.c | 8 ++------
app/widgets/gimpdockwindow.c | 7 ++-----
app/widgets/gimpdynamicsoutputeditor.c | 11 +++--------
app/widgets/gimpeditor.c | 7 ++-----
app/widgets/gimphighlightablebutton.c | 9 +++------
app/widgets/gimpiconpicker.c | 8 ++------
app/widgets/gimpiconsizescale.c | 9 +++------
app/widgets/gimpitemtreeview.c | 9 +++------
app/widgets/gimpitemtreeview.h | 8 ++++----
app/widgets/gimplayermodebox.c | 9 ++-------
app/widgets/gimplayermodecombobox.c | 10 +++-------
app/widgets/gimplayertreeview.c | 9 +++------
app/widgets/gimplayertreeview.h | 8 ++++----
app/widgets/gimpmenudock.c | 4 +---
app/widgets/gimpmenufactory.c | 9 +++------
app/widgets/gimpmeter.c | 8 ++------
app/widgets/gimppanedbox.c | 8 ++------
app/widgets/gimppickablebutton.c | 9 +++------
app/widgets/gimppickablepopup.c | 9 +++------
app/widgets/gimppolar.c | 8 ++------
app/widgets/gimpprefsbox.c | 8 ++------
app/widgets/gimpsearchpopup.c | 8 ++------
app/widgets/gimpsessioninfo.c | 7 ++-----
app/widgets/gimpsettingsbox.c | 8 ++------
app/widgets/gimpsettingseditor.c | 9 +++------
app/widgets/gimpsizebox.c | 7 ++-----
app/widgets/gimpspinscale.c | 9 +++------
app/widgets/gimpsymmetryeditor.c | 10 +++-------
app/widgets/gimptemplateeditor.c | 9 +++------
app/widgets/gimptoolbox.c | 8 ++------
app/widgets/gimptooleditor.c | 9 +++------
app/widgets/gimptooloptionseditor.c | 7 ++-----
app/widgets/gimptoolpalette.c | 9 +++------
app/widgets/gimptoolpreseteditor.c | 7 ++-----
app/widgets/gimpviewrenderer.c | 8 ++------
app/widgets/gimpviewrendererdrawable.c | 11 ++++-------
app/widgets/gimpwindow.c | 8 ++------
libgimp/gimpaspectpreview.c | 9 +++------
libgimp/gimpbrushselectbutton.c | 9 +++------
libgimp/gimpdrawablepreview.c | 10 +++-------
libgimp/gimpfontselectbutton.c | 9 +++------
libgimp/gimpgradientselectbutton.c | 10 ++++------
libgimp/gimppaletteselectbutton.c | 9 +++------
libgimp/gimppatternselectbutton.c | 9 +++------
libgimp/gimptilebackendplugin.c | 10 +++-------
libgimp/gimpzoompreview.c | 9 +++------
libgimpcolor/gimpcolorprofile.c | 9 ++-------
libgimpcolor/gimpcolortransform.c | 10 +++-------
libgimpconfig/gimpcolorconfig.c | 7 ++-----
libgimpwidgets/gimpbusybox.c | 8 ++------
libgimpwidgets/gimpcellrenderertoggle.c | 10 +++-------
libgimpwidgets/gimpcolorarea.c | 9 +++------
libgimpwidgets/gimpcolordisplay.c | 5 ++---
libgimpwidgets/gimpcolorprofilechooserdialog.c | 11 ++++-------
libgimpwidgets/gimpcolorprofilecombobox.c | 11 +++--------
libgimpwidgets/gimpcolorprofileview.c | 10 +++-------
libgimpwidgets/gimpcolorscale.c | 8 ++------
libgimpwidgets/gimpcolorselector.c | 9 +++------
libgimpwidgets/gimpdialog.c | 8 ++------
libgimpwidgets/gimpintcombobox.c | 9 +++------
libgimpwidgets/gimpintstore.c | 5 ++---
libgimpwidgets/gimpnumberpairentry.c | 9 +++------
libgimpwidgets/gimppageselector.c | 8 ++------
libgimpwidgets/gimppreviewarea.c | 9 +++------
libgimpwidgets/gimpruler.c | 6 ++----
libgimpwidgets/gimpstringcombobox.c | 9 +++------
libgimpwidgets/gimpunitstore.c | 7 ++-----
libgimpwidgets/gimpzoommodel.c | 8 ++------
modules/gimpcolorwheel.c | 11 ++++-------
172 files changed, 485 insertions(+), 1036 deletions(-)
---
diff --git a/app/config/gimpdialogconfig.c b/app/config/gimpdialogconfig.c
index b470da07bb..766d1d18f4 100644
--- a/app/config/gimpdialogconfig.c
+++ b/app/config/gimpdialogconfig.c
@@ -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
diff --git a/app/core/gimpasync.c b/app/core/gimpasync.c
index 647ffd9f05..77ecd947f1 100644
--- a/app/core/gimpasync.c
+++ b/app/core/gimpasync.c
@@ -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);
diff --git a/app/core/gimpasyncset.c b/app/core/gimpasyncset.c
index 91aab579d5..f1b611e6ee 100644
--- a/app/core/gimpasyncset.c
+++ b/app/core/gimpasyncset.c
@@ -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);
}
diff --git a/app/core/gimpauxitem.c b/app/core/gimpauxitem.c
index 42225b4a55..cc9614934b 100644
--- a/app/core/gimpauxitem.c
+++ b/app/core/gimpauxitem.c
@@ -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
diff --git a/app/core/gimpbrush.c b/app/core/gimpbrush.c
index 1e77263942..b4791b70c4 100644
--- a/app/core/gimpbrush.c
+++ b/app/core/gimpbrush.c
@@ -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;
diff --git a/app/core/gimpcontainer.c b/app/core/gimpcontainer.c
index ec11b28406..3c2be3d440 100644
--- a/app/core/gimpcontainer.c
+++ b/app/core/gimpcontainer.c
@@ -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;
diff --git a/app/core/gimpcontainer.h b/app/core/gimpcontainer.h
index 76bec4c8bc..8b428599fa 100644
--- a/app/core/gimpcontainer.h
+++ b/app/core/gimpcontainer.h
@@ -33,14 +33,14 @@
#define GIMP_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CONTAINER,
GimpContainerClass))
-typedef struct _GimpContainerClass GimpContainerClass;
-typedef struct _GimpContainerPriv GimpContainerPriv;
+typedef struct _GimpContainerClass GimpContainerClass;
+typedef struct _GimpContainerPrivate GimpContainerPrivate;
struct _GimpContainer
{
- GimpObject parent_instance;
+ GimpObject parent_instance;
- GimpContainerPriv *priv;
+ GimpContainerPrivate *priv;
};
struct _GimpContainerClass
diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c
index 436e506f94..844496c5ae 100644
--- a/app/core/gimpdatafactory.c
+++ b/app/core/gimpdatafactory.c
@@ -104,7 +104,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
@@ -165,16 +166,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 ();
}
diff --git a/app/core/gimpdataloaderfactory.c b/app/core/gimpdataloaderfactory.c
index 2b08688c41..01c449619f 100644
--- a/app/core/gimpdataloaderfactory.c
+++ b/app/core/gimpdataloaderfactory.c
@@ -99,8 +99,8 @@ 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,
- GIMP_TYPE_DATA_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
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 85106a423a..cb4dd55713 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -198,6 +198,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,
@@ -276,16 +277,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);
}
diff --git a/app/core/gimpdynamics.c b/app/core/gimpdynamics.c
index 5056c35d2c..a1fb0efc2c 100644
--- a/app/core/gimpdynamics.c
+++ b/app/core/gimpdynamics.c
@@ -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
diff --git a/app/core/gimpdynamicsoutput.c b/app/core/gimpdynamicsoutput.c
index d3a5dac027..7a4f309a7e 100644
--- a/app/core/gimpdynamicsoutput.c
+++ b/app/core/gimpdynamicsoutput.c
@@ -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
diff --git a/app/core/gimpfilloptions.c b/app/core/gimpfilloptions.c
index 7e86ffe0c4..3da41e94d4 100644
--- a/app/core/gimpfilloptions.c
+++ b/app/core/gimpfilloptions.c
@@ -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
diff --git a/app/core/gimpfilter.c b/app/core/gimpfilter.c
index d88458bfb8..f565d499a0 100644
--- a/app/core/gimpfilter.c
+++ b/app/core/gimpfilter.c
@@ -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
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index 2d37666f03..8dfd386101 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -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);
@@ -231,6 +229,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,
@@ -301,8 +300,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;
}
diff --git a/app/core/gimpguide.c b/app/core/gimpguide.c
index 87da7f7f74..14389587da 100644
--- a/app/core/gimpguide.c
+++ b/app/core/gimpguide.c
@@ -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
diff --git a/app/core/gimphistogram.c b/app/core/gimphistogram.c
index 1ce1c8add0..f9c5c4ceaf 100644
--- a/app/core/gimphistogram.c
+++ b/app/core/gimphistogram.c
@@ -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;
}
diff --git a/app/core/gimpidtable.c b/app/core/gimpidtable.c
index 193c8cd35f..b69a13d053 100644
--- a/app/core/gimpidtable.c
+++ b/app/core/gimpidtable.c
@@ -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
@@ -53,24 +53,18 @@ G_DEFINE_TYPE (GimpIdTable, gimp_id_table, GIMP_TYPE_OBJECT)
static void
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);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GimpObjectClass *gimp_object_class = GIMP_OBJECT_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;
diff --git a/app/core/gimpidtable.h b/app/core/gimpidtable.h
index 0311d17b80..88097fd4c1 100644
--- a/app/core/gimpidtable.h
+++ b/app/core/gimpidtable.h
@@ -33,14 +33,14 @@
#define GIMP_ID_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_ID_TABLE,
GimpIdTableClass))
-typedef struct _GimpIdTableClass GimpIdTableClass;
-typedef struct _GimpIdTablePriv GimpIdTablePriv;
+typedef struct _GimpIdTableClass GimpIdTableClass;
+typedef struct _GimpIdTablePrivate GimpIdTablePrivate;
struct _GimpIdTable
{
- GimpObject parent_instance;
+ GimpObject parent_instance;
- GimpIdTablePriv *priv;
+ GimpIdTablePrivate *priv;
};
struct _GimpIdTableClass
diff --git a/app/core/gimpimage-private.h b/app/core/gimpimage-private.h
index d00d1634ad..8ffda57b2c 100644
--- a/app/core/gimpimage-private.h
+++ b/app/core/gimpimage-private.h
@@ -30,8 +30,6 @@ struct _GimpImageFlushAccumulator
};
-typedef struct _GimpImagePrivate GimpImagePrivate;
-
struct _GimpImagePrivate
{
gint ID; /* provides a unique ID */
@@ -131,10 +129,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);
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 841144139c..bb9ad909ba 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -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;
diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h
index 4e04a9a5e0..b2e03fba79 100644
--- a/app/core/gimpimage.h
+++ b/app/core/gimpimage.h
@@ -33,13 +33,16 @@
#define GIMP_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE, GimpImageClass))
-typedef struct _GimpImageClass GimpImageClass;
+typedef struct _GimpImageClass GimpImageClass;
+typedef struct _GimpImagePrivate GimpImagePrivate;
struct _GimpImage
{
- GimpViewable parent_instance;
+ GimpViewable parent_instance;
- Gimp *gimp; /* the GIMP the image belongs to */
+ Gimp *gimp; /* the GIMP the image belongs to */
+
+ GimpImagePrivate *priv;
};
struct _GimpImageClass
diff --git a/app/core/gimpimagefile.c b/app/core/gimpimagefile.c
index fb10d34945..cf079d848c 100644
--- a/app/core/gimpimagefile.c
+++ b/app/core/gimpimagefile.c
@@ -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));
}
static void
diff --git a/app/core/gimpitem.c b/app/core/gimpitem.c
index 363ee52eec..d7856ef071 100644
--- a/app/core/gimpitem.c
+++ b/app/core/gimpitem.c
@@ -106,9 +106,7 @@ struct _GimpItemPrivate
GList *offset_nodes; /* offset nodes to manage */
};
-#define GET_PRIVATE(item) G_TYPE_INSTANCE_GET_PRIVATE (item, \
- GIMP_TYPE_ITEM, \
- GimpItemPrivate)
+#define GET_PRIVATE(item) ((GimpItemPrivate *) gimp_item_get_instance_private ((GimpItem *) (item)))
/* local function prototypes */
@@ -168,7 +166,7 @@ static void gimp_item_real_resize (GimpItem *item,
-G_DEFINE_TYPE (GimpItem, gimp_item, GIMP_TYPE_FILTER)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpItem, gimp_item, GIMP_TYPE_FILTER)
#define parent_class gimp_item_parent_class
@@ -347,8 +345,6 @@ gimp_item_class_init (GimpItemClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpItemPrivate));
}
static void
diff --git a/app/core/gimpitemtree.c b/app/core/gimpitemtree.c
index 839a3b8cba..247f3b8648 100644
--- a/app/core/gimpitemtree.c
+++ b/app/core/gimpitemtree.c
@@ -60,9 +60,7 @@ struct _GimpItemTreePrivate
};
#define GIMP_ITEM_TREE_GET_PRIVATE(object) \
- G_TYPE_INSTANCE_GET_PRIVATE (object, \
- GIMP_TYPE_ITEM_TREE, \
- GimpItemTreePrivate)
+ ((GimpItemTreePrivate *) gimp_item_tree_get_instance_private ((GimpItemTree *) (object)))
/* local function prototypes */
@@ -86,7 +84,7 @@ static void gimp_item_tree_uniquefy_name (GimpItemTree *tree,
const gchar *new_name);
-G_DEFINE_TYPE (GimpItemTree, gimp_item_tree, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpItemTree, gimp_item_tree, GIMP_TYPE_OBJECT)
#define parent_class gimp_item_tree_parent_class
@@ -130,8 +128,6 @@ gimp_item_tree_class_init (GimpItemTreeClass *klass)
NULL, NULL,
GIMP_TYPE_ITEM,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpItemTreePrivate));
}
static void
diff --git a/app/core/gimpmybrush.c b/app/core/gimpmybrush.c
index 53199524a5..b140b13abc 100644
--- a/app/core/gimpmybrush.c
+++ b/app/core/gimpmybrush.c
@@ -59,6 +59,7 @@ static gchar * gimp_mybrush_get_checksum (GimpTagged *t
G_DEFINE_TYPE_WITH_CODE (GimpMybrush, gimp_mybrush, GIMP_TYPE_DATA,
+ G_ADD_PRIVATE (GimpMybrush)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_TAGGED,
gimp_mybrush_tagged_iface_init))
@@ -84,8 +85,6 @@ gimp_mybrush_class_init (GimpMybrushClass *klass)
data_class->dirty = gimp_mybrush_dirty;
data_class->get_extension = gimp_mybrush_get_extension;
-
- g_type_class_add_private (klass, sizeof (GimpMybrushPrivate));
}
static void
@@ -97,9 +96,7 @@ gimp_mybrush_tagged_iface_init (GimpTaggedInterface *iface)
static void
gimp_mybrush_init (GimpMybrush *brush)
{
- brush->priv = G_TYPE_INSTANCE_GET_PRIVATE (brush,
- GIMP_TYPE_MYBRUSH,
- GimpMybrushPrivate);
+ brush->priv = gimp_mybrush_get_instance_private (brush);
brush->priv->radius = 1.0;
brush->priv->opaque = 1.0;
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 3e7aac4568..ae73b2bee6 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -221,6 +221,7 @@ static gint gimp_projection_round_chunk_height (gdouble heigh
G_DEFINE_TYPE_WITH_CODE (GimpProjection, gimp_projection, GIMP_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpProjection)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PICKABLE,
gimp_projection_pickable_iface_init))
@@ -258,8 +259,6 @@ gimp_projection_class_init (GimpProjectionClass *klass)
g_object_class_override_property (object_class, PROP_BUFFER, "buffer");
- g_type_class_add_private (klass, sizeof (GimpProjectionPrivate));
-
if (g_getenv ("GIMP_NO_ADAPTIVE_CHUNK_SIZE"))
GIMP_PROJECTION_ADAPTIVE_CHUNK_SIZE = FALSE;
@@ -285,9 +284,7 @@ gimp_projection_class_init (GimpProjectionClass *klass)
static void
gimp_projection_init (GimpProjection *proj)
{
- proj->priv = G_TYPE_INSTANCE_GET_PRIVATE (proj,
- GIMP_TYPE_PROJECTION,
- GimpProjectionPrivate);
+ proj->priv = gimp_projection_get_instance_private (proj);
}
static void
diff --git a/app/core/gimpsamplepoint.c b/app/core/gimpsamplepoint.c
index 60870594b6..f0fe3778cd 100644
--- a/app/core/gimpsamplepoint.c
+++ b/app/core/gimpsamplepoint.c
@@ -54,7 +54,8 @@ static void gimp_sample_point_set_property (GObject *object,
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpSamplePoint, gimp_sample_point, GIMP_TYPE_AUX_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSamplePoint, gimp_sample_point,
+ GIMP_TYPE_AUX_ITEM)
static void
@@ -87,16 +88,12 @@ gimp_sample_point_class_init (GimpSamplePointClass *klass)
GIMP_TYPE_COLOR_PICK_MODE,
GIMP_COLOR_PICK_MODE_PIXEL,
0);
-
- g_type_class_add_private (klass, sizeof (GimpSamplePointPrivate));
}
static void
gimp_sample_point_init (GimpSamplePoint *sample_point)
{
- sample_point->priv = G_TYPE_INSTANCE_GET_PRIVATE (sample_point,
- GIMP_TYPE_SAMPLE_POINT,
- GimpSamplePointPrivate);
+ sample_point->priv = gimp_sample_point_get_instance_private (sample_point);
}
static void
diff --git a/app/core/gimpstrokeoptions.c b/app/core/gimpstrokeoptions.c
index 8315792ddb..3bb5c92115 100644
--- a/app/core/gimpstrokeoptions.c
+++ b/app/core/gimpstrokeoptions.c
@@ -96,9 +96,7 @@ struct _GimpStrokeOptionsPrivate
};
#define GET_PRIVATE(options) \
- G_TYPE_INSTANCE_GET_PRIVATE (options, \
- GIMP_TYPE_STROKE_OPTIONS, \
- GimpStrokeOptionsPrivate)
+ ((GimpStrokeOptionsPrivate *) gimp_stroke_options_get_instance_private ((GimpStrokeOptions *)
(options)))
static void gimp_stroke_options_config_iface_init (gpointer iface,
@@ -119,6 +117,7 @@ static GimpConfig * gimp_stroke_options_duplicate (GimpConfig *config);
G_DEFINE_TYPE_WITH_CODE (GimpStrokeOptions, gimp_stroke_options,
GIMP_TYPE_FILL_OPTIONS,
+ G_ADD_PRIVATE (GimpStrokeOptions)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_stroke_options_config_iface_init))
@@ -225,8 +224,6 @@ gimp_stroke_options_class_init (GimpStrokeOptionsClass *klass)
NULL,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
-
- g_type_class_add_private (klass, sizeof (GimpStrokeOptionsPrivate));
}
static void
diff --git a/app/core/gimptagcache.c b/app/core/gimptagcache.c
index e43c1145a7..ab508c0243 100644
--- a/app/core/gimptagcache.c
+++ b/app/core/gimptagcache.c
@@ -68,7 +68,7 @@ typedef struct
GimpTagCacheRecord current_record;
} GimpTagCacheParseData;
-struct _GimpTagCachePriv
+struct _GimpTagCachePrivate
{
GArray *records;
GList *containers;
@@ -110,7 +110,7 @@ static const gchar * gimp_tag_cache_attribute_name_to_value
static GQuark gimp_tag_cache_get_error_domain (void);
-G_DEFINE_TYPE (GimpTagCache, gimp_tag_cache, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpTagCache, gimp_tag_cache, GIMP_TYPE_OBJECT)
#define parent_class gimp_tag_cache_parent_class
@@ -118,24 +118,18 @@ G_DEFINE_TYPE (GimpTagCache, gimp_tag_cache, GIMP_TYPE_OBJECT)
static void
gimp_tag_cache_class_init (GimpTagCacheClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
- GimpTagCacheClass *gimp_tag_cache_class = GIMP_TAG_CACHE_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
object_class->finalize = gimp_tag_cache_finalize;
gimp_object_class->get_memsize = gimp_tag_cache_get_memsize;
-
- g_type_class_add_private (gimp_tag_cache_class,
- sizeof (GimpTagCachePriv));
}
static void
gimp_tag_cache_init (GimpTagCache *cache)
{
- cache->priv = G_TYPE_INSTANCE_GET_PRIVATE (cache,
- GIMP_TYPE_TAG_CACHE,
- GimpTagCachePriv);
+ cache->priv = gimp_tag_cache_get_instance_private (cache);
cache->priv->records = g_array_new (FALSE, FALSE,
sizeof (GimpTagCacheRecord));
diff --git a/app/core/gimptagcache.h b/app/core/gimptagcache.h
index 21dc536ed6..4c3a465926 100644
--- a/app/core/gimptagcache.h
+++ b/app/core/gimptagcache.h
@@ -33,14 +33,14 @@
#define GIMP_TAG_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TAG_CACHE,
GimpTagCacheClass))
-typedef struct _GimpTagCacheClass GimpTagCacheClass;
-typedef struct _GimpTagCachePriv GimpTagCachePriv;
+typedef struct _GimpTagCacheClass GimpTagCacheClass;
+typedef struct _GimpTagCachePrivate GimpTagCachePrivate;
struct _GimpTagCache
{
- GimpObject parent_instance;
+ GimpObject parent_instance;
- GimpTagCachePriv *priv;
+ GimpTagCachePrivate *priv;
};
struct _GimpTagCacheClass
diff --git a/app/core/gimptemplate.c b/app/core/gimptemplate.c
index 0023525f42..1459493390 100644
--- a/app/core/gimptemplate.c
+++ b/app/core/gimptemplate.c
@@ -91,9 +91,7 @@ struct _GimpTemplatePrivate
guint64 initial_size;
};
-#define GET_PRIVATE(template) G_TYPE_INSTANCE_GET_PRIVATE (template, \
- GIMP_TYPE_TEMPLATE, \
- GimpTemplatePrivate)
+#define GET_PRIVATE(template) ((GimpTemplatePrivate *) gimp_template_get_instance_private ((GimpTemplate *)
(template)))
static void gimp_template_finalize (GObject *object);
@@ -110,6 +108,7 @@ static void gimp_template_notify (GObject *object,
G_DEFINE_TYPE_WITH_CODE (GimpTemplate, gimp_template, GIMP_TYPE_VIEWABLE,
+ G_ADD_PRIVATE (GimpTemplate)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_template_parent_class
@@ -245,8 +244,6 @@ gimp_template_class_init (GimpTemplateClass *klass)
NULL,
NULL,
GIMP_PARAM_STATIC_STRINGS);
-
- g_type_class_add_private (klass, sizeof (GimpTemplatePrivate));
}
static void
diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c
index f24dd824e3..0fbe0e7bf9 100644
--- a/app/core/gimpviewable.c
+++ b/app/core/gimpviewable.c
@@ -75,9 +75,7 @@ struct _GimpViewablePrivate
GdkPixbuf *preview_pixbuf;
};
-#define GET_PRIVATE(viewable) G_TYPE_INSTANCE_GET_PRIVATE (viewable, \
- GIMP_TYPE_VIEWABLE, \
- GimpViewablePrivate)
+#define GET_PRIVATE(viewable) ((GimpViewablePrivate *) gimp_viewable_get_instance_private ((GimpViewable *)
(viewable)))
static void gimp_viewable_config_iface_init (GimpConfigInterface *iface);
@@ -133,6 +131,7 @@ static gboolean gimp_viewable_deserialize_property (GimpConfig *config,
G_DEFINE_TYPE_WITH_CODE (GimpViewable, gimp_viewable, GIMP_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpViewable)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_viewable_config_iface_init))
@@ -234,8 +233,6 @@ gimp_viewable_class_init (GimpViewableClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpViewablePrivate));
}
static void
diff --git a/app/display/gimpcanvasarc.c b/app/display/gimpcanvasarc.c
index 5fde91b76a..a4041b2930 100644
--- a/app/display/gimpcanvasarc.c
+++ b/app/display/gimpcanvasarc.c
@@ -61,9 +61,7 @@ struct _GimpCanvasArcPrivate
};
#define GET_PRIVATE(arc) \
- G_TYPE_INSTANCE_GET_PRIVATE (arc, \
- GIMP_TYPE_CANVAS_ARC, \
- GimpCanvasArcPrivate)
+ ((GimpCanvasArcPrivate *) gimp_canvas_arc_get_instance_private ((GimpCanvasArc *) (arc)))
/* local function prototypes */
@@ -81,8 +79,8 @@ static void gimp_canvas_arc_draw (GimpCanvasItem *item,
static cairo_region_t * gimp_canvas_arc_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasArc, gimp_canvas_arc,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasArc, gimp_canvas_arc,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_arc_parent_class
@@ -135,8 +133,6 @@ gimp_canvas_arc_class_init (GimpCanvasArcClass *klass)
g_param_spec_boolean ("filled", NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasArcPrivate));
}
static void
diff --git a/app/display/gimpcanvasboundary.c b/app/display/gimpcanvasboundary.c
index 68448ad357..b2e445fd2c 100644
--- a/app/display/gimpcanvasboundary.c
+++ b/app/display/gimpcanvasboundary.c
@@ -59,9 +59,7 @@ struct _GimpCanvasBoundaryPrivate
};
#define GET_PRIVATE(boundary) \
- G_TYPE_INSTANCE_GET_PRIVATE (boundary, \
- GIMP_TYPE_CANVAS_BOUNDARY, \
- GimpCanvasBoundaryPrivate)
+ ((GimpCanvasBoundaryPrivate *) gimp_canvas_boundary_get_instance_private ((GimpCanvasBoundary *)
(boundary)))
/* local function prototypes */
@@ -80,8 +78,8 @@ static void gimp_canvas_boundary_draw (GimpCanvasItem *item,
static cairo_region_t * gimp_canvas_boundary_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasBoundary, gimp_canvas_boundary,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasBoundary, gimp_canvas_boundary,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_boundary_parent_class
@@ -118,8 +116,6 @@ gimp_canvas_boundary_class_init (GimpCanvasBoundaryClass *klass)
-GIMP_MAX_IMAGE_SIZE,
GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasBoundaryPrivate));
}
static void
diff --git a/app/display/gimpcanvasbufferpreview.c b/app/display/gimpcanvasbufferpreview.c
index 2221b0ac3a..6aad7f2ed1 100644
--- a/app/display/gimpcanvasbufferpreview.c
+++ b/app/display/gimpcanvasbufferpreview.c
@@ -50,9 +50,7 @@ struct _GimpCanvasBufferPreviewPrivate
#define GET_PRIVATE(transform_preview) \
- G_TYPE_INSTANCE_GET_PRIVATE (transform_preview, \
- GIMP_TYPE_CANVAS_BUFFER_PREVIEW, \
- GimpCanvasBufferPreviewPrivate)
+ ((GimpCanvasBufferPreviewPrivate *) gimp_canvas_buffer_preview_get_instance_private
((GimpCanvasBufferPreview *) (transform_preview)))
/* local function prototypes */
@@ -73,8 +71,8 @@ static void gimp_canvas_buffer_preview_compute_bounds (GimpCanvasIte
cairo_rectangle_int_t *bounds);
-G_DEFINE_TYPE (GimpCanvasBufferPreview, gimp_canvas_buffer_preview,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasBufferPreview, gimp_canvas_buffer_preview,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_buffer_preview_parent_class
@@ -96,8 +94,6 @@ gimp_canvas_buffer_preview_class_init (GimpCanvasBufferPreviewClass *klass)
NULL, NULL,
GEGL_TYPE_BUFFER,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasBufferPreviewPrivate));
}
static void
diff --git a/app/display/gimpcanvascorner.c b/app/display/gimpcanvascorner.c
index 2cc59f3e06..50aebfb4f0 100644
--- a/app/display/gimpcanvascorner.c
+++ b/app/display/gimpcanvascorner.c
@@ -61,9 +61,7 @@ struct _GimpCanvasCornerPrivate
};
#define GET_PRIVATE(corner) \
- G_TYPE_INSTANCE_GET_PRIVATE (corner, \
- GIMP_TYPE_CANVAS_CORNER, \
- GimpCanvasCornerPrivate)
+ ((GimpCanvasCornerPrivate *) gimp_canvas_corner_get_instance_private ((GimpCanvasCorner *) (corner)))
/* local function prototypes */
@@ -81,8 +79,8 @@ static void gimp_canvas_corner_draw (GimpCanvasItem *item,
static cairo_region_t * gimp_canvas_corner_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasCorner, gimp_canvas_corner,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasCorner, gimp_canvas_corner,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_corner_parent_class
@@ -143,8 +141,6 @@ gimp_canvas_corner_class_init (GimpCanvasCornerClass *klass)
g_param_spec_boolean ("outside", NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasCornerPrivate));
}
static void
diff --git a/app/display/gimpcanvascursor.c b/app/display/gimpcanvascursor.c
index ff171d36ad..581fa76c90 100644
--- a/app/display/gimpcanvascursor.c
+++ b/app/display/gimpcanvascursor.c
@@ -54,9 +54,7 @@ struct _GimpCanvasCursorPrivate
};
#define GET_PRIVATE(cursor) \
- G_TYPE_INSTANCE_GET_PRIVATE (cursor, \
- GIMP_TYPE_CANVAS_CURSOR, \
- GimpCanvasCursorPrivate)
+ ((GimpCanvasCursorPrivate *) gimp_canvas_cursor_get_instance_private ((GimpCanvasCursor *) (cursor)))
/* local function prototypes */
@@ -74,8 +72,8 @@ static void gimp_canvas_cursor_draw (GimpCanvasItem *item,
static cairo_region_t * gimp_canvas_cursor_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasCursor, gimp_canvas_cursor,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasCursor, gimp_canvas_cursor,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_cursor_parent_class
@@ -103,8 +101,6 @@ gimp_canvas_cursor_class_init (GimpCanvasCursorClass *klass)
-GIMP_MAX_IMAGE_SIZE,
GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasCursorPrivate));
}
static void
diff --git a/app/display/gimpcanvasgrid.c b/app/display/gimpcanvasgrid.c
index 4f9f138370..f55c202c38 100644
--- a/app/display/gimpcanvasgrid.c
+++ b/app/display/gimpcanvasgrid.c
@@ -54,9 +54,7 @@ struct _GimpCanvasGridPrivate
};
#define GET_PRIVATE(grid) \
- G_TYPE_INSTANCE_GET_PRIVATE (grid, \
- GIMP_TYPE_CANVAS_GRID, \
- GimpCanvasGridPrivate)
+ ((GimpCanvasGridPrivate *) gimp_canvas_grid_get_instance_private ((GimpCanvasGrid *) (grid)))
/* local function prototypes */
@@ -77,7 +75,8 @@ static void gimp_canvas_grid_stroke (GimpCanvasItem *item,
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasGrid, gimp_canvas_grid, GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasGrid, gimp_canvas_grid,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_grid_parent_class
@@ -106,8 +105,6 @@ gimp_canvas_grid_class_init (GimpCanvasGridClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasGridPrivate));
}
static void
diff --git a/app/display/gimpcanvasgroup.c b/app/display/gimpcanvasgroup.c
index a28029e3ec..13d00ff94f 100644
--- a/app/display/gimpcanvasgroup.c
+++ b/app/display/gimpcanvasgroup.c
@@ -71,7 +71,8 @@ static void gimp_canvas_group_child_update (GimpCanvasItem *item,
GimpCanvasGroup *group);
-G_DEFINE_TYPE (GimpCanvasGroup, gimp_canvas_group, GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasGroup, gimp_canvas_group,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_group_parent_class
@@ -101,16 +102,12 @@ gimp_canvas_group_class_init (GimpCanvasGroupClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasGroupPrivate));
}
static void
gimp_canvas_group_init (GimpCanvasGroup *group)
{
- group->priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
- GIMP_TYPE_CANVAS_GROUP,
- GimpCanvasGroupPrivate);
+ group->priv = gimp_canvas_group_get_instance_private (group);
group->priv->items = g_queue_new ();
}
diff --git a/app/display/gimpcanvasguide.c b/app/display/gimpcanvasguide.c
index 2547e9dae6..5712633448 100644
--- a/app/display/gimpcanvasguide.c
+++ b/app/display/gimpcanvasguide.c
@@ -53,9 +53,7 @@ struct _GimpCanvasGuidePrivate
};
#define GET_PRIVATE(guide) \
- G_TYPE_INSTANCE_GET_PRIVATE (guide, \
- GIMP_TYPE_CANVAS_GUIDE, \
- GimpCanvasGuidePrivate)
+ ((GimpCanvasGuidePrivate *) gimp_canvas_guide_get_instance_private ((GimpCanvasGuide *) (guide)))
/* local function prototypes */
@@ -75,7 +73,8 @@ static void gimp_canvas_guide_stroke (GimpCanvasItem *item,
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasGuide, gimp_canvas_guide, GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasGuide, gimp_canvas_guide,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_guide_parent_class
@@ -110,8 +109,6 @@ gimp_canvas_guide_class_init (GimpCanvasGuideClass *klass)
GIMP_TYPE_GUIDE_STYLE,
GIMP_GUIDE_STYLE_NONE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasGuidePrivate));
}
static void
diff --git a/app/display/gimpcanvashandle.c b/app/display/gimpcanvashandle.c
index 36b0307513..4291affc7c 100644
--- a/app/display/gimpcanvashandle.c
+++ b/app/display/gimpcanvashandle.c
@@ -69,9 +69,7 @@ struct _GimpCanvasHandlePrivate
};
#define GET_PRIVATE(handle) \
- G_TYPE_INSTANCE_GET_PRIVATE (handle, \
- GIMP_TYPE_CANVAS_HANDLE, \
- GimpCanvasHandlePrivate)
+ ((GimpCanvasHandlePrivate *) gimp_canvas_handle_get_instance_private ((GimpCanvasHandle *) (handle)))
/* local function prototypes */
@@ -92,8 +90,8 @@ static gboolean gimp_canvas_handle_hit (GimpCanvasItem *item,
gdouble y);
-G_DEFINE_TYPE (GimpCanvasHandle, gimp_canvas_handle,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasHandle, gimp_canvas_handle,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_handle_parent_class
@@ -154,8 +152,6 @@ gimp_canvas_handle_class_init (GimpCanvasHandleClass *klass)
g_param_spec_double ("slice-angle", NULL, NULL,
-1000, 1000, 2 * G_PI,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasHandlePrivate));
}
static void
diff --git a/app/display/gimpcanvasitem.c b/app/display/gimpcanvasitem.c
index 5d505b3f8f..3c90237183 100644
--- a/app/display/gimpcanvasitem.c
+++ b/app/display/gimpcanvasitem.c
@@ -93,8 +93,7 @@ static gboolean gimp_canvas_item_real_hit (GimpCanvasItem *item
gdouble y);
-G_DEFINE_TYPE (GimpCanvasItem, gimp_canvas_item,
- GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasItem, gimp_canvas_item, GIMP_TYPE_OBJECT)
#define parent_class gimp_canvas_item_parent_class
@@ -155,8 +154,6 @@ gimp_canvas_item_class_init (GimpCanvasItemClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasItemPrivate));
}
static void
@@ -164,9 +161,7 @@ gimp_canvas_item_init (GimpCanvasItem *item)
{
GimpCanvasItemPrivate *private;
- item->private = G_TYPE_INSTANCE_GET_PRIVATE (item,
- GIMP_TYPE_CANVAS_ITEM,
- GimpCanvasItemPrivate);
+ item->private = gimp_canvas_item_get_instance_private (item);
private = item->private;
private->shell = NULL;
diff --git a/app/display/gimpcanvaslayerboundary.c b/app/display/gimpcanvaslayerboundary.c
index cc23476216..0e4b43be32 100644
--- a/app/display/gimpcanvaslayerboundary.c
+++ b/app/display/gimpcanvaslayerboundary.c
@@ -54,9 +54,7 @@ struct _GimpCanvasLayerBoundaryPrivate
};
#define GET_PRIVATE(layer_boundary) \
- G_TYPE_INSTANCE_GET_PRIVATE (layer_boundary, \
- GIMP_TYPE_CANVAS_LAYER_BOUNDARY, \
- GimpCanvasLayerBoundaryPrivate)
+ ((GimpCanvasLayerBoundaryPrivate *) gimp_canvas_layer_boundary_get_instance_private
((GimpCanvasLayerBoundary *) (layer_boundary)))
/* local function prototypes */
@@ -77,8 +75,8 @@ static void gimp_canvas_layer_boundary_stroke (GimpCanvasItem
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasLayerBoundary, gimp_canvas_layer_boundary,
- GIMP_TYPE_CANVAS_RECTANGLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasLayerBoundary, gimp_canvas_layer_boundary,
+ GIMP_TYPE_CANVAS_RECTANGLE)
#define parent_class gimp_canvas_layer_boundary_parent_class
@@ -106,8 +104,6 @@ gimp_canvas_layer_boundary_class_init (GimpCanvasLayerBoundaryClass *klass)
g_param_spec_boolean ("edit-mask", NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasLayerBoundaryPrivate));
}
static void
diff --git a/app/display/gimpcanvasline.c b/app/display/gimpcanvasline.c
index d22b97bab8..38a00c8d01 100644
--- a/app/display/gimpcanvasline.c
+++ b/app/display/gimpcanvasline.c
@@ -53,9 +53,7 @@ struct _GimpCanvasLinePrivate
};
#define GET_PRIVATE(line) \
- G_TYPE_INSTANCE_GET_PRIVATE (line, \
- GIMP_TYPE_CANVAS_LINE, \
- GimpCanvasLinePrivate)
+ ((GimpCanvasLinePrivate *) gimp_canvas_line_get_instance_private ((GimpCanvasLine *) (line)))
/* local function prototypes */
@@ -73,7 +71,8 @@ static void gimp_canvas_line_draw (GimpCanvasItem *item,
static cairo_region_t * gimp_canvas_line_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasLine, gimp_canvas_line, GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasLine, gimp_canvas_line,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_line_parent_class
@@ -113,8 +112,6 @@ gimp_canvas_line_class_init (GimpCanvasLineClass *klass)
-GIMP_MAX_IMAGE_SIZE,
GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasLinePrivate));
}
static void
diff --git a/app/display/gimpcanvaspassepartout.c b/app/display/gimpcanvaspassepartout.c
index b7a11c695b..06b26e703e 100644
--- a/app/display/gimpcanvaspassepartout.c
+++ b/app/display/gimpcanvaspassepartout.c
@@ -46,9 +46,7 @@ struct _GimpCanvasPassePartoutPrivate
};
#define GET_PRIVATE(item) \
- G_TYPE_INSTANCE_GET_PRIVATE (item, \
- GIMP_TYPE_CANVAS_PASSE_PARTOUT, \
- GimpCanvasPassePartoutPrivate)
+ ((GimpCanvasPassePartoutPrivate *) gimp_canvas_passe_partout_get_instance_private
((GimpCanvasPassePartout *) (item)))
/* local function prototypes */
@@ -68,8 +66,8 @@ static void gimp_canvas_passe_partout_fill (GimpCanvasItem *
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasPassePartout, gimp_canvas_passe_partout,
- GIMP_TYPE_CANVAS_RECTANGLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasPassePartout, gimp_canvas_passe_partout,
+ GIMP_TYPE_CANVAS_RECTANGLE)
#define parent_class gimp_canvas_passe_partout_parent_class
@@ -92,8 +90,6 @@ gimp_canvas_passe_partout_class_init (GimpCanvasPassePartoutClass *klass)
0.0,
1.0, 0.5,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasPassePartoutPrivate));
}
static void
diff --git a/app/display/gimpcanvaspath.c b/app/display/gimpcanvaspath.c
index ff452b0c65..71a001f6f7 100644
--- a/app/display/gimpcanvaspath.c
+++ b/app/display/gimpcanvaspath.c
@@ -59,9 +59,7 @@ struct _GimpCanvasPathPrivate
};
#define GET_PRIVATE(path) \
- G_TYPE_INSTANCE_GET_PRIVATE (path, \
- GIMP_TYPE_CANVAS_PATH, \
- GimpCanvasPathPrivate)
+ ((GimpCanvasPathPrivate *) gimp_canvas_path_get_instance_private ((GimpCanvasPath *) (path)))
/* local function prototypes */
@@ -81,8 +79,8 @@ static void gimp_canvas_path_stroke (GimpCanvasItem *item,
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasPath, gimp_canvas_path,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasPath, gimp_canvas_path,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_path_parent_class
@@ -129,8 +127,6 @@ gimp_canvas_path_class_init (GimpCanvasPathClass *klass)
GIMP_TYPE_PATH_STYLE,
GIMP_PATH_STYLE_DEFAULT,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasPathPrivate));
}
static void
diff --git a/app/display/gimpcanvaspen.c b/app/display/gimpcanvaspen.c
index 45a9453d2d..d0d01f914d 100644
--- a/app/display/gimpcanvaspen.c
+++ b/app/display/gimpcanvaspen.c
@@ -54,9 +54,7 @@ struct _GimpCanvasPenPrivate
};
#define GET_PRIVATE(pen) \
- G_TYPE_INSTANCE_GET_PRIVATE (pen, \
- GIMP_TYPE_CANVAS_PEN, \
- GimpCanvasPenPrivate)
+ ((GimpCanvasPenPrivate *) gimp_canvas_pen_get_instance_private ((GimpCanvasPen *) (pen)))
/* local function prototypes */
@@ -74,8 +72,8 @@ static void gimp_canvas_pen_stroke (GimpCanvasItem *item,
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasPen, gimp_canvas_pen,
- GIMP_TYPE_CANVAS_POLYGON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasPen, gimp_canvas_pen,
+ GIMP_TYPE_CANVAS_POLYGON)
#define parent_class gimp_canvas_pen_parent_class
@@ -101,8 +99,6 @@ gimp_canvas_pen_class_init (GimpCanvasPenClass *klass)
g_param_spec_int ("width", NULL, NULL,
1, G_MAXINT, 1,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasPenPrivate));
}
static void
diff --git a/app/display/gimpcanvaspolygon.c b/app/display/gimpcanvaspolygon.c
index 3667da102c..b4bf5f6183 100644
--- a/app/display/gimpcanvaspolygon.c
+++ b/app/display/gimpcanvaspolygon.c
@@ -55,9 +55,7 @@ struct _GimpCanvasPolygonPrivate
};
#define GET_PRIVATE(polygon) \
- G_TYPE_INSTANCE_GET_PRIVATE (polygon, \
- GIMP_TYPE_CANVAS_POLYGON, \
- GimpCanvasPolygonPrivate)
+ ((GimpCanvasPolygonPrivate *) gimp_canvas_polygon_get_instance_private ((GimpCanvasPolygon *)
(polygon)))
/* local function prototypes */
@@ -79,8 +77,8 @@ static gboolean gimp_canvas_polygon_hit (GimpCanvasItem *item,
gdouble y);
-G_DEFINE_TYPE (GimpCanvasPolygon, gimp_canvas_polygon,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasPolygon, gimp_canvas_polygon,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_polygon_parent_class
@@ -111,8 +109,6 @@ gimp_canvas_polygon_class_init (GimpCanvasPolygonClass *klass)
g_param_spec_boolean ("filled", NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasPolygonPrivate));
}
static void
diff --git a/app/display/gimpcanvasprogress.c b/app/display/gimpcanvasprogress.c
index 0d83c78fb9..8995d40e6c 100644
--- a/app/display/gimpcanvasprogress.c
+++ b/app/display/gimpcanvasprogress.c
@@ -67,9 +67,7 @@ struct _GimpCanvasProgressPrivate
};
#define GET_PRIVATE(progress) \
- G_TYPE_INSTANCE_GET_PRIVATE (progress, \
- GIMP_TYPE_CANVAS_PROGRESS, \
- GimpCanvasProgressPrivate)
+ ((GimpCanvasProgressPrivate *) gimp_canvas_progress_get_instance_private ((GimpCanvasProgress *)
(progress)))
/* local function prototypes */
@@ -112,6 +110,7 @@ static gboolean gimp_canvas_progress_message (GimpProgress
G_DEFINE_TYPE_WITH_CODE (GimpCanvasProgress, gimp_canvas_progress,
GIMP_TYPE_CANVAS_ITEM,
+ G_ADD_PRIVATE (GimpCanvasProgress)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROGRESS,
gimp_canvas_progress_iface_init))
@@ -149,8 +148,6 @@ gimp_canvas_progress_class_init (GimpCanvasProgressClass *klass)
-GIMP_MAX_IMAGE_SIZE,
GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasProgressPrivate));
}
static void
diff --git a/app/display/gimpcanvasproxygroup.c b/app/display/gimpcanvasproxygroup.c
index 8fced481b1..a979f24cf8 100644
--- a/app/display/gimpcanvasproxygroup.c
+++ b/app/display/gimpcanvasproxygroup.c
@@ -47,9 +47,7 @@ struct _GimpCanvasProxyGroupPrivate
};
#define GET_PRIVATE(proxy_group) \
- G_TYPE_INSTANCE_GET_PRIVATE (proxy_group, \
- GIMP_TYPE_CANVAS_PROXY_GROUP, \
- GimpCanvasProxyGroupPrivate)
+ ((GimpCanvasProxyGroupPrivate *) gimp_canvas_proxy_group_get_instance_private ((GimpCanvasProxyGroup
*) (proxy_group)))
/* local function prototypes */
@@ -65,8 +63,8 @@ static void gimp_canvas_proxy_group_get_property (GObject *objec
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpCanvasProxyGroup, gimp_canvas_proxy_group,
- GIMP_TYPE_CANVAS_GROUP)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasProxyGroup, gimp_canvas_proxy_group,
+ GIMP_TYPE_CANVAS_GROUP)
#define parent_class gimp_canvas_proxy_group_parent_class
@@ -79,8 +77,6 @@ gimp_canvas_proxy_group_class_init (GimpCanvasProxyGroupClass *klass)
object_class->finalize = gimp_canvas_proxy_group_finalize;
object_class->set_property = gimp_canvas_proxy_group_set_property;
object_class->get_property = gimp_canvas_proxy_group_get_property;
-
- g_type_class_add_private (klass, sizeof (GimpCanvasProxyGroupPrivate));
}
static void
diff --git a/app/display/gimpcanvasrectangle.c b/app/display/gimpcanvasrectangle.c
index f0690933a7..7ef7351ee1 100644
--- a/app/display/gimpcanvasrectangle.c
+++ b/app/display/gimpcanvasrectangle.c
@@ -55,9 +55,7 @@ struct _GimpCanvasRectanglePrivate
};
#define GET_PRIVATE(rectangle) \
- G_TYPE_INSTANCE_GET_PRIVATE (rectangle, \
- GIMP_TYPE_CANVAS_RECTANGLE, \
- GimpCanvasRectanglePrivate)
+ ((GimpCanvasRectanglePrivate *) gimp_canvas_rectangle_get_instance_private ((GimpCanvasRectangle *)
(rectangle)))
/* local function prototypes */
@@ -75,8 +73,8 @@ static void gimp_canvas_rectangle_draw (GimpCanvasItem *item
static cairo_region_t * gimp_canvas_rectangle_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasRectangle, gimp_canvas_rectangle,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasRectangle, gimp_canvas_rectangle,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_rectangle_parent_class
@@ -121,8 +119,6 @@ gimp_canvas_rectangle_class_init (GimpCanvasRectangleClass *klass)
g_param_spec_boolean ("filled", NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasRectanglePrivate));
}
static void
diff --git a/app/display/gimpcanvasrectangleguides.c b/app/display/gimpcanvasrectangleguides.c
index 0f9ebf1029..b7cc07dd29 100644
--- a/app/display/gimpcanvasrectangleguides.c
+++ b/app/display/gimpcanvasrectangleguides.c
@@ -60,9 +60,7 @@ struct _GimpCanvasRectangleGuidesPrivate
};
#define GET_PRIVATE(rectangle) \
- G_TYPE_INSTANCE_GET_PRIVATE (rectangle, \
- GIMP_TYPE_CANVAS_RECTANGLE_GUIDES, \
- GimpCanvasRectangleGuidesPrivate)
+ ((GimpCanvasRectangleGuidesPrivate *) gimp_canvas_rectangle_guides_get_instance_private
((GimpCanvasRectangleGuides *) (rectangle)))
/* local function prototypes */
@@ -80,8 +78,8 @@ static void gimp_canvas_rectangle_guides_draw (GimpCanvasIte
static cairo_region_t * gimp_canvas_rectangle_guides_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasRectangleGuides, gimp_canvas_rectangle_guides,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasRectangleGuides,
+ gimp_canvas_rectangle_guides, GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_rectangle_guides_parent_class
@@ -132,8 +130,6 @@ gimp_canvas_rectangle_guides_class_init (GimpCanvasRectangleGuidesClass *klass)
g_param_spec_int ("n-guides", NULL, NULL,
1, 128, 4,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasRectangleGuidesPrivate));
}
static void
diff --git a/app/display/gimpcanvassamplepoint.c b/app/display/gimpcanvassamplepoint.c
index c4c299d890..913a5b7ca1 100644
--- a/app/display/gimpcanvassamplepoint.c
+++ b/app/display/gimpcanvassamplepoint.c
@@ -58,9 +58,7 @@ struct _GimpCanvasSamplePointPrivate
};
#define GET_PRIVATE(sample_point) \
- G_TYPE_INSTANCE_GET_PRIVATE (sample_point, \
- GIMP_TYPE_CANVAS_SAMPLE_POINT, \
- GimpCanvasSamplePointPrivate)
+ ((GimpCanvasSamplePointPrivate *) gimp_canvas_sample_point_get_instance_private
((GimpCanvasSamplePoint *) (sample_point)))
/* local function prototypes */
@@ -82,8 +80,8 @@ static void gimp_canvas_sample_point_fill (GimpCanvasItem *i
cairo_t *cr);
-G_DEFINE_TYPE (GimpCanvasSamplePoint, gimp_canvas_sample_point,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasSamplePoint, gimp_canvas_sample_point,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_sample_point_parent_class
@@ -124,8 +122,6 @@ gimp_canvas_sample_point_class_init (GimpCanvasSamplePointClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasSamplePointPrivate));
}
static void
diff --git a/app/display/gimpcanvastextcursor.c b/app/display/gimpcanvastextcursor.c
index 0e2780d723..aaa8c5fb50 100644
--- a/app/display/gimpcanvastextcursor.c
+++ b/app/display/gimpcanvastextcursor.c
@@ -57,9 +57,7 @@ struct _GimpCanvasTextCursorPrivate
};
#define GET_PRIVATE(text_cursor) \
- G_TYPE_INSTANCE_GET_PRIVATE (text_cursor, \
- GIMP_TYPE_CANVAS_TEXT_CURSOR, \
- GimpCanvasTextCursorPrivate)
+ ((GimpCanvasTextCursorPrivate *) gimp_canvas_text_cursor_get_instance_private ((GimpCanvasTextCursor
*) (text_cursor)))
/* local function prototypes */
@@ -77,8 +75,8 @@ static void gimp_canvas_text_cursor_draw (GimpCanvasItem *it
static cairo_region_t * gimp_canvas_text_cursor_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasTextCursor, gimp_canvas_text_cursor,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasTextCursor, gimp_canvas_text_cursor,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_text_cursor_parent_class
@@ -129,8 +127,6 @@ gimp_canvas_text_cursor_class_init (GimpCanvasTextCursorClass *klass)
gimp_text_direction_get_type(),
GIMP_TEXT_DIRECTION_LTR,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasTextCursorPrivate));
}
static void
diff --git a/app/display/gimpcanvastransformguides.c b/app/display/gimpcanvastransformguides.c
index 3110c5e852..ba6c4cb455 100644
--- a/app/display/gimpcanvastransformguides.c
+++ b/app/display/gimpcanvastransformguides.c
@@ -65,9 +65,7 @@ struct _GimpCanvasTransformGuidesPrivate
};
#define GET_PRIVATE(transform) \
- G_TYPE_INSTANCE_GET_PRIVATE (transform, \
- GIMP_TYPE_CANVAS_TRANSFORM_GUIDES, \
- GimpCanvasTransformGuidesPrivate)
+ ((GimpCanvasTransformGuidesPrivate *) gimp_canvas_transform_guides_get_instance_private
((GimpCanvasTransformGuides *) (transform)))
/* local function prototypes */
@@ -85,8 +83,8 @@ static void gimp_canvas_transform_guides_draw (GimpCanvasIte
static cairo_region_t * gimp_canvas_transform_guides_get_extents (GimpCanvasItem *item);
-G_DEFINE_TYPE (GimpCanvasTransformGuides, gimp_canvas_transform_guides,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasTransformGuides,
+ gimp_canvas_transform_guides, GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_transform_guides_parent_class
@@ -156,8 +154,6 @@ gimp_canvas_transform_guides_class_init (GimpCanvasTransformGuidesClass *klass)
g_param_spec_boolean ("clip", NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasTransformGuidesPrivate));
}
static void
diff --git a/app/display/gimpcanvastransformpreview.c b/app/display/gimpcanvastransformpreview.c
index 66352b6272..392d8b9d41 100644
--- a/app/display/gimpcanvastransformpreview.c
+++ b/app/display/gimpcanvastransformpreview.c
@@ -90,9 +90,7 @@ struct _GimpCanvasTransformPreviewPrivate
};
#define GET_PRIVATE(transform_preview) \
- G_TYPE_INSTANCE_GET_PRIVATE (transform_preview, \
- GIMP_TYPE_CANVAS_TRANSFORM_PREVIEW, \
- GimpCanvasTransformPreviewPrivate)
+ ((GimpCanvasTransformPreviewPrivate *) gimp_canvas_transform_preview_get_instance_private
((GimpCanvasTransformPreview *) (transform_preview)))
/* local function prototypes */
@@ -119,8 +117,9 @@ static void gimp_canvas_transform_preview_set_drawable (GimpCanvasT
static void gimp_canvas_transform_preview_sync_node (GimpCanvasTransformPreview
*transform_preview);
-G_DEFINE_TYPE (GimpCanvasTransformPreview, gimp_canvas_transform_preview,
- GIMP_TYPE_CANVAS_ITEM)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCanvasTransformPreview,
+ gimp_canvas_transform_preview,
+ GIMP_TYPE_CANVAS_ITEM)
#define parent_class gimp_canvas_transform_preview_parent_class
@@ -190,8 +189,6 @@ gimp_canvas_transform_preview_class_init (GimpCanvasTransformPreviewClass *klass
NULL, NULL,
0.0, 1.0, 1.0,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpCanvasTransformPreviewPrivate));
}
static void
diff --git a/app/display/gimpcursorview.c b/app/display/gimpcursorview.c
index 970fb67d75..92628f286b 100644
--- a/app/display/gimpcursorview.c
+++ b/app/display/gimpcursorview.c
@@ -59,7 +59,7 @@ enum
};
-struct _GimpCursorViewPriv
+struct _GimpCursorViewPrivate
{
GimpEditor parent_instance;
@@ -139,6 +139,7 @@ static gboolean gimp_cursor_view_cursor_idle (GimpCursorView *v
G_DEFINE_TYPE_WITH_CODE (GimpCursorView, gimp_cursor_view, GIMP_TYPE_EDITOR,
+ G_ADD_PRIVATE (GimpCursorView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_cursor_view_docked_iface_init))
@@ -165,8 +166,6 @@ gimp_cursor_view_class_init (GimpCursorViewClass* klass)
TRUE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpCursorViewPriv));
}
static void
@@ -177,9 +176,7 @@ gimp_cursor_view_init (GimpCursorView *view)
GtkWidget *toggle;
gint content_spacing;
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
- GIMP_TYPE_CURSOR_VIEW,
- GimpCursorViewPriv);
+ view->priv = gimp_cursor_view_get_instance_private (view);
view->priv->sample_merged = TRUE;
view->priv->context = NULL;
diff --git a/app/display/gimpcursorview.h b/app/display/gimpcursorview.h
index 7d5beefe79..f5380410d0 100644
--- a/app/display/gimpcursorview.h
+++ b/app/display/gimpcursorview.h
@@ -33,14 +33,14 @@
#define GIMP_CURSOR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_CURSOR_VIEW,
GimpCursorViewClass))
-typedef struct _GimpCursorViewClass GimpCursorViewClass;
-typedef struct _GimpCursorViewPriv GimpCursorViewPriv;
+typedef struct _GimpCursorViewClass GimpCursorViewClass;
+typedef struct _GimpCursorViewPrivate GimpCursorViewPrivate;
struct _GimpCursorView
{
- GimpEditor parent_instance;
+ GimpEditor parent_instance;
- GimpCursorViewPriv *priv;
+ GimpCursorViewPrivate *priv;
};
struct _GimpCursorViewClass
diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c
index 8aaa57ecc4..7429c2da7f 100644
--- a/app/display/gimpdisplay.c
+++ b/app/display/gimpdisplay.c
@@ -83,9 +83,7 @@ struct _GimpDisplayPrivate
};
#define GIMP_DISPLAY_GET_PRIVATE(display) \
- G_TYPE_INSTANCE_GET_PRIVATE (display, \
- GIMP_TYPE_DISPLAY, \
- GimpDisplayPrivate)
+ ((GimpDisplayPrivate *) gimp_display_get_instance_private ((GimpDisplay *) (display)))
/* local function prototypes */
@@ -131,6 +129,7 @@ static void gimp_display_paint_area (GimpDisplay *displa
G_DEFINE_TYPE_WITH_CODE (GimpDisplay, gimp_display, GIMP_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpDisplay)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROGRESS,
gimp_display_progress_iface_init))
@@ -169,8 +168,6 @@ gimp_display_class_init (GimpDisplayClass *klass)
NULL, NULL,
GIMP_TYPE_DISPLAY_SHELL,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpDisplayPrivate));
}
static void
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index f697d36d93..1a42c894fa 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -147,9 +147,7 @@ typedef struct
#define GIMP_IMAGE_WINDOW_GET_PRIVATE(window) \
- G_TYPE_INSTANCE_GET_PRIVATE (window, \
- GIMP_TYPE_IMAGE_WINDOW, \
- GimpImageWindowPrivate)
+ ((GimpImageWindowPrivate *) gimp_image_window_get_instance_private ((GimpImageWindow *) (window)))
/* local function prototypes */
@@ -269,6 +267,7 @@ static void gimp_image_window_update_tab_labels (GimpImageWindow *win
G_DEFINE_TYPE_WITH_CODE (GimpImageWindow, gimp_image_window, GIMP_TYPE_WINDOW,
+ G_ADD_PRIVATE (GimpImageWindow)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCK_CONTAINER,
gimp_image_window_dock_container_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_SESSION_MANAGED,
@@ -333,8 +332,6 @@ gimp_image_window_class_init (GimpImageWindowClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
- g_type_class_add_private (klass, sizeof (GimpImageWindowPrivate));
-
gtk_rc_parse_string (image_window_rc_style);
}
diff --git a/app/display/gimptoolcompass.c b/app/display/gimptoolcompass.c
index 6328e8123a..626195c148 100644
--- a/app/display/gimptoolcompass.c
+++ b/app/display/gimptoolcompass.c
@@ -169,7 +169,8 @@ static void gimp_tool_compass_update_angle (GimpToolCompass *compa
gboolean flip);
-G_DEFINE_TYPE (GimpToolCompass, gimp_tool_compass, GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolCompass, gimp_tool_compass,
+ GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_compass_parent_class
@@ -273,16 +274,12 @@ gimp_tool_compass_class_init (GimpToolCompassClass *klass)
g_param_spec_double ("unit-angle", NULL, NULL,
-G_PI, G_PI, 0.0,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpToolCompassPrivate));
}
static void
gimp_tool_compass_init (GimpToolCompass *compass)
{
- compass->private = G_TYPE_INSTANCE_GET_PRIVATE (compass,
- GIMP_TYPE_TOOL_COMPASS,
- GimpToolCompassPrivate);
+ compass->private = gimp_tool_compass_get_instance_private (compass);
compass->private->point = -1;
}
diff --git a/app/display/gimptooldialog.c b/app/display/gimptooldialog.c
index 276f3e334c..e0bc0828ba 100644
--- a/app/display/gimptooldialog.c
+++ b/app/display/gimptooldialog.c
@@ -43,9 +43,7 @@ struct _GimpToolDialogPrivate
GimpDisplayShell *shell;
};
-#define GET_PRIVATE(dialog) G_TYPE_INSTANCE_GET_PRIVATE (dialog, \
- GIMP_TYPE_TOOL_DIALOG, \
- GimpToolDialogPrivate)
+#define GET_PRIVATE(dialog) ((GimpToolDialogPrivate *) gimp_tool_dialog_get_instance_private
((GimpToolDialog *) (dialog)))
static void gimp_tool_dialog_dispose (GObject *object);
@@ -54,7 +52,8 @@ static void gimp_tool_dialog_shell_unmap (GimpDisplayShell *shell,
GimpToolDialog *dialog);
-G_DEFINE_TYPE (GimpToolDialog, gimp_tool_dialog, GIMP_TYPE_VIEWABLE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolDialog, gimp_tool_dialog,
+ GIMP_TYPE_VIEWABLE_DIALOG)
static void
@@ -63,8 +62,6 @@ gimp_tool_dialog_class_init (GimpToolDialogClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = gimp_tool_dialog_dispose;
-
- g_type_class_add_private (klass, sizeof (GimpToolDialogPrivate));
}
static void
diff --git a/app/display/gimptoolgui.c b/app/display/gimptoolgui.c
index 71bd8221a5..23bb00dafc 100644
--- a/app/display/gimptoolgui.c
+++ b/app/display/gimptoolgui.c
@@ -81,9 +81,7 @@ struct _GimpToolGuiPrivate
GtkWidget *vbox;
};
-#define GET_PRIVATE(gui) G_TYPE_INSTANCE_GET_PRIVATE (gui, \
- GIMP_TYPE_TOOL_GUI, \
- GimpToolGuiPrivate)
+#define GET_PRIVATE(gui) ((GimpToolGuiPrivate *) gimp_tool_gui_get_instance_private ((GimpToolGui *) (gui)))
static void gimp_tool_gui_dispose (GObject *object);
@@ -110,7 +108,7 @@ static ResponseEntry * response_entry_find (GList *entries,
gint response_id);
-G_DEFINE_TYPE (GimpToolGui, gimp_tool_gui, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolGui, gimp_tool_gui, GIMP_TYPE_OBJECT)
static guint signals[LAST_SIGNAL] = { 0, };
@@ -134,8 +132,6 @@ gimp_tool_gui_class_init (GimpToolGuiClass *klass)
gimp_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
-
- g_type_class_add_private (klass, sizeof (GimpToolGuiPrivate));
}
static void
diff --git a/app/display/gimptoolgyroscope.c b/app/display/gimptoolgyroscope.c
index 41ff43b3bf..4d6b1759c7 100644
--- a/app/display/gimptoolgyroscope.c
+++ b/app/display/gimptoolgyroscope.c
@@ -160,7 +160,8 @@ static void gimp_tool_gyroscope_rotate_vector (GimpVector3 *v
const GimpVector3 *axis);
-G_DEFINE_TYPE (GimpToolGyroscope, gimp_tool_gyroscope, GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolGyroscope, gimp_tool_gyroscope,
+ GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_gyroscope_parent_class
@@ -244,16 +245,12 @@ gimp_tool_gyroscope_class_init (GimpToolGyroscopeClass *klass)
0.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolGyroscopePrivate));
}
static void
gimp_tool_gyroscope_init (GimpToolGyroscope *gyroscope)
{
- gyroscope->private = G_TYPE_INSTANCE_GET_PRIVATE (gyroscope,
- GIMP_TYPE_TOOL_GYROSCOPE,
- GimpToolGyroscopePrivate);
+ gyroscope->private = gimp_tool_gyroscope_get_instance_private (gyroscope);
}
static void
diff --git a/app/display/gimptoolhandlegrid.c b/app/display/gimptoolhandlegrid.c
index 1a074d0f0a..cb5b53d2ac 100644
--- a/app/display/gimptoolhandlegrid.c
+++ b/app/display/gimptoolhandlegrid.c
@@ -155,8 +155,8 @@ static inline gdouble calc_lineintersect_ratio (gdouble p1x,
gdouble q2y);
-G_DEFINE_TYPE (GimpToolHandleGrid, gimp_tool_handle_grid,
- GIMP_TYPE_TOOL_TRANSFORM_GRID)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolHandleGrid, gimp_tool_handle_grid,
+ GIMP_TYPE_TOOL_TRANSFORM_GRID)
#define parent_class gimp_tool_handle_grid_parent_class
@@ -338,16 +338,12 @@ gimp_tool_handle_grid_class_init (GimpToolHandleGridClass *klass)
0.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolHandleGridPrivate));
}
static void
gimp_tool_handle_grid_init (GimpToolHandleGrid *grid)
{
- grid->private = G_TYPE_INSTANCE_GET_PRIVATE (grid,
- GIMP_TYPE_TOOL_HANDLE_GRID,
- GimpToolHandleGridPrivate);
+ grid->private = gimp_tool_handle_grid_get_instance_private (grid);
}
static void
diff --git a/app/display/gimptoolline.c b/app/display/gimptoolline.c
index ed3dbf3632..271f926617 100644
--- a/app/display/gimptoolline.c
+++ b/app/display/gimptoolline.c
@@ -208,7 +208,7 @@ static gboolean gimp_tool_line_handle_hit (GimpCanvasItem *handle,
gdouble *min_dist);
-G_DEFINE_TYPE (GimpToolLine, gimp_tool_line, GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolLine, gimp_tool_line, GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_line_parent_class
@@ -347,8 +347,6 @@ gimp_tool_line_class_init (GimpToolLineClass *klass)
_("Line: "),
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolLinePrivate));
}
static void
@@ -356,9 +354,7 @@ gimp_tool_line_init (GimpToolLine *line)
{
GimpToolLinePrivate *private;
- private = line->private = G_TYPE_INSTANCE_GET_PRIVATE (line,
- GIMP_TYPE_TOOL_LINE,
- GimpToolLinePrivate);
+ private = line->private = gimp_tool_line_get_instance_private (line);
private->sliders = g_array_new (FALSE, FALSE, sizeof (GimpControllerSlider));
diff --git a/app/display/gimptoolpath.c b/app/display/gimptoolpath.c
index c452cef401..027ef9486e 100644
--- a/app/display/gimptoolpath.c
+++ b/app/display/gimptoolpath.c
@@ -198,7 +198,7 @@ static void gimp_tool_path_delete_selected_anchors
(GimpToolPath *path);
-G_DEFINE_TYPE (GimpToolPath, gimp_tool_path, GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolPath, gimp_tool_path, GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_path_parent_class
@@ -278,16 +278,12 @@ gimp_tool_path_class_init (GimpToolPathClass *klass)
FALSE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolPathPrivate));
}
static void
gimp_tool_path_init (GimpToolPath *path)
{
- path->private = G_TYPE_INSTANCE_GET_PRIVATE (path,
- GIMP_TYPE_TOOL_PATH,
- GimpToolPathPrivate);
+ path->private = gimp_tool_path_get_instance_private (path);
}
static void
diff --git a/app/display/gimptoolpolygon.c b/app/display/gimptoolpolygon.c
index 52b6917888..7c8174eec8 100644
--- a/app/display/gimptoolpolygon.c
+++ b/app/display/gimptoolpolygon.c
@@ -192,7 +192,8 @@ static gint gimp_tool_polygon_get_segment_index (GimpToolPolygon *polygo
const GimpCoords *coords);
-G_DEFINE_TYPE (GimpToolPolygon, gimp_tool_polygon, GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolPolygon, gimp_tool_polygon,
+ GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_polygon_parent_class
@@ -221,16 +222,12 @@ gimp_tool_polygon_class_init (GimpToolPolygonClass *klass)
widget_class->motion_modifier = gimp_tool_polygon_motion_modifier;
widget_class->hover_modifier = gimp_tool_polygon_hover_modifier;
widget_class->get_cursor = gimp_tool_polygon_get_cursor;
-
- g_type_class_add_private (klass, sizeof (GimpToolPolygonPrivate));
}
static void
gimp_tool_polygon_init (GimpToolPolygon *polygon)
{
- polygon->private = G_TYPE_INSTANCE_GET_PRIVATE (polygon,
- GIMP_TYPE_TOOL_POLYGON,
- GimpToolPolygonPrivate);
+ polygon->private = gimp_tool_polygon_get_instance_private (polygon);
polygon->private->grabbed_segment_index = INVALID_INDEX;
polygon->private->last_click_time = NO_CLICK_TIME_AVAILABLE;
diff --git a/app/display/gimptoolrectangle.c b/app/display/gimptoolrectangle.c
index 17ee0cb368..97c5d058f7 100644
--- a/app/display/gimptoolrectangle.c
+++ b/app/display/gimptoolrectangle.c
@@ -433,8 +433,8 @@ static void gimp_tool_rectangle_adjust_coord (GimpToolRectangle *rect
gdouble *coord_y_output);
-G_DEFINE_TYPE (GimpToolRectangle, gimp_tool_rectangle,
- GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolRectangle, gimp_tool_rectangle,
+ GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_rectangle_parent_class
@@ -694,16 +694,12 @@ gimp_tool_rectangle_class_init (GimpToolRectangleClass *klass)
FALSE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolRectanglePrivate));
}
static void
gimp_tool_rectangle_init (GimpToolRectangle *rectangle)
{
- rectangle->private = G_TYPE_INSTANCE_GET_PRIVATE (rectangle,
- GIMP_TYPE_TOOL_RECTANGLE,
- GimpToolRectanglePrivate);
+ rectangle->private = gimp_tool_rectangle_get_instance_private (rectangle);
rectangle->private->function = GIMP_TOOL_RECTANGLE_CREATING;
rectangle->private->is_first = TRUE;
diff --git a/app/display/gimptoolrotategrid.c b/app/display/gimptoolrotategrid.c
index 02c2fa1dbc..c58349043a 100644
--- a/app/display/gimptoolrotategrid.c
+++ b/app/display/gimptoolrotategrid.c
@@ -77,8 +77,8 @@ static void gimp_tool_rotate_grid_motion (GimpToolWidget *widget,
GdkModifierType state);
-G_DEFINE_TYPE (GimpToolRotateGrid, gimp_tool_rotate_grid,
- GIMP_TYPE_TOOL_TRANSFORM_GRID)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolRotateGrid, gimp_tool_rotate_grid,
+ GIMP_TYPE_TOOL_TRANSFORM_GRID)
#define parent_class gimp_tool_rotate_grid_parent_class
@@ -103,16 +103,12 @@ gimp_tool_rotate_grid_class_init (GimpToolRotateGridClass *klass)
0.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolRotateGridPrivate));
}
static void
gimp_tool_rotate_grid_init (GimpToolRotateGrid *grid)
{
- grid->private = G_TYPE_INSTANCE_GET_PRIVATE (grid,
- GIMP_TYPE_TOOL_ROTATE_GRID,
- GimpToolRotateGridPrivate);
+ grid->private = gimp_tool_rotate_grid_get_instance_private (grid);
}
static void
diff --git a/app/display/gimptoolsheargrid.c b/app/display/gimptoolsheargrid.c
index e99a420fcd..06183e1552 100644
--- a/app/display/gimptoolsheargrid.c
+++ b/app/display/gimptoolsheargrid.c
@@ -79,8 +79,8 @@ static void gimp_tool_shear_grid_motion (GimpToolWidget *widget,
GdkModifierType state);
-G_DEFINE_TYPE (GimpToolShearGrid, gimp_tool_shear_grid,
- GIMP_TYPE_TOOL_TRANSFORM_GRID)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolShearGrid, gimp_tool_shear_grid,
+ GIMP_TYPE_TOOL_TRANSFORM_GRID)
#define parent_class gimp_tool_shear_grid_parent_class
@@ -122,16 +122,12 @@ gimp_tool_shear_grid_class_init (GimpToolShearGridClass *klass)
0.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolShearGridPrivate));
}
static void
gimp_tool_shear_grid_init (GimpToolShearGrid *grid)
{
- grid->private = G_TYPE_INSTANCE_GET_PRIVATE (grid,
- GIMP_TYPE_TOOL_SHEAR_GRID,
- GimpToolShearGridPrivate);
+ grid->private = gimp_tool_shear_grid_get_instance_private (grid);
g_object_set (grid,
"inside-function", GIMP_TRANSFORM_FUNCTION_SHEAR,
diff --git a/app/display/gimptooltransformgrid.c b/app/display/gimptooltransformgrid.c
index 338adbcfc5..6c150b6130 100644
--- a/app/display/gimptooltransformgrid.c
+++ b/app/display/gimptooltransformgrid.c
@@ -204,8 +204,8 @@ static void gimp_tool_transform_grid_calc_handles (GimpToolTransformGrid *
gint *handle_h);
-G_DEFINE_TYPE (GimpToolTransformGrid, gimp_tool_transform_grid,
- GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolTransformGrid, gimp_tool_transform_grid,
+ GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_transform_grid_parent_class
@@ -443,16 +443,12 @@ gimp_tool_transform_grid_class_init (GimpToolTransformGridClass *klass)
FALSE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolTransformGridPrivate));
}
static void
gimp_tool_transform_grid_init (GimpToolTransformGrid *grid)
{
- grid->private = G_TYPE_INSTANCE_GET_PRIVATE (grid,
- GIMP_TYPE_TOOL_TRANSFORM_GRID,
- GimpToolTransformGridPrivate);
+ grid->private = gimp_tool_transform_grid_get_instance_private (grid);
}
static void
diff --git a/app/display/gimptoolwidget.c b/app/display/gimptoolwidget.c
index 60859f2c66..d54c5dd2a3 100644
--- a/app/display/gimptoolwidget.c
+++ b/app/display/gimptoolwidget.c
@@ -96,7 +96,7 @@ static gboolean gimp_tool_widget_real_key_press (GimpToolWidget *widget,
GdkEventKey *kevent);
-G_DEFINE_TYPE (GimpToolWidget, gimp_tool_widget, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolWidget, gimp_tool_widget, GIMP_TYPE_OBJECT)
#define parent_class gimp_tool_widget_parent_class
@@ -194,16 +194,12 @@ gimp_tool_widget_class_init (GimpToolWidgetClass *klass)
NULL, NULL,
GIMP_TYPE_CANVAS_ITEM,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpToolWidgetPrivate));
}
static void
gimp_tool_widget_init (GimpToolWidget *widget)
{
- widget->private = G_TYPE_INSTANCE_GET_PRIVATE (widget,
- GIMP_TYPE_TOOL_WIDGET,
- GimpToolWidgetPrivate);
+ widget->private = gimp_tool_widget_get_instance_private (widget);
}
static void
diff --git a/app/display/gimptoolwidgetgroup.c b/app/display/gimptoolwidgetgroup.c
index 804c99be20..f34dea4316 100644
--- a/app/display/gimptoolwidgetgroup.c
+++ b/app/display/gimptoolwidgetgroup.c
@@ -133,7 +133,8 @@ static GimpToolWidget * gimp_tool_widget_group_get_hover_widget (GimpToolWidg
GimpHit *hit);
-G_DEFINE_TYPE (GimpToolWidgetGroup, gimp_tool_widget_group, GIMP_TYPE_TOOL_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolWidgetGroup, gimp_tool_widget_group,
+ GIMP_TYPE_TOOL_WIDGET)
#define parent_class gimp_tool_widget_group_parent_class
@@ -161,8 +162,6 @@ gimp_tool_widget_group_class_init (GimpToolWidgetGroupClass *klass)
widget_class->motion_modifier = gimp_tool_widget_group_motion_modifier;
widget_class->hover_modifier = gimp_tool_widget_group_hover_modifier;
widget_class->get_cursor = gimp_tool_widget_group_get_cursor;
-
- g_type_class_add_private (klass, sizeof (GimpToolWidgetGroupPrivate));
}
static void
@@ -170,9 +169,7 @@ gimp_tool_widget_group_init (GimpToolWidgetGroup *group)
{
GimpToolWidgetGroupPrivate *priv;
- priv = group->priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
- GIMP_TYPE_TOOL_WIDGET_GROUP,
- GimpToolWidgetGroupPrivate);
+ priv = group->priv = gimp_tool_widget_group_get_instance_private (group);
priv->children = g_object_new (GIMP_TYPE_LIST,
"children-type", GIMP_TYPE_TOOL_WIDGET,
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index f8fc0b0715..dd9aa5d37d 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -84,7 +84,8 @@ static void gimp_ui_configurer_configure_for_multi_window (GimpUIC
static GimpImageWindow * gimp_ui_configurer_get_uber_window (GimpUIConfigurer *ui_configurer);
-G_DEFINE_TYPE (GimpUIConfigurer, gimp_ui_configurer, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpUIConfigurer, gimp_ui_configurer,
+ GIMP_TYPE_OBJECT)
#define parent_class gimp_ui_configurer_parent_class
@@ -102,16 +103,12 @@ gimp_ui_configurer_class_init (GimpUIConfigurerClass *klass)
GIMP_TYPE_GIMP,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
- g_type_class_add_private (klass,
- sizeof (GimpUIConfigurerPrivate));
}
static void
gimp_ui_configurer_init (GimpUIConfigurer *ui_configurer)
{
- ui_configurer->p = G_TYPE_INSTANCE_GET_PRIVATE (ui_configurer,
- GIMP_TYPE_UI_CONFIGURER,
- GimpUIConfigurerPrivate);
+ ui_configurer->p = gimp_ui_configurer_get_instance_private (ui_configurer);
}
static void
diff --git a/app/paint/gimpmybrushcore.c b/app/paint/gimpmybrushcore.c
index a6751b9f7b..9e96821ee1 100644
--- a/app/paint/gimpmybrushcore.c
+++ b/app/paint/gimpmybrushcore.c
@@ -87,7 +87,8 @@ static void gimp_mybrush_core_create_brushes (GimpMybrushCore *mybrush,
GimpSymmetry *sym);
-G_DEFINE_TYPE (GimpMybrushCore, gimp_mybrush_core, GIMP_TYPE_PAINT_CORE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpMybrushCore, gimp_mybrush_core,
+ GIMP_TYPE_PAINT_CORE)
#define parent_class gimp_mybrush_core_parent_class
@@ -115,16 +116,12 @@ gimp_mybrush_core_class_init (GimpMybrushCoreClass *klass)
paint_core_class->start = gimp_mybrush_core_start;
paint_core_class->paint = gimp_mybrush_core_paint;
paint_core_class->interpolate = gimp_mybrush_core_interpolate;
-
- g_type_class_add_private (klass, sizeof (GimpMybrushCorePrivate));
}
static void
gimp_mybrush_core_init (GimpMybrushCore *mybrush)
{
- mybrush->private = G_TYPE_INSTANCE_GET_PRIVATE (mybrush,
- GIMP_TYPE_MYBRUSH_CORE,
- GimpMybrushCorePrivate);
+ mybrush->private = gimp_mybrush_core_get_instance_private (mybrush);
}
static void
diff --git a/app/text/gimpfontfactory.c b/app/text/gimpfontfactory.c
index a68f178cf9..8bb96cc967 100644
--- a/app/text/gimpfontfactory.c
+++ b/app/text/gimpfontfactory.c
@@ -96,7 +96,8 @@ static void gimp_font_factory_load_names (GimpContainer *container,
PangoContext *context);
-G_DEFINE_TYPE (GimpFontFactory, gimp_font_factory, GIMP_TYPE_DATA_FACTORY)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpFontFactory, gimp_font_factory,
+ GIMP_TYPE_DATA_FACTORY)
#define parent_class gimp_font_factory_parent_class
@@ -114,16 +115,12 @@ gimp_font_factory_class_init (GimpFontFactoryClass *klass)
factory_class->data_save = gimp_font_factory_data_save;
factory_class->data_duplicate = gimp_font_factory_data_duplicate;
factory_class->data_delete = gimp_font_factory_data_delete;
-
- g_type_class_add_private (klass, sizeof (GimpFontFactoryPrivate));
}
static void
gimp_font_factory_init (GimpFontFactory *factory)
{
- factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (factory,
- GIMP_TYPE_FONT_FACTORY,
- GimpFontFactoryPrivate);
+ factory->priv = gimp_font_factory_get_instance_private (factory);
}
static void
diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c
index 9f3ad2d465..026d3cc1a9 100644
--- a/app/text/gimptextlayer.c
+++ b/app/text/gimptextlayer.c
@@ -120,7 +120,7 @@ static void gimp_text_layer_render_layout (GimpTextLayer *layer,
GimpTextLayout *layout);
-G_DEFINE_TYPE (GimpTextLayer, gimp_text_layer, GIMP_TYPE_LAYER)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpTextLayer, gimp_text_layer, GIMP_TYPE_LAYER)
#define parent_class gimp_text_layer_parent_class
@@ -184,8 +184,6 @@ gimp_text_layer_class_init (GimpTextLayerClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
-
- g_type_class_add_private (klass, sizeof (GimpTextLayerPrivate));
}
static void
@@ -193,9 +191,7 @@ gimp_text_layer_init (GimpTextLayer *layer)
{
layer->text = NULL;
layer->text_parasite = NULL;
- layer->private = G_TYPE_INSTANCE_GET_PRIVATE (layer,
- GIMP_TYPE_TEXT_LAYER,
- GimpTextLayerPrivate);
+ layer->private = gimp_text_layer_get_instance_private (layer);
}
static void
diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c
index 18ce5e2f68..5509a26392 100644
--- a/app/tools/gimpfreeselecttool.c
+++ b/app/tools/gimpfreeselecttool.c
@@ -110,8 +110,8 @@ static void gimp_free_select_tool_polygon_response (GimpToolWidget
GimpFreeSelectTool *fst);
-G_DEFINE_TYPE (GimpFreeSelectTool, gimp_free_select_tool,
- GIMP_TYPE_SELECTION_TOOL);
+G_DEFINE_TYPE_WITH_PRIVATE (GimpFreeSelectTool, gimp_free_select_tool,
+ GIMP_TYPE_SELECTION_TOOL)
#define parent_class gimp_free_select_tool_parent_class
@@ -167,8 +167,6 @@ gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass)
tool_class->active_modifier_key = gimp_free_select_tool_active_modifier_key;
klass->select = gimp_free_select_tool_real_select;
-
- g_type_class_add_private (klass, sizeof (GimpFreeSelectToolPrivate));
}
static void
@@ -176,9 +174,7 @@ gimp_free_select_tool_init (GimpFreeSelectTool *fst)
{
GimpTool *tool = GIMP_TOOL (fst);
- fst->private = G_TYPE_INSTANCE_GET_PRIVATE (fst,
- GIMP_TYPE_FREE_SELECT_TOOL,
- GimpFreeSelectToolPrivate);
+ fst->private = gimp_free_select_tool_get_instance_private (fst);
gimp_tool_control_set_motion_mode (tool->control,
GIMP_MOTION_MODE_EXACT);
diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c
index 5f9e2757da..007e81b269 100644
--- a/app/tools/gimprectangleselecttool.c
+++ b/app/tools/gimprectangleselecttool.c
@@ -133,8 +133,8 @@ static void gimp_rectangle_select_tool_update_option_defaults
static void gimp_rectangle_select_tool_auto_shrink (GimpRectangleSelectTool *rect_tool);
-G_DEFINE_TYPE (GimpRectangleSelectTool, gimp_rectangle_select_tool,
- GIMP_TYPE_SELECTION_TOOL)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpRectangleSelectTool, gimp_rectangle_select_tool,
+ GIMP_TYPE_SELECTION_TOOL)
#define parent_class gimp_rectangle_select_tool_parent_class
@@ -170,8 +170,6 @@ gimp_rectangle_select_tool_class_init (GimpRectangleSelectToolClass *klass)
tool_class->cursor_update = gimp_rectangle_select_tool_cursor_update;
klass->select = gimp_rectangle_select_tool_real_select;
-
- g_type_class_add_private (klass, sizeof (GimpRectangleSelectToolPrivate));
}
static void
@@ -180,9 +178,7 @@ gimp_rectangle_select_tool_init (GimpRectangleSelectTool *rect_tool)
GimpTool *tool = GIMP_TOOL (rect_tool);
rect_tool->private =
- G_TYPE_INSTANCE_GET_PRIVATE (rect_tool,
- GIMP_TYPE_RECTANGLE_SELECT_TOOL,
- GimpRectangleSelectToolPrivate);
+ gimp_rectangle_select_tool_get_instance_private (rect_tool);
gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_active_modifiers (tool->control,
diff --git a/app/widgets/gimpbuffersourcebox.c b/app/widgets/gimpbuffersourcebox.c
index 3258075e6d..f13b84462e 100644
--- a/app/widgets/gimpbuffersourcebox.c
+++ b/app/widgets/gimpbuffersourcebox.c
@@ -80,8 +80,8 @@ static void gimp_buffer_source_box_enable_toggled (GtkToggleButton *butto
GimpBufferSourceBox *box);
-G_DEFINE_TYPE (GimpBufferSourceBox, gimp_buffer_source_box,
- GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpBufferSourceBox, gimp_buffer_source_box,
+ GTK_TYPE_BOX)
#define parent_class gimp_buffer_source_box_parent_class
@@ -125,16 +125,12 @@ gimp_buffer_source_box_class_init (GimpBufferSourceBoxClass *klass)
TRUE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpBufferSourceBoxPrivate));
}
static void
gimp_buffer_source_box_init (GimpBufferSourceBox *box)
{
- box->priv = G_TYPE_INSTANCE_GET_PRIVATE (box,
- GIMP_TYPE_BUFFER_SOURCE_BOX,
- GimpBufferSourceBoxPrivate);
+ box->priv = gimp_buffer_source_box_get_instance_private (box);
gtk_orientable_set_orientation (GTK_ORIENTABLE (box),
GTK_ORIENTATION_HORIZONTAL);
diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c
index 9644d4094f..5b77aa4a70 100644
--- a/app/widgets/gimpchanneltreeview.c
+++ b/app/widgets/gimpchanneltreeview.c
@@ -49,7 +49,7 @@
#include "gimp-intl.h"
-struct _GimpChannelTreeViewPriv
+struct _GimpChannelTreeViewPrivate
{
GtkWidget *component_editor;
@@ -81,6 +81,7 @@ static void gimp_channel_tree_view_set_view_size (GimpContainerView *
G_DEFINE_TYPE_WITH_CODE (GimpChannelTreeView, gimp_channel_tree_view,
GIMP_TYPE_DRAWABLE_TREE_VIEW,
+ G_ADD_PRIVATE (GimpChannelTreeView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_channel_tree_view_view_iface_init))
@@ -125,8 +126,6 @@ gimp_channel_tree_view_class_init (GimpChannelTreeViewClass *klass)
iv_class->delete_action = "channels-delete";
iv_class->lock_content_help_id = GIMP_HELP_CHANNEL_LOCK_PIXELS;
iv_class->lock_position_help_id = GIMP_HELP_CHANNEL_LOCK_POSITION;
-
- g_type_class_add_private (klass, sizeof (GimpChannelTreeViewPriv));
}
static void
@@ -141,9 +140,7 @@ gimp_channel_tree_view_view_iface_init (GimpContainerViewInterface *view_iface)
static void
gimp_channel_tree_view_init (GimpChannelTreeView *view)
{
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
- GIMP_TYPE_CHANNEL_TREE_VIEW,
- GimpChannelTreeViewPriv);
+ view->priv = gimp_channel_tree_view_get_instance_private (view);
view->priv->component_editor = NULL;
view->priv->toselection_button = NULL;
diff --git a/app/widgets/gimpchanneltreeview.h b/app/widgets/gimpchanneltreeview.h
index a6e6d54874..933dcddd7c 100644
--- a/app/widgets/gimpchanneltreeview.h
+++ b/app/widgets/gimpchanneltreeview.h
@@ -33,14 +33,14 @@
#define GIMP_CHANNEL_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIMP_TYPE_CHANNEL_TREE_VIEW, GimpChannelTreeViewClass))
-typedef struct _GimpChannelTreeViewClass GimpChannelTreeViewClass;
-typedef struct _GimpChannelTreeViewPriv GimpChannelTreeViewPriv;
+typedef struct _GimpChannelTreeViewClass GimpChannelTreeViewClass;
+typedef struct _GimpChannelTreeViewPrivate GimpChannelTreeViewPrivate;
struct _GimpChannelTreeView
{
- GimpDrawableTreeView parent_instance;
+ GimpDrawableTreeView parent_instance;
- GimpChannelTreeViewPriv *priv;
+ GimpChannelTreeViewPrivate *priv;
};
struct _GimpChannelTreeViewClass
diff --git a/app/widgets/gimpcircle.c b/app/widgets/gimpcircle.c
index de4c54cb10..407d9e71c5 100644
--- a/app/widgets/gimpcircle.c
+++ b/app/widgets/gimpcircle.c
@@ -99,7 +99,7 @@ static void gimp_circle_draw_background (GimpCircle *circl
GimpCircleBackground background);
-G_DEFINE_TYPE (GimpCircle, gimp_circle, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCircle, gimp_circle, GTK_TYPE_WIDGET)
#define parent_class gimp_circle_parent_class
@@ -149,16 +149,12 @@ gimp_circle_class_init (GimpCircleClass *klass)
GIMP_CIRCLE_BACKGROUND_HSV,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpCirclePrivate));
}
static void
gimp_circle_init (GimpCircle *circle)
{
- circle->priv = G_TYPE_INSTANCE_GET_PRIVATE (circle,
- GIMP_TYPE_CIRCLE,
- GimpCirclePrivate);
+ circle->priv = gimp_circle_get_instance_private (circle);
gtk_widget_set_has_window (GTK_WIDGET (circle), FALSE);
gtk_widget_add_events (GTK_WIDGET (circle),
diff --git a/app/widgets/gimpcontainereditor.c b/app/widgets/gimpcontainereditor.c
index 4e91fb6320..9292f33067 100644
--- a/app/widgets/gimpcontainereditor.c
+++ b/app/widgets/gimpcontainereditor.c
@@ -117,6 +117,7 @@ static gboolean gimp_container_editor_get_show_button_bar (GimpDocked *docked);
G_DEFINE_TYPE_WITH_CODE (GimpContainerEditor, gimp_container_editor,
GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GimpContainerEditor)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_container_editor_docked_iface_init))
@@ -196,8 +197,6 @@ gimp_container_editor_class_init (GimpContainerEditorClass *klass)
NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (GimpContainerEditorPrivate));
}
static void
@@ -217,9 +216,7 @@ gimp_container_editor_init (GimpContainerEditor *editor)
gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
GTK_ORIENTATION_VERTICAL);
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor,
- GIMP_TYPE_CONTAINER_EDITOR,
- GimpContainerEditorPrivate);
+ editor->priv = gimp_container_editor_get_instance_private (editor);
}
static void
diff --git a/app/widgets/gimpcontainericonview.c b/app/widgets/gimpcontainericonview.c
index c8e4f92fd9..5b141e2b8c 100644
--- a/app/widgets/gimpcontainericonview.c
+++ b/app/widgets/gimpcontainericonview.c
@@ -42,7 +42,7 @@
#include "gimpwidgets-utils.h"
-struct _GimpContainerIconViewPriv
+struct _GimpContainerIconViewPrivate
{
GimpViewRenderer *dnd_renderer;
};
@@ -111,6 +111,7 @@ static gint gimp_container_icon_view_get_selected (GimpContainer
G_DEFINE_TYPE_WITH_CODE (GimpContainerIconView, gimp_container_icon_view,
GIMP_TYPE_CONTAINER_BOX,
+ G_ADD_PRIVATE (GimpContainerIconView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_container_icon_view_view_iface_init))
@@ -130,8 +131,6 @@ gimp_container_icon_view_class_init (GimpContainerIconViewClass *klass)
widget_class->unmap = gimp_container_icon_view_unmap;
widget_class->popup_menu = gimp_container_icon_view_popup_menu;
-
- g_type_class_add_private (klass, sizeof (GimpContainerIconViewPriv));
}
static void
@@ -162,9 +161,7 @@ gimp_container_icon_view_init (GimpContainerIconView *icon_view)
{
GimpContainerBox *box = GIMP_CONTAINER_BOX (icon_view);
- icon_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon_view,
- GIMP_TYPE_CONTAINER_ICON_VIEW,
- GimpContainerIconViewPriv);
+ icon_view->priv = gimp_container_icon_view_get_instance_private (icon_view);
gimp_container_tree_store_columns_init (icon_view->model_columns,
&icon_view->n_model_columns);
diff --git a/app/widgets/gimpcontainericonview.h b/app/widgets/gimpcontainericonview.h
index e1ccb8b75d..c7d15cdb51 100644
--- a/app/widgets/gimpcontainericonview.h
+++ b/app/widgets/gimpcontainericonview.h
@@ -33,24 +33,24 @@
#define GIMP_CONTAINER_ICON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIMP_TYPE_CONTAINER_ICON_VIEW, GimpContainerIconViewClass))
-typedef struct _GimpContainerIconViewClass GimpContainerIconViewClass;
-typedef struct _GimpContainerIconViewPriv GimpContainerIconViewPriv;
+typedef struct _GimpContainerIconViewClass GimpContainerIconViewClass;
+typedef struct _GimpContainerIconViewPrivate GimpContainerIconViewPrivate;
struct _GimpContainerIconView
{
- GimpContainerBox parent_instance;
+ GimpContainerBox parent_instance;
- GtkTreeModel *model;
- gint n_model_columns;
- GType model_columns[16];
+ GtkTreeModel *model;
+ gint n_model_columns;
+ GType model_columns[16];
- GtkIconView *view;
+ GtkIconView *view;
- GtkCellRenderer *renderer_cell;
+ GtkCellRenderer *renderer_cell;
- Gimp *dnd_gimp; /* eek */
+ Gimp *dnd_gimp; /* eek */
- GimpContainerIconViewPriv *priv;
+ GimpContainerIconViewPrivate *priv;
};
struct _GimpContainerIconViewClass
diff --git a/app/widgets/gimpcontainertreestore.c b/app/widgets/gimpcontainertreestore.c
index ef20d3a95a..643368df2d 100644
--- a/app/widgets/gimpcontainertreestore.c
+++ b/app/widgets/gimpcontainertreestore.c
@@ -54,9 +54,7 @@ struct _GimpContainerTreeStorePrivate
};
#define GET_PRIVATE(store) \
- G_TYPE_INSTANCE_GET_PRIVATE (store, \
- GIMP_TYPE_CONTAINER_TREE_STORE, \
- GimpContainerTreeStorePrivate)
+ ((GimpContainerTreeStorePrivate *) gimp_container_tree_store_get_instance_private
((GimpContainerTreeStore *) (store)))
static void gimp_container_tree_store_constructed (GObject *object);
@@ -77,8 +75,8 @@ static void gimp_container_tree_store_renderer_update (GimpViewRenderer
GimpContainerTreeStore *store);
-G_DEFINE_TYPE (GimpContainerTreeStore, gimp_container_tree_store,
- GTK_TYPE_TREE_STORE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpContainerTreeStore, gimp_container_tree_store,
+ GTK_TYPE_TREE_STORE)
#define parent_class gimp_container_tree_store_parent_class
@@ -105,8 +103,6 @@ gimp_container_tree_store_class_init (GimpContainerTreeStoreClass *klass)
NULL, NULL,
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpContainerTreeStorePrivate));
}
static void
diff --git a/app/widgets/gimpcontainertreeview-private.h b/app/widgets/gimpcontainertreeview-private.h
index 3765afd96a..66c21f4b29 100644
--- a/app/widgets/gimpcontainertreeview-private.h
+++ b/app/widgets/gimpcontainertreeview-private.h
@@ -22,7 +22,7 @@
#define __GIMP_CONTAINER_TREE_VIEW_PRIVATE_H__
-struct _GimpContainerTreeViewPriv
+struct _GimpContainerTreeViewPrivate
{
GtkTreeSelection *selection;
diff --git a/app/widgets/gimpcontainertreeview.c b/app/widgets/gimpcontainertreeview.c
index 3093eb547b..e4dcd64da0 100644
--- a/app/widgets/gimpcontainertreeview.c
+++ b/app/widgets/gimpcontainertreeview.c
@@ -145,6 +145,7 @@ static void gimp_container_tree_view_process_updates (GimpContainer
G_DEFINE_TYPE_WITH_CODE (GimpContainerTreeView, gimp_container_tree_view,
GIMP_TYPE_CONTAINER_BOX,
+ G_ADD_PRIVATE (GimpContainerTreeView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_container_tree_view_view_iface_init))
@@ -191,8 +192,6 @@ gimp_container_tree_view_class_init (GimpContainerTreeViewClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_KEY_F2, 0,
"edit-name", 0);
-
- g_type_class_add_private (klass, sizeof (GimpContainerTreeViewPriv));
}
static void
@@ -224,9 +223,7 @@ gimp_container_tree_view_init (GimpContainerTreeView *tree_view)
{
GimpContainerBox *box = GIMP_CONTAINER_BOX (tree_view);
- tree_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_view,
- GIMP_TYPE_CONTAINER_TREE_VIEW,
- GimpContainerTreeViewPriv);
+ tree_view->priv = gimp_container_tree_view_get_instance_private (tree_view);
gimp_container_tree_store_columns_init (tree_view->model_columns,
&tree_view->n_model_columns);
diff --git a/app/widgets/gimpcontainertreeview.h b/app/widgets/gimpcontainertreeview.h
index 4ed9bc8e76..b31d24f3ec 100644
--- a/app/widgets/gimpcontainertreeview.h
+++ b/app/widgets/gimpcontainertreeview.h
@@ -33,25 +33,25 @@
#define GIMP_CONTAINER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIMP_TYPE_CONTAINER_TREE_VIEW, GimpContainerTreeViewClass))
-typedef struct _GimpContainerTreeViewClass GimpContainerTreeViewClass;
-typedef struct _GimpContainerTreeViewPriv GimpContainerTreeViewPriv;
+typedef struct _GimpContainerTreeViewClass GimpContainerTreeViewClass;
+typedef struct _GimpContainerTreeViewPrivate GimpContainerTreeViewPrivate;
struct _GimpContainerTreeView
{
- GimpContainerBox parent_instance;
+ GimpContainerBox parent_instance;
- GtkTreeModel *model;
- gint n_model_columns;
- GType model_columns[16];
+ GtkTreeModel *model;
+ gint n_model_columns;
+ GType model_columns[16];
- GtkTreeView *view;
+ GtkTreeView *view;
- GtkTreeViewColumn *main_column;
- GtkCellRenderer *renderer_cell;
+ GtkTreeViewColumn *main_column;
+ GtkCellRenderer *renderer_cell;
- Gimp *dnd_gimp; /* eek */
+ Gimp *dnd_gimp; /* eek */
- GimpContainerTreeViewPriv *priv;
+ GimpContainerTreeViewPrivate *priv;
};
struct _GimpContainerTreeViewClass
diff --git a/app/widgets/gimpdashboard.c b/app/widgets/gimpdashboard.c
index 7ef3982675..94e71d4cd9 100644
--- a/app/widgets/gimpdashboard.c
+++ b/app/widgets/gimpdashboard.c
@@ -899,6 +899,7 @@ static const GroupInfo groups[] =
G_DEFINE_TYPE_WITH_CODE (GimpDashboard, gimp_dashboard, GIMP_TYPE_EDITOR,
+ G_ADD_PRIVATE (GimpDashboard)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_dashboard_docked_iface_init))
@@ -922,8 +923,6 @@ gimp_dashboard_class_init (GimpDashboardClass *klass)
widget_class->map = gimp_dashboard_map;
widget_class->unmap = gimp_dashboard_unmap;
-
- g_type_class_add_private (klass, sizeof (GimpDashboardPrivate));
}
static void
@@ -949,9 +948,7 @@ gimp_dashboard_init (GimpDashboard *dashboard)
Group group;
gint field;
- priv = dashboard->priv = G_TYPE_INSTANCE_GET_PRIVATE (dashboard,
- GIMP_TYPE_DASHBOARD,
- GimpDashboardPrivate);
+ priv = dashboard->priv = gimp_dashboard_get_instance_private (dashboard);
g_mutex_init (&priv->mutex);
g_cond_init (&priv->cond);
diff --git a/app/widgets/gimpdatafactoryview.c b/app/widgets/gimpdatafactoryview.c
index 9cf81eb4a7..35c8eb1ce0 100644
--- a/app/widgets/gimpdatafactoryview.c
+++ b/app/widgets/gimpdatafactoryview.c
@@ -63,7 +63,7 @@ enum
};
-struct _GimpDataFactoryViewPriv
+struct _GimpDataFactoryViewPrivate
{
GimpDataFactory *factory;
gchar *action_group;
@@ -114,6 +114,7 @@ static void gimp_data_factory_view_tree_name_edited (GtkCellRendererText *cell,
G_DEFINE_TYPE_WITH_CODE (GimpDataFactoryView, gimp_data_factory_view,
GIMP_TYPE_CONTAINER_EDITOR,
+ G_ADD_PRIVATE (GimpDataFactoryView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_data_factory_view_docked_iface_init))
@@ -150,16 +151,12 @@ gimp_data_factory_view_class_init (GimpDataFactoryViewClass *klass)
NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (GimpDataFactoryViewPriv));
}
static void
gimp_data_factory_view_init (GimpDataFactoryView *view)
{
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
- GIMP_TYPE_DATA_FACTORY_VIEW,
- GimpDataFactoryViewPriv);
+ view->priv = gimp_data_factory_view_get_instance_private (view);
view->priv->tagged_container = NULL;
view->priv->query_tag_entry = NULL;
@@ -217,11 +214,11 @@ gimp_data_factory_view_constructor (GType type,
static void
gimp_data_factory_view_constructed (GObject *object)
{
- GimpDataFactoryView *factory_view = GIMP_DATA_FACTORY_VIEW (object);
- GimpDataFactoryViewPriv *priv = factory_view->priv;
- GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (object);
- GimpUIManager *manager;
- gchar *str;
+ GimpDataFactoryView *factory_view = GIMP_DATA_FACTORY_VIEW (object);
+ GimpDataFactoryViewPrivate *priv = factory_view->priv;
+ GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (object);
+ GimpUIManager *manager;
+ gchar *str;
G_OBJECT_CLASS (parent_class)->constructed (object);
diff --git a/app/widgets/gimpdatafactoryview.h b/app/widgets/gimpdatafactoryview.h
index 25c7cc0aca..347029514c 100644
--- a/app/widgets/gimpdatafactoryview.h
+++ b/app/widgets/gimpdatafactoryview.h
@@ -33,14 +33,14 @@
#define GIMP_DATA_FACTORY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),
GIMP_TYPE_DATA_FACTORY_VIEW, GimpDataFactoryViewClass))
-typedef struct _GimpDataFactoryViewClass GimpDataFactoryViewClass;
-typedef struct _GimpDataFactoryViewPriv GimpDataFactoryViewPriv;
+typedef struct _GimpDataFactoryViewClass GimpDataFactoryViewClass;
+typedef struct _GimpDataFactoryViewPrivate GimpDataFactoryViewPrivate;
struct _GimpDataFactoryView
{
- GimpContainerEditor parent_instance;
+ GimpContainerEditor parent_instance;
- GimpDataFactoryViewPriv *priv;
+ GimpDataFactoryViewPrivate *priv;
};
struct _GimpDataFactoryViewClass
diff --git a/app/widgets/gimpdeviceeditor.c b/app/widgets/gimpdeviceeditor.c
index 061ba61813..db866d39fd 100644
--- a/app/widgets/gimpdeviceeditor.c
+++ b/app/widgets/gimpdeviceeditor.c
@@ -72,9 +72,7 @@ struct _GimpDeviceEditorPrivate
#define GIMP_DEVICE_EDITOR_GET_PRIVATE(editor) \
- G_TYPE_INSTANCE_GET_PRIVATE (editor, \
- GIMP_TYPE_DEVICE_EDITOR, \
- GimpDeviceEditorPrivate)
+ ((GimpDeviceEditorPrivate *) gimp_device_editor_get_instance_private ((GimpDeviceEditor *) (editor)))
static void gimp_device_editor_constructed (GObject *object);
@@ -110,7 +108,8 @@ static void gimp_device_editor_delete_clicked (GtkWidget *button,
GimpDeviceEditor *editor);
-G_DEFINE_TYPE (GimpDeviceEditor, gimp_device_editor, GTK_TYPE_PANED)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDeviceEditor, gimp_device_editor,
+ GTK_TYPE_PANED)
#define parent_class gimp_device_editor_parent_class
@@ -131,8 +130,6 @@ gimp_device_editor_class_init (GimpDeviceEditorClass *klass)
GIMP_TYPE_GIMP,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GimpDeviceEditorPrivate));
}
static void
diff --git a/app/widgets/gimpdeviceinfoeditor.c b/app/widgets/gimpdeviceinfoeditor.c
index c2cbb65742..75b4f39c67 100644
--- a/app/widgets/gimpdeviceinfoeditor.c
+++ b/app/widgets/gimpdeviceinfoeditor.c
@@ -90,9 +90,7 @@ struct _GimpDeviceInfoEditorPrivate
};
#define GIMP_DEVICE_INFO_EDITOR_GET_PRIVATE(editor) \
- G_TYPE_INSTANCE_GET_PRIVATE (editor, \
- GIMP_TYPE_DEVICE_INFO_EDITOR, \
- GimpDeviceInfoEditorPrivate)
+ ((GimpDeviceInfoEditorPrivate *) gimp_device_info_editor_get_instance_private ((GimpDeviceInfoEditor
*) (editor)))
static void gimp_device_info_editor_constructed (GObject *object);
@@ -129,7 +127,8 @@ static void gimp_device_info_editor_curve_reset (GtkWidget *butto
GimpCurve *curve);
-G_DEFINE_TYPE (GimpDeviceInfoEditor, gimp_device_info_editor, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDeviceInfoEditor, gimp_device_info_editor,
+ GTK_TYPE_BOX)
#define parent_class gimp_device_info_editor_parent_class
@@ -165,8 +164,6 @@ gimp_device_info_editor_class_init (GimpDeviceInfoEditorClass *klass)
GIMP_TYPE_DEVICE_INFO,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GimpDeviceInfoEditorPrivate));
}
static void
diff --git a/app/widgets/gimpdevicemanager.c b/app/widgets/gimpdevicemanager.c
index ebe7617b87..26cd47e957 100644
--- a/app/widgets/gimpdevicemanager.c
+++ b/app/widgets/gimpdevicemanager.c
@@ -97,7 +97,8 @@ static void gimp_device_manager_connect_tool (GimpDeviceManager *manager);
static void gimp_device_manager_disconnect_tool (GimpDeviceManager *manager);
-G_DEFINE_TYPE (GimpDeviceManager, gimp_device_manager, GIMP_TYPE_LIST)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDeviceManager, gimp_device_manager,
+ GIMP_TYPE_LIST)
#define parent_class gimp_device_manager_parent_class
@@ -127,16 +128,12 @@ gimp_device_manager_class_init (GimpDeviceManagerClass *klass)
GIMP_TYPE_DEVICE_INFO,
GIMP_PARAM_STATIC_STRINGS |
G_PARAM_READABLE));
-
- g_type_class_add_private (object_class, sizeof (GimpDeviceManagerPrivate));
}
static void
gimp_device_manager_init (GimpDeviceManager *manager)
{
- manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager,
- GIMP_TYPE_DEVICE_MANAGER,
- GimpDeviceManagerPrivate);
+ manager->priv = gimp_device_manager_get_instance_private (manager);
manager->priv->displays = g_hash_table_new_full (g_str_hash,
g_str_equal,
diff --git a/app/widgets/gimpdial.c b/app/widgets/gimpdial.c
index 0bffc21ab6..bda1236893 100644
--- a/app/widgets/gimpdial.c
+++ b/app/widgets/gimpdial.c
@@ -107,7 +107,7 @@ static gdouble gimp_dial_get_angle_distance (gdouble alpha,
gdouble beta);
-G_DEFINE_TYPE (GimpDial, gimp_dial, GIMP_TYPE_CIRCLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDial, gimp_dial, GIMP_TYPE_CIRCLE)
#define parent_class gimp_dial_parent_class
@@ -162,16 +162,12 @@ gimp_dial_class_init (GimpDialClass *klass)
TRUE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpDialPrivate));
}
static void
gimp_dial_init (GimpDial *dial)
{
- dial->priv = G_TYPE_INSTANCE_GET_PRIVATE (dial,
- GIMP_TYPE_DIAL,
- GimpDialPrivate);
+ dial->priv = gimp_dial_get_instance_private (dial);
}
static void
diff --git a/app/widgets/gimpdialogfactory.c b/app/widgets/gimpdialogfactory.c
index be3b1780f5..c3ba7b0b95 100644
--- a/app/widgets/gimpdialogfactory.c
+++ b/app/widgets/gimpdialogfactory.c
@@ -97,7 +97,8 @@ static void gimp_dialog_factory_hide (GimpDialogFactory
static void gimp_dialog_factory_show (GimpDialogFactory *factory);
-G_DEFINE_TYPE (GimpDialogFactory, gimp_dialog_factory, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDialogFactory, gimp_dialog_factory,
+ GIMP_TYPE_OBJECT)
#define parent_class gimp_dialog_factory_parent_class
@@ -139,16 +140,12 @@ gimp_dialog_factory_class_init (GimpDialogFactoryClass *klass)
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_DOCK_WINDOW);
-
- g_type_class_add_private (klass, sizeof (GimpDialogFactoryPrivate));
}
static void
gimp_dialog_factory_init (GimpDialogFactory *factory)
{
- factory->p = G_TYPE_INSTANCE_GET_PRIVATE (factory,
- GIMP_TYPE_DIALOG_FACTORY,
- GimpDialogFactoryPrivate);
+ factory->p = gimp_dialog_factory_get_instance_private (factory);
factory->p->dialog_state = GIMP_DIALOGS_SHOWN;
}
diff --git a/app/widgets/gimpdock.c b/app/widgets/gimpdock.c
index 08a0222c86..c7bc81afa8 100644
--- a/app/widgets/gimpdock.c
+++ b/app/widgets/gimpdock.c
@@ -86,7 +86,7 @@ static gboolean gimp_dock_dropped_cb (GtkWidget *source,
gpointer data);
-G_DEFINE_TYPE (GimpDock, gimp_dock, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDock, gimp_dock, GTK_TYPE_BOX)
#define parent_class gimp_dock_parent_class
@@ -155,8 +155,6 @@ gimp_dock_class_init (GimpDockClass *klass)
G_MAXDOUBLE,
DEFAULT_DOCK_FONT_SCALE,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpDockPrivate));
}
static void
@@ -168,9 +166,7 @@ gimp_dock_init (GimpDock *dock)
gtk_orientable_set_orientation (GTK_ORIENTABLE (dock),
GTK_ORIENTATION_VERTICAL);
- dock->p = G_TYPE_INSTANCE_GET_PRIVATE (dock,
- GIMP_TYPE_DOCK,
- GimpDockPrivate);
+ dock->p = gimp_dock_get_instance_private (dock);
dock->p->ID = dock_ID++;
name = g_strdup_printf ("gimp-internal-dock-%d", dock->p->ID);
diff --git a/app/widgets/gimpdockable.c b/app/widgets/gimpdockable.c
index 722f70fd32..0b5278aa7e 100644
--- a/app/widgets/gimpdockable.c
+++ b/app/widgets/gimpdockable.c
@@ -126,6 +126,7 @@ static GimpTabStyle
G_DEFINE_TYPE_WITH_CODE (GimpDockable, gimp_dockable, GTK_TYPE_BIN,
+ G_ADD_PRIVATE (GimpDockable)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_SESSION_MANAGED,
gimp_dockable_session_managed_iface_init))
@@ -167,16 +168,12 @@ gimp_dockable_class_init (GimpDockableClass *klass)
G_MAXINT,
0,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpDockablePrivate));
}
static void
gimp_dockable_init (GimpDockable *dockable)
{
- dockable->p = G_TYPE_INSTANCE_GET_PRIVATE (dockable,
- GIMP_TYPE_DOCKABLE,
- GimpDockablePrivate);
+ dockable->p = gimp_dockable_get_instance_private (dockable);
dockable->p->tab_style = GIMP_TAB_STYLE_AUTOMATIC;
dockable->p->actual_tab_style = GIMP_TAB_STYLE_UNDEFINED;
dockable->p->drag_x = GIMP_DOCKABLE_DRAG_OFFSET;
diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c
index 468d9443ff..2e4a2eaa58 100644
--- a/app/widgets/gimpdockbook.c
+++ b/app/widgets/gimpdockbook.c
@@ -186,7 +186,7 @@ static void gimp_dockbook_config_size_changed (GimpGuiConfig *
GimpDockbook *dockbook);
-G_DEFINE_TYPE (GimpDockbook, gimp_dockbook, GTK_TYPE_NOTEBOOK)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDockbook, gimp_dockbook, GTK_TYPE_NOTEBOOK)
#define parent_class gimp_dockbook_parent_class
@@ -257,8 +257,6 @@ gimp_dockbook_class_init (GimpDockbookClass *klass)
GTK_TYPE_ICON_SIZE,
DEFAULT_TAB_ICON_SIZE,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpDockbookPrivate));
}
static void
@@ -267,9 +265,7 @@ gimp_dockbook_init (GimpDockbook *dockbook)
GtkNotebook *notebook = GTK_NOTEBOOK (dockbook);
GtkWidget *image = NULL;
- dockbook->p = G_TYPE_INSTANCE_GET_PRIVATE (dockbook,
- GIMP_TYPE_DOCKBOOK,
- GimpDockbookPrivate);
+ dockbook->p = gimp_dockbook_get_instance_private (dockbook);
/* Various init */
gtk_notebook_popup_enable (notebook);
diff --git a/app/widgets/gimpdockcolumns.c b/app/widgets/gimpdockcolumns.c
index 18ae858d10..c113c4b843 100644
--- a/app/widgets/gimpdockcolumns.c
+++ b/app/widgets/gimpdockcolumns.c
@@ -91,7 +91,7 @@ static void gimp_dock_columns_dock_book_removed (GimpDockColumns *dock_colu
GimpDock *dock);
-G_DEFINE_TYPE (GimpDockColumns, gimp_dock_columns, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDockColumns, gimp_dock_columns, GTK_TYPE_BOX)
#define parent_class gimp_dock_columns_parent_class
@@ -150,8 +150,6 @@ gimp_dock_columns_class_init (GimpDockColumnsClass *klass)
gimp_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
GIMP_TYPE_DOCK);
-
- g_type_class_add_private (klass, sizeof (GimpDockColumnsPrivate));
}
static void
@@ -160,9 +158,7 @@ gimp_dock_columns_init (GimpDockColumns *dock_columns)
gtk_orientable_set_orientation (GTK_ORIENTABLE (dock_columns),
GTK_ORIENTATION_HORIZONTAL);
- dock_columns->p = G_TYPE_INSTANCE_GET_PRIVATE (dock_columns,
- GIMP_TYPE_DOCK_COLUMNS,
- GimpDockColumnsPrivate);
+ dock_columns->p = gimp_dock_columns_get_instance_private (dock_columns);
dock_columns->p->paned_hbox = gimp_paned_box_new (FALSE, 0,
GTK_ORIENTATION_HORIZONTAL);
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index 74e50e862c..18ad2fc4ae 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -165,6 +165,7 @@ static void gimp_dock_window_auto_clicked (GtkWidget
G_DEFINE_TYPE_WITH_CODE (GimpDockWindow, gimp_dock_window, GIMP_TYPE_WINDOW,
+ G_ADD_PRIVATE (GimpDockWindow)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCK_CONTAINER,
gimp_dock_window_dock_container_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_SESSION_MANAGED,
@@ -242,8 +243,6 @@ gimp_dock_window_class_init (GimpDockWindowClass *klass)
GTK_TYPE_ICON_SIZE,
DEFAULT_MENU_VIEW_SIZE,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpDockWindowPrivate));
}
static void
@@ -252,9 +251,7 @@ gimp_dock_window_init (GimpDockWindow *dock_window)
static gint dock_window_ID = 1;
gchar *name = NULL;
- dock_window->p = G_TYPE_INSTANCE_GET_PRIVATE (dock_window,
- GIMP_TYPE_DOCK_WINDOW,
- GimpDockWindowPrivate);
+ dock_window->p = gimp_dock_window_get_instance_private (dock_window);
dock_window->p->ID = dock_window_ID++;
dock_window->p->auto_follow_active = TRUE;
diff --git a/app/widgets/gimpdynamicsoutputeditor.c b/app/widgets/gimpdynamicsoutputeditor.c
index 2fbad0e1de..7dacf23b55 100644
--- a/app/widgets/gimpdynamicsoutputeditor.c
+++ b/app/widgets/gimpdynamicsoutputeditor.c
@@ -95,9 +95,7 @@ struct _GimpDynamicsOutputEditorPrivate
};
#define GET_PRIVATE(editor) \
- G_TYPE_INSTANCE_GET_PRIVATE (editor, \
- GIMP_TYPE_DYNAMICS_OUTPUT_EDITOR, \
- GimpDynamicsOutputEditorPrivate)
+ ((GimpDynamicsOutputEditorPrivate *) gimp_dynamics_output_editor_get_instance_private
((GimpDynamicsOutputEditor *) (editor)))
static void gimp_dynamics_output_editor_constructed (GObject *object);
@@ -129,8 +127,8 @@ static void gimp_dynamics_output_editor_notify_output (GimpDynamicsOutput
GimpDynamicsOutputEditor *editor);
-G_DEFINE_TYPE (GimpDynamicsOutputEditor, gimp_dynamics_output_editor,
- GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDynamicsOutputEditor,
+ gimp_dynamics_output_editor, GTK_TYPE_BOX)
#define parent_class gimp_dynamics_output_editor_parent_class
@@ -151,9 +149,6 @@ gimp_dynamics_output_editor_class_init (GimpDynamicsOutputEditorClass *klass)
GIMP_TYPE_DYNAMICS_OUTPUT,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class,
- sizeof (GimpDynamicsOutputEditorPrivate));
}
static void
diff --git a/app/widgets/gimpeditor.c b/app/widgets/gimpeditor.c
index c725343790..f79fc9c1df 100644
--- a/app/widgets/gimpeditor.c
+++ b/app/widgets/gimpeditor.c
@@ -112,6 +112,7 @@ static void gimp_editor_config_size_changed (GimpGuiConfig *config,
G_DEFINE_TYPE_WITH_CODE (GimpEditor, gimp_editor, GTK_TYPE_BOX,
+ G_ADD_PRIVATE (GimpEditor)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_editor_docked_iface_init))
@@ -200,8 +201,6 @@ gimp_editor_class_init (GimpEditorClass *klass)
GTK_TYPE_RELIEF_STYLE,
DEFAULT_BUTTON_RELIEF,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpEditorPrivate));
}
static void
@@ -219,9 +218,7 @@ gimp_editor_init (GimpEditor *editor)
gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
GTK_ORIENTATION_VERTICAL);
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor,
- GIMP_TYPE_EDITOR,
- GimpEditorPrivate);
+ editor->priv = gimp_editor_get_instance_private (editor);
editor->priv->popup_data = editor;
editor->priv->show_button_bar = TRUE;
diff --git a/app/widgets/gimphighlightablebutton.c b/app/widgets/gimphighlightablebutton.c
index a54b44e6a7..41c5a44118 100644
--- a/app/widgets/gimphighlightablebutton.c
+++ b/app/widgets/gimphighlightablebutton.c
@@ -72,7 +72,8 @@ static gboolean gimp_highlightable_button_expose_event (GtkWidget *widget
GdkEventExpose *event);
-G_DEFINE_TYPE (GimpHighlightableButton, gimp_highlightable_button, GIMP_TYPE_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpHighlightableButton, gimp_highlightable_button,
+ GIMP_TYPE_BUTTON)
#define parent_class gimp_highlightable_button_parent_class
@@ -102,16 +103,12 @@ gimp_highlightable_button_class_init (GimpHighlightableButtonClass *klass)
&(GimpRGB) DEFAULT_HIGHLIGHT_COLOR,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpHighlightableButtonPrivate));
}
static void
gimp_highlightable_button_init (GimpHighlightableButton *button)
{
- button->priv = G_TYPE_INSTANCE_GET_PRIVATE (button,
- GIMP_TYPE_HIGHLIGHTABLE_BUTTON,
- GimpHighlightableButtonPrivate);
+ button->priv = gimp_highlightable_button_get_instance_private (button);
}
static void
diff --git a/app/widgets/gimpiconpicker.c b/app/widgets/gimpiconpicker.c
index 2a7e2a3f67..ac0099efbb 100644
--- a/app/widgets/gimpiconpicker.c
+++ b/app/widgets/gimpiconpicker.c
@@ -74,9 +74,7 @@ struct _GimpIconPickerPrivate
};
#define GET_PRIVATE(picker) \
- G_TYPE_INSTANCE_GET_PRIVATE (picker, \
- GIMP_TYPE_ICON_PICKER, \
- GimpIconPickerPrivate)
+ ((GimpIconPickerPrivate *) gimp_icon_picker_get_instance_private ((GimpIconPicker *) (picker)))
static void gimp_icon_picker_constructed (GObject *object);
@@ -111,7 +109,7 @@ static void gimp_icon_picker_menu_copy (GtkWidget *widget,
gpointer data);
-G_DEFINE_TYPE (GimpIconPicker, gimp_icon_picker, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpIconPicker, gimp_icon_picker, GTK_TYPE_BOX)
#define parent_class gimp_icon_picker_parent_class
@@ -142,8 +140,6 @@ gimp_icon_picker_class_init (GimpIconPickerClass *klass)
g_param_spec_object ("icon-pixbuf", NULL, NULL,
GDK_TYPE_PIXBUF,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpIconPickerPrivate));
}
static void
diff --git a/app/widgets/gimpiconsizescale.c b/app/widgets/gimpiconsizescale.c
index 304e8b75b3..8261a73c55 100644
--- a/app/widgets/gimpiconsizescale.c
+++ b/app/widgets/gimpiconsizescale.c
@@ -54,9 +54,7 @@ struct _GimpIconSizeScalePrivate
};
#define GET_PRIVATE(scale) \
- G_TYPE_INSTANCE_GET_PRIVATE (scale, \
- GIMP_TYPE_ICON_SIZE_SCALE, \
- GimpIconSizeScalePrivate)
+ ((GimpIconSizeScalePrivate *) gimp_icon_size_scale_get_instance_private ((GimpIconSizeScale *)
(scale)))
static void gimp_icon_size_scale_constructed (GObject *object);
@@ -90,7 +88,8 @@ static gboolean gimp_icon_size_scale_change_value (GtkRange *range,
GimpGuiConfig *config);
-G_DEFINE_TYPE (GimpIconSizeScale, gimp_icon_size_scale, GIMP_TYPE_FRAME)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpIconSizeScale, gimp_icon_size_scale,
+ GIMP_TYPE_FRAME)
#define parent_class gimp_icon_size_scale_parent_class
@@ -111,8 +110,6 @@ gimp_icon_size_scale_class_init (GimpIconSizeScaleClass *klass)
GIMP_TYPE_GIMP,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GimpIconSizeScalePrivate));
}
static void
diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c
index 18f3043dce..04c4b4f06f 100644
--- a/app/widgets/gimpitemtreeview.c
+++ b/app/widgets/gimpitemtreeview.c
@@ -65,7 +65,7 @@ enum
};
-struct _GimpItemTreeViewPriv
+struct _GimpItemTreeViewPrivate
{
GimpImage *image;
@@ -214,6 +214,7 @@ static void gimp_item_tree_view_row_expanded (GtkTreeView *tree_vie
G_DEFINE_TYPE_WITH_CODE (GimpItemTreeView, gimp_item_tree_view,
GIMP_TYPE_CONTAINER_TREE_VIEW,
+ G_ADD_PRIVATE (GimpItemTreeView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_item_tree_view_view_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
@@ -282,8 +283,6 @@ gimp_item_tree_view_class_init (GimpItemTreeViewClass *klass)
klass->lock_position_icon_name = NULL;
klass->lock_position_tooltip = NULL;
klass->lock_position_help_id = NULL;
-
- g_type_class_add_private (klass, sizeof (GimpItemTreeViewPriv));
}
static void
@@ -311,9 +310,7 @@ gimp_item_tree_view_init (GimpItemTreeView *view)
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (view);
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
- GIMP_TYPE_ITEM_TREE_VIEW,
- GimpItemTreeViewPriv);
+ view->priv = gimp_item_tree_view_get_instance_private (view);
view->priv->model_column_visible =
gimp_container_tree_store_columns_add (tree_view->model_columns,
diff --git a/app/widgets/gimpitemtreeview.h b/app/widgets/gimpitemtreeview.h
index 845e130e2d..891eca9a41 100644
--- a/app/widgets/gimpitemtreeview.h
+++ b/app/widgets/gimpitemtreeview.h
@@ -49,14 +49,14 @@ typedef GimpItem * (* GimpNewItemFunc) (GimpImage *image);
#define GIMP_ITEM_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_ITEM_TREE_VIEW,
GimpItemTreeViewClass))
-typedef struct _GimpItemTreeViewClass GimpItemTreeViewClass;
-typedef struct _GimpItemTreeViewPriv GimpItemTreeViewPriv;
+typedef struct _GimpItemTreeViewClass GimpItemTreeViewClass;
+typedef struct _GimpItemTreeViewPrivate GimpItemTreeViewPrivate;
struct _GimpItemTreeView
{
- GimpContainerTreeView parent_instance;
+ GimpContainerTreeView parent_instance;
- GimpItemTreeViewPriv *priv;
+ GimpItemTreeViewPrivate *priv;
};
struct _GimpItemTreeViewClass
diff --git a/app/widgets/gimplayermodebox.c b/app/widgets/gimplayermodebox.c
index ca18c489ae..aa35f8f5eb 100644
--- a/app/widgets/gimplayermodebox.c
+++ b/app/widgets/gimplayermodebox.c
@@ -74,8 +74,7 @@ static void gimp_layer_mode_box_get_property (GObject *object,
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpLayerModeBox, gimp_layer_mode_box,
- GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpLayerModeBox, gimp_layer_mode_box, GTK_TYPE_BOX)
#define parent_class gimp_layer_mode_box_parent_class
@@ -104,16 +103,12 @@ gimp_layer_mode_box_class_init (GimpLayerModeBoxClass *klass)
GIMP_LAYER_MODE_NORMAL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpLayerModeBoxPrivate));
}
static void
gimp_layer_mode_box_init (GimpLayerModeBox *box)
{
- box->priv = G_TYPE_INSTANCE_GET_PRIVATE (box,
- GIMP_TYPE_LAYER_MODE_BOX,
- GimpLayerModeBoxPrivate);
+ box->priv = gimp_layer_mode_box_get_instance_private (box);
gtk_orientable_set_orientation (GTK_ORIENTABLE (box),
GTK_ORIENTATION_HORIZONTAL);
diff --git a/app/widgets/gimplayermodecombobox.c b/app/widgets/gimplayermodecombobox.c
index 30617b3899..0483c4d859 100644
--- a/app/widgets/gimplayermodecombobox.c
+++ b/app/widgets/gimplayermodecombobox.c
@@ -78,8 +78,8 @@ static gboolean gimp_layer_mode_combo_box_separator_func (GtkTreeModel
gpointer data);
-G_DEFINE_TYPE (GimpLayerModeComboBox, gimp_layer_mode_combo_box,
- GIMP_TYPE_ENUM_COMBO_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpLayerModeComboBox, gimp_layer_mode_combo_box,
+ GIMP_TYPE_ENUM_COMBO_BOX)
#define parent_class gimp_layer_mode_combo_box_parent_class
@@ -119,16 +119,12 @@ gimp_layer_mode_combo_box_class_init (GimpLayerModeComboBoxClass *klass)
GIMP_LAYER_MODE_GROUP_DEFAULT,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpLayerModeComboBoxPrivate));
}
static void
gimp_layer_mode_combo_box_init (GimpLayerModeComboBox *combo)
{
- combo->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo,
- GIMP_TYPE_LAYER_MODE_COMBO_BOX,
- GimpLayerModeComboBoxPrivate);
+ combo->priv = gimp_layer_mode_combo_box_get_instance_private (combo);
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo),
gimp_layer_mode_combo_box_separator_func,
diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c
index 80524c9e7d..34b0c89217 100644
--- a/app/widgets/gimplayertreeview.c
+++ b/app/widgets/gimplayertreeview.c
@@ -64,7 +64,7 @@
#include "gimp-intl.h"
-struct _GimpLayerTreeViewPriv
+struct _GimpLayerTreeViewPrivate
{
GtkWidget *layer_mode_box;
GtkAdjustment *opacity_adjustment;
@@ -176,6 +176,7 @@ static void gimp_layer_tree_view_alpha_changed (GimpLayer
G_DEFINE_TYPE_WITH_CODE (GimpLayerTreeView, gimp_layer_tree_view,
GIMP_TYPE_DRAWABLE_TREE_VIEW,
+ G_ADD_PRIVATE (GimpLayerTreeView)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONTAINER_VIEW,
gimp_layer_tree_view_view_iface_init))
@@ -226,8 +227,6 @@ gimp_layer_tree_view_class_init (GimpLayerTreeViewClass *klass)
item_view_class->delete_action = "layers-delete";
item_view_class->lock_content_help_id = GIMP_HELP_LAYER_LOCK_PIXELS;
item_view_class->lock_position_help_id = GIMP_HELP_LAYER_LOCK_POSITION;
-
- g_type_class_add_private (klass, sizeof (GimpLayerTreeViewPriv));
}
static void
@@ -254,9 +253,7 @@ gimp_layer_tree_view_init (GimpLayerTreeView *view)
GtkIconSize icon_size;
PangoAttribute *attr;
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
- GIMP_TYPE_LAYER_TREE_VIEW,
- GimpLayerTreeViewPriv);
+ view->priv = gimp_layer_tree_view_get_instance_private (view);
view->priv->model_column_mask =
gimp_container_tree_store_columns_add (tree_view->model_columns,
diff --git a/app/widgets/gimplayertreeview.h b/app/widgets/gimplayertreeview.h
index 3f09810026..1a89b2d4e9 100644
--- a/app/widgets/gimplayertreeview.h
+++ b/app/widgets/gimplayertreeview.h
@@ -33,14 +33,14 @@
#define GIMP_LAYER_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_LAYER_TREE_VIEW,
GimpLayerTreeViewClass))
-typedef struct _GimpLayerTreeViewClass GimpLayerTreeViewClass;
-typedef struct _GimpLayerTreeViewPriv GimpLayerTreeViewPriv;
+typedef struct _GimpLayerTreeViewClass GimpLayerTreeViewClass;
+typedef struct _GimpLayerTreeViewPrivate GimpLayerTreeViewPrivate;
struct _GimpLayerTreeView
{
- GimpDrawableTreeView parent_instance;
+ GimpDrawableTreeView parent_instance;
- GimpLayerTreeViewPriv *priv;
+ GimpLayerTreeViewPrivate *priv;
};
struct _GimpLayerTreeViewClass
diff --git a/app/widgets/gimpmenudock.c b/app/widgets/gimpmenudock.c
index 0e687c4444..fac3994a5d 100644
--- a/app/widgets/gimpmenudock.c
+++ b/app/widgets/gimpmenudock.c
@@ -55,7 +55,7 @@ static void gimp_menu_dock_style_set (GtkWidget *widget,
GtkStyle *prev_style);
-G_DEFINE_TYPE (GimpMenuDock, gimp_menu_dock, GIMP_TYPE_DOCK)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpMenuDock, gimp_menu_dock, GIMP_TYPE_DOCK)
#define parent_class gimp_menu_dock_parent_class
@@ -74,8 +74,6 @@ gimp_menu_dock_class_init (GimpMenuDockClass *klass)
G_MAXINT,
DEFAULT_MINIMAL_WIDTH,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpMenuDockPrivate));
}
static void
diff --git a/app/widgets/gimpmenufactory.c b/app/widgets/gimpmenufactory.c
index 3abf5f7269..a26201cd05 100644
--- a/app/widgets/gimpmenufactory.c
+++ b/app/widgets/gimpmenufactory.c
@@ -47,7 +47,8 @@ struct _GimpMenuFactoryPrivate
static void gimp_menu_factory_finalize (GObject *object);
-G_DEFINE_TYPE (GimpMenuFactory, gimp_menu_factory, GIMP_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpMenuFactory, gimp_menu_factory,
+ GIMP_TYPE_OBJECT)
#define parent_class gimp_menu_factory_parent_class
@@ -58,16 +59,12 @@ gimp_menu_factory_class_init (GimpMenuFactoryClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_menu_factory_finalize;
-
- g_type_class_add_private (klass, sizeof (GimpMenuFactoryPrivate));
}
static void
gimp_menu_factory_init (GimpMenuFactory *factory)
{
- factory->p = G_TYPE_INSTANCE_GET_PRIVATE (factory,
- GIMP_TYPE_MENU_FACTORY,
- GimpMenuFactoryPrivate);
+ factory->p = gimp_menu_factory_get_instance_private (factory);
}
static void
diff --git a/app/widgets/gimpmeter.c b/app/widgets/gimpmeter.c
index 53ee1fc490..9a5ec925ff 100644
--- a/app/widgets/gimpmeter.c
+++ b/app/widgets/gimpmeter.c
@@ -128,7 +128,7 @@ static void gimp_meter_mask_sample (GimpMeter *meter,
gdouble *result);
-G_DEFINE_TYPE (GimpMeter, gimp_meter, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpMeter, gimp_meter, GTK_TYPE_WIDGET)
#define parent_class gimp_meter_parent_class
@@ -222,16 +222,12 @@ gimp_meter_class_init (GimpMeterClass *klass)
TRUE, &(GimpRGB) {},
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpMeterPrivate));
}
static void
gimp_meter_init (GimpMeter *meter)
{
- meter->priv = G_TYPE_INSTANCE_GET_PRIVATE (meter,
- GIMP_TYPE_METER,
- GimpMeterPrivate);
+ meter->priv = gimp_meter_get_instance_private (meter);
g_mutex_init (&meter->priv->mutex);
diff --git a/app/widgets/gimppanedbox.c b/app/widgets/gimppanedbox.c
index a359c9b12e..731b58c922 100644
--- a/app/widgets/gimppanedbox.c
+++ b/app/widgets/gimppanedbox.c
@@ -104,7 +104,7 @@ static void gimp_paned_box_set_widget_drag_handler (GtkWidget *widget,
static gint gimp_paned_box_get_drop_area_size (GimpPanedBox *paned_box);
-G_DEFINE_TYPE (GimpPanedBox, gimp_paned_box, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPanedBox, gimp_paned_box, GTK_TYPE_BOX)
#define parent_class gimp_paned_box_parent_class
@@ -124,16 +124,12 @@ gimp_paned_box_class_init (GimpPanedBoxClass *klass)
widget_class->drag_drop = gimp_paned_box_drag_drop;
widget_class->realize = gimp_paned_box_realize;
widget_class->unrealize = gimp_paned_box_unrealize;
-
- g_type_class_add_private (klass, sizeof (GimpPanedBoxPrivate));
}
static void
gimp_paned_box_init (GimpPanedBox *paned_box)
{
- paned_box->p = G_TYPE_INSTANCE_GET_PRIVATE (paned_box,
- GIMP_TYPE_PANED_BOX,
- GimpPanedBoxPrivate);
+ paned_box->p = gimp_paned_box_get_instance_private (paned_box);
/* Instructions label
*
diff --git a/app/widgets/gimppickablebutton.c b/app/widgets/gimppickablebutton.c
index fc8100fcb9..e8454c2729 100644
--- a/app/widgets/gimppickablebutton.c
+++ b/app/widgets/gimppickablebutton.c
@@ -85,7 +85,8 @@ static void gimp_pickable_button_notify_buffer (GimpPickable *pickable
GimpPickableButton *button);
-G_DEFINE_TYPE (GimpPickableButton, gimp_pickable_button, GIMP_TYPE_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPickableButton, gimp_pickable_button,
+ GIMP_TYPE_BUTTON)
#define parent_class gimp_pickable_button_parent_class
@@ -116,16 +117,12 @@ gimp_pickable_button_class_init (GimpPickableButtonClass *klass)
NULL, NULL,
GIMP_TYPE_PICKABLE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpPickableButtonPrivate));
}
static void
gimp_pickable_button_init (GimpPickableButton *button)
{
- button->private = G_TYPE_INSTANCE_GET_PRIVATE (button,
- GIMP_TYPE_PICKABLE_BUTTON,
- GimpPickableButtonPrivate);
+ button->private = gimp_pickable_button_get_instance_private (button);
button->private->view_size = GIMP_VIEW_SIZE_LARGE;
button->private->view_border_width = 1;
diff --git a/app/widgets/gimppickablepopup.c b/app/widgets/gimppickablepopup.c
index dbee51d9f8..c0e0161af5 100644
--- a/app/widgets/gimppickablepopup.c
+++ b/app/widgets/gimppickablepopup.c
@@ -86,7 +86,8 @@ static void gimp_pickable_popup_item_activate (GimpContainerView *view,
GimpPickablePopup *popup);
-G_DEFINE_TYPE (GimpPickablePopup, gimp_pickable_popup, GIMP_TYPE_POPUP)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPickablePopup, gimp_pickable_popup,
+ GIMP_TYPE_POPUP)
#define parent_class gimp_pickable_popup_parent_class
@@ -130,16 +131,12 @@ gimp_pickable_popup_class_init (GimpPickablePopupClass *klass)
1,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpPickablePopupPrivate));
}
static void
gimp_pickable_popup_init (GimpPickablePopup *popup)
{
- popup->priv = G_TYPE_INSTANCE_GET_PRIVATE (popup,
- GIMP_TYPE_PICKABLE_POPUP,
- GimpPickablePopupPrivate);
+ popup->priv = gimp_pickable_popup_get_instance_private (popup);
popup->priv->view_size = GIMP_VIEW_SIZE_SMALL;
popup->priv->view_border_width = 1;
diff --git a/app/widgets/gimppolar.c b/app/widgets/gimppolar.c
index 035f96a2ff..c62150789e 100644
--- a/app/widgets/gimppolar.c
+++ b/app/widgets/gimppolar.c
@@ -93,7 +93,7 @@ static gdouble gimp_polar_get_angle_distance (gdouble alpha,
gdouble beta);
-G_DEFINE_TYPE (GimpPolar, gimp_polar, GIMP_TYPE_CIRCLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPolar, gimp_polar, GIMP_TYPE_CIRCLE)
#define parent_class gimp_polar_parent_class
@@ -127,16 +127,12 @@ gimp_polar_class_init (GimpPolarClass *klass)
0.0, 1.0, 0.0,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpPolarPrivate));
}
static void
gimp_polar_init (GimpPolar *polar)
{
- polar->priv = G_TYPE_INSTANCE_GET_PRIVATE (polar,
- GIMP_TYPE_POLAR,
- GimpPolarPrivate);
+ polar->priv = gimp_polar_get_instance_private (polar);
}
static void
diff --git a/app/widgets/gimpprefsbox.c b/app/widgets/gimpprefsbox.c
index 09127647ab..27136a1fa7 100644
--- a/app/widgets/gimpprefsbox.c
+++ b/app/widgets/gimpprefsbox.c
@@ -75,7 +75,7 @@ static void gimp_prefs_box_notebook_page_callback (GtkNotebook *notebook,
GimpPrefsBox *box);
-G_DEFINE_TYPE (GimpPrefsBox, gimp_prefs_box, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPrefsBox, gimp_prefs_box, GTK_TYPE_BOX)
#define parent_class gimp_prefs_box_parent_class
@@ -86,8 +86,6 @@ gimp_prefs_box_class_init (GimpPrefsBoxClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_prefs_box_finalize;
-
- g_type_class_add_private (klass, sizeof (GimpPrefsBoxPrivate));
}
static void
@@ -102,9 +100,7 @@ gimp_prefs_box_init (GimpPrefsBox *box)
GtkWidget *ebox;
GtkWidget *vbox;
- box->priv = G_TYPE_INSTANCE_GET_PRIVATE (box,
- GIMP_TYPE_PREFS_BOX,
- GimpPrefsBoxPrivate);
+ box->priv = gimp_prefs_box_get_instance_private (box);
private = box->priv;
diff --git a/app/widgets/gimpsearchpopup.c b/app/widgets/gimpsearchpopup.c
index a266e93130..4a5a8ecdab 100644
--- a/app/widgets/gimpsearchpopup.c
+++ b/app/widgets/gimpsearchpopup.c
@@ -115,7 +115,7 @@ static gboolean gimp_search_popup_view_accel_find_func (GtkAccelKey *key
gpointer data);
-G_DEFINE_TYPE (GimpSearchPopup, gimp_search_popup, GIMP_TYPE_POPUP)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSearchPopup, gimp_search_popup, GIMP_TYPE_POPUP)
#define parent_class gimp_search_popup_parent_class
@@ -166,16 +166,12 @@ gimp_search_popup_class_init (GimpSearchPopupClass *klass)
g_param_spec_pointer ("callback-data", NULL, NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (GimpSearchPopupPrivate));
}
static void
gimp_search_popup_init (GimpSearchPopup *search_popup)
{
- search_popup->priv = G_TYPE_INSTANCE_GET_PRIVATE (search_popup,
- GIMP_TYPE_SEARCH_POPUP,
- GimpSearchPopupPrivate);
+ search_popup->priv = gimp_search_popup_get_instance_private (search_popup);
}
/************ Public Functions ****************/
diff --git a/app/widgets/gimpsessioninfo.c b/app/widgets/gimpsessioninfo.c
index 81e2c1a62e..23fb579e47 100644
--- a/app/widgets/gimpsessioninfo.c
+++ b/app/widgets/gimpsessioninfo.c
@@ -95,6 +95,7 @@ static gboolean gimp_session_info_restore_docks (GimpRestoreDocksData *dat
G_DEFINE_TYPE_WITH_CODE (GimpSessionInfo, gimp_session_info, GIMP_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpSessionInfo)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_session_info_config_iface_init))
@@ -110,16 +111,12 @@ gimp_session_info_class_init (GimpSessionInfoClass *klass)
object_class->finalize = gimp_session_info_finalize;
gimp_object_class->get_memsize = gimp_session_info_get_memsize;
-
- g_type_class_add_private (klass, sizeof (GimpSessionInfoPrivate));
}
static void
gimp_session_info_init (GimpSessionInfo *info)
{
- info->p = G_TYPE_INSTANCE_GET_PRIVATE (info,
- GIMP_TYPE_SESSION_INFO,
- GimpSessionInfoPrivate);
+ info->p = gimp_session_info_get_instance_private (info);
info->p->monitor = DEFAULT_MONITOR;
info->p->screen = DEFAULT_SCREEN;
diff --git a/app/widgets/gimpsettingsbox.c b/app/widgets/gimpsettingsbox.c
index 7424a7df51..6bb7cfd09c 100644
--- a/app/widgets/gimpsettingsbox.c
+++ b/app/widgets/gimpsettingsbox.c
@@ -89,9 +89,7 @@ struct _GimpSettingsBoxPrivate
GFile *last_file;
};
-#define GET_PRIVATE(item) G_TYPE_INSTANCE_GET_PRIVATE (item, \
- GIMP_TYPE_SETTINGS_BOX, \
- GimpSettingsBoxPrivate)
+#define GET_PRIVATE(item) ((GimpSettingsBoxPrivate *) gimp_settings_box_get_instance_private
((GimpSettingsBox *) (item)))
static void gimp_settings_box_constructed (GObject *object);
@@ -145,7 +143,7 @@ static void gimp_settings_box_truncate_list (GimpSettingsBox *box,
gint max_recent);
-G_DEFINE_TYPE (GimpSettingsBox, gimp_settings_box, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSettingsBox, gimp_settings_box, GTK_TYPE_BOX)
#define parent_class gimp_settings_box_parent_class
@@ -263,8 +261,6 @@ gimp_settings_box_class_init (GimpSettingsBoxClass *klass)
G_TYPE_FILE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpSettingsBoxPrivate));
}
static void
diff --git a/app/widgets/gimpsettingseditor.c b/app/widgets/gimpsettingseditor.c
index 5f883bcd91..b86f4100e2 100644
--- a/app/widgets/gimpsettingseditor.c
+++ b/app/widgets/gimpsettingseditor.c
@@ -71,9 +71,7 @@ struct _GimpSettingsEditorPrivate
GtkWidget *delete_button;
};
-#define GET_PRIVATE(item) G_TYPE_INSTANCE_GET_PRIVATE (item, \
- GIMP_TYPE_SETTINGS_EDITOR, \
- GimpSettingsEditorPrivate)
+#define GET_PRIVATE(item) ((GimpSettingsEditorPrivate *) gimp_settings_editor_get_instance_private
((GimpSettingsEditor *) (item)))
static void gimp_settings_editor_constructed (GObject *object);
@@ -107,7 +105,8 @@ static void gimp_settings_editor_name_edited (GtkCellRendererText *cell,
GimpSettingsEditor *editor);
-G_DEFINE_TYPE (GimpSettingsEditor, gimp_settings_editor, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSettingsEditor, gimp_settings_editor,
+ GTK_TYPE_BOX)
#define parent_class gimp_settings_editor_parent_class
@@ -142,8 +141,6 @@ gimp_settings_editor_class_init (GimpSettingsEditorClass *klass)
GIMP_TYPE_CONTAINER,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (GimpSettingsEditorPrivate));
}
static void
diff --git a/app/widgets/gimpsizebox.c b/app/widgets/gimpsizebox.c
index 0786d1d8f5..6c8ad777e8 100644
--- a/app/widgets/gimpsizebox.c
+++ b/app/widgets/gimpsizebox.c
@@ -53,8 +53,7 @@ enum
};
-#define GIMP_SIZE_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GIMP_TYPE_SIZE_BOX, GimpSizeBoxPrivate))
+#define GIMP_SIZE_BOX_GET_PRIVATE(obj) ((GimpSizeBoxPrivate *) gimp_size_box_get_instance_private
((GimpSizeBox *) (obj)))
typedef struct _GimpSizeBoxPrivate GimpSizeBoxPrivate;
@@ -84,7 +83,7 @@ static void gimp_size_box_chain_toggled (GimpChainButton *button,
GimpSizeBox *box);
-G_DEFINE_TYPE (GimpSizeBox, gimp_size_box, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSizeBox, gimp_size_box, GTK_TYPE_BOX)
#define parent_class gimp_size_box_parent_class
@@ -99,8 +98,6 @@ gimp_size_box_class_init (GimpSizeBoxClass *klass)
object_class->set_property = gimp_size_box_set_property;
object_class->get_property = gimp_size_box_get_property;
- g_type_class_add_private (object_class, sizeof (GimpSizeBoxPrivate));
-
g_object_class_install_property (object_class, PROP_WIDTH,
g_param_spec_int ("width", NULL, NULL,
GIMP_MIN_IMAGE_SIZE,
diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c
index a1d76c25f6..2b11e1b9b4 100644
--- a/app/widgets/gimpspinscale.c
+++ b/app/widgets/gimpspinscale.c
@@ -82,9 +82,7 @@ struct _GimpSpinScalePrivate
gint pointer_warp_start_x;
};
-#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GIMP_TYPE_SPIN_SCALE, \
- GimpSpinScalePrivate))
+#define GET_PRIVATE(obj) ((GimpSpinScalePrivate *) gimp_spin_scale_get_instance_private ((GimpSpinScale *)
(obj)))
static void gimp_spin_scale_dispose (GObject *object);
@@ -129,7 +127,8 @@ static void gimp_spin_scale_setup_mnemonic (GimpSpinScale *scale,
guint previous_keyval);
-G_DEFINE_TYPE (GimpSpinScale, gimp_spin_scale, GTK_TYPE_SPIN_BUTTON);
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSpinScale, gimp_spin_scale,
+ GTK_TYPE_SPIN_BUTTON)
#define parent_class gimp_spin_scale_parent_class
@@ -162,8 +161,6 @@ gimp_spin_scale_class_init (GimpSpinScaleClass *klass)
g_param_spec_string ("label", NULL, NULL,
NULL,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpSpinScalePrivate));
}
static void
diff --git a/app/widgets/gimpsymmetryeditor.c b/app/widgets/gimpsymmetryeditor.c
index 9f0d130634..44380943e2 100644
--- a/app/widgets/gimpsymmetryeditor.c
+++ b/app/widgets/gimpsymmetryeditor.c
@@ -66,8 +66,8 @@ static void gimp_symmetry_editor_set_options (GimpSymmetryEditor *editor,
GimpSymmetry *symmetry);
-G_DEFINE_TYPE (GimpSymmetryEditor, gimp_symmetry_editor,
- GIMP_TYPE_IMAGE_EDITOR)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpSymmetryEditor, gimp_symmetry_editor,
+ GIMP_TYPE_IMAGE_EDITOR)
#define parent_class gimp_symmetry_editor_parent_class
@@ -78,8 +78,6 @@ gimp_symmetry_editor_class_init (GimpSymmetryEditorClass *klass)
GimpImageEditorClass *image_editor_class = GIMP_IMAGE_EDITOR_CLASS (klass);
image_editor_class->set_image = gimp_symmetry_editor_set_image;
-
- g_type_class_add_private (klass, sizeof (GimpSymmetryEditorPrivate));
}
static void
@@ -88,9 +86,7 @@ gimp_symmetry_editor_init (GimpSymmetryEditor *editor)
GtkWidget *scrolled_window;
GtkWidget *viewport;
- editor->p = G_TYPE_INSTANCE_GET_PRIVATE (editor,
- GIMP_TYPE_SYMMETRY_EDITOR,
- GimpSymmetryEditorPrivate);
+ editor->p = gimp_symmetry_editor_get_instance_private (editor);
gtk_widget_set_size_request (GTK_WIDGET (editor), -1, 200);
diff --git a/app/widgets/gimptemplateeditor.c b/app/widgets/gimptemplateeditor.c
index 6ee8677d8b..8d980c980d 100644
--- a/app/widgets/gimptemplateeditor.c
+++ b/app/widgets/gimptemplateeditor.c
@@ -75,9 +75,7 @@ struct _GimpTemplateEditorPrivate
};
#define GET_PRIVATE(editor) \
- G_TYPE_INSTANCE_GET_PRIVATE (editor, \
- GIMP_TYPE_TEMPLATE_EDITOR, \
- GimpTemplateEditorPrivate)
+ ((GimpTemplateEditorPrivate *) gimp_template_editor_get_instance_private ((GimpTemplateEditor *)
(editor)))
static void gimp_template_editor_constructed (GObject *object);
@@ -100,7 +98,8 @@ static void gimp_template_editor_template_notify (GimpTemplate *template
GimpTemplateEditor *editor);
-G_DEFINE_TYPE (GimpTemplateEditor, gimp_template_editor, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpTemplateEditor, gimp_template_editor,
+ GTK_TYPE_BOX)
#define parent_class gimp_template_editor_parent_class
@@ -126,8 +125,6 @@ gimp_template_editor_class_init (GimpTemplateEditorClass *klass)
GIMP_TYPE_TEMPLATE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (object_class, sizeof (GimpTemplateEditorPrivate));
}
static void
diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c
index 8ab0900a5b..516b9e74da 100644
--- a/app/widgets/gimptoolbox.c
+++ b/app/widgets/gimptoolbox.c
@@ -143,7 +143,7 @@ static void toolbox_paste_received (GtkClipboard *clipboa
gpointer data);
-G_DEFINE_TYPE (GimpToolbox, gimp_toolbox, GIMP_TYPE_DOCK)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolbox, gimp_toolbox, GIMP_TYPE_DOCK)
#define parent_class gimp_toolbox_parent_class
@@ -174,16 +174,12 @@ gimp_toolbox_class_init (GimpToolboxClass *klass)
GIMP_TYPE_CONTEXT,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpToolboxPrivate));
}
static void
gimp_toolbox_init (GimpToolbox *toolbox)
{
- toolbox->p = G_TYPE_INSTANCE_GET_PRIVATE (toolbox,
- GIMP_TYPE_TOOLBOX,
- GimpToolboxPrivate);
+ toolbox->p = gimp_toolbox_get_instance_private (toolbox);
gimp_help_connect (GTK_WIDGET (toolbox), gimp_standard_help_func,
GIMP_HELP_TOOLBOX, NULL);
diff --git a/app/widgets/gimptooleditor.c b/app/widgets/gimptooleditor.c
index 765b1b58e3..1c46067079 100644
--- a/app/widgets/gimptooleditor.c
+++ b/app/widgets/gimptooleditor.c
@@ -105,13 +105,12 @@ static void gimp_tool_editor_reset_clicked
GimpToolEditor *tool_editor);
-G_DEFINE_TYPE (GimpToolEditor, gimp_tool_editor, GIMP_TYPE_CONTAINER_TREE_VIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolEditor, gimp_tool_editor,
+ GIMP_TYPE_CONTAINER_TREE_VIEW)
#define parent_class gimp_tool_editor_parent_class
-#define GIMP_TOOL_EDITOR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GIMP_TYPE_TOOL_EDITOR, \
- GimpToolEditorPrivate))
+#define GIMP_TOOL_EDITOR_GET_PRIVATE(obj) ((GimpToolEditorPrivate *) gimp_tool_editor_get_instance_private
((GimpToolEditor *) (obj)))
static void
@@ -121,8 +120,6 @@ gimp_tool_editor_class_init (GimpToolEditorClass *klass)
object_class->dispose = gimp_tool_editor_dispose;
object_class->finalize = gimp_tool_editor_finalize;
-
- g_type_class_add_private (klass, sizeof (GimpToolEditorPrivate));
}
static void
diff --git a/app/widgets/gimptooloptionseditor.c b/app/widgets/gimptooloptionseditor.c
index 658a0bd0c1..9e2da813da 100644
--- a/app/widgets/gimptooloptionseditor.c
+++ b/app/widgets/gimptooloptionseditor.c
@@ -105,6 +105,7 @@ static void gimp_tool_options_editor_presets_update (GimpToolOptionsEd
G_DEFINE_TYPE_WITH_CODE (GimpToolOptionsEditor, gimp_tool_options_editor,
GIMP_TYPE_EDITOR,
+ G_ADD_PRIVATE (GimpToolOptionsEditor)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED,
gimp_tool_options_editor_docked_iface_init))
@@ -127,8 +128,6 @@ gimp_tool_options_editor_class_init (GimpToolOptionsEditorClass *klass)
GIMP_TYPE_GIMP,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (GimpToolOptionsEditorPrivate));
}
static void
@@ -145,9 +144,7 @@ gimp_tool_options_editor_init (GimpToolOptionsEditor *editor)
GtkScrolledWindow *scrolled_window;
GtkWidget *viewport;
- editor->p = G_TYPE_INSTANCE_GET_PRIVATE (editor,
- GIMP_TYPE_TOOL_OPTIONS_EDITOR,
- GimpToolOptionsEditorPrivate);
+ editor->p = gimp_tool_options_editor_get_instance_private (editor);
gtk_widget_set_size_request (GTK_WIDGET (editor), -1, 200);
diff --git a/app/widgets/gimptoolpalette.c b/app/widgets/gimptoolpalette.c
index 658f385984..33fbca4201 100644
--- a/app/widgets/gimptoolpalette.c
+++ b/app/widgets/gimptoolpalette.c
@@ -59,9 +59,7 @@ struct _GimpToolPalettePrivate
gint tool_columns;
};
-#define GET_PRIVATE(p) G_TYPE_INSTANCE_GET_PRIVATE (p, \
- GIMP_TYPE_TOOL_PALETTE, \
- GimpToolPalettePrivate)
+#define GET_PRIVATE(p) ((GimpToolPalettePrivate *) gimp_tool_palette_get_instance_private ((GimpToolPalette
*) (p)))
static void gimp_tool_palette_dispose (GObject *object);
@@ -90,7 +88,8 @@ static void gimp_tool_palette_config_size_changed (GimpGuiConfig *config,
GimpToolPalette *palette);
-G_DEFINE_TYPE (GimpToolPalette, gimp_tool_palette, GTK_TYPE_TOOL_PALETTE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpToolPalette, gimp_tool_palette,
+ GTK_TYPE_TOOL_PALETTE)
#define parent_class gimp_tool_palette_parent_class
@@ -120,8 +119,6 @@ gimp_tool_palette_class_init (GimpToolPaletteClass *klass)
GTK_TYPE_RELIEF_STYLE,
DEFAULT_BUTTON_RELIEF,
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (klass, sizeof (GimpToolPalettePrivate));
}
static void
diff --git a/app/widgets/gimptoolpreseteditor.c b/app/widgets/gimptoolpreseteditor.c
index 5176376f70..6f84a63cea 100644
--- a/app/widgets/gimptoolpreseteditor.c
+++ b/app/widgets/gimptoolpreseteditor.c
@@ -76,6 +76,7 @@ static void gimp_tool_preset_editor_notify_data (GimpToolPreset *option
G_DEFINE_TYPE_WITH_CODE (GimpToolPresetEditor, gimp_tool_preset_editor,
GIMP_TYPE_DATA_EDITOR,
+ G_ADD_PRIVATE (GimpToolPresetEditor)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_DOCKED, NULL))
#define parent_class gimp_tool_preset_editor_parent_class
@@ -92,16 +93,12 @@ gimp_tool_preset_editor_class_init (GimpToolPresetEditorClass *klass)
editor_class->set_data = gimp_tool_preset_editor_set_data;
editor_class->title = _("Tool Preset Editor");
-
- g_type_class_add_private (klass, sizeof (GimpToolPresetEditorPrivate));
}
static void
gimp_tool_preset_editor_init (GimpToolPresetEditor *editor)
{
- editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor,
- GIMP_TYPE_TOOL_PRESET_EDITOR,
- GimpToolPresetEditorPrivate);
+ editor->priv = gimp_tool_preset_editor_get_instance_private (editor);
}
static void
diff --git a/app/widgets/gimpviewrenderer.c b/app/widgets/gimpviewrenderer.c
index bdad3ca884..ee3fc059bf 100644
--- a/app/widgets/gimpviewrenderer.c
+++ b/app/widgets/gimpviewrenderer.c
@@ -114,7 +114,7 @@ static cairo_pattern_t *
GtkWidget *widget);
-G_DEFINE_TYPE (GimpViewRenderer, gimp_view_renderer, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpViewRenderer, gimp_view_renderer, G_TYPE_OBJECT)
#define parent_class gimp_view_renderer_parent_class
@@ -159,16 +159,12 @@ gimp_view_renderer_class_init (GimpViewRendererClass *klass)
gimp_rgba_set (&white_color, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&green_color, 0.0, 0.94, 0.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&red_color, 1.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
-
- g_type_class_add_private (klass, sizeof (GimpViewRendererPrivate));
}
static void
gimp_view_renderer_init (GimpViewRenderer *renderer)
{
- renderer->priv = G_TYPE_INSTANCE_GET_PRIVATE (renderer,
- GIMP_TYPE_VIEW_RENDERER,
- GimpViewRendererPrivate);
+ renderer->priv = gimp_view_renderer_get_instance_private (renderer);
renderer->viewable = NULL;
diff --git a/app/widgets/gimpviewrendererdrawable.c b/app/widgets/gimpviewrendererdrawable.c
index f3ee8c10c1..d2e7013ae0 100644
--- a/app/widgets/gimpviewrendererdrawable.c
+++ b/app/widgets/gimpviewrendererdrawable.c
@@ -65,8 +65,9 @@ static void gimp_view_renderer_drawable_render (GimpViewRenderer
static void gimp_view_renderer_drawable_cancel_render (GimpViewRendererDrawable *renderdrawable);
-G_DEFINE_TYPE (GimpViewRendererDrawable, gimp_view_renderer_drawable,
- GIMP_TYPE_VIEW_RENDERER)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpViewRendererDrawable,
+ gimp_view_renderer_drawable,
+ GIMP_TYPE_VIEW_RENDERER)
#define parent_class gimp_view_renderer_drawable_parent_class
@@ -84,17 +85,13 @@ gimp_view_renderer_drawable_class_init (GimpViewRendererDrawableClass *klass)
renderer_class->invalidate = gimp_view_renderer_drawable_invalidate;
renderer_class->render = gimp_view_renderer_drawable_render;
-
- g_type_class_add_private (klass, sizeof (GimpViewRendererDrawablePrivate));
}
static void
gimp_view_renderer_drawable_init (GimpViewRendererDrawable *renderdrawable)
{
renderdrawable->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (renderdrawable,
- GIMP_TYPE_VIEW_RENDERER_DRAWABLE,
- GimpViewRendererDrawablePrivate);
+ gimp_view_renderer_drawable_get_instance_private (renderdrawable);
}
static void
diff --git a/app/widgets/gimpwindow.c b/app/widgets/gimpwindow.c
index 0f1f1af00a..40b3e746cf 100644
--- a/app/widgets/gimpwindow.c
+++ b/app/widgets/gimpwindow.c
@@ -61,7 +61,7 @@ static gboolean gimp_window_key_press_event (GtkWidget *widget,
GdkEventKey *kevent);
-G_DEFINE_TYPE (GimpWindow, gimp_window, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpWindow, gimp_window, GTK_TYPE_WINDOW)
#define parent_class gimp_window_parent_class
@@ -90,16 +90,12 @@ gimp_window_class_init (GimpWindowClass *klass)
widget_class->screen_changed = gimp_window_screen_changed;
widget_class->configure_event = gimp_window_configure_event;
widget_class->key_press_event = gimp_window_key_press_event;
-
- g_type_class_add_private (klass, sizeof (GimpWindowPrivate));
}
static void
gimp_window_init (GimpWindow *window)
{
- window->private = G_TYPE_INSTANCE_GET_PRIVATE (window,
- GIMP_TYPE_WINDOW,
- GimpWindowPrivate);
+ window->private = gimp_window_get_instance_private (window);
window->private->monitor = -1;
}
diff --git a/libgimp/gimpaspectpreview.c b/libgimp/gimpaspectpreview.c
index d1260a9215..6177746624 100644
--- a/libgimp/gimpaspectpreview.c
+++ b/libgimp/gimpaspectpreview.c
@@ -62,9 +62,7 @@ typedef struct
#define GIMP_ASPECT_PREVIEW_GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (preview, \
- GIMP_TYPE_ASPECT_PREVIEW, \
- GimpAspectPreviewPrivate)
+ ((GimpAspectPreviewPrivate *) gimp_aspect_preview_get_instance_private ((GimpAspectPreview *) (preview)))
static void gimp_aspect_preview_constructed (GObject *object);
static void gimp_aspect_preview_dispose (GObject *object);
@@ -101,7 +99,8 @@ static void gimp_aspect_preview_set_drawable_id
gint32 drawable_ID);
-G_DEFINE_TYPE (GimpAspectPreview, gimp_aspect_preview, GIMP_TYPE_PREVIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpAspectPreview, gimp_aspect_preview,
+ GIMP_TYPE_PREVIEW)
#define parent_class gimp_aspect_preview_parent_class
@@ -127,8 +126,6 @@ gimp_aspect_preview_class_init (GimpAspectPreviewClass *klass)
preview_class->transform = gimp_aspect_preview_transform;
preview_class->untransform = gimp_aspect_preview_untransform;
- g_type_class_add_private (object_class, sizeof (GimpAspectPreviewPrivate));
-
/**
* GimpAspectPreview:drawable:
*
diff --git a/libgimp/gimpbrushselectbutton.c b/libgimp/gimpbrushselectbutton.c
index c2bf6f697f..99d1c34b1d 100644
--- a/libgimp/gimpbrushselectbutton.c
+++ b/libgimp/gimpbrushselectbutton.c
@@ -47,7 +47,7 @@
#define CELL_SIZE 20
-#define GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),
GIMP_TYPE_BRUSH_SELECT_BUTTON, GimpBrushSelectButtonPrivate))
+#define GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE(obj) ((GimpBrushSelectButtonPrivate *)
gimp_brush_select_button_get_instance_private ((GimpBrushSelectButton *) (obj)))
typedef struct _GimpBrushSelectButtonPrivate GimpBrushSelectButtonPrivate;
@@ -147,8 +147,8 @@ static const GtkTargetEntry target = { "application/x-gimp-brush-name", 0 };
static guint brush_button_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GimpBrushSelectButton, gimp_brush_select_button,
- GIMP_TYPE_SELECT_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpBrushSelectButton, gimp_brush_select_button,
+ GIMP_TYPE_SELECT_BUTTON)
static void
@@ -269,9 +269,6 @@ gimp_brush_select_button_class_init (GimpBrushSelectButtonClass *klass)
G_TYPE_INT,
G_TYPE_POINTER,
G_TYPE_BOOLEAN);
-
- g_type_class_add_private (object_class,
- sizeof (GimpBrushSelectButtonPrivate));
}
static void
diff --git a/libgimp/gimpdrawablepreview.c b/libgimp/gimpdrawablepreview.c
index c29b46847b..dcdc6c2726 100644
--- a/libgimp/gimpdrawablepreview.c
+++ b/libgimp/gimpdrawablepreview.c
@@ -67,9 +67,7 @@ typedef struct
#define GIMP_DRAWABLE_PREVIEW_GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (preview, \
- GIMP_TYPE_DRAWABLE_PREVIEW, \
- GimpDrawablePreviewPrivate)
+ ((GimpDrawablePreviewPrivate *) gimp_drawable_preview_get_instance_private ((GimpDrawablePreview *)
(preview)))
static void gimp_drawable_preview_constructed (GObject *object);
static void gimp_drawable_preview_dispose (GObject *object);
@@ -101,8 +99,8 @@ static void gimp_drawable_preview_set_drawable_id
gint32 drawable_ID);
-G_DEFINE_TYPE (GimpDrawablePreview, gimp_drawable_preview,
- GIMP_TYPE_SCROLLED_PREVIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDrawablePreview, gimp_drawable_preview,
+ GIMP_TYPE_SCROLLED_PREVIEW)
#define parent_class gimp_drawable_preview_parent_class
@@ -127,8 +125,6 @@ gimp_drawable_preview_class_init (GimpDrawablePreviewClass *klass)
preview_class->draw_thumb = gimp_drawable_preview_draw_thumb;
preview_class->draw_buffer = gimp_drawable_preview_draw_buffer;
- g_type_class_add_private (object_class, sizeof (GimpDrawablePreviewPrivate));
-
/**
* GimpDrawablePreview:drawable:
*
diff --git a/libgimp/gimpfontselectbutton.c b/libgimp/gimpfontselectbutton.c
index 1483926e2a..f3460f2c87 100644
--- a/libgimp/gimpfontselectbutton.c
+++ b/libgimp/gimpfontselectbutton.c
@@ -44,7 +44,7 @@
**/
-#define GIMP_FONT_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),
GIMP_TYPE_FONT_SELECT_BUTTON, GimpFontSelectButtonPrivate))
+#define GIMP_FONT_SELECT_BUTTON_GET_PRIVATE(obj) ((GimpFontSelectButtonPrivate *)
gimp_font_select_button_get_instance_private ((GimpFontSelectButton *) (obj)))
typedef struct _GimpFontSelectButtonPrivate GimpFontSelectButtonPrivate;
@@ -107,8 +107,8 @@ static const GtkTargetEntry target = { "application/x-gimp-font-name", 0 };
static guint font_button_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GimpFontSelectButton, gimp_font_select_button,
- GIMP_TYPE_SELECT_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpFontSelectButton, gimp_font_select_button,
+ GIMP_TYPE_SELECT_BUTTON)
static void
@@ -174,9 +174,6 @@ gimp_font_select_button_class_init (GimpFontSelectButtonClass *klass)
G_TYPE_NONE, 2,
G_TYPE_STRING,
G_TYPE_BOOLEAN);
-
- g_type_class_add_private (object_class,
- sizeof (GimpFontSelectButtonPrivate));
}
static void
diff --git a/libgimp/gimpgradientselectbutton.c b/libgimp/gimpgradientselectbutton.c
index f3ac3f24ca..25e6a8ce44 100644
--- a/libgimp/gimpgradientselectbutton.c
+++ b/libgimp/gimpgradientselectbutton.c
@@ -48,7 +48,7 @@
#define CELL_WIDTH 84
-#define GIMP_GRADIENT_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),
GIMP_TYPE_GRADIENT_SELECT_BUTTON, GimpGradientSelectButtonPrivate))
+#define GIMP_GRADIENT_SELECT_BUTTON_GET_PRIVATE(obj) ((GimpGradientSelectButtonPrivate *)
gimp_gradient_select_button_get_instance_private ((GimpGradientSelectButton *) (obj)))
typedef struct _GimpGradientSelectButtonPrivate GimpGradientSelectButtonPrivate;
@@ -125,8 +125,9 @@ static const GtkTargetEntry target = { "application/x-gimp-gradient-name", 0 };
static guint gradient_button_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GimpGradientSelectButton, gimp_gradient_select_button,
- GIMP_TYPE_SELECT_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpGradientSelectButton,
+ gimp_gradient_select_button,
+ GIMP_TYPE_SELECT_BUTTON)
static void
@@ -196,9 +197,6 @@ gimp_gradient_select_button_class_init (GimpGradientSelectButtonClass *klass)
G_TYPE_INT,
G_TYPE_POINTER,
G_TYPE_BOOLEAN);
-
- g_type_class_add_private (object_class,
- sizeof (GimpGradientSelectButtonPrivate));
}
static void
diff --git a/libgimp/gimppaletteselectbutton.c b/libgimp/gimppaletteselectbutton.c
index d5a03663e3..66ddd688e9 100644
--- a/libgimp/gimppaletteselectbutton.c
+++ b/libgimp/gimppaletteselectbutton.c
@@ -44,7 +44,7 @@
**/
-#define GIMP_PALETTE_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),
GIMP_TYPE_PALETTE_SELECT_BUTTON, GimpPaletteSelectButtonPrivate))
+#define GIMP_PALETTE_SELECT_BUTTON_GET_PRIVATE(obj) ((GimpPaletteSelectButtonPrivate *)
gimp_palette_select_button_get_instance_private ((GimpPaletteSelectButton *) (obj)))
typedef struct _GimpPaletteSelectButtonPrivate GimpPaletteSelectButtonPrivate;
@@ -107,8 +107,8 @@ static const GtkTargetEntry target = { "application/x-gimp-palette-name", 0 };
static guint palette_button_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GimpPaletteSelectButton, gimp_palette_select_button,
- GIMP_TYPE_SELECT_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPaletteSelectButton, gimp_palette_select_button,
+ GIMP_TYPE_SELECT_BUTTON)
static void
@@ -174,9 +174,6 @@ gimp_palette_select_button_class_init (GimpPaletteSelectButtonClass *klass)
G_TYPE_NONE, 2,
G_TYPE_STRING,
G_TYPE_BOOLEAN);
-
- g_type_class_add_private (object_class,
- sizeof (GimpPaletteSelectButtonPrivate));
}
static void
diff --git a/libgimp/gimppatternselectbutton.c b/libgimp/gimppatternselectbutton.c
index aa0793f9bf..ea652eb10b 100644
--- a/libgimp/gimppatternselectbutton.c
+++ b/libgimp/gimppatternselectbutton.c
@@ -47,7 +47,7 @@
#define CELL_SIZE 20
-#define GIMP_PATTERN_SELECT_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),
GIMP_TYPE_PATTERN_SELECT_BUTTON, GimpPatternSelectButtonPrivate))
+#define GIMP_PATTERN_SELECT_BUTTON_GET_PRIVATE(obj) ((GimpPatternSelectButtonPrivate *)
gimp_pattern_select_button_get_instance_private ((GimpPatternSelectButton *) (obj)))
typedef struct _GimpPatternSelectButtonPrivate GimpPatternSelectButtonPrivate;
@@ -134,8 +134,8 @@ static const GtkTargetEntry target = { "application/x-gimp-pattern-name", 0 };
static guint pattern_button_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GimpPatternSelectButton, gimp_pattern_select_button,
- GIMP_TYPE_SELECT_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPatternSelectButton, gimp_pattern_select_button,
+ GIMP_TYPE_SELECT_BUTTON)
static void
gimp_pattern_select_button_class_init (GimpPatternSelectButtonClass *klass)
@@ -208,9 +208,6 @@ gimp_pattern_select_button_class_init (GimpPatternSelectButtonClass *klass)
G_TYPE_INT,
G_TYPE_POINTER,
G_TYPE_BOOLEAN);
-
- g_type_class_add_private (object_class,
- sizeof (GimpPatternSelectButtonPrivate));
}
static void
diff --git a/libgimp/gimptilebackendplugin.c b/libgimp/gimptilebackendplugin.c
index 6c37371f0e..900e934df0 100644
--- a/libgimp/gimptilebackendplugin.c
+++ b/libgimp/gimptilebackendplugin.c
@@ -78,8 +78,8 @@ static GeglTile * gimp_tile_read_mul (GimpTileBackendPlugin *backend_plugin,
gint y);
-G_DEFINE_TYPE (GimpTileBackendPlugin, _gimp_tile_backend_plugin,
- GEGL_TYPE_TILE_BACKEND)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpTileBackendPlugin, _gimp_tile_backend_plugin,
+ GEGL_TYPE_TILE_BACKEND)
#define parent_class _gimp_tile_backend_plugin_parent_class
@@ -94,8 +94,6 @@ _gimp_tile_backend_plugin_class_init (GimpTileBackendPluginClass *klass)
object_class->finalize = gimp_tile_backend_plugin_finalize;
- g_type_class_add_private (klass, sizeof (GimpTileBackendPluginPrivate));
-
gimp_tile_cache_ntiles (64);
}
@@ -104,9 +102,7 @@ _gimp_tile_backend_plugin_init (GimpTileBackendPlugin *backend)
{
GeglTileSource *source = GEGL_TILE_SOURCE (backend);
- backend->priv = G_TYPE_INSTANCE_GET_PRIVATE (backend,
- GIMP_TYPE_TILE_BACKEND_PLUGIN,
- GimpTileBackendPluginPrivate);
+ backend->priv = _gimp_tile_backend_plugin_get_instance_private (backend);
source->command = gimp_tile_backend_plugin_command;
}
diff --git a/libgimp/gimpzoompreview.c b/libgimp/gimpzoompreview.c
index e28accb2db..eb0735a92d 100644
--- a/libgimp/gimpzoompreview.c
+++ b/libgimp/gimpzoompreview.c
@@ -129,7 +129,8 @@ static void gimp_zoom_preview_get_source_area (GimpPreview *preview,
gint *h);
-G_DEFINE_TYPE (GimpZoomPreview, gimp_zoom_preview, GIMP_TYPE_SCROLLED_PREVIEW)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpZoomPreview, gimp_zoom_preview,
+ GIMP_TYPE_SCROLLED_PREVIEW)
#define parent_class gimp_zoom_preview_parent_class
@@ -158,8 +159,6 @@ gimp_zoom_preview_class_init (GimpZoomPreviewClass *klass)
preview_class->transform = gimp_zoom_preview_transform;
preview_class->untransform = gimp_zoom_preview_untransform;
- g_type_class_add_private (object_class, sizeof (GimpZoomPreviewPrivate));
-
/**
* GimpZoomPreview:drawable:
*
@@ -210,9 +209,7 @@ gimp_zoom_preview_class_init (GimpZoomPreviewClass *klass)
static void
gimp_zoom_preview_init (GimpZoomPreview *preview)
{
- preview->priv = G_TYPE_INSTANCE_GET_PRIVATE (preview,
- GIMP_TYPE_ZOOM_PREVIEW,
- GimpZoomPreviewPrivate);
+ preview->priv = gimp_zoom_preview_get_instance_private (preview);
g_signal_connect (GIMP_PREVIEW (preview)->area, "size-allocate",
G_CALLBACK (gimp_zoom_preview_size_allocate),
diff --git a/libgimpcolor/gimpcolorprofile.c b/libgimpcolor/gimpcolorprofile.c
index fe7c10cfa5..9beef491e9 100644
--- a/libgimpcolor/gimpcolorprofile.c
+++ b/libgimpcolor/gimpcolorprofile.c
@@ -107,8 +107,7 @@ struct _GimpColorProfilePrivate
static void gimp_color_profile_finalize (GObject *object);
-G_DEFINE_TYPE (GimpColorProfile, gimp_color_profile,
- G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorProfile, gimp_color_profile, G_TYPE_OBJECT)
#define parent_class gimp_color_profile_parent_class
@@ -132,16 +131,12 @@ gimp_color_profile_class_init (GimpColorProfileClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_color_profile_finalize;
-
- g_type_class_add_private (klass, sizeof (GimpColorProfilePrivate));
}
static void
gimp_color_profile_init (GimpColorProfile *profile)
{
- profile->priv = G_TYPE_INSTANCE_GET_PRIVATE (profile,
- GIMP_TYPE_COLOR_PROFILE,
- GimpColorProfilePrivate);
+ profile->priv = gimp_color_profile_get_instance_private (profile);
}
static void
diff --git a/libgimpcolor/gimpcolortransform.c b/libgimpcolor/gimpcolortransform.c
index acea276325..b3c0a21589 100644
--- a/libgimpcolor/gimpcolortransform.c
+++ b/libgimpcolor/gimpcolortransform.c
@@ -84,8 +84,8 @@ struct _GimpColorTransformPrivate
static void gimp_color_transform_finalize (GObject *object);
-G_DEFINE_TYPE (GimpColorTransform, gimp_color_transform,
- G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorTransform, gimp_color_transform,
+ G_TYPE_OBJECT)
#define parent_class gimp_color_transform_parent_class
@@ -132,17 +132,13 @@ gimp_color_transform_class_init (GimpColorTransformClass *klass)
G_TYPE_NONE, 1,
G_TYPE_DOUBLE);
- g_type_class_add_private (klass, sizeof (GimpColorTransformPrivate));
-
cmsSetLogErrorHandler (lcms_error_handler);
}
static void
gimp_color_transform_init (GimpColorTransform *transform)
{
- transform->priv = G_TYPE_INSTANCE_GET_PRIVATE (transform,
- GIMP_TYPE_COLOR_TRANSFORM,
- GimpColorTransformPrivate);
+ transform->priv = gimp_color_transform_get_instance_private (transform);
}
static void
diff --git a/libgimpconfig/gimpcolorconfig.c b/libgimpconfig/gimpcolorconfig.c
index c01700b3e3..9ef5d482e2 100644
--- a/libgimpconfig/gimpcolorconfig.c
+++ b/libgimpconfig/gimpcolorconfig.c
@@ -142,9 +142,7 @@ struct _GimpColorConfigPrivate
};
#define GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_COLOR_CONFIG, \
- GimpColorConfigPrivate)
+ ((GimpColorConfigPrivate *) gimp_color_config_get_instance_private ((GimpColorConfig *) (obj)))
static void gimp_color_config_finalize (GObject *object);
@@ -175,6 +173,7 @@ static void gimp_color_config_set_simulation_profile (GimpColorConfig *config,
G_DEFINE_TYPE_WITH_CODE (GimpColorConfig, gimp_color_config, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpColorConfig)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL)
gimp_type_set_translation_domain (g_define_type_id,
GETTEXT_PACKAGE "-libgimp"))
@@ -309,8 +308,6 @@ gimp_color_config_class_init (GimpColorConfigClass *klass)
"This property is deprecated and its value ignored",
"CdisplayLcms",
GIMP_PARAM_STATIC_STRINGS);
-
- g_type_class_add_private (object_class, sizeof (GimpColorConfigPrivate));
}
static void
diff --git a/libgimpwidgets/gimpbusybox.c b/libgimpwidgets/gimpbusybox.c
index 58450f1866..33255d189c 100644
--- a/libgimpwidgets/gimpbusybox.c
+++ b/libgimpwidgets/gimpbusybox.c
@@ -66,7 +66,7 @@ static void gimp_busy_box_get_property (GObject *object,
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpBusyBox, gimp_busy_box, GTK_TYPE_ALIGNMENT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpBusyBox, gimp_busy_box, GTK_TYPE_ALIGNMENT)
#define parent_class gimp_busy_box_parent_class
@@ -95,8 +95,6 @@ gimp_busy_box_class_init (GimpBusyBoxClass *klass)
NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (klass, sizeof (GimpBusyBoxPrivate));
}
static void
@@ -106,9 +104,7 @@ gimp_busy_box_init (GimpBusyBox *box)
GtkWidget *spinner;
GtkWidget *label;
- box->priv = G_TYPE_INSTANCE_GET_PRIVATE (box,
- GIMP_TYPE_BUSY_BOX,
- GimpBusyBoxPrivate);
+ box->priv = gimp_busy_box_get_instance_private (box);
gtk_alignment_set (GTK_ALIGNMENT (box), 0.5, 0.5, 0.0, 0.0);
diff --git a/libgimpwidgets/gimpcellrenderertoggle.c b/libgimpwidgets/gimpcellrenderertoggle.c
index d4e451ab98..84dff32d4d 100644
--- a/libgimpwidgets/gimpcellrenderertoggle.c
+++ b/libgimpwidgets/gimpcellrenderertoggle.c
@@ -67,9 +67,7 @@ struct _GimpCellRendererTogglePrivate
};
#define GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_CELL_RENDERER_TOGGLE, \
- GimpCellRendererTogglePrivate)
+ ((GimpCellRendererTogglePrivate *) gimp_cell_renderer_toggle_get_instance_private
((GimpCellRendererToggle *) (obj)))
static void gimp_cell_renderer_toggle_finalize (GObject *object);
@@ -106,8 +104,8 @@ static void gimp_cell_renderer_toggle_create_pixbuf (GimpCellRendererToggle *tog
GtkWidget *widget);
-G_DEFINE_TYPE (GimpCellRendererToggle, gimp_cell_renderer_toggle,
- GTK_TYPE_CELL_RENDERER_TOGGLE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpCellRendererToggle, gimp_cell_renderer_toggle,
+ GTK_TYPE_CELL_RENDERER_TOGGLE)
#define parent_class gimp_cell_renderer_toggle_parent_class
@@ -171,8 +169,6 @@ gimp_cell_renderer_toggle_class_init (GimpCellRendererToggleClass *klass)
FALSE,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
-
- g_type_class_add_private (object_class, sizeof (GimpCellRendererTogglePrivate));
}
static void
diff --git a/libgimpwidgets/gimpcolorarea.c b/libgimpwidgets/gimpcolorarea.c
index 04a5bd5b39..2ba26fbcd0 100644
--- a/libgimpwidgets/gimpcolorarea.c
+++ b/libgimpwidgets/gimpcolorarea.c
@@ -74,9 +74,7 @@ struct _GimpColorAreaPrivate
};
#define GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_COLOR_AREA, \
- GimpColorAreaPrivate)
+ ((GimpColorAreaPrivate *) gimp_color_area_get_instance_private ((GimpColorArea *) (obj)))
static void gimp_color_area_dispose (GObject *object);
@@ -127,7 +125,8 @@ static void gimp_color_area_create_transform (GimpColorArea *area);
static void gimp_color_area_destroy_transform (GimpColorArea *area);
-G_DEFINE_TYPE (GimpColorArea, gimp_color_area, GTK_TYPE_DRAWING_AREA)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorArea, gimp_color_area,
+ GTK_TYPE_DRAWING_AREA)
#define parent_class gimp_color_area_parent_class
@@ -227,8 +226,6 @@ gimp_color_area_class_init (GimpColorAreaClass *klass)
"Whether to draw a thin border in the foreground
color around the area",
FALSE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpColorAreaPrivate));
}
static void
diff --git a/libgimpwidgets/gimpcolordisplay.c b/libgimpwidgets/gimpcolordisplay.c
index 915a8b47c6..d064e9b7f2 100644
--- a/libgimpwidgets/gimpcolordisplay.c
+++ b/libgimpwidgets/gimpcolordisplay.c
@@ -68,7 +68,7 @@ typedef struct
GimpColorManaged *managed;
} GimpColorDisplayPrivate;
-#define GIMP_COLOR_DISPLAY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIMP_TYPE_COLOR_DISPLAY,
GimpColorDisplayPrivate))
+#define GIMP_COLOR_DISPLAY_GET_PRIVATE(obj) ((GimpColorDisplayPrivate *)
gimp_color_display_get_instance_private ((GimpColorDisplay *) (obj)))
static void gimp_color_display_constructed (GObject *object);
@@ -89,6 +89,7 @@ static void gimp_color_display_set_color_managed (GimpColorDisplay *display,
G_DEFINE_TYPE_WITH_CODE (GimpColorDisplay, gimp_color_display, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpColorDisplay)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_color_display_parent_class
@@ -106,8 +107,6 @@ gimp_color_display_class_init (GimpColorDisplayClass *klass)
object_class->set_property = gimp_color_display_set_property;
object_class->get_property = gimp_color_display_get_property;
- g_type_class_add_private (object_class, sizeof (GimpColorDisplayPrivate));
-
g_object_class_install_property (object_class, PROP_ENABLED,
g_param_spec_boolean ("enabled",
"Enabled",
diff --git a/libgimpwidgets/gimpcolorprofilechooserdialog.c b/libgimpwidgets/gimpcolorprofilechooserdialog.c
index a207f0f2f1..000e6c0515 100644
--- a/libgimpwidgets/gimpcolorprofilechooserdialog.c
+++ b/libgimpwidgets/gimpcolorprofilechooserdialog.c
@@ -55,8 +55,9 @@ static void gimp_color_profile_chooser_dialog_add_shortcut (GimpColorProfi
static void gimp_color_profile_chooser_dialog_update_preview (GimpColorProfileChooserDialog *dialog);
-G_DEFINE_TYPE (GimpColorProfileChooserDialog, gimp_color_profile_chooser_dialog,
- GTK_TYPE_FILE_CHOOSER_DIALOG);
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorProfileChooserDialog,
+ gimp_color_profile_chooser_dialog,
+ GTK_TYPE_FILE_CHOOSER_DIALOG)
#define parent_class gimp_color_profile_chooser_dialog_parent_class
@@ -70,17 +71,13 @@ gimp_color_profile_chooser_dialog_class_init (GimpColorProfileChooserDialogClass
object_class->constructed = gimp_color_profile_chooser_dialog_constructed;
widget_class->delete_event = gimp_color_profile_chooser_dialog_delete_event;
-
- g_type_class_add_private (klass, sizeof (GimpColorProfileChooserDialogPrivate));
}
static void
gimp_color_profile_chooser_dialog_init (GimpColorProfileChooserDialog *dialog)
{
dialog->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (dialog,
- GIMP_TYPE_COLOR_PROFILE_CHOOSER_DIALOG,
- GimpColorProfileChooserDialogPrivate);
+ gimp_color_profile_chooser_dialog_get_instance_private (dialog);
}
static void
diff --git a/libgimpwidgets/gimpcolorprofilecombobox.c b/libgimpwidgets/gimpcolorprofilecombobox.c
index 3c2d3c7fb5..348136530d 100644
--- a/libgimpwidgets/gimpcolorprofilecombobox.c
+++ b/libgimpwidgets/gimpcolorprofilecombobox.c
@@ -57,9 +57,7 @@ typedef struct
} GimpColorProfileComboBoxPrivate;
#define GIMP_COLOR_PROFILE_COMBO_BOX_GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_COLOR_PROFILE_COMBO_BOX, \
- GimpColorProfileComboBoxPrivate)
+ ((GimpColorProfileComboBoxPrivate *) gimp_color_profile_combo_box_get_instance_private
((GimpColorProfileComboBox *) (obj)))
static void gimp_color_profile_combo_box_finalize (GObject *object);
@@ -82,8 +80,8 @@ static void gimp_color_profile_combo_dialog_response (GimpColorProfileChooserD
GimpColorProfileComboBox *combo);
-G_DEFINE_TYPE (GimpColorProfileComboBox,
- gimp_color_profile_combo_box, GTK_TYPE_COMBO_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorProfileComboBox,
+ gimp_color_profile_combo_box, GTK_TYPE_COMBO_BOX)
#define parent_class gimp_color_profile_combo_box_parent_class
@@ -132,9 +130,6 @@ gimp_color_profile_combo_box_class_init (GimpColorProfileComboBoxClass *klass)
"The profile store used for this combo box",
GIMP_TYPE_COLOR_PROFILE_STORE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class,
- sizeof (GimpColorProfileComboBoxPrivate));
}
static void
diff --git a/libgimpwidgets/gimpcolorprofileview.c b/libgimpwidgets/gimpcolorprofileview.c
index 979b515590..8ee2308cf7 100644
--- a/libgimpwidgets/gimpcolorprofileview.c
+++ b/libgimpwidgets/gimpcolorprofileview.c
@@ -44,8 +44,8 @@ static void gimp_color_profile_view_constructed (GObject *object);
static void gimp_color_profile_view_finalize (GObject *object);
-G_DEFINE_TYPE (GimpColorProfileView, gimp_color_profile_view,
- GTK_TYPE_TEXT_VIEW);
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorProfileView, gimp_color_profile_view,
+ GTK_TYPE_TEXT_VIEW)
#define parent_class gimp_color_profile_view_parent_class
@@ -57,16 +57,12 @@ gimp_color_profile_view_class_init (GimpColorProfileViewClass *klass)
object_class->constructed = gimp_color_profile_view_constructed;
object_class->finalize = gimp_color_profile_view_finalize;
-
- g_type_class_add_private (klass, sizeof (GimpColorProfileViewPrivate));
}
static void
gimp_color_profile_view_init (GimpColorProfileView *view)
{
- view->priv = G_TYPE_INSTANCE_GET_PRIVATE (view,
- GIMP_TYPE_COLOR_PROFILE_VIEW,
- GimpColorProfileViewPrivate);
+ view->priv = gimp_color_profile_view_get_instance_private (view);
}
static void
diff --git a/libgimpwidgets/gimpcolorscale.c b/libgimpwidgets/gimpcolorscale.c
index 11bdfb9dfe..f87ab08935 100644
--- a/libgimpwidgets/gimpcolorscale.c
+++ b/libgimpwidgets/gimpcolorscale.c
@@ -72,9 +72,7 @@ struct _GimpColorScalePrivate
};
#define GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_COLOR_SCALE, \
- GimpColorScalePrivate)
+ ((GimpColorScalePrivate *) gimp_color_scale_get_instance_private ((GimpColorScale *) (obj)))
static void gimp_color_scale_dispose (GObject *object);
@@ -112,7 +110,7 @@ static void gimp_color_scale_notify_config (GimpColorConfig *config,
GimpColorScale *scale);
-G_DEFINE_TYPE (GimpColorScale, gimp_color_scale, GTK_TYPE_SCALE)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorScale, gimp_color_scale, GTK_TYPE_SCALE)
#define parent_class gimp_color_scale_parent_class
@@ -154,8 +152,6 @@ gimp_color_scale_class_init (GimpColorScaleClass *klass)
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
- g_type_class_add_private (object_class, sizeof (GimpColorScalePrivate));
-
fish_rgb_to_lch = babl_fish (babl_format ("R'G'B'A double"),
babl_format ("CIE LCH(ab) double"));
fish_lch_to_rgb = babl_fish (babl_format ("CIE LCH(ab) double"),
diff --git a/libgimpwidgets/gimpcolorselector.c b/libgimpwidgets/gimpcolorselector.c
index 4a65253865..72023accfc 100644
--- a/libgimpwidgets/gimpcolorselector.c
+++ b/libgimpwidgets/gimpcolorselector.c
@@ -66,15 +66,14 @@ struct _GimpColorSelectorPrivate
};
#define GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_COLOR_SELECTOR, \
- GimpColorSelectorPrivate)
+ ((GimpColorSelectorPrivate *) gimp_color_selector_get_instance_private ((GimpColorSelector *) (obj)))
static void gimp_color_selector_dispose (GObject *object);
-G_DEFINE_TYPE (GimpColorSelector, gimp_color_selector, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpColorSelector, gimp_color_selector,
+ GTK_TYPE_BOX)
#define parent_class gimp_color_selector_parent_class
@@ -134,8 +133,6 @@ gimp_color_selector_class_init (GimpColorSelectorClass *klass)
klass->channel_changed = NULL;
klass->model_visible_changed = NULL;
klass->set_config = NULL;
-
- g_type_class_add_private (object_class, sizeof (GimpColorSelectorPrivate));
}
static void
diff --git a/libgimpwidgets/gimpdialog.c b/libgimpwidgets/gimpdialog.c
index b0fa1a48fe..be92c402e2 100644
--- a/libgimpwidgets/gimpdialog.c
+++ b/libgimpwidgets/gimpdialog.c
@@ -60,9 +60,7 @@ struct _GimpDialogPrivate
GtkWidget *help_button;
};
-#define GET_PRIVATE(dialog) G_TYPE_INSTANCE_GET_PRIVATE (dialog, \
- GIMP_TYPE_DIALOG, \
- GimpDialogPrivate)
+#define GET_PRIVATE(dialog) ((GimpDialogPrivate *) gimp_dialog_get_instance_private ((GimpDialog *)
(dialog)))
static void gimp_dialog_constructed (GObject *object);
@@ -88,7 +86,7 @@ static void gimp_dialog_response (GtkDialog *dialog,
gint response_id);
-G_DEFINE_TYPE (GimpDialog, gimp_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpDialog, gimp_dialog, GTK_TYPE_DIALOG)
#define parent_class gimp_dialog_parent_class
@@ -150,8 +148,6 @@ gimp_dialog_class_init (GimpDialogClass *klass)
GTK_TYPE_WIDGET,
GIMP_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY));
-
- g_type_class_add_private (klass, sizeof (GimpDialogPrivate));
}
static void
diff --git a/libgimpwidgets/gimpintcombobox.c b/libgimpwidgets/gimpintcombobox.c
index 7dea56efc6..6cd890935b 100644
--- a/libgimpwidgets/gimpintcombobox.c
+++ b/libgimpwidgets/gimpintcombobox.c
@@ -90,7 +90,8 @@ static void gimp_int_combo_box_data_func (GtkCellLayout *layout,
gpointer data);
-G_DEFINE_TYPE (GimpIntComboBox, gimp_int_combo_box, GTK_TYPE_COMBO_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpIntComboBox, gimp_int_combo_box,
+ GTK_TYPE_COMBO_BOX)
#define parent_class gimp_int_combo_box_parent_class
@@ -149,8 +150,6 @@ gimp_int_combo_box_class_init (GimpIntComboBoxClass *klass)
GIMP_TYPE_INT_COMBO_BOX_LAYOUT,
GIMP_INT_COMBO_BOX_LAYOUT_ABBREVIATED,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpIntComboBoxPrivate));
}
static void
@@ -159,9 +158,7 @@ gimp_int_combo_box_init (GimpIntComboBox *combo_box)
GimpIntComboBoxPrivate *priv;
GtkListStore *store;
- combo_box->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
- GIMP_TYPE_INT_COMBO_BOX,
- GimpIntComboBoxPrivate);
+ combo_box->priv = priv = gimp_int_combo_box_get_instance_private (combo_box);
store = gimp_int_store_new ();
gtk_combo_box_set_model (GTK_COMBO_BOX (combo_box), GTK_TREE_MODEL (store));
diff --git a/libgimpwidgets/gimpintstore.c b/libgimpwidgets/gimpintstore.c
index 0ffec3f5c2..54c6cf94ad 100644
--- a/libgimpwidgets/gimpintstore.c
+++ b/libgimpwidgets/gimpintstore.c
@@ -76,11 +76,12 @@ static void gimp_int_store_add_empty (GimpIntStore *store);
G_DEFINE_TYPE_WITH_CODE (GimpIntStore, gimp_int_store, GTK_TYPE_LIST_STORE,
+ G_ADD_PRIVATE (GimpIntStore)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
gimp_int_store_tree_model_init))
#define GIMP_INT_STORE_GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, GIMP_TYPE_INT_STORE, GimpIntStorePrivate)
+ ((GimpIntStorePrivate *) gimp_int_store_get_instance_private ((GimpIntStore *) (obj)))
#define parent_class gimp_int_store_parent_class
@@ -116,8 +117,6 @@ gimp_int_store_class_init (GimpIntStoreClass *klass)
G_TYPE_NONE,
G_PARAM_CONSTRUCT_ONLY |
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpIntStorePrivate));
}
static void
diff --git a/libgimpwidgets/gimpnumberpairentry.c b/libgimpwidgets/gimpnumberpairentry.c
index b1c0e0658c..0b57bb33c5 100644
--- a/libgimpwidgets/gimpnumberpairentry.c
+++ b/libgimpwidgets/gimpnumberpairentry.c
@@ -161,7 +161,8 @@ static gchar * gimp_number_pair_entry_strdup_number_pair_string
-G_DEFINE_TYPE (GimpNumberPairEntry, gimp_number_pair_entry, GTK_TYPE_ENTRY)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpNumberPairEntry, gimp_number_pair_entry,
+ GTK_TYPE_ENTRY)
#define parent_class gimp_number_pair_entry_parent_class
@@ -297,8 +298,6 @@ gimp_number_pair_entry_class_init (GimpNumberPairEntryClass *klass)
GIMP_TYPE_ASPECT_TYPE,
GIMP_ASPECT_SQUARE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (klass, sizeof (GimpNumberPairEntryPrivate));
}
static void
@@ -306,9 +305,7 @@ gimp_number_pair_entry_init (GimpNumberPairEntry *entry)
{
GimpNumberPairEntryPrivate *priv;
- entry->priv = G_TYPE_INSTANCE_GET_PRIVATE (entry,
- GIMP_TYPE_NUMBER_PAIR_ENTRY,
- GimpNumberPairEntryPrivate);
+ entry->priv = gimp_number_pair_entry_get_instance_private (entry);
priv = GIMP_NUMBER_PAIR_ENTRY_GET_PRIVATE (entry);
diff --git a/libgimpwidgets/gimppageselector.c b/libgimpwidgets/gimppageselector.c
index 9ee844e69f..03b6a5693f 100644
--- a/libgimpwidgets/gimppageselector.c
+++ b/libgimpwidgets/gimppageselector.c
@@ -119,7 +119,7 @@ static GdkPixbuf * gimp_page_selector_add_frame (GtkWidget *widget,
GdkPixbuf *pixbuf);
-G_DEFINE_TYPE (GimpPageSelector, gimp_page_selector, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPageSelector, gimp_page_selector, GTK_TYPE_BOX)
#define parent_class gimp_page_selector_parent_class
@@ -203,8 +203,6 @@ gimp_page_selector_class_init (GimpPageSelectorClass *klass)
GIMP_TYPE_PAGE_SELECTOR_TARGET,
GIMP_PAGE_SELECTOR_TARGET_LAYERS,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpPageSelectorPrivate));
}
static void
@@ -219,9 +217,7 @@ gimp_page_selector_init (GimpPageSelector *selector)
GtkWidget *label;
GtkWidget *combo;
- selector->priv = G_TYPE_INSTANCE_GET_PRIVATE (selector,
- GIMP_TYPE_PAGE_SELECTOR,
- GimpPageSelectorPrivate);
+ selector->priv = gimp_page_selector_get_instance_private (selector);
priv = GIMP_PAGE_SELECTOR_GET_PRIVATE (selector);
diff --git a/libgimpwidgets/gimppreviewarea.c b/libgimpwidgets/gimppreviewarea.c
index c62f13c232..7715ce0e1e 100644
--- a/libgimpwidgets/gimppreviewarea.c
+++ b/libgimpwidgets/gimppreviewarea.c
@@ -70,9 +70,7 @@ struct _GimpPreviewAreaPrivate
};
#define GET_PRIVATE(obj) \
- G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_PREVIEW_AREA, \
- GimpPreviewAreaPrivate)
+ ((GimpPreviewAreaPrivate *) gimp_preview_area_get_instance_private ((GimpPreviewArea *) (obj)))
static void gimp_preview_area_dispose (GObject *object);
@@ -102,7 +100,8 @@ static void gimp_preview_area_create_transform (GimpPreviewArea *area);
static void gimp_preview_area_destroy_transform (GimpPreviewArea *area);
-G_DEFINE_TYPE (GimpPreviewArea, gimp_preview_area, GTK_TYPE_DRAWING_AREA)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpPreviewArea, gimp_preview_area,
+ GTK_TYPE_DRAWING_AREA)
#define parent_class gimp_preview_area_parent_class
@@ -136,8 +135,6 @@ gimp_preview_area_class_init (GimpPreviewAreaClass *klass)
GIMP_TYPE_CHECK_TYPE,
DEFAULT_CHECK_TYPE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpPreviewAreaPrivate));
}
static void
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index 08aa25b7cd..db9f53821a 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -80,7 +80,7 @@ typedef struct
} GimpRulerPrivate;
#define GIMP_RULER_GET_PRIVATE(ruler) \
- G_TYPE_INSTANCE_GET_PRIVATE (ruler, GIMP_TYPE_RULER, GimpRulerPrivate)
+ ((GimpRulerPrivate *) gimp_ruler_get_instance_private ((GimpRuler *) (ruler)))
typedef struct
@@ -153,7 +153,7 @@ static const RulerMetric *
gimp_ruler_get_metric (GimpUnit unit);
-G_DEFINE_TYPE (GimpRuler, gimp_ruler, GTK_TYPE_WIDGET)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpRuler, gimp_ruler, GTK_TYPE_WIDGET)
#define parent_class gimp_ruler_parent_class
@@ -178,8 +178,6 @@ gimp_ruler_class_init (GimpRulerClass *klass)
widget_class->motion_notify_event = gimp_ruler_motion_notify;
widget_class->expose_event = gimp_ruler_expose;
- g_type_class_add_private (object_class, sizeof (GimpRulerPrivate));
-
g_object_class_install_property (object_class,
PROP_ORIENTATION,
g_param_spec_enum ("orientation",
diff --git a/libgimpwidgets/gimpstringcombobox.c b/libgimpwidgets/gimpstringcombobox.c
index b24a6814d6..56208a385b 100644
--- a/libgimpwidgets/gimpstringcombobox.c
+++ b/libgimpwidgets/gimpstringcombobox.c
@@ -70,7 +70,8 @@ static void gimp_string_combo_box_get_property (GObject *object,
GParamSpec *pspec);
-G_DEFINE_TYPE (GimpStringComboBox, gimp_string_combo_box, GTK_TYPE_COMBO_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpStringComboBox, gimp_string_combo_box,
+ GTK_TYPE_COMBO_BOX)
#define parent_class gimp_string_combo_box_parent_class
@@ -136,16 +137,12 @@ gimp_string_combo_box_class_init (GimpStringComboBoxClass *klass)
PANGO_TYPE_ELLIPSIZE_MODE,
PANGO_ELLIPSIZE_NONE,
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpStringComboBoxPrivate));
}
static void
gimp_string_combo_box_init (GimpStringComboBox *combo_box)
{
- combo_box->priv = G_TYPE_INSTANCE_GET_PRIVATE (combo_box,
- GIMP_TYPE_STRING_COMBO_BOX,
- GimpStringComboBoxPrivate);
+ combo_box->priv = gimp_string_combo_box_get_instance_private (combo_box);
}
static void
diff --git a/libgimpwidgets/gimpunitstore.c b/libgimpwidgets/gimpunitstore.c
index 4efb98655b..f3524d24f5 100644
--- a/libgimpwidgets/gimpunitstore.c
+++ b/libgimpwidgets/gimpunitstore.c
@@ -55,9 +55,7 @@ typedef struct
GimpUnit synced_unit;
} GimpUnitStorePrivate;
-#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE (obj, \
- GIMP_TYPE_UNIT_STORE, \
- GimpUnitStorePrivate)
+#define GET_PRIVATE(obj) ((GimpUnitStorePrivate *) gimp_unit_store_get_instance_private ((GimpUnitStore *)
(obj)))
static void gimp_unit_store_tree_model_init (GtkTreeModelIface *iface);
@@ -104,6 +102,7 @@ static gboolean gimp_unit_store_iter_parent (GtkTreeModel *tree_model,
G_DEFINE_TYPE_WITH_CODE (GimpUnitStore, gimp_unit_store, G_TYPE_OBJECT,
+ G_ADD_PRIVATE (GimpUnitStore)
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
gimp_unit_store_tree_model_init))
@@ -171,8 +170,6 @@ gimp_unit_store_class_init (GimpUnitStoreClass *klass)
"Format string for a long label",
"%p",
GIMP_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (GimpUnitStorePrivate));
}
static void
diff --git a/libgimpwidgets/gimpzoommodel.c b/libgimpwidgets/gimpzoommodel.c
index ff5d2a7da2..2860595871 100644
--- a/libgimpwidgets/gimpzoommodel.c
+++ b/libgimpwidgets/gimpzoommodel.c
@@ -85,7 +85,7 @@ static void gimp_zoom_model_get_property (GObject *object,
static guint zoom_model_signals[LAST_SIGNAL] = { 0, };
-G_DEFINE_TYPE (GimpZoomModel, gimp_zoom_model, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GimpZoomModel, gimp_zoom_model, G_TYPE_OBJECT)
#define parent_class gimp_zoom_model_parent_class
@@ -176,8 +176,6 @@ gimp_zoom_model_class_init (GimpZoomModelClass *klass)
"The zoom factor expressed as a percentage",
"100%",
GIMP_PARAM_READABLE));
-
- g_type_class_add_private (object_class, sizeof (GimpZoomModelPrivate));
}
static void
@@ -185,9 +183,7 @@ gimp_zoom_model_init (GimpZoomModel *model)
{
GimpZoomModelPrivate *priv;
- model->priv = G_TYPE_INSTANCE_GET_PRIVATE (model,
- GIMP_TYPE_ZOOM_MODEL,
- GimpZoomModelPrivate);
+ model->priv = gimp_zoom_model_get_instance_private (model);
priv = GIMP_ZOOM_MODEL_GET_PRIVATE (model);
diff --git a/modules/gimpcolorwheel.c b/modules/gimpcolorwheel.c
index 13d6409b6c..293d051c99 100644
--- a/modules/gimpcolorwheel.c
+++ b/modules/gimpcolorwheel.c
@@ -126,7 +126,9 @@ static void gimp_color_wheel_destroy_transform (GimpColorWheel *wheel);
static guint wheel_signals[LAST_SIGNAL];
-G_DEFINE_DYNAMIC_TYPE (GimpColorWheel, gimp_color_wheel, GTK_TYPE_WIDGET)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (GimpColorWheel, gimp_color_wheel,
+ GTK_TYPE_WIDGET, 0,
+ G_ADD_PRIVATE_DYNAMIC (GimpColorWheel))
#define parent_class gimp_color_wheel_parent_class
@@ -211,8 +213,6 @@ gimp_color_wheel_class_init (GimpColorWheelClass *class)
gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0,
"move", 1,
G_TYPE_ENUM, GTK_DIR_LEFT);
-
- g_type_class_add_private (object_class, sizeof (GimpColorWheelPrivate));
}
static void
@@ -223,10 +223,7 @@ gimp_color_wheel_class_finalize (GimpColorWheelClass *klass)
static void
gimp_color_wheel_init (GimpColorWheel *wheel)
{
- GimpColorWheelPrivate *priv;
-
- priv = G_TYPE_INSTANCE_GET_PRIVATE (wheel, GIMP_TYPE_COLOR_WHEEL,
- GimpColorWheelPrivate);
+ GimpColorWheelPrivate *priv = gimp_color_wheel_get_instance_private (wheel);
wheel->priv = priv;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]