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