PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/packages/svgalib/src/vgamouse.pp

https://github.com/slibre/freepascal
Puppet | 99 lines | 81 code | 18 blank | 0 comment | 0 complexity | 5b8f64297241fbfce76a723179db6e13 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1unit vgamouse;
 2
 3  interface
 4
 5{$linklib vga}
 6{$linklib c}
 7
 8  Type
 9    PLongint = ^Longint;
10
11  const
12     MOUSE_MICROSOFT = 0;
13     MOUSE_MOUSESYSTEMS = 1;
14     MOUSE_MMSERIES = 2;
15     MOUSE_LOGITECH = 3;
16     MOUSE_BUSMOUSE = 4;
17     MOUSE_PS2 = 5;
18     MOUSE_LOGIMAN = 6;
19     MOUSE_GPM = 7;
20     MOUSE_SPACEBALL = 8;
21     MOUSE_ORIENTATION_VERTICAL = 0;
22     MOUSE_ORIENTATION_HORIZONTAL = 1;
23
24     MOUSE_CHG_DTR = $80000000;
25     MOUSE_DTR_HIGH = $40000000;
26     MOUSE_CHG_RTS = $20000000;
27     MOUSE_RTS_HIGH = $10000000;
28     MOUSE_TYPE_MASK = $ffff;
29     MOUSE_LEFTBUTTON = 4;
30     MOUSE_MIDDLEBUTTON = 2;
31     MOUSE_RIGHTBUTTON = 1;
32     MOUSE_FOURTHBUTTON = 8;
33     MOUSE_FIFTHBUTTON = 16;
34     MOUSE_SIXTHBUTTON = 32;
35     MOUSE_RESETBUTTON = 64;
36     MOUSE_XDIM = 1;
37     MOUSE_YDIM = 2;
38     MOUSE_ZDIM = 4;
39     MOUSE_RXDIM = 8;
40     MOUSE_RYDIM = 16;
41     MOUSE_RZDIM = 32;
42     MOUSE_2DIM = 3;
43     MOUSE_3DIM = 7;
44     MOUSE_6DIM = 63;
45     MOUSE_DEFAULTSAMPLERATE = 150;
46
47  function mouse_init(dev:pchar; thetype:longint; samplerate:longint):longint;cdecl; external;
48  function mouse_init_return_fd(dev:pchar; thetype:longint; samplerate:longint):longint;cdecl; external;
49
50  type
51
52     __mouse_handler = procedure (button:longint; dx:longint; dy:longint; dz:longint; drx:longint;
53                   dry:longint; drz:longint);cdecl;
54
55  procedure mouse_seteventhandler(handler:__mouse_handler);cdecl; external;
56
57  procedure mouse_close;cdecl; external;
58
59  function mouse_update:longint;cdecl; external;
60
61  procedure mouse_waitforupdate;cdecl; external;
62
63  const
64     MOUSE_NOWRAP = 0;
65     MOUSE_WRAPX = 1;
66     MOUSE_WRAPY = 2;
67     MOUSE_WRAPZ = 4;
68     MOUSE_WRAPRX = 8;
69     MOUSE_WRAPRY = 16;
70     MOUSE_WRAPRZ = 32;
71     MOUSE_WRAP = 63;
72
73     MOUSE_ROT_COORDS = 196;
74     MOUSE_ROT_INFINITESIMAL = 0;
75     MOUSE_ROT_RX_RY_RZ = 64;
76     MOUSE_ROT_ZXZ = 128;
77     MOUSE_ROT_YPR = 196;
78
79  procedure mouse_setdefaulteventhandler;cdecl; external;
80  procedure mouse_setposition(x:longint; y:longint);cdecl; external;
81  procedure mouse_setposition_6d(x:longint; y:longint; z:longint; rx:longint; ry:longint;
82              rz:longint; dim_mask:longint);cdecl; external;
83  procedure mouse_setxrange(x1:longint; x2:longint);cdecl; external;
84  procedure mouse_setyrange(y1:longint; y2:longint);cdecl; external;
85  procedure mouse_setrange_6d(x1:longint; x2:longint; y1:longint; y2:longint; z1:longint;
86              z2:longint; rx1:longint; rx2:longint; ry1:longint; ry2:longint;
87              rz1:longint; rz2:longint; dim_mask:longint);cdecl; external;
88  procedure mouse_setscale(s:longint);cdecl; external;
89  procedure mouse_setwrap(w:longint);cdecl; external;
90  function mouse_getx:longint;cdecl; external;
91  function mouse_gety:longint;cdecl; external;
92  procedure mouse_getposition_6d(x:plongint; y:plongint; z:plongint; rx:plongint; ry:plongint;
93              rz:plongint);cdecl; external;
94  function mouse_getbutton:longint;cdecl; external;
95
96
97implementation
98
99end.