2009-01-20 08:46:12 -07:00
|
|
|
/*
|
|
|
|
Copyright 1985, 1987, 1990, 1998 The Open Group
|
|
|
|
Copyright 2008 Dan Nicholson
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
Except as contained in this notice, the names of the authors or their
|
|
|
|
institutions shall not be used in advertising or otherwise to promote the
|
|
|
|
sale, use or other dealings in this Software without prior written
|
|
|
|
authorization from the authors.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _XKBCOMMON_H_
|
|
|
|
#define _XKBCOMMON_H_
|
|
|
|
|
2009-04-10 13:25:51 -06:00
|
|
|
#include <stdio.h>
|
2009-03-17 07:19:56 -06:00
|
|
|
#include <X11/Xfuncproto.h>
|
2009-04-25 02:13:24 -06:00
|
|
|
#include <X11/extensions/XKBstrcommon.h>
|
|
|
|
#include <X11/extensions/XKBrulescommon.h>
|
2009-03-19 18:16:13 -06:00
|
|
|
|
2009-04-05 16:15:20 -06:00
|
|
|
/* Action structures used in the server */
|
|
|
|
typedef struct _XkbcModAction {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
unsigned char mask;
|
|
|
|
unsigned char real_mods;
|
|
|
|
unsigned int vmods;
|
|
|
|
} XkbcModAction;
|
|
|
|
|
|
|
|
typedef struct _XkbcISOAction {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
unsigned char mask;
|
|
|
|
unsigned char real_mods;
|
|
|
|
/* FIXME: Make this an int. */
|
|
|
|
char group_XXX;
|
|
|
|
unsigned char affect;
|
|
|
|
unsigned int vmods;
|
|
|
|
} XkbcISOAction;
|
|
|
|
|
|
|
|
typedef struct _XkbcPtrAction {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
} XkbcPtrAction;
|
|
|
|
|
|
|
|
typedef struct _XkbcCtrlsAction {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char flags;
|
|
|
|
unsigned long ctrls;
|
|
|
|
} XkbcCtrlsAction;
|
|
|
|
|
|
|
|
typedef struct _XkbcRedirectKeyAction {
|
|
|
|
unsigned char type;
|
|
|
|
unsigned char new_key;
|
|
|
|
unsigned char mods_mask;
|
|
|
|
unsigned char mods;
|
|
|
|
unsigned int vmods_mask;
|
|
|
|
unsigned int vmods;
|
|
|
|
} XkbcRedirectKeyAction;
|
|
|
|
|
|
|
|
typedef union _XkbcAction {
|
|
|
|
XkbAnyAction any;
|
|
|
|
XkbcModAction mods;
|
|
|
|
XkbGroupAction group;
|
|
|
|
XkbcISOAction iso;
|
|
|
|
XkbcPtrAction ptr;
|
|
|
|
XkbPtrBtnAction btn;
|
|
|
|
XkbPtrDfltAction dflt;
|
|
|
|
XkbSwitchScreenAction screen;
|
|
|
|
XkbcCtrlsAction ctrls;
|
|
|
|
XkbMessageAction msg;
|
|
|
|
XkbcRedirectKeyAction redirect;
|
|
|
|
XkbDeviceBtnAction devbtn;
|
|
|
|
XkbDeviceValuatorAction devval;
|
|
|
|
unsigned char type;
|
|
|
|
} XkbcAction;
|
|
|
|
|
|
|
|
typedef struct _XkbcServerMapRec {
|
|
|
|
unsigned short num_acts;
|
|
|
|
unsigned short size_acts;
|
|
|
|
XkbcAction * acts;
|
|
|
|
|
|
|
|
XkbBehavior * behaviors;
|
|
|
|
unsigned short * key_acts;
|
|
|
|
#if defined(__cplusplus) || defined(c_plusplus)
|
|
|
|
/* explicit is a C++ reserved word */
|
|
|
|
unsigned char * c_explicit;
|
|
|
|
#else
|
|
|
|
unsigned char * explicit;
|
|
|
|
#endif
|
|
|
|
unsigned char vmods[XkbNumVirtualMods];
|
|
|
|
unsigned short * vmodmap;
|
|
|
|
} XkbcServerMapRec, *XkbcServerMapPtr;
|
|
|
|
|
2009-03-19 18:16:13 -06:00
|
|
|
/* Common keyboard description structure */
|
|
|
|
typedef struct _XkbcDesc {
|
|
|
|
unsigned int defined;
|
|
|
|
unsigned short flags;
|
|
|
|
unsigned short device_spec;
|
|
|
|
KeyCode min_key_code;
|
|
|
|
KeyCode max_key_code;
|
|
|
|
|
|
|
|
XkbControlsPtr ctrls;
|
2009-04-05 16:15:20 -06:00
|
|
|
XkbcServerMapPtr server;
|
2009-03-19 18:16:13 -06:00
|
|
|
XkbClientMapPtr map;
|
|
|
|
XkbIndicatorPtr indicators;
|
|
|
|
XkbNamesPtr names;
|
|
|
|
XkbCompatMapPtr compat;
|
|
|
|
XkbGeometryPtr geom;
|
|
|
|
} XkbcDescRec, *XkbcDescPtr;
|
2009-01-20 08:46:12 -07:00
|
|
|
|
2009-03-17 07:19:56 -06:00
|
|
|
_XFUNCPROTOBEGIN
|
|
|
|
|
2009-04-09 15:29:32 -06:00
|
|
|
extern void
|
|
|
|
XkbcInitAtoms(void);
|
|
|
|
|
2009-03-29 09:55:18 -06:00
|
|
|
extern XkbcDescPtr
|
2009-04-08 18:59:15 -06:00
|
|
|
XkbcCompileKeymapFromRules(const XkbRMLVOSet *rmlvo);
|
2009-03-31 06:36:52 -06:00
|
|
|
|
|
|
|
extern XkbcDescPtr
|
2009-04-08 18:59:15 -06:00
|
|
|
XkbcCompileKeymapFromComponents(const XkbComponentNamesPtr ktcsg);
|
2009-03-29 09:55:18 -06:00
|
|
|
|
2009-04-10 13:25:51 -06:00
|
|
|
extern XkbcDescPtr
|
|
|
|
XkbcCompileKeymapFromFile(FILE *inputFile, const char *mapName);
|
|
|
|
|
2009-04-19 17:30:36 -06:00
|
|
|
extern XkbComponentListPtr
|
2009-04-22 00:22:25 -06:00
|
|
|
XkbcListComponents(XkbComponentNamesPtr ptrns, int *maxMatch);
|
2009-04-19 17:30:36 -06:00
|
|
|
|
2009-04-24 22:55:59 -06:00
|
|
|
/*
|
|
|
|
* Converts a keysym to a string; will return unknown Unicode codepoints
|
|
|
|
* as "Ua1b2", and other unknown keysyms as "0xabcd1234".
|
|
|
|
*
|
|
|
|
* The string returned may become invalidated after the next call to
|
|
|
|
* XkbcKeysymToString: if you need to preserve it, then you must
|
|
|
|
* duplicate it.
|
|
|
|
*/
|
2009-04-24 22:52:51 -06:00
|
|
|
extern char *
|
|
|
|
XkbcKeysymToString(KeySym ks);
|
|
|
|
|
2009-04-24 22:55:59 -06:00
|
|
|
/*
|
|
|
|
* See XkbcKeysymToString comments: this function will accept any string
|
|
|
|
* from that function.
|
|
|
|
*/
|
2009-04-24 22:52:51 -06:00
|
|
|
extern KeySym
|
|
|
|
XkbcStringToKeysym(const char *s);
|
|
|
|
|
2009-03-17 07:19:56 -06:00
|
|
|
_XFUNCPROTOEND
|
|
|
|
|
2009-01-20 08:46:12 -07:00
|
|
|
#endif /* _XKBCOMMON_H_ */
|