clutter: Stop using g_type_class_add_private()

It is now deprecated in favor of the G_ADD_PRIVATE() macro (usually
called via G_DEFINE_WITH_PRIVATE()).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
This commit is contained in:
Florian Müllner 2018-07-19 13:45:13 +02:00
parent ec451b4674
commit 4fe594bf9c
6 changed files with 30 additions and 42 deletions

View File

@ -61,11 +61,6 @@ G_END_DECLS
/* Coglbox private declaration
*--------------------------------------------------*/
G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
struct _TestCoglboxPrivate
{
CoglHandle texhand_id;
@ -73,6 +68,11 @@ struct _TestCoglboxPrivate
CoglHandle offscreen_id;
};
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
/* Coglbox implementation
*--------------------------------------------------*/
@ -290,8 +290,6 @@ test_coglbox_class_init (TestCoglboxClass *klass)
actor_class->map = test_coglbox_map;
actor_class->paint = test_coglbox_paint;
g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate));
}
static ClutterActor*

View File

@ -61,17 +61,17 @@ G_END_DECLS
/* Coglbox private declaration
*--------------------------------------------------*/
G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
struct _TestCoglboxPrivate
{
CoglHandle cogl_tex_id[4];
gint frame;
};
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
/* Coglbox implementation
*--------------------------------------------------*/
@ -182,8 +182,6 @@ test_coglbox_class_init (TestCoglboxClass *klass)
gobject_class->finalize = test_coglbox_finalize;
gobject_class->dispose = test_coglbox_dispose;
actor_class->paint = test_coglbox_paint;
g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate));
}
static ClutterActor*

View File

@ -86,11 +86,6 @@ G_END_DECLS
/* Coglbox private declaration
*--------------------------------------------------*/
G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
struct _TestCoglboxPrivate
{
guint gl_handle;
@ -116,6 +111,11 @@ struct _TestCoglboxPrivate
(* glBindTexture) (guint target, guint texture);
};
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
/* Coglbox implementation
*--------------------------------------------------*/
@ -229,8 +229,6 @@ test_coglbox_class_init (TestCoglboxClass *klass)
gobject_class->finalize = test_coglbox_finalize;
gobject_class->dispose = test_coglbox_dispose;
actor_class->paint = test_coglbox_paint;
g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate));
}
static ClutterActor*

View File

@ -61,11 +61,6 @@ G_END_DECLS
/* Coglbox private declaration
*--------------------------------------------------*/
G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
struct _TestCoglboxPrivate
{
CoglHandle sliced_tex, not_sliced_tex;
@ -74,6 +69,11 @@ struct _TestCoglboxPrivate
gboolean use_linear_filtering;
};
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
/* Coglbox implementation
*--------------------------------------------------*/
@ -293,8 +293,6 @@ test_coglbox_class_init (TestCoglboxClass *klass)
gobject_class->finalize = test_coglbox_finalize;
gobject_class->dispose = test_coglbox_dispose;
actor_class->paint = test_coglbox_paint;
g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate));
}
static ClutterActor*

View File

@ -62,17 +62,17 @@ G_END_DECLS
/* Coglbox private declaration
*--------------------------------------------------*/
G_DEFINE_TYPE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
struct _TestCoglboxPrivate
{
CoglHandle cogl_tex_id;
gdouble animation_progress;
};
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
/* Coglbox implementation
*--------------------------------------------------*/
@ -158,8 +158,6 @@ test_coglbox_class_init (TestCoglboxClass *klass)
gobject_class->finalize = test_coglbox_finalize;
gobject_class->dispose = test_coglbox_dispose;
actor_class->paint = test_coglbox_paint;
g_type_class_add_private (gobject_class, sizeof (TestCoglboxPrivate));
}
static ClutterActor*

View File

@ -40,11 +40,6 @@ enum
PROP_USE_TRANSFORMED_BOX
};
G_DEFINE_TYPE (MyThing, my_thing, CLUTTER_TYPE_ACTOR)
#define MY_THING_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MY_TYPE_THING, MyThingPrivate))
struct _MyThingPrivate
{
gfloat spacing;
@ -53,6 +48,11 @@ struct _MyThingPrivate
guint use_transformed_box : 1;
};
G_DEFINE_TYPE_WITH_PRIVATE (MyThing, my_thing, CLUTTER_TYPE_ACTOR)
#define MY_THING_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), MY_TYPE_THING, MyThingPrivate))
static void
my_thing_set_property (GObject *gobject,
guint prop_id,
@ -409,8 +409,6 @@ my_thing_class_init (MyThingClass *klass)
"Use transformed box when allocating",
FALSE,
G_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (MyThingPrivate));
}
static void