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