Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

# dmxcommon.h

Go to the documentation of this file.

    00001 /* $XFree86$ */
    00002 /*
    00003  * Copyright 2002,2003 Red Hat Inc., Durham, North Carolina.
    00004  *
    00005  * All Rights Reserved.
    00006  *
    00007  * Permission is hereby granted, free of charge, to any person obtaining
    00008  * a copy of this software and associated documentation files (the
    00009  * "Software"), to deal in the Software without restriction, including
    00010  * without limitation on the rights to use, copy, modify, merge,
    00011  * publish, distribute, sublicense, and/or sell copies of the Software,
    00012  * and to permit persons to whom the Software is furnished to do so,
    00013  * subject to the following conditions:
    00014  *
    00015  * The above copyright notice and this permission notice (including the
    00016  * next paragraph) shall be included in all copies or substantial
    00017  * portions of the Software.
    00018  *
    00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00020  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00021  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    00022  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
    00023  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
    00024  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    00025  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    00026  * SOFTWARE.
    00027  */
    00028
    00029 /*
    00030  * Authors:
    00031  *   Rickard E. (Rik) Faith <faith@redhat.com>
    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                                 /* helper functions */
    00130 extern pointer dmxCommonCopyPrivate(DeviceIntPtr pDevice);
    00131 extern void    dmxCommonSaveState(pointer private);
    00132 extern void    dmxCommonRestoreState(pointer private);
    00133 #endif