[gtk+/xi2-for-master] gdkdevice-xi2: Use ->priv pointer instead GET_PRIV macro all the time
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/xi2-for-master] gdkdevice-xi2: Use ->priv pointer instead GET_PRIV macro all the time
- Date: Fri, 21 May 2010 19:58:54 +0000 (UTC)
commit 56f8dd0cddd20d6702ddc6e504c5ca1a22fe6e34
Author: Javier Jardón <jjardon gnome org>
Date: Fri May 21 21:21:15 2010 +0200
gdkdevice-xi2: Use ->priv pointer instead GET_PRIV macro all the time
gdk/x11/gdkdevice-xi2.c | 30 ++++++++++++++++--------------
gdk/x11/gdkdevice-xi2.h | 4 ++++
2 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index c5e524e..71a6ee4 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -24,11 +24,8 @@
#include "gdkintl.h"
#include "gdkx.h"
-#define GDK_DEVICE_XI2_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDK_TYPE_DEVICE_XI2, GdkDeviceXI2Private))
-typedef struct GdkDeviceXI2Private GdkDeviceXI2Private;
-
-struct GdkDeviceXI2Private
+struct _GdkDeviceXI2Private
{
int device_id;
};
@@ -122,6 +119,11 @@ gdk_device_xi2_class_init (GdkDeviceXI2Class *klass)
static void
gdk_device_xi2_init (GdkDeviceXI2 *device)
{
+ GdkDeviceXI2Private *priv;
+
+ device->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (device,
+ GDK_TYPE_DEVICE_XI2,
+ GdkDeviceXI2Private);
}
static void
@@ -132,7 +134,7 @@ gdk_device_xi2_get_property (GObject *object,
{
GdkDeviceXI2Private *priv;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (object);
+ priv = GDK_DEVICE_XI2 (object)->priv;
switch (prop_id)
{
@@ -153,7 +155,7 @@ gdk_device_xi2_set_property (GObject *object,
{
GdkDeviceXI2Private *priv;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (object);
+ priv = GDK_DEVICE_XI2 (object)->priv;
switch (prop_id)
{
@@ -177,7 +179,7 @@ gdk_device_xi2_get_state (GdkDevice *device,
XIDeviceInfo *info;
gint i, j, ndevices;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_device_get_display (device);
if (axes)
@@ -243,7 +245,7 @@ gdk_device_xi2_set_window_cursor (GdkDevice *device,
GdkDeviceXI2Private *priv;
GdkCursorPrivate *cursor_private;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
/* Non-master devices don't have a cursor */
if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER)
@@ -273,7 +275,7 @@ gdk_device_xi2_warp (GdkDevice *device,
GdkDeviceXI2Private *priv;
Window dest;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
XIWarpPointer (GDK_SCREEN_XDISPLAY (screen),
@@ -304,7 +306,7 @@ gdk_device_xi2_query_state (GdkDevice *device,
if (!window || GDK_WINDOW_DESTROYED (window))
return FALSE;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_drawable_get_display (window);
if (!XIQueryPointer (GDK_WINDOW_XDISPLAY (window),
@@ -363,7 +365,7 @@ gdk_device_xi2_grab (GdkDevice *device,
Cursor xcursor;
int status;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_device_get_display (device);
/* FIXME: confine_to is actually unused */
@@ -402,7 +404,7 @@ gdk_device_xi2_ungrab (GdkDevice *device,
GdkDeviceXI2Private *priv;
GdkDisplay *display;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_device_get_display (device);
XIUngrabDevice (GDK_DISPLAY_XDISPLAY (display),
@@ -428,7 +430,7 @@ gdk_device_xi2_window_at_position (GdkDevice *device,
XIModifierState mod_state;
XIGroupState group_state;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
display = gdk_device_get_display (device);
screen = gdk_display_get_default_screen (display);
@@ -503,7 +505,7 @@ gdk_device_xi2_select_window_events (GdkDevice *device,
GdkDeviceXI2Private *priv;
XIEventMask evmask;
- priv = GDK_DEVICE_XI2_GET_PRIVATE (device);
+ priv = GDK_DEVICE_XI2 (device)->priv;
evmask.deviceid = priv->device_id;
evmask.mask = gdk_device_xi2_translate_event_mask (event_mask, &evmask.mask_len);
diff --git a/gdk/x11/gdkdevice-xi2.h b/gdk/x11/gdkdevice-xi2.h
index 2d2f031..e77ab43 100644
--- a/gdk/x11/gdkdevice-xi2.h
+++ b/gdk/x11/gdkdevice-xi2.h
@@ -32,11 +32,15 @@ G_BEGIN_DECLS
#define GDK_DEVICE_XI2_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_XI2, GdkDeviceXI2Class))
typedef struct _GdkDeviceXI2 GdkDeviceXI2;
+typedef struct _GdkDeviceXI2Private GdkDeviceXI2Private;
typedef struct _GdkDeviceXI2Class GdkDeviceXI2Class;
struct _GdkDeviceXI2
{
GdkDevice parent_instance;
+
+ /*< private >*/
+ GdkDeviceXI2Private *priv;
};
struct _GdkDeviceXI2Class
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]