Xrandrint.h revision b042e37f
1b042e37fSmrg/*
2b042e37fSmrg * $XFree86: xc/lib/Xrandr/Xrandrint.h,v 1.2 2001/06/07 15:33:43 keithp Exp $
3b042e37fSmrg *
4b042e37fSmrg *
5b042e37fSmrg * Copyright © 2000, Compaq Computer Corporation,
6b042e37fSmrg * Copyright © 2002, Hewlett Packard, Inc.
7b042e37fSmrg *
8b042e37fSmrg * Permission to use, copy, modify, distribute, and sell this software and its
9b042e37fSmrg * documentation for any purpose is hereby granted without fee, provided that
10b042e37fSmrg * the above copyright notice appear in all copies and that both that
11b042e37fSmrg * copyright notice and this permission notice appear in supporting
12b042e37fSmrg * documentation, and that the name of Compaq or HP not be used in advertising
13b042e37fSmrg * or publicity pertaining to distribution of the software without specific,
14b042e37fSmrg * written prior permission.  HP makes no representations about the
15b042e37fSmrg * suitability of this software for any purpose.  It is provided "as is"
16b042e37fSmrg * without express or implied warranty.
17b042e37fSmrg *
18b042e37fSmrg * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
19b042e37fSmrg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
20b042e37fSmrg * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21b042e37fSmrg * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
22b042e37fSmrg * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
23b042e37fSmrg * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24b042e37fSmrg *
25b042e37fSmrg * Author:  Jim Gettys, HP Labs, Hewlett-Packard, Inc.
26b042e37fSmrg */
27b042e37fSmrg
28b042e37fSmrg#ifndef _XRANDRINT_H_
29b042e37fSmrg#define _XRANDRINT_H_
30b042e37fSmrg
31b042e37fSmrg#define NEED_EVENTS
32b042e37fSmrg#define NEED_REPLIES
33b042e37fSmrg#include <X11/Xlibint.h>
34b042e37fSmrg#include <X11/Xutil.h>
35b042e37fSmrg#include <X11/extensions/Xext.h>
36b042e37fSmrg#include <X11/extensions/extutil.h>
37b042e37fSmrg#include "Xrandr.h"
38b042e37fSmrg#include <X11/extensions/randr.h>
39b042e37fSmrg#include <X11/extensions/randrproto.h>
40b042e37fSmrg
41b042e37fSmrgextern XExtensionInfo XrandrExtensionInfo;
42b042e37fSmrgextern char XrandrExtensionName[];
43b042e37fSmrg
44b042e37fSmrg#define RRCheckExtension(dpy,i,val) \
45b042e37fSmrg  XextCheckExtension (dpy, i, XRRExtensionName, val)
46b042e37fSmrg#define RRSimpleCheckExtension(dpy,i) \
47b042e37fSmrg  XextSimpleCheckExtension (dpy, i, XRRExtensionName)
48b042e37fSmrg
49b042e37fSmrgXExtDisplayInfo *XRRFindDisplay (Display *dpy);
50b042e37fSmrg
51b042e37fSmrg
52b042e37fSmrg/* deliberately opaque internal data structure; can be extended,
53b042e37fSmrg   but not reordered */
54b042e37fSmrgstruct _XRRScreenConfiguration {
55b042e37fSmrg  Screen *screen;	/* the root window in GetScreenInfo */
56b042e37fSmrg  XRRScreenSize *sizes;
57b042e37fSmrg  Rotation rotations;
58b042e37fSmrg  Rotation current_rotation;
59b042e37fSmrg  int nsizes;
60b042e37fSmrg  int current_size;
61b042e37fSmrg  short current_rate;
62b042e37fSmrg  Time timestamp;
63b042e37fSmrg  Time config_timestamp;
64b042e37fSmrg  int subpixel_order;	/* introduced in randr v0.1 */
65b042e37fSmrg  short *rates;		/* introduced in randr v1.1 */
66b042e37fSmrg  int nrates;
67b042e37fSmrg};
68b042e37fSmrg
69b042e37fSmrg/*
70b042e37fSmrg * if a configure notify on the root is recieved, or
71b042e37fSmrg * an XRRScreenChangeNotify is recieved,
72b042e37fSmrg * XRRUpdateConfiguration should be called to update the X library's
73b042e37fSmrg * view of the screen configuration; it will also invalidate the cache
74b042e37fSmrg * provided by XRRScreenConfig and XRRConfig, and force a round trip
75b042e37fSmrg * when next used.  Returns invalid status if not an event type
76b042e37fSmrg * the library routine understand.
77b042e37fSmrg */
78b042e37fSmrg
79b042e37fSmrg/* we cache one screen configuration/screen */
80b042e37fSmrg
81b042e37fSmrgtypedef struct _XRandRInfo {
82b042e37fSmrg  XRRScreenConfiguration **config;
83b042e37fSmrg  int major_version, minor_version;	/* major_version = -1 means we don't know */
84b042e37fSmrg  Bool has_rates;			/* Server supports refresh rates */
85b042e37fSmrg} XRandRInfo;
86b042e37fSmrg
87b042e37fSmrgtypedef struct _randrVersionState {
88b042e37fSmrg    unsigned long   version_seq;
89b042e37fSmrg    Bool	    error;
90b042e37fSmrg    int		    major_version;
91b042e37fSmrg    int		    minor_version;
92b042e37fSmrg} _XRRVersionState;
93b042e37fSmrg
94b042e37fSmrgextern char XRRExtensionName[];
95b042e37fSmrg
96b042e37fSmrgBool
97b042e37fSmrg_XRRVersionHandler (Display	*dpy,
98b042e37fSmrg		    xReply	*rep,
99b042e37fSmrg		    char	*buf,
100b042e37fSmrg		    int		len,
101b042e37fSmrg		    XPointer    data);
102b042e37fSmrg
103b042e37fSmrg#endif /* _XRANDRINT_H_ */
104