gpm114.pas 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. {
  2. $Id$
  3. Low level unit for GPM v1.14, the mouse server for Linux
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Library General Public License as published
  6. by the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. *************************************************************************}
  16. unit gpm114;
  17. interface
  18. uses
  19. linux;
  20. {$LINKLIB c}
  21. {$LINKLIB gpm}
  22. const
  23. { Buttons }
  24. GPM_B_LEFT = 4;
  25. GPM_B_MIDDLE = 2;
  26. GPM_B_RIGHT = 1;
  27. { Event types }
  28. GPM_MOVE = 1;
  29. GPM_DRAG = 2;
  30. GPM_DOWN = 4;
  31. GPM_UP = 8;
  32. GPM_SINGLE = 16; { at most one in three is set }
  33. GPM_DOUBLE = 32;
  34. GPM_TRIPLE = 64;
  35. GPM_MFLAG = 128;
  36. GPM_HARD = 256;
  37. GPM_ENTER = 512;
  38. GPM_LEAVE = 1024;
  39. GPM_BARE_EVENTS = $60F;
  40. { Margins }
  41. GPM_TOP = 1;
  42. GPM_BOT = 2;
  43. GPM_LFT = 4;
  44. GPM_RGT = 8;
  45. type
  46. {$PACKRECORDS 4}
  47. TGPMConnect = record
  48. EventMask, DefaultMask: Word;
  49. MinMod, MaxMod: Word;
  50. Pid: Longint;
  51. vc: Longint;
  52. end;
  53. TGPMEvent = record
  54. Buttons, Modifiers: Byte;
  55. vc: Word;
  56. Dx, Dy, X, Y: Integer;
  57. EventType: Word;
  58. Clicks: Longint;
  59. GPMMargin: Word;
  60. end;
  61. TGPMHandler = function (const GPMEvent: TGPMEvent; ClientData: Pointer): Longint;cdecl;
  62. { Global variables }
  63. var
  64. gpm_flag : Longint;cvar;external;
  65. gpm_consolefd : Longint;cvar;external name 'gpm_fd';
  66. gpm_tried : Longbool;cvar;external;
  67. gpm_hflag : Longbool;cvar;external;
  68. gpm_morekeys : Longbool;cvar;external;
  69. gpm_zerobased : Longbool;cvar;external;
  70. gpm_visiblepointer : Longbool;cvar;external;
  71. gpm_mx : Longint;cvar;external;
  72. gpm_my : Longint;cvar;external;
  73. gpm_timeout : timeval;cvar;external;
  74. gpm_handler : TGPMHandler;cvar;external;
  75. gpm_data : Pointer;cvar;external;
  76. gpm_console_fd : Longint;cvar;external;
  77. function Gpm_Open(var Connect: TGPMConnect; Flag: Longint): Longint;cdecl;
  78. function Gpm_Close:Longint;cdecl;
  79. function Gpm_GetEvent(var Event: TGpmEvent): Longint;cdecl;
  80. function Gpm_GetLibVersion(var where: Longint): PChar;cdecl;
  81. function Gpm_GetServerVersion(var where: Longint): PChar;cdecl;
  82. function Gpm_GetSnapshot(var Event: TGPMEvent): Longint;cdecl;
  83. implementation
  84. function Gpm_Open(var Connect: TGPMConnect; Flag: Longint): Longint; cdecl;external;
  85. function Gpm_Close: Longint; cdecl;external;
  86. function Gpm_GetEvent(var Event: TGpmEvent): Longint; cdecl;external;
  87. function Gpm_GetLibVersion(var where: Longint): PChar; cdecl;external;
  88. function Gpm_GetServerVersion(var where: Longint): PChar; cdecl;external;
  89. function Gpm_GetSnapshot(var Event: TGPMEvent): Longint; cdecl;external;
  90. end.
  91. {
  92. $Log$
  93. Revision 1.1 2000-01-06 01:20:31 peter
  94. * moved out of packages/ back to topdir
  95. Revision 1.1 1999/11/24 23:36:38 peter
  96. * moved to packages dir
  97. Revision 1.1 1999/07/01 19:41:26 peter
  98. * define OLDGPM to compile with old gpm (for v1.14) else the new
  99. gpm unit from rtl will be used (v1.17)
  100. Revision 1.1 1998/12/04 12:48:30 peter
  101. * moved some dirs
  102. Revision 1.1 1998/10/29 11:02:51 peter
  103. + mouse for linux
  104. }