First import
[xorg_rtime.git] / xorg-server-1.4 / randr / rrsdispatch.c
blob4a6a6e43ff2a7d14ec145220eb0513722796a7a2
1 /*
2 * Copyright © 2006 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
23 #include "randrstr.h"
25 static int
26 SProcRRQueryVersion (ClientPtr client)
28 register int n;
29 REQUEST(xRRQueryVersionReq);
31 swaps(&stuff->length, n);
32 swapl(&stuff->majorVersion, n);
33 swapl(&stuff->minorVersion, n);
34 return (*ProcRandrVector[stuff->randrReqType]) (client);
37 static int
38 SProcRRGetScreenInfo (ClientPtr client)
40 register int n;
41 REQUEST(xRRGetScreenInfoReq);
43 swaps(&stuff->length, n);
44 swapl(&stuff->window, n);
45 return (*ProcRandrVector[stuff->randrReqType]) (client);
48 static int
49 SProcRRSetScreenConfig (ClientPtr client)
51 register int n;
52 REQUEST(xRRSetScreenConfigReq);
54 if (RRClientKnowsRates (client))
56 REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
57 swaps (&stuff->rate, n);
59 else
61 REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
64 swaps(&stuff->length, n);
65 swapl(&stuff->drawable, n);
66 swapl(&stuff->timestamp, n);
67 swaps(&stuff->sizeID, n);
68 swaps(&stuff->rotation, n);
69 return (*ProcRandrVector[stuff->randrReqType]) (client);
72 static int
73 SProcRRSelectInput (ClientPtr client)
75 register int n;
76 REQUEST(xRRSelectInputReq);
78 swaps(&stuff->length, n);
79 swapl(&stuff->window, n);
80 swaps(&stuff->enable, n);
81 return (*ProcRandrVector[stuff->randrReqType]) (client);
84 static int
85 SProcRRGetScreenSizeRange (ClientPtr client)
87 REQUEST(xRRGetScreenSizeRangeReq);
89 REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
90 (void) stuff;
91 return BadImplementation;
94 static int
95 SProcRRSetScreenSize (ClientPtr client)
97 REQUEST(xRRSetScreenSizeReq);
99 REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
100 (void) stuff;
101 return BadImplementation;
104 static int
105 SProcRRGetScreenResources (ClientPtr client)
107 REQUEST(xRRGetScreenResourcesReq);
109 REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
110 (void) stuff;
111 return BadImplementation;
114 static int
115 SProcRRGetOutputInfo (ClientPtr client)
117 REQUEST(xRRGetOutputInfoReq);;
119 REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
120 (void) stuff;
121 return BadImplementation;
124 static int
125 SProcRRListOutputProperties (ClientPtr client)
127 REQUEST(xRRListOutputPropertiesReq);
129 REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
130 (void) stuff;
131 return BadImplementation;
134 static int
135 SProcRRQueryOutputProperty (ClientPtr client)
137 REQUEST(xRRQueryOutputPropertyReq);
139 REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
140 (void) stuff;
141 return BadImplementation;
144 static int
145 SProcRRConfigureOutputProperty (ClientPtr client)
147 REQUEST(xRRConfigureOutputPropertyReq);
149 REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq);
150 (void) stuff;
151 return BadImplementation;
154 static int
155 SProcRRChangeOutputProperty (ClientPtr client)
157 REQUEST(xRRChangeOutputPropertyReq);
159 REQUEST_SIZE_MATCH(xRRChangeOutputPropertyReq);
160 (void) stuff;
161 return BadImplementation;
164 static int
165 SProcRRDeleteOutputProperty (ClientPtr client)
167 REQUEST(xRRDeleteOutputPropertyReq);
169 REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
170 (void) stuff;
171 return BadImplementation;
174 static int
175 SProcRRGetOutputProperty (ClientPtr client)
177 REQUEST(xRRGetOutputPropertyReq);
179 REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
180 (void) stuff;
181 return BadImplementation;
184 static int
185 SProcRRCreateMode (ClientPtr client)
187 REQUEST(xRRCreateModeReq);
189 REQUEST_SIZE_MATCH(xRRCreateModeReq);
190 (void) stuff;
191 return BadImplementation;
194 static int
195 SProcRRDestroyMode (ClientPtr client)
197 REQUEST(xRRDestroyModeReq);
199 REQUEST_SIZE_MATCH(xRRDestroyModeReq);
200 (void) stuff;
201 return BadImplementation;
204 static int
205 SProcRRAddOutputMode (ClientPtr client)
207 REQUEST(xRRAddOutputModeReq);
209 REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
210 (void) stuff;
211 return BadImplementation;
214 static int
215 SProcRRDeleteOutputMode (ClientPtr client)
217 REQUEST(xRRDeleteOutputModeReq);
219 REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
220 (void) stuff;
221 return BadImplementation;
224 static int
225 SProcRRGetCrtcInfo (ClientPtr client)
227 REQUEST(xRRGetCrtcInfoReq);
229 REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
230 (void) stuff;
231 return BadImplementation;
234 static int
235 SProcRRSetCrtcConfig (ClientPtr client)
237 REQUEST(xRRSetCrtcConfigReq);
239 REQUEST_SIZE_MATCH(xRRSetCrtcConfigReq);
240 (void) stuff;
241 return BadImplementation;
244 static int
245 SProcRRGetCrtcGammaSize (ClientPtr client)
247 REQUEST(xRRGetCrtcGammaSizeReq);
249 REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
250 (void) stuff;
251 return BadImplementation;
254 static int
255 SProcRRGetCrtcGamma (ClientPtr client)
257 REQUEST(xRRGetCrtcGammaReq);
259 REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
260 (void) stuff;
261 return BadImplementation;
264 static int
265 SProcRRSetCrtcGamma (ClientPtr client)
267 REQUEST(xRRSetCrtcGammaReq);
269 REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq);
270 (void) stuff;
271 return BadImplementation;
274 int (*SProcRandrVector[RRNumberRequests])(ClientPtr) = {
275 SProcRRQueryVersion, /* 0 */
276 /* we skip 1 to make old clients fail pretty immediately */
277 NULL, /* 1 SProcRandrOldGetScreenInfo */
278 /* V1.0 apps share the same set screen config request id */
279 SProcRRSetScreenConfig, /* 2 */
280 NULL, /* 3 SProcRandrOldScreenChangeSelectInput */
281 /* 3 used to be ScreenChangeSelectInput; deprecated */
282 SProcRRSelectInput, /* 4 */
283 SProcRRGetScreenInfo, /* 5 */
284 /* V1.2 additions */
285 SProcRRGetScreenSizeRange, /* 6 */
286 SProcRRSetScreenSize, /* 7 */
287 SProcRRGetScreenResources, /* 8 */
288 SProcRRGetOutputInfo, /* 9 */
289 SProcRRListOutputProperties,/* 10 */
290 SProcRRQueryOutputProperty, /* 11 */
291 SProcRRConfigureOutputProperty, /* 12 */
292 SProcRRChangeOutputProperty,/* 13 */
293 SProcRRDeleteOutputProperty,/* 14 */
294 SProcRRGetOutputProperty, /* 15 */
295 SProcRRCreateMode, /* 16 */
296 SProcRRDestroyMode, /* 17 */
297 SProcRRAddOutputMode, /* 18 */
298 SProcRRDeleteOutputMode, /* 19 */
299 SProcRRGetCrtcInfo, /* 20 */
300 SProcRRSetCrtcConfig, /* 21 */
301 SProcRRGetCrtcGammaSize, /* 22 */
302 SProcRRGetCrtcGamma, /* 23 */
303 SProcRRSetCrtcGamma, /* 24 */