rrsdispatch.c revision 05b261ec
1/*
2 * Copyright © 2006 Keith Packard
3 *
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.
13 *
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.
21 */
22
23#include "randrstr.h"
24
25static int
26SProcRRQueryVersion (ClientPtr client)
27{
28    register int n;
29    REQUEST(xRRQueryVersionReq);
30
31    swaps(&stuff->length, n);
32    swapl(&stuff->majorVersion, n);
33    swapl(&stuff->minorVersion, n);
34    return (*ProcRandrVector[stuff->randrReqType]) (client);
35}
36
37static int
38SProcRRGetScreenInfo (ClientPtr client)
39{
40    register int n;
41    REQUEST(xRRGetScreenInfoReq);
42
43    swaps(&stuff->length, n);
44    swapl(&stuff->window, n);
45    return (*ProcRandrVector[stuff->randrReqType]) (client);
46}
47
48static int
49SProcRRSetScreenConfig (ClientPtr client)
50{
51    register int n;
52    REQUEST(xRRSetScreenConfigReq);
53
54    if (RRClientKnowsRates (client))
55    {
56	REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
57	swaps (&stuff->rate, n);
58    }
59    else
60    {
61	REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
62    }
63
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);
70}
71
72static int
73SProcRRSelectInput (ClientPtr client)
74{
75    register int n;
76    REQUEST(xRRSelectInputReq);
77
78    swaps(&stuff->length, n);
79    swapl(&stuff->window, n);
80    swaps(&stuff->enable, n);
81    return (*ProcRandrVector[stuff->randrReqType]) (client);
82}
83
84static int
85SProcRRGetScreenSizeRange (ClientPtr client)
86{
87    REQUEST(xRRGetScreenSizeRangeReq);
88
89    REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
90    (void) stuff;
91    return BadImplementation;
92}
93
94static int
95SProcRRSetScreenSize (ClientPtr client)
96{
97    REQUEST(xRRSetScreenSizeReq);
98
99    REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
100    (void) stuff;
101    return BadImplementation;
102}
103
104static int
105SProcRRGetScreenResources (ClientPtr client)
106{
107    REQUEST(xRRGetScreenResourcesReq);
108
109    REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
110    (void) stuff;
111    return BadImplementation;
112}
113
114static int
115SProcRRGetOutputInfo (ClientPtr client)
116{
117    REQUEST(xRRGetOutputInfoReq);;
118
119    REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
120    (void) stuff;
121    return BadImplementation;
122}
123
124static int
125SProcRRListOutputProperties (ClientPtr client)
126{
127    REQUEST(xRRListOutputPropertiesReq);
128
129    REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
130    (void) stuff;
131    return BadImplementation;
132}
133
134static int
135SProcRRQueryOutputProperty (ClientPtr client)
136{
137    REQUEST(xRRQueryOutputPropertyReq);
138
139    REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
140    (void) stuff;
141    return BadImplementation;
142}
143
144static int
145SProcRRConfigureOutputProperty (ClientPtr client)
146{
147    REQUEST(xRRConfigureOutputPropertyReq);
148
149    REQUEST_SIZE_MATCH(xRRConfigureOutputPropertyReq);
150    (void) stuff;
151    return BadImplementation;
152}
153
154static int
155SProcRRChangeOutputProperty (ClientPtr client)
156{
157    REQUEST(xRRChangeOutputPropertyReq);
158
159    REQUEST_SIZE_MATCH(xRRChangeOutputPropertyReq);
160    (void) stuff;
161    return BadImplementation;
162}
163
164static int
165SProcRRDeleteOutputProperty (ClientPtr client)
166{
167    REQUEST(xRRDeleteOutputPropertyReq);
168
169    REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
170    (void) stuff;
171    return BadImplementation;
172}
173
174static int
175SProcRRGetOutputProperty (ClientPtr client)
176{
177    REQUEST(xRRGetOutputPropertyReq);
178
179    REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
180    (void) stuff;
181    return BadImplementation;
182}
183
184static int
185SProcRRCreateMode (ClientPtr client)
186{
187    REQUEST(xRRCreateModeReq);
188
189    REQUEST_SIZE_MATCH(xRRCreateModeReq);
190    (void) stuff;
191    return BadImplementation;
192}
193
194static int
195SProcRRDestroyMode (ClientPtr client)
196{
197    REQUEST(xRRDestroyModeReq);
198
199    REQUEST_SIZE_MATCH(xRRDestroyModeReq);
200    (void) stuff;
201    return BadImplementation;
202}
203
204static int
205SProcRRAddOutputMode (ClientPtr client)
206{
207    REQUEST(xRRAddOutputModeReq);
208
209    REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
210    (void) stuff;
211    return BadImplementation;
212}
213
214static int
215SProcRRDeleteOutputMode (ClientPtr client)
216{
217    REQUEST(xRRDeleteOutputModeReq);
218
219    REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
220    (void) stuff;
221    return BadImplementation;
222}
223
224static int
225SProcRRGetCrtcInfo (ClientPtr client)
226{
227    REQUEST(xRRGetCrtcInfoReq);
228
229    REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
230    (void) stuff;
231    return BadImplementation;
232}
233
234static int
235SProcRRSetCrtcConfig (ClientPtr client)
236{
237    REQUEST(xRRSetCrtcConfigReq);
238
239    REQUEST_SIZE_MATCH(xRRSetCrtcConfigReq);
240    (void) stuff;
241    return BadImplementation;
242}
243
244static int
245SProcRRGetCrtcGammaSize (ClientPtr client)
246{
247    REQUEST(xRRGetCrtcGammaSizeReq);
248
249    REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
250    (void) stuff;
251    return BadImplementation;
252}
253
254static int
255SProcRRGetCrtcGamma (ClientPtr client)
256{
257    REQUEST(xRRGetCrtcGammaReq);
258
259    REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
260    (void) stuff;
261    return BadImplementation;
262}
263
264static int
265SProcRRSetCrtcGamma (ClientPtr client)
266{
267    REQUEST(xRRSetCrtcGammaReq);
268
269    REQUEST_SIZE_MATCH(xRRSetCrtcGammaReq);
270    (void) stuff;
271    return BadImplementation;
272}
273
274int (*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 */
304};
305
306