Distributed Multihead X  1.16.4
lnx-ms.c File Reference
#include "inputstr.h"
#include <X11/Xos.h>
#include <errno.h>
#include <termios.h>
#include "dmxinputinit.h"
#include "lnx-ms.h"

Data Structures

struct  _myPrivate
 

Macros

#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 msLinuxReadBytes (int fd, unsigned char *buf, int len, int min)
 
static void msLinuxButton (DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block)
 
void msLinuxRead (DevicePtr pDev, MOTIONPROC motion, ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
 
void msLinuxInit (DevicePtr pDev)
 
int msLinuxOn (DevicePtr pDev)
 
void msLinuxOff (DevicePtr pDev)
 
static void msLinuxGetMap (DevicePtr pDev, unsigned char *map, int *nButtons)
 
void msLinuxVTPreSwitch (void *p)
 
void msLinuxVTPostSwitch (void *p)
 
void * msLinuxCreatePrivate (DeviceIntPtr pMouse)
 
void msLinuxDestroyPrivate (void *priv)
 
void msLinuxGetInfo (DevicePtr pDev, DMXLocalInitInfoPtr info)
 

Detailed Description

This code implements a low-level device driver for a serial MS mouse. The code is derived from code by Juliusz Chroboczek and Keith Packard (see the source code for complete references).

Macro Definition Documentation

#define BLOCK   DMXBlockType
#define CHECKPROC   dmxCheckSpecialProcPtr
#define ENQUEUEPROC   dmxEnqueueProcPtr
#define FATAL0 (   f)    dmxLog(dmxFatal,f)
#define FATAL1 (   f,
 
)    dmxLog(dmxFatal,f,a)

Referenced by msLinuxInit(), and msLinuxOn().

#define FATAL2 (   f,
  a,
 
)    dmxLog(dmxFatal,f,a,b)
#define GETPRIV
Value:
myPrivate *priv \
= ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
struct _DMXLocalInputInfo * DMXLocalInputInfoPtr
Definition: dmxinput.h:70
Definition: dmxbackend.c:64

Referenced by msLinuxButton(), msLinuxInit(), msLinuxOff(), msLinuxOn(), and msLinuxRead().

#define LOG0 (   f)    dmxLog(dmxDebug,f)
#define LOG1 (   f,
 
)    dmxLog(dmxDebug,f,a)
#define LOG2 (   f,
  a,
 
)    dmxLog(dmxDebug,f,a,b)
#define LOG3 (   f,
  a,
  b,
 
)    dmxLog(dmxDebug,f,a,b,c)
#define MOTIONPROC   dmxMotionProcPtr
#define PRESS (   b)
Value:
do { \
enqueue(pDev, ButtonPress, 0, 0, NULL, block); \
} while (0)

Referenced by msLinuxButton().

#define RELEASE (   b)
Value:
do { \
enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \
} while (0)

Referenced by msLinuxButton().

Typedef Documentation

typedef struct _myPrivate myPrivate

Function Documentation

static void msLinuxButton ( DevicePtr  pDev,
ENQUEUEPROC  enqueue,
int  buttons,
BLOCK  block 
)
static

References GETPRIV, PRESS, and RELEASE.

Referenced by msLinuxRead().

void* msLinuxCreatePrivate ( DeviceIntPtr  pMouse)

Create a private structure for use within this file.

References _myPrivate::fd, and _myPrivate::pMouse.

void msLinuxDestroyPrivate ( void *  priv)

Destroy a private structure.

static void msLinuxGetMap ( DevicePtr  pDev,
unsigned char *  map,
int *  nButtons 
)
static

Referenced by msLinuxGetInfo().

void msLinuxInit ( DevicePtr  pDev)

Initialize pDev.

References FATAL1, GETPRIV, and O_NONBLOCK.

Referenced by msLinuxOn().

void msLinuxOff ( DevicePtr  pDev)

Turn pDev off (i.e., stop taking input from pDev).

References GETPRIV.

int msLinuxOn ( DevicePtr  pDev)

Turn pDev on (i.e., take input from pDev).

References FATAL1, GETPRIV, and msLinuxInit().

void msLinuxRead ( DevicePtr  pDev,
MOTIONPROC  motion,
ENQUEUEPROC  enqueue,
CHECKPROC  checkspecial,
BLOCK  block 
)

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 GETPRIV, msLinuxButton(), and msLinuxReadBytes().

static int msLinuxReadBytes ( int  fd,
unsigned char *  buf,
int  len,
int  min 
)
static

Referenced by msLinuxRead().

void msLinuxVTPostSwitch ( void *  p)

Currently unused hook called after returning from a VT switch.

void msLinuxVTPreSwitch ( void *  p)

Currently unused hook called prior to an VT switch.


Generated on Tue Aug 18 2015 01:27:31 for Distributed Multihead X by doxygen 1.8.8