[gtk+] Implement keyval vfuncs for quartz
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Implement keyval vfuncs for quartz
- Date: Wed, 22 Dec 2010 16:52:34 +0000 (UTC)
commit 168b3c13b733140233439f9ef861ebb861149a42
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 17 13:18:17 2010 -0500
Implement keyval vfuncs for quartz
gdk/Makefile.am | 3 ++-
gdk/gdkkeynames.c | 8 ++++----
gdk/quartz/gdkdisplaymanager-quartz.c | 32 ++++++++++++++++++++++++++++++++
3 files changed, 38 insertions(+), 5 deletions(-)
---
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 684df0a..21c81fa 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -16,6 +16,7 @@ CLEANFILES =
EXTRA_DIST += \
keynames.txt \
keyname-table.h \
+ gdkkeynames.c \
gen-keyname-table.pl \
gdkconfig.h.win32 \
gdkkeysyms-update.pl \
@@ -158,7 +159,7 @@ libgdk_3_0_la_SOURCES = $(common_sources)
libgdk_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS)
libgdk_3_0_la_LDFLAGS = $(LDADD)
-libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c
+libgdk_quartz_3_0_la_SOURCES = $(common_sources)
libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS)
libgdk_quartz_3_0_la_LDFLAGS = $(LDADD)
diff --git a/gdk/gdkkeynames.c b/gdk/gdkkeynames.c
index bbebc3b..6d1fcd4 100644
--- a/gdk/gdkkeynames.c
+++ b/gdk/gdkkeynames.c
@@ -45,8 +45,8 @@ gdk_keys_keyval_compare (const void *pkey, const void *pbase)
return (*(int *) pkey) - ((gdk_key *) pbase)->keyval;
}
-gchar*
-gdk_keyval_name (guint keyval)
+static gchar*
+_gdk_keyval_name (guint keyval)
{
static gchar buf[100];
gdk_key *found;
@@ -86,8 +86,8 @@ gdk_keys_name_compare (const void *pkey, const void *pbase)
(const char *) (keynames + ((const gdk_key *) pbase)->offset));
}
-guint
-gdk_keyval_from_name (const gchar *keyval_name)
+static guint
+_gdk_keyval_from_name (const gchar *keyval_name)
{
gdk_key *found;
diff --git a/gdk/quartz/gdkdisplaymanager-quartz.c b/gdk/quartz/gdkdisplaymanager-quartz.c
index 54c361a..8627ba9 100644
--- a/gdk/quartz/gdkdisplaymanager-quartz.c
+++ b/gdk/quartz/gdkdisplaymanager-quartz.c
@@ -75,6 +75,35 @@ gdk_display_manager_quartz_set_default_display (GdkDisplayManager *manager,
manager_quartz->default_display = display;
}
+#include "../gdkkeynames.c"
+
+static gchar *
+gdk_quartz_display_manager_get_keyval_name (GdkDisplayManager *manager,
+ guint keyval)
+{
+ return _gdk_keyval_name (keyval);
+}
+
+static guint
+gdk_quartz_display_manager_lookup_keyval (GdkDisplayManager *manager,
+ const gchar *name)
+{
+ return _gdk_keyval_from_name (name);
+}
+
+static void
+gdk_quartz_display_manager_keyval_convert_case (GdkDisplayManager *manager,
+ guint symbol,
+ guint *lower,
+ guint *upper)
+{
+ /* FIXME implement this */
+ if (lower)
+ *lower = symbol;
+ if (upper)
+ *upper = symbol;
+}
+
static void
gdk_display_manager_quartz_init (GdkDisplayManagerQuartz *manager)
{
@@ -102,6 +131,9 @@ gdk_display_manager_quartz_class_init (GdkDisplayManagerQuartzClass *class)
manager_class->get_default_display = gdk_display_manager_quartz_get_default_display;
manager_class->atom_intern = _gdk_quartz_display_manager_atom_intern;
manager_class->get_atom_name = _gdk_quartz_display_manager_get_atom_name;
+ manager_class->lookup_keyval = gdk_quartz_display_manager_lookup_keyval;
+ manager_class->get_keyval_name = gdk_quartz_display_manager_get_keyval_name;
+ manager_class->keyval_convert_case = gdk_quartz_display_manager_keyval_convert_case;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]