-
Notifications
You must be signed in to change notification settings - Fork 3
/
XineramaApi.txt
186 lines (129 loc) · 6.5 KB
/
XineramaApi.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
Xinerama API
(Proposal)
X.org Xinerama Task Force
Last Modified
20 May 2002
X.org Standards Process Status:
Stage 4: Public Review
Draft Standard Version 0.8
Authors:
Jay Cotton, Sun Microsystems, Inc.
John McKernan, Sun Microsystems, Inc.
Rob Lembree, Digital Equipment Corporation.
Yanjun Zhang. Sun Microsystems, Inc.
Paul Anderson, Hewlett Packard Inc.
Mark Vojkovich, The XFree86 Project, Inc.
Heather Lanigan, Hewlett Packard
Distributed under the TOG X License, used by the X Window System, as follows:
Copyright @ 2000 Sun Microsystems, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense , and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Trademarks are property of their respective holders.
1. Overview
The Xinerama extension provides a way for a multi-headed system to function
as one large screen. Windows can span multiple screens and can move from one
screen to another.
Xinerama requires a homogeneous graphics environment to operate. A homogeneous
environment is one in which a common set of visuals, depths and screen sizes
can be found. It is required that at least one common visual is present on
each card. These can be 8 bit pseudo color, or 24 bit true color etc. A mix of
8 and 24 bit visuals is allowed, but all cards need to support at least one
common visual ID. Xinerama will find and use the intersection of the lowest
common set of visual IDs. It is undesirable to run Xinerama with dissimilar
screen sizes, changes in screen size can confuse window managers.
For the purpose of Xinerama, a screen is defined as a set of frambuffers
joined logically as a single work surface.
2. Xinerama Functions
Bool XineramaQueryExtension(display,event_base,error_base)
Display *display;
int *event_base, *error_base;
display Specifies the connection to the Xserver.
event_base Specifies the return location for the assigned base event
error_base Specifies the return location for the assigned base error
The XineramaQueryExtension function queries the Xserver to determine the
availability of the Xinerama Extension. If the extension is available, the
return value is TRUE, and event_base and error_base are set to the base event
number and base error number for the extension, respectively. Otherwise, the
return value is FALSE, and the values of event_base and error_base are
undefined.
Status XineramaQueryVersion(display,major_version,minor_version)
Display *display;
int *major_version, *minor_version;
display Specifies the connection to the Xserver.
major_version Specifies the return location for the extension major version.
minor_version Specifies the return location for the extension minor version.
The XineramaQueryVersion function returns the version of the Xinerama extension
implemented by the Xserver. The version is returned in major_version and
minor_version. The major version and minor version for this specification are
'1' and '2', respectively. The major version will be incremented for protocol
incompatible changes, and the minor version will be incremented for small,
upwardly compatible changes.
Status returned is Success for all okay.
BOOL XineramaActive(display,win)
Display *display;
Window win;
display Specifies the connection to the Xserver.
win Specifies any window.
The XineramaActive function returns a Boolean operator used to determine if
Xinerama is activated on the screen. Returns TRUE for active and FALSE for not
active. BadWindow is returned for an invalid window.
Status XineramaGetData(display, win, framebuffer_rects, num_framebuffers)
Display *display;
Window win;
XRectangle **framebuffer_rects;
int *number_framebuffers;
display Specifies the connection to the Xserver.
win Specifies any window.
The XineramaGetData function uses the two pointers below to return info about
each individual framebuffer within the Xinerama Screen.
framebuffer_rects An array of rects, one for each framebuffer in the order
that the framebuffers are specified on the Xserver
command line.
num_framebuffers The number of framebuffers managed by Xinerama
for this Screen.
Use XFree() to release the memory.
Return Status will be Success for no error, and BadWindow for invalid window,
BadAlloc for memory allocation failure.
Status XineramaGetCenterHint(display, root_window, x, y)
Display * display;
Window root_window;
int * x;
int * y;
display Specifies the connection to the Xserver.
root_window Specifies the root window.
x Used to return value of x
y Used to return value of y
The XineramaGetCenterHint function returns x and y to indicate where a window
that wants to display in the "center" should be centered.
The Xinerama center hint is also a root window property. The property ATOM is
called XINERAMA_CENTER_HINT. The property format is 2 16-bit integers the
X coordinate followed by the Y coordinate.
Status is Success for everything okay, and BadWindow if the window is invalid.
void XineramaSetCenterHint(display, root_window, x, y)
Display * display;
Window root_window;
int x;
int y;
display Specifies the connection to the Xserver.
root_window Specifies the root window.
x Value of x
y Value of y
The XineramaSetCenterHint allows for setting of the XINERAMA_CENTER_HINT atom
based on given x and y.
The Xinerama center hint is also a root window property. The property ATOM is
called XINERAMA_CENTER_HINT. The property format is 2 16-bit integers the
X coordinate followed by the Y coordinate.
BadWindow is returned if the window is invalid.