Implement keyval vfuncs for quartz

This commit is contained in:
Matthias Clasen 2010-12-17 13:18:17 -05:00 committed by Kristian Rietveld
parent 9ae2dc0deb
commit 168b3c13b7
3 changed files with 38 additions and 5 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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