diff options
author | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-06 18:48:27 +0000 |
commit | a915739887477b28d924ecc8417ee107d125bd6c (patch) | |
tree | c02f315476b61892d1fd89182e18943dce8d6277 /xorg-server/xkb/ddxLoad.c | |
parent | 6f25a23db1df27e992c34f6fd4c82e83c44fc2e2 (diff) | |
download | vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.gz vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.tar.bz2 vcxsrv-a915739887477b28d924ecc8417ee107d125bd6c.zip |
Switched to xorg-server-1.6.99.900.tar.gz
Diffstat (limited to 'xorg-server/xkb/ddxLoad.c')
-rw-r--r-- | xorg-server/xkb/ddxLoad.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c index 4d5dfb685..6954dd150 100644 --- a/xorg-server/xkb/ddxLoad.c +++ b/xorg-server/xkb/ddxLoad.c @@ -34,7 +34,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <stdio.h> #include <ctype.h> -#define NEED_EVENTS 1 #include <X11/X.h> #include <X11/Xos.h> #include <X11/Xproto.h> @@ -178,7 +177,7 @@ OutputDirectory( } } -static Bool +static Bool XkbDDXCompileKeymapByNames( XkbDescPtr xkb, XkbComponentNamesPtr names, unsigned want, @@ -205,7 +204,6 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, snprintf(keymap, sizeof(keymap), "server-%s", display); - XkbEnsureSafeMapName(keymap); OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); #ifdef WIN32 @@ -405,7 +403,7 @@ XkbRF_RulesPtr rules; return False; } - rules = XkbRF_Create(0, 0); + rules = XkbRF_Create(); if (!rules) { LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n"); fclose(file); @@ -429,3 +427,36 @@ XkbRF_RulesPtr rules; return complete; } + +XkbDescPtr +XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo) +{ + XkbComponentNamesRec kccgst; + XkbRF_VarDefsRec mlvo; + XkbDescPtr xkb; + char name[PATH_MAX]; + + if (!dev || !rmlvo) { + LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n"); + return NULL; + } + + mlvo.model = rmlvo->model; + mlvo.layout = rmlvo->layout; + mlvo.variant = rmlvo->variant; + mlvo.options = rmlvo->options; + + /* XDNFR already logs for us. */ + if (!XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, &kccgst)) + return NULL; + + /* XDLKBN too, but it might return 0 as well as allocating. */ + if (!XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, 0, &xkb, name, + PATH_MAX)) { + if (xkb) + XkbFreeKeyboard(xkb, 0, TRUE); + return NULL; + } + + return xkb; +} |