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