00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00038 #ifndef _DMXINPUTINIT_H_
00039 #define _DMXINPUTINIT_H_
00040
00041 #include "dmx.h"
00042 #include "dmxinput.h"
00043 #include "dmxlog.h"
00044
00045
00046 #define DMX_LOCAL_DEFAULT_KEYBOARD "kbd"
00047 #define DMX_LOCAL_DEFAULT_POINTER "ps2"
00048 #define DMX_MAX_BUTTONS 256
00049 #define DMX_MOTION_SIZE 256
00050 #define DMX_MAX_VALUATORS 32
00051 #define DMX_MAX_AXES 32
00052 #define DMX_MAX_XINPUT_EVENT_TYPES 100
00053 #define DMX_MAP_ENTRIES 16
00054 #define DMX_MAP_MASK (DMX_MAP_ENTRIES - 1)
00055
00056 typedef enum {
00057 DMX_FUNCTION_GRAB,
00058 DMX_FUNCTION_TERMINATE,
00059 DMX_FUNCTION_FINE
00060 } DMXFunctionType;
00061
00062 typedef enum {
00063 DMX_LOCAL_HIGHLEVEL,
00064 DMX_LOCAL_KEYBOARD,
00065 DMX_LOCAL_MOUSE,
00066 DMX_LOCAL_OTHER
00067 } DMXLocalInputType;
00068
00069 typedef enum {
00070 DMX_LOCAL_TYPE_LOCAL,
00071 DMX_LOCAL_TYPE_CONSOLE,
00072 DMX_LOCAL_TYPE_BACKEND,
00073 DMX_LOCAL_TYPE_COMMON
00074 } DMXLocalInputExtType;
00075
00076 typedef enum {
00077 DMX_RELATIVE,
00078 DMX_ABSOLUTE,
00079 DMX_ABSOLUTE_CONFINED
00080 } DMXMotionType;
00081
00084 typedef struct _DMXLocalInitInfo {
00085 int keyboard;
00087 int keyClass;
00088 KeySymsRec keySyms;
00089 int freemap;
00090 CARD8 modMap[MAP_LENGTH];
00091 #ifdef XKB
00092 XkbDescPtr xkb;
00093 XkbComponentNamesRec names;
00094 int freenames;
00095 int force;
00096 #endif
00097
00098 int buttonClass;
00099 int numButtons;
00100 unsigned char map[DMX_MAX_BUTTONS];
00102 int valuatorClass;
00104 int numRelAxes;
00105 int numAbsAxes;
00106 int minval[DMX_MAX_AXES];
00107 int maxval[DMX_MAX_AXES];
00108 int res[DMX_MAX_AXES];
00109 int minres[DMX_MAX_AXES];
00110 int maxres[DMX_MAX_AXES];
00112 int focusClass;
00114 int proximityClass;
00116 int kbdFeedbackClass;
00118 int ptrFeedbackClass;
00120 int ledFeedbackClass;
00122 int belFeedbackClass;
00124 int intFeedbackClass;
00126 int strFeedbackClass;
00129 int maxSymbols;
00130 int maxSymbolsSupported;
00131 KeySym *symbols;
00132 } DMXLocalInitInfo, *DMXLocalInitInfoPtr;
00133
00134 typedef pointer (*dmxCreatePrivateProcPtr)(DeviceIntPtr);
00135 typedef void (*dmxDestroyPrivateProcPtr)(pointer);
00136
00137 typedef void (*dmxInitProcPtr)(DevicePtr);
00138 typedef void (*dmxReInitProcPtr)(DevicePtr);
00139 typedef void (*dmxLateReInitProcPtr)(DevicePtr);
00140 typedef void (*dmxGetInfoProcPtr)(DevicePtr, DMXLocalInitInfoPtr);
00141 typedef int (*dmxOnProcPtr)(DevicePtr);
00142 typedef void (*dmxOffProcPtr)(DevicePtr);
00143 typedef void (*dmxUpdatePositionProcPtr)(pointer, int x, int y);
00144
00145 typedef void (*dmxVTPreSwitchProcPtr)(pointer);
00146 typedef void (*dmxVTPostSwitchProcPtr)(pointer);
00147 typedef void (*dmxVTSwitchReturnProcPtr)(pointer);
00148 typedef int (*dmxVTSwitchProcPtr)(pointer, int vt,
00149 dmxVTSwitchReturnProcPtr, pointer);
00150
00151 typedef void (*dmxMotionProcPtr)(DevicePtr,
00152 int *valuators,
00153 int firstAxis,
00154 int axesCount,
00155 DMXMotionType type,
00156 DMXBlockType block);
00157 typedef void (*dmxEnqueueProcPtr)(DevicePtr, int type, int detail,
00158 KeySym keySym, XEvent *e,
00159 DMXBlockType block);
00160 typedef int (*dmxCheckSpecialProcPtr)(DevicePtr, KeySym keySym);
00161 typedef void (*dmxCollectEventsProcPtr)(DevicePtr,
00162 dmxMotionProcPtr,
00163 dmxEnqueueProcPtr,
00164 dmxCheckSpecialProcPtr,
00165 DMXBlockType);
00166 typedef void (*dmxProcessInputProcPtr)(pointer);
00167 typedef void (*dmxUpdateInfoProcPtr)(pointer, DMXUpdateType, WindowPtr);
00168 typedef int (*dmxFunctionsProcPtr)(pointer, DMXFunctionType);
00169
00170 typedef void (*dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl);
00171 typedef void (*dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl);
00172 typedef void (*dmxKBBellProcPtr)(DevicePtr, int percent,
00173 int volume, int pitch, int duration);
00174
00177 typedef struct _DMXEventMap {
00178 int remote;
00179 int server;
00180 } DMXEventMap;
00181
00185 typedef struct _DMXLocalInputInfo {
00186 const char *name;
00187 DMXLocalInputType type;
00188 DMXLocalInputExtType extType;
00189 int binding;
00193
00194
00195 dmxCreatePrivateProcPtr create_private;
00198 dmxDestroyPrivateProcPtr destroy_private;
00201 dmxInitProcPtr init;
00202 dmxReInitProcPtr reinit;
00205 dmxLateReInitProcPtr latereinit;
00209 dmxGetInfoProcPtr get_info;
00210 dmxOnProcPtr on;
00211 dmxOffProcPtr off;
00212 dmxUpdatePositionProcPtr update_position;
00215 dmxVTPreSwitchProcPtr vt_pre_switch;
00216 dmxVTPostSwitchProcPtr vt_post_switch;
00217 dmxVTSwitchProcPtr vt_switch;
00219 dmxCollectEventsProcPtr collect_events;
00222 dmxProcessInputProcPtr process_input;
00224 dmxFunctionsProcPtr functions;
00225 dmxUpdateInfoProcPtr update_info;
00228 dmxMCtrlProcPtr mCtrl;
00229 dmxKBCtrlProcPtr kCtrl;
00230 dmxKBBellProcPtr kBell;
00232 pointer private;
00233 int isCore;
00234 int sendsCore;
00235 KeybdCtrl kctrl;
00236 PtrCtrl mctrl;
00238 DeviceIntPtr pDevice;
00239 int inputIdx;
00240 int lastX, lastY;
00244 int head;
00246 int tail;
00248 unsigned long *history;
00249 int *valuators;
00251
00252 int (*savedMotionProc)(DeviceIntPtr,
00253 xTimecoord *,
00254 unsigned long,
00255 unsigned long,
00256 ScreenPtr);
00257 int savedMotionEvents;
00258 int savedSendsCore;
00260 DMXEventMap map[DMX_MAP_ENTRIES];
00261 int mapOptimize;
00265 long deviceId;
00267 const char *deviceName;
00269 } DMXLocalInputInfoRec;
00270
00271 extern DMXLocalInputInfoPtr dmxLocalCorePointer, dmxLocalCoreKeyboard;
00272
00273 extern void dmxLocalInitInput(DMXInputInfo *dmxInput);
00274 extern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
00275 DMXLocalInputInfoPtr s);
00276
00277 extern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl);
00278 extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl);
00279 extern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
00280 pointer ctrl, int unknown);
00281
00282 extern int dmxInputExtensionErrorHandler(Display *dsp, char *name,
00283 char *reason);
00284
00285 extern int dmxInputDetach(DMXInputInfo *dmxInput);
00286 extern void dmxInputDetachAll(DMXScreenInfo *dmxScreen);
00287 extern int dmxInputDetachId(int id);
00288 extern DMXInputInfo *dmxInputLocateId(int id);
00289 extern int dmxInputAttachConsole(const char *name, int isCore,
00290 int *id);
00291 extern int dmxInputAttachBackend(int physicalScreen, int isCore,
00292 int *id);
00293
00294 #endif