author | ssadetsky |
Mon, 17 Oct 2016 10:14:38 +0300 | |
changeset 41793 | 7b9c71553d63 |
parent 39556 | 50963eeaefca |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* reserved comment block |
|
3 |
* DO NOT REMOVE OR ALTER! |
|
4 |
*/ |
|
5 |
/* |
|
6 |
* $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $ |
|
7 |
* |
|
39556
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
8 |
* Copyright © 2000 Compaq Computer Corporation, Inc. |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
9 |
* Copyright © 2002 Hewlett-Packard Company, Inc. |
2 | 10 |
* |
11 |
* Permission to use, copy, modify, distribute, and sell this software and its |
|
12 |
* documentation for any purpose is hereby granted without fee, provided that |
|
13 |
* the above copyright notice appear in all copies and that both that |
|
14 |
* copyright notice and this permission notice appear in supporting |
|
15 |
* documentation, and that the name of Compaq not be used in advertising or |
|
16 |
* publicity pertaining to distribution of the software without specific, |
|
17 |
* written prior permission. HP makes no representations about the |
|
18 |
* suitability of this software for any purpose. It is provided "as is" |
|
19 |
* without express or implied warranty. |
|
20 |
* |
|
21 |
* HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL |
|
22 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ |
|
23 |
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
24 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
|
25 |
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
|
26 |
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
27 |
* |
|
28 |
* Author: Jim Gettys, HP Labs, HP. |
|
29 |
*/ |
|
30 |
||
31 |
#ifndef _XRANDR_H_ |
|
32 |
#define _XRANDR_H_ |
|
33 |
||
34 |
/*#include <X11/extensions/randr.h>*/ |
|
35 |
#include "randr.h" |
|
36 |
||
37 |
#include <X11/Xfuncproto.h> |
|
38 |
||
39 |
_XFUNCPROTOBEGIN |
|
40 |
||
41 |
||
42 |
typedef struct { |
|
43 |
int width, height; |
|
44 |
int mwidth, mheight; |
|
45 |
} XRRScreenSize; |
|
46 |
||
47 |
/* |
|
48 |
* Events. |
|
49 |
*/ |
|
50 |
||
51 |
typedef struct { |
|
52 |
int type; /* event base */ |
|
53 |
unsigned long serial; /* # of last request processed by server */ |
|
54 |
Bool send_event; /* true if this came from a SendEvent request */ |
|
55 |
Display *display; /* Display the event was read from */ |
|
56 |
Window window; /* window which selected for this event */ |
|
57 |
Window root; /* Root window for changed screen */ |
|
58 |
Time timestamp; /* when the screen change occurred */ |
|
59 |
Time config_timestamp; /* when the last configuration change */ |
|
60 |
SizeID size_index; |
|
61 |
SubpixelOrder subpixel_order; |
|
62 |
Rotation rotation; |
|
63 |
int width; |
|
64 |
int height; |
|
65 |
int mwidth; |
|
66 |
int mheight; |
|
67 |
} XRRScreenChangeNotifyEvent; |
|
68 |
||
39556
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
69 |
typedef XID RROutput; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
70 |
typedef XID RRCrtc; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
71 |
typedef XID RRMode; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
72 |
|
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
73 |
typedef unsigned long XRRModeFlags; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
74 |
|
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
75 |
typedef struct { |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
76 |
RRMode id; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
77 |
unsigned int width; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
78 |
unsigned int height; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
79 |
unsigned long dotClock; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
80 |
unsigned int hSyncStart; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
81 |
unsigned int hSyncEnd; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
82 |
unsigned int hTotal; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
83 |
unsigned int hSkew; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
84 |
unsigned int vSyncStart; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
85 |
unsigned int vSyncEnd; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
86 |
unsigned int vTotal; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
87 |
char *name; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
88 |
unsigned int nameLength; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
89 |
XRRModeFlags modeFlags; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
90 |
} XRRModeInfo; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
91 |
|
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
92 |
typedef struct { |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
93 |
Time timestamp; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
94 |
Time configTimestamp; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
95 |
int ncrtc; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
96 |
RRCrtc *crtcs; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
97 |
int noutput; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
98 |
RROutput *outputs; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
99 |
int nmode; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
100 |
XRRModeInfo *modes; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
101 |
} XRRScreenResources; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
102 |
|
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
103 |
typedef struct { |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
104 |
Time timestamp; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
105 |
RRCrtc crtc; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
106 |
char *name; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
107 |
int nameLen; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
108 |
unsigned long mm_width; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
109 |
unsigned long mm_height; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
110 |
Connection connection; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
111 |
SubpixelOrder subpixel_order; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
112 |
int ncrtc; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
113 |
RRCrtc *crtcs; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
114 |
int nclone; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
115 |
RROutput *clones; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
116 |
int nmode; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
117 |
int npreferred; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
118 |
RRMode *modes; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
119 |
} XRROutputInfo; |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
120 |
|
41793
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
121 |
typedef struct { |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
122 |
Time timestamp; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
123 |
int x, y; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
124 |
unsigned int width, height; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
125 |
RRMode mode; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
126 |
Rotation rotation; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
127 |
int noutput; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
128 |
RROutput *outputs; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
129 |
Rotation rotations; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
130 |
int npossible; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
131 |
RROutput *possible; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
132 |
} XRRCrtcInfo; |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
133 |
|
39556
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
134 |
XRRScreenResources *XRRGetScreenResources (Display *dpy, Window window); |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
135 |
|
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
136 |
void XRRFreeScreenResources (XRRScreenResources *resources); |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
137 |
|
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
138 |
XRROutputInfo * XRRGetOutputInfo (Display *dpy, XRRScreenResources *resources, |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
139 |
RROutput output); |
50963eeaefca
8022810: Cannot list all the available display modes on Ubuntu linux in case of two screen devices
ssadetsky
parents:
26751
diff
changeset
|
140 |
void XRRFreeOutputInfo (XRROutputInfo *outputInfo); |
2 | 141 |
|
41793
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
142 |
XRRCrtcInfo *XRRGetCrtcInfo (Display *dpy, XRRScreenResources *resources, |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
143 |
RRCrtc crtc); |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
144 |
void XRRFreeCrtcInfo (XRRCrtcInfo *crtcInfo); |
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
145 |
|
7b9c71553d63
8167486: Device.getDisplayMode() doesn't report refresh rate on Linux in case of dual screen
ssadetsky
parents:
39556
diff
changeset
|
146 |
|
2 | 147 |
/* internal representation is private to the library */ |
148 |
typedef struct _XRRScreenConfiguration XRRScreenConfiguration; |
|
149 |
||
150 |
Bool XRRQueryExtension (Display *dpy, int *event_basep, int *error_basep); |
|
151 |
Status XRRQueryVersion (Display *dpy, |
|
152 |
int *major_versionp, |
|
153 |
int *minor_versionp); |
|
154 |
||
155 |
XRRScreenConfiguration *XRRGetScreenInfo (Display *dpy, |
|
156 |
Drawable draw); |
|
157 |
||
158 |
void XRRFreeScreenConfigInfo (XRRScreenConfiguration *config); |
|
159 |
||
160 |
/* |
|
161 |
* Note that screen configuration changes are only permitted if the client can |
|
162 |
* prove it has up to date configuration information. We are trying to |
|
163 |
* insist that it become possible for screens to change dynamically, so |
|
164 |
* we want to ensure the client knows what it is talking about when requesting |
|
165 |
* changes. |
|
166 |
*/ |
|
167 |
Status XRRSetScreenConfig (Display *dpy, |
|
168 |
XRRScreenConfiguration *config, |
|
169 |
Drawable draw, |
|
170 |
int size_index, |
|
171 |
Rotation rotation, |
|
172 |
Time timestamp); |
|
173 |
||
174 |
/* added in v1.1, sorry for the lame name */ |
|
175 |
Status XRRSetScreenConfigAndRate (Display *dpy, |
|
176 |
XRRScreenConfiguration *config, |
|
177 |
Drawable draw, |
|
178 |
int size_index, |
|
179 |
Rotation rotation, |
|
180 |
short rate, |
|
181 |
Time timestamp); |
|
182 |
||
183 |
||
184 |
Rotation XRRConfigRotations(XRRScreenConfiguration *config, Rotation *current_rotation); |
|
185 |
||
186 |
Time XRRConfigTimes (XRRScreenConfiguration *config, Time *config_timestamp); |
|
187 |
||
188 |
XRRScreenSize *XRRConfigSizes(XRRScreenConfiguration *config, int *nsizes); |
|
189 |
||
190 |
short *XRRConfigRates (XRRScreenConfiguration *config, int sizeID, int *nrates); |
|
191 |
||
192 |
SizeID XRRConfigCurrentConfiguration (XRRScreenConfiguration *config, |
|
193 |
Rotation *rotation); |
|
194 |
||
195 |
short XRRConfigCurrentRate (XRRScreenConfiguration *config); |
|
196 |
||
197 |
int XRRRootToScreen(Display *dpy, Window root); |
|
198 |
||
199 |
/* |
|
200 |
* returns the screen configuration for the specified screen; does a lazy |
|
201 |
* evalution to delay getting the information, and caches the result. |
|
202 |
* These routines should be used in preference to XRRGetScreenInfo |
|
203 |
* to avoid unneeded round trips to the X server. These are new |
|
204 |
* in protocol version 0.1. |
|
205 |
*/ |
|
206 |
||
207 |
||
208 |
XRRScreenConfiguration *XRRScreenConfig(Display *dpy, int screen); |
|
209 |
XRRScreenConfiguration *XRRConfig(Screen *screen); |
|
210 |
void XRRSelectInput(Display *dpy, Window window, int mask); |
|
211 |
||
212 |
/* |
|
213 |
* the following are always safe to call, even if RandR is not implemented |
|
214 |
* on a screen |
|
215 |
*/ |
|
216 |
||
217 |
||
218 |
Rotation XRRRotations(Display *dpy, int screen, Rotation *current_rotation); |
|
219 |
XRRScreenSize *XRRSizes(Display *dpy, int screen, int *nsizes); |
|
220 |
short *XRRRates (Display *dpy, int screen, int sizeID, int *nrates); |
|
221 |
Time XRRTimes (Display *dpy, int screen, Time *config_timestamp); |
|
222 |
||
223 |
||
224 |
/* |
|
225 |
* intended to take RRScreenChangeNotify, or |
|
226 |
* ConfigureNotify (on the root window) |
|
227 |
* returns 1 if it is an event type it understands, 0 if not |
|
228 |
*/ |
|
229 |
int XRRUpdateConfiguration(XEvent *event); |
|
230 |
||
231 |
_XFUNCPROTOEND |
|
232 |
||
233 |
#endif /* _XRANDR_H_ */ |