[xorg-commit-diffs] xc/programs/Xserver/hw/xwin Imakefile, 1.1.4.1.2.13, 1.1.4.1.2.14 InitInput.c, 1.1.4.1.2.4, 1.1.4.1.2.5 InitOutput.c, 1.1.4.1.2.30, 1.1.4.1.2.31 win.h, 1.1.4.1.2.26, 1.1.4.1.2.27 winclipboardunicode.c, 1.1.4.1.2.8, 1.1.4.1.2.9 winglobals.c, 1.1.2.14, 1.1.2.15 winmultiwindowwndproc.c, 1.1.6.14, 1.1.6.15 winwndproc.c, 1.1.4.1.2.18, 1.1.4.1.2.19

Harold L Hunt II xorg-commit at pdx.freedesktop.org
Fri Apr 2 21:00:49 PST 2004


Committed by: harold

Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv31372

Modified Files:
      Tag: CYGWIN
	Imakefile InitInput.c InitOutput.c win.h winclipboardunicode.c 
	winglobals.c winmultiwindowwndproc.c winwndproc.c 
Log Message:
Implement a framework for hooking low-level windows key presses.  Note: This needs a little work still and it does nothing useful yet.

Index: Imakefile
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Imakefile,v
retrieving revision 1.1.4.1.2.13
retrieving revision 1.1.4.1.2.14
diff -u -d -r1.1.4.1.2.13 -r1.1.4.1.2.14
--- a/Imakefile	30 Mar 2004 00:31:28 -0000	1.1.4.1.2.13
+++ b/Imakefile	3 Apr 2004 05:00:46 -0000	1.1.4.1.2.14
@@ -87,6 +87,7 @@
 	winerror.c \
 	winglobals.c \
 	winkeybd.c \
+	winkeyhook.c \
 	winmisc.c \
 	winmouse.c \
 	winmsg.c \
@@ -207,6 +208,7 @@
 	winerror.o \
 	winglobals.o \
 	winkeybd.o \
+	winkeyhook.o \
 	winmisc.o \
 	winmouse.o \
 	winmsg.o \

Index: InitInput.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitInput.c,v
retrieving revision 1.1.4.1.2.4
retrieving revision 1.1.4.1.2.5
diff -u -d -r1.1.4.1.2.4 -r1.1.4.1.2.5
--- a/InitInput.c	17 Mar 2004 20:31:50 -0000	1.1.4.1.2.4
+++ b/InitInput.c	3 Apr 2004 05:00:46 -0000	1.1.4.1.2.5
@@ -50,7 +50,7 @@
  * Local global declarations
  */
 
-CARD32			g_c32LastInputEventTime = 0;
+CARD32				g_c32LastInputEventTime = 0;
 
 
 /*

Index: InitOutput.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c,v
retrieving revision 1.1.4.1.2.30
retrieving revision 1.1.4.1.2.31
diff -u -d -r1.1.4.1.2.30 -r1.1.4.1.2.31
--- a/InitOutput.c	29 Mar 2004 16:32:37 -0000	1.1.4.1.2.30
+++ b/InitOutput.c	3 Apr 2004 05:00:46 -0000	1.1.4.1.2.31
@@ -245,6 +245,9 @@
       g_pszCommandLine = NULL;
     }
 
+  /* Remove our keyboard hook if it is installed */
+  winRemoveKeyboardHookLL ();
+
   /* Tell Windows that we want to end the app */
   PostQuitMessage (0);
 }

Index: win.h
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v
retrieving revision 1.1.4.1.2.26
retrieving revision 1.1.4.1.2.27
diff -u -d -r1.1.4.1.2.26 -r1.1.4.1.2.27
--- a/win.h	30 Mar 2004 00:31:28 -0000	1.1.4.1.2.26
+++ b/win.h	3 Apr 2004 05:00:46 -0000	1.1.4.1.2.27
@@ -968,6 +968,17 @@
 
 
 /*
+ * winkeyhook.c
+ */
+
+Bool
+winInstallKeyboardHookLL ();
+
+void
+winRemoveKeyboardHookLL ();
+
+
+/*
  * winmisc.c
  */
 

