105b261ecSmrg/************************************************************ 205b261ecSmrg 305b261ecSmrgCopyright 1987, 1998 The Open Group 405b261ecSmrg 505b261ecSmrgPermission to use, copy, modify, distribute, and sell this software and its 605b261ecSmrgdocumentation for any purpose is hereby granted without fee, provided that 705b261ecSmrgthe above copyright notice appear in all copies and that both that 805b261ecSmrgcopyright notice and this permission notice appear in supporting 905b261ecSmrgdocumentation. 1005b261ecSmrg 1105b261ecSmrgThe above copyright notice and this permission notice shall be included in 1205b261ecSmrgall copies or substantial portions of the Software. 1305b261ecSmrg 1405b261ecSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1505b261ecSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1605b261ecSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1705b261ecSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 1805b261ecSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 1905b261ecSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 2005b261ecSmrg 2105b261ecSmrgExcept as contained in this notice, the name of The Open Group shall not be 2205b261ecSmrgused in advertising or otherwise to promote the sale, use or other dealings 2305b261ecSmrgin this Software without prior written authorization from The Open Group. 2405b261ecSmrg 2505b261ecSmrgCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 2605b261ecSmrg 2705b261ecSmrg All Rights Reserved 2805b261ecSmrg 2935c4bbdfSmrgPermission to use, copy, modify, and distribute this software and its 3035c4bbdfSmrgdocumentation for any purpose and without fee is hereby granted, 3105b261ecSmrgprovided that the above copyright notice appear in all copies and that 3235c4bbdfSmrgboth that copyright notice and this permission notice appear in 3305b261ecSmrgsupporting documentation, and that the name of Digital not be 3405b261ecSmrgused in advertising or publicity pertaining to distribution of the 3535c4bbdfSmrgsoftware without specific, written prior permission. 3605b261ecSmrg 3705b261ecSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 3805b261ecSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 3905b261ecSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 4005b261ecSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 4105b261ecSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 4205b261ecSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 4305b261ecSmrgSOFTWARE. 4405b261ecSmrg 4505b261ecSmrg********************************************************/ 4605b261ecSmrg 4705b261ecSmrg#ifdef HAVE_DIX_CONFIG_H 4805b261ecSmrg#include <dix-config.h> 4905b261ecSmrg#endif 5005b261ecSmrg 5105b261ecSmrg#include <X11/X.h> 5205b261ecSmrg#include <X11/Xproto.h> 5305b261ecSmrg#include <X11/Xprotostr.h> 5405b261ecSmrg#include "misc.h" 5505b261ecSmrg#include "dixstruct.h" 5635c4bbdfSmrg#include "extnsionst.h" /* for SendEvent */ 5705b261ecSmrg#include "swapreq.h" 5805b261ecSmrg 5905b261ecSmrg/* Thanks to Jack Palevich for testing and subsequently rewriting all this */ 6005b261ecSmrg 6105b261ecSmrg/* Byte swap a list of longs */ 626747b715Smrgvoid 6335c4bbdfSmrgSwapLongs(CARD32 *list, unsigned long count) 6435c4bbdfSmrg{ 6535c4bbdfSmrg while (count >= 8) { 6635c4bbdfSmrg swapl(list + 0); 6735c4bbdfSmrg swapl(list + 1); 6835c4bbdfSmrg swapl(list + 2); 6935c4bbdfSmrg swapl(list + 3); 7035c4bbdfSmrg swapl(list + 4); 7135c4bbdfSmrg swapl(list + 5); 7235c4bbdfSmrg swapl(list + 6); 7335c4bbdfSmrg swapl(list + 7); 7435c4bbdfSmrg list += 8; 7535c4bbdfSmrg count -= 8; 7635c4bbdfSmrg } 7735c4bbdfSmrg if (count != 0) { 7835c4bbdfSmrg do { 7935c4bbdfSmrg swapl(list); 8035c4bbdfSmrg list++; 8135c4bbdfSmrg } while (--count != 0); 8235c4bbdfSmrg } 8305b261ecSmrg} 8405b261ecSmrg 8505b261ecSmrg/* Byte swap a list of shorts */ 866747b715Smrgvoid 8735c4bbdfSmrgSwapShorts(short *list, unsigned long count) 8835c4bbdfSmrg{ 8935c4bbdfSmrg while (count >= 16) { 9035c4bbdfSmrg swaps(list + 0); 9135c4bbdfSmrg swaps(list + 1); 9235c4bbdfSmrg swaps(list + 2); 9335c4bbdfSmrg swaps(list + 3); 9435c4bbdfSmrg swaps(list + 4); 9535c4bbdfSmrg swaps(list + 5); 9635c4bbdfSmrg swaps(list + 6); 9735c4bbdfSmrg swaps(list + 7); 9835c4bbdfSmrg swaps(list + 8); 9935c4bbdfSmrg swaps(list + 9); 10035c4bbdfSmrg swaps(list + 10); 10135c4bbdfSmrg swaps(list + 11); 10235c4bbdfSmrg swaps(list + 12); 10335c4bbdfSmrg swaps(list + 13); 10435c4bbdfSmrg swaps(list + 14); 10535c4bbdfSmrg swaps(list + 15); 10635c4bbdfSmrg list += 16; 10735c4bbdfSmrg count -= 16; 10835c4bbdfSmrg } 10935c4bbdfSmrg if (count != 0) { 11035c4bbdfSmrg do { 11135c4bbdfSmrg swaps(list); 11235c4bbdfSmrg list++; 11335c4bbdfSmrg } while (--count != 0); 11435c4bbdfSmrg } 11505b261ecSmrg} 11605b261ecSmrg 11705b261ecSmrg/* The following is used for all requests that have 11805b261ecSmrg no fields to be swapped (except "length") */ 1197e31ba66Smrgint _X_COLD 12005b261ecSmrgSProcSimpleReq(ClientPtr client) 12105b261ecSmrg{ 12205b261ecSmrg REQUEST(xReq); 12335c4bbdfSmrg swaps(&stuff->length); 12435c4bbdfSmrg return (*ProcVector[stuff->reqType]) (client); 12505b261ecSmrg} 12605b261ecSmrg 12705b261ecSmrg/* The following is used for all requests that have 12805b261ecSmrg only a single 32-bit field to be swapped, coming 12905b261ecSmrg right after the "length" field */ 1307e31ba66Smrgint _X_COLD 13105b261ecSmrgSProcResourceReq(ClientPtr client) 13205b261ecSmrg{ 13305b261ecSmrg REQUEST(xResourceReq); 13435c4bbdfSmrg swaps(&stuff->length); 13535c4bbdfSmrg REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */ 13635c4bbdfSmrg swapl(&stuff->id); 13735c4bbdfSmrg return (*ProcVector[stuff->reqType]) (client); 13805b261ecSmrg} 13905b261ecSmrg 1407e31ba66Smrgint _X_COLD 14105b261ecSmrgSProcCreateWindow(ClientPtr client) 14205b261ecSmrg{ 14305b261ecSmrg REQUEST(xCreateWindowReq); 14435c4bbdfSmrg swaps(&stuff->length); 14505b261ecSmrg REQUEST_AT_LEAST_SIZE(xCreateWindowReq); 14635c4bbdfSmrg swapl(&stuff->wid); 14735c4bbdfSmrg swapl(&stuff->parent); 14835c4bbdfSmrg swaps(&stuff->x); 14935c4bbdfSmrg swaps(&stuff->y); 15035c4bbdfSmrg swaps(&stuff->width); 15135c4bbdfSmrg swaps(&stuff->height); 15235c4bbdfSmrg swaps(&stuff->borderWidth); 15335c4bbdfSmrg swaps(&stuff->class); 15435c4bbdfSmrg swapl(&stuff->visual); 15535c4bbdfSmrg swapl(&stuff->mask); 15605b261ecSmrg SwapRestL(stuff); 15735c4bbdfSmrg return ((*ProcVector[X_CreateWindow]) (client)); 15805b261ecSmrg} 15905b261ecSmrg 1607e31ba66Smrgint _X_COLD 16105b261ecSmrgSProcChangeWindowAttributes(ClientPtr client) 16205b261ecSmrg{ 16305b261ecSmrg REQUEST(xChangeWindowAttributesReq); 16435c4bbdfSmrg swaps(&stuff->length); 16505b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); 16635c4bbdfSmrg swapl(&stuff->window); 16735c4bbdfSmrg swapl(&stuff->valueMask); 16805b261ecSmrg SwapRestL(stuff); 16935c4bbdfSmrg return ((*ProcVector[X_ChangeWindowAttributes]) (client)); 17005b261ecSmrg} 17105b261ecSmrg 1727e31ba66Smrgint _X_COLD 17305b261ecSmrgSProcReparentWindow(ClientPtr client) 17405b261ecSmrg{ 17505b261ecSmrg REQUEST(xReparentWindowReq); 17635c4bbdfSmrg swaps(&stuff->length); 17705b261ecSmrg REQUEST_SIZE_MATCH(xReparentWindowReq); 17835c4bbdfSmrg swapl(&stuff->window); 17935c4bbdfSmrg swapl(&stuff->parent); 18035c4bbdfSmrg swaps(&stuff->x); 18135c4bbdfSmrg swaps(&stuff->y); 18235c4bbdfSmrg return ((*ProcVector[X_ReparentWindow]) (client)); 18305b261ecSmrg} 18405b261ecSmrg 1857e31ba66Smrgint _X_COLD 18605b261ecSmrgSProcConfigureWindow(ClientPtr client) 18705b261ecSmrg{ 18805b261ecSmrg REQUEST(xConfigureWindowReq); 18935c4bbdfSmrg swaps(&stuff->length); 19005b261ecSmrg REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); 19135c4bbdfSmrg swapl(&stuff->window); 19235c4bbdfSmrg swaps(&stuff->mask); 19305b261ecSmrg SwapRestL(stuff); 19435c4bbdfSmrg return ((*ProcVector[X_ConfigureWindow]) (client)); 19505b261ecSmrg 19605b261ecSmrg} 19705b261ecSmrg 1987e31ba66Smrgint _X_COLD 19905b261ecSmrgSProcInternAtom(ClientPtr client) 20005b261ecSmrg{ 20105b261ecSmrg REQUEST(xInternAtomReq); 20235c4bbdfSmrg swaps(&stuff->length); 20305b261ecSmrg REQUEST_AT_LEAST_SIZE(xInternAtomReq); 20435c4bbdfSmrg swaps(&stuff->nbytes); 20535c4bbdfSmrg return ((*ProcVector[X_InternAtom]) (client)); 20605b261ecSmrg} 20705b261ecSmrg 2087e31ba66Smrgint _X_COLD 20905b261ecSmrgSProcChangeProperty(ClientPtr client) 21005b261ecSmrg{ 21105b261ecSmrg REQUEST(xChangePropertyReq); 21235c4bbdfSmrg swaps(&stuff->length); 21305b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangePropertyReq); 21435c4bbdfSmrg swapl(&stuff->window); 21535c4bbdfSmrg swapl(&stuff->property); 21635c4bbdfSmrg swapl(&stuff->type); 21735c4bbdfSmrg swapl(&stuff->nUnits); 21835c4bbdfSmrg switch (stuff->format) { 21935c4bbdfSmrg case 8: 22035c4bbdfSmrg break; 22135c4bbdfSmrg case 16: 22235c4bbdfSmrg SwapRestS(stuff); 22335c4bbdfSmrg break; 22435c4bbdfSmrg case 32: 22535c4bbdfSmrg SwapRestL(stuff); 22635c4bbdfSmrg break; 22735c4bbdfSmrg } 22835c4bbdfSmrg return ((*ProcVector[X_ChangeProperty]) (client)); 22905b261ecSmrg} 23005b261ecSmrg 2317e31ba66Smrgint _X_COLD 23205b261ecSmrgSProcDeleteProperty(ClientPtr client) 23305b261ecSmrg{ 23405b261ecSmrg REQUEST(xDeletePropertyReq); 23535c4bbdfSmrg swaps(&stuff->length); 23605b261ecSmrg REQUEST_SIZE_MATCH(xDeletePropertyReq); 23735c4bbdfSmrg swapl(&stuff->window); 23835c4bbdfSmrg swapl(&stuff->property); 23935c4bbdfSmrg return ((*ProcVector[X_DeleteProperty]) (client)); 24035c4bbdfSmrg 24105b261ecSmrg} 24205b261ecSmrg 2437e31ba66Smrgint _X_COLD 24405b261ecSmrgSProcGetProperty(ClientPtr client) 24505b261ecSmrg{ 24605b261ecSmrg REQUEST(xGetPropertyReq); 24735c4bbdfSmrg swaps(&stuff->length); 24805b261ecSmrg REQUEST_SIZE_MATCH(xGetPropertyReq); 24935c4bbdfSmrg swapl(&stuff->window); 25035c4bbdfSmrg swapl(&stuff->property); 25135c4bbdfSmrg swapl(&stuff->type); 25235c4bbdfSmrg swapl(&stuff->longOffset); 25335c4bbdfSmrg swapl(&stuff->longLength); 25435c4bbdfSmrg return ((*ProcVector[X_GetProperty]) (client)); 25505b261ecSmrg} 25605b261ecSmrg 2577e31ba66Smrgint _X_COLD 25805b261ecSmrgSProcSetSelectionOwner(ClientPtr client) 25905b261ecSmrg{ 26005b261ecSmrg REQUEST(xSetSelectionOwnerReq); 26135c4bbdfSmrg swaps(&stuff->length); 26205b261ecSmrg REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); 26335c4bbdfSmrg swapl(&stuff->window); 26435c4bbdfSmrg swapl(&stuff->selection); 26535c4bbdfSmrg swapl(&stuff->time); 26635c4bbdfSmrg return ((*ProcVector[X_SetSelectionOwner]) (client)); 26705b261ecSmrg} 26805b261ecSmrg 2697e31ba66Smrgint _X_COLD 27005b261ecSmrgSProcConvertSelection(ClientPtr client) 27105b261ecSmrg{ 27205b261ecSmrg REQUEST(xConvertSelectionReq); 27335c4bbdfSmrg swaps(&stuff->length); 27405b261ecSmrg REQUEST_SIZE_MATCH(xConvertSelectionReq); 27535c4bbdfSmrg swapl(&stuff->requestor); 27635c4bbdfSmrg swapl(&stuff->selection); 27735c4bbdfSmrg swapl(&stuff->target); 27835c4bbdfSmrg swapl(&stuff->property); 27935c4bbdfSmrg swapl(&stuff->time); 28035c4bbdfSmrg return ((*ProcVector[X_ConvertSelection]) (client)); 28105b261ecSmrg} 28205b261ecSmrg 2837e31ba66Smrgint _X_COLD 28405b261ecSmrgSProcSendEvent(ClientPtr client) 28505b261ecSmrg{ 28635c4bbdfSmrg xEvent eventT = { .u.u.type = 0 }; 28705b261ecSmrg EventSwapPtr proc; 28835c4bbdfSmrg 28905b261ecSmrg REQUEST(xSendEventReq); 29035c4bbdfSmrg swaps(&stuff->length); 29105b261ecSmrg REQUEST_SIZE_MATCH(xSendEventReq); 29235c4bbdfSmrg swapl(&stuff->destination); 29335c4bbdfSmrg swapl(&stuff->eventMask); 29405b261ecSmrg 2950679523aSmrg /* Generic events can have variable size, but SendEvent request holds 2960679523aSmrg exactly 32B of event data. */ 2970679523aSmrg if (stuff->event.u.u.type == GenericEvent) { 2980679523aSmrg client->errorValue = stuff->event.u.u.type; 2990679523aSmrg return BadValue; 3000679523aSmrg } 3010679523aSmrg 30205b261ecSmrg /* Swap event */ 30305b261ecSmrg proc = EventSwapVector[stuff->event.u.u.type & 0177]; 30435c4bbdfSmrg if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */ 30535c4bbdfSmrg return BadValue; 30635c4bbdfSmrg (*proc) (&stuff->event, &eventT); 30705b261ecSmrg stuff->event = eventT; 30805b261ecSmrg 30935c4bbdfSmrg return ((*ProcVector[X_SendEvent]) (client)); 31005b261ecSmrg} 31105b261ecSmrg 3127e31ba66Smrgint _X_COLD 31305b261ecSmrgSProcGrabPointer(ClientPtr client) 31405b261ecSmrg{ 31505b261ecSmrg REQUEST(xGrabPointerReq); 31635c4bbdfSmrg swaps(&stuff->length); 31705b261ecSmrg REQUEST_SIZE_MATCH(xGrabPointerReq); 31835c4bbdfSmrg swapl(&stuff->grabWindow); 31935c4bbdfSmrg swaps(&stuff->eventMask); 32035c4bbdfSmrg swapl(&stuff->confineTo); 32135c4bbdfSmrg swapl(&stuff->cursor); 32235c4bbdfSmrg swapl(&stuff->time); 32335c4bbdfSmrg return ((*ProcVector[X_GrabPointer]) (client)); 32405b261ecSmrg} 32505b261ecSmrg 3267e31ba66Smrgint _X_COLD 32705b261ecSmrgSProcGrabButton(ClientPtr client) 32805b261ecSmrg{ 32905b261ecSmrg REQUEST(xGrabButtonReq); 33035c4bbdfSmrg swaps(&stuff->length); 33105b261ecSmrg REQUEST_SIZE_MATCH(xGrabButtonReq); 33235c4bbdfSmrg swapl(&stuff->grabWindow); 33335c4bbdfSmrg swaps(&stuff->eventMask); 33435c4bbdfSmrg swapl(&stuff->confineTo); 33535c4bbdfSmrg swapl(&stuff->cursor); 33635c4bbdfSmrg swaps(&stuff->modifiers); 33735c4bbdfSmrg return ((*ProcVector[X_GrabButton]) (client)); 33805b261ecSmrg} 33905b261ecSmrg 3407e31ba66Smrgint _X_COLD 34105b261ecSmrgSProcUngrabButton(ClientPtr client) 34205b261ecSmrg{ 34305b261ecSmrg REQUEST(xUngrabButtonReq); 34435c4bbdfSmrg swaps(&stuff->length); 34505b261ecSmrg REQUEST_SIZE_MATCH(xUngrabButtonReq); 34635c4bbdfSmrg swapl(&stuff->grabWindow); 34735c4bbdfSmrg swaps(&stuff->modifiers); 34835c4bbdfSmrg return ((*ProcVector[X_UngrabButton]) (client)); 34905b261ecSmrg} 35005b261ecSmrg 3517e31ba66Smrgint _X_COLD 35205b261ecSmrgSProcChangeActivePointerGrab(ClientPtr client) 35305b261ecSmrg{ 35405b261ecSmrg REQUEST(xChangeActivePointerGrabReq); 35535c4bbdfSmrg swaps(&stuff->length); 35605b261ecSmrg REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); 35735c4bbdfSmrg swapl(&stuff->cursor); 35835c4bbdfSmrg swapl(&stuff->time); 35935c4bbdfSmrg swaps(&stuff->eventMask); 36035c4bbdfSmrg return ((*ProcVector[X_ChangeActivePointerGrab]) (client)); 36105b261ecSmrg} 36205b261ecSmrg 3637e31ba66Smrgint _X_COLD 36405b261ecSmrgSProcGrabKeyboard(ClientPtr client) 36505b261ecSmrg{ 36605b261ecSmrg REQUEST(xGrabKeyboardReq); 36735c4bbdfSmrg swaps(&stuff->length); 36805b261ecSmrg REQUEST_SIZE_MATCH(xGrabKeyboardReq); 36935c4bbdfSmrg swapl(&stuff->grabWindow); 37035c4bbdfSmrg swapl(&stuff->time); 37135c4bbdfSmrg return ((*ProcVector[X_GrabKeyboard]) (client)); 37205b261ecSmrg} 37305b261ecSmrg 3747e31ba66Smrgint _X_COLD 37505b261ecSmrgSProcGrabKey(ClientPtr client) 37605b261ecSmrg{ 37705b261ecSmrg REQUEST(xGrabKeyReq); 37835c4bbdfSmrg swaps(&stuff->length); 37905b261ecSmrg REQUEST_SIZE_MATCH(xGrabKeyReq); 38035c4bbdfSmrg swapl(&stuff->grabWindow); 38135c4bbdfSmrg swaps(&stuff->modifiers); 38235c4bbdfSmrg return ((*ProcVector[X_GrabKey]) (client)); 38305b261ecSmrg} 38405b261ecSmrg 3857e31ba66Smrgint _X_COLD 38605b261ecSmrgSProcUngrabKey(ClientPtr client) 38705b261ecSmrg{ 38805b261ecSmrg REQUEST(xUngrabKeyReq); 38935c4bbdfSmrg swaps(&stuff->length); 39005b261ecSmrg REQUEST_SIZE_MATCH(xUngrabKeyReq); 39135c4bbdfSmrg swapl(&stuff->grabWindow); 39235c4bbdfSmrg swaps(&stuff->modifiers); 39335c4bbdfSmrg return ((*ProcVector[X_UngrabKey]) (client)); 39405b261ecSmrg} 39505b261ecSmrg 3967e31ba66Smrgint _X_COLD 39705b261ecSmrgSProcGetMotionEvents(ClientPtr client) 39805b261ecSmrg{ 39905b261ecSmrg REQUEST(xGetMotionEventsReq); 40035c4bbdfSmrg swaps(&stuff->length); 40105b261ecSmrg REQUEST_SIZE_MATCH(xGetMotionEventsReq); 40235c4bbdfSmrg swapl(&stuff->window); 40335c4bbdfSmrg swapl(&stuff->start); 40435c4bbdfSmrg swapl(&stuff->stop); 40535c4bbdfSmrg return ((*ProcVector[X_GetMotionEvents]) (client)); 40605b261ecSmrg} 40705b261ecSmrg 4087e31ba66Smrgint _X_COLD 40905b261ecSmrgSProcTranslateCoords(ClientPtr client) 41005b261ecSmrg{ 41105b261ecSmrg REQUEST(xTranslateCoordsReq); 41235c4bbdfSmrg swaps(&stuff->length); 41305b261ecSmrg REQUEST_SIZE_MATCH(xTranslateCoordsReq); 41435c4bbdfSmrg swapl(&stuff->srcWid); 41535c4bbdfSmrg swapl(&stuff->dstWid); 41635c4bbdfSmrg swaps(&stuff->srcX); 41735c4bbdfSmrg swaps(&stuff->srcY); 41835c4bbdfSmrg return ((*ProcVector[X_TranslateCoords]) (client)); 41905b261ecSmrg} 42005b261ecSmrg 4217e31ba66Smrgint _X_COLD 42205b261ecSmrgSProcWarpPointer(ClientPtr client) 42305b261ecSmrg{ 42405b261ecSmrg REQUEST(xWarpPointerReq); 42535c4bbdfSmrg swaps(&stuff->length); 42605b261ecSmrg REQUEST_SIZE_MATCH(xWarpPointerReq); 42735c4bbdfSmrg swapl(&stuff->srcWid); 42835c4bbdfSmrg swapl(&stuff->dstWid); 42935c4bbdfSmrg swaps(&stuff->srcX); 43035c4bbdfSmrg swaps(&stuff->srcY); 43135c4bbdfSmrg swaps(&stuff->srcWidth); 43235c4bbdfSmrg swaps(&stuff->srcHeight); 43335c4bbdfSmrg swaps(&stuff->dstX); 43435c4bbdfSmrg swaps(&stuff->dstY); 43535c4bbdfSmrg return ((*ProcVector[X_WarpPointer]) (client)); 43605b261ecSmrg} 43705b261ecSmrg 4387e31ba66Smrgint _X_COLD 43905b261ecSmrgSProcSetInputFocus(ClientPtr client) 44005b261ecSmrg{ 44105b261ecSmrg REQUEST(xSetInputFocusReq); 44235c4bbdfSmrg swaps(&stuff->length); 44305b261ecSmrg REQUEST_SIZE_MATCH(xSetInputFocusReq); 44435c4bbdfSmrg swapl(&stuff->focus); 44535c4bbdfSmrg swapl(&stuff->time); 44635c4bbdfSmrg return ((*ProcVector[X_SetInputFocus]) (client)); 44705b261ecSmrg} 44805b261ecSmrg 4497e31ba66Smrgint _X_COLD 45005b261ecSmrgSProcOpenFont(ClientPtr client) 45105b261ecSmrg{ 45205b261ecSmrg REQUEST(xOpenFontReq); 45335c4bbdfSmrg swaps(&stuff->length); 45405b261ecSmrg REQUEST_AT_LEAST_SIZE(xOpenFontReq); 45535c4bbdfSmrg swapl(&stuff->fid); 45635c4bbdfSmrg swaps(&stuff->nbytes); 45735c4bbdfSmrg return ((*ProcVector[X_OpenFont]) (client)); 45805b261ecSmrg} 45905b261ecSmrg 4607e31ba66Smrgint _X_COLD 46105b261ecSmrgSProcListFonts(ClientPtr client) 46205b261ecSmrg{ 46305b261ecSmrg REQUEST(xListFontsReq); 46435c4bbdfSmrg swaps(&stuff->length); 46505b261ecSmrg REQUEST_AT_LEAST_SIZE(xListFontsReq); 46635c4bbdfSmrg swaps(&stuff->maxNames); 46735c4bbdfSmrg swaps(&stuff->nbytes); 46835c4bbdfSmrg return ((*ProcVector[X_ListFonts]) (client)); 46905b261ecSmrg} 47005b261ecSmrg 4717e31ba66Smrgint _X_COLD 47205b261ecSmrgSProcListFontsWithInfo(ClientPtr client) 47305b261ecSmrg{ 47405b261ecSmrg REQUEST(xListFontsWithInfoReq); 47535c4bbdfSmrg swaps(&stuff->length); 47605b261ecSmrg REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); 47735c4bbdfSmrg swaps(&stuff->maxNames); 47835c4bbdfSmrg swaps(&stuff->nbytes); 47935c4bbdfSmrg return ((*ProcVector[X_ListFontsWithInfo]) (client)); 48005b261ecSmrg} 48105b261ecSmrg 4827e31ba66Smrgint _X_COLD 48305b261ecSmrgSProcSetFontPath(ClientPtr client) 48405b261ecSmrg{ 48505b261ecSmrg REQUEST(xSetFontPathReq); 48635c4bbdfSmrg swaps(&stuff->length); 48705b261ecSmrg REQUEST_AT_LEAST_SIZE(xSetFontPathReq); 48835c4bbdfSmrg swaps(&stuff->nFonts); 48935c4bbdfSmrg return ((*ProcVector[X_SetFontPath]) (client)); 49005b261ecSmrg} 49105b261ecSmrg 4927e31ba66Smrgint _X_COLD 49305b261ecSmrgSProcCreatePixmap(ClientPtr client) 49405b261ecSmrg{ 49505b261ecSmrg REQUEST(xCreatePixmapReq); 49605b261ecSmrg 49735c4bbdfSmrg swaps(&stuff->length); 49805b261ecSmrg REQUEST_SIZE_MATCH(xCreatePixmapReq); 49935c4bbdfSmrg swapl(&stuff->pid); 50035c4bbdfSmrg swapl(&stuff->drawable); 50135c4bbdfSmrg swaps(&stuff->width); 50235c4bbdfSmrg swaps(&stuff->height); 50335c4bbdfSmrg return ((*ProcVector[X_CreatePixmap]) (client)); 50405b261ecSmrg} 50505b261ecSmrg 5067e31ba66Smrgint _X_COLD 50705b261ecSmrgSProcCreateGC(ClientPtr client) 50805b261ecSmrg{ 50905b261ecSmrg REQUEST(xCreateGCReq); 51035c4bbdfSmrg swaps(&stuff->length); 51105b261ecSmrg REQUEST_AT_LEAST_SIZE(xCreateGCReq); 51235c4bbdfSmrg swapl(&stuff->gc); 51335c4bbdfSmrg swapl(&stuff->drawable); 51435c4bbdfSmrg swapl(&stuff->mask); 51505b261ecSmrg SwapRestL(stuff); 51635c4bbdfSmrg return ((*ProcVector[X_CreateGC]) (client)); 51705b261ecSmrg} 51805b261ecSmrg 5197e31ba66Smrgint _X_COLD 52005b261ecSmrgSProcChangeGC(ClientPtr client) 52105b261ecSmrg{ 52205b261ecSmrg REQUEST(xChangeGCReq); 52335c4bbdfSmrg swaps(&stuff->length); 52405b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeGCReq); 52535c4bbdfSmrg swapl(&stuff->gc); 52635c4bbdfSmrg swapl(&stuff->mask); 52705b261ecSmrg SwapRestL(stuff); 52835c4bbdfSmrg return ((*ProcVector[X_ChangeGC]) (client)); 52905b261ecSmrg} 53005b261ecSmrg 5317e31ba66Smrgint _X_COLD 53205b261ecSmrgSProcCopyGC(ClientPtr client) 53305b261ecSmrg{ 53405b261ecSmrg REQUEST(xCopyGCReq); 53535c4bbdfSmrg swaps(&stuff->length); 53605b261ecSmrg REQUEST_SIZE_MATCH(xCopyGCReq); 53735c4bbdfSmrg swapl(&stuff->srcGC); 53835c4bbdfSmrg swapl(&stuff->dstGC); 53935c4bbdfSmrg swapl(&stuff->mask); 54035c4bbdfSmrg return ((*ProcVector[X_CopyGC]) (client)); 54105b261ecSmrg} 54205b261ecSmrg 5437e31ba66Smrgint _X_COLD 54405b261ecSmrgSProcSetDashes(ClientPtr client) 54505b261ecSmrg{ 54605b261ecSmrg REQUEST(xSetDashesReq); 54735c4bbdfSmrg swaps(&stuff->length); 54805b261ecSmrg REQUEST_AT_LEAST_SIZE(xSetDashesReq); 54935c4bbdfSmrg swapl(&stuff->gc); 55035c4bbdfSmrg swaps(&stuff->dashOffset); 55135c4bbdfSmrg swaps(&stuff->nDashes); 55235c4bbdfSmrg return ((*ProcVector[X_SetDashes]) (client)); 55305b261ecSmrg 55405b261ecSmrg} 55505b261ecSmrg 5567e31ba66Smrgint _X_COLD 55705b261ecSmrgSProcSetClipRectangles(ClientPtr client) 55805b261ecSmrg{ 55905b261ecSmrg REQUEST(xSetClipRectanglesReq); 56035c4bbdfSmrg swaps(&stuff->length); 56105b261ecSmrg REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); 56235c4bbdfSmrg swapl(&stuff->gc); 56335c4bbdfSmrg swaps(&stuff->xOrigin); 56435c4bbdfSmrg swaps(&stuff->yOrigin); 56505b261ecSmrg SwapRestS(stuff); 56635c4bbdfSmrg return ((*ProcVector[X_SetClipRectangles]) (client)); 56705b261ecSmrg} 56805b261ecSmrg 5697e31ba66Smrgint _X_COLD 57005b261ecSmrgSProcClearToBackground(ClientPtr client) 57105b261ecSmrg{ 57205b261ecSmrg REQUEST(xClearAreaReq); 57335c4bbdfSmrg swaps(&stuff->length); 57405b261ecSmrg REQUEST_SIZE_MATCH(xClearAreaReq); 57535c4bbdfSmrg swapl(&stuff->window); 57635c4bbdfSmrg swaps(&stuff->x); 57735c4bbdfSmrg swaps(&stuff->y); 57835c4bbdfSmrg swaps(&stuff->width); 57935c4bbdfSmrg swaps(&stuff->height); 58035c4bbdfSmrg return ((*ProcVector[X_ClearArea]) (client)); 58105b261ecSmrg} 58205b261ecSmrg 5837e31ba66Smrgint _X_COLD 58405b261ecSmrgSProcCopyArea(ClientPtr client) 58505b261ecSmrg{ 58605b261ecSmrg REQUEST(xCopyAreaReq); 58735c4bbdfSmrg swaps(&stuff->length); 58805b261ecSmrg REQUEST_SIZE_MATCH(xCopyAreaReq); 58935c4bbdfSmrg swapl(&stuff->srcDrawable); 59035c4bbdfSmrg swapl(&stuff->dstDrawable); 59135c4bbdfSmrg swapl(&stuff->gc); 59235c4bbdfSmrg swaps(&stuff->srcX); 59335c4bbdfSmrg swaps(&stuff->srcY); 59435c4bbdfSmrg swaps(&stuff->dstX); 59535c4bbdfSmrg swaps(&stuff->dstY); 59635c4bbdfSmrg swaps(&stuff->width); 59735c4bbdfSmrg swaps(&stuff->height); 59835c4bbdfSmrg return ((*ProcVector[X_CopyArea]) (client)); 59905b261ecSmrg} 60005b261ecSmrg 6017e31ba66Smrgint _X_COLD 60205b261ecSmrgSProcCopyPlane(ClientPtr client) 60305b261ecSmrg{ 60405b261ecSmrg REQUEST(xCopyPlaneReq); 60535c4bbdfSmrg swaps(&stuff->length); 60605b261ecSmrg REQUEST_SIZE_MATCH(xCopyPlaneReq); 60735c4bbdfSmrg swapl(&stuff->srcDrawable); 60835c4bbdfSmrg swapl(&stuff->dstDrawable); 60935c4bbdfSmrg swapl(&stuff->gc); 61035c4bbdfSmrg swaps(&stuff->srcX); 61135c4bbdfSmrg swaps(&stuff->srcY); 61235c4bbdfSmrg swaps(&stuff->dstX); 61335c4bbdfSmrg swaps(&stuff->dstY); 61435c4bbdfSmrg swaps(&stuff->width); 61535c4bbdfSmrg swaps(&stuff->height); 61635c4bbdfSmrg swapl(&stuff->bitPlane); 61735c4bbdfSmrg return ((*ProcVector[X_CopyPlane]) (client)); 61805b261ecSmrg} 61905b261ecSmrg 62005b261ecSmrg/* The following routine is used for all Poly drawing requests 62105b261ecSmrg (except FillPoly, which uses a different request format) */ 6227e31ba66Smrgint _X_COLD 62305b261ecSmrgSProcPoly(ClientPtr client) 62405b261ecSmrg{ 62505b261ecSmrg REQUEST(xPolyPointReq); 62635c4bbdfSmrg swaps(&stuff->length); 62705b261ecSmrg REQUEST_AT_LEAST_SIZE(xPolyPointReq); 62835c4bbdfSmrg swapl(&stuff->drawable); 62935c4bbdfSmrg swapl(&stuff->gc); 63005b261ecSmrg SwapRestS(stuff); 63135c4bbdfSmrg return ((*ProcVector[stuff->reqType]) (client)); 63205b261ecSmrg} 63305b261ecSmrg 63405b261ecSmrg/* cannot use SProcPoly for this one, because xFillPolyReq 63505b261ecSmrg is longer than xPolyPointReq, and we don't want to swap 63605b261ecSmrg the difference as shorts! */ 6377e31ba66Smrgint _X_COLD 63805b261ecSmrgSProcFillPoly(ClientPtr client) 63905b261ecSmrg{ 64005b261ecSmrg REQUEST(xFillPolyReq); 64135c4bbdfSmrg swaps(&stuff->length); 64205b261ecSmrg REQUEST_AT_LEAST_SIZE(xFillPolyReq); 64335c4bbdfSmrg swapl(&stuff->drawable); 64435c4bbdfSmrg swapl(&stuff->gc); 64505b261ecSmrg SwapRestS(stuff); 64635c4bbdfSmrg return ((*ProcVector[X_FillPoly]) (client)); 64705b261ecSmrg} 64805b261ecSmrg 6497e31ba66Smrgint _X_COLD 65005b261ecSmrgSProcPutImage(ClientPtr client) 65105b261ecSmrg{ 65205b261ecSmrg REQUEST(xPutImageReq); 65335c4bbdfSmrg swaps(&stuff->length); 65405b261ecSmrg REQUEST_AT_LEAST_SIZE(xPutImageReq); 65535c4bbdfSmrg swapl(&stuff->drawable); 65635c4bbdfSmrg swapl(&stuff->gc); 65735c4bbdfSmrg swaps(&stuff->width); 65835c4bbdfSmrg swaps(&stuff->height); 65935c4bbdfSmrg swaps(&stuff->dstX); 66035c4bbdfSmrg swaps(&stuff->dstY); 66105b261ecSmrg /* Image should already be swapped */ 66235c4bbdfSmrg return ((*ProcVector[X_PutImage]) (client)); 66305b261ecSmrg 66405b261ecSmrg} 66505b261ecSmrg 6667e31ba66Smrgint _X_COLD 66705b261ecSmrgSProcGetImage(ClientPtr client) 66805b261ecSmrg{ 66905b261ecSmrg REQUEST(xGetImageReq); 67035c4bbdfSmrg swaps(&stuff->length); 67105b261ecSmrg REQUEST_SIZE_MATCH(xGetImageReq); 67235c4bbdfSmrg swapl(&stuff->drawable); 67335c4bbdfSmrg swaps(&stuff->x); 67435c4bbdfSmrg swaps(&stuff->y); 67535c4bbdfSmrg swaps(&stuff->width); 67635c4bbdfSmrg swaps(&stuff->height); 67735c4bbdfSmrg swapl(&stuff->planeMask); 67835c4bbdfSmrg return ((*ProcVector[X_GetImage]) (client)); 67905b261ecSmrg} 68005b261ecSmrg 68105b261ecSmrg/* ProcPolyText used for both PolyText8 and PolyText16 */ 68205b261ecSmrg 6837e31ba66Smrgint _X_COLD 68405b261ecSmrgSProcPolyText(ClientPtr client) 68505b261ecSmrg{ 68605b261ecSmrg REQUEST(xPolyTextReq); 68735c4bbdfSmrg swaps(&stuff->length); 68805b261ecSmrg REQUEST_AT_LEAST_SIZE(xPolyTextReq); 68935c4bbdfSmrg swapl(&stuff->drawable); 69035c4bbdfSmrg swapl(&stuff->gc); 69135c4bbdfSmrg swaps(&stuff->x); 69235c4bbdfSmrg swaps(&stuff->y); 69335c4bbdfSmrg return ((*ProcVector[stuff->reqType]) (client)); 69405b261ecSmrg} 69505b261ecSmrg 69605b261ecSmrg/* ProcImageText used for both ImageText8 and ImageText16 */ 69705b261ecSmrg 6987e31ba66Smrgint _X_COLD 69905b261ecSmrgSProcImageText(ClientPtr client) 70005b261ecSmrg{ 70105b261ecSmrg REQUEST(xImageTextReq); 70235c4bbdfSmrg swaps(&stuff->length); 70305b261ecSmrg REQUEST_AT_LEAST_SIZE(xImageTextReq); 70435c4bbdfSmrg swapl(&stuff->drawable); 70535c4bbdfSmrg swapl(&stuff->gc); 70635c4bbdfSmrg swaps(&stuff->x); 70735c4bbdfSmrg swaps(&stuff->y); 70835c4bbdfSmrg return ((*ProcVector[stuff->reqType]) (client)); 70905b261ecSmrg} 71005b261ecSmrg 7117e31ba66Smrgint _X_COLD 71205b261ecSmrgSProcCreateColormap(ClientPtr client) 71305b261ecSmrg{ 71405b261ecSmrg REQUEST(xCreateColormapReq); 71535c4bbdfSmrg swaps(&stuff->length); 71605b261ecSmrg REQUEST_SIZE_MATCH(xCreateColormapReq); 71735c4bbdfSmrg swapl(&stuff->mid); 71835c4bbdfSmrg swapl(&stuff->window); 71935c4bbdfSmrg swapl(&stuff->visual); 72035c4bbdfSmrg return ((*ProcVector[X_CreateColormap]) (client)); 72105b261ecSmrg} 72205b261ecSmrg 7237e31ba66Smrgint _X_COLD 72405b261ecSmrgSProcCopyColormapAndFree(ClientPtr client) 72505b261ecSmrg{ 72605b261ecSmrg REQUEST(xCopyColormapAndFreeReq); 72735c4bbdfSmrg swaps(&stuff->length); 72805b261ecSmrg REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); 72935c4bbdfSmrg swapl(&stuff->mid); 73035c4bbdfSmrg swapl(&stuff->srcCmap); 73135c4bbdfSmrg return ((*ProcVector[X_CopyColormapAndFree]) (client)); 73205b261ecSmrg 73305b261ecSmrg} 73405b261ecSmrg 7357e31ba66Smrgint _X_COLD 73605b261ecSmrgSProcAllocColor(ClientPtr client) 73705b261ecSmrg{ 73805b261ecSmrg REQUEST(xAllocColorReq); 73935c4bbdfSmrg swaps(&stuff->length); 74005b261ecSmrg REQUEST_SIZE_MATCH(xAllocColorReq); 74135c4bbdfSmrg swapl(&stuff->cmap); 74235c4bbdfSmrg swaps(&stuff->red); 74335c4bbdfSmrg swaps(&stuff->green); 74435c4bbdfSmrg swaps(&stuff->blue); 74535c4bbdfSmrg return ((*ProcVector[X_AllocColor]) (client)); 74605b261ecSmrg} 74705b261ecSmrg 7487e31ba66Smrgint _X_COLD 74905b261ecSmrgSProcAllocNamedColor(ClientPtr client) 75005b261ecSmrg{ 75105b261ecSmrg REQUEST(xAllocNamedColorReq); 75235c4bbdfSmrg swaps(&stuff->length); 75305b261ecSmrg REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq); 75435c4bbdfSmrg swapl(&stuff->cmap); 75535c4bbdfSmrg swaps(&stuff->nbytes); 75635c4bbdfSmrg return ((*ProcVector[X_AllocNamedColor]) (client)); 75705b261ecSmrg} 75805b261ecSmrg 7597e31ba66Smrgint _X_COLD 76005b261ecSmrgSProcAllocColorCells(ClientPtr client) 76105b261ecSmrg{ 76205b261ecSmrg REQUEST(xAllocColorCellsReq); 76335c4bbdfSmrg swaps(&stuff->length); 76405b261ecSmrg REQUEST_SIZE_MATCH(xAllocColorCellsReq); 76535c4bbdfSmrg swapl(&stuff->cmap); 76635c4bbdfSmrg swaps(&stuff->colors); 76735c4bbdfSmrg swaps(&stuff->planes); 76835c4bbdfSmrg return ((*ProcVector[X_AllocColorCells]) (client)); 76905b261ecSmrg} 77005b261ecSmrg 7717e31ba66Smrgint _X_COLD 77205b261ecSmrgSProcAllocColorPlanes(ClientPtr client) 77305b261ecSmrg{ 77405b261ecSmrg REQUEST(xAllocColorPlanesReq); 77535c4bbdfSmrg swaps(&stuff->length); 77605b261ecSmrg REQUEST_SIZE_MATCH(xAllocColorPlanesReq); 77735c4bbdfSmrg swapl(&stuff->cmap); 77835c4bbdfSmrg swaps(&stuff->colors); 77935c4bbdfSmrg swaps(&stuff->red); 78035c4bbdfSmrg swaps(&stuff->green); 78135c4bbdfSmrg swaps(&stuff->blue); 78235c4bbdfSmrg return ((*ProcVector[X_AllocColorPlanes]) (client)); 78305b261ecSmrg} 78405b261ecSmrg 7857e31ba66Smrgint _X_COLD 78605b261ecSmrgSProcFreeColors(ClientPtr client) 78705b261ecSmrg{ 78805b261ecSmrg REQUEST(xFreeColorsReq); 78935c4bbdfSmrg swaps(&stuff->length); 79005b261ecSmrg REQUEST_AT_LEAST_SIZE(xFreeColorsReq); 79135c4bbdfSmrg swapl(&stuff->cmap); 79235c4bbdfSmrg swapl(&stuff->planeMask); 79305b261ecSmrg SwapRestL(stuff); 79435c4bbdfSmrg return ((*ProcVector[X_FreeColors]) (client)); 79505b261ecSmrg 79605b261ecSmrg} 79705b261ecSmrg 7987e31ba66Smrgvoid _X_COLD 79935c4bbdfSmrgSwapColorItem(xColorItem * pItem) 80005b261ecSmrg{ 80135c4bbdfSmrg swapl(&pItem->pixel); 80235c4bbdfSmrg swaps(&pItem->red); 80335c4bbdfSmrg swaps(&pItem->green); 80435c4bbdfSmrg swaps(&pItem->blue); 80505b261ecSmrg} 80605b261ecSmrg 8077e31ba66Smrgint _X_COLD 80805b261ecSmrgSProcStoreColors(ClientPtr client) 80905b261ecSmrg{ 81005b261ecSmrg long count; 81135c4bbdfSmrg xColorItem *pItem; 81205b261ecSmrg 81305b261ecSmrg REQUEST(xStoreColorsReq); 81435c4bbdfSmrg swaps(&stuff->length); 81505b261ecSmrg REQUEST_AT_LEAST_SIZE(xStoreColorsReq); 81635c4bbdfSmrg swapl(&stuff->cmap); 81705b261ecSmrg pItem = (xColorItem *) &stuff[1]; 81835c4bbdfSmrg for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;) 81935c4bbdfSmrg SwapColorItem(pItem++); 82035c4bbdfSmrg return ((*ProcVector[X_StoreColors]) (client)); 82105b261ecSmrg} 82205b261ecSmrg 8237e31ba66Smrgint _X_COLD 82435c4bbdfSmrgSProcStoreNamedColor(ClientPtr client) 82505b261ecSmrg{ 82605b261ecSmrg REQUEST(xStoreNamedColorReq); 82735c4bbdfSmrg swaps(&stuff->length); 82805b261ecSmrg REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); 82935c4bbdfSmrg swapl(&stuff->cmap); 83035c4bbdfSmrg swapl(&stuff->pixel); 83135c4bbdfSmrg swaps(&stuff->nbytes); 83235c4bbdfSmrg return ((*ProcVector[X_StoreNamedColor]) (client)); 83305b261ecSmrg} 83405b261ecSmrg 8357e31ba66Smrgint _X_COLD 83635c4bbdfSmrgSProcQueryColors(ClientPtr client) 83705b261ecSmrg{ 83805b261ecSmrg REQUEST(xQueryColorsReq); 83935c4bbdfSmrg swaps(&stuff->length); 84005b261ecSmrg REQUEST_AT_LEAST_SIZE(xQueryColorsReq); 84135c4bbdfSmrg swapl(&stuff->cmap); 84205b261ecSmrg SwapRestL(stuff); 84335c4bbdfSmrg return ((*ProcVector[X_QueryColors]) (client)); 84435c4bbdfSmrg} 84505b261ecSmrg 8467e31ba66Smrgint _X_COLD 84735c4bbdfSmrgSProcLookupColor(ClientPtr client) 84805b261ecSmrg{ 84905b261ecSmrg REQUEST(xLookupColorReq); 85035c4bbdfSmrg swaps(&stuff->length); 85105b261ecSmrg REQUEST_AT_LEAST_SIZE(xLookupColorReq); 85235c4bbdfSmrg swapl(&stuff->cmap); 85335c4bbdfSmrg swaps(&stuff->nbytes); 85435c4bbdfSmrg return ((*ProcVector[X_LookupColor]) (client)); 85505b261ecSmrg} 85605b261ecSmrg 8577e31ba66Smrgint _X_COLD 85835c4bbdfSmrgSProcCreateCursor(ClientPtr client) 85905b261ecSmrg{ 86005b261ecSmrg REQUEST(xCreateCursorReq); 86135c4bbdfSmrg swaps(&stuff->length); 86205b261ecSmrg REQUEST_SIZE_MATCH(xCreateCursorReq); 86335c4bbdfSmrg swapl(&stuff->cid); 86435c4bbdfSmrg swapl(&stuff->source); 86535c4bbdfSmrg swapl(&stuff->mask); 86635c4bbdfSmrg swaps(&stuff->foreRed); 86735c4bbdfSmrg swaps(&stuff->foreGreen); 86835c4bbdfSmrg swaps(&stuff->foreBlue); 86935c4bbdfSmrg swaps(&stuff->backRed); 87035c4bbdfSmrg swaps(&stuff->backGreen); 87135c4bbdfSmrg swaps(&stuff->backBlue); 87235c4bbdfSmrg swaps(&stuff->x); 87335c4bbdfSmrg swaps(&stuff->y); 87435c4bbdfSmrg return ((*ProcVector[X_CreateCursor]) (client)); 87505b261ecSmrg} 87605b261ecSmrg 8777e31ba66Smrgint _X_COLD 87835c4bbdfSmrgSProcCreateGlyphCursor(ClientPtr client) 87905b261ecSmrg{ 88005b261ecSmrg REQUEST(xCreateGlyphCursorReq); 88135c4bbdfSmrg swaps(&stuff->length); 88205b261ecSmrg REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); 88335c4bbdfSmrg swapl(&stuff->cid); 88435c4bbdfSmrg swapl(&stuff->source); 88535c4bbdfSmrg swapl(&stuff->mask); 88635c4bbdfSmrg swaps(&stuff->sourceChar); 88735c4bbdfSmrg swaps(&stuff->maskChar); 88835c4bbdfSmrg swaps(&stuff->foreRed); 88935c4bbdfSmrg swaps(&stuff->foreGreen); 89035c4bbdfSmrg swaps(&stuff->foreBlue); 89135c4bbdfSmrg swaps(&stuff->backRed); 89235c4bbdfSmrg swaps(&stuff->backGreen); 89335c4bbdfSmrg swaps(&stuff->backBlue); 89435c4bbdfSmrg return ((*ProcVector[X_CreateGlyphCursor]) (client)); 89505b261ecSmrg} 89605b261ecSmrg 8977e31ba66Smrgint _X_COLD 89835c4bbdfSmrgSProcRecolorCursor(ClientPtr client) 89905b261ecSmrg{ 90005b261ecSmrg REQUEST(xRecolorCursorReq); 90135c4bbdfSmrg swaps(&stuff->length); 90205b261ecSmrg REQUEST_SIZE_MATCH(xRecolorCursorReq); 90335c4bbdfSmrg swapl(&stuff->cursor); 90435c4bbdfSmrg swaps(&stuff->foreRed); 90535c4bbdfSmrg swaps(&stuff->foreGreen); 90635c4bbdfSmrg swaps(&stuff->foreBlue); 90735c4bbdfSmrg swaps(&stuff->backRed); 90835c4bbdfSmrg swaps(&stuff->backGreen); 90935c4bbdfSmrg swaps(&stuff->backBlue); 91035c4bbdfSmrg return ((*ProcVector[X_RecolorCursor]) (client)); 91105b261ecSmrg} 91205b261ecSmrg 9137e31ba66Smrgint _X_COLD 91435c4bbdfSmrgSProcQueryBestSize(ClientPtr client) 91505b261ecSmrg{ 91605b261ecSmrg REQUEST(xQueryBestSizeReq); 91735c4bbdfSmrg swaps(&stuff->length); 91805b261ecSmrg REQUEST_SIZE_MATCH(xQueryBestSizeReq); 91935c4bbdfSmrg swapl(&stuff->drawable); 92035c4bbdfSmrg swaps(&stuff->width); 92135c4bbdfSmrg swaps(&stuff->height); 92235c4bbdfSmrg return ((*ProcVector[X_QueryBestSize]) (client)); 92305b261ecSmrg 92405b261ecSmrg} 92505b261ecSmrg 9267e31ba66Smrgint _X_COLD 92735c4bbdfSmrgSProcQueryExtension(ClientPtr client) 92805b261ecSmrg{ 92905b261ecSmrg REQUEST(xQueryExtensionReq); 93035c4bbdfSmrg swaps(&stuff->length); 93105b261ecSmrg REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); 93235c4bbdfSmrg swaps(&stuff->nbytes); 93335c4bbdfSmrg return ((*ProcVector[X_QueryExtension]) (client)); 93405b261ecSmrg} 93505b261ecSmrg 9367e31ba66Smrgint _X_COLD 93735c4bbdfSmrgSProcChangeKeyboardMapping(ClientPtr client) 93805b261ecSmrg{ 93905b261ecSmrg REQUEST(xChangeKeyboardMappingReq); 94035c4bbdfSmrg swaps(&stuff->length); 94105b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); 94205b261ecSmrg SwapRestL(stuff); 94335c4bbdfSmrg return ((*ProcVector[X_ChangeKeyboardMapping]) (client)); 94405b261ecSmrg} 94505b261ecSmrg 9467e31ba66Smrgint _X_COLD 94735c4bbdfSmrgSProcChangeKeyboardControl(ClientPtr client) 94805b261ecSmrg{ 94905b261ecSmrg REQUEST(xChangeKeyboardControlReq); 95035c4bbdfSmrg swaps(&stuff->length); 95105b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); 95235c4bbdfSmrg swapl(&stuff->mask); 95305b261ecSmrg SwapRestL(stuff); 95435c4bbdfSmrg return ((*ProcVector[X_ChangeKeyboardControl]) (client)); 95505b261ecSmrg} 95605b261ecSmrg 9577e31ba66Smrgint _X_COLD 95835c4bbdfSmrgSProcChangePointerControl(ClientPtr client) 95905b261ecSmrg{ 96005b261ecSmrg REQUEST(xChangePointerControlReq); 96135c4bbdfSmrg swaps(&stuff->length); 96205b261ecSmrg REQUEST_SIZE_MATCH(xChangePointerControlReq); 96335c4bbdfSmrg swaps(&stuff->accelNum); 96435c4bbdfSmrg swaps(&stuff->accelDenum); 96535c4bbdfSmrg swaps(&stuff->threshold); 96635c4bbdfSmrg return ((*ProcVector[X_ChangePointerControl]) (client)); 96705b261ecSmrg} 96805b261ecSmrg 9697e31ba66Smrgint _X_COLD 97035c4bbdfSmrgSProcSetScreenSaver(ClientPtr client) 97105b261ecSmrg{ 97205b261ecSmrg REQUEST(xSetScreenSaverReq); 97335c4bbdfSmrg swaps(&stuff->length); 97405b261ecSmrg REQUEST_SIZE_MATCH(xSetScreenSaverReq); 97535c4bbdfSmrg swaps(&stuff->timeout); 97635c4bbdfSmrg swaps(&stuff->interval); 97735c4bbdfSmrg return ((*ProcVector[X_SetScreenSaver]) (client)); 97805b261ecSmrg} 97905b261ecSmrg 9807e31ba66Smrgint _X_COLD 98135c4bbdfSmrgSProcChangeHosts(ClientPtr client) 98205b261ecSmrg{ 98305b261ecSmrg REQUEST(xChangeHostsReq); 98435c4bbdfSmrg swaps(&stuff->length); 98505b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeHostsReq); 98635c4bbdfSmrg swaps(&stuff->hostLength); 98735c4bbdfSmrg return ((*ProcVector[X_ChangeHosts]) (client)); 98805b261ecSmrg 98905b261ecSmrg} 99005b261ecSmrg 9917e31ba66Smrgint _X_COLD 99235c4bbdfSmrgSProcRotateProperties(ClientPtr client) 99305b261ecSmrg{ 99405b261ecSmrg REQUEST(xRotatePropertiesReq); 99535c4bbdfSmrg swaps(&stuff->length); 99605b261ecSmrg REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); 99735c4bbdfSmrg swapl(&stuff->window); 99835c4bbdfSmrg swaps(&stuff->nAtoms); 99935c4bbdfSmrg swaps(&stuff->nPositions); 100005b261ecSmrg SwapRestL(stuff); 100135c4bbdfSmrg return ((*ProcVector[X_RotateProperties]) (client)); 100205b261ecSmrg} 100305b261ecSmrg 10047e31ba66Smrgint _X_COLD 100505b261ecSmrgSProcNoOperation(ClientPtr client) 100605b261ecSmrg{ 100705b261ecSmrg REQUEST(xReq); 100835c4bbdfSmrg swaps(&stuff->length); 100935c4bbdfSmrg return ((*ProcVector[X_NoOperation]) (client)); 101005b261ecSmrg} 101105b261ecSmrg 10127e31ba66Smrgvoid _X_COLD 101335c4bbdfSmrgSwapConnClientPrefix(xConnClientPrefix * pCCP) 101405b261ecSmrg{ 101535c4bbdfSmrg swaps(&pCCP->majorVersion); 101635c4bbdfSmrg swaps(&pCCP->minorVersion); 101735c4bbdfSmrg swaps(&pCCP->nbytesAuthProto); 101835c4bbdfSmrg swaps(&pCCP->nbytesAuthString); 101905b261ecSmrg} 1020