Xrandrint.h revision 0597fb56
1b042e37fSmrg/* 20597fb56Smrg * 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 190597fb56Smrg * 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#include <X11/Xlibint.h> 29b042e37fSmrg#include <X11/Xutil.h> 30b042e37fSmrg#include <X11/extensions/Xext.h> 31b042e37fSmrg#include <X11/extensions/extutil.h> 32b042e37fSmrg#include "Xrandr.h" 33b042e37fSmrg#include <X11/extensions/randr.h> 34b042e37fSmrg#include <X11/extensions/randrproto.h> 35b042e37fSmrg 368c4a8e55Smrgextern char XRRExtensionName[]; 37b042e37fSmrg 38b042e37fSmrg#define RRCheckExtension(dpy,i,val) \ 39b042e37fSmrg XextCheckExtension (dpy, i, XRRExtensionName, val) 40b042e37fSmrg#define RRSimpleCheckExtension(dpy,i) \ 41b042e37fSmrg XextSimpleCheckExtension (dpy, i, XRRExtensionName) 42b042e37fSmrg 43b042e37fSmrgXExtDisplayInfo *XRRFindDisplay (Display *dpy); 44b042e37fSmrg 45b042e37fSmrg 460597fb56Smrg/* deliberately opaque internal data structure; can be extended, 47b042e37fSmrg but not reordered */ 48b042e37fSmrgstruct _XRRScreenConfiguration { 49b042e37fSmrg Screen *screen; /* the root window in GetScreenInfo */ 50b042e37fSmrg XRRScreenSize *sizes; 51b042e37fSmrg Rotation rotations; 52b042e37fSmrg Rotation current_rotation; 53b042e37fSmrg int nsizes; 54b042e37fSmrg int current_size; 55b042e37fSmrg short current_rate; 56b042e37fSmrg Time timestamp; 57b042e37fSmrg Time config_timestamp; 58b042e37fSmrg int subpixel_order; /* introduced in randr v0.1 */ 59b042e37fSmrg short *rates; /* introduced in randr v1.1 */ 60b042e37fSmrg int nrates; 61b042e37fSmrg}; 62b042e37fSmrg 63b042e37fSmrg/* 64b042e37fSmrg * if a configure notify on the root is recieved, or 65b042e37fSmrg * an XRRScreenChangeNotify is recieved, 66b042e37fSmrg * XRRUpdateConfiguration should be called to update the X library's 67b042e37fSmrg * view of the screen configuration; it will also invalidate the cache 68b042e37fSmrg * provided by XRRScreenConfig and XRRConfig, and force a round trip 69b042e37fSmrg * when next used. Returns invalid status if not an event type 70b042e37fSmrg * the library routine understand. 71b042e37fSmrg */ 720597fb56Smrg 73b042e37fSmrg/* we cache one screen configuration/screen */ 74b042e37fSmrg 75b042e37fSmrgtypedef struct _XRandRInfo { 76b042e37fSmrg XRRScreenConfiguration **config; 77b042e37fSmrg int major_version, minor_version; /* major_version = -1 means we don't know */ 78b042e37fSmrg Bool has_rates; /* Server supports refresh rates */ 79b042e37fSmrg} XRandRInfo; 80b042e37fSmrg 81b042e37fSmrgtypedef struct _randrVersionState { 82b042e37fSmrg unsigned long version_seq; 83b042e37fSmrg Bool error; 84b042e37fSmrg int major_version; 85b042e37fSmrg int minor_version; 86b042e37fSmrg} _XRRVersionState; 87b042e37fSmrg 88b042e37fSmrgBool 89b042e37fSmrg_XRRVersionHandler (Display *dpy, 90b042e37fSmrg xReply *rep, 91b042e37fSmrg char *buf, 92b042e37fSmrg int len, 93b042e37fSmrg XPointer data); 94b042e37fSmrg 958c4a8e55Smrg_X_HIDDEN Bool 968c4a8e55Smrg_XRRHasRates (int major, int minor); 978c4a8e55Smrg 98b042e37fSmrg#endif /* _XRANDRINT_H_ */ 99