head 1.2; access; symbols netbsd-7-2-RELEASE:1.1.1.3 netbsd-7-1-2-RELEASE:1.1.1.3 netbsd-7-1-1-RELEASE:1.1.1.3 netbsd-7-1:1.1.1.3.0.14 netbsd-7-1-RELEASE:1.1.1.3 netbsd-7-1-RC2:1.1.1.3 netbsd-7-1-RC1:1.1.1.3 netbsd-7-0-2-RELEASE:1.1.1.3 netbsd-7-0-1-RELEASE:1.1.1.3 netbsd-7-0:1.1.1.3.0.12 netbsd-7-0-RELEASE:1.1.1.3 netbsd-7-0-RC3:1.1.1.3 netbsd-7-0-RC2:1.1.1.3 netbsd-7-0-RC1:1.1.1.3 netbsd-5-2-3-RELEASE:1.1.1.1 netbsd-5-1-5-RELEASE:1.1.1.1 netbsd-6-0-6-RELEASE:1.1.1.3 netbsd-6-1-5-RELEASE:1.1.1.3 netbsd-7:1.1.1.3.0.10 netbsd-7-base:1.1.1.3 netbsd-6-1-4-RELEASE:1.1.1.3 netbsd-6-0-5-RELEASE:1.1.1.3 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.3 riastradh-drm2:1.1.1.3.0.8 riastradh-drm2-base:1.1.1.3 netbsd-6-1-3-RELEASE:1.1.1.3 netbsd-6-0-4-RELEASE:1.1.1.3 netbsd-5-2-2-RELEASE:1.1.1.1 netbsd-5-1-4-RELEASE:1.1.1.1 netbsd-6-1-2-RELEASE:1.1.1.3 netbsd-6-0-3-RELEASE:1.1.1.3 netbsd-5-2-1-RELEASE:1.1.1.1 netbsd-5-1-3-RELEASE:1.1.1.1 netbsd-6-1-1-RELEASE:1.1.1.3 xorg-server-1-10-6:1.1.1.3 netbsd-6-1:1.1.1.3.0.6 netbsd-6-0-2-RELEASE:1.1.1.3 netbsd-6-1-RELEASE:1.1.1.3 netbsd-6-1-RC4:1.1.1.3 netbsd-6-1-RC3:1.1.1.3 netbsd-6-1-RC2:1.1.1.3 netbsd-6-1-RC1:1.1.1.3 netbsd-5-2:1.1.1.1.0.8 netbsd-6-0-1-RELEASE:1.1.1.3 netbsd-5-2-RELEASE:1.1.1.1 netbsd-5-2-RC1:1.1.1.1 netbsd-6-0:1.1.1.3.0.4 netbsd-6-0-RELEASE:1.1.1.3 netbsd-6-0-RC2:1.1.1.3 netbsd-6-0-RC1:1.1.1.3 netbsd-6:1.1.1.3.0.2 netbsd-6-base:1.1.1.3 netbsd-5-1-2-RELEASE:1.1.1.1 netbsd-5-1-1-RELEASE:1.1.1.1 xorg-server-1-10-3:1.1.1.3 mrg-xorg-server-1-9-5-pre-1-10-3:1.1.1.2 xorg-server-1-9-5:1.1.1.2 xorg-server-1-9-2:1.1.1.2 netbsd-5-1:1.1.1.1.0.6 netbsd-5-1-RELEASE:1.1.1.1 netbsd-5-1-RC4:1.1.1.1 netbsd-5-1-RC3:1.1.1.1 netbsd-5-1-RC2:1.1.1.1 netbsd-5-1-RC1:1.1.1.1 netbsd-5-0-2-RELEASE:1.1.1.1 xorg-server-1-6-5:1.1.1.1 xorg-server-1-6-3:1.1.1.1 netbsd-5-0-1-RELEASE:1.1.1.1 xorg-server-1-6-2:1.1.1.1 xorg-server-1-6-1-901:1.1.1.1 netbsd-5-0:1.1.1.1.0.4 netbsd-5-0-RELEASE:1.1.1.1 netbsd-5-0-RC4:1.1.1.1 netbsd-5-0-RC3:1.1.1.1 netbsd-5-0-RC2:1.1.1.1 netbsd-5-0-RC1:1.1.1.1 netbsd-5:1.1.1.1.0.2 netbsd-5-base:1.1.1.1 xorg-server-1-4-2:1.1.1.1 xorg:1.1.1; locks; strict; comment @# @; 1.2 date 2016.08.11.00.04.28; author mrg; state dead; branches; next 1.1; commitid FQxwnZNPy5ZgOOhz; 1.1 date 2008.07.31.19.50.27; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.07.31.19.50.27; author mrg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2010.11.23.05.21.14; author mrg; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2011.08.02.06.56.49; author mrg; state Exp; branches; next ; desc @@ 1.2 log @first merge of netbsd changes. not tested yet. @ text @
#include "dmxinputinit.h"#include "dmxcommon.h"#include "dmxconsole.h"#include "dmxprop.h"#include "dmxsync.h"#include "dmxmap.h"#include "inputstr.h"#include "input.h"#include "keysym.h"#include "mipointer.h"#include "scrnintstr.h"#include <unistd.h>Data Structures | |
| struct | _myPrivate |
Typedefs | |
| typedef _myPrivate | myPrivate |
Functions | |
| void | dmxCommonKbdCtrl (DevicePtr pDev, KeybdCtrl *ctrl) |
| void | dmxCommonMouCtrl (DevicePtr pDev, PtrCtrl *ctrl) |
| void | dmxCommonKbdBell (DevicePtr pDev, int percent, int volume, int pitch, int duration) |
| void | dmxCommonKbdGetMap (DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) |
| void | dmxCommonKbdGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info) |
| int | dmxCommonKbdOn (DevicePtr pDev) |
| void | dmxCommonKbdOff (DevicePtr pDev) |
| int | dmxCommonOthOn (DevicePtr pDev) |
| void | dmxCommonOthOff (DevicePtr pDev) |
| void | dmxCommonOthGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info) |
| void | dmxCommonMouGetMap (DevicePtr pDev, unsigned char *map, int *nButtons) |
| int | dmxCommonMouOn (DevicePtr pDev) |
| void | dmxCommonMouOff (DevicePtr pDev) |
| int | dmxFindPointerScreen (int x, int y) |
| pointer | dmxCommonCopyPrivate (DeviceIntPtr pDevice) |
| void | dmxCommonSaveState (pointer private) |
| void | dmxCommonRestoreState (pointer private) |
|
|
Each device has a private area that is visible only from inside the driver code. |
|
|
Returns a pointer to the private area for the device that comes just prior to pDevice in the current dmxInput device list. This is used as the private area for the current device in some situations (e.g., when a keyboard and mouse form a pair that should share the same private area). If the requested private area cannot be located, then NULL is returned. |
|
||||||||||||||||||||||||
|
Sound they keyboard bell. |
|
||||||||||||
|
Update the keyboard control. |
|
||||||||||||
|
Fill in the XKEYBOARD parts of the info structure for the specified pDev. |
|
||||||||||||||||
|
Get the keyboard mapping. |
|
|
Turn pDev off. |
|
|
Turn pDev on (i.e., take input from pDev). |
|
||||||||||||
|
Update the mouse control. |
|
||||||||||||||||
|
Obtain the mouse button mapping. |
|
|
Turn pDev off. |
|
|
Turn pDev on (i.e., take input from pDev). |
|
||||||||||||
|
Fill the info structure with information needed to initialize pDev. |
|
|
Turn pDev off. |
|
|
Turn pDev on (i.e., take input from pDev). |
|
|
This routine restores all the information saved by dmxCommonSaveState. |
|
|
This routine saves and resets some important state for the backend and console device drivers:
This routine and dmxCommonRestoreState are used when the pointer enters and leaves the console window, or when the backend window is active or not active (for a full-screen window, this only happens at server startup and server shutdown). |
|
||||||||||||
|
Given the global coordinates x and y, determine the screen with the lowest number on which those coordinates lie. If they are not on any screen, return -1. The number returned is an index into #dmxScreenInfo and is between -1 and dmxNumScreens - 1, inclusive. |
#include "dmxinputinit.h"#include "dmxcommon.h"#include "dmxconsole.h"#include "dmxprop.h"#include "dmxsync.h"#include "dmxmap.h"#include "inputstr.h"#include "input.h"#include <X11/keysym.h>#include "mipointer.h"#include "scrnintstr.h"#include <unistd.h>Data Structures | |
| struct | _myPrivate |
Defines | |
| #define | DMX_STATE_DEBUG 0 |
| #define | DMXDBG0(f) |
| #define | NAME(x) priv->xkb->names->x ? XGetAtomName(priv->display,priv->xkb->names->x) : NULL |
| #define | ADD(type) |
Typedefs | |
| typedef struct _myPrivate | myPrivate |
Functions | |
| static void | dmxCommonKbdSetAR (Display *display, unsigned char *old, unsigned char *new) |
| static void | dmxCommonKbdSetLeds (Display *display, unsigned long new) |
| static void | dmxCommonKbdSetCtrl (Display *display, KeybdCtrl *old, KeybdCtrl *new) |
| static void | dmxCommonMouSetCtrl (Display *display, PtrCtrl *old, PtrCtrl *new) |
| void | dmxCommonKbdCtrl (DevicePtr pDev, KeybdCtrl *ctrl) |
| void | dmxCommonMouCtrl (DevicePtr pDev, PtrCtrl *ctrl) |
| void | dmxCommonKbdBell (DevicePtr pDev, int percent, int volume, int pitch, int duration) |
| void | dmxCommonKbdGetMap (DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap) |
| void | dmxCommonKbdGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info) |
| int | dmxCommonKbdOn (DevicePtr pDev) |
| void | dmxCommonKbdOff (DevicePtr pDev) |
| int | dmxCommonOthOn (DevicePtr pDev) |
| void | dmxCommonOthOff (DevicePtr pDev) |
| void | dmxCommonOthGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info) |
| void | dmxCommonMouGetMap (DevicePtr pDev, unsigned char *map, int *nButtons) |
| static void * | dmxCommonXSelect (DMXScreenInfo *dmxScreen, void *closure) |
| static void * | dmxCommonAddEnabledDevice (DMXScreenInfo *dmxScreen, void *closure) |
| static void * | dmxCommonRemoveEnabledDevice (DMXScreenInfo *dmxScreen, void *closure) |
| int | dmxCommonMouOn (DevicePtr pDev) |
| void | dmxCommonMouOff (DevicePtr pDev) |
| int | dmxFindPointerScreen (int x, int y) |
| pointer | dmxCommonCopyPrivate (DeviceIntPtr pDevice) |
| void | dmxCommonSaveState (pointer private) |
| void | dmxCommonRestoreState (pointer private) |
This file implements common routines used by the backend and console input devices.
| #define ADD | ( | type | ) |
if (count < DMX_MAX_XINPUT_EVENT_TYPES) { \ type(priv->xi, event_type[count], event_list[count]); \ if (event_type[count]) { \ dmxMapInsert(dmxLocal, event_type[count], XI_##type); \ ++count; \ } \ } else { \ dmxLog(dmxWarning, "More than %d event types for %s\n", \ DMX_MAX_XINPUT_EVENT_TYPES, dmxInput->name); \ }
Referenced by dmxCommonOthOn().
d48 1 a48 12| #define DMX_STATE_DEBUG 0 |
| #define DMXDBG0 | ( | f | ) |
Referenced by dmxCommonRestoreState(), and dmxCommonSaveState().
d54 1 a54 17| #define NAME | ( | x | ) | priv->xkb->names->x ? XGetAtomName(priv->display,priv->xkb->names->x) : NULL |
Referenced by dmxCommonKbdGetInfo().
d58 1 a58 14| typedef struct _myPrivate myPrivate |
Each device has a private area that is visible only from inside the driver code.
d60 1 a60 27| static void* dmxCommonAddEnabledDevice | ( | DMXScreenInfo * | dmxScreen, | |
| void * | closure | |||
| ) | [static] |
References _DMXScreenInfo::beDisplay.
d64 1 a64 1Referenced by dmxCommonMouOn().
d66 8 a73 6| pointer dmxCommonCopyPrivate | ( | DeviceIntPtr | pDevice | ) | d105 1 d107 19 a125 12 |
| void dmxCommonKbdBell | ( | DevicePtr | pDev, | a132 1a133 5 | int | percent, | |
| d135 2 a136 2 | int | volume, | a138 1a139 5 | int | pitch, | ||
| d141 2 a142 2 | int | duration | a145 22 | ) |
Sound they keyboard bell.
| void dmxCommonKbdCtrl | ( | DevicePtr | pDev, | ||||
| d147 2 a148 2 | KeybdCtrl * | ctrl | a151 24 | ) |
Update the keyboard control.
References dmxCommonKbdSetCtrl(), and dmxCommonSaveState().
| void dmxCommonKbdGetInfo | ( | DevicePtr | pDev, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| d153 2 a154 2 | DMXLocalInitInfoPtr | info | d158 2 a159 2 | ) | d161 1 d163 19 a181 14 |
| void dmxCommonKbdGetMap | ( | DevicePtr | pDev, | a188 1a189 5 | KeySymsPtr | pKeySyms, | |
| d191 2 a192 2 | CARD8 * | pModMap | d196 2 a197 2 | ) | a198 4 |
Get the keyboard mapping.
a199 16Referenced by dmxBackendKbdGetInfo(), and dmxConsoleKbdGetInfo().
| void dmxCommonKbdOff | ( | DevicePtr | pDev | ) |
| int dmxCommonKbdOn | ( | DevicePtr | pDev | ) | a225 13 |
Turn pDev on (i.e., take input from pDev).
References dmxCommonSaveState().
| static void dmxCommonKbdSetAR | ( | Display * | display, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| a227 5 | unsigned char * | old, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| d229 2 a230 2 | unsigned char * | new | d234 2 a235 2 | ) | [static] |
d237 1
d239 19
a257 11
| static void dmxCommonKbdSetCtrl | ( | Display * | display, | a264 1d266 3 a268 2 | KeybdCtrl * | old, | a270 1d272 3 a274 2 | KeybdCtrl * | new | d278 2 a279 2 | ) | [static] |
d281 1
d283 27
a309 2
| static void dmxCommonKbdSetLeds | ( | Display * | display, | a366 1d368 3 a370 2 | unsigned long | new | d374 2 a375 2 | ) | [static] |
d377 1
d379 19
a397 11
| void dmxCommonMouCtrl | ( | DevicePtr | pDev, | a404 1a405 4 | PtrCtrl * | ctrl |
| ) | a409 13 |
Update the mouse control.
References dmxCommonMouSetCtrl().
| void dmxCommonMouGetMap | ( | DevicePtr | pDev, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| a411 5 | unsigned char * | map, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| d413 2 a414 2 | int * | nButtons | d418 2 a419 2 | ) | d421 1 d423 27 a449 3 |
| void dmxCommonMouOff | ( | DevicePtr | pDev | ) | a478 4 |
Turn pDev off.
a479 16References dmxCommonRemoveEnabledDevice(), dmxCommonXSelect(), and dmxPropertyIterate().
| int dmxCommonMouOn | ( | DevicePtr | pDev | ) |
| static void dmxCommonMouSetCtrl | ( | Display * | display, | a506 1a507 5 | PtrCtrl * | old, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| d509 2 a510 2 | PtrCtrl * | new | d514 2 a515 2 | ) | [static] |
d517 1
d519 27
a545 2
| void dmxCommonOthGetInfo | ( | DevicePtr | pDev, | a574 15|
| DMXLocalInitInfoPtr | info | |||
| ) |
Fill the info structure with information needed to initialize pDev.
a575 16References _DMXLocalInitInfo::buttonClass, display, dmxInputExtensionErrorHandler(), _DMXLocalInitInfo::focusClass, _DMXLocalInitInfo::kbdFeedbackClass, _DMXLocalInitInfo::keyboard, _DMXLocalInitInfo::keyClass, _DMXLocalInitInfo::keySyms, _DMXLocalInitInfo::maxres, _DMXLocalInitInfo::maxval, _DMXLocalInitInfo::minres, _DMXLocalInitInfo::minval, _DMXLocalInitInfo::numAbsAxes, _DMXLocalInitInfo::numButtons, _DMXLocalInitInfo::numRelAxes, _DMXLocalInitInfo::proximityClass, _DMXLocalInitInfo::ptrFeedbackClass, _DMXLocalInitInfo::res, and _DMXLocalInitInfo::valuatorClass.
| void dmxCommonOthOff | ( | DevicePtr | pDev | ) |
| int dmxCommonOthOn | ( | DevicePtr | pDev | ) | a603 6 |
Turn pDev on (i.e., take input from pDev).
References ADD, ChangeDeviceNotify, DeviceFocusIn, DeviceFocusOut, DeviceMappingNotify, DeviceMotionNotify, DeviceStateNotify, dmxLog(), dmxWarning, ProximityIn, and ProximityOut.
a604 23| static void* dmxCommonRemoveEnabledDevice | ( | DMXScreenInfo * | dmxScreen, | ||
| void * | closure | ||||
| ) | [static] |
| void dmxCommonRestoreState | ( | pointer | private | ) | a632 4 |
This routine restores all the information saved by dmxCommonSaveState.
a633 18References dmxCommonKbdSetCtrl(), DMXDBG0, dmxLog(), dmxLogInput(), and dmxWarning.
Referenced by dmxBackendCollectEvents(), dmxCloseConsole(), dmxCommonKbdGetInfo(), dmxCommonKbdOff(), and dmxConsoleCollectEvents().
| void dmxCommonSaveState | ( | pointer | private | ) |
| static void* dmxCommonXSelect | ( | DMXScreenInfo * | dmxScreen, | a663 1d665 3 a667 2 | void * | closure | d671 2 a672 2 | ) | [static] |
a673 5
References _DMXScreenInfo::beDisplay, and _DMXScreenInfo::scrnWin.
a674 25Referenced by dmxCommonMouOff(), and dmxCommonMouOn().
| int dmxFindPointerScreen | ( | int | x, | |
| int | y | |||
| ) |