Xfixes.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*
  2. * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
  3. * Copyright 2011, 2021 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 _XFIXES_H_
  46. #define _XFIXES_H_
  47. #include <X11/extensions/xfixeswire.h>
  48. #include <X11/Xfuncproto.h>
  49. #include <X11/Xlib.h>
  50. /*
  51. * This revision number also appears in configure.ac, they have
  52. * to be manually synchronized
  53. */
  54. #define XFIXES_REVISION 1
  55. #define XFIXES_VERSION ((XFIXES_MAJOR * 10000) + (XFIXES_MINOR * 100) + (XFIXES_REVISION))
  56. typedef struct {
  57. int type; /* event base */
  58. unsigned long serial;
  59. Bool send_event;
  60. Display *display;
  61. Window window;
  62. int subtype;
  63. Window owner;
  64. Atom selection;
  65. Time timestamp;
  66. Time selection_timestamp;
  67. } XFixesSelectionNotifyEvent;
  68. typedef struct {
  69. int type; /* event base */
  70. unsigned long serial;
  71. Bool send_event;
  72. Display *display;
  73. Window window;
  74. int subtype;
  75. unsigned long cursor_serial;
  76. Time timestamp;
  77. Atom cursor_name;
  78. } XFixesCursorNotifyEvent;
  79. typedef struct {
  80. short x, y;
  81. unsigned short width, height;
  82. unsigned short xhot, yhot;
  83. unsigned long cursor_serial;
  84. unsigned long *pixels;
  85. #if XFIXES_MAJOR >= 2
  86. Atom atom; /* Version >= 2 only */
  87. const char *name; /* Version >= 2 only */
  88. #endif
  89. } XFixesCursorImage;
  90. #if XFIXES_MAJOR >= 2
  91. /* Version 2 types */
  92. typedef XID XserverRegion;
  93. typedef struct {
  94. short x, y;
  95. unsigned short width, height;
  96. unsigned short xhot, yhot;
  97. unsigned long cursor_serial;
  98. unsigned long *pixels;
  99. Atom atom;
  100. const char *name;
  101. } XFixesCursorImageAndName;
  102. #endif
  103. _XFUNCPROTOBEGIN
  104. Bool XFixesQueryExtension (Display *dpy,
  105. int *event_base_return,
  106. int *error_base_return);
  107. Status XFixesQueryVersion (Display *dpy,
  108. int *major_version_return,
  109. int *minor_version_return);
  110. int XFixesVersion (void);
  111. void
  112. XFixesChangeSaveSet (Display *dpy,
  113. Window win,
  114. int mode,
  115. int target,
  116. int map);
  117. void
  118. XFixesSelectSelectionInput (Display *dpy,
  119. Window win,
  120. Atom selection,
  121. unsigned long eventMask);
  122. void
  123. XFixesSelectCursorInput (Display *dpy,
  124. Window win,
  125. unsigned long eventMask);
  126. XFixesCursorImage *
  127. XFixesGetCursorImage (Display *dpy);
  128. #if XFIXES_MAJOR >= 2
  129. /* Version 2 functions */
  130. XserverRegion
  131. XFixesCreateRegion (Display *dpy, XRectangle *rectangles, int nrectangles);
  132. XserverRegion
  133. XFixesCreateRegionFromBitmap (Display *dpy, Pixmap bitmap);
  134. XserverRegion
  135. XFixesCreateRegionFromWindow (Display *dpy, Window window, int kind);
  136. XserverRegion
  137. XFixesCreateRegionFromGC (Display *dpy, GC gc);
  138. XserverRegion
  139. XFixesCreateRegionFromPicture (Display *dpy, XID picture);
  140. void
  141. XFixesDestroyRegion (Display *dpy, XserverRegion region);
  142. void
  143. XFixesSetRegion (Display *dpy, XserverRegion region,
  144. XRectangle *rectangles, int nrectangles);
  145. void
  146. XFixesCopyRegion (Display *dpy, XserverRegion dst, XserverRegion src);
  147. void
  148. XFixesUnionRegion (Display *dpy, XserverRegion dst,
  149. XserverRegion src1, XserverRegion src2);
  150. void
  151. XFixesIntersectRegion (Display *dpy, XserverRegion dst,
  152. XserverRegion src1, XserverRegion src2);
  153. void
  154. XFixesSubtractRegion (Display *dpy, XserverRegion dst,
  155. XserverRegion src1, XserverRegion src2);
  156. void
  157. XFixesInvertRegion (Display *dpy, XserverRegion dst,
  158. XRectangle *rect, XserverRegion src);
  159. void
  160. XFixesTranslateRegion (Display *dpy, XserverRegion region, int dx, int dy);
  161. void
  162. XFixesRegionExtents (Display *dpy, XserverRegion dst, XserverRegion src);
  163. XRectangle *
  164. XFixesFetchRegion (Display *dpy, XserverRegion region, int *nrectanglesRet);
  165. XRectangle *
  166. XFixesFetchRegionAndBounds (Display *dpy, XserverRegion region,
  167. int *nrectanglesRet,
  168. XRectangle *bounds);
  169. void
  170. XFixesSetGCClipRegion (Display *dpy, GC gc,
  171. int clip_x_origin, int clip_y_origin,
  172. XserverRegion region);
  173. void
  174. XFixesSetWindowShapeRegion (Display *dpy, Window win, int shape_kind,
  175. int x_off, int y_off, XserverRegion region);
  176. void
  177. XFixesSetPictureClipRegion (Display *dpy, XID picture,
  178. int clip_x_origin, int clip_y_origin,
  179. XserverRegion region);
  180. void
  181. XFixesSetCursorName (Display *dpy, Cursor cursor, const char *name);
  182. const char *
  183. XFixesGetCursorName (Display *dpy, Cursor cursor, Atom *atom);
  184. void
  185. XFixesChangeCursor (Display *dpy, Cursor source, Cursor destination);
  186. void
  187. XFixesChangeCursorByName (Display *dpy, Cursor source, const char *name);
  188. #endif /* XFIXES_MAJOR >= 2 */
  189. #if XFIXES_MAJOR >= 3
  190. void
  191. XFixesExpandRegion (Display *dpy, XserverRegion dst, XserverRegion src,
  192. unsigned left, unsigned right,
  193. unsigned top, unsigned bottom);
  194. #endif /* XFIXES_MAJOR >= 3 */
  195. #if XFIXES_MAJOR >= 4
  196. /* Version 4.0 externs */
  197. void
  198. XFixesHideCursor (Display *dpy, Window win);
  199. void
  200. XFixesShowCursor (Display *dpy, Window win);
  201. #endif /* XFIXES_MAJOR >= 4 */
  202. #if XFIXES_MAJOR >= 5
  203. typedef XID PointerBarrier;
  204. PointerBarrier
  205. XFixesCreatePointerBarrier(Display *dpy, Window w, int x1, int y1,
  206. int x2, int y2, int directions,
  207. int num_devices, int *devices);
  208. void
  209. XFixesDestroyPointerBarrier(Display *dpy, PointerBarrier b);
  210. #endif /* XFIXES_MAJOR >= 5 */
  211. #if XFIXES_MAJOR >= 6
  212. void
  213. XFixesSetClientDisconnectMode(Display *dpy, int disconnect_mode);
  214. int
  215. XFixesGetClientDisconnectMode(Display *dpy);
  216. #endif /* XFIXES_MAJOR >= 6 */
  217. _XFUNCPROTOEND
  218. #endif /* _XFIXES_H_ */