[gtk+/events-refactor: 728/1085] Make GdkDeviceClass private.



commit 75011a56e403d70c4c97e25d8140413963472322
Author: Carlos Garnacho <carlos lanedo com>
Date:   Fri Aug 14 01:22:33 2009 +0200

    Make GdkDeviceClass private.

 gdk/Makefile.am          |    1 +
 gdk/gdkdevice.c          |    1 +
 gdk/gdkdevice.h          |   35 -----------------------
 gdk/gdkdeviceprivate.h   |   70 ++++++++++++++++++++++++++++++++++++++++++++++
 gdk/x11/gdkdevice-core.h |    2 +-
 gdk/x11/gdkwindow-x11.c  |    1 +
 6 files changed, 74 insertions(+), 36 deletions(-)
---
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 9606b5f..b6ad452 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -69,6 +69,7 @@ gdk_public_h_sources =				\
 	gdkcursor.h				\
 	gdkdevice.h				\
 	gdkdevicemanager.h			\
+	gdkdeviceprivate.h			\
 	gdkdisplay.h				\
 	gdkdisplaymanager.h			\
 	gdkdnd.h				\
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index fe89b16..0b5b762 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -18,6 +18,7 @@
  */
 
 #include "gdkdevice.h"
+#include "gdkdeviceprivate.h"
 #include "gdkintl.h"
 #include "gdkinternals.h"
 #include "gdkalias.h"
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index fdb7114..edcf3d0 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -30,13 +30,9 @@ G_BEGIN_DECLS
 
 #define GDK_TYPE_DEVICE         (gdk_device_get_type ())
 #define GDK_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE, GdkDevice))
-#define GDK_DEVICE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
 #define GDK_IS_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE))
-#define GDK_IS_DEVICE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
-#define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
 
 typedef struct _GdkDevice GdkDevice;
-typedef struct _GdkDeviceClass GdkDeviceClass;
 
 typedef struct _GdkDeviceKey GdkDeviceKey;
 typedef struct _GdkDeviceAxis GdkDeviceAxis;
@@ -118,37 +114,6 @@ struct _GdkDevice
   GdkDeviceKey *keys;
 };
 
-struct _GdkDeviceClass
-{
-  GObjectClass parent_class;
-
-  gboolean (* get_history) (GdkDevice      *device,
-                            GdkWindow      *window,
-                            guint32         start,
-                            guint32         stop,
-                            GdkTimeCoord ***events,
-                            guint          *n_events);
-
-  void (* get_state) (GdkDevice       *device,
-                      GdkWindow       *window,
-                      gdouble         *axes,
-                      GdkModifierType *mask);
-
-  gboolean (* get_axis) (GdkDevice  *device,
-                         gdouble    *axes,
-                         GdkAxisUse  use,
-                         gdouble    *value);
-
-  void (* set_window_cursor) (GdkDevice *device,
-                              GdkWindow *window,
-                              GdkCursor *cursor);
-
-  void (* warp)              (GdkDevice  *device,
-                              GdkScreen  *screen,
-                              gint        x,
-                              gint        y);
-};
-
 GType gdk_device_get_type (void) G_GNUC_CONST;
 
 /* Functions to configure a device */
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
new file mode 100644
index 0000000..d1ce69b
--- /dev/null
+++ b/gdk/gdkdeviceprivate.h
@@ -0,0 +1,70 @@
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 2009 Carlos Garnacho <carlosg gnome org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdk.h> can be included directly."
+#endif
+
+#ifndef __GDK_DEVICE_PRIVATE_H__
+#define __GDK_DEVICE_PRIVATE_H__
+
+#include <gdk/gdkdevice.h>
+
+G_BEGIN_DECLS
+
+#define GDK_DEVICE_CLASS(c)     (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
+#define GDK_IS_DEVICE_CLASS(c)  (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
+#define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
+
+typedef struct _GdkDeviceClass GdkDeviceClass;
+
+struct _GdkDeviceClass
+{
+  GObjectClass parent_class;
+
+  gboolean (* get_history) (GdkDevice      *device,
+                            GdkWindow      *window,
+                            guint32         start,
+                            guint32         stop,
+                            GdkTimeCoord ***events,
+                            guint          *n_events);
+
+  void (* get_state) (GdkDevice       *device,
+                      GdkWindow       *window,
+                      gdouble         *axes,
+                      GdkModifierType *mask);
+
+  gboolean (* get_axis) (GdkDevice  *device,
+                         gdouble    *axes,
+                         GdkAxisUse  use,
+                         gdouble    *value);
+
+  void (* set_window_cursor) (GdkDevice *device,
+                              GdkWindow *window,
+                              GdkCursor *cursor);
+
+  void (* warp)              (GdkDevice  *device,
+                              GdkScreen  *screen,
+                              gint        x,
+                              gint        y);
+};
+
+G_END_DECLS
+
+#endif /* __GDK_DEVICE_PRIVATE_H__ */
diff --git a/gdk/x11/gdkdevice-core.h b/gdk/x11/gdkdevice-core.h
index 6efa760..8f53d6f 100644
--- a/gdk/x11/gdkdevice-core.h
+++ b/gdk/x11/gdkdevice-core.h
@@ -20,7 +20,7 @@
 #ifndef __GDK_DEVICE_CORE_H__
 #define __GDK_DEVICE_CORE_H__
 
-#include <gdk/gdkdevice.h>
+#include <gdk/gdkdeviceprivate.h>
 
 G_BEGIN_DECLS
 
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index ecba091..33c6001 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -50,6 +50,7 @@
 #include "gdkinternals.h"
 #include "MwmUtil.h"
 #include "gdkwindow-x11.h"
+#include "gdkdeviceprivate.h"
 #include "gdkalias.h"
 
 #include <stdlib.h>



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