12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085 |
- /************************************************************
- Copyright 1987, 1998 The Open Group
- Permission to use, copy, modify, distribute, and sell this software and its
- documentation for any purpose is hereby granted without fee, provided that
- the above copyright notice appear in all copies and that both that
- copyright notice and this permission notice appear in supporting
- documentation.
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Except as contained in this notice, the name of The Open Group shall not be
- used in advertising or otherwise to promote the sale, use or other dealings
- in this Software without prior written authorization from The Open Group.
- Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- All Rights Reserved
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the name of Digital not be
- used in advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
- DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- SOFTWARE.
- ********************************************************/
- #ifdef HAVE_DIX_CONFIG_H
- #include <dix-config.h>
- #endif
- #include <X11/X.h>
- #include <X11/Xproto.h>
- #include <X11/Xprotostr.h>
- #include "misc.h"
- #include "dixstruct.h"
- #include "extnsionst.h" /* for SendEvent */
- #include "swapreq.h"
- /* Thanks to Jack Palevich for testing and subsequently rewriting all this */
- /* Byte swap a list of longs */
- _X_EXPORT void
- SwapLongs(register CARD32 *list, register unsigned long count)
- {
- while (count >= 8) {
- swapl(list + 0);
- swapl(list + 1);
- swapl(list + 2);
- swapl(list + 3);
- swapl(list + 4);
- swapl(list + 5);
- swapl(list + 6);
- swapl(list + 7);
- list += 8;
- count -= 8;
- }
- if (count != 0) {
- do {
- swapl(list);
- list++;
- } while (--count != 0);
- }
- }
- /* Byte swap a list of shorts */
- _X_EXPORT void
- SwapShorts(register short *list, register unsigned long count)
- {
- while (count >= 16) {
- swaps(list + 0);
- swaps(list + 1);
- swaps(list + 2);
- swaps(list + 3);
- swaps(list + 4);
- swaps(list + 5);
- swaps(list + 6);
- swaps(list + 7);
- swaps(list + 8);
- swaps(list + 9);
- swaps(list + 10);
- swaps(list + 11);
- swaps(list + 12);
- swaps(list + 13);
- swaps(list + 14);
- swaps(list + 15);
- list += 16;
- count -= 16;
- }
- if (count != 0) {
- do {
- swaps(list);
- list++;
- } while (--count != 0);
- }
- }
- /* The following is used for all requests that have
- no fields to be swapped (except "length") */
- int
- SProcSimpleReq(register ClientPtr client)
- {
- REQUEST(xReq);
- swaps(&stuff->length);
- return (*ProcVector[stuff->reqType]) (client);
- }
- /* The following is used for all requests that have
- only a single 32-bit field to be swapped, coming
- right after the "length" field */
- int
- SProcResourceReq(register ClientPtr client)
- {
- REQUEST(xResourceReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
- swapl(&stuff->id);
- return (*ProcVector[stuff->reqType]) (client);
- }
- int
- SProcCreateWindow(register ClientPtr client)
- {
- REQUEST(xCreateWindowReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
- swapl(&stuff->wid);
- swapl(&stuff->parent);
- swaps(&stuff->x);
- swaps(&stuff->y);
- swaps(&stuff->width);
- swaps(&stuff->height);
- swaps(&stuff->borderWidth);
- swaps(&stuff->class);
- swapl(&stuff->visual);
- swapl(&stuff->mask);
- SwapRestL(stuff);
- return ((*ProcVector[X_CreateWindow]) (client));
- }
- int
- SProcChangeWindowAttributes(register ClientPtr client)
- {
- REQUEST(xChangeWindowAttributesReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
- swapl(&stuff->window);
- swapl(&stuff->valueMask);
- SwapRestL(stuff);
- return ((*ProcVector[X_ChangeWindowAttributes]) (client));
- }
- int
- SProcReparentWindow(register ClientPtr client)
- {
- REQUEST(xReparentWindowReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xReparentWindowReq);
- swapl(&stuff->window);
- swapl(&stuff->parent);
- swaps(&stuff->x);
- swaps(&stuff->y);
- return ((*ProcVector[X_ReparentWindow]) (client));
- }
- int
- SProcConfigureWindow(register ClientPtr client)
- {
- REQUEST(xConfigureWindowReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
- swapl(&stuff->window);
- swaps(&stuff->mask);
- SwapRestL(stuff);
- return ((*ProcVector[X_ConfigureWindow]) (client));
- }
- int
- SProcInternAtom(register ClientPtr client)
- {
- REQUEST(xInternAtomReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xInternAtomReq);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_InternAtom]) (client));
- }
- int
- SProcChangeProperty(register ClientPtr client)
- {
- REQUEST(xChangePropertyReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
- swapl(&stuff->window);
- swapl(&stuff->property);
- swapl(&stuff->type);
- swapl(&stuff->nUnits);
- switch (stuff->format) {
- case 8:
- break;
- case 16:
- SwapRestS(stuff);
- break;
- case 32:
- SwapRestL(stuff);
- break;
- }
- return ((*ProcVector[X_ChangeProperty]) (client));
- }
- int
- SProcDeleteProperty(register ClientPtr client)
- {
- REQUEST(xDeletePropertyReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xDeletePropertyReq);
- swapl(&stuff->window);
- swapl(&stuff->property);
- return ((*ProcVector[X_DeleteProperty]) (client));
- }
- int
- SProcGetProperty(register ClientPtr client)
- {
- REQUEST(xGetPropertyReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGetPropertyReq);
- swapl(&stuff->window);
- swapl(&stuff->property);
- swapl(&stuff->type);
- swapl(&stuff->longOffset);
- swapl(&stuff->longLength);
- return ((*ProcVector[X_GetProperty]) (client));
- }
- int
- SProcSetSelectionOwner(register ClientPtr client)
- {
- REQUEST(xSetSelectionOwnerReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
- swapl(&stuff->window);
- swapl(&stuff->selection);
- swapl(&stuff->time);
- return ((*ProcVector[X_SetSelectionOwner]) (client));
- }
- int
- SProcConvertSelection(register ClientPtr client)
- {
- REQUEST(xConvertSelectionReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xConvertSelectionReq);
- swapl(&stuff->requestor);
- swapl(&stuff->selection);
- swapl(&stuff->target);
- swapl(&stuff->property);
- swapl(&stuff->time);
- return ((*ProcVector[X_ConvertSelection]) (client));
- }
- int
- SProcSendEvent(register ClientPtr client)
- {
- xEvent eventT;
- EventSwapPtr proc;
- REQUEST(xSendEventReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xSendEventReq);
- swapl(&stuff->destination);
- swapl(&stuff->eventMask);
- /* Swap event */
- proc = EventSwapVector[stuff->event.u.u.type & 0177];
- if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
- return (BadValue);
- (*proc) (&stuff->event, &eventT);
- stuff->event = eventT;
- return ((*ProcVector[X_SendEvent]) (client));
- }
- int
- SProcGrabPointer(register ClientPtr client)
- {
- REQUEST(xGrabPointerReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGrabPointerReq);
- swapl(&stuff->grabWindow);
- swaps(&stuff->eventMask);
- swapl(&stuff->confineTo);
- swapl(&stuff->cursor);
- swapl(&stuff->time);
- return ((*ProcVector[X_GrabPointer]) (client));
- }
- int
- SProcGrabButton(register ClientPtr client)
- {
- REQUEST(xGrabButtonReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGrabButtonReq);
- swapl(&stuff->grabWindow);
- swaps(&stuff->eventMask);
- swapl(&stuff->confineTo);
- swapl(&stuff->cursor);
- swaps(&stuff->modifiers);
- return ((*ProcVector[X_GrabButton]) (client));
- }
- int
- SProcUngrabButton(register ClientPtr client)
- {
- REQUEST(xUngrabButtonReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xUngrabButtonReq);
- swapl(&stuff->grabWindow);
- swaps(&stuff->modifiers);
- return ((*ProcVector[X_UngrabButton]) (client));
- }
- int
- SProcChangeActivePointerGrab(register ClientPtr client)
- {
- REQUEST(xChangeActivePointerGrabReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
- swapl(&stuff->cursor);
- swapl(&stuff->time);
- swaps(&stuff->eventMask);
- return ((*ProcVector[X_ChangeActivePointerGrab]) (client));
- }
- int
- SProcGrabKeyboard(register ClientPtr client)
- {
- REQUEST(xGrabKeyboardReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGrabKeyboardReq);
- swapl(&stuff->grabWindow);
- swapl(&stuff->time);
- return ((*ProcVector[X_GrabKeyboard]) (client));
- }
- int
- SProcGrabKey(register ClientPtr client)
- {
- REQUEST(xGrabKeyReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGrabKeyReq);
- swapl(&stuff->grabWindow);
- swaps(&stuff->modifiers);
- return ((*ProcVector[X_GrabKey]) (client));
- }
- int
- SProcUngrabKey(register ClientPtr client)
- {
- REQUEST(xUngrabKeyReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xUngrabKeyReq);
- swapl(&stuff->grabWindow);
- swaps(&stuff->modifiers);
- return ((*ProcVector[X_UngrabKey]) (client));
- }
- int
- SProcGetMotionEvents(register ClientPtr client)
- {
- REQUEST(xGetMotionEventsReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGetMotionEventsReq);
- swapl(&stuff->window);
- swapl(&stuff->start);
- swapl(&stuff->stop);
- return ((*ProcVector[X_GetMotionEvents]) (client));
- }
- int
- SProcTranslateCoords(register ClientPtr client)
- {
- REQUEST(xTranslateCoordsReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xTranslateCoordsReq);
- swapl(&stuff->srcWid);
- swapl(&stuff->dstWid);
- swaps(&stuff->srcX);
- swaps(&stuff->srcY);
- return ((*ProcVector[X_TranslateCoords]) (client));
- }
- int
- SProcWarpPointer(register ClientPtr client)
- {
- REQUEST(xWarpPointerReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xWarpPointerReq);
- swapl(&stuff->srcWid);
- swapl(&stuff->dstWid);
- swaps(&stuff->srcX);
- swaps(&stuff->srcY);
- swaps(&stuff->srcWidth);
- swaps(&stuff->srcHeight);
- swaps(&stuff->dstX);
- swaps(&stuff->dstY);
- return ((*ProcVector[X_WarpPointer]) (client));
- }
- int
- SProcSetInputFocus(register ClientPtr client)
- {
- REQUEST(xSetInputFocusReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xSetInputFocusReq);
- swapl(&stuff->focus);
- swapl(&stuff->time);
- return ((*ProcVector[X_SetInputFocus]) (client));
- }
- int
- SProcOpenFont(register ClientPtr client)
- {
- REQUEST(xOpenFontReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xOpenFontReq);
- swapl(&stuff->fid);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_OpenFont]) (client));
- }
- int
- SProcListFonts(register ClientPtr client)
- {
- REQUEST(xListFontsReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xListFontsReq);
- swaps(&stuff->maxNames);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_ListFonts]) (client));
- }
- int
- SProcListFontsWithInfo(register ClientPtr client)
- {
- REQUEST(xListFontsWithInfoReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
- swaps(&stuff->maxNames);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_ListFontsWithInfo]) (client));
- }
- int
- SProcSetFontPath(register ClientPtr client)
- {
- REQUEST(xSetFontPathReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
- swaps(&stuff->nFonts);
- return ((*ProcVector[X_SetFontPath]) (client));
- }
- int
- SProcCreatePixmap(register ClientPtr client)
- {
- REQUEST(xCreatePixmapReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCreatePixmapReq);
- swapl(&stuff->pid);
- swapl(&stuff->drawable);
- swaps(&stuff->width);
- swaps(&stuff->height);
- return ((*ProcVector[X_CreatePixmap]) (client));
- }
- int
- SProcCreateGC(register ClientPtr client)
- {
- REQUEST(xCreateGCReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xCreateGCReq);
- swapl(&stuff->gc);
- swapl(&stuff->drawable);
- swapl(&stuff->mask);
- SwapRestL(stuff);
- return ((*ProcVector[X_CreateGC]) (client));
- }
- int
- SProcChangeGC(register ClientPtr client)
- {
- REQUEST(xChangeGCReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xChangeGCReq);
- swapl(&stuff->gc);
- swapl(&stuff->mask);
- SwapRestL(stuff);
- return ((*ProcVector[X_ChangeGC]) (client));
- }
- int
- SProcCopyGC(register ClientPtr client)
- {
- REQUEST(xCopyGCReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCopyGCReq);
- swapl(&stuff->srcGC);
- swapl(&stuff->dstGC);
- swapl(&stuff->mask);
- return ((*ProcVector[X_CopyGC]) (client));
- }
- int
- SProcSetDashes(register ClientPtr client)
- {
- REQUEST(xSetDashesReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xSetDashesReq);
- swapl(&stuff->gc);
- swaps(&stuff->dashOffset);
- swaps(&stuff->nDashes);
- return ((*ProcVector[X_SetDashes]) (client));
- }
- int
- SProcSetClipRectangles(register ClientPtr client)
- {
- REQUEST(xSetClipRectanglesReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
- swapl(&stuff->gc);
- swaps(&stuff->xOrigin);
- swaps(&stuff->yOrigin);
- SwapRestS(stuff);
- return ((*ProcVector[X_SetClipRectangles]) (client));
- }
- int
- SProcClearToBackground(register ClientPtr client)
- {
- REQUEST(xClearAreaReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xClearAreaReq);
- swapl(&stuff->window);
- swaps(&stuff->x);
- swaps(&stuff->y);
- swaps(&stuff->width);
- swaps(&stuff->height);
- return ((*ProcVector[X_ClearArea]) (client));
- }
- int
- SProcCopyArea(register ClientPtr client)
- {
- REQUEST(xCopyAreaReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCopyAreaReq);
- swapl(&stuff->srcDrawable);
- swapl(&stuff->dstDrawable);
- swapl(&stuff->gc);
- swaps(&stuff->srcX);
- swaps(&stuff->srcY);
- swaps(&stuff->dstX);
- swaps(&stuff->dstY);
- swaps(&stuff->width);
- swaps(&stuff->height);
- return ((*ProcVector[X_CopyArea]) (client));
- }
- int
- SProcCopyPlane(register ClientPtr client)
- {
- REQUEST(xCopyPlaneReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCopyPlaneReq);
- swapl(&stuff->srcDrawable);
- swapl(&stuff->dstDrawable);
- swapl(&stuff->gc);
- swaps(&stuff->srcX);
- swaps(&stuff->srcY);
- swaps(&stuff->dstX);
- swaps(&stuff->dstY);
- swaps(&stuff->width);
- swaps(&stuff->height);
- swapl(&stuff->bitPlane);
- return ((*ProcVector[X_CopyPlane]) (client));
- }
- /* The following routine is used for all Poly drawing requests
- (except FillPoly, which uses a different request format) */
- int
- SProcPoly(register ClientPtr client)
- {
- REQUEST(xPolyPointReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xPolyPointReq);
- swapl(&stuff->drawable);
- swapl(&stuff->gc);
- SwapRestS(stuff);
- return ((*ProcVector[stuff->reqType]) (client));
- }
- /* cannot use SProcPoly for this one, because xFillPolyReq
- is longer than xPolyPointReq, and we don't want to swap
- the difference as shorts! */
- int
- SProcFillPoly(register ClientPtr client)
- {
- REQUEST(xFillPolyReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xFillPolyReq);
- swapl(&stuff->drawable);
- swapl(&stuff->gc);
- SwapRestS(stuff);
- return ((*ProcVector[X_FillPoly]) (client));
- }
- int
- SProcPutImage(register ClientPtr client)
- {
- REQUEST(xPutImageReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xPutImageReq);
- swapl(&stuff->drawable);
- swapl(&stuff->gc);
- swaps(&stuff->width);
- swaps(&stuff->height);
- swaps(&stuff->dstX);
- swaps(&stuff->dstY);
- /* Image should already be swapped */
- return ((*ProcVector[X_PutImage]) (client));
- }
- int
- SProcGetImage(register ClientPtr client)
- {
- REQUEST(xGetImageReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xGetImageReq);
- swapl(&stuff->drawable);
- swaps(&stuff->x);
- swaps(&stuff->y);
- swaps(&stuff->width);
- swaps(&stuff->height);
- swapl(&stuff->planeMask);
- return ((*ProcVector[X_GetImage]) (client));
- }
- /* ProcPolyText used for both PolyText8 and PolyText16 */
- int
- SProcPolyText(register ClientPtr client)
- {
- REQUEST(xPolyTextReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- swapl(&stuff->drawable);
- swapl(&stuff->gc);
- swaps(&stuff->x);
- swaps(&stuff->y);
- return ((*ProcVector[stuff->reqType]) (client));
- }
- /* ProcImageText used for both ImageText8 and ImageText16 */
- int
- SProcImageText(register ClientPtr client)
- {
- REQUEST(xImageTextReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xImageTextReq);
- swapl(&stuff->drawable);
- swapl(&stuff->gc);
- swaps(&stuff->x);
- swaps(&stuff->y);
- return ((*ProcVector[stuff->reqType]) (client));
- }
- int
- SProcCreateColormap(register ClientPtr client)
- {
- REQUEST(xCreateColormapReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCreateColormapReq);
- swapl(&stuff->mid);
- swapl(&stuff->window);
- swapl(&stuff->visual);
- return ((*ProcVector[X_CreateColormap]) (client));
- }
- int
- SProcCopyColormapAndFree(register ClientPtr client)
- {
- REQUEST(xCopyColormapAndFreeReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
- swapl(&stuff->mid);
- swapl(&stuff->srcCmap);
- return ((*ProcVector[X_CopyColormapAndFree]) (client));
- }
- int
- SProcAllocColor(register ClientPtr client)
- {
- REQUEST(xAllocColorReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xAllocColorReq);
- swapl(&stuff->cmap);
- swaps(&stuff->red);
- swaps(&stuff->green);
- swaps(&stuff->blue);
- return ((*ProcVector[X_AllocColor]) (client));
- }
- int
- SProcAllocNamedColor(register ClientPtr client)
- {
- REQUEST(xAllocNamedColorReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
- swapl(&stuff->cmap);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_AllocNamedColor]) (client));
- }
- int
- SProcAllocColorCells(register ClientPtr client)
- {
- REQUEST(xAllocColorCellsReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xAllocColorCellsReq);
- swapl(&stuff->cmap);
- swaps(&stuff->colors);
- swaps(&stuff->planes);
- return ((*ProcVector[X_AllocColorCells]) (client));
- }
- int
- SProcAllocColorPlanes(register ClientPtr client)
- {
- REQUEST(xAllocColorPlanesReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
- swapl(&stuff->cmap);
- swaps(&stuff->colors);
- swaps(&stuff->red);
- swaps(&stuff->green);
- swaps(&stuff->blue);
- return ((*ProcVector[X_AllocColorPlanes]) (client));
- }
- int
- SProcFreeColors(register ClientPtr client)
- {
- REQUEST(xFreeColorsReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
- swapl(&stuff->cmap);
- swapl(&stuff->planeMask);
- SwapRestL(stuff);
- return ((*ProcVector[X_FreeColors]) (client));
- }
- _X_EXPORT void
- SwapColorItem(xColorItem * pItem)
- {
- swapl(&pItem->pixel);
- swaps(&pItem->red);
- swaps(&pItem->green);
- swaps(&pItem->blue);
- }
- int
- SProcStoreColors(register ClientPtr client)
- {
- long count;
- xColorItem *pItem;
- REQUEST(xStoreColorsReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
- swapl(&stuff->cmap);
- pItem = (xColorItem *) & stuff[1];
- for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;)
- SwapColorItem(pItem++);
- return ((*ProcVector[X_StoreColors]) (client));
- }
- int
- SProcStoreNamedColor(register ClientPtr client)
- {
- REQUEST(xStoreNamedColorReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
- swapl(&stuff->cmap);
- swapl(&stuff->pixel);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_StoreNamedColor]) (client));
- }
- int
- SProcQueryColors(register ClientPtr client)
- {
- REQUEST(xQueryColorsReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
- swapl(&stuff->cmap);
- SwapRestL(stuff);
- return ((*ProcVector[X_QueryColors]) (client));
- }
- int
- SProcLookupColor(register ClientPtr client)
- {
- REQUEST(xLookupColorReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xLookupColorReq);
- swapl(&stuff->cmap);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_LookupColor]) (client));
- }
- int
- SProcCreateCursor(register ClientPtr client)
- {
- REQUEST(xCreateCursorReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCreateCursorReq);
- swapl(&stuff->cid);
- swapl(&stuff->source);
- swapl(&stuff->mask);
- swaps(&stuff->foreRed);
- swaps(&stuff->foreGreen);
- swaps(&stuff->foreBlue);
- swaps(&stuff->backRed);
- swaps(&stuff->backGreen);
- swaps(&stuff->backBlue);
- swaps(&stuff->x);
- swaps(&stuff->y);
- return ((*ProcVector[X_CreateCursor]) (client));
- }
- int
- SProcCreateGlyphCursor(register ClientPtr client)
- {
- REQUEST(xCreateGlyphCursorReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
- swapl(&stuff->cid);
- swapl(&stuff->source);
- swapl(&stuff->mask);
- swaps(&stuff->sourceChar);
- swaps(&stuff->maskChar);
- swaps(&stuff->foreRed);
- swaps(&stuff->foreGreen);
- swaps(&stuff->foreBlue);
- swaps(&stuff->backRed);
- swaps(&stuff->backGreen);
- swaps(&stuff->backBlue);
- return ((*ProcVector[X_CreateGlyphCursor]) (client));
- }
- int
- SProcRecolorCursor(register ClientPtr client)
- {
- REQUEST(xRecolorCursorReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xRecolorCursorReq);
- swapl(&stuff->cursor);
- swaps(&stuff->foreRed);
- swaps(&stuff->foreGreen);
- swaps(&stuff->foreBlue);
- swaps(&stuff->backRed);
- swaps(&stuff->backGreen);
- swaps(&stuff->backBlue);
- return ((*ProcVector[X_RecolorCursor]) (client));
- }
- int
- SProcQueryBestSize(register ClientPtr client)
- {
- REQUEST(xQueryBestSizeReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xQueryBestSizeReq);
- swapl(&stuff->drawable);
- swaps(&stuff->width);
- swaps(&stuff->height);
- return ((*ProcVector[X_QueryBestSize]) (client));
- }
- int
- SProcQueryExtension(register ClientPtr client)
- {
- REQUEST(xQueryExtensionReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
- swaps(&stuff->nbytes);
- return ((*ProcVector[X_QueryExtension]) (client));
- }
- int
- SProcChangeKeyboardMapping(register ClientPtr client)
- {
- REQUEST(xChangeKeyboardMappingReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
- SwapRestL(stuff);
- return ((*ProcVector[X_ChangeKeyboardMapping]) (client));
- }
- int
- SProcChangeKeyboardControl(register ClientPtr client)
- {
- REQUEST(xChangeKeyboardControlReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
- swapl(&stuff->mask);
- SwapRestL(stuff);
- return ((*ProcVector[X_ChangeKeyboardControl]) (client));
- }
- int
- SProcChangePointerControl(register ClientPtr client)
- {
- REQUEST(xChangePointerControlReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xChangePointerControlReq);
- swaps(&stuff->accelNum);
- swaps(&stuff->accelDenum);
- swaps(&stuff->threshold);
- return ((*ProcVector[X_ChangePointerControl]) (client));
- }
- int
- SProcSetScreenSaver(register ClientPtr client)
- {
- REQUEST(xSetScreenSaverReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xSetScreenSaverReq);
- swaps(&stuff->timeout);
- swaps(&stuff->interval);
- return ((*ProcVector[X_SetScreenSaver]) (client));
- }
- int
- SProcChangeHosts(register ClientPtr client)
- {
- REQUEST(xChangeHostsReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
- swaps(&stuff->hostLength);
- return ((*ProcVector[X_ChangeHosts]) (client));
- }
- int
- SProcRotateProperties(register ClientPtr client)
- {
- REQUEST(xRotatePropertiesReq);
- swaps(&stuff->length);
- REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
- swapl(&stuff->window);
- swaps(&stuff->nAtoms);
- swaps(&stuff->nPositions);
- SwapRestL(stuff);
- return ((*ProcVector[X_RotateProperties]) (client));
- }
- int
- SProcNoOperation(register ClientPtr client)
- {
- REQUEST(xReq);
- swaps(&stuff->length);
- return ((*ProcVector[X_NoOperation]) (client));
- }
- void
- SwapConnClientPrefix(xConnClientPrefix * pCCP)
- {
- swaps(&pCCP->majorVersion);
- swaps(&pCCP->minorVersion);
- swaps(&pCCP->nbytesAuthProto);
- swaps(&pCCP->nbytesAuthString);
- }
|