2006-11-26 11:13:41 -07:00
|
|
|
/************************************************************
|
|
|
|
|
|
|
|
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"
|
2012-06-10 07:21:05 -06:00
|
|
|
#include "extnsionst.h" /* for SendEvent */
|
2006-11-26 11:13:41 -07:00
|
|
|
#include "swapreq.h"
|
|
|
|
|
|
|
|
/* Thanks to Jack Palevich for testing and subsequently rewriting all this */
|
|
|
|
|
|
|
|
/* Byte swap a list of longs */
|
2010-07-27 13:02:24 -06:00
|
|
|
void
|
2012-06-10 07:21:05 -06:00
|
|
|
SwapLongs(CARD32 *list, 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);
|
|
|
|
}
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Byte swap a list of shorts */
|
2010-07-27 13:02:24 -06:00
|
|
|
void
|
2012-06-10 07:21:05 -06:00
|
|
|
SwapShorts(short *list, 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);
|
|
|
|
}
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The following is used for all requests that have
|
|
|
|
no fields to be swapped (except "length") */
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSimpleReq(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
|
|
|
return (*ProcVector[stuff->reqType]) (client);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcResourceReq(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xResourceReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
|
|
|
REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
|
|
|
|
swapl(&stuff->id);
|
|
|
|
return (*ProcVector[stuff->reqType]) (client);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCreateWindow(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCreateWindowReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_CreateWindow]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcChangeWindowAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangeWindowAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->valueMask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_ChangeWindowAttributes]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcReparentWindow(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xReparentWindowReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xReparentWindowReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->parent);
|
|
|
|
swaps(&stuff->x);
|
|
|
|
swaps(&stuff->y);
|
|
|
|
return ((*ProcVector[X_ReparentWindow]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcConfigureWindow(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xConfigureWindowReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swaps(&stuff->mask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_ConfigureWindow]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcInternAtom(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xInternAtomReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xInternAtomReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_InternAtom]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcChangeProperty(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangePropertyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcDeleteProperty(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDeletePropertyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDeletePropertyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->property);
|
|
|
|
return ((*ProcVector[X_DeleteProperty]) (client));
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGetProperty(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGetPropertyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGetPropertyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->property);
|
|
|
|
swapl(&stuff->type);
|
|
|
|
swapl(&stuff->longOffset);
|
|
|
|
swapl(&stuff->longLength);
|
|
|
|
return ((*ProcVector[X_GetProperty]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSetSelectionOwner(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xSetSelectionOwnerReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->selection);
|
|
|
|
swapl(&stuff->time);
|
|
|
|
return ((*ProcVector[X_SetSelectionOwner]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcConvertSelection(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xConvertSelectionReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xConvertSelectionReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->requestor);
|
|
|
|
swapl(&stuff->selection);
|
|
|
|
swapl(&stuff->target);
|
|
|
|
swapl(&stuff->property);
|
|
|
|
swapl(&stuff->time);
|
|
|
|
return ((*ProcVector[X_ConvertSelection]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSendEvent(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2013-06-07 11:28:45 -06:00
|
|
|
xEvent eventT = { .u.u.type = 0 };
|
2006-11-26 11:13:41 -07:00
|
|
|
EventSwapPtr proc;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST(xSendEventReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xSendEventReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->destination);
|
|
|
|
swapl(&stuff->eventMask);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
/* Swap event */
|
|
|
|
proc = EventSwapVector[stuff->event.u.u.type & 0177];
|
2012-06-10 07:21:05 -06:00
|
|
|
if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
|
|
|
|
return BadValue;
|
|
|
|
(*proc) (&stuff->event, &eventT);
|
2006-11-26 11:13:41 -07:00
|
|
|
stuff->event = eventT;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_SendEvent]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGrabPointer(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGrabPointerReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGrabPointerReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->grabWindow);
|
|
|
|
swaps(&stuff->eventMask);
|
|
|
|
swapl(&stuff->confineTo);
|
|
|
|
swapl(&stuff->cursor);
|
|
|
|
swapl(&stuff->time);
|
|
|
|
return ((*ProcVector[X_GrabPointer]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGrabButton(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGrabButtonReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGrabButtonReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->grabWindow);
|
|
|
|
swaps(&stuff->eventMask);
|
|
|
|
swapl(&stuff->confineTo);
|
|
|
|
swapl(&stuff->cursor);
|
|
|
|
swaps(&stuff->modifiers);
|
|
|
|
return ((*ProcVector[X_GrabButton]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcUngrabButton(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xUngrabButtonReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xUngrabButtonReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->grabWindow);
|
|
|
|
swaps(&stuff->modifiers);
|
|
|
|
return ((*ProcVector[X_UngrabButton]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcChangeActivePointerGrab(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangeActivePointerGrabReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cursor);
|
|
|
|
swapl(&stuff->time);
|
|
|
|
swaps(&stuff->eventMask);
|
|
|
|
return ((*ProcVector[X_ChangeActivePointerGrab]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGrabKeyboard(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGrabKeyboardReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGrabKeyboardReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->grabWindow);
|
|
|
|
swapl(&stuff->time);
|
|
|
|
return ((*ProcVector[X_GrabKeyboard]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGrabKey(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGrabKeyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGrabKeyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->grabWindow);
|
|
|
|
swaps(&stuff->modifiers);
|
|
|
|
return ((*ProcVector[X_GrabKey]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcUngrabKey(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xUngrabKeyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xUngrabKeyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->grabWindow);
|
|
|
|
swaps(&stuff->modifiers);
|
|
|
|
return ((*ProcVector[X_UngrabKey]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGetMotionEvents(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGetMotionEventsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGetMotionEventsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->start);
|
|
|
|
swapl(&stuff->stop);
|
|
|
|
return ((*ProcVector[X_GetMotionEvents]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcTranslateCoords(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xTranslateCoordsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->srcWid);
|
|
|
|
swapl(&stuff->dstWid);
|
|
|
|
swaps(&stuff->srcX);
|
|
|
|
swaps(&stuff->srcY);
|
|
|
|
return ((*ProcVector[X_TranslateCoords]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcWarpPointer(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xWarpPointerReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xWarpPointerReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSetInputFocus(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xSetInputFocusReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xSetInputFocusReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->focus);
|
|
|
|
swapl(&stuff->time);
|
|
|
|
return ((*ProcVector[X_SetInputFocus]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcOpenFont(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xOpenFontReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xOpenFontReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->fid);
|
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_OpenFont]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcListFonts(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xListFontsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xListFontsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->maxNames);
|
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_ListFonts]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcListFontsWithInfo(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xListFontsWithInfoReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->maxNames);
|
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_ListFontsWithInfo]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSetFontPath(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xSetFontPathReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->nFonts);
|
|
|
|
return ((*ProcVector[X_SetFontPath]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCreatePixmap(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCreatePixmapReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCreatePixmapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->pid);
|
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swaps(&stuff->width);
|
|
|
|
swaps(&stuff->height);
|
|
|
|
return ((*ProcVector[X_CreatePixmap]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCreateGC(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCreateGCReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->gc);
|
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swapl(&stuff->mask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_CreateGC]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcChangeGC(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangeGCReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeGCReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->gc);
|
|
|
|
swapl(&stuff->mask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_ChangeGC]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCopyGC(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCopyGCReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCopyGCReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->srcGC);
|
|
|
|
swapl(&stuff->dstGC);
|
|
|
|
swapl(&stuff->mask);
|
|
|
|
return ((*ProcVector[X_CopyGC]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSetDashes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xSetDashesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xSetDashesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->gc);
|
|
|
|
swaps(&stuff->dashOffset);
|
|
|
|
swaps(&stuff->nDashes);
|
|
|
|
return ((*ProcVector[X_SetDashes]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcSetClipRectangles(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xSetClipRectanglesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->gc);
|
|
|
|
swaps(&stuff->xOrigin);
|
|
|
|
swaps(&stuff->yOrigin);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestS(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_SetClipRectangles]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcClearToBackground(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xClearAreaReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xClearAreaReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swaps(&stuff->x);
|
|
|
|
swaps(&stuff->y);
|
|
|
|
swaps(&stuff->width);
|
|
|
|
swaps(&stuff->height);
|
|
|
|
return ((*ProcVector[X_ClearArea]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCopyArea(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCopyAreaReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCopyAreaReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCopyPlane(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCopyPlaneReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCopyPlaneReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The following routine is used for all Poly drawing requests
|
|
|
|
(except FillPoly, which uses a different request format) */
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcPoly(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xPolyPointReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyPointReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swapl(&stuff->gc);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestS(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[stuff->reqType]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* cannot use SProcPoly for this one, because xFillPolyReq
|
|
|
|
is longer than xPolyPointReq, and we don't want to swap
|
|
|
|
the difference as shorts! */
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcFillPoly(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xFillPolyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xFillPolyReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swapl(&stuff->gc);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestS(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_FillPoly]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcPutImage(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xPutImageReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xPutImageReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swapl(&stuff->gc);
|
|
|
|
swaps(&stuff->width);
|
|
|
|
swaps(&stuff->height);
|
|
|
|
swaps(&stuff->dstX);
|
|
|
|
swaps(&stuff->dstY);
|
2006-11-26 11:13:41 -07:00
|
|
|
/* Image should already be swapped */
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_PutImage]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcGetImage(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xGetImageReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xGetImageReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swaps(&stuff->x);
|
|
|
|
swaps(&stuff->y);
|
|
|
|
swaps(&stuff->width);
|
|
|
|
swaps(&stuff->height);
|
|
|
|
swapl(&stuff->planeMask);
|
|
|
|
return ((*ProcVector[X_GetImage]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ProcPolyText used for both PolyText8 and PolyText16 */
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcPolyText(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xPolyTextReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swapl(&stuff->gc);
|
|
|
|
swaps(&stuff->x);
|
|
|
|
swaps(&stuff->y);
|
|
|
|
return ((*ProcVector[stuff->reqType]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* ProcImageText used for both ImageText8 and ImageText16 */
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcImageText(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xImageTextReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xImageTextReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swapl(&stuff->gc);
|
|
|
|
swaps(&stuff->x);
|
|
|
|
swaps(&stuff->y);
|
|
|
|
return ((*ProcVector[stuff->reqType]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCreateColormap(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCreateColormapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCreateColormapReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->mid);
|
|
|
|
swapl(&stuff->window);
|
|
|
|
swapl(&stuff->visual);
|
|
|
|
return ((*ProcVector[X_CreateColormap]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcCopyColormapAndFree(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCopyColormapAndFreeReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->mid);
|
|
|
|
swapl(&stuff->srcCmap);
|
|
|
|
return ((*ProcVector[X_CopyColormapAndFree]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcAllocColor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xAllocColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xAllocColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swaps(&stuff->red);
|
|
|
|
swaps(&stuff->green);
|
|
|
|
swaps(&stuff->blue);
|
|
|
|
return ((*ProcVector[X_AllocColor]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcAllocNamedColor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xAllocNamedColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_AllocNamedColor]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcAllocColorCells(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xAllocColorCellsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xAllocColorCellsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swaps(&stuff->colors);
|
|
|
|
swaps(&stuff->planes);
|
|
|
|
return ((*ProcVector[X_AllocColorCells]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcAllocColorPlanes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xAllocColorPlanesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swaps(&stuff->colors);
|
|
|
|
swaps(&stuff->red);
|
|
|
|
swaps(&stuff->green);
|
|
|
|
swaps(&stuff->blue);
|
|
|
|
return ((*ProcVector[X_AllocColorPlanes]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcFreeColors(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xFreeColorsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swapl(&stuff->planeMask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_FreeColors]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-07-27 13:02:24 -06:00
|
|
|
void
|
2012-06-10 07:21:05 -06:00
|
|
|
SwapColorItem(xColorItem * pItem)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&pItem->pixel);
|
|
|
|
swaps(&pItem->red);
|
|
|
|
swaps(&pItem->green);
|
|
|
|
swaps(&pItem->blue);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcStoreColors(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
long count;
|
2012-06-10 07:21:05 -06:00
|
|
|
xColorItem *pItem;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST(xStoreColorsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
2006-11-26 11:13:41 -07:00
|
|
|
pItem = (xColorItem *) &stuff[1];
|
2012-06-10 07:21:05 -06:00
|
|
|
for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;)
|
|
|
|
SwapColorItem(pItem++);
|
|
|
|
return ((*ProcVector[X_StoreColors]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcStoreNamedColor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xStoreNamedColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swapl(&stuff->pixel);
|
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_StoreNamedColor]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcQueryColors(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xQueryColorsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_QueryColors]) (client));
|
|
|
|
}
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcLookupColor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xLookupColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xLookupColorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->cmap);
|
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_LookupColor]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcCreateCursor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCreateCursorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCreateCursorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcCreateGlyphCursor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xCreateGlyphCursorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcRecolorCursor(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xRecolorCursorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xRecolorCursorReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
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));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcQueryBestSize(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xQueryBestSizeReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xQueryBestSizeReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->drawable);
|
|
|
|
swaps(&stuff->width);
|
|
|
|
swaps(&stuff->height);
|
|
|
|
return ((*ProcVector[X_QueryBestSize]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcQueryExtension(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xQueryExtensionReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->nbytes);
|
|
|
|
return ((*ProcVector[X_QueryExtension]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcChangeKeyboardMapping(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangeKeyboardMappingReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
|
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_ChangeKeyboardMapping]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcChangeKeyboardControl(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangeKeyboardControlReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->mask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_ChangeKeyboardControl]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcChangePointerControl(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangePointerControlReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xChangePointerControlReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->accelNum);
|
|
|
|
swaps(&stuff->accelDenum);
|
|
|
|
swaps(&stuff->threshold);
|
|
|
|
return ((*ProcVector[X_ChangePointerControl]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcSetScreenSaver(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xSetScreenSaverReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xSetScreenSaverReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->timeout);
|
|
|
|
swaps(&stuff->interval);
|
|
|
|
return ((*ProcVector[X_SetScreenSaver]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2012-06-10 07:21:05 -06:00
|
|
|
SProcChangeHosts(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xChangeHostsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->hostLength);
|
|
|
|
return ((*ProcVector[X_ChangeHosts]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
int
|
|
|
|
SProcRotateProperties(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xRotatePropertiesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
|
|
|
swaps(&stuff->nAtoms);
|
|
|
|
swaps(&stuff->nPositions);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
2012-06-10 07:21:05 -06:00
|
|
|
return ((*ProcVector[X_RotateProperties]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2007-11-24 10:55:21 -07:00
|
|
|
SProcNoOperation(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
|
|
|
return ((*ProcVector[X_NoOperation]) (client));
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-06-10 07:21:05 -06:00
|
|
|
SwapConnClientPrefix(xConnClientPrefix * pCCP)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&pCCP->majorVersion);
|
|
|
|
swaps(&pCCP->minorVersion);
|
|
|
|
swaps(&pCCP->nbytesAuthProto);
|
|
|
|
swaps(&pCCP->nbytesAuthString);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|