1b042e37fSmrg/*
2b042e37fSmrg * Copyright © 2000 Compaq Computer Corporation, Inc.
3b042e37fSmrg * Copyright © 2002 Hewlett-Packard Company, Inc.
4b042e37fSmrg * Copyright © 2006 Intel Corporation
58c4a8e55Smrg * Copyright © 2008 Red Hat, Inc.
6b042e37fSmrg *
7b042e37fSmrg * Permission to use, copy, modify, distribute, and sell this software and its
8b042e37fSmrg * documentation for any purpose is hereby granted without fee, provided that
9b042e37fSmrg * the above copyright notice appear in all copies and that both that copyright
10b042e37fSmrg * notice and this permission notice appear in supporting documentation, and
11b042e37fSmrg * that the name of the copyright holders not be used in advertising or
12b042e37fSmrg * publicity pertaining to distribution of the software without specific,
13b042e37fSmrg * written prior permission.  The copyright holders make no representations
14b042e37fSmrg * about the suitability of this software for any purpose.  It is provided "as
15b042e37fSmrg * is" without express or implied warranty.
16b042e37fSmrg *
17b042e37fSmrg * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18b042e37fSmrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19b042e37fSmrg * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20b042e37fSmrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21b042e37fSmrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22b042e37fSmrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
23b042e37fSmrg * OF THIS SOFTWARE.
24b042e37fSmrg *
25b042e37fSmrg * Author:  Jim Gettys, HP Labs, Hewlett-Packard, Inc.
26b042e37fSmrg *	    Keith Packard, Intel Corporation
27b042e37fSmrg */
28b042e37fSmrg
29b042e37fSmrg#ifndef _XRANDR_H_
30b042e37fSmrg#define _XRANDR_H_
31b042e37fSmrg
32b042e37fSmrg#include <X11/extensions/randr.h>
338c4a8e55Smrg#include <X11/extensions/Xrender.h>
34b042e37fSmrg
35b042e37fSmrg#include <X11/Xfuncproto.h>
36b042e37fSmrg
37b042e37fSmrg_XFUNCPROTOBEGIN
38b042e37fSmrg
39b042e37fSmrgtypedef XID RROutput;
40b042e37fSmrgtypedef XID RRCrtc;
41b042e37fSmrgtypedef XID RRMode;
420597fb56Smrgtypedef XID RRProvider;
43b042e37fSmrg
44b042e37fSmrgtypedef struct {
45b042e37fSmrg    int	width, height;
46b042e37fSmrg    int	mwidth, mheight;
47b042e37fSmrg} XRRScreenSize;
48b042e37fSmrg
49b042e37fSmrg/*
50b042e37fSmrg *  Events.
51b042e37fSmrg */
52b042e37fSmrg
53b042e37fSmrgtypedef struct {
54b042e37fSmrg    int type;			/* event base */
55b042e37fSmrg    unsigned long serial;	/* # of last request processed by server */
56b042e37fSmrg    Bool send_event;		/* true if this came from a SendEvent request */
57b042e37fSmrg    Display *display;		/* Display the event was read from */
58b042e37fSmrg    Window window;		/* window which selected for this event */
59b042e37fSmrg    Window root;		/* Root window for changed screen */
60b042e37fSmrg    Time timestamp;		/* when the screen change occurred */
61b042e37fSmrg    Time config_timestamp;	/* when the last configuration change */
62b042e37fSmrg    SizeID size_index;
63b042e37fSmrg    SubpixelOrder subpixel_order;
64b042e37fSmrg    Rotation rotation;
65b042e37fSmrg    int width;
66b042e37fSmrg    int height;
67b042e37fSmrg    int mwidth;
68b042e37fSmrg    int mheight;
69b042e37fSmrg} XRRScreenChangeNotifyEvent;
70b042e37fSmrg
71b042e37fSmrgtypedef struct {
72b042e37fSmrg    int type;			/* event base */
73b042e37fSmrg    unsigned long serial;	/* # of last request processed by server */
74b042e37fSmrg    Bool send_event;		/* true if this came from a SendEvent request */
75b042e37fSmrg    Display *display;		/* Display the event was read from */
76b042e37fSmrg    Window window;		/* window which selected for this event */
77b042e37fSmrg    int subtype;		/* RRNotify_ subtype */
78b042e37fSmrg} XRRNotifyEvent;
79b042e37fSmrg
80b042e37fSmrgtypedef struct {
81b042e37fSmrg    int type;			/* event base */
82b042e37fSmrg    unsigned long serial;	/* # of last request processed by server */
83b042e37fSmrg    Bool send_event;		/* true if this came from a SendEvent request */
84b042e37fSmrg    Display *display;		/* Display the event was read from */
85b042e37fSmrg    Window window;		/* window which selected for this event */
86b042e37fSmrg    int subtype;		/* RRNotify_OutputChange */
87b042e37fSmrg    RROutput output;		/* affected output */
88b042e37fSmrg    RRCrtc crtc;	    	/* current crtc (or None) */
89b042e37fSmrg    RRMode mode;	    	/* current mode (or None) */
90b042e37fSmrg    Rotation rotation;		/* current rotation of associated crtc */
91b042e37fSmrg    Connection connection;	/* current connection status */
92b042e37fSmrg    SubpixelOrder subpixel_order;
93b042e37fSmrg} XRROutputChangeNotifyEvent;
94b042e37fSmrg
95b042e37fSmrgtypedef struct {
96b042e37fSmrg    int type;			/* event base */
97b042e37fSmrg    unsigned long serial;	/* # of last request processed by server */
98b042e37fSmrg    Bool send_event;		/* true if this came from a SendEvent request */
99b042e37fSmrg    Display *display;		/* Display the event was read from */
100b042e37fSmrg    Window window;		/* window which selected for this event */
101b042e37fSmrg    int subtype;		/* RRNotify_CrtcChange */
102b042e37fSmrg    RRCrtc crtc;    		/* current crtc (or None) */
103b042e37fSmrg    RRMode mode;	    	/* current mode (or None) */
104b042e37fSmrg    Rotation rotation;		/* current rotation of associated crtc */
105b042e37fSmrg    int x, y;			/* position */
106b042e37fSmrg    unsigned int width, height;	/* size */
107b042e37fSmrg} XRRCrtcChangeNotifyEvent;
108b042e37fSmrg
109b042e37fSmrgtypedef struct {
110b042e37fSmrg    int type;			/* event base */
111b042e37fSmrg    unsigned long serial;	/* # of last request processed by server */
112b042e37fSmrg    Bool send_event;		/* true if this came from a SendEvent request */
113b042e37fSmrg    Display *display;		/* Display the event was read from */
114b042e37fSmrg    Window window;		/* window which selected for this event */
115b042e37fSmrg    int subtype;		/* RRNotify_OutputProperty */
116b042e37fSmrg    RROutput output;		/* related output */
117b042e37fSmrg    Atom property;		/* changed property */
118b042e37fSmrg    Time timestamp;		/* time of change */
119b042e37fSmrg    int state;			/* NewValue, Deleted */
120b042e37fSmrg} XRROutputPropertyNotifyEvent;
121b042e37fSmrg
1220597fb56Smrgtypedef struct {
1230597fb56Smrg    int type;			/* event base */
1240597fb56Smrg    unsigned long serial;	/* # of last request processed by server */
1250597fb56Smrg    Bool send_event;		/* true if this came from a SendEvent request */
1260597fb56Smrg    Display *display;		/* Display the event was read from */
1270597fb56Smrg    Window window;		/* window which selected for this event */
1280597fb56Smrg    int subtype;		/* RRNotify_ProviderChange */
1290597fb56Smrg    RRProvider provider; 	/* current provider (or None) */
1300597fb56Smrg    Time timestamp;		/* time of change */
1310597fb56Smrg    unsigned int current_role;
1320597fb56Smrg} XRRProviderChangeNotifyEvent;
1330597fb56Smrg
1340597fb56Smrgtypedef struct {
1350597fb56Smrg    int type;			/* event base */
1360597fb56Smrg    unsigned long serial;	/* # of last request processed by server */
1370597fb56Smrg    Bool send_event;		/* true if this came from a SendEvent request */
1380597fb56Smrg    Display *display;		/* Display the event was read from */
1390597fb56Smrg    Window window;		/* window which selected for this event */
1400597fb56Smrg    int subtype;		/* RRNotify_ProviderProperty */
1410597fb56Smrg    RRProvider provider;		/* related provider */
1420597fb56Smrg    Atom property;		/* changed property */
1430597fb56Smrg    Time timestamp;		/* time of change */
1440597fb56Smrg    int state;			/* NewValue, Deleted */
1450597fb56Smrg} XRRProviderPropertyNotifyEvent;
1460597fb56Smrg
1470597fb56Smrgtypedef struct {
1480597fb56Smrg    int type;			/* event base */
1490597fb56Smrg    unsigned long serial;	/* # of last request processed by server */
1500597fb56Smrg    Bool send_event;		/* true if this came from a SendEvent request */
1510597fb56Smrg    Display *display;		/* Display the event was read from */
1520597fb56Smrg    Window window;		/* window which selected for this event */
1530597fb56Smrg    int subtype;		/* RRNotify_ResourceChange */
1540597fb56Smrg    Time timestamp;		/* time of change */
1550597fb56Smrg} XRRResourceChangeNotifyEvent;
1560597fb56Smrg
157b042e37fSmrg/* internal representation is private to the library */
1580597fb56Smrgtypedef struct _XRRScreenConfiguration XRRScreenConfiguration;
159b042e37fSmrg
1608c4a8e55SmrgBool XRRQueryExtension (Display *dpy,
1618c4a8e55Smrg			int *event_base_return,
1628c4a8e55Smrg			int *error_base_return);
163b042e37fSmrgStatus XRRQueryVersion (Display *dpy,
1648c4a8e55Smrg			    int     *major_version_return,
1658c4a8e55Smrg			    int     *minor_version_return);
166b042e37fSmrg
167b042e37fSmrgXRRScreenConfiguration *XRRGetScreenInfo (Display *dpy,
168b042e37fSmrg					  Window window);
1690597fb56Smrg
170b042e37fSmrgvoid XRRFreeScreenConfigInfo (XRRScreenConfiguration *config);
171b042e37fSmrg
1720597fb56Smrg/*
173b042e37fSmrg * Note that screen configuration changes are only permitted if the client can
174b042e37fSmrg * prove it has up to date configuration information.  We are trying to
175b042e37fSmrg * insist that it become possible for screens to change dynamically, so
176b042e37fSmrg * we want to ensure the client knows what it is talking about when requesting
177b042e37fSmrg * changes.
178b042e37fSmrg */
1790597fb56SmrgStatus XRRSetScreenConfig (Display *dpy,
180b042e37fSmrg			   XRRScreenConfiguration *config,
181b042e37fSmrg			   Drawable draw,
182b042e37fSmrg			   int size_index,
183b042e37fSmrg			   Rotation rotation,
184b042e37fSmrg			   Time timestamp);
185b042e37fSmrg
186b042e37fSmrg/* added in v1.1, sorry for the lame name */
1870597fb56SmrgStatus XRRSetScreenConfigAndRate (Display *dpy,
188b042e37fSmrg				  XRRScreenConfiguration *config,
189b042e37fSmrg				  Drawable draw,
190b042e37fSmrg				  int size_index,
191b042e37fSmrg				  Rotation rotation,
192b042e37fSmrg				  short rate,
193b042e37fSmrg				  Time timestamp);
194b042e37fSmrg
195b042e37fSmrg
196b042e37fSmrgRotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation);
197b042e37fSmrg
198b042e37fSmrgTime XRRConfigTimes (XRRScreenConfiguration *config, Time *config_timestamp);
199b042e37fSmrg
200b042e37fSmrgXRRScreenSize *XRRConfigSizes(XRRScreenConfiguration *config, int *nsizes);
201b042e37fSmrg
202b042e37fSmrgshort *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates);
203b042e37fSmrg
2040597fb56SmrgSizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config,
205b042e37fSmrg			      Rotation *rotation);
2060597fb56Smrg
207b042e37fSmrgshort XRRConfigCurrentRate (XRRScreenConfiguration *config);
208b042e37fSmrg
209b042e37fSmrgint XRRRootToScreen(Display *dpy, Window root);
210b042e37fSmrg
2110597fb56Smrg/*
212b042e37fSmrg * returns the screen configuration for the specified screen; does a lazy
2138d0bc965Smrg * evaluation to delay getting the information, and caches the result.
214b042e37fSmrg * These routines should be used in preference to XRRGetScreenInfo
215b042e37fSmrg * to avoid unneeded round trips to the X server.  These are new
216b042e37fSmrg * in protocol version 0.1.
217b042e37fSmrg */
218b042e37fSmrg
219b042e37fSmrg
220b042e37fSmrgvoid XRRSelectInput(Display *dpy, Window window, int mask);
221b042e37fSmrg
2220597fb56Smrg/*
2230597fb56Smrg * the following are always safe to call, even if RandR is not implemented
2240597fb56Smrg * on a screen
225b042e37fSmrg */
226b042e37fSmrg
227b042e37fSmrg
228b042e37fSmrgRotation XRRRotations(Display *dpy, int screen, Rotation *current_rotation);
229b042e37fSmrgXRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes);
230b042e37fSmrgshort *XRRRates (Display *dpy, int screen, int sizeID, int *nrates);
231b042e37fSmrgTime XRRTimes (Display *dpy, int screen, Time *config_timestamp);
232b042e37fSmrg
233b042e37fSmrg
234b042e37fSmrg/* Version 1.2 additions */
235b042e37fSmrg
236b042e37fSmrgStatus
237b042e37fSmrgXRRGetScreenSizeRange (Display *dpy, Window window,
238b042e37fSmrg		       int *minWidth, int *minHeight,
239b042e37fSmrg		       int *maxWidth, int *maxHeight);
240b042e37fSmrg
241b042e37fSmrgvoid
242b042e37fSmrgXRRSetScreenSize (Display *dpy, Window window,
243b042e37fSmrg		  int width, int height,
244b042e37fSmrg		  int mmWidth, int mmHeight);
245b042e37fSmrg
246b042e37fSmrgtypedef unsigned long XRRModeFlags;
247b042e37fSmrg
248b042e37fSmrgtypedef struct _XRRModeInfo {
249b042e37fSmrg    RRMode		id;
250b042e37fSmrg    unsigned int	width;
251b042e37fSmrg    unsigned int	height;
252b042e37fSmrg    unsigned long	dotClock;
253b042e37fSmrg    unsigned int	hSyncStart;
254b042e37fSmrg    unsigned int	hSyncEnd;
255b042e37fSmrg    unsigned int	hTotal;
256b042e37fSmrg    unsigned int	hSkew;
257b042e37fSmrg    unsigned int	vSyncStart;
258b042e37fSmrg    unsigned int	vSyncEnd;
259b042e37fSmrg    unsigned int	vTotal;
260b042e37fSmrg    char		*name;
261b042e37fSmrg    unsigned int	nameLength;
262b042e37fSmrg    XRRModeFlags	modeFlags;
263b042e37fSmrg} XRRModeInfo;
264b042e37fSmrg
265b042e37fSmrgtypedef struct _XRRScreenResources {
266b042e37fSmrg    Time	timestamp;
267b042e37fSmrg    Time	configTimestamp;
268b042e37fSmrg    int		ncrtc;
269b042e37fSmrg    RRCrtc	*crtcs;
270b042e37fSmrg    int		noutput;
271b042e37fSmrg    RROutput	*outputs;
272b042e37fSmrg    int		nmode;
273b042e37fSmrg    XRRModeInfo	*modes;
274b042e37fSmrg} XRRScreenResources;
2750597fb56Smrg
276b042e37fSmrgXRRScreenResources *
277b042e37fSmrgXRRGetScreenResources (Display *dpy, Window window);
278b042e37fSmrg
279b042e37fSmrgvoid
280b042e37fSmrgXRRFreeScreenResources (XRRScreenResources *resources);
281b042e37fSmrg
282b042e37fSmrgtypedef struct _XRROutputInfo {
283b042e37fSmrg    Time	    timestamp;
284b042e37fSmrg    RRCrtc	    crtc;
285b042e37fSmrg    char	    *name;
286b042e37fSmrg    int		    nameLen;
287b042e37fSmrg    unsigned long   mm_width;
288b042e37fSmrg    unsigned long   mm_height;
289b042e37fSmrg    Connection	    connection;
290b042e37fSmrg    SubpixelOrder   subpixel_order;
291b042e37fSmrg    int		    ncrtc;
292b042e37fSmrg    RRCrtc	    *crtcs;
293b042e37fSmrg    int		    nclone;
294b042e37fSmrg    RROutput	    *clones;
295b042e37fSmrg    int		    nmode;
296b042e37fSmrg    int		    npreferred;
297b042e37fSmrg    RRMode	    *modes;
298b042e37fSmrg} XRROutputInfo;
299b042e37fSmrg
300b042e37fSmrgXRROutputInfo *
301b042e37fSmrgXRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, RROutput output);
302b042e37fSmrg
303b042e37fSmrgvoid
304b042e37fSmrgXRRFreeOutputInfo (XRROutputInfo *outputInfo);
305b042e37fSmrg
306b042e37fSmrgAtom *
307b042e37fSmrgXRRListOutputProperties (Display *dpy, RROutput output, int *nprop);
308b042e37fSmrg
309b042e37fSmrgtypedef struct {
310b042e37fSmrg    Bool    pending;
311b042e37fSmrg    Bool    range;
312b042e37fSmrg    Bool    immutable;
313b042e37fSmrg    int	    num_values;
314b042e37fSmrg    long    *values;
315b042e37fSmrg} XRRPropertyInfo;
316b042e37fSmrg
317b042e37fSmrgXRRPropertyInfo *
318b042e37fSmrgXRRQueryOutputProperty (Display *dpy, RROutput output, Atom property);
319b042e37fSmrg
320b042e37fSmrgvoid
321b042e37fSmrgXRRConfigureOutputProperty (Display *dpy, RROutput output, Atom property,
322b042e37fSmrg			    Bool pending, Bool range, int num_values,
323b042e37fSmrg			    long *values);
3240597fb56Smrg
325b042e37fSmrgvoid
326b042e37fSmrgXRRChangeOutputProperty (Display *dpy, RROutput output,
327b042e37fSmrg			 Atom property, Atom type,
328b042e37fSmrg			 int format, int mode,
329b042e37fSmrg			 _Xconst unsigned char *data, int nelements);
330b042e37fSmrg
331b042e37fSmrgvoid
332b042e37fSmrgXRRDeleteOutputProperty (Display *dpy, RROutput output, Atom property);
333b042e37fSmrg
334b042e37fSmrgint
335b042e37fSmrgXRRGetOutputProperty (Display *dpy, RROutput output,
336b042e37fSmrg		      Atom property, long offset, long length,
337b042e37fSmrg		      Bool _delete, Bool pending, Atom req_type,
338b042e37fSmrg		      Atom *actual_type, int *actual_format,
339b042e37fSmrg		      unsigned long *nitems, unsigned long *bytes_after,
340b042e37fSmrg		      unsigned char **prop);
341b042e37fSmrg
342b042e37fSmrgXRRModeInfo *
3438bd17e5fSmrgXRRAllocModeInfo (_Xconst char *name, int nameLength);
344b042e37fSmrg
345b042e37fSmrgRRMode
346b042e37fSmrgXRRCreateMode (Display *dpy, Window window, XRRModeInfo *modeInfo);
347b042e37fSmrg
348b042e37fSmrgvoid
349b042e37fSmrgXRRDestroyMode (Display *dpy, RRMode mode);
350b042e37fSmrg
351b042e37fSmrgvoid
352b042e37fSmrgXRRAddOutputMode (Display *dpy, RROutput output, RRMode mode);
353b042e37fSmrg
354b042e37fSmrgvoid
355b042e37fSmrgXRRDeleteOutputMode (Display *dpy, RROutput output, RRMode mode);
356b042e37fSmrg
357b042e37fSmrgvoid
358b042e37fSmrgXRRFreeModeInfo (XRRModeInfo *modeInfo);
3590597fb56Smrg
360b042e37fSmrgtypedef struct _XRRCrtcInfo {
361b042e37fSmrg    Time	    timestamp;
362b042e37fSmrg    int		    x, y;
363b042e37fSmrg    unsigned int    width, height;
364b042e37fSmrg    RRMode	    mode;
365b042e37fSmrg    Rotation	    rotation;
366b042e37fSmrg    int		    noutput;
367b042e37fSmrg    RROutput	    *outputs;
368b042e37fSmrg    Rotation	    rotations;
369b042e37fSmrg    int		    npossible;
370b042e37fSmrg    RROutput	    *possible;
371b042e37fSmrg} XRRCrtcInfo;
372b042e37fSmrg
373b042e37fSmrgXRRCrtcInfo *
374b042e37fSmrgXRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources, RRCrtc crtc);
375b042e37fSmrg
376b042e37fSmrgvoid
377b042e37fSmrgXRRFreeCrtcInfo (XRRCrtcInfo *crtcInfo);
378b042e37fSmrg
379b042e37fSmrgStatus
380b042e37fSmrgXRRSetCrtcConfig (Display *dpy,
381b042e37fSmrg		  XRRScreenResources *resources,
382b042e37fSmrg		  RRCrtc crtc,
383b042e37fSmrg		  Time timestamp,
384b042e37fSmrg		  int x, int y,
385b042e37fSmrg		  RRMode mode,
386b042e37fSmrg		  Rotation rotation,
387b042e37fSmrg		  RROutput *outputs,
388b042e37fSmrg		  int noutputs);
389b042e37fSmrg
390b042e37fSmrgint
391b042e37fSmrgXRRGetCrtcGammaSize (Display *dpy, RRCrtc crtc);
392b042e37fSmrg
393b042e37fSmrgtypedef struct _XRRCrtcGamma {
394b042e37fSmrg    int		    size;
395b042e37fSmrg    unsigned short  *red;
396b042e37fSmrg    unsigned short  *green;
397b042e37fSmrg    unsigned short  *blue;
398b042e37fSmrg} XRRCrtcGamma;
399b042e37fSmrg
400b042e37fSmrgXRRCrtcGamma *
401b042e37fSmrgXRRGetCrtcGamma (Display *dpy, RRCrtc crtc);
402b042e37fSmrg
403b042e37fSmrgXRRCrtcGamma *
404b042e37fSmrgXRRAllocGamma (int size);
405b042e37fSmrg
406b042e37fSmrgvoid
407b042e37fSmrgXRRSetCrtcGamma (Display *dpy, RRCrtc crtc, XRRCrtcGamma *gamma);
408b042e37fSmrg
409b042e37fSmrgvoid
410b042e37fSmrgXRRFreeGamma (XRRCrtcGamma *gamma);
411b042e37fSmrg
4128c4a8e55Smrg/* Version 1.3 additions */
4138c4a8e55Smrg
4148c4a8e55SmrgXRRScreenResources *
4158c4a8e55SmrgXRRGetScreenResourcesCurrent (Display *dpy, Window window);
4168c4a8e55Smrg
4178c4a8e55Smrgvoid
4188c4a8e55SmrgXRRSetCrtcTransform (Display	*dpy,
4190597fb56Smrg		     RRCrtc	crtc,
4208c4a8e55Smrg		     XTransform	*transform,
4218bd17e5fSmrg		     _Xconst char *filter,
4228c4a8e55Smrg		     XFixed	*params,
4238c4a8e55Smrg		     int	nparams);
4248c4a8e55Smrg
4258c4a8e55Smrgtypedef struct _XRRCrtcTransformAttributes {
4268c4a8e55Smrg    XTransform	pendingTransform;
4278c4a8e55Smrg    char	*pendingFilter;
4288c4a8e55Smrg    int		pendingNparams;
4298c4a8e55Smrg    XFixed	*pendingParams;
4308c4a8e55Smrg    XTransform	currentTransform;
4318c4a8e55Smrg    char	*currentFilter;
4328c4a8e55Smrg    int		currentNparams;
4338c4a8e55Smrg    XFixed	*currentParams;
4348c4a8e55Smrg} XRRCrtcTransformAttributes;
4358c4a8e55Smrg
4368c4a8e55Smrg/*
4378c4a8e55Smrg * Get current crtc transforms and filters.
4388c4a8e55Smrg * Pass *attributes to XFree to free
4398c4a8e55Smrg */
4408c4a8e55SmrgStatus
4418c4a8e55SmrgXRRGetCrtcTransform (Display	*dpy,
4428c4a8e55Smrg		     RRCrtc	crtc,
4438c4a8e55Smrg		     XRRCrtcTransformAttributes **attributes);
4448c4a8e55Smrg
4458c4a8e55Smrg/*
4460597fb56Smrg * intended to take RRScreenChangeNotify,  or
447b042e37fSmrg * ConfigureNotify (on the root window)
448b042e37fSmrg * returns 1 if it is an event type it understands, 0 if not
449b042e37fSmrg */
450b042e37fSmrgint XRRUpdateConfiguration(XEvent *event);
451b042e37fSmrg
4528c4a8e55Smrgtypedef struct _XRRPanning {
4538c4a8e55Smrg    Time            timestamp;
4548c4a8e55Smrg    unsigned int left;
4558c4a8e55Smrg    unsigned int top;
4568c4a8e55Smrg    unsigned int width;
4578c4a8e55Smrg    unsigned int height;
4588c4a8e55Smrg    unsigned int track_left;
4598c4a8e55Smrg    unsigned int track_top;
4608c4a8e55Smrg    unsigned int track_width;
4618c4a8e55Smrg    unsigned int track_height;
4628c4a8e55Smrg    int          border_left;
4638c4a8e55Smrg    int          border_top;
4648c4a8e55Smrg    int          border_right;
4658c4a8e55Smrg    int          border_bottom;
4668c4a8e55Smrg} XRRPanning;
4678c4a8e55Smrg
4688c4a8e55SmrgXRRPanning *
4698c4a8e55SmrgXRRGetPanning (Display *dpy, XRRScreenResources *resources, RRCrtc crtc);
4708c4a8e55Smrg
4718c4a8e55Smrgvoid
4728c4a8e55SmrgXRRFreePanning (XRRPanning *panning);
4738c4a8e55Smrg
4748c4a8e55SmrgStatus
4758c4a8e55SmrgXRRSetPanning (Display *dpy,
4768c4a8e55Smrg	       XRRScreenResources *resources,
4778c4a8e55Smrg	       RRCrtc crtc,
4788c4a8e55Smrg	       XRRPanning *panning);
4798c4a8e55Smrg
4808c4a8e55Smrgvoid
4818c4a8e55SmrgXRRSetOutputPrimary(Display *dpy,
4828c4a8e55Smrg		    Window window,
4838c4a8e55Smrg		    RROutput output);
4848c4a8e55Smrg
4858c4a8e55SmrgRROutput
4868c4a8e55SmrgXRRGetOutputPrimary(Display *dpy,
4878c4a8e55Smrg		    Window window);
4888c4a8e55Smrg
4890597fb56Smrgtypedef struct _XRRProviderResources {
4900597fb56Smrg    Time timestamp;
4910597fb56Smrg    int nproviders;
4920597fb56Smrg    RRProvider *providers;
4930597fb56Smrg} XRRProviderResources;
4940597fb56Smrg
4950597fb56SmrgXRRProviderResources *
4960597fb56SmrgXRRGetProviderResources(Display *dpy, Window window);
4970597fb56Smrg
4980597fb56Smrgvoid
4990597fb56SmrgXRRFreeProviderResources(XRRProviderResources *resources);
5000597fb56Smrg
5010597fb56Smrgtypedef struct _XRRProviderInfo {
5020597fb56Smrg    unsigned int capabilities;
5030597fb56Smrg    int ncrtcs;
5040597fb56Smrg    RRCrtc	*crtcs;
5050597fb56Smrg    int noutputs;
5060597fb56Smrg    RROutput    *outputs;
5070597fb56Smrg    char	    *name;
5080597fb56Smrg    int nassociatedproviders;
5090597fb56Smrg    RRProvider *associated_providers;
5100597fb56Smrg    unsigned int *associated_capability;
5110597fb56Smrg    int		    nameLen;
5120597fb56Smrg} XRRProviderInfo;
5130597fb56Smrg
5140597fb56SmrgXRRProviderInfo *
5150597fb56SmrgXRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provider);
5160597fb56Smrg
5170597fb56Smrgvoid
5180597fb56SmrgXRRFreeProviderInfo(XRRProviderInfo *provider);
5190597fb56Smrg
5200597fb56Smrgint
5210597fb56SmrgXRRSetProviderOutputSource(Display *dpy, XID provider, XID source_provider);
5220597fb56Smrg
5230597fb56Smrgint
5240597fb56SmrgXRRSetProviderOffloadSink(Display *dpy, XID provider, XID sink_provider);
5250597fb56Smrg
5260597fb56SmrgAtom *
5270597fb56SmrgXRRListProviderProperties (Display *dpy, RRProvider provider, int *nprop);
5280597fb56Smrg
5290597fb56SmrgXRRPropertyInfo *
5300597fb56SmrgXRRQueryProviderProperty (Display *dpy, RRProvider provider, Atom property);
5310597fb56Smrg
5320597fb56Smrgvoid
5330597fb56SmrgXRRConfigureProviderProperty (Display *dpy, RRProvider provider, Atom property,
5340597fb56Smrg			    Bool pending, Bool range, int num_values,
5350597fb56Smrg			    long *values);
5360597fb56Smrg
5370597fb56Smrgvoid
5380597fb56SmrgXRRChangeProviderProperty (Display *dpy, RRProvider provider,
5390597fb56Smrg			 Atom property, Atom type,
5400597fb56Smrg			 int format, int mode,
5410597fb56Smrg			 _Xconst unsigned char *data, int nelements);
5420597fb56Smrg
5430597fb56Smrgvoid
5440597fb56SmrgXRRDeleteProviderProperty (Display *dpy, RRProvider provider, Atom property);
5450597fb56Smrg
5460597fb56Smrgint
5470597fb56SmrgXRRGetProviderProperty (Display *dpy, RRProvider provider,
5480597fb56Smrg			Atom property, long offset, long length,
5490597fb56Smrg			Bool _delete, Bool pending, Atom req_type,
5500597fb56Smrg			Atom *actual_type, int *actual_format,
5510597fb56Smrg			unsigned long *nitems, unsigned long *bytes_after,
5520597fb56Smrg			unsigned char **prop);
5530597fb56Smrg
55467594505Smrg
55567594505Smrgtypedef struct _XRRMonitorInfo {
55667594505Smrg    Atom name;
55767594505Smrg    Bool primary;
55867594505Smrg    Bool automatic;
55967594505Smrg    int noutput;
56067594505Smrg    int x;
56167594505Smrg    int y;
56267594505Smrg    int width;
56367594505Smrg    int height;
56467594505Smrg    int mwidth;
56567594505Smrg    int mheight;
56667594505Smrg    RROutput *outputs;
56767594505Smrg} XRRMonitorInfo;
56867594505Smrg
56967594505SmrgXRRMonitorInfo *
57067594505SmrgXRRAllocateMonitor(Display *dpy, int noutput);
57167594505Smrg
57267594505SmrgXRRMonitorInfo *
57367594505SmrgXRRGetMonitors(Display *dpy, Window window, Bool get_active, int *nmonitors);
57467594505Smrg
57567594505Smrgvoid
57667594505SmrgXRRSetMonitor(Display *dpy, Window window, XRRMonitorInfo *monitor);
57767594505Smrg
57867594505Smrgvoid
57967594505SmrgXRRDeleteMonitor(Display *dpy, Window window, Atom name);
58067594505Smrg
58167594505Smrgvoid
58267594505SmrgXRRFreeMonitors(XRRMonitorInfo *monitors);
58367594505Smrg
584b042e37fSmrg_XFUNCPROTOEND
585b042e37fSmrg
586b042e37fSmrg#endif /* _XRANDR_H_ */
587