[next] [prev] [prev-tail] [tail] [up]

### 6.2 Constants, types and variables

#### constants

The following constants are used to denote filenames used by the library:

     _PATH_VARRUN = '/var/run/';
     _PATH_DEV    = '/dev/';
     GPM_NODE_DIR = _PATH_VARRUN;
     GPM_NODE_DIR_MODE = 0775;
     GPM_NODE_PID  = '/var/run/gpm.pid';
     GPM_NODE_DEV  = '/dev/gpmctl';
     GPM_NODE_CTL  = GPM_NODE_DEV;
     GPM_NODE_FIFO = '/dev/gpmdata';

The following constants denote the buttons on the mouse:

     GPM_B_LEFT   = 4;
     GPM_B_MIDDLE = 2;
     GPM_B_RIGHT  = 1;

The following constants define events:

     GPM_MOVE = 1;
     GPM_DRAG = 2;
     GPM_DOWN = 4;
     GPM_UP = 8;
     GPM_SINGLE = 16;
     GPM_DOUBLE = 32;
     GPM_TRIPLE = 64;
     GPM_MFLAG = 128;
     GPM_HARD = 256;
     GPM_ENTER = 512;
     GPM_LEAVE = 1024;

The following constants are used in defining margins:

     GPM_TOP = 1;
     GPM_BOT = 2;
     GPM_LFT = 4;
     GPM_RGT = 8;

#### Types

The following general types are defined:

       TGpmEtype = longint;
       TGpmMargin = longint;

The following type describes an event; it is passed in many of the gpm functions.

     PGpmEvent = ^TGpmEvent;
     TGpmEvent = record
       buttons : byte;
       modifiers : byte;
       vc : word;
       dx : word;
       dy : word;
       x : word;
       y : word;
       EventType : TGpmEType;
       clicks : longint;
       margin : TGpmMargin;
     end;
     TGpmHandler=function(var event:TGpmEvent;clientdata:pointer):longint;cdecl;

The following types are used in connecting to the gpm server:

     PGpmConnect = ^TGpmConnect;
     TGpmConnect = record
       eventMask : word;
       defaultMask : word;
       minMod : word;
       maxMod : word;
       pid : longint;
       vc : longint;
     end;

The following type is used to define regions of interest

     PGpmRoi = ^TGpmRoi;
     TGpmRoi = record
       xMin : integer;
       xMax : integer;
       yMin : integer;
       yMax : integer;
       minMod : word;
       maxMod : word;
       eventMask : word;
       owned : word;
       handler : TGpmHandler;
       clientdata : pointer;
       prev : PGpmRoi;
       next : PGpmRoi;
     end;

#### Variables

The following variables are imported from the gpm library

     gpm_flag           : longint;cvar;external;
     gpm_fd             : longint;cvar;external;
     gpm_hflag          : longint;cvar;external;
     gpm_morekeys       : Longbool;cvar;external;
     gpm_zerobased      : Longbool;cvar;external;
     gpm_visiblepointer : Longbool;cvar;external;
     gpm_mx             : longint;cvar;external;
     gpm_my             : longint;cvar;external;
     gpm_timeout        : TTimeVal;cvar;external;
     _gpm_buf           : array[0..0] of char;cvar;external;
     _gpm_arg           : ^word;cvar;external;
     gpm_handler        : TGpmHandler;cvar;external;
     gpm_data           : pointer;cvar;external;
     gpm_roi_handler    : TGpmHandler;cvar;external;
     gpm_roi_data       : pointer;cvar;external;
     gpm_roi            : PGpmRoi;cvar;external;
     gpm_current_roi    : PGpmRoi;cvar;external;
     gpm_consolefd      : longint;cvar;external;
     Gpm_HandleRoi      : TGpmHandler;cvar;external;

[next] [prev] [prev-tail] [front] [up]