[gtk+/xi2-for-master] gdkdevicemanager: Use ->priv pointer instead GET_PRIV macro all the time



commit cb9f9720fce4029236623d7d29fe2eca61bc0135
Author: Javier Jardón <jjardon gnome org>
Date:   Fri May 21 21:14:15 2010 +0200

    gdkdevicemanager: Use ->priv pointer instead GET_PRIV macro all the time

 gdk/gdkdevicemanager.c |   16 +++++++++-------
 gdk/gdkdevicemanager.h |    4 ++++
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/gdk/gdkdevicemanager.c b/gdk/gdkdevicemanager.c
index 260fb8a..5bce0fc 100644
--- a/gdk/gdkdevicemanager.c
+++ b/gdk/gdkdevicemanager.c
@@ -113,14 +113,12 @@ enum {
 
 static guint signals [LAST_SIGNAL] = { 0 };
 
-typedef struct GdkDeviceManagerPrivate GdkDeviceManagerPrivate;
 
-struct GdkDeviceManagerPrivate
+struct _GdkDeviceManagerPrivate
 {
   GdkDisplay *display;
 };
 
-#define GDK_DEVICE_MANAGER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDK_TYPE_DEVICE_MANAGER, GdkDeviceManagerPrivate))
 
 static void
 gdk_device_manager_class_init (GdkDeviceManagerClass *klass)
@@ -203,9 +201,13 @@ gdk_device_manager_class_init (GdkDeviceManagerClass *klass)
 }
 
 static void
-gdk_device_manager_init (GdkDeviceManager *manager)
+gdk_device_manager_init (GdkDeviceManager *device_manager)
 {
+  GdkDeviceManagerPrivate *priv;
 
+  device_manager->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (device_manager,
+                                                             GDK_TYPE_DEVICE_MANAGER,
+                                                             GdkDeviceManagerPrivate);
 }
 
 static void
@@ -216,7 +218,7 @@ gdk_device_manager_set_property (GObject      *object,
 {
   GdkDeviceManagerPrivate *priv;
 
-  priv = GDK_DEVICE_MANAGER_GET_PRIVATE (object);
+  priv = GDK_DEVICE_MANAGER (object)->priv;
 
   switch (prop_id)
     {
@@ -237,7 +239,7 @@ gdk_device_manager_get_property (GObject      *object,
 {
   GdkDeviceManagerPrivate *priv;
 
-  priv = GDK_DEVICE_MANAGER_GET_PRIVATE (object);
+  priv = GDK_DEVICE_MANAGER (object)->priv;
 
   switch (prop_id)
     {
@@ -268,7 +270,7 @@ gdk_device_manager_get_display (GdkDeviceManager *device_manager)
 
   g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL);
 
-  priv = GDK_DEVICE_MANAGER_GET_PRIVATE (device_manager);
+  priv = device_manager->priv;
 
   return priv->display;
 }
diff --git a/gdk/gdkdevicemanager.h b/gdk/gdkdevicemanager.h
index ec86953..32ac376 100644
--- a/gdk/gdkdevicemanager.h
+++ b/gdk/gdkdevicemanager.h
@@ -37,11 +37,15 @@ G_BEGIN_DECLS
 #define GDK_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER, GdkDeviceManagerClass))
 
 typedef struct _GdkDeviceManager GdkDeviceManager;
+typedef struct _GdkDeviceManagerPrivate GdkDeviceManagerPrivate;
 typedef struct _GdkDeviceManagerClass GdkDeviceManagerClass;
 
 struct _GdkDeviceManager
 {
   GObject parent_instance;
+
+  /*< private >*/
+  GdkDeviceManagerPrivate *priv;
 };
 
 struct _GdkDeviceManagerClass



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]