xserver/xkb xkbActions.c,1.2,1.3 xkbInit.c,1.3,1.4
Dave Airlie
xserver-commit at pdx.freedesktop.org
Tue Jan 3 01:02:24 PST 2006
Committed by: airlied
Update of /cvs/xserver/xserver/xkb
In directory gabe:/tmp/cvs-serv8685/xkb
Modified Files:
xkbActions.c xkbInit.c
Log Message:
xkb changes from Xgl
Index: xkbActions.c
===================================================================
RCS file: /cvs/xserver/xserver/xkb/xkbActions.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- xkbActions.c 3 Jan 2006 07:39:41 -0000 1.2
+++ xkbActions.c 3 Jan 2006 09:02:22 -0000 1.3
@@ -41,6 +41,48 @@
#include "xkb.h"
#include <ctype.h>
+static unsigned int _xkbServerGeneration;
+int xkbDevicePrivateIndex = -1;
+
+void
+xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc,
+ pointer data)
+{
+ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(device);
+ ProcessInputProc tmp = device->public.processInputProc;
+ if(xkbPrivPtr->unwrapProc)
+ xkbPrivPtr->unwrapProc = NULL;
+
+ UNWRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr);
+ proc(device,data);
+ WRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr,
+ tmp,xkbUnwrapProc);
+}
+
+
+void
+XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
+{
+ xkbDeviceInfoPtr xkbPrivPtr;
+
+ if (serverGeneration != _xkbServerGeneration) {
+ if ((xkbDevicePrivateIndex = AllocateDevicePrivateIndex()) == -1)
+ return;
+ _xkbServerGeneration = serverGeneration;
+ }
+ if (!AllocateDevicePrivate(device, xkbDevicePrivateIndex))
+ return;
+
+ xkbPrivPtr = (xkbDeviceInfoPtr) xalloc(sizeof(xkbDeviceInfoRec));
+ if (!xkbPrivPtr)
+ return;
+ xkbPrivPtr->unwrapProc = NULL;
+
+ device->devPrivates[xkbDevicePrivateIndex].ptr = xkbPrivPtr;
+ WRAP_PROCESS_INPUT_PROC(device,xkbPrivPtr,
+ proc,xkbUnwrapProc);
+}
+
#ifdef XINPUT
extern void ProcessOtherEvent(
xEvent * /* xE */,
@@ -825,6 +867,7 @@
int x,y;
XkbStateRec old;
unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0;
+xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device);
if ((filter->keycode!=0)&&(filter->keycode!=keycode))
return 1;
@@ -873,7 +916,10 @@
realMods = xkbi->device->key->modifierMap[ev.u.u.detail];
xkbi->device->key->modifierMap[ev.u.u.detail] = 0;
- CoreProcessKeyboardEvent(&ev,xkbi->device,1);
+ UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr);
+ xkbi->device->public.processInputProc(&ev,xkbi->device,1);
+ COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr,
+ ProcessKeyboardEvent,xkbUnwrapProc);
xkbi->device->key->modifierMap[ev.u.u.detail] = realMods;
if ( mask || mods ) {
@@ -911,7 +957,10 @@
realMods = xkbi->device->key->modifierMap[ev.u.u.detail];
xkbi->device->key->modifierMap[ev.u.u.detail] = 0;
- CoreProcessKeyboardEvent(&ev,xkbi->device,1);
+ UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr);
+ xkbi->device->public.processInputProc(&ev,xkbi->device,1);
+ COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr,
+ ProcessKeyboardEvent,xkbUnwrapProc);
xkbi->device->key->modifierMap[ev.u.u.detail] = realMods;
if ( mask || mods ) {
@@ -1106,6 +1155,8 @@
Bool xiEvent;
#endif
+xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
+
keyc= kbd->key;
xkbi= keyc->xkbInfo;
key= xE->u.u.detail;
@@ -1247,7 +1298,10 @@
if (keyEvent) {
realMods = keyc->modifierMap[key];
keyc->modifierMap[key] = 0;
- CoreProcessKeyboardEvent(xE,dev,count);
+ UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr);
+ dev->public.processInputProc(xE,dev,count);
+ COND_WRAP_PROCESS_INPUT_PROC(dev, xkbPrivPtr,
+ ProcessKeyboardEvent,xkbUnwrapProc);
keyc->modifierMap[key] = realMods;
}
else CoreProcessPointerEvent(xE,dev,count);
Index: xkbInit.c
===================================================================
RCS file: /cvs/xserver/xserver/xkb/xkbInit.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xkbInit.c 3 Jan 2006 07:39:41 -0000 1.3
+++ xkbInit.c 3 Jan 2006 09:02:22 -0000 1.4
@@ -91,9 +91,12 @@
/***====================================================================***/
-//#ifndef XKB_BASE_DIRECTORY
+#ifndef XKB_BASE_DIRECTORY
#define XKB_BASE_DIRECTORY "/usr/lib/X11/xkb"
-//#endif
+#endif
+#ifndef XKB_BIN_DIRECTORY
+#define XKB_BIN_DIRECTORY XKB_BASE_DIRECTORY
+#endif
#ifndef XKB_DFLT_RULES_FILE
#define XKB_DFLT_RULES_FILE "rules"
#endif
@@ -117,6 +120,7 @@
#endif
char * XkbBaseDirectory= XKB_BASE_DIRECTORY;
+char * XkbBinDirectory= XKB_BIN_DIRECTORY;
char * XkbInitialMap= NULL;
int XkbWantAccessX= 0;
static XkbFileInfo * _XkbInitFileInfo= NULL;
@@ -191,6 +195,9 @@
if (XkbRulesFile) {
strcpy(&pval[out],XkbRulesFile);
out+= strlen(XkbRulesFile);
+ } else {
+ strcpy(&pval[out],XKB_DFLT_RULES_FILE);
+ out+= strlen(XKB_DFLT_RULES_FILE);
}
pval[out++]= '\0';
if (XkbModelUsed) {
More information about the xserver-commit
mailing list