[gtk+] quartz: Port gdkkeys-quartz.c to new API
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] quartz: Port gdkkeys-quartz.c to new API
- Date: Wed, 22 Dec 2010 16:54:20 +0000 (UTC)
commit cde6dade8fe12f8a188f2e985b419dde6b54c99f
Author: Kristian Rietveld <kris gtk org>
Date: Wed Dec 22 14:29:24 2010 +0100
quartz: Port gdkkeys-quartz.c to new API
gdk/quartz/gdkkeys-quartz.c | 37 ++++++++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/gdk/quartz/gdkkeys-quartz.c b/gdk/quartz/gdkkeys-quartz.c
index c35eccb..81765f4 100644
--- a/gdk/quartz/gdkkeys-quartz.c
+++ b/gdk/quartz/gdkkeys-quartz.c
@@ -54,6 +54,7 @@
#include <Carbon/Carbon.h>
#include <AppKit/NSEvent.h>
#include "gdk.h"
+#include "gdkkeysprivate.h"
#include "gdkkeysyms.h"
#define NUM_KEYCODES 128
@@ -61,16 +62,34 @@
static GdkKeymap *default_keymap = NULL;
-typedef struct _GdkKeymapQuartz GdkKeymapQuartz;
-typedef struct _GdkKeymapQuartzClass GdkKeymapQuartzClass;
-G_DEFINE_TYPE (GdkKeyMapQuartz, _gdk_keymap_quartz, GDK_TYPE_KEYMAP)
+#define GDK_TYPE_QUARTZ_KEYMAP (gdk_quartz_keymap_get_type ())
+#define GDK_QUARTZ_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_KEYMAP, GdkQuartzKeymap))
+#define GDK_QUARTZ_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_KEYMAP, GdkQuartzKeymapClass))
+#define GDK_IS_QUARTZ_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_KEYMAP))
+#define GDK_IS_QUARTZ_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_KEYMAP))
+#define GDK_QUARTZ_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_KEYMAP, GdkQuartzKeymapClass))
+
+typedef struct _GdkQuartzKeymap GdkQuartzKeymap;
+typedef struct _GdkQuartzKeymapClass GdkQuartzKeymapClass;
+
+struct _GdkQuartzKeymap
+{
+ GdkKeymap keymap;
+};
+
+struct _GdkQuartzKeymapClass
+{
+ GdkKeymapClass keymap_class;
+};
+
+G_DEFINE_TYPE (GdkQuartzKeymap, _gdk_quartz_keymap, GDK_TYPE_KEYMAP)
GdkKeymap *
_gdk_quartz_display_get_keymap (GdkDisplay *display)
{
if (default_keymap == NULL)
- default_keymap = g_object_new (_gdk_keymap_quartz_get_type (), NULL);
+ default_keymap = g_object_new (_gdk_quartz_keymap_get_type (), NULL);
return default_keymap;
}
@@ -734,23 +753,23 @@ _gdk_quartz_keys_is_modifier (guint keycode)
}
static void
-_gdk_keymap_quartz_init (GdkKeymapQuartz *keymap)
+_gdk_quartz_keymap_init (GdkQuartzKeymap *keymap)
{
}
static void
-_gdk_keymap_quartz_finalize (GObject *object)
+_gdk_quartz_keymap_finalize (GObject *object)
{
- G_OBJECT_CLASS (_gdk_keymap_quartz_parent_class)->finalize (object);
+ G_OBJECT_CLASS (_gdk_quartz_keymap_parent_class)->finalize (object);
}
static void
-_gdk_keymap_quartz_class_init (GdkKeymapQuartzClass *klass)
+_gdk_quartz_keymap_class_init (GdkQuartzKeymapClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkKeymapClass *keymap_class = GDK_KEYMAP_CLASS (klass);
- object_class->finalize = gdk_keymap_quartz_finalize;
+ object_class->finalize = _gdk_quartz_keymap_finalize;
keymap_class->get_direction = gdk_quartz_keymap_get_direction;
keymap_class->have_bidi_layouts = gdk_quartz_keymap_have_bidi_layouts;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]