xfixes.pp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. (*
  2. * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
  3. * Copyright 2011 Red Hat, Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the "Software"),
  7. * to deal in the Software without restriction, including without limitation
  8. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. * and/or sell copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice (including the next
  13. * paragraph) shall be included in all copies or substantial portions of the
  14. * Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  22. * DEALINGS IN THE SOFTWARE.
  23. *)
  24. (*
  25. * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
  26. *
  27. * Permission to use, copy, modify, distribute, and sell this software and its
  28. * documentation for any purpose is hereby granted without fee, provided that
  29. * the above copyright notice appear in all copies and that both that
  30. * copyright notice and this permission notice appear in supporting
  31. * documentation, and that the name of Keith Packard not be used in
  32. * advertising or publicity pertaining to distribution of the software without
  33. * specific, written prior permission. Keith Packard makes no
  34. * representations about the suitability of this software for any purpose. It
  35. * is provided "as is" without express or implied warranty.
  36. *
  37. * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  38. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  39. * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  40. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  41. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  42. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  43. * PERFORMANCE OF THIS SOFTWARE.
  44. *)
  45. unit xfixes;
  46. interface
  47. {$PACKRECORDS C}
  48. uses
  49. ctypes, x, xlib;
  50. const
  51. libXfixes = 'Xfixes';
  52. {$I xfixeswire.inc}
  53. //#include <X11/Xfuncproto.h>
  54. //#include <X11/Xlib.h>
  55. const
  56. (*
  57. * This revision number also appears in configure.ac, they have
  58. * to be manually synchronized
  59. *)
  60. XFIXES_REVISION = 1;
  61. XFIXES_VERSION = (XFIXES_MAJOR * 10000) + (XFIXES_MINOR * 100) + XFIXES_REVISION;
  62. type
  63. PXFixesSelectionNotifyEvent = ^TXFixesSelectionNotifyEvent;
  64. TXFixesSelectionNotifyEvent = record
  65. _type: cint; { event base }
  66. serial: culong;
  67. send_event: TBool;
  68. display: PDisplay;
  69. window: TWindow;
  70. subtype: cint;
  71. owner: TWindow;
  72. selection: TAtom;
  73. timestamp: TTime;
  74. selection_timestamp: TTime;
  75. end;
  76. PXFixesCursorNotifyEvent = ^TXFixesCursorNotifyEvent;
  77. TXFixesCursorNotifyEvent = record
  78. _type: cint; { event base }
  79. serial: culong;
  80. send_event: TBool;
  81. display: PDisplay;
  82. window: TWindow;
  83. subtype: cint;
  84. cursor_serial: culong;
  85. timestamp: TTime;
  86. cursor_name: TAtom;
  87. end;
  88. PXFixesCursorImage = ^TXFixesCursorImage;
  89. TXFixesCursorImage = record
  90. x, y: cshort;
  91. width, height: cushort;
  92. xhot, yhot: cushort;
  93. cursor_serial: culong;
  94. pixels: Pculong;
  95. //#if XFIXES_MAJOR >= 2
  96. atom: TAtom; { Version >= 2 only }
  97. name: PChar; { Version >= 2 only }
  98. //#endif
  99. end;
  100. //#if XFIXES_MAJOR >= 2
  101. { Version 2 types }
  102. PXserverRegion = ^TXserverRegion;
  103. TXserverRegion = TXID;
  104. PXFixesCursorImageAndName = ^TXFixesCursorImageAndName;
  105. TXFixesCursorImageAndName = record
  106. x, y: cshort;
  107. width, height: cushort;
  108. xhot, yhot: cushort;
  109. cursor_serial: culong;
  110. pixels: Pculong;
  111. atom: TAtom;
  112. name: PChar;
  113. end;
  114. //#endif
  115. //_XFUNCPROTOBEGIN
  116. function XFixesQueryExtension(dpy: PDisplay;
  117. event_base_return: Pcint;
  118. error_base_return: Pcint): TBoolResult; cdecl; external libXfixes;
  119. function XFixesQueryVersion(dpy: PDisplay;
  120. major_version_return: Pcint;
  121. minor_version_return: Pcint): TStatus; cdecl; external libXfixes;
  122. function XFixesVersion: cint; cdecl; external libXfixes;
  123. procedure
  124. XFixesChangeSaveSet(dpy: PDisplay;
  125. win: TWindow;
  126. mode: cint;
  127. target: cint;
  128. map: cint); cdecl; external libXfixes;
  129. procedure
  130. XFixesSelectSelectionInput(dpy: PDisplay;
  131. win: TWindow;
  132. selection: TAtom;
  133. eventMask: culong); cdecl; external libXfixes;
  134. procedure
  135. XFixesSelectCursorInput(dpy: PDisplay;
  136. win: TWindow;
  137. eventMask: culong); cdecl; external libXfixes;
  138. function XFixesGetCursorImage(dpy: PDisplay)
  139. : PXFixesCursorImage; cdecl; external libXfixes;
  140. //#if XFIXES_MAJOR >= 2
  141. { Version 2 functions }
  142. function XFixesCreateRegion(dpy: PDisplay; rectangles: PXRectangle; nrectangles: cint)
  143. : TXserverRegion; cdecl; external libXfixes;
  144. function XFixesCreateRegionFromBitmap(dpy: PDisplay; bitmap: TPixmap)
  145. : TXserverRegion; cdecl; external libXfixes;
  146. function XFixesCreateRegionFromWindow(dpy: PDisplay; window: TWindow; kind: cint)
  147. : TXserverRegion; cdecl; external libXfixes;
  148. function XFixesCreateRegionFromGC(dpy: PDisplay; gc: TGC)
  149. : TXserverRegion; cdecl; external libXfixes;
  150. function XFixesCreateRegionFromPicture(dpy: PDisplay; picture: TXID)
  151. : TXserverRegion; cdecl; external libXfixes;
  152. procedure
  153. XFixesDestroyRegion(dpy: PDisplay; region: TXserverRegion); cdecl; external libXfixes;
  154. procedure
  155. XFixesSetRegion(dpy: PDisplay; region: TXserverRegion;
  156. rectangles: PXRectangle; nrectangles: cint); cdecl; external libXfixes;
  157. procedure
  158. XFixesCopyRegion(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion); cdecl; external libXfixes;
  159. procedure
  160. XFixesUnionRegion(dpy: PDisplay; dst: TXserverRegion;
  161. src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes;
  162. procedure
  163. XFixesIntersectRegion(dpy: PDisplay; dst: TXserverRegion;
  164. src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes;
  165. procedure
  166. XFixesSubtractRegion(dpy: PDisplay; dst: TXserverRegion;
  167. src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes;
  168. procedure
  169. XFixesInvertRegion(dpy: PDisplay; dst: TXserverRegion;
  170. rect: PXRectangle; src: TXserverRegion); cdecl; external libXfixes;
  171. procedure
  172. XFixesTranslateRegion(dpy: PDisplay; region: TXserverRegion; dx, dy: cint); cdecl; external libXfixes;
  173. procedure
  174. XFixesRegionExtents(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion); cdecl; external libXfixes;
  175. function XFixesFetchRegion(dpy: PDisplay; region: TXserverRegion; nrectanglesRet: Pcint)
  176. : PXRectangle; cdecl; external libXfixes;
  177. function XFixesFetchRegionAndBounds(dpy: PDisplay; region: TXserverRegion;
  178. nrectanglesRet: Pcint;
  179. bounds: PXRectangle)
  180. : PXRectangle; cdecl; external libXfixes;
  181. procedure
  182. XFixesSetGCClipRegion(dpy: PDisplay; gc: TGC;
  183. clip_x_origin: cint; clip_y_origin: cint;
  184. region: TXserverRegion); cdecl; external libXfixes;
  185. procedure
  186. XFixesSetWindowShapeRegion(dpy: PDisplay; win: TWindow; shape_kind: cint;
  187. x_off: cint; y_off: cint; region: TXserverRegion); cdecl; external libXfixes;
  188. procedure
  189. XFixesSetPictureClipRegion(dpy: PDisplay; picture: TXID;
  190. clip_x_origin: cint; clip_y_origin: cint;
  191. region: TXserverRegion); cdecl; external libXfixes;
  192. procedure
  193. XFixesSetCursorName(dpy: PDisplay; cursor: TCursor; name: PChar); cdecl; external libXfixes;
  194. function XFixesGetCursorName(dpy: PDisplay; cursor: TCursor; atom: PAtom)
  195. : PChar; cdecl; external libXfixes;
  196. procedure
  197. XFixesChangeCursor(dpy: PDisplay; source: TCursor; destination: TCursor); cdecl; external libXfixes;
  198. procedure
  199. XFixesChangeCursorByName(dpy: PDisplay; source: TCursor; name: PChar); cdecl; external libXfixes;
  200. //#endif /* XFIXES_MAJOR >= 2 */
  201. //#if XFIXES_MAJOR >= 3
  202. procedure
  203. XFixesExpandRegion(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion;
  204. left, right, top, bottom: cunsigned); cdecl; external libXfixes;
  205. //#endif /* XFIXES_MAJOR >= 3 */
  206. //#if XFIXES_MAJOR >= 4
  207. { Version 4.0 externs }
  208. procedure
  209. XFixesHideCursor(dpy: PDisplay; win: TWindow); cdecl; external libXfixes;
  210. procedure
  211. XFixesShowCursor(dpy: PDisplay; win: TWindow); cdecl; external libXfixes;
  212. //#endif /* XFIXES_MAJOR >= 4 */
  213. //#if XFIXES_MAJOR >= 5
  214. type
  215. PPointerBarrier = ^TPointerBarrier;
  216. TPointerBarrier = TXID;
  217. function
  218. XFixesCreatePointerBarrier(dpy: PDisplay; w: TWindow; x1, y1,
  219. x2, y2: cint; directions: cint;
  220. num_devices: cint; devices: Pcint): TPointerBarrier; cdecl; external libXfixes;
  221. procedure
  222. XFixesDestroyPointerBarrier(dpy: PDisplay; b: TPointerBarrier); cdecl; external libXfixes;
  223. //#endif /* XFIXES_MAJOR >= 5 */
  224. //_XFUNCPROTOEND
  225. implementation
  226. end.