swapreq.c revision 35c4bbdf
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") */ 11905b261ecSmrgint 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 */ 13005b261ecSmrgint 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 14005b261ecSmrgint 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 16005b261ecSmrgint 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 17205b261ecSmrgint 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 18505b261ecSmrgint 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 19805b261ecSmrgint 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 20805b261ecSmrgint 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 2316747b715Smrgint 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 2436747b715Smrgint 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 25705b261ecSmrgint 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 26905b261ecSmrgint 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 28305b261ecSmrgint 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 29505b261ecSmrg /* Swap event */ 29605b261ecSmrg proc = EventSwapVector[stuff->event.u.u.type & 0177]; 29735c4bbdfSmrg if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */ 29835c4bbdfSmrg return BadValue; 29935c4bbdfSmrg (*proc) (&stuff->event, &eventT); 30005b261ecSmrg stuff->event = eventT; 30105b261ecSmrg 30235c4bbdfSmrg return ((*ProcVector[X_SendEvent]) (client)); 30305b261ecSmrg} 30405b261ecSmrg 30505b261ecSmrgint 30605b261ecSmrgSProcGrabPointer(ClientPtr client) 30705b261ecSmrg{ 30805b261ecSmrg REQUEST(xGrabPointerReq); 30935c4bbdfSmrg swaps(&stuff->length); 31005b261ecSmrg REQUEST_SIZE_MATCH(xGrabPointerReq); 31135c4bbdfSmrg swapl(&stuff->grabWindow); 31235c4bbdfSmrg swaps(&stuff->eventMask); 31335c4bbdfSmrg swapl(&stuff->confineTo); 31435c4bbdfSmrg swapl(&stuff->cursor); 31535c4bbdfSmrg swapl(&stuff->time); 31635c4bbdfSmrg return ((*ProcVector[X_GrabPointer]) (client)); 31705b261ecSmrg} 31805b261ecSmrg 31905b261ecSmrgint 32005b261ecSmrgSProcGrabButton(ClientPtr client) 32105b261ecSmrg{ 32205b261ecSmrg REQUEST(xGrabButtonReq); 32335c4bbdfSmrg swaps(&stuff->length); 32405b261ecSmrg REQUEST_SIZE_MATCH(xGrabButtonReq); 32535c4bbdfSmrg swapl(&stuff->grabWindow); 32635c4bbdfSmrg swaps(&stuff->eventMask); 32735c4bbdfSmrg swapl(&stuff->confineTo); 32835c4bbdfSmrg swapl(&stuff->cursor); 32935c4bbdfSmrg swaps(&stuff->modifiers); 33035c4bbdfSmrg return ((*ProcVector[X_GrabButton]) (client)); 33105b261ecSmrg} 33205b261ecSmrg 33305b261ecSmrgint 33405b261ecSmrgSProcUngrabButton(ClientPtr client) 33505b261ecSmrg{ 33605b261ecSmrg REQUEST(xUngrabButtonReq); 33735c4bbdfSmrg swaps(&stuff->length); 33805b261ecSmrg REQUEST_SIZE_MATCH(xUngrabButtonReq); 33935c4bbdfSmrg swapl(&stuff->grabWindow); 34035c4bbdfSmrg swaps(&stuff->modifiers); 34135c4bbdfSmrg return ((*ProcVector[X_UngrabButton]) (client)); 34205b261ecSmrg} 34305b261ecSmrg 34405b261ecSmrgint 34505b261ecSmrgSProcChangeActivePointerGrab(ClientPtr client) 34605b261ecSmrg{ 34705b261ecSmrg REQUEST(xChangeActivePointerGrabReq); 34835c4bbdfSmrg swaps(&stuff->length); 34905b261ecSmrg REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); 35035c4bbdfSmrg swapl(&stuff->cursor); 35135c4bbdfSmrg swapl(&stuff->time); 35235c4bbdfSmrg swaps(&stuff->eventMask); 35335c4bbdfSmrg return ((*ProcVector[X_ChangeActivePointerGrab]) (client)); 35405b261ecSmrg} 35505b261ecSmrg 35605b261ecSmrgint 35705b261ecSmrgSProcGrabKeyboard(ClientPtr client) 35805b261ecSmrg{ 35905b261ecSmrg REQUEST(xGrabKeyboardReq); 36035c4bbdfSmrg swaps(&stuff->length); 36105b261ecSmrg REQUEST_SIZE_MATCH(xGrabKeyboardReq); 36235c4bbdfSmrg swapl(&stuff->grabWindow); 36335c4bbdfSmrg swapl(&stuff->time); 36435c4bbdfSmrg return ((*ProcVector[X_GrabKeyboard]) (client)); 36505b261ecSmrg} 36605b261ecSmrg 36705b261ecSmrgint 36805b261ecSmrgSProcGrabKey(ClientPtr client) 36905b261ecSmrg{ 37005b261ecSmrg REQUEST(xGrabKeyReq); 37135c4bbdfSmrg swaps(&stuff->length); 37205b261ecSmrg REQUEST_SIZE_MATCH(xGrabKeyReq); 37335c4bbdfSmrg swapl(&stuff->grabWindow); 37435c4bbdfSmrg swaps(&stuff->modifiers); 37535c4bbdfSmrg return ((*ProcVector[X_GrabKey]) (client)); 37605b261ecSmrg} 37705b261ecSmrg 37805b261ecSmrgint 37905b261ecSmrgSProcUngrabKey(ClientPtr client) 38005b261ecSmrg{ 38105b261ecSmrg REQUEST(xUngrabKeyReq); 38235c4bbdfSmrg swaps(&stuff->length); 38305b261ecSmrg REQUEST_SIZE_MATCH(xUngrabKeyReq); 38435c4bbdfSmrg swapl(&stuff->grabWindow); 38535c4bbdfSmrg swaps(&stuff->modifiers); 38635c4bbdfSmrg return ((*ProcVector[X_UngrabKey]) (client)); 38705b261ecSmrg} 38805b261ecSmrg 38905b261ecSmrgint 39005b261ecSmrgSProcGetMotionEvents(ClientPtr client) 39105b261ecSmrg{ 39205b261ecSmrg REQUEST(xGetMotionEventsReq); 39335c4bbdfSmrg swaps(&stuff->length); 39405b261ecSmrg REQUEST_SIZE_MATCH(xGetMotionEventsReq); 39535c4bbdfSmrg swapl(&stuff->window); 39635c4bbdfSmrg swapl(&stuff->start); 39735c4bbdfSmrg swapl(&stuff->stop); 39835c4bbdfSmrg return ((*ProcVector[X_GetMotionEvents]) (client)); 39905b261ecSmrg} 40005b261ecSmrg 40105b261ecSmrgint 40205b261ecSmrgSProcTranslateCoords(ClientPtr client) 40305b261ecSmrg{ 40405b261ecSmrg REQUEST(xTranslateCoordsReq); 40535c4bbdfSmrg swaps(&stuff->length); 40605b261ecSmrg REQUEST_SIZE_MATCH(xTranslateCoordsReq); 40735c4bbdfSmrg swapl(&stuff->srcWid); 40835c4bbdfSmrg swapl(&stuff->dstWid); 40935c4bbdfSmrg swaps(&stuff->srcX); 41035c4bbdfSmrg swaps(&stuff->srcY); 41135c4bbdfSmrg return ((*ProcVector[X_TranslateCoords]) (client)); 41205b261ecSmrg} 41305b261ecSmrg 41405b261ecSmrgint 41505b261ecSmrgSProcWarpPointer(ClientPtr client) 41605b261ecSmrg{ 41705b261ecSmrg REQUEST(xWarpPointerReq); 41835c4bbdfSmrg swaps(&stuff->length); 41905b261ecSmrg REQUEST_SIZE_MATCH(xWarpPointerReq); 42035c4bbdfSmrg swapl(&stuff->srcWid); 42135c4bbdfSmrg swapl(&stuff->dstWid); 42235c4bbdfSmrg swaps(&stuff->srcX); 42335c4bbdfSmrg swaps(&stuff->srcY); 42435c4bbdfSmrg swaps(&stuff->srcWidth); 42535c4bbdfSmrg swaps(&stuff->srcHeight); 42635c4bbdfSmrg swaps(&stuff->dstX); 42735c4bbdfSmrg swaps(&stuff->dstY); 42835c4bbdfSmrg return ((*ProcVector[X_WarpPointer]) (client)); 42905b261ecSmrg} 43005b261ecSmrg 43105b261ecSmrgint 43205b261ecSmrgSProcSetInputFocus(ClientPtr client) 43305b261ecSmrg{ 43405b261ecSmrg REQUEST(xSetInputFocusReq); 43535c4bbdfSmrg swaps(&stuff->length); 43605b261ecSmrg REQUEST_SIZE_MATCH(xSetInputFocusReq); 43735c4bbdfSmrg swapl(&stuff->focus); 43835c4bbdfSmrg swapl(&stuff->time); 43935c4bbdfSmrg return ((*ProcVector[X_SetInputFocus]) (client)); 44005b261ecSmrg} 44105b261ecSmrg 44205b261ecSmrgint 44305b261ecSmrgSProcOpenFont(ClientPtr client) 44405b261ecSmrg{ 44505b261ecSmrg REQUEST(xOpenFontReq); 44635c4bbdfSmrg swaps(&stuff->length); 44705b261ecSmrg REQUEST_AT_LEAST_SIZE(xOpenFontReq); 44835c4bbdfSmrg swapl(&stuff->fid); 44935c4bbdfSmrg swaps(&stuff->nbytes); 45035c4bbdfSmrg return ((*ProcVector[X_OpenFont]) (client)); 45105b261ecSmrg} 45205b261ecSmrg 45305b261ecSmrgint 45405b261ecSmrgSProcListFonts(ClientPtr client) 45505b261ecSmrg{ 45605b261ecSmrg REQUEST(xListFontsReq); 45735c4bbdfSmrg swaps(&stuff->length); 45805b261ecSmrg REQUEST_AT_LEAST_SIZE(xListFontsReq); 45935c4bbdfSmrg swaps(&stuff->maxNames); 46035c4bbdfSmrg swaps(&stuff->nbytes); 46135c4bbdfSmrg return ((*ProcVector[X_ListFonts]) (client)); 46205b261ecSmrg} 46305b261ecSmrg 46405b261ecSmrgint 46505b261ecSmrgSProcListFontsWithInfo(ClientPtr client) 46605b261ecSmrg{ 46705b261ecSmrg REQUEST(xListFontsWithInfoReq); 46835c4bbdfSmrg swaps(&stuff->length); 46905b261ecSmrg REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); 47035c4bbdfSmrg swaps(&stuff->maxNames); 47135c4bbdfSmrg swaps(&stuff->nbytes); 47235c4bbdfSmrg return ((*ProcVector[X_ListFontsWithInfo]) (client)); 47305b261ecSmrg} 47405b261ecSmrg 47505b261ecSmrgint 47605b261ecSmrgSProcSetFontPath(ClientPtr client) 47705b261ecSmrg{ 47805b261ecSmrg REQUEST(xSetFontPathReq); 47935c4bbdfSmrg swaps(&stuff->length); 48005b261ecSmrg REQUEST_AT_LEAST_SIZE(xSetFontPathReq); 48135c4bbdfSmrg swaps(&stuff->nFonts); 48235c4bbdfSmrg return ((*ProcVector[X_SetFontPath]) (client)); 48305b261ecSmrg} 48405b261ecSmrg 48505b261ecSmrgint 48605b261ecSmrgSProcCreatePixmap(ClientPtr client) 48705b261ecSmrg{ 48805b261ecSmrg REQUEST(xCreatePixmapReq); 48905b261ecSmrg 49035c4bbdfSmrg swaps(&stuff->length); 49105b261ecSmrg REQUEST_SIZE_MATCH(xCreatePixmapReq); 49235c4bbdfSmrg swapl(&stuff->pid); 49335c4bbdfSmrg swapl(&stuff->drawable); 49435c4bbdfSmrg swaps(&stuff->width); 49535c4bbdfSmrg swaps(&stuff->height); 49635c4bbdfSmrg return ((*ProcVector[X_CreatePixmap]) (client)); 49705b261ecSmrg} 49805b261ecSmrg 49905b261ecSmrgint 50005b261ecSmrgSProcCreateGC(ClientPtr client) 50105b261ecSmrg{ 50205b261ecSmrg REQUEST(xCreateGCReq); 50335c4bbdfSmrg swaps(&stuff->length); 50405b261ecSmrg REQUEST_AT_LEAST_SIZE(xCreateGCReq); 50535c4bbdfSmrg swapl(&stuff->gc); 50635c4bbdfSmrg swapl(&stuff->drawable); 50735c4bbdfSmrg swapl(&stuff->mask); 50805b261ecSmrg SwapRestL(stuff); 50935c4bbdfSmrg return ((*ProcVector[X_CreateGC]) (client)); 51005b261ecSmrg} 51105b261ecSmrg 51205b261ecSmrgint 51305b261ecSmrgSProcChangeGC(ClientPtr client) 51405b261ecSmrg{ 51505b261ecSmrg REQUEST(xChangeGCReq); 51635c4bbdfSmrg swaps(&stuff->length); 51705b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeGCReq); 51835c4bbdfSmrg swapl(&stuff->gc); 51935c4bbdfSmrg swapl(&stuff->mask); 52005b261ecSmrg SwapRestL(stuff); 52135c4bbdfSmrg return ((*ProcVector[X_ChangeGC]) (client)); 52205b261ecSmrg} 52305b261ecSmrg 52405b261ecSmrgint 52505b261ecSmrgSProcCopyGC(ClientPtr client) 52605b261ecSmrg{ 52705b261ecSmrg REQUEST(xCopyGCReq); 52835c4bbdfSmrg swaps(&stuff->length); 52905b261ecSmrg REQUEST_SIZE_MATCH(xCopyGCReq); 53035c4bbdfSmrg swapl(&stuff->srcGC); 53135c4bbdfSmrg swapl(&stuff->dstGC); 53235c4bbdfSmrg swapl(&stuff->mask); 53335c4bbdfSmrg return ((*ProcVector[X_CopyGC]) (client)); 53405b261ecSmrg} 53505b261ecSmrg 53605b261ecSmrgint 53705b261ecSmrgSProcSetDashes(ClientPtr client) 53805b261ecSmrg{ 53905b261ecSmrg REQUEST(xSetDashesReq); 54035c4bbdfSmrg swaps(&stuff->length); 54105b261ecSmrg REQUEST_AT_LEAST_SIZE(xSetDashesReq); 54235c4bbdfSmrg swapl(&stuff->gc); 54335c4bbdfSmrg swaps(&stuff->dashOffset); 54435c4bbdfSmrg swaps(&stuff->nDashes); 54535c4bbdfSmrg return ((*ProcVector[X_SetDashes]) (client)); 54605b261ecSmrg 54705b261ecSmrg} 54805b261ecSmrg 54905b261ecSmrgint 55005b261ecSmrgSProcSetClipRectangles(ClientPtr client) 55105b261ecSmrg{ 55205b261ecSmrg REQUEST(xSetClipRectanglesReq); 55335c4bbdfSmrg swaps(&stuff->length); 55405b261ecSmrg REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); 55535c4bbdfSmrg swapl(&stuff->gc); 55635c4bbdfSmrg swaps(&stuff->xOrigin); 55735c4bbdfSmrg swaps(&stuff->yOrigin); 55805b261ecSmrg SwapRestS(stuff); 55935c4bbdfSmrg return ((*ProcVector[X_SetClipRectangles]) (client)); 56005b261ecSmrg} 56105b261ecSmrg 56205b261ecSmrgint 56305b261ecSmrgSProcClearToBackground(ClientPtr client) 56405b261ecSmrg{ 56505b261ecSmrg REQUEST(xClearAreaReq); 56635c4bbdfSmrg swaps(&stuff->length); 56705b261ecSmrg REQUEST_SIZE_MATCH(xClearAreaReq); 56835c4bbdfSmrg swapl(&stuff->window); 56935c4bbdfSmrg swaps(&stuff->x); 57035c4bbdfSmrg swaps(&stuff->y); 57135c4bbdfSmrg swaps(&stuff->width); 57235c4bbdfSmrg swaps(&stuff->height); 57335c4bbdfSmrg return ((*ProcVector[X_ClearArea]) (client)); 57405b261ecSmrg} 57505b261ecSmrg 57605b261ecSmrgint 57705b261ecSmrgSProcCopyArea(ClientPtr client) 57805b261ecSmrg{ 57905b261ecSmrg REQUEST(xCopyAreaReq); 58035c4bbdfSmrg swaps(&stuff->length); 58105b261ecSmrg REQUEST_SIZE_MATCH(xCopyAreaReq); 58235c4bbdfSmrg swapl(&stuff->srcDrawable); 58335c4bbdfSmrg swapl(&stuff->dstDrawable); 58435c4bbdfSmrg swapl(&stuff->gc); 58535c4bbdfSmrg swaps(&stuff->srcX); 58635c4bbdfSmrg swaps(&stuff->srcY); 58735c4bbdfSmrg swaps(&stuff->dstX); 58835c4bbdfSmrg swaps(&stuff->dstY); 58935c4bbdfSmrg swaps(&stuff->width); 59035c4bbdfSmrg swaps(&stuff->height); 59135c4bbdfSmrg return ((*ProcVector[X_CopyArea]) (client)); 59205b261ecSmrg} 59305b261ecSmrg 59405b261ecSmrgint 59505b261ecSmrgSProcCopyPlane(ClientPtr client) 59605b261ecSmrg{ 59705b261ecSmrg REQUEST(xCopyPlaneReq); 59835c4bbdfSmrg swaps(&stuff->length); 59905b261ecSmrg REQUEST_SIZE_MATCH(xCopyPlaneReq); 60035c4bbdfSmrg swapl(&stuff->srcDrawable); 60135c4bbdfSmrg swapl(&stuff->dstDrawable); 60235c4bbdfSmrg swapl(&stuff->gc); 60335c4bbdfSmrg swaps(&stuff->srcX); 60435c4bbdfSmrg swaps(&stuff->srcY); 60535c4bbdfSmrg swaps(&stuff->dstX); 60635c4bbdfSmrg swaps(&stuff->dstY); 60735c4bbdfSmrg swaps(&stuff->width); 60835c4bbdfSmrg swaps(&stuff->height); 60935c4bbdfSmrg swapl(&stuff->bitPlane); 61035c4bbdfSmrg return ((*ProcVector[X_CopyPlane]) (client)); 61105b261ecSmrg} 61205b261ecSmrg 61305b261ecSmrg/* The following routine is used for all Poly drawing requests 61405b261ecSmrg (except FillPoly, which uses a different request format) */ 61505b261ecSmrgint 61605b261ecSmrgSProcPoly(ClientPtr client) 61705b261ecSmrg{ 61805b261ecSmrg REQUEST(xPolyPointReq); 61935c4bbdfSmrg swaps(&stuff->length); 62005b261ecSmrg REQUEST_AT_LEAST_SIZE(xPolyPointReq); 62135c4bbdfSmrg swapl(&stuff->drawable); 62235c4bbdfSmrg swapl(&stuff->gc); 62305b261ecSmrg SwapRestS(stuff); 62435c4bbdfSmrg return ((*ProcVector[stuff->reqType]) (client)); 62505b261ecSmrg} 62605b261ecSmrg 62705b261ecSmrg/* cannot use SProcPoly for this one, because xFillPolyReq 62805b261ecSmrg is longer than xPolyPointReq, and we don't want to swap 62905b261ecSmrg the difference as shorts! */ 63005b261ecSmrgint 63105b261ecSmrgSProcFillPoly(ClientPtr client) 63205b261ecSmrg{ 63305b261ecSmrg REQUEST(xFillPolyReq); 63435c4bbdfSmrg swaps(&stuff->length); 63505b261ecSmrg REQUEST_AT_LEAST_SIZE(xFillPolyReq); 63635c4bbdfSmrg swapl(&stuff->drawable); 63735c4bbdfSmrg swapl(&stuff->gc); 63805b261ecSmrg SwapRestS(stuff); 63935c4bbdfSmrg return ((*ProcVector[X_FillPoly]) (client)); 64005b261ecSmrg} 64105b261ecSmrg 64205b261ecSmrgint 64305b261ecSmrgSProcPutImage(ClientPtr client) 64405b261ecSmrg{ 64505b261ecSmrg REQUEST(xPutImageReq); 64635c4bbdfSmrg swaps(&stuff->length); 64705b261ecSmrg REQUEST_AT_LEAST_SIZE(xPutImageReq); 64835c4bbdfSmrg swapl(&stuff->drawable); 64935c4bbdfSmrg swapl(&stuff->gc); 65035c4bbdfSmrg swaps(&stuff->width); 65135c4bbdfSmrg swaps(&stuff->height); 65235c4bbdfSmrg swaps(&stuff->dstX); 65335c4bbdfSmrg swaps(&stuff->dstY); 65405b261ecSmrg /* Image should already be swapped */ 65535c4bbdfSmrg return ((*ProcVector[X_PutImage]) (client)); 65605b261ecSmrg 65705b261ecSmrg} 65805b261ecSmrg 65905b261ecSmrgint 66005b261ecSmrgSProcGetImage(ClientPtr client) 66105b261ecSmrg{ 66205b261ecSmrg REQUEST(xGetImageReq); 66335c4bbdfSmrg swaps(&stuff->length); 66405b261ecSmrg REQUEST_SIZE_MATCH(xGetImageReq); 66535c4bbdfSmrg swapl(&stuff->drawable); 66635c4bbdfSmrg swaps(&stuff->x); 66735c4bbdfSmrg swaps(&stuff->y); 66835c4bbdfSmrg swaps(&stuff->width); 66935c4bbdfSmrg swaps(&stuff->height); 67035c4bbdfSmrg swapl(&stuff->planeMask); 67135c4bbdfSmrg return ((*ProcVector[X_GetImage]) (client)); 67205b261ecSmrg} 67305b261ecSmrg 67405b261ecSmrg/* ProcPolyText used for both PolyText8 and PolyText16 */ 67505b261ecSmrg 67605b261ecSmrgint 67705b261ecSmrgSProcPolyText(ClientPtr client) 67805b261ecSmrg{ 67905b261ecSmrg REQUEST(xPolyTextReq); 68035c4bbdfSmrg swaps(&stuff->length); 68105b261ecSmrg REQUEST_AT_LEAST_SIZE(xPolyTextReq); 68235c4bbdfSmrg swapl(&stuff->drawable); 68335c4bbdfSmrg swapl(&stuff->gc); 68435c4bbdfSmrg swaps(&stuff->x); 68535c4bbdfSmrg swaps(&stuff->y); 68635c4bbdfSmrg return ((*ProcVector[stuff->reqType]) (client)); 68705b261ecSmrg} 68805b261ecSmrg 68905b261ecSmrg/* ProcImageText used for both ImageText8 and ImageText16 */ 69005b261ecSmrg 69105b261ecSmrgint 69205b261ecSmrgSProcImageText(ClientPtr client) 69305b261ecSmrg{ 69405b261ecSmrg REQUEST(xImageTextReq); 69535c4bbdfSmrg swaps(&stuff->length); 69605b261ecSmrg REQUEST_AT_LEAST_SIZE(xImageTextReq); 69735c4bbdfSmrg swapl(&stuff->drawable); 69835c4bbdfSmrg swapl(&stuff->gc); 69935c4bbdfSmrg swaps(&stuff->x); 70035c4bbdfSmrg swaps(&stuff->y); 70135c4bbdfSmrg return ((*ProcVector[stuff->reqType]) (client)); 70205b261ecSmrg} 70305b261ecSmrg 70405b261ecSmrgint 70505b261ecSmrgSProcCreateColormap(ClientPtr client) 70605b261ecSmrg{ 70705b261ecSmrg REQUEST(xCreateColormapReq); 70835c4bbdfSmrg swaps(&stuff->length); 70905b261ecSmrg REQUEST_SIZE_MATCH(xCreateColormapReq); 71035c4bbdfSmrg swapl(&stuff->mid); 71135c4bbdfSmrg swapl(&stuff->window); 71235c4bbdfSmrg swapl(&stuff->visual); 71335c4bbdfSmrg return ((*ProcVector[X_CreateColormap]) (client)); 71405b261ecSmrg} 71505b261ecSmrg 71605b261ecSmrgint 71705b261ecSmrgSProcCopyColormapAndFree(ClientPtr client) 71805b261ecSmrg{ 71905b261ecSmrg REQUEST(xCopyColormapAndFreeReq); 72035c4bbdfSmrg swaps(&stuff->length); 72105b261ecSmrg REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); 72235c4bbdfSmrg swapl(&stuff->mid); 72335c4bbdfSmrg swapl(&stuff->srcCmap); 72435c4bbdfSmrg return ((*ProcVector[X_CopyColormapAndFree]) (client)); 72505b261ecSmrg 72605b261ecSmrg} 72705b261ecSmrg 72805b261ecSmrgint 72905b261ecSmrgSProcAllocColor(ClientPtr client) 73005b261ecSmrg{ 73105b261ecSmrg REQUEST(xAllocColorReq); 73235c4bbdfSmrg swaps(&stuff->length); 73305b261ecSmrg REQUEST_SIZE_MATCH(xAllocColorReq); 73435c4bbdfSmrg swapl(&stuff->cmap); 73535c4bbdfSmrg swaps(&stuff->red); 73635c4bbdfSmrg swaps(&stuff->green); 73735c4bbdfSmrg swaps(&stuff->blue); 73835c4bbdfSmrg return ((*ProcVector[X_AllocColor]) (client)); 73905b261ecSmrg} 74005b261ecSmrg 74105b261ecSmrgint 74205b261ecSmrgSProcAllocNamedColor(ClientPtr client) 74305b261ecSmrg{ 74405b261ecSmrg REQUEST(xAllocNamedColorReq); 74535c4bbdfSmrg swaps(&stuff->length); 74605b261ecSmrg REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq); 74735c4bbdfSmrg swapl(&stuff->cmap); 74835c4bbdfSmrg swaps(&stuff->nbytes); 74935c4bbdfSmrg return ((*ProcVector[X_AllocNamedColor]) (client)); 75005b261ecSmrg} 75105b261ecSmrg 75205b261ecSmrgint 75305b261ecSmrgSProcAllocColorCells(ClientPtr client) 75405b261ecSmrg{ 75505b261ecSmrg REQUEST(xAllocColorCellsReq); 75635c4bbdfSmrg swaps(&stuff->length); 75705b261ecSmrg REQUEST_SIZE_MATCH(xAllocColorCellsReq); 75835c4bbdfSmrg swapl(&stuff->cmap); 75935c4bbdfSmrg swaps(&stuff->colors); 76035c4bbdfSmrg swaps(&stuff->planes); 76135c4bbdfSmrg return ((*ProcVector[X_AllocColorCells]) (client)); 76205b261ecSmrg} 76305b261ecSmrg 76405b261ecSmrgint 76505b261ecSmrgSProcAllocColorPlanes(ClientPtr client) 76605b261ecSmrg{ 76705b261ecSmrg REQUEST(xAllocColorPlanesReq); 76835c4bbdfSmrg swaps(&stuff->length); 76905b261ecSmrg REQUEST_SIZE_MATCH(xAllocColorPlanesReq); 77035c4bbdfSmrg swapl(&stuff->cmap); 77135c4bbdfSmrg swaps(&stuff->colors); 77235c4bbdfSmrg swaps(&stuff->red); 77335c4bbdfSmrg swaps(&stuff->green); 77435c4bbdfSmrg swaps(&stuff->blue); 77535c4bbdfSmrg return ((*ProcVector[X_AllocColorPlanes]) (client)); 77605b261ecSmrg} 77705b261ecSmrg 77805b261ecSmrgint 77905b261ecSmrgSProcFreeColors(ClientPtr client) 78005b261ecSmrg{ 78105b261ecSmrg REQUEST(xFreeColorsReq); 78235c4bbdfSmrg swaps(&stuff->length); 78305b261ecSmrg REQUEST_AT_LEAST_SIZE(xFreeColorsReq); 78435c4bbdfSmrg swapl(&stuff->cmap); 78535c4bbdfSmrg swapl(&stuff->planeMask); 78605b261ecSmrg SwapRestL(stuff); 78735c4bbdfSmrg return ((*ProcVector[X_FreeColors]) (client)); 78805b261ecSmrg 78905b261ecSmrg} 79005b261ecSmrg 7916747b715Smrgvoid 79235c4bbdfSmrgSwapColorItem(xColorItem * pItem) 79305b261ecSmrg{ 79435c4bbdfSmrg swapl(&pItem->pixel); 79535c4bbdfSmrg swaps(&pItem->red); 79635c4bbdfSmrg swaps(&pItem->green); 79735c4bbdfSmrg swaps(&pItem->blue); 79805b261ecSmrg} 79905b261ecSmrg 80005b261ecSmrgint 80105b261ecSmrgSProcStoreColors(ClientPtr client) 80205b261ecSmrg{ 80305b261ecSmrg long count; 80435c4bbdfSmrg xColorItem *pItem; 80505b261ecSmrg 80605b261ecSmrg REQUEST(xStoreColorsReq); 80735c4bbdfSmrg swaps(&stuff->length); 80805b261ecSmrg REQUEST_AT_LEAST_SIZE(xStoreColorsReq); 80935c4bbdfSmrg swapl(&stuff->cmap); 81005b261ecSmrg pItem = (xColorItem *) &stuff[1]; 81135c4bbdfSmrg for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;) 81235c4bbdfSmrg SwapColorItem(pItem++); 81335c4bbdfSmrg return ((*ProcVector[X_StoreColors]) (client)); 81405b261ecSmrg} 81505b261ecSmrg 81605b261ecSmrgint 81735c4bbdfSmrgSProcStoreNamedColor(ClientPtr client) 81805b261ecSmrg{ 81905b261ecSmrg REQUEST(xStoreNamedColorReq); 82035c4bbdfSmrg swaps(&stuff->length); 82105b261ecSmrg REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); 82235c4bbdfSmrg swapl(&stuff->cmap); 82335c4bbdfSmrg swapl(&stuff->pixel); 82435c4bbdfSmrg swaps(&stuff->nbytes); 82535c4bbdfSmrg return ((*ProcVector[X_StoreNamedColor]) (client)); 82605b261ecSmrg} 82705b261ecSmrg 82805b261ecSmrgint 82935c4bbdfSmrgSProcQueryColors(ClientPtr client) 83005b261ecSmrg{ 83105b261ecSmrg REQUEST(xQueryColorsReq); 83235c4bbdfSmrg swaps(&stuff->length); 83305b261ecSmrg REQUEST_AT_LEAST_SIZE(xQueryColorsReq); 83435c4bbdfSmrg swapl(&stuff->cmap); 83505b261ecSmrg SwapRestL(stuff); 83635c4bbdfSmrg return ((*ProcVector[X_QueryColors]) (client)); 83735c4bbdfSmrg} 83805b261ecSmrg 83905b261ecSmrgint 84035c4bbdfSmrgSProcLookupColor(ClientPtr client) 84105b261ecSmrg{ 84205b261ecSmrg REQUEST(xLookupColorReq); 84335c4bbdfSmrg swaps(&stuff->length); 84405b261ecSmrg REQUEST_AT_LEAST_SIZE(xLookupColorReq); 84535c4bbdfSmrg swapl(&stuff->cmap); 84635c4bbdfSmrg swaps(&stuff->nbytes); 84735c4bbdfSmrg return ((*ProcVector[X_LookupColor]) (client)); 84805b261ecSmrg} 84905b261ecSmrg 85005b261ecSmrgint 85135c4bbdfSmrgSProcCreateCursor(ClientPtr client) 85205b261ecSmrg{ 85305b261ecSmrg REQUEST(xCreateCursorReq); 85435c4bbdfSmrg swaps(&stuff->length); 85505b261ecSmrg REQUEST_SIZE_MATCH(xCreateCursorReq); 85635c4bbdfSmrg swapl(&stuff->cid); 85735c4bbdfSmrg swapl(&stuff->source); 85835c4bbdfSmrg swapl(&stuff->mask); 85935c4bbdfSmrg swaps(&stuff->foreRed); 86035c4bbdfSmrg swaps(&stuff->foreGreen); 86135c4bbdfSmrg swaps(&stuff->foreBlue); 86235c4bbdfSmrg swaps(&stuff->backRed); 86335c4bbdfSmrg swaps(&stuff->backGreen); 86435c4bbdfSmrg swaps(&stuff->backBlue); 86535c4bbdfSmrg swaps(&stuff->x); 86635c4bbdfSmrg swaps(&stuff->y); 86735c4bbdfSmrg return ((*ProcVector[X_CreateCursor]) (client)); 86805b261ecSmrg} 86905b261ecSmrg 87005b261ecSmrgint 87135c4bbdfSmrgSProcCreateGlyphCursor(ClientPtr client) 87205b261ecSmrg{ 87305b261ecSmrg REQUEST(xCreateGlyphCursorReq); 87435c4bbdfSmrg swaps(&stuff->length); 87505b261ecSmrg REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); 87635c4bbdfSmrg swapl(&stuff->cid); 87735c4bbdfSmrg swapl(&stuff->source); 87835c4bbdfSmrg swapl(&stuff->mask); 87935c4bbdfSmrg swaps(&stuff->sourceChar); 88035c4bbdfSmrg swaps(&stuff->maskChar); 88135c4bbdfSmrg swaps(&stuff->foreRed); 88235c4bbdfSmrg swaps(&stuff->foreGreen); 88335c4bbdfSmrg swaps(&stuff->foreBlue); 88435c4bbdfSmrg swaps(&stuff->backRed); 88535c4bbdfSmrg swaps(&stuff->backGreen); 88635c4bbdfSmrg swaps(&stuff->backBlue); 88735c4bbdfSmrg return ((*ProcVector[X_CreateGlyphCursor]) (client)); 88805b261ecSmrg} 88905b261ecSmrg 89005b261ecSmrgint 89135c4bbdfSmrgSProcRecolorCursor(ClientPtr client) 89205b261ecSmrg{ 89305b261ecSmrg REQUEST(xRecolorCursorReq); 89435c4bbdfSmrg swaps(&stuff->length); 89505b261ecSmrg REQUEST_SIZE_MATCH(xRecolorCursorReq); 89635c4bbdfSmrg swapl(&stuff->cursor); 89735c4bbdfSmrg swaps(&stuff->foreRed); 89835c4bbdfSmrg swaps(&stuff->foreGreen); 89935c4bbdfSmrg swaps(&stuff->foreBlue); 90035c4bbdfSmrg swaps(&stuff->backRed); 90135c4bbdfSmrg swaps(&stuff->backGreen); 90235c4bbdfSmrg swaps(&stuff->backBlue); 90335c4bbdfSmrg return ((*ProcVector[X_RecolorCursor]) (client)); 90405b261ecSmrg} 90505b261ecSmrg 90605b261ecSmrgint 90735c4bbdfSmrgSProcQueryBestSize(ClientPtr client) 90805b261ecSmrg{ 90905b261ecSmrg REQUEST(xQueryBestSizeReq); 91035c4bbdfSmrg swaps(&stuff->length); 91105b261ecSmrg REQUEST_SIZE_MATCH(xQueryBestSizeReq); 91235c4bbdfSmrg swapl(&stuff->drawable); 91335c4bbdfSmrg swaps(&stuff->width); 91435c4bbdfSmrg swaps(&stuff->height); 91535c4bbdfSmrg return ((*ProcVector[X_QueryBestSize]) (client)); 91605b261ecSmrg 91705b261ecSmrg} 91805b261ecSmrg 91905b261ecSmrgint 92035c4bbdfSmrgSProcQueryExtension(ClientPtr client) 92105b261ecSmrg{ 92205b261ecSmrg REQUEST(xQueryExtensionReq); 92335c4bbdfSmrg swaps(&stuff->length); 92405b261ecSmrg REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); 92535c4bbdfSmrg swaps(&stuff->nbytes); 92635c4bbdfSmrg return ((*ProcVector[X_QueryExtension]) (client)); 92705b261ecSmrg} 92805b261ecSmrg 92905b261ecSmrgint 93035c4bbdfSmrgSProcChangeKeyboardMapping(ClientPtr client) 93105b261ecSmrg{ 93205b261ecSmrg REQUEST(xChangeKeyboardMappingReq); 93335c4bbdfSmrg swaps(&stuff->length); 93405b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); 93505b261ecSmrg SwapRestL(stuff); 93635c4bbdfSmrg return ((*ProcVector[X_ChangeKeyboardMapping]) (client)); 93705b261ecSmrg} 93805b261ecSmrg 93905b261ecSmrgint 94035c4bbdfSmrgSProcChangeKeyboardControl(ClientPtr client) 94105b261ecSmrg{ 94205b261ecSmrg REQUEST(xChangeKeyboardControlReq); 94335c4bbdfSmrg swaps(&stuff->length); 94405b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); 94535c4bbdfSmrg swapl(&stuff->mask); 94605b261ecSmrg SwapRestL(stuff); 94735c4bbdfSmrg return ((*ProcVector[X_ChangeKeyboardControl]) (client)); 94805b261ecSmrg} 94905b261ecSmrg 95005b261ecSmrgint 95135c4bbdfSmrgSProcChangePointerControl(ClientPtr client) 95205b261ecSmrg{ 95305b261ecSmrg REQUEST(xChangePointerControlReq); 95435c4bbdfSmrg swaps(&stuff->length); 95505b261ecSmrg REQUEST_SIZE_MATCH(xChangePointerControlReq); 95635c4bbdfSmrg swaps(&stuff->accelNum); 95735c4bbdfSmrg swaps(&stuff->accelDenum); 95835c4bbdfSmrg swaps(&stuff->threshold); 95935c4bbdfSmrg return ((*ProcVector[X_ChangePointerControl]) (client)); 96005b261ecSmrg} 96105b261ecSmrg 96205b261ecSmrgint 96335c4bbdfSmrgSProcSetScreenSaver(ClientPtr client) 96405b261ecSmrg{ 96505b261ecSmrg REQUEST(xSetScreenSaverReq); 96635c4bbdfSmrg swaps(&stuff->length); 96705b261ecSmrg REQUEST_SIZE_MATCH(xSetScreenSaverReq); 96835c4bbdfSmrg swaps(&stuff->timeout); 96935c4bbdfSmrg swaps(&stuff->interval); 97035c4bbdfSmrg return ((*ProcVector[X_SetScreenSaver]) (client)); 97105b261ecSmrg} 97205b261ecSmrg 97305b261ecSmrgint 97435c4bbdfSmrgSProcChangeHosts(ClientPtr client) 97505b261ecSmrg{ 97605b261ecSmrg REQUEST(xChangeHostsReq); 97735c4bbdfSmrg swaps(&stuff->length); 97805b261ecSmrg REQUEST_AT_LEAST_SIZE(xChangeHostsReq); 97935c4bbdfSmrg swaps(&stuff->hostLength); 98035c4bbdfSmrg return ((*ProcVector[X_ChangeHosts]) (client)); 98105b261ecSmrg 98205b261ecSmrg} 98305b261ecSmrg 98435c4bbdfSmrgint 98535c4bbdfSmrgSProcRotateProperties(ClientPtr client) 98605b261ecSmrg{ 98705b261ecSmrg REQUEST(xRotatePropertiesReq); 98835c4bbdfSmrg swaps(&stuff->length); 98905b261ecSmrg REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); 99035c4bbdfSmrg swapl(&stuff->window); 99135c4bbdfSmrg swaps(&stuff->nAtoms); 99235c4bbdfSmrg swaps(&stuff->nPositions); 99305b261ecSmrg SwapRestL(stuff); 99435c4bbdfSmrg return ((*ProcVector[X_RotateProperties]) (client)); 99505b261ecSmrg} 99605b261ecSmrg 99705b261ecSmrgint 99805b261ecSmrgSProcNoOperation(ClientPtr client) 99905b261ecSmrg{ 100005b261ecSmrg REQUEST(xReq); 100135c4bbdfSmrg swaps(&stuff->length); 100235c4bbdfSmrg return ((*ProcVector[X_NoOperation]) (client)); 100305b261ecSmrg} 100405b261ecSmrg 100505b261ecSmrgvoid 100635c4bbdfSmrgSwapConnClientPrefix(xConnClientPrefix * pCCP) 100705b261ecSmrg{ 100835c4bbdfSmrg swaps(&pCCP->majorVersion); 100935c4bbdfSmrg swaps(&pCCP->minorVersion); 101035c4bbdfSmrg swaps(&pCCP->nbytesAuthProto); 101135c4bbdfSmrg swaps(&pCCP->nbytesAuthString); 101205b261ecSmrg} 1013