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