Index: winclipboardunicode.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winclipboardunicode.c,v
retrieving revision 1.1.4.1.2.8
retrieving revision 1.1.4.1.2.9
diff -u -d -r1.1.4.1.2.8 -r1.1.4.1.2.9
--- a/winclipboardunicode.c	26 Mar 2004 20:07:03 -0000	1.1.4.1.2.8
+++ b/winclipboardunicode.c	3 Apr 2004 05:00:46 -0000	1.1.4.1.2.9
@@ -50,13 +50,13 @@
   switch (osvi.dwPlatformId)
     {
     case VER_PLATFORM_WIN32_NT:
-      /* Engine 4 is supported on NT only */
+      /* Unicode supported on NT only */
       ErrorF ("DetectUnicodeSupport - Windows NT/2000/XP\n");
       fReturn = TRUE;
       break;
 
     case VER_PLATFORM_WIN32_WINDOWS:
-      /* Engine 4 is supported on NT only */
+      /* Unicode is not supported on non-NT */
       ErrorF ("DetectUnicodeSupport - Windows 95/98/Me\n");
       fReturn = FALSE;
       break;

Index: winglobals.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winglobals.c,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -d -r1.1.2.14 -r1.1.2.15
--- a/winglobals.c	29 Mar 2004 16:32:37 -0000	1.1.2.14
+++ b/winglobals.c	3 Apr 2004 05:00:46 -0000	1.1.2.15
@@ -59,9 +59,9 @@
 Bool		g_fLogInited = FALSE;
 char *		g_pszCommandLine = NULL;
 Bool		g_fUseMsg = FALSE;
-#ifdef XWIN_MULTIWINDOW
 DWORD		g_dwCurrentThreadID = 0;
-#endif
+Bool		g_fKeyboardHookLL = TRUE;
+HHOOK		g_hhookKeyboardLL = NULL;
 
 
 /*
@@ -110,9 +110,7 @@
 void
 winInitializeGlobals (void)
 {
-#ifdef XWIN_MULTIWINDOW
   g_dwCurrentThreadID = GetCurrentThreadId ();
-#endif
 #ifdef XWIN_CLIPBOARD
   g_fClipboardLaunched = FALSE;
   g_fClipboardStarted = FALSE;

Index: winmultiwindowwndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowwndproc.c,v
retrieving revision 1.1.6.14
retrieving revision 1.1.6.15
diff -u -d -r1.1.6.14 -r1.1.6.15
--- a/winmultiwindowwndproc.c	30 Mar 2004 08:28:59 -0000	1.1.6.14
+++ b/winmultiwindowwndproc.c	3 Apr 2004 05:00:46 -0000	1.1.6.15
@@ -40,8 +40,9 @@
  * External global variables
  */
 
-extern Bool		g_fCursor;
-extern HICON		g_hiconX;
+extern Bool			g_fCursor;
+extern HICON			g_hiconX;
+extern Bool			g_fKeyboardHookLL;
 
 
 /*
@@ -59,7 +60,6 @@
 #define WIN_MULTIWINDOW_SHAPE		YES
 
 
-
 /*
  * ConstrainSize - Taken from TWM sources - Respects hints for sizing
  */
@@ -626,11 +626,18 @@
 	break;
 
       winRestoreModeKeyStates ();
+
+      /* Add the keyboard hook if possible */
+      if (g_fKeyboardHookLL)
+	g_fKeyboardHookLL = winInstallKeyboardHookLL ();
       return 0;
       
     case WM_KILLFOCUS:
       /* Pop any pressed keys since we are losing keyboard focus */
       winKeybdReleaseKeys ();
+
+      /* Remove our keyboard hook if it is installed */
+      winRemoveKeyboardHookLL ();
       return 0;
 
     case WM_SYSDEADCHAR:      

Index: winwndproc.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwndproc.c,v
retrieving revision 1.1.4.1.2.18
retrieving revision 1.1.4.1.2.19
diff -u -d -r1.1.4.1.2.18 -r1.1.4.1.2.19
--- a/winwndproc.c	1 Apr 2004 18:20:19 -0000	1.1.4.1.2.18
+++ b/winwndproc.c	3 Apr 2004 05:00:46 -0000	1.1.4.1.2.19
@@ -52,6 +52,7 @@
 
 extern Bool			g_fClipboard;
 extern HWND			g_hDlgDepthChange;
+extern Bool			g_fKeyboardHookLL;
 
 
 /*
@@ -913,6 +914,10 @@
 
       /* Restore the state of all mode keys */
       winRestoreModeKeyStates ();
+
+      /* Add the keyboard hook if possible */
+      if (g_fKeyboardHookLL)
+	g_fKeyboardHookLL = winInstallKeyboardHookLL ();
       return 0;
 
     case WM_KILLFOCUS:
@@ -921,6 +926,9 @@
 
       /* Release any pressed keys */
       winKeybdReleaseKeys ();
+
+      /* Remove our keyboard hook if it is installed */
+      winRemoveKeyboardHookLL ();
       return 0;
 
     case WM_SYSKEYDOWN:




More information about the xorg-commit-diffs mailing list