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.29; author mrg; state dead; branches; next 1.1; commitid FQxwnZNPy5ZgOOhz; 1.1 date 2008.07.31.19.50.31; author mrg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.07.31.19.50.31; author mrg; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2010.11.23.05.21.22; author mrg; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2011.08.02.06.56.52; author mrg; state Exp; branches; next ; desc @@ 1.2 log @first merge of netbsd changes. not tested yet. @ text @
#include "inputstr.h"#include "Xos.h"#include <errno.h>#include <termios.h>#include "dmxinputinit.h"#include "lnx-ps2.h"Data Structures | |
| struct | _myPrivate |
Functions | |
| void | ps2LinuxRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) |
| void | ps2LinuxInit (DevicePtr pDev) |
| int | ps2LinuxOn (DevicePtr pDev) |
| void | ps2LinuxOff (DevicePtr pDev) |
| void | ps2LinuxVTPreSwitch (pointer p) |
| void | ps2LinuxVTPostSwitch (pointer p) |
| pointer | ps2LinuxCreatePrivate (DeviceIntPtr pMouse) |
| void | ps2LinuxDestroyPrivate (pointer priv) |
| void | ps2LinuxGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info) |
|
|
Create a private structure for use within this file. |
|
|
Destroy a private structure. |
|
||||||||||||
|
Fill the info structure with information needed to initialize pDev. |
|
|
Initialize pDev. |
|
|
Turn pDev off (i.e., stop taking input from pDev). |
|
|
Turn pDev on (i.e., take input from pDev). |
|
||||||||||||||||||||||||
|
Read an event from the pDev device. If the event is a motion event, enqueue it with the motion function. Otherwise, check for special keys with the checkspecial function and enqueue the event with the enqueue function. The block type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function. |
|
|
Currently unused hook called after returning from a VT switch. |
|
|
Currently unused hook called prior to an VT switch. |
#include "inputstr.h"#include <X11/Xos.h>#include <errno.h>#include <termios.h>#include "dmxinputinit.h"#include "lnx-ps2.h"Data Structures | |
| struct | _myPrivate |
Defines | |
| #define | GETPRIV |
| #define | LOG0(f) dmxLog(dmxDebug,f) |
| #define | LOG1(f, a) dmxLog(dmxDebug,f,a) |
| #define | LOG2(f, a, b) dmxLog(dmxDebug,f,a,b) |
| #define | LOG3(f, a, b, c) dmxLog(dmxDebug,f,a,b,c) |
| #define | FATAL0(f) dmxLog(dmxFatal,f) |
| #define | FATAL1(f, a) dmxLog(dmxFatal,f,a) |
| #define | FATAL2(f, a, b) dmxLog(dmxFatal,f,a,b) |
| #define | MOTIONPROC dmxMotionProcPtr |
| #define | ENQUEUEPROC dmxEnqueueProcPtr |
| #define | CHECKPROC dmxCheckSpecialProcPtr |
| #define | BLOCK DMXBlockType |
| #define | PRESS(b) |
| #define | RELEASE(b) |
Typedefs | |
| typedef struct _myPrivate | myPrivate |
Functions | |
| static int | ps2LinuxReadBytes (int fd, unsigned char *buf, int len, int min) |
| static void | ps2LinuxButton (DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block) |
| void | ps2LinuxRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block) |
| void | ps2LinuxInit (DevicePtr pDev) |
| int | ps2LinuxOn (DevicePtr pDev) |
| void | ps2LinuxOff (DevicePtr pDev) |
| static void | ps2LinuxGetMap (DevicePtr pDev, unsigned char *map, int *nButtons) |
| void | ps2LinuxVTPreSwitch (pointer p) |
| void | ps2LinuxVTPostSwitch (pointer p) |
| pointer | ps2LinuxCreatePrivate (DeviceIntPtr pMouse) |
| void | ps2LinuxDestroyPrivate (pointer priv) |
| void | ps2LinuxGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info) |
This code implements a low-level device driver for a serial MS mouse. The code is derived from code by Keith Packard (see the source code for complete references).
| #define BLOCK DMXBlockType |
| #define CHECKPROC dmxCheckSpecialProcPtr |
| #define ENQUEUEPROC dmxEnqueueProcPtr |
| #define FATAL0 | ( | f | ) | dmxLog(dmxFatal,f) |
| #define FATAL1 | ( | f, | ||
| a | ||||
| ) | dmxLog(dmxFatal,f,a) |
Referenced by ps2LinuxInit().
d35 1 a35 32| #define FATAL2 | ( | f, | ||
| a, | ||||
| b | ||||
| ) | dmxLog(dmxFatal,f,a,b) |
| #define GETPRIV |
myPrivate *priv \ = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
| #define LOG0 | ( | f | ) | dmxLog(dmxDebug,f) |
| #define LOG1 | ( | f, | ||
| a | ||||
| ) | dmxLog(dmxDebug,f,a) |
| #define LOG2 | ( | f, | a56 20||
| a, | ||||
| b | ||||
| ) | dmxLog(dmxDebug,f,a,b) |
| #define LOG3 | ( | f, | ||||||||||||||||||||||||||||||||||||||||||||||||
| a, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| b, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | dmxLog(dmxDebug,f,a,b,c) |
| #define MOTIONPROC dmxMotionProcPtr | a85 3
| #define PRESS | ( | b | ) |
| #define RELEASE | ( | b | ) |
do { \ enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \ } while (0)
| typedef struct _myPrivate myPrivate |
| static void ps2LinuxButton | ( | DevicePtr | pDev, | a113 1a114 11 | ENQUEUEPROC | enqueue, | |
| int | buttons, | ||||||
| d116 2 a117 2 | BLOCK | block | d121 2 a122 2 | ) | [static] |
a123 7
References PRESS, and RELEASE.
Referenced by ps2LinuxRead().
a124 14| pointer ps2LinuxCreatePrivate | ( | DeviceIntPtr | pMouse | ) |
| void ps2LinuxDestroyPrivate | ( | pointer | priv | ) | a152 4 |
Destroy a private structure.
a153 23| void ps2LinuxGetInfo | ( | DevicePtr | pDev, | |||||||||||||||||||||||||||||||||||||||||||||||
| DMXLocalInitInfoPtr | info | |||||||||||||||||||||||||||||||||||||||||||||||||
| ) |
| static void ps2LinuxGetMap | ( | DevicePtr | pDev, | |
| unsigned char * | map, | |||
| int * | nButtons | |||
| ) | [static] |
a181 5
Referenced by ps2LinuxGetInfo().
a182 14| void ps2LinuxInit | ( | DevicePtr | pDev | ) |
| void ps2LinuxOff | ( | DevicePtr | pDev | ) | d211 1 d213 19 a231 31 |
| int ps2LinuxOn | ( | DevicePtr | pDev | ) |
Turn pDev on (i.e., take input from pDev).
References ps2LinuxInit().
| void ps2LinuxRead | ( | DevicePtr | pDev, | a238 1a239 5 | MOTIONPROC | motion, | |
| d241 2 a242 2 | ENQUEUEPROC | enqueue, | a244 1a245 5 | CHECKPROC | checkspecial, | ||
| d247 2 a248 2 | BLOCK | block | a251 24 | ) |
Read an event from the pDev device. If the event is a motion event, enqueue it with the motion function. Otherwise, check for special keys with the checkspecial function and enqueue the event with the enqueue function. The block type is passed to the functions so that they may block SIGIO handling as appropriate to the caller of this function.
References ps2LinuxButton(), and ps2LinuxReadBytes().
| static int ps2LinuxReadBytes | ( | int | fd, | ||||
| d253 2 a254 2 | unsigned char * | buf, | a256 1a257 5 | int | len, | ||
| d259 2 a260 2 | int | min | d264 2 a265 2 | ) | [static] |
d267 1
d269 27
a295 4