Distributed Multihead X  1.16.4
dmxinputinit.h
Go to the documentation of this file.
1 /*
2  * Copyright 2002 Red Hat Inc., Durham, North Carolina.
3  *
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining
7  * a copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation on the rights to use, copy, modify, merge,
10  * publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial
16  * portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  */
27 
28 /*
29  * Authors:
30  * Rickard E. (Rik) Faith <faith@redhat.com>
31  *
32  */
33 
37 #ifndef _DMXINPUTINIT_H_
38 #define _DMXINPUTINIT_H_
39 
40 #include "dmx.h"
41 #include "dmxinput.h"
42 #include "dmxlog.h"
43 
44 #define DMX_LOCAL_DEFAULT_KEYBOARD "kbd"
45 #define DMX_LOCAL_DEFAULT_POINTER "ps2"
46 #define DMX_MAX_BUTTONS 256
47 #define DMX_MOTION_SIZE 256
48 #define DMX_MAX_VALUATORS 32
49 #define DMX_MAX_AXES 32
50 #define DMX_MAX_XINPUT_EVENT_TYPES 100
51 #define DMX_MAP_ENTRIES 16 /* Must be a power of 2 */
52 #define DMX_MAP_MASK (DMX_MAP_ENTRIES - 1)
53 
54 typedef enum {
59 
60 typedef enum {
66 
67 typedef enum {
73 
74 typedef enum {
79 
82 typedef struct _DMXLocalInitInfo {
83  int keyboard;
85  int keyClass;
86  KeySymsRec keySyms;
87  int freemap;
88  CARD8 modMap[MAP_LENGTH];
89  XkbDescPtr xkb;
90  XkbComponentNamesRec names;
91  int freenames;
92  int force;
95  int numButtons;
96  unsigned char map[DMX_MAX_BUTTONS];
127  KeySym *symbols;
129 
130 typedef void *(*dmxCreatePrivateProcPtr) (DeviceIntPtr);
131 typedef void (*dmxDestroyPrivateProcPtr) (void *);
132 
133 typedef void (*dmxInitProcPtr) (DevicePtr);
134 typedef void (*dmxReInitProcPtr) (DevicePtr);
135 typedef void (*dmxLateReInitProcPtr) (DevicePtr);
136 typedef void (*dmxGetInfoProcPtr) (DevicePtr, DMXLocalInitInfoPtr);
137 typedef int (*dmxOnProcPtr) (DevicePtr);
138 typedef void (*dmxOffProcPtr) (DevicePtr);
139 typedef void (*dmxUpdatePositionProcPtr) (void *, int x, int y);
140 
141 typedef void (*dmxVTPreSwitchProcPtr) (void *); /* Turn I/O Off */
142 typedef void (*dmxVTPostSwitchProcPtr) (void *); /* Turn I/O On */
143 typedef void (*dmxVTSwitchReturnProcPtr) (void *);
144 typedef int (*dmxVTSwitchProcPtr) (void *, int vt,
145  dmxVTSwitchReturnProcPtr, void *);
146 
147 typedef void (*dmxMotionProcPtr) (DevicePtr,
148  int *valuators,
149  int firstAxis,
150  int axesCount,
151  DMXMotionType type, DMXBlockType block);
152 typedef void (*dmxEnqueueProcPtr) (DevicePtr, int type, int detail,
153  KeySym keySym, XEvent * e,
154  DMXBlockType block);
155 typedef int (*dmxCheckSpecialProcPtr) (DevicePtr, KeySym keySym);
156 typedef void (*dmxCollectEventsProcPtr) (DevicePtr,
160 typedef void (*dmxProcessInputProcPtr) (void *);
161 typedef void (*dmxUpdateInfoProcPtr) (void *, DMXUpdateType, WindowPtr);
162 typedef int (*dmxFunctionsProcPtr) (void *, DMXFunctionType);
163 
164 typedef void (*dmxKBCtrlProcPtr) (DevicePtr, KeybdCtrl * ctrl);
165 typedef void (*dmxMCtrlProcPtr) (DevicePtr, PtrCtrl * ctrl);
166 typedef void (*dmxKBBellProcPtr) (DevicePtr, int percent,
167  int volume, int pitch, int duration);
168 
171 typedef struct _DMXEventMap {
172  int remote;
173  int server;
174 } DMXEventMap;
175 
179 typedef struct _DMXLocalInputInfo {
180  const char *name;
183  int binding;
187  /* Low-level (e.g., keyboard/mouse drivers) */
188 
226  void *private;
227  int isCore;
228  int sendsCore;
229  KeybdCtrl kctrl;
230  PtrCtrl mctrl;
232  DeviceIntPtr pDevice;
233  int inputIdx;
234  int lastX, lastY;
238  int head;
240  int tail;
242  unsigned long *history;
243  int *valuators;
245  /* for XInput ChangePointerDevice */
246  int (*savedMotionProc) (DeviceIntPtr,
247  xTimecoord *,
248  unsigned long, unsigned long, ScreenPtr);
257  long deviceId;
259  const char *deviceName;
262 
264 
265 extern void dmxLocalInitInput(DMXInputInfo * dmxInput);
268 
269 extern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl * ctrl);
270 extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl * ctrl);
271 extern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
272  void *ctrl, int unknown);
273 
274 extern int dmxInputExtensionErrorHandler(Display * dsp, _Xconst char *name,
275  _Xconst char *reason);
276 
277 extern int dmxInputDetach(DMXInputInfo * dmxInput);
278 extern void dmxInputDetachAll(DMXScreenInfo * dmxScreen);
279 extern int dmxInputDetachId(int id);
280 extern DMXInputInfo *dmxInputLocateId(int id);
281 extern int dmxInputAttachConsole(const char *name, int isCore, int *id);
282 extern int dmxInputAttachBackend(int physicalScreen, int isCore, int *id);
283 
284 #endif
int belFeedbackClass
Definition: dmxinputinit.h:118
int valuatorClass
Definition: dmxinputinit.h:98
KeySymsRec keySyms
Definition: dmxinputinit.h:86
unsigned char map[DMX_MAX_BUTTONS]
Definition: dmxinputinit.h:96
Definition: dmxinputinit.h:63
struct _DMXEventMap DMXEventMap
Definition: dmxinputinit.h:55
Definition: dmxinput.h:84
int ledFeedbackClass
Definition: dmxinputinit.h:116
int proximityClass
Definition: dmxinputinit.h:110
int head
Definition: dmxinputinit.h:238
int dmxInputExtensionErrorHandler(Display *dsp, _Xconst char *name, _Xconst char *reason)
Definition: dmxinputinit.c:866
void(* dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl)
Definition: dmxinputinit.h:164
dmxVTPostSwitchProcPtr vt_post_switch
Definition: dmxinputinit.h:210
Definition: dmxinputinit.h:77
DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput, DMXLocalInputInfoPtr s)
Definition: dmxinputinit.c:803
Definition: dmxinputinit.h:56
void(* dmxVTPreSwitchProcPtr)(void *)
Definition: dmxinputinit.h:141
int maxSymbolsSupported
Definition: dmxinputinit.h:126
DMXLocalInputExtType
Definition: dmxinputinit.h:67
struct _DMXLocalInitInfo DMXLocalInitInfo
int buttonClass
Definition: dmxinputinit.h:94
int(* dmxOnProcPtr)(DevicePtr)
Definition: dmxinputinit.h:137
long deviceId
Definition: dmxinputinit.h:257
DMXLocalInputInfoPtr dmxLocalCorePointer
Definition: dmxinputinit.c:81
void *(* dmxCreatePrivateProcPtr)(DeviceIntPtr)
Definition: dmxinputinit.h:130
Definition: dmxinputinit.h:70
unsigned long * history
Definition: dmxinputinit.h:242
int(* dmxCheckSpecialProcPtr)(DevicePtr, KeySym keySym)
Definition: dmxinputinit.h:155
#define DMX_MAX_BUTTONS
Definition: dmxinputinit.h:46
int ptrFeedbackClass
Definition: dmxinputinit.h:114
void(* dmxGetInfoProcPtr)(DevicePtr, DMXLocalInitInfoPtr)
Definition: dmxinputinit.h:136
int res[DMX_MAX_AXES]
Definition: dmxinputinit.h:104
DMXMotionType
Definition: dmxinputinit.h:74
int dmxInputAttachConsole(const char *name, int isCore, int *id)
Definition: dmxinputinit.c:1332
int(* savedMotionProc)(DeviceIntPtr, xTimecoord *, unsigned long, unsigned long, ScreenPtr)
Definition: dmxinputinit.h:246
int dmxInputDetachId(int id)
Definition: dmxinputinit.c:1268
int binding
Definition: dmxinputinit.h:183
void(* dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl)
Definition: dmxinputinit.h:165
int sendsCore
Definition: dmxinputinit.h:228
DMXLocalInputType type
Definition: dmxinputinit.h:181
DMXInputInfo * dmxInputLocateId(int id)
Definition: dmxinputinit.c:1279
Definition: dmxinputinit.h:64
int dmxInputAttachBackend(int physicalScreen, int isCore, int *id)
Definition: dmxinputinit.c:1355
int keyboard
Definition: dmxinputinit.h:83
int maxSymbols
Definition: dmxinputinit.h:125
void(* dmxUpdateInfoProcPtr)(void *, DMXUpdateType, WindowPtr)
Definition: dmxinputinit.h:161
dmxVTPreSwitchProcPtr vt_pre_switch
Definition: dmxinputinit.h:209
void(* dmxProcessInputProcPtr)(void *)
Definition: dmxinputinit.h:160
DMXLocalInputExtType extType
Definition: dmxinputinit.h:182
dmxUpdateInfoProcPtr update_info
Definition: dmxinputinit.h:219
dmxCollectEventsProcPtr collect_events
Definition: dmxinputinit.h:213
Definition: dmxinputinit.h:61
void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice, void *ctrl, int unknown)
Definition: dmxinputinit.c:338
void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl)
Definition: dmxinputinit.c:261
dmxProcessInputProcPtr process_input
Definition: dmxinputinit.h:216
int numButtons
Definition: dmxinputinit.h:95
DMXLocalInputInfoPtr dmxLocalCoreKeyboard
Definition: dmxinputinit.c:81
Definition: dmxinputinit.h:179
int strFeedbackClass
Definition: dmxinputinit.h:122
dmxReInitProcPtr reinit
Definition: dmxinputinit.h:196
void(* dmxCollectEventsProcPtr)(DevicePtr, dmxMotionProcPtr, dmxEnqueueProcPtr, dmxCheckSpecialProcPtr, DMXBlockType)
Definition: dmxinputinit.h:156
Definition: dmxinputinit.h:57
int tail
Definition: dmxinputinit.h:240
int(* dmxFunctionsProcPtr)(void *, DMXFunctionType)
Definition: dmxinputinit.h:162
void(* dmxDestroyPrivateProcPtr)(void *)
Definition: dmxinputinit.h:131
DMXLocalInputType
Definition: dmxinputinit.h:60
void(* dmxKBBellProcPtr)(DevicePtr, int percent, int volume, int pitch, int duration)
Definition: dmxinputinit.h:166
int savedSendsCore
Definition: dmxinputinit.h:250
KeybdCtrl kctrl
Definition: dmxinputinit.h:229
dmxUpdatePositionProcPtr update_position
Definition: dmxinputinit.h:206
void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl)
Definition: dmxinputinit.c:303
void(* dmxOffProcPtr)(DevicePtr)
Definition: dmxinputinit.h:138
Definition: dmx.h:91
KeySym * symbols
Definition: dmxinputinit.h:127
Definition: dmxinputinit.h:71
int(* dmxVTSwitchProcPtr)(void *, int vt, dmxVTSwitchReturnProcPtr, void *)
Definition: dmxinputinit.h:144
CARD8 modMap[MAP_LENGTH]
Definition: dmxinputinit.h:88
void(* dmxLateReInitProcPtr)(DevicePtr)
Definition: dmxinputinit.h:135
int inputIdx
Definition: dmxinputinit.h:233
#define DMX_MAP_ENTRIES
Definition: dmxinputinit.h:51
int focusClass
Definition: dmxinputinit.h:108
Definition: dmxinputinit.h:82
const char * deviceName
Definition: dmxinputinit.h:259
Definition: dmxinputinit.h:171
DeviceIntPtr pDevice
Definition: dmxinputinit.h:232
Definition: dmxinputinit.h:68
int keyClass
Definition: dmxinputinit.h:85
Definition: dmxinputinit.h:69
struct _DMXLocalInitInfo * DMXLocalInitInfoPtr
dmxOffProcPtr off
Definition: dmxinputinit.h:205
int numAbsAxes
Definition: dmxinputinit.h:101
dmxFunctionsProcPtr functions
Definition: dmxinputinit.h:218
void(* dmxUpdatePositionProcPtr)(void *, int x, int y)
Definition: dmxinputinit.h:139
void(* dmxVTPostSwitchProcPtr)(void *)
Definition: dmxinputinit.h:142
int maxres[DMX_MAX_AXES]
Definition: dmxinputinit.h:106
DMXFunctionType
Definition: dmxinputinit.h:54
dmxMCtrlProcPtr mCtrl
Definition: dmxinputinit.h:222
#define DMX_MAX_AXES
Definition: dmxinputinit.h:49
DMXUpdateType
Definition: dmxinput.h:56
int remote
Definition: dmxinputinit.h:172
void(* dmxMotionProcPtr)(DevicePtr, int *valuators, int firstAxis, int axesCount, DMXMotionType type, DMXBlockType block)
Definition: dmxinputinit.h:147
void(* dmxEnqueueProcPtr)(DevicePtr, int type, int detail, KeySym keySym, XEvent *e, DMXBlockType block)
Definition: dmxinputinit.h:152
Definition: dmxinputinit.h:62
dmxOnProcPtr on
Definition: dmxinputinit.h:204
void dmxLocalInitInput(DMXInputInfo *dmxInput)
dmxKBCtrlProcPtr kCtrl
Definition: dmxinputinit.h:223
int numRelAxes
Definition: dmxinputinit.h:100
XkbDescPtr xkb
Definition: dmxinputinit.h:89
int dmxInputDetach(DMXInputInfo *dmxInput)
Definition: dmxinputinit.c:1229
void dmxInputDetachAll(DMXScreenInfo *dmxScreen)
Definition: dmxinputinit.c:1254
dmxCreatePrivateProcPtr create_private
Definition: dmxinputinit.h:189
dmxGetInfoProcPtr get_info
Definition: dmxinputinit.h:203
int lastY
Definition: dmxinputinit.h:234
int mapOptimize
Definition: dmxinputinit.h:253
int * valuators
Definition: dmxinputinit.h:243
dmxVTSwitchProcPtr vt_switch
Definition: dmxinputinit.h:211
int minval[DMX_MAX_AXES]
Definition: dmxinputinit.h:102
int savedMotionEvents
Definition: dmxinputinit.h:249
int maxval[DMX_MAX_AXES]
Definition: dmxinputinit.h:103
struct _DMXLocalInputInfo DMXLocalInputInfoRec
int intFeedbackClass
Definition: dmxinputinit.h:120
int freenames
Definition: dmxinputinit.h:91
dmxInitProcPtr init
Definition: dmxinputinit.h:195
void(* dmxInitProcPtr)(DevicePtr)
Definition: dmxinputinit.h:133
Definition: dmxinputinit.h:75
DMXEventMap map[DMX_MAP_ENTRIES]
Definition: dmxinputinit.h:252
DMXBlockType
Definition: dmxinput.h:147
int freemap
Definition: dmxinputinit.h:87
void(* dmxReInitProcPtr)(DevicePtr)
Definition: dmxinputinit.h:134
PtrCtrl mctrl
Definition: dmxinputinit.h:230
int kbdFeedbackClass
Definition: dmxinputinit.h:112
void(* dmxVTSwitchReturnProcPtr)(void *)
Definition: dmxinputinit.h:143
XkbComponentNamesRec names
Definition: dmxinputinit.h:90
dmxDestroyPrivateProcPtr destroy_private
Definition: dmxinputinit.h:192
int force
Definition: dmxinputinit.h:92
int minres[DMX_MAX_AXES]
Definition: dmxinputinit.h:105
int server
Definition: dmxinputinit.h:173
dmxLateReInitProcPtr latereinit
Definition: dmxinputinit.h:199
int isCore
Definition: dmxinputinit.h:227
const char * name
Definition: dmxinputinit.h:180
Definition: dmxinputinit.h:76
dmxKBBellProcPtr kBell
Definition: dmxinputinit.h:224
int lastX
Definition: dmxinputinit.h:234

Generated on Tue Aug 18 2015 01:27:31 for Distributed Multihead X by doxygen 1.8.8