File: gpm114.pas

package info (click to toggle)
fpc 0.99.13-19991013-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 23,104 kB
  • ctags: 9,760
  • sloc: pascal: 253,711; ansic: 5,236; makefile: 3,855; yacc: 2,016; lex: 707; asm: 526; xml: 443; sh: 200; perl: 87; sed: 21; csh: 12; cpp: 1
file content (127 lines) | stat: -rw-r--r-- 3,730 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{
  $Id: gpm114.pas,v 1.1 1999/07/01 19:41:26 peter Exp $

  Low level unit for GPM v1.14, the mouse server for Linux

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Library General Public License as published
  by the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *************************************************************************}
unit gpm114;
interface

uses
  linux;

{$LINKLIB c}
{$LINKLIB gpm}

const
  { Buttons }
  GPM_B_LEFT         = 4;
  GPM_B_MIDDLE       = 2;
  GPM_B_RIGHT        = 1;

  { Event types }
  GPM_MOVE           = 1;
  GPM_DRAG           = 2;
  GPM_DOWN           = 4;
  GPM_UP             = 8;

  GPM_SINGLE         = 16;            { at most one in three is set }
  GPM_DOUBLE         = 32;
  GPM_TRIPLE         = 64;

  GPM_MFLAG          = 128;
  GPM_HARD           = 256;

  GPM_ENTER          = 512;
  GPM_LEAVE          = 1024;

  GPM_BARE_EVENTS    = $60F;

  { Margins }
  GPM_TOP            = 1;
  GPM_BOT            = 2;
  GPM_LFT            = 4;
  GPM_RGT            = 8;

type
{$PACKRECORDS 4}
  TGPMConnect = record
    EventMask, DefaultMask: Word;
    MinMod, MaxMod: Word;
    Pid: Longint;
    vc: Longint;
  end;

  TGPMEvent = record
    Buttons, Modifiers: Byte;
    vc: Word;
    Dx, Dy, X, Y: Integer;
    EventType: Word;
    Clicks: Longint;
    GPMMargin: Word;
  end;

  TGPMHandler = function (const GPMEvent: TGPMEvent; ClientData: Pointer): Longint;cdecl;

{ Global variables }
var
  gpm_flag           : Longint;cvar;external;
  gpm_consolefd      : Longint;cvar;external name 'gpm_fd';
  gpm_tried          : Longbool;cvar;external;
  gpm_hflag          : Longbool;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        : timeval;cvar;external;
  gpm_handler        : TGPMHandler;cvar;external;
  gpm_data           : Pointer;cvar;external;
  gpm_console_fd     : Longint;cvar;external;

function Gpm_Open(var Connect: TGPMConnect; Flag: Longint): Longint;cdecl;
function Gpm_Close:Longint;cdecl;
function Gpm_GetEvent(var Event: TGpmEvent): Longint;cdecl;

function Gpm_GetLibVersion(var where: Longint): PChar;cdecl;
function Gpm_GetServerVersion(var where: Longint): PChar;cdecl;
function Gpm_GetSnapshot(var Event: TGPMEvent): Longint;cdecl;

implementation

function Gpm_Open(var Connect: TGPMConnect; Flag: Longint): Longint; cdecl;external;
function Gpm_Close: Longint; cdecl;external;
function Gpm_GetEvent(var Event: TGpmEvent): Longint; cdecl;external;

function Gpm_GetLibVersion(var where: Longint): PChar; cdecl;external;
function Gpm_GetServerVersion(var where: Longint): PChar; cdecl;external;
function Gpm_GetSnapshot(var Event: TGPMEvent): Longint; cdecl;external;


end.
{
  $Log: gpm114.pas,v $
  Revision 1.1  1999/07/01 19:41:26  peter
    * define OLDGPM to compile with old gpm (for v1.14) else the new
      gpm unit from rtl will be used (v1.17)

  Revision 1.1  1998/12/04 12:48:30  peter
    * moved some dirs

  Revision 1.1  1998/10/29 11:02:51  peter
    + mouse for linux

}