gtk2/gdk/win32/gdkglobals-win32.c
Tor Lillqvist 93fa867e14 Implement the functions that until now just were non-functional stubs. For
2002-02-26  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkkeys-win32.c: Implement the functions that until
	now just were non-functional stubs. For "hardware keycodes", we
	use Windows virtual keycodes. Not scancodes, although that at
	first might seem more low-level and a better match to X11
	keycodes.

	The Windows API is really mixed up and confused with respect to
	scancodes and virtual keycodes. (Surprised?) Some scancodes are
	generated by two keys on the keyboard (!), and although the
	keyboard messages do have a flag to indicate which key the user
	pressed, other API that take a scan code as input don't let you
	specify which actual key you mean.

	(update_keymap): Function to build a X11-like representation of
	the keyboard. Each key has four keysyms: two levels (nonshifted
	and shifted) and two groups (normal and with AltGr).

	(gdk_keymap_get_direction): Use the codepage corresponding to the
	thread's input locale, not the system codepage.

	* gdk/win32/gdkglobals-win32.c
	* gdk/win32/gdkmain-win32.c
	* gdk/win32/gdkprivate-win32.h
	* gdk/win32/gdkwindow-win32.h
	* gdk/win32/gdkwindow-win32.c: Remove the input_locale and
	charset_info fields from GdkWindowImplWin32. Input locale is
	per-thread in Windows, and as GDK on Windows really only works
	when the GDI interaction all happens in just one thread anyway,
	this state can be global. Use globals _gdk_input_locale and
	_gdk_input_codepage instead. Set these based on the thread's input
	locale (keyboard layout, or which IME is active).

	* gdk/win32/gdkevents-win32.c: Set the group and hardware_keycode
	fields in GDK key events. On input locale change messages, set
	the global state variables, and inform update_keymap() that it
	has to rebuild the keymap.
2002-02-26 01:18:27 +00:00

57 lines
1.7 KiB
C

/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1998-2002 Tor Lillqvist
*
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdktypes.h"
#include "gdkprivate-win32.h"
HWND gdk_root_window = NULL;
HDC gdk_display_hdc;
HINSTANCE gdk_dll_hinstance;
HINSTANCE gdk_app_hmodule;
HKL _gdk_input_locale;
UINT _gdk_input_codepage;
WORD cf_rtf;
WORD cf_utf8_string;
GdkAtom utf8_string;
GdkAtom compound_text;
GdkAtom text_uri_list;
GdkAtom local_dnd;
GdkAtom gdk_win32_dropfiles;
GdkAtom gdk_ole2_dnd;
GdkAtom _gdk_selection_property;
DWORD windows_version;
gint gdk_input_ignore_wintab = FALSE;
gint gdk_event_func_from_window_proc = FALSE;
gint gdk_max_colors = 0;