[clutter] layout-manager: Add a private struct to hold future properties
- From: Bastian Winkler <bwinkler src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] layout-manager: Add a private struct to hold future properties
- Date: Tue, 29 May 2012 12:12:19 +0000 (UTC)
commit 734720ef0f849b1e31b01d3d376dfeb3b310ca5f
Author: Bastian Winkler <buz netbuz org>
Date: Thu May 24 14:26:57 2012 +0200
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
clutter/clutter-layout-manager.c | 10 ++++++++++
clutter/clutter-layout-manager.h | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-layout-manager.c b/clutter/clutter-layout-manager.c
index 9e16e21..39da12c 100644
--- a/clutter/clutter-layout-manager.c
+++ b/clutter/clutter-layout-manager.c
@@ -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);
}
/**
diff --git a/clutter/clutter-layout-manager.h b/clutter/clutter-layout-manager.h
index 74efb76..d19d563 100644
--- a/clutter/clutter-layout-manager.h
+++ b/clutter/clutter-layout-manager.h
@@ -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;
};
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]