tables.c revision 4642e01f
1/***********************************************************
2
3Copyright 1987, 1998  The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25
26Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
27
28                        All Rights Reserved
29
30Permission to use, copy, modify, and distribute this software and its
31documentation for any purpose and without fee is hereby granted,
32provided that the above copyright notice appear in all copies and that
33both that copyright notice and this permission notice appear in
34supporting documentation, and that the name of Digital not be
35used in advertising or publicity pertaining to distribution of the
36software without specific, written prior permission.
37
38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
44SOFTWARE.
45
46******************************************************************/
47
48#ifdef HAVE_DIX_CONFIG_H
49#include <dix-config.h>
50#endif
51
52#include <X11/X.h>
53#define NEED_EVENTS
54#define NEED_REPLIES
55#include <X11/Xproto.h>
56#include "windowstr.h"
57#include "extnsionst.h"
58#include "dixstruct.h"
59#include "dixevents.h"
60#include "dispatch.h"
61#include "swaprep.h"
62#include "swapreq.h"
63
64int (* InitialVector[3]) (
65	ClientPtr /* client */
66    ) =
67{
68    0,
69    ProcInitialConnection,
70    ProcEstablishConnection
71};
72
73int (* ProcVector[256]) (
74	ClientPtr /* client */
75    ) =
76{
77    ProcBadRequest,
78    ProcCreateWindow,
79    ProcChangeWindowAttributes,
80    ProcGetWindowAttributes,
81    ProcDestroyWindow,
82    ProcDestroySubwindows,		/* 5 */
83    ProcChangeSaveSet,
84    ProcReparentWindow,
85    ProcMapWindow,
86    ProcMapSubwindows,
87    ProcUnmapWindow,			/* 10 */
88    ProcUnmapSubwindows,
89    ProcConfigureWindow,
90    ProcCirculateWindow,
91    ProcGetGeometry,
92    ProcQueryTree,			/* 15 */
93    ProcInternAtom,
94    ProcGetAtomName,
95    ProcChangeProperty,
96    ProcDeleteProperty,
97    ProcGetProperty,			/* 20 */
98    ProcListProperties,
99    ProcSetSelectionOwner,
100    ProcGetSelectionOwner,
101    ProcConvertSelection,
102    ProcSendEvent,			/* 25 */
103    ProcGrabPointer,
104    ProcUngrabPointer,
105    ProcGrabButton,
106    ProcUngrabButton,
107    ProcChangeActivePointerGrab,	/* 30 */
108    ProcGrabKeyboard,
109    ProcUngrabKeyboard,
110    ProcGrabKey,
111    ProcUngrabKey,
112    ProcAllowEvents,			/* 35 */
113    ProcGrabServer,
114    ProcUngrabServer,
115    ProcQueryPointer,
116    ProcGetMotionEvents,
117    ProcTranslateCoords,		/* 40 */
118    ProcWarpPointer,
119    ProcSetInputFocus,
120    ProcGetInputFocus,
121    ProcQueryKeymap,
122    ProcOpenFont,			/* 45 */
123    ProcCloseFont,
124    ProcQueryFont,
125    ProcQueryTextExtents,
126    ProcListFonts,
127    ProcListFontsWithInfo,		/* 50 */
128    ProcSetFontPath,
129    ProcGetFontPath,
130    ProcCreatePixmap,
131    ProcFreePixmap,
132    ProcCreateGC,			/* 55 */
133    ProcChangeGC,
134    ProcCopyGC,
135    ProcSetDashes,
136    ProcSetClipRectangles,
137    ProcFreeGC,				/* 60 */
138    ProcClearToBackground,
139    ProcCopyArea,
140    ProcCopyPlane,
141    ProcPolyPoint,
142    ProcPolyLine,			/* 65 */
143    ProcPolySegment,
144    ProcPolyRectangle,
145    ProcPolyArc,
146    ProcFillPoly,
147    ProcPolyFillRectangle,		/* 70 */
148    ProcPolyFillArc,
149    ProcPutImage,
150    ProcGetImage,
151    ProcPolyText,
152    ProcPolyText,			/* 75 */
153    ProcImageText8,
154    ProcImageText16,
155    ProcCreateColormap,
156    ProcFreeColormap,
157    ProcCopyColormapAndFree,		/* 80 */
158    ProcInstallColormap,
159    ProcUninstallColormap,
160    ProcListInstalledColormaps,
161    ProcAllocColor,
162    ProcAllocNamedColor,		/* 85 */
163    ProcAllocColorCells,
164    ProcAllocColorPlanes,
165    ProcFreeColors,
166    ProcStoreColors,
167    ProcStoreNamedColor,		/* 90 */
168    ProcQueryColors,
169    ProcLookupColor,
170    ProcCreateCursor,
171    ProcCreateGlyphCursor,
172    ProcFreeCursor,			/* 95 */
173    ProcRecolorCursor,
174    ProcQueryBestSize,
175    ProcQueryExtension,
176    ProcListExtensions,
177    ProcChangeKeyboardMapping,		/* 100 */
178    ProcGetKeyboardMapping,
179    ProcChangeKeyboardControl,
180    ProcGetKeyboardControl,
181    ProcBell,
182    ProcChangePointerControl,		/* 105 */
183    ProcGetPointerControl,
184    ProcSetScreenSaver,
185    ProcGetScreenSaver,
186    ProcChangeHosts,
187    ProcListHosts,			/* 110 */
188    ProcChangeAccessControl,
189    ProcChangeCloseDownMode,
190    ProcKillClient,
191    ProcRotateProperties,
192    ProcForceScreenSaver,		/* 115 */
193    ProcSetPointerMapping,
194    ProcGetPointerMapping,
195    ProcSetModifierMapping,
196    ProcGetModifierMapping,
197    0,					/* 120 */
198    0,
199    0,
200    0,
201    0,
202    0,					/* 125 */
203    0,
204    ProcNoOperation
205};
206
207int (* SwappedProcVector[256]) (
208	ClientPtr /* client */
209    ) =
210{
211    ProcBadRequest,
212    SProcCreateWindow,
213    SProcChangeWindowAttributes,
214    SProcResourceReq,			/* GetWindowAttributes */
215    SProcResourceReq,			/* DestroyWindow */
216    SProcResourceReq,			/* 5 DestroySubwindows */
217    SProcResourceReq,			/* SProcChangeSaveSet, */
218    SProcReparentWindow,
219    SProcResourceReq,			/* MapWindow */
220    SProcResourceReq,			/* MapSubwindows */
221    SProcResourceReq,			/* 10 UnmapWindow */
222    SProcResourceReq,			/* UnmapSubwindows */
223    SProcConfigureWindow,
224    SProcResourceReq,			/* SProcCirculateWindow, */
225    SProcResourceReq,			/* GetGeometry */
226    SProcResourceReq,			/* 15 QueryTree */
227    SProcInternAtom,
228    SProcResourceReq,			/* SProcGetAtomName, */
229    SProcChangeProperty,
230    SProcDeleteProperty,
231    SProcGetProperty,			/* 20 */
232    SProcResourceReq,			/* SProcListProperties, */
233    SProcSetSelectionOwner,
234    SProcResourceReq, 			/* SProcGetSelectionOwner, */
235    SProcConvertSelection,
236    SProcSendEvent,			/* 25 */
237    SProcGrabPointer,
238    SProcResourceReq, 			/* SProcUngrabPointer, */
239    SProcGrabButton,
240    SProcUngrabButton,
241    SProcChangeActivePointerGrab,	/* 30 */
242    SProcGrabKeyboard,
243    SProcResourceReq,			/* SProcUngrabKeyboard, */
244    SProcGrabKey,
245    SProcUngrabKey,
246    SProcResourceReq,			/* 35 SProcAllowEvents, */
247    SProcSimpleReq,			/* SProcGrabServer, */
248    SProcSimpleReq,			/* SProcUngrabServer, */
249    SProcResourceReq,			/* SProcQueryPointer, */
250    SProcGetMotionEvents,
251    SProcTranslateCoords,		/*40 */
252    SProcWarpPointer,
253    SProcSetInputFocus,
254    SProcSimpleReq,			/* SProcGetInputFocus, */
255    SProcSimpleReq,			/* QueryKeymap, */
256    SProcOpenFont,			/* 45 */
257    SProcResourceReq,			/* SProcCloseFont, */
258    SProcResourceReq, 			/* SProcQueryFont, */
259    SProcResourceReq,			/* SProcQueryTextExtents,  */
260    SProcListFonts,
261    SProcListFontsWithInfo,		/* 50 */
262    SProcSetFontPath,
263    SProcSimpleReq,			/* GetFontPath, */
264    SProcCreatePixmap,
265    SProcResourceReq,			/* SProcFreePixmap, */
266    SProcCreateGC,			/* 55 */
267    SProcChangeGC,
268    SProcCopyGC,
269    SProcSetDashes,
270    SProcSetClipRectangles,
271    SProcResourceReq,			/* 60 SProcFreeGC, */
272    SProcClearToBackground,
273    SProcCopyArea,
274    SProcCopyPlane,
275    SProcPoly,				/* PolyPoint, */
276    SProcPoly,				/* 65 PolyLine */
277    SProcPoly,				/* PolySegment, */
278    SProcPoly,				/* PolyRectangle, */
279    SProcPoly,				/* PolyArc, */
280    SProcFillPoly,
281    SProcPoly,				/* 70 PolyFillRectangle */
282    SProcPoly,				/* PolyFillArc, */
283    SProcPutImage,
284    SProcGetImage,
285    SProcPolyText,
286    SProcPolyText,			/* 75 */
287    SProcImageText,
288    SProcImageText,
289    SProcCreateColormap,
290    SProcResourceReq,			/* SProcFreeColormap, */
291    SProcCopyColormapAndFree,		/* 80 */
292    SProcResourceReq,			/* SProcInstallColormap, */
293    SProcResourceReq,			/* SProcUninstallColormap, */
294    SProcResourceReq, 			/* SProcListInstalledColormaps, */
295    SProcAllocColor,
296    SProcAllocNamedColor,		/* 85 */
297    SProcAllocColorCells,
298    SProcAllocColorPlanes,
299    SProcFreeColors,
300    SProcStoreColors,
301    SProcStoreNamedColor,		/* 90 */
302    SProcQueryColors,
303    SProcLookupColor,
304    SProcCreateCursor,
305    SProcCreateGlyphCursor,
306    SProcResourceReq,			/* 95 SProcFreeCursor, */
307    SProcRecolorCursor,
308    SProcQueryBestSize,
309    SProcQueryExtension,
310    SProcSimpleReq,			/* ListExtensions, */
311    SProcChangeKeyboardMapping,		/* 100 */
312    SProcSimpleReq,			/* GetKeyboardMapping, */
313    SProcChangeKeyboardControl,
314    SProcSimpleReq,			/* GetKeyboardControl, */
315    SProcSimpleReq,			/* Bell, */
316    SProcChangePointerControl,		/* 105 */
317    SProcSimpleReq,			/* GetPointerControl, */
318    SProcSetScreenSaver,
319    SProcSimpleReq,			/* GetScreenSaver, */
320    SProcChangeHosts,
321    SProcSimpleReq,			/* 110 ListHosts, */
322    SProcSimpleReq,			/* SProcChangeAccessControl, */
323    SProcSimpleReq,			/* SProcChangeCloseDownMode, */
324    SProcResourceReq,			/* SProcKillClient, */
325    SProcRotateProperties,
326    SProcSimpleReq,			/* 115 ForceScreenSaver */
327    SProcSimpleReq,			/* SetPointerMapping, */
328    SProcSimpleReq,			/* GetPointerMapping, */
329    SProcSimpleReq,			/* SetModifierMapping, */
330    SProcSimpleReq,			/* GetModifierMapping, */
331    0,					/* 120 */
332    0,
333    0,
334    0,
335    0,
336    0,					/* 125 */
337    0,
338    SProcNoOperation
339};
340
341_X_EXPORT EventSwapPtr EventSwapVector[128] =
342{
343    (EventSwapPtr)SErrorEvent,
344    NotImplemented,
345    SKeyButtonPtrEvent,
346    SKeyButtonPtrEvent,
347    SKeyButtonPtrEvent,
348    SKeyButtonPtrEvent,			/* 5 */
349    SKeyButtonPtrEvent,
350    SEnterLeaveEvent,
351    SEnterLeaveEvent,
352    SFocusEvent,
353    SFocusEvent,			/* 10 */
354    SKeymapNotifyEvent,
355    SExposeEvent,
356    SGraphicsExposureEvent,
357    SNoExposureEvent,
358    SVisibilityEvent,			/* 15 */
359    SCreateNotifyEvent,
360    SDestroyNotifyEvent,
361    SUnmapNotifyEvent,
362    SMapNotifyEvent,
363    SMapRequestEvent,			/* 20 */
364    SReparentEvent,
365    SConfigureNotifyEvent,
366    SConfigureRequestEvent,
367    SGravityEvent,
368    SResizeRequestEvent,		/* 25 */
369    SCirculateEvent,
370    SCirculateEvent,
371    SPropertyEvent,
372    SSelectionClearEvent,
373    SSelectionRequestEvent,		/* 30 */
374    SSelectionNotifyEvent,
375    SColormapEvent,
376    SClientMessageEvent,
377    SMappingEvent,
378};
379
380
381ReplySwapPtr ReplySwapVector[256] =
382{
383    ReplyNotSwappd,
384    ReplyNotSwappd,
385    ReplyNotSwappd,
386    (ReplySwapPtr)SGetWindowAttributesReply,
387    ReplyNotSwappd,
388    ReplyNotSwappd,				/* 5 */
389    ReplyNotSwappd,
390    ReplyNotSwappd,
391    ReplyNotSwappd,
392    ReplyNotSwappd,
393    ReplyNotSwappd,				/* 10 */
394    ReplyNotSwappd,
395    ReplyNotSwappd,
396    ReplyNotSwappd,
397    (ReplySwapPtr)SGetGeometryReply,
398    (ReplySwapPtr)SQueryTreeReply,		/* 15 */
399    (ReplySwapPtr)SInternAtomReply,
400    (ReplySwapPtr)SGetAtomNameReply,
401    ReplyNotSwappd,
402    ReplyNotSwappd,
403    (ReplySwapPtr)SGetPropertyReply,		/* 20 */
404    (ReplySwapPtr)SListPropertiesReply,
405    ReplyNotSwappd,
406    (ReplySwapPtr)SGetSelectionOwnerReply,
407    ReplyNotSwappd,
408    ReplyNotSwappd,				/* 25 */
409    (ReplySwapPtr)SGenericReply,		/* SGrabPointerReply, */
410    ReplyNotSwappd,
411    ReplyNotSwappd,
412    ReplyNotSwappd,
413    ReplyNotSwappd,				/* 30 */
414    (ReplySwapPtr)SGenericReply,		/* SGrabKeyboardReply, */
415    ReplyNotSwappd,
416    ReplyNotSwappd,
417    ReplyNotSwappd,
418    ReplyNotSwappd,				/* 35 */
419    ReplyNotSwappd,
420    ReplyNotSwappd,
421    (ReplySwapPtr)SQueryPointerReply,
422    (ReplySwapPtr)SGetMotionEventsReply,
423    (ReplySwapPtr)STranslateCoordsReply,	/* 40 */
424    ReplyNotSwappd,
425    ReplyNotSwappd,
426    (ReplySwapPtr)SGetInputFocusReply,
427    (ReplySwapPtr)SQueryKeymapReply,
428    ReplyNotSwappd,				/* 45 */
429    ReplyNotSwappd,
430    (ReplySwapPtr)SQueryFontReply,
431    (ReplySwapPtr)SQueryTextExtentsReply,
432    (ReplySwapPtr)SListFontsReply,
433    (ReplySwapPtr)SListFontsWithInfoReply,	/* 50 */
434    ReplyNotSwappd,
435    (ReplySwapPtr)SGetFontPathReply,
436    ReplyNotSwappd,
437    ReplyNotSwappd,
438    ReplyNotSwappd,				/* 55 */
439    ReplyNotSwappd,
440    ReplyNotSwappd,
441    ReplyNotSwappd,
442    ReplyNotSwappd,
443    ReplyNotSwappd,				/* 60 */
444    ReplyNotSwappd,
445    ReplyNotSwappd,
446    ReplyNotSwappd,
447    ReplyNotSwappd,
448    ReplyNotSwappd,				/* 65 */
449    ReplyNotSwappd,
450    ReplyNotSwappd,
451    ReplyNotSwappd,
452    ReplyNotSwappd,
453    ReplyNotSwappd,				/* 70 */
454    ReplyNotSwappd,
455    ReplyNotSwappd,
456    (ReplySwapPtr)SGetImageReply,
457    ReplyNotSwappd,
458    ReplyNotSwappd,				/* 75 */
459    ReplyNotSwappd,
460    ReplyNotSwappd,
461    ReplyNotSwappd,
462    ReplyNotSwappd,
463    ReplyNotSwappd,				/* 80 */
464    ReplyNotSwappd,
465    ReplyNotSwappd,
466    (ReplySwapPtr)SListInstalledColormapsReply,
467    (ReplySwapPtr)SAllocColorReply,
468    (ReplySwapPtr)SAllocNamedColorReply,	/* 85 */
469    (ReplySwapPtr)SAllocColorCellsReply,
470    (ReplySwapPtr)SAllocColorPlanesReply,
471    ReplyNotSwappd,
472    ReplyNotSwappd,
473    ReplyNotSwappd,				/* 90 */
474    (ReplySwapPtr)SQueryColorsReply,
475    (ReplySwapPtr)SLookupColorReply,
476    ReplyNotSwappd,
477    ReplyNotSwappd,
478    ReplyNotSwappd,				/* 95 */
479    ReplyNotSwappd,
480    (ReplySwapPtr)SQueryBestSizeReply,
481    (ReplySwapPtr)SGenericReply,		/* SQueryExtensionReply, */
482    (ReplySwapPtr)SListExtensionsReply,
483    ReplyNotSwappd,				/* 100 */
484    (ReplySwapPtr)SGetKeyboardMappingReply,
485    ReplyNotSwappd,
486    (ReplySwapPtr)SGetKeyboardControlReply,
487    ReplyNotSwappd,
488    ReplyNotSwappd,				/* 105 */
489    (ReplySwapPtr)SGetPointerControlReply,
490    ReplyNotSwappd,
491    (ReplySwapPtr)SGetScreenSaverReply,
492    ReplyNotSwappd,
493    (ReplySwapPtr)SListHostsReply,		/* 110 */
494    ReplyNotSwappd,
495    ReplyNotSwappd,
496    ReplyNotSwappd,
497    ReplyNotSwappd,
498    ReplyNotSwappd,				/* 115 */
499    (ReplySwapPtr)SGenericReply,		/* SetPointerMapping */
500    (ReplySwapPtr)SGetPointerMappingReply,
501    (ReplySwapPtr)SGenericReply,		/* SetModifierMapping */
502    (ReplySwapPtr)SGetModifierMappingReply,	/* 119 */
503    ReplyNotSwappd,				/* 120 */
504    ReplyNotSwappd,				/* 121 */
505    ReplyNotSwappd,				/* 122 */
506    ReplyNotSwappd,				/* 123 */
507    ReplyNotSwappd,				/* 124 */
508    ReplyNotSwappd,				/* 125 */
509    ReplyNotSwappd,				/* 126 */
510    ReplyNotSwappd,				/* NoOperation */
511    ReplyNotSwappd
512};
513