[gtk+/gtk-2-24] Backport some of the GTK3 changes to win32/gdkkeys
- From: Руслан Ижбулатов <ruslanizhb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] Backport some of the GTK3 changes to win32/gdkkeys
- Date: Fri, 25 Nov 2016 17:01:41 +0000 (UTC)
commit 92e6c4575652109b44454ee78c79a7166d29ad77
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date: Sat Jul 30 20:30:28 2016 +0000
Backport some of the GTK3 changes to win32/gdkkeys
This lays the foundation for backporting more invasive gdkkeys commits
from GTK3.
https://bugzilla.gnome.org/show_bug.cgi?id=768722
gdk/gdk.symbols | 6 +
gdk/win32/Makefile.am | 1 +
gdk/win32/gdkkeys-win32.c | 305 +++++++++++++++++++++++++--------------------
gdk/win32/gdkwin32.h | 6 +
gdk/win32/gdkwin32keys.h | 47 +++++++
5 files changed, 229 insertions(+), 136 deletions(-)
---
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index d4f2072..b2bd9eb 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -1282,6 +1282,12 @@ gdk_win32_hdc_release
gdk_win32_selection_add_targets
#endif
#endif
+
+#if IN_HEADER(__GDK_WIN32_H__)
+#if IN_FILE(__GDK_KEYS_WIN32_C__)
+gdk_win32_keymap_get_type G_GNUC_CONST
+#endif
+#endif
#endif
#ifdef GDK_WINDOWING_X11
diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am
index d57ad35..e3e4608 100644
--- a/gdk/win32/Makefile.am
+++ b/gdk/win32/Makefile.am
@@ -55,6 +55,7 @@ libgdk_win32_la_SOURCES = \
gdktestutils-win32.c \
gdkvisual-win32.c \
gdkwin32.h \
+ gdkwin32keys.h \
gdkwin32id.c \
gdkwindow-win32.c \
gdkwindow-win32.h \
diff --git a/gdk/win32/gdkkeys-win32.c b/gdk/win32/gdkkeys-win32.c
index b70066e..dd4cb0c 100644
--- a/gdk/win32/gdkkeys-win32.c
+++ b/gdk/win32/gdkkeys-win32.c
@@ -35,8 +35,25 @@
#include "gdkprivate-win32.h"
#include "gdkinternals.h"
#include "gdkkeysyms.h"
+#include "gdkkeys.h"
+#include "gdkwin32keys.h"
-#include "config.h"
+struct _GdkWin32KeymapClass
+{
+ GdkKeymapClass parent_class;
+};
+
+struct _GdkWin32Keymap
+{
+ GdkKeymap parent_instance;
+};
+
+G_DEFINE_TYPE (GdkWin32Keymap, gdk_win32_keymap, GDK_TYPE_KEYMAP)
+
+static void
+gdk_win32_keymap_init (GdkWin32Keymap *keymap)
+{
+}
guint _gdk_keymap_serial = 0;
gboolean _gdk_keyboard_has_altgr = FALSE;
@@ -49,6 +66,8 @@ static GdkKeymap *default_keymap = NULL;
static guint *keysym_tab = NULL;
static wchar_t decimal_mark = 0;
+#define KEY_STATE_SIZE 256
+
#ifdef G_ENABLE_DEBUG
static void
print_keysym_tab (void)
@@ -58,7 +77,7 @@ print_keysym_tab (void)
g_print ("keymap:%s%s\n",
_gdk_keyboard_has_altgr ? " (uses AltGr)" : "",
(gdk_shift_modifiers & GDK_LOCK_MASK) ? " (has ShiftLock)" : "");
- for (vk = 0; vk < 256; vk++)
+ for (vk = 0; vk < KEY_STATE_SIZE; vk++)
{
gint state;
@@ -84,158 +103,158 @@ handle_special (guint vk,
switch (vk)
{
case VK_CANCEL:
- *ksymp = GDK_Cancel; break;
+ *ksymp = GDK_KEY_Cancel; break;
case VK_BACK:
- *ksymp = GDK_BackSpace; break;
+ *ksymp = GDK_KEY_BackSpace; break;
case VK_TAB:
if (shift & 0x1)
- *ksymp = GDK_ISO_Left_Tab;
+ *ksymp = GDK_KEY_ISO_Left_Tab;
else
- *ksymp = GDK_Tab;
+ *ksymp = GDK_KEY_Tab;
break;
case VK_CLEAR:
- *ksymp = GDK_Clear; break;
+ *ksymp = GDK_KEY_Clear; break;
case VK_RETURN:
- *ksymp = GDK_Return; break;
+ *ksymp = GDK_KEY_Return; break;
case VK_SHIFT:
case VK_LSHIFT:
- *ksymp = GDK_Shift_L; break;
+ *ksymp = GDK_KEY_Shift_L; break;
case VK_CONTROL:
case VK_LCONTROL:
- *ksymp = GDK_Control_L; break;
+ *ksymp = GDK_KEY_Control_L; break;
case VK_MENU:
case VK_LMENU:
- *ksymp = GDK_Alt_L; break;
+ *ksymp = GDK_KEY_Alt_L; break;
case VK_PAUSE:
- *ksymp = GDK_Pause; break;
+ *ksymp = GDK_KEY_Pause; break;
case VK_ESCAPE:
- *ksymp = GDK_Escape; break;
+ *ksymp = GDK_KEY_Escape; break;
case VK_PRIOR:
- *ksymp = GDK_Prior; break;
+ *ksymp = GDK_KEY_Prior; break;
case VK_NEXT:
- *ksymp = GDK_Next; break;
+ *ksymp = GDK_KEY_Next; break;
case VK_END:
- *ksymp = GDK_End; break;
+ *ksymp = GDK_KEY_End; break;
case VK_HOME:
- *ksymp = GDK_Home; break;
+ *ksymp = GDK_KEY_Home; break;
case VK_LEFT:
- *ksymp = GDK_Left; break;
+ *ksymp = GDK_KEY_Left; break;
case VK_UP:
- *ksymp = GDK_Up; break;
+ *ksymp = GDK_KEY_Up; break;
case VK_RIGHT:
- *ksymp = GDK_Right; break;
+ *ksymp = GDK_KEY_Right; break;
case VK_DOWN:
- *ksymp = GDK_Down; break;
+ *ksymp = GDK_KEY_Down; break;
case VK_SELECT:
- *ksymp = GDK_Select; break;
+ *ksymp = GDK_KEY_Select; break;
case VK_PRINT:
- *ksymp = GDK_Print; break;
+ *ksymp = GDK_KEY_Print; break;
case VK_SNAPSHOT:
- *ksymp = GDK_Print; break;
+ *ksymp = GDK_KEY_Print; break;
case VK_EXECUTE:
- *ksymp = GDK_Execute; break;
+ *ksymp = GDK_KEY_Execute; break;
case VK_INSERT:
- *ksymp = GDK_Insert; break;
+ *ksymp = GDK_KEY_Insert; break;
case VK_DELETE:
- *ksymp = GDK_Delete; break;
+ *ksymp = GDK_KEY_Delete; break;
case VK_HELP:
- *ksymp = GDK_Help; break;
+ *ksymp = GDK_KEY_Help; break;
case VK_LWIN:
- *ksymp = GDK_Meta_L; break;
+ *ksymp = GDK_KEY_Meta_L; break;
case VK_RWIN:
- *ksymp = GDK_Meta_R; break;
+ *ksymp = GDK_KEY_Meta_R; break;
+ case VK_APPS:
+ *ksymp = GDK_KEY_Menu; break;
case VK_DECIMAL:
*ksymp = GDK_KEY_KP_Decimal; break;
- case VK_APPS:
- *ksymp = GDK_Menu; break;
case VK_MULTIPLY:
- *ksymp = GDK_KP_Multiply; break;
+ *ksymp = GDK_KEY_KP_Multiply; break;
case VK_ADD:
- *ksymp = GDK_KP_Add; break;
+ *ksymp = GDK_KEY_KP_Add; break;
case VK_SEPARATOR:
- *ksymp = GDK_KP_Separator; break;
+ *ksymp = GDK_KEY_KP_Separator; break;
case VK_SUBTRACT:
- *ksymp = GDK_KP_Subtract; break;
+ *ksymp = GDK_KEY_KP_Subtract; break;
case VK_DIVIDE:
- *ksymp = GDK_KP_Divide; break;
+ *ksymp = GDK_KEY_KP_Divide; break;
case VK_NUMPAD0:
- *ksymp = GDK_KP_0; break;
+ *ksymp = GDK_KEY_KP_0; break;
case VK_NUMPAD1:
- *ksymp = GDK_KP_1; break;
+ *ksymp = GDK_KEY_KP_1; break;
case VK_NUMPAD2:
- *ksymp = GDK_KP_2; break;
+ *ksymp = GDK_KEY_KP_2; break;
case VK_NUMPAD3:
- *ksymp = GDK_KP_3; break;
+ *ksymp = GDK_KEY_KP_3; break;
case VK_NUMPAD4:
- *ksymp = GDK_KP_4; break;
+ *ksymp = GDK_KEY_KP_4; break;
case VK_NUMPAD5:
- *ksymp = GDK_KP_5; break;
+ *ksymp = GDK_KEY_KP_5; break;
case VK_NUMPAD6:
- *ksymp = GDK_KP_6; break;
+ *ksymp = GDK_KEY_KP_6; break;
case VK_NUMPAD7:
- *ksymp = GDK_KP_7; break;
+ *ksymp = GDK_KEY_KP_7; break;
case VK_NUMPAD8:
- *ksymp = GDK_KP_8; break;
+ *ksymp = GDK_KEY_KP_8; break;
case VK_NUMPAD9:
- *ksymp = GDK_KP_9; break;
+ *ksymp = GDK_KEY_KP_9; break;
case VK_F1:
- *ksymp = GDK_F1; break;
+ *ksymp = GDK_KEY_F1; break;
case VK_F2:
- *ksymp = GDK_F2; break;
+ *ksymp = GDK_KEY_F2; break;
case VK_F3:
- *ksymp = GDK_F3; break;
+ *ksymp = GDK_KEY_F3; break;
case VK_F4:
- *ksymp = GDK_F4; break;
+ *ksymp = GDK_KEY_F4; break;
case VK_F5:
- *ksymp = GDK_F5; break;
+ *ksymp = GDK_KEY_F5; break;
case VK_F6:
- *ksymp = GDK_F6; break;
+ *ksymp = GDK_KEY_F6; break;
case VK_F7:
- *ksymp = GDK_F7; break;
+ *ksymp = GDK_KEY_F7; break;
case VK_F8:
- *ksymp = GDK_F8; break;
+ *ksymp = GDK_KEY_F8; break;
case VK_F9:
- *ksymp = GDK_F9; break;
+ *ksymp = GDK_KEY_F9; break;
case VK_F10:
- *ksymp = GDK_F10; break;
+ *ksymp = GDK_KEY_F10; break;
case VK_F11:
- *ksymp = GDK_F11; break;
+ *ksymp = GDK_KEY_F11; break;
case VK_F12:
- *ksymp = GDK_F12; break;
+ *ksymp = GDK_KEY_F12; break;
case VK_F13:
- *ksymp = GDK_F13; break;
+ *ksymp = GDK_KEY_F13; break;
case VK_F14:
- *ksymp = GDK_F14; break;
+ *ksymp = GDK_KEY_F14; break;
case VK_F15:
- *ksymp = GDK_F15; break;
+ *ksymp = GDK_KEY_F15; break;
case VK_F16:
- *ksymp = GDK_F16; break;
+ *ksymp = GDK_KEY_F16; break;
case VK_F17:
- *ksymp = GDK_F17; break;
+ *ksymp = GDK_KEY_F17; break;
case VK_F18:
- *ksymp = GDK_F18; break;
+ *ksymp = GDK_KEY_F18; break;
case VK_F19:
- *ksymp = GDK_F19; break;
+ *ksymp = GDK_KEY_F19; break;
case VK_F20:
- *ksymp = GDK_F20; break;
+ *ksymp = GDK_KEY_F20; break;
case VK_F21:
- *ksymp = GDK_F21; break;
+ *ksymp = GDK_KEY_F21; break;
case VK_F22:
- *ksymp = GDK_F22; break;
+ *ksymp = GDK_KEY_F22; break;
case VK_F23:
- *ksymp = GDK_F23; break;
+ *ksymp = GDK_KEY_F23; break;
case VK_F24:
- *ksymp = GDK_F24; break;
+ *ksymp = GDK_KEY_F24; break;
case VK_NUMLOCK:
- *ksymp = GDK_Num_Lock; break;
+ *ksymp = GDK_KEY_Num_Lock; break;
case VK_SCROLL:
- *ksymp = GDK_Scroll_Lock; break;
+ *ksymp = GDK_KEY_Scroll_Lock; break;
case VK_RSHIFT:
- *ksymp = GDK_Shift_R; break;
+ *ksymp = GDK_KEY_Shift_R; break;
case VK_RCONTROL:
- *ksymp = GDK_Control_R; break;
+ *ksymp = GDK_KEY_Control_R; break;
case VK_RMENU:
- *ksymp = GDK_Alt_R; break;
+ *ksymp = GDK_KEY_Alt_R; break;
}
}
@@ -265,12 +284,12 @@ set_shift_vks (guchar *key_state,
}
static void
-reset_after_dead (guchar key_state[256])
+reset_after_dead (guchar key_state[KEY_STATE_SIZE])
{
- guchar temp_key_state[256];
+ guchar temp_key_state[KEY_STATE_SIZE];
wchar_t wcs[2];
- memmove (temp_key_state, key_state, sizeof (key_state));
+ memmove (temp_key_state, key_state, KEY_STATE_SIZE);
temp_key_state[VK_SHIFT] =
temp_key_state[VK_CONTROL] =
@@ -288,39 +307,39 @@ handle_dead (guint keysym,
switch (keysym)
{
case '"': /* 0x022 */
- *ksymp = GDK_dead_diaeresis; break;
+ *ksymp = GDK_KEY_dead_diaeresis; break;
case '\'': /* 0x027 */
- *ksymp = GDK_dead_acute; break;
- case GDK_asciicircum: /* 0x05e */
- *ksymp = GDK_dead_circumflex; break;
- case GDK_grave: /* 0x060 */
- *ksymp = GDK_dead_grave; break;
- case GDK_asciitilde: /* 0x07e */
- *ksymp = GDK_dead_tilde; break;
- case GDK_diaeresis: /* 0x0a8 */
- *ksymp = GDK_dead_diaeresis; break;
- case GDK_degree: /* 0x0b0 */
- *ksymp = GDK_dead_abovering; break;
- case GDK_acute: /* 0x0b4 */
- *ksymp = GDK_dead_acute; break;
- case GDK_periodcentered: /* 0x0b7 */
- *ksymp = GDK_dead_abovedot; break;
- case GDK_cedilla: /* 0x0b8 */
- *ksymp = GDK_dead_cedilla; break;
- case GDK_breve: /* 0x1a2 */
- *ksymp = GDK_dead_breve; break;
- case GDK_ogonek: /* 0x1b2 */
- *ksymp = GDK_dead_ogonek; break;
- case GDK_caron: /* 0x1b7 */
- *ksymp = GDK_dead_caron; break;
- case GDK_doubleacute: /* 0x1bd */
- *ksymp = GDK_dead_doubleacute; break;
- case GDK_abovedot: /* 0x1ff */
- *ksymp = GDK_dead_abovedot; break;
+ *ksymp = GDK_KEY_dead_acute; break;
+ case GDK_KEY_asciicircum: /* 0x05e */
+ *ksymp = GDK_KEY_dead_circumflex; break;
+ case GDK_KEY_grave: /* 0x060 */
+ *ksymp = GDK_KEY_dead_grave; break;
+ case GDK_KEY_asciitilde: /* 0x07e */
+ *ksymp = GDK_KEY_dead_tilde; break;
+ case GDK_KEY_diaeresis: /* 0x0a8 */
+ *ksymp = GDK_KEY_dead_diaeresis; break;
+ case GDK_KEY_degree: /* 0x0b0 */
+ *ksymp = GDK_KEY_dead_abovering; break;
+ case GDK_KEY_acute: /* 0x0b4 */
+ *ksymp = GDK_KEY_dead_acute; break;
+ case GDK_KEY_periodcentered: /* 0x0b7 */
+ *ksymp = GDK_KEY_dead_abovedot; break;
+ case GDK_KEY_cedilla: /* 0x0b8 */
+ *ksymp = GDK_KEY_dead_cedilla; break;
+ case GDK_KEY_breve: /* 0x1a2 */
+ *ksymp = GDK_KEY_dead_breve; break;
+ case GDK_KEY_ogonek: /* 0x1b2 */
+ *ksymp = GDK_KEY_dead_ogonek; break;
+ case GDK_KEY_caron: /* 0x1b7 */
+ *ksymp = GDK_KEY_dead_caron; break;
+ case GDK_KEY_doubleacute: /* 0x1bd */
+ *ksymp = GDK_KEY_dead_doubleacute; break;
+ case GDK_KEY_abovedot: /* 0x1ff */
+ *ksymp = GDK_KEY_dead_abovedot; break;
case 0x1000384: /* Greek tonos */
- *ksymp = GDK_dead_acute; break;
- case GDK_Greek_accentdieresis: /* 0x7ae */
- *ksymp = GDK_Greek_accentdieresis; break;
+ *ksymp = GDK_KEY_dead_acute; break;
+ case GDK_KEY_Greek_accentdieresis: /* 0x7ae */
+ *ksymp = GDK_KEY_Greek_accentdieresis; break;
default:
/* By default use the keysym as such. This takes care of for
* instance the dead U+09CD (BENGALI VIRAMA) on the ekushey
@@ -346,7 +365,7 @@ static void
update_keymap (void)
{
static guint current_serial = 0;
- guchar key_state[256];
+ guchar key_state[KEY_STATE_SIZE];
guint scancode;
guint vk;
gboolean capslock_tested = FALSE;
@@ -357,21 +376,21 @@ update_keymap (void)
current_serial = _gdk_keymap_serial;
if (keysym_tab == NULL)
- keysym_tab = g_new (guint, 4*256);
+ keysym_tab = g_new (guint, 4*KEY_STATE_SIZE);
memset (key_state, 0, sizeof (key_state));
_gdk_keyboard_has_altgr = FALSE;
gdk_shift_modifiers = GDK_SHIFT_MASK;
- for (vk = 0; vk < 256; vk++)
+ for (vk = 0; vk < KEY_STATE_SIZE; vk++)
{
if ((scancode = MapVirtualKey (vk, 0)) == 0 &&
vk != VK_DIVIDE)
keysym_tab[vk*4+0] =
keysym_tab[vk*4+1] =
keysym_tab[vk*4+2] =
- keysym_tab[vk*4+3] = GDK_VoidSymbol;
+ keysym_tab[vk*4+3] = GDK_KEY_VoidSymbol;
else
{
gint shift;
@@ -420,7 +439,7 @@ update_keymap (void)
{
guint keysym = gdk_unicode_to_keyval (wcs[0]);
- /* It is a dead key, and it's has been stored in
+ /* It is a dead key, and it has been stored in
* the keyboard layout's state by
* ToAsciiEx()/ToUnicodeEx(). Yes, this is an
* incredibly silly API! Make the keyboard
@@ -456,7 +475,7 @@ update_keymap (void)
}
}
if (*ksymp == 0)
- *ksymp = GDK_VoidSymbol;
+ *ksymp = GDK_KEY_VoidSymbol;
}
key_state[vk] = 0;
@@ -464,9 +483,9 @@ update_keymap (void)
* the mapping with Control+Alt is different.
*/
if (!_gdk_keyboard_has_altgr)
- if ((keysym_tab[vk*4 + 2] != GDK_VoidSymbol &&
+ if ((keysym_tab[vk*4 + 2] != GDK_KEY_VoidSymbol &&
keysym_tab[vk*4] != keysym_tab[vk*4 + 2]) ||
- (keysym_tab[vk*4 + 3] != GDK_VoidSymbol &&
+ (keysym_tab[vk*4 + 3] != GDK_KEY_VoidSymbol &&
keysym_tab[vk*4 + 1] != keysym_tab[vk*4 + 3]))
_gdk_keyboard_has_altgr = TRUE;
@@ -494,8 +513,8 @@ update_keymap (void)
if (ToAsciiEx (vk, scancode, key_state,
(LPWORD) chars, 0, _gdk_input_locale) == 1)
{
- if (chars[0] >= GDK_space &&
- chars[0] <= GDK_asciitilde &&
+ if (chars[0] >= GDK_KEY_space &&
+ chars[0] <= GDK_KEY_asciitilde &&
chars[0] == keysym_tab[vk*4 + 1])
{
/* CapsLock acts as ShiftLock */
@@ -516,7 +535,7 @@ gdk_keymap_get_for_display (GdkDisplay *display)
g_return_val_if_fail (display == gdk_display_get_default (), NULL);
if (default_keymap == NULL)
- default_keymap = g_object_new (gdk_keymap_get_type (), NULL);
+ default_keymap = g_object_new (gdk_win32_keymap_get_type (), NULL);
return default_keymap;
}
@@ -580,7 +599,7 @@ gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
update_keymap ();
- for (vk = 0; vk < 256; vk++)
+ for (vk = 0; vk < KEY_STATE_SIZE; vk++)
{
gint i;
@@ -605,7 +624,7 @@ gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
#ifdef G_ENABLE_DEBUG
if (_gdk_debug_flags & GDK_DEBUG_EVENTS)
{
- gint i;
+ guint i;
g_print ("gdk_keymap_get_entries_for_keyval: %#.04x (%s):",
keyval, gdk_keyval_name (keyval));
@@ -648,7 +667,7 @@ gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
g_return_val_if_fail (n_entries != NULL, FALSE);
if (hardware_keycode <= 0 ||
- hardware_keycode >= 256)
+ hardware_keycode >= KEY_STATE_SIZE)
{
if (keys)
*keys = NULL;
@@ -744,14 +763,14 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
update_keymap ();
- if (key->keycode >= 256 ||
+ if (key->keycode >= KEY_STATE_SIZE ||
key->group < 0 || key->group >= 2 ||
key->level < 0 || key->level >= 2)
return 0;
sym = keysym_tab[key->keycode*4 + key->group*2 + key->level];
- if (sym == GDK_VoidSymbol)
+ if (sym == GDK_KEY_VoidSymbol)
return 0;
else
return sym;
@@ -793,7 +812,7 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
if (keymap != NULL && keymap != gdk_keymap_get_default ())
return FALSE;
- if (hardware_keycode >= 256)
+ if (hardware_keycode >= KEY_STATE_SIZE)
return FALSE;
if (group < 0 || group >= 2)
@@ -820,23 +839,23 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
* the key for those.
*/
if (shift_level == 1 &&
- keyvals[group*2 + 1] == GDK_VoidSymbol &&
- keyvals[group*2] != GDK_VoidSymbol)
+ keyvals[group*2 + 1] == GDK_KEY_VoidSymbol &&
+ keyvals[group*2] != GDK_KEY_VoidSymbol)
{
shift_level = 0;
ignore_shift = TRUE;
}
if (group == 1 &&
- keyvals[2 + shift_level] == GDK_VoidSymbol &&
- keyvals[0 + shift_level] != GDK_VoidSymbol)
+ keyvals[2 + shift_level] == GDK_KEY_VoidSymbol &&
+ keyvals[0 + shift_level] != GDK_KEY_VoidSymbol)
{
group = 0;
ignore_group = TRUE;
}
- if (keyvals[group *2 + shift_level] == GDK_VoidSymbol &&
- keyvals[0 + 0] != GDK_VoidSymbol)
+ if (keyvals[group *2 + shift_level] == GDK_KEY_VoidSymbol &&
+ keyvals[0 + 0] != GDK_KEY_VoidSymbol)
{
shift_level = 0;
group = 0;
@@ -847,11 +866,11 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
/* See whether the group and shift level actually mattered
* to know what to put in consumed_modifiers
*/
- if (keyvals[group*2 + 1] == GDK_VoidSymbol ||
+ if (keyvals[group*2 + 1] == GDK_KEY_VoidSymbol ||
keyvals[group*2 + 0] == keyvals[group*2 + 1])
ignore_shift = TRUE;
- if (keyvals[2 + shift_level] == GDK_VoidSymbol ||
+ if (keyvals[2 + shift_level] == GDK_KEY_VoidSymbol ||
keyvals[0 + shift_level] == keyvals[2 + shift_level])
ignore_group = TRUE;
@@ -891,7 +910,7 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
group, shift_level, tmp_modifiers, gdk_keyval_name (tmp_keyval)));
#endif
- return tmp_keyval != GDK_VoidSymbol;
+ return tmp_keyval != GDK_KEY_VoidSymbol;
}
void
@@ -907,3 +926,17 @@ gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap,
/* FIXME: Is this the right thing to do? */
return TRUE;
}
+
+static void
+gdk_win32_keymap_finalize (GObject *object)
+{
+}
+
+static void
+gdk_win32_keymap_class_init (GdkWin32KeymapClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gdk_win32_keymap_finalize;
+
+}
diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h
index 32777ad..d7ba5a0 100644
--- a/gdk/win32/gdkwin32.h
+++ b/gdk/win32/gdkwin32.h
@@ -35,6 +35,12 @@
#include <windows.h>
#include <commctrl.h>
+#define __GDKWIN32_H_INSIDE__
+
+#include <gdk/win32/gdkwin32keys.h>
+
+#undef __GDKWIN32_H_INSIDE__
+
G_BEGIN_DECLS
#ifdef INSIDE_GDK_WIN32
diff --git a/gdk/win32/gdkwin32keys.h b/gdk/win32/gdkwin32keys.h
new file mode 100644
index 0000000..c271d67
--- /dev/null
+++ b/gdk/win32/gdkwin32keys.h
@@ -0,0 +1,47 @@
+/* GDK - The GIMP Drawing Kit
+ * Copyright (C) 2010 Red Hat, Inc.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GDK_WIN32_KEYS_H__
+#define __GDK_WIN32_KEYS_H__
+
+#if !defined (__GDKWIN32_H_INSIDE__) && !defined (GDK_COMPILATION)
+#error "Only <gdk/gdkwin32.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
+
+G_BEGIN_DECLS
+
+#ifdef GDK_COMPILATION
+typedef struct _GdkWin32Keymap GdkWin32Keymap;
+#else
+typedef GdkKeymap GdkWin32Keymap;
+#endif
+typedef struct _GdkWin32KeymapClass GdkWin32KeymapClass;
+
+#define GDK_TYPE_WIN32_KEYMAP (gdk_win32_keymap_get_type())
+#define GDK_WIN32_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WIN32_KEYMAP,
GdkWin32Keymap))
+#define GDK_WIN32_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_KEYMAP,
GdkWin32KeymapClass))
+#define GDK_IS_WIN32_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WIN32_KEYMAP))
+#define GDK_IS_WIN32_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_KEYMAP))
+#define GDK_WIN32_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_KEYMAP,
GdkWin32KeymapClass))
+
+GType gdk_win32_keymap_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GDK_WIN32_KEYMAP_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]