listing: Drop unused deviceSpec argument
[platform/upstream/libxkbcommon.git] / include / X11 / extensions / XKBcommon.h
1 /*
2 Copyright 1985, 1987, 1990, 1998  The Open Group
3 Copyright 2008  Dan Nicholson
4
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
26 */
27
28 #ifndef _XKBCOMMON_H_
29 #define _XKBCOMMON_H_
30
31 #include <stdio.h>
32 #include <X11/Xfuncproto.h>
33
34 /* Action structures used in the server */
35 typedef struct _XkbcModAction {
36     unsigned char   type;
37     unsigned char   flags;
38     unsigned char   mask;
39     unsigned char   real_mods;
40     unsigned int    vmods;
41 } XkbcModAction;
42
43 typedef struct _XkbcISOAction {
44     unsigned char   type;
45     unsigned char   flags;
46     unsigned char   mask;
47     unsigned char   real_mods;
48     /* FIXME: Make this an int. */
49     char            group_XXX;
50     unsigned char   affect;
51     unsigned int    vmods;
52 } XkbcISOAction;
53
54 typedef struct _XkbcPtrAction {
55     unsigned char   type;
56     unsigned char   flags;
57     int             x;
58     int             y;
59 } XkbcPtrAction;
60
61 typedef struct _XkbcCtrlsAction {
62     unsigned char   type;
63     unsigned char   flags;
64     unsigned long   ctrls;
65 } XkbcCtrlsAction;
66
67 typedef struct  _XkbcRedirectKeyAction {
68     unsigned char   type;
69     unsigned char   new_key;
70     unsigned char   mods_mask;
71     unsigned char   mods;
72     unsigned int    vmods_mask;
73     unsigned int    vmods;
74 } XkbcRedirectKeyAction;
75
76 typedef union _XkbcAction {
77     XkbAnyAction            any;
78     XkbcModAction           mods;
79     XkbGroupAction          group;
80     XkbcISOAction           iso;
81     XkbcPtrAction           ptr;
82     XkbPtrBtnAction         btn;
83     XkbPtrDfltAction        dflt;
84     XkbSwitchScreenAction   screen;
85     XkbcCtrlsAction         ctrls;
86     XkbMessageAction        msg;
87     XkbcRedirectKeyAction   redirect;
88     XkbDeviceBtnAction      devbtn;
89     XkbDeviceValuatorAction devval;
90     unsigned char           type;
91 } XkbcAction;
92
93 typedef struct _XkbcServerMapRec {
94     unsigned short      num_acts;
95     unsigned short      size_acts;
96     XkbcAction *        acts;
97
98     XkbBehavior *       behaviors;
99     unsigned short *    key_acts;
100 #if defined(__cplusplus) || defined(c_plusplus)
101     /* explicit is a C++ reserved word */
102     unsigned char *     c_explicit;
103 #else
104     unsigned char *     explicit;
105 #endif
106     unsigned char       vmods[XkbNumVirtualMods];
107     unsigned short *    vmodmap;
108 } XkbcServerMapRec, *XkbcServerMapPtr;
109
110 /* Common keyboard description structure */
111 typedef struct _XkbcDesc {
112     unsigned int        defined;
113     unsigned short      flags;
114     unsigned short      device_spec;
115     KeyCode             min_key_code;
116     KeyCode             max_key_code;
117
118     XkbControlsPtr      ctrls;
119     XkbcServerMapPtr    server;
120     XkbClientMapPtr     map;
121     XkbIndicatorPtr     indicators;
122     XkbNamesPtr         names;
123     XkbCompatMapPtr     compat;
124     XkbGeometryPtr      geom;
125 } XkbcDescRec, *XkbcDescPtr;
126
127 _XFUNCPROTOBEGIN
128
129 extern void
130 XkbcInitAtoms(void);
131
132 extern XkbcDescPtr
133 XkbcCompileKeymapFromRules(const XkbRMLVOSet *rmlvo);
134
135 extern XkbcDescPtr
136 XkbcCompileKeymapFromComponents(const XkbComponentNamesPtr ktcsg);
137
138 extern XkbcDescPtr
139 XkbcCompileKeymapFromFile(FILE *inputFile, const char *mapName);
140
141 extern XkbComponentListPtr
142 XkbcListComponents(XkbComponentNamesPtr ptrns, int *maxMatch);
143
144 _XFUNCPROTOEND
145
146 #endif /* _XKBCOMMON_H_ */