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
00039 #ifndef _DMXCOMMON_H_
00040 #define _DMXCOMMON_H_
00041
00042 #define DMX_COMMON_OTHER \
00043 Display *display; \
00044 Window window; \
00045 DMXScreenInfo *be; \
00046 DMXLocalInputInfoPtr dmxLocal; \
00047 int initPointerX; \
00048 int initPointerY; \
00049 long eventMask; \
00050 KeybdCtrl kctrl; \
00051 PtrCtrl mctrl; \
00052 int kctrlset; \
00053 int mctrlset; \
00054 KeybdCtrl savedKctrl; \
00055 XModifierKeymap *savedModMap; \
00056 int stateSaved
00057
00058 #ifdef XKB
00059 #define DMX_COMMON_XKB \
00060 DMX_COMMON_OTHER; \
00061 XkbDescPtr xkb; \
00062 XkbIndicatorRec savedIndicators
00063 #else
00064 #define DMX_COMMON_XKB DMX_COMMON_OTHER
00065 #endif
00066
00067 #ifdef XINPUT
00068 #define DMX_COMMON_PRIVATE \
00069 DMX_COMMON_XKB; \
00070 XDevice *xi
00071 #else
00072 #define DMX_COMMON_PRIVATE DMX_COMMON_OTHER
00073 #endif
00074
00075 #define GETONLYPRIVFROMPRIVATE \
00076 myPrivate *priv = private
00077
00078 #define GETPRIVFROMPRIVATE \
00079 GETONLYPRIVFROMPRIVATE; \
00080 DMXInputInfo *dmxInput = &dmxInputs[priv->dmxLocal->inputIdx]
00081
00082 #define GETDMXLOCALFROMPDEVICE \
00083 DevicePtr pDev = &pDevice->public; \
00084 DMXLocalInputInfoPtr dmxLocal = pDev->devicePrivate
00085
00086 #define GETDMXINPUTFROMPRIV \
00087 DMXInputInfo *dmxInput = &dmxInputs[priv->dmxLocal->inputIdx]
00088
00089 #define GETDMXINPUTFROMPDEVICE \
00090 GETDMXLOCALFROMPDEVICE; \
00091 DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]
00092
00093 #define GETDMXLOCALFROMPDEV \
00094 DMXLocalInputInfoPtr dmxLocal = pDev->devicePrivate
00095
00096 #define GETDMXINPUTFROMPDEV \
00097 GETDMXLOCALFROMPDEV; \
00098 DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]
00099
00100 #define GETPRIVFROMPDEV \
00101 GETDMXLOCALFROMPDEV; \
00102 myPrivate *priv = dmxLocal->private
00103
00104 #define DMX_KEYBOARD_EVENT_MASK \
00105 (KeyPressMask | KeyReleaseMask | KeymapStateMask)
00106
00107 #define DMX_POINTER_EVENT_MASK \
00108 (ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
00109
00110 extern void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
00111 extern void dmxCommonKbdGetMap(DevicePtr pDev,
00112 KeySymsPtr pKeySyms, CARD8 *pModMap);
00113 extern void dmxCommonKbdCtrl(DevicePtr pDev, KeybdCtrl *ctrl);
00114 extern void dmxCommonKbdBell(DevicePtr pDev, int percent,
00115 int volume, int pitch, int duration);
00116 extern int dmxCommonKbdOn(DevicePtr pDev);
00117 extern void dmxCommonKbdOff(DevicePtr pDev);
00118 extern void dmxCommonMouGetMap(DevicePtr pDev,
00119 unsigned char *map, int *nButtons);
00120 extern void dmxCommonMouCtrl(DevicePtr pDev, PtrCtrl *ctrl);
00121 extern int dmxCommonMouOn(DevicePtr pDev);
00122 extern void dmxCommonMouOff(DevicePtr pDev);
00123 extern int dmxFindPointerScreen(int x, int y);
00124
00125 extern int dmxCommonOthOn(DevicePtr pDev);
00126 extern void dmxCommonOthOff(DevicePtr pDev);
00127 extern void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
00128
00129
00130 extern pointer dmxCommonCopyPrivate(DeviceIntPtr pDevice);
00131 extern void dmxCommonSaveState(pointer private);
00132 extern void dmxCommonRestoreState(pointer private);
00133 #endif