xfixes.pp 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. {$IFNDEF FPC_DOTTEDUNITS}
  46. unit xfixes;
  47. {$ENDIF FPC_DOTTEDUNITS}
  48. interface
  49. {$PACKRECORDS C}
  50. {$IFDEF FPC_DOTTEDUNITS}
  51. uses
  52. System.CTypes, Api.X11.X, Api.X11.Xlib;
  53. {$ELSE FPC_DOTTEDUNITS}
  54. uses
  55. ctypes, x, xlib;
  56. {$ENDIF FPC_DOTTEDUNITS}
  57. const
  58. libXfixes = 'Xfixes';
  59. {$I xfixeswire.inc}
  60. //#include <X11/Xfuncproto.h>
  61. //#include <X11/Xlib.h>
  62. const
  63. (*
  64. * This revision number also appears in configure.ac, they have
  65. * to be manually synchronized
  66. *)
  67. XFIXES_REVISION = 1;
  68. XFIXES_VERSION = (XFIXES_MAJOR * 10000) + (XFIXES_MINOR * 100) + XFIXES_REVISION;
  69. type
  70. PXFixesSelectionNotifyEvent = ^TXFixesSelectionNotifyEvent;
  71. TXFixesSelectionNotifyEvent = record
  72. _type: cint; { event base }
  73. serial: culong;
  74. send_event: TBool;
  75. display: PDisplay;
  76. window: TWindow;
  77. subtype: cint;
  78. owner: TWindow;
  79. selection: TAtom;
  80. timestamp: TTime;
  81. selection_timestamp: TTime;
  82. end;
  83. PXFixesCursorNotifyEvent = ^TXFixesCursorNotifyEvent;
  84. TXFixesCursorNotifyEvent = record
  85. _type: cint; { event base }
  86. serial: culong;
  87. send_event: TBool;
  88. display: PDisplay;
  89. window: TWindow;
  90. subtype: cint;
  91. cursor_serial: culong;
  92. timestamp: TTime;
  93. cursor_name: TAtom;
  94. end;
  95. PXFixesCursorImage = ^TXFixesCursorImage;
  96. TXFixesCursorImage = record
  97. x, y: cshort;
  98. width, height: cushort;
  99. xhot, yhot: cushort;
  100. cursor_serial: culong;
  101. pixels: Pculong;
  102. //#if XFIXES_MAJOR >= 2
  103. atom: TAtom; { Version >= 2 only }
  104. name: PAnsiChar; { Version >= 2 only }
  105. //#endif
  106. end;
  107. //#if XFIXES_MAJOR >= 2
  108. { Version 2 types }
  109. PXserverRegion = ^TXserverRegion;
  110. TXserverRegion = TXID;
  111. PXFixesCursorImageAndName = ^TXFixesCursorImageAndName;
  112. TXFixesCursorImageAndName = record
  113. x, y: cshort;
  114. width, height: cushort;
  115. xhot, yhot: cushort;
  116. cursor_serial: culong;
  117. pixels: Pculong;
  118. atom: TAtom;
  119. name: PAnsiChar;
  120. end;
  121. //#endif
  122. //_XFUNCPROTOBEGIN
  123. function XFixesQueryExtension(dpy: PDisplay;
  124. event_base_return: Pcint;
  125. error_base_return: Pcint): TBoolResult; cdecl; external libXfixes;
  126. function XFixesQueryVersion(dpy: PDisplay;
  127. major_version_return: Pcint;
  128. minor_version_return: Pcint): TStatus; cdecl; external libXfixes;
  129. function XFixesVersion: cint; cdecl; external libXfixes;
  130. procedure
  131. XFixesChangeSaveSet(dpy: PDisplay;
  132. win: TWindow;
  133. mode: cint;
  134. target: cint;
  135. map: cint); cdecl; external libXfixes;
  136. procedure
  137. XFixesSelectSelectionInput(dpy: PDisplay;
  138. win: TWindow;
  139. selection: TAtom;
  140. eventMask: culong); cdecl; external libXfixes;
  141. procedure
  142. XFixesSelectCursorInput(dpy: PDisplay;
  143. win: TWindow;
  144. eventMask: culong); cdecl; external libXfixes;
  145. function XFixesGetCursorImage(dpy: PDisplay)
  146. : PXFixesCursorImage; cdecl; external libXfixes;
  147. //#if XFIXES_MAJOR >= 2
  148. { Version 2 functions }
  149. function XFixesCreateRegion(dpy: PDisplay; rectangles: PXRectangle; nrectangles: cint)
  150. : TXserverRegion; cdecl; external libXfixes;
  151. function XFixesCreateRegionFromBitmap(dpy: PDisplay; bitmap: TPixmap)
  152. : TXserverRegion; cdecl; external libXfixes;
  153. function XFixesCreateRegionFromWindow(dpy: PDisplay; window: TWindow; kind: cint)
  154. : TXserverRegion; cdecl; external libXfixes;
  155. function XFixesCreateRegionFromGC(dpy: PDisplay; gc: TGC)
  156. : TXserverRegion; cdecl; external libXfixes;
  157. function XFixesCreateRegionFromPicture(dpy: PDisplay; picture: TXID)
  158. : TXserverRegion; cdecl; external libXfixes;
  159. procedure
  160. XFixesDestroyRegion(dpy: PDisplay; region: TXserverRegion); cdecl; external libXfixes;
  161. procedure
  162. XFixesSetRegion(dpy: PDisplay; region: TXserverRegion;
  163. rectangles: PXRectangle; nrectangles: cint); cdecl; external libXfixes;
  164. procedure
  165. XFixesCopyRegion(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion); cdecl; external libXfixes;
  166. procedure
  167. XFixesUnionRegion(dpy: PDisplay; dst: TXserverRegion;
  168. src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes;
  169. procedure
  170. XFixesIntersectRegion(dpy: PDisplay; dst: TXserverRegion;
  171. src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes;
  172. procedure
  173. XFixesSubtractRegion(dpy: PDisplay; dst: TXserverRegion;
  174. src1: TXserverRegion; src2: TXserverRegion); cdecl; external libXfixes;
  175. procedure
  176. XFixesInvertRegion(dpy: PDisplay; dst: TXserverRegion;
  177. rect: PXRectangle; src: TXserverRegion); cdecl; external libXfixes;
  178. procedure
  179. XFixesTranslateRegion(dpy: PDisplay; region: TXserverRegion; dx, dy: cint); cdecl; external libXfixes;
  180. procedure
  181. XFixesRegionExtents(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion); cdecl; external libXfixes;
  182. function XFixesFetchRegion(dpy: PDisplay; region: TXserverRegion; nrectanglesRet: Pcint)
  183. : PXRectangle; cdecl; external libXfixes;
  184. function XFixesFetchRegionAndBounds(dpy: PDisplay; region: TXserverRegion;
  185. nrectanglesRet: Pcint;
  186. bounds: PXRectangle)
  187. : PXRectangle; cdecl; external libXfixes;
  188. procedure
  189. XFixesSetGCClipRegion(dpy: PDisplay; gc: TGC;
  190. clip_x_origin: cint; clip_y_origin: cint;
  191. region: TXserverRegion); cdecl; external libXfixes;
  192. procedure
  193. XFixesSetWindowShapeRegion(dpy: PDisplay; win: TWindow; shape_kind: cint;
  194. x_off: cint; y_off: cint; region: TXserverRegion); cdecl; external libXfixes;
  195. procedure
  196. XFixesSetPictureClipRegion(dpy: PDisplay; picture: TXID;
  197. clip_x_origin: cint; clip_y_origin: cint;
  198. region: TXserverRegion); cdecl; external libXfixes;
  199. procedure
  200. XFixesSetCursorName(dpy: PDisplay; cursor: TCursor; name: PAnsiChar); cdecl; external libXfixes;
  201. function XFixesGetCursorName(dpy: PDisplay; cursor: TCursor; atom: PAtom)
  202. : PAnsiChar; cdecl; external libXfixes;
  203. procedure
  204. XFixesChangeCursor(dpy: PDisplay; source: TCursor; destination: TCursor); cdecl; external libXfixes;
  205. procedure
  206. XFixesChangeCursorByName(dpy: PDisplay; source: TCursor; name: PAnsiChar); cdecl; external libXfixes;
  207. //#endif /* XFIXES_MAJOR >= 2 */
  208. //#if XFIXES_MAJOR >= 3
  209. procedure
  210. XFixesExpandRegion(dpy: PDisplay; dst: TXserverRegion; src: TXserverRegion;
  211. left, right, top, bottom: cunsigned); cdecl; external libXfixes;
  212. //#endif /* XFIXES_MAJOR >= 3 */
  213. //#if XFIXES_MAJOR >= 4
  214. { Version 4.0 externs }
  215. procedure
  216. XFixesHideCursor(dpy: PDisplay; win: TWindow); cdecl; external libXfixes;
  217. procedure
  218. XFixesShowCursor(dpy: PDisplay; win: TWindow); cdecl; external libXfixes;
  219. //#endif /* XFIXES_MAJOR >= 4 */
  220. //#if XFIXES_MAJOR >= 5
  221. type
  222. PPointerBarrier = ^TPointerBarrier;
  223. TPointerBarrier = TXID;
  224. function
  225. XFixesCreatePointerBarrier(dpy: PDisplay; w: TWindow; x1, y1,
  226. x2, y2: cint; directions: cint;
  227. num_devices: cint; devices: Pcint): TPointerBarrier; cdecl; external libXfixes;
  228. procedure
  229. XFixesDestroyPointerBarrier(dpy: PDisplay; b: TPointerBarrier); cdecl; external libXfixes;
  230. //#endif /* XFIXES_MAJOR >= 5 */
  231. //_XFUNCPROTOEND
  232. implementation
  233. end.