layout-manager: Add a private struct to hold future properties

In order to allow the abstract ClutterLayoutManager class to have own
GObject properties we'll need a private structure.

https://bugzilla.gnome.org/show_bug.cgi?id=676827
This commit is contained in:
Bastian Winkler 2012-05-24 14:26:57 +02:00
parent f9c29d5067
commit 734720ef0f
2 changed files with 12 additions and 2 deletions

View File

@ -345,6 +345,11 @@
G_OBJECT_TYPE_NAME (_obj), \
(method)); } G_STMT_END
struct _ClutterLayoutManagerPrivate
{
gpointer dummy;
};
enum
{
LAYOUT_CHANGED,
@ -585,6 +590,8 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
quark_layout_alpha =
g_quark_from_static_string ("clutter-layout-manager-alpha");
g_type_class_add_private (klass, sizeof (ClutterLayoutManagerPrivate));
klass->get_preferred_width = layout_manager_real_get_preferred_width;
klass->get_preferred_height = layout_manager_real_get_preferred_height;
klass->allocate = layout_manager_real_allocate;
@ -638,6 +645,9 @@ clutter_layout_manager_class_init (ClutterLayoutManagerClass *klass)
static void
clutter_layout_manager_init (ClutterLayoutManager *manager)
{
manager->priv =
G_TYPE_INSTANCE_GET_PRIVATE (manager, CLUTTER_TYPE_LAYOUT_MANAGER,
ClutterLayoutManagerPrivate);
}
/**

View File

@ -40,6 +40,7 @@ G_BEGIN_DECLS
#define CLUTTER_IS_LAYOUT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_LAYOUT_MANAGER))
#define CLUTTER_LAYOUT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_LAYOUT_MANAGER, ClutterLayoutManagerClass))
typedef struct _ClutterLayoutManagerPrivate ClutterLayoutManagerPrivate;
typedef struct _ClutterLayoutManagerClass ClutterLayoutManagerClass;
/**
@ -55,8 +56,7 @@ struct _ClutterLayoutManager
/*< private >*/
GInitiallyUnowned parent_instance;
/* padding for future expansion */
gpointer dummy;
ClutterLayoutManagerPrivate *priv;
};
/**