2003-11-14 16:54:54 +01:00
|
|
|
/* $Xorg: panoramiXprocs.c,v 1.5 2000/08/17 19:47:57 cpqbld Exp $ */
|
|
|
|
/*****************************************************************
|
|
|
|
Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software.
|
|
|
|
|
|
|
|
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
|
|
|
|
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
|
|
|
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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 Digital Equipment Corporation
|
|
|
|
shall not be used in advertising or otherwise to promote the sale, use or other
|
|
|
|
dealings in this Software without prior written authorization from Digital
|
|
|
|
Equipment Corporation.
|
|
|
|
******************************************************************/
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
|
|
|
|
|
2004-04-23 20:54:16 +02:00
|
|
|
/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.36tsi Exp $ */
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "X.h"
|
|
|
|
#define NEED_REPLIES
|
|
|
|
#define NEED_EVENTS
|
|
|
|
#include "Xproto.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "dixfontstr.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "colormapst.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "opaque.h"
|
|
|
|
#include "inputstr.h"
|
|
|
|
#include "migc.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "panoramiX.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "panoramiXsrv.h"
|
|
|
|
#include "resource.h"
|
2003-11-25 20:29:01 +01:00
|
|
|
#include "panoramiXh.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
#define XINERAMA_IMAGE_BUFSIZE (256*1024)
|
|
|
|
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
|
|
|
|
CWDontPropagate | CWOverrideRedirect | CWCursor )
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
#if 0
|
|
|
|
extern void (* EventSwapVector[128]) (fsError *, fsError *);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
extern void Swap32Write();
|
|
|
|
extern void SLHostsExtend();
|
|
|
|
extern void SQColorsExtend();
|
2003-11-14 16:54:54 +01:00
|
|
|
WriteSConnectionInfo();
|
|
|
|
extern void WriteSConnSetupPrefix();
|
2003-11-25 20:29:01 +01:00
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
/* Various of the DIX function interfaces were not designed to allow
|
|
|
|
* the client->errorValue to be set on BadValue and other errors.
|
|
|
|
* Rather than changing interfaces and breaking untold code we introduce
|
|
|
|
* a new global that dispatch can use.
|
|
|
|
*/
|
2003-11-14 17:49:22 +01:00
|
|
|
extern XID clientErrorValue; /* XXX this is a kludge */
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXCreateWindow(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *parent, *newWin;
|
|
|
|
PanoramiXRes *backPix = NULL;
|
|
|
|
PanoramiXRes *bordPix = NULL;
|
|
|
|
PanoramiXRes *cmap = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCreateWindowReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
|
|
|
int result = 0, len, j;
|
|
|
|
int orig_x, orig_y;
|
|
|
|
XID orig_visual, tmp;
|
|
|
|
Bool parentIsRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
|
|
|
|
|
|
|
|
len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
|
2003-11-14 17:49:22 +01:00
|
|
|
if (Ones(stuff->mask) != len)
|
|
|
|
return BadLength;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if (!(parent = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->parent, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
if(stuff->class == CopyFromParent)
|
|
|
|
stuff->class = parent->u.win.class;
|
|
|
|
|
|
|
|
if((stuff->class == InputOnly) && (stuff->mask & (~INPUTONLY_LEGAL_MASK)))
|
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
if ((Mask)stuff->mask & CWBackPixmap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
tmp = *((CARD32 *) &stuff[1] + pback_offset);
|
|
|
|
if ((tmp != None) && (tmp != ParentRelative)) {
|
|
|
|
if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->mask & CWBorderPixmap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
tmp = *((CARD32 *) &stuff[1] + pbord_offset);
|
|
|
|
if (tmp != CopyFromParent) {
|
|
|
|
if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->mask & CWColormap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
|
|
|
if ((tmp != CopyFromParent) && (tmp != None)) {
|
|
|
|
if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_COLORMAP, SecurityReadAccess)))
|
|
|
|
return BadColor;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(newWin = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
newWin->type = XRT_WINDOW;
|
|
|
|
newWin->u.win.visibility = VisibilityNotViewable;
|
|
|
|
newWin->u.win.class = stuff->class;
|
2003-11-25 20:29:01 +01:00
|
|
|
newWin->u.win.root = FALSE;
|
2003-11-14 17:49:22 +01:00
|
|
|
newWin->info[0].id = stuff->wid;
|
|
|
|
for(j = 1; j < PanoramiXNumScreens; j++)
|
|
|
|
newWin->info[j].id = FakeClientID(client->index);
|
|
|
|
|
|
|
|
if (stuff->class == InputOnly)
|
|
|
|
stuff->visual = CopyFromParent;
|
|
|
|
orig_visual = stuff->visual;
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_x = stuff->x;
|
|
|
|
orig_y = stuff->y;
|
2003-11-25 20:29:01 +01:00
|
|
|
parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
|
|
|
|
(stuff->parent == savedScreenInfo[0].wid);
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->wid = newWin->info[j].id;
|
|
|
|
stuff->parent = parent->info[j].id;
|
|
|
|
if (parentIsRoot) {
|
2003-11-14 16:54:54 +01:00
|
|
|
stuff->x = orig_x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = orig_y - panoramiXdataPtr[j].y;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if (backPix)
|
|
|
|
*((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
|
|
|
|
if (bordPix)
|
|
|
|
*((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
|
|
|
|
if (cmap)
|
|
|
|
*((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
|
|
|
|
if ( orig_visual != CopyFromParent )
|
|
|
|
stuff->visual = PanoramiXVisualTable[(orig_visual*MAXSCREENS) + j];
|
|
|
|
result = (*SavedProcVector[X_CreateWindow])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result == Success)
|
|
|
|
AddResource(newWin->info[0].id, XRT_WINDOW, newWin);
|
|
|
|
else
|
|
|
|
xfree(newWin);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXChangeWindowAttributes(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
PanoramiXRes *backPix = NULL;
|
|
|
|
PanoramiXRes *bordPix = NULL;
|
|
|
|
PanoramiXRes *cmap = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xChangeWindowAttributesReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
|
|
|
|
int result = 0, len, j;
|
|
|
|
XID tmp;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
|
2003-11-14 17:49:22 +01:00
|
|
|
if (Ones(stuff->valueMask) != len)
|
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
if (!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if((win->u.win.class == InputOnly) &&
|
|
|
|
(stuff->valueMask & (~INPUTONLY_LEGAL_MASK)))
|
|
|
|
return BadMatch;
|
|
|
|
|
|
|
|
if ((Mask)stuff->valueMask & CWBackPixmap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
pback_offset = Ones((Mask)stuff->valueMask & (CWBackPixmap - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
tmp = *((CARD32 *) &stuff[1] + pback_offset);
|
|
|
|
if ((tmp != None) && (tmp != ParentRelative)) {
|
|
|
|
if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->valueMask & CWBorderPixmap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
pbord_offset = Ones((Mask)stuff->valueMask & (CWBorderPixmap - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
tmp = *((CARD32 *) &stuff[1] + pbord_offset);
|
|
|
|
if (tmp != CopyFromParent) {
|
|
|
|
if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->valueMask & CWColormap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
cmap_offset = Ones((Mask)stuff->valueMask & (CWColormap - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
tmp = *((CARD32 *) &stuff[1] + cmap_offset);
|
|
|
|
if ((tmp != CopyFromParent) && (tmp != None)) {
|
|
|
|
if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_COLORMAP, SecurityReadAccess)))
|
|
|
|
return BadColor;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->window = win->info[j].id;
|
|
|
|
if (backPix)
|
|
|
|
*((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
|
|
|
|
if (bordPix)
|
|
|
|
*((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
|
|
|
|
if (cmap)
|
|
|
|
*((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_ChangeWindowAttributes])(client);
|
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXDestroyWindow(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_WINDOW, SecurityDestroyAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->id = win->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_DestroyWindow])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Since ProcDestroyWindow is using FreeResource, it will free
|
|
|
|
our resource for us on the last pass through the loop above */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXDestroySubwindows(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_WINDOW, SecurityDestroyAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->id = win->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_DestroySubwindows])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* DestroySubwindows is using FreeResource which will free
|
|
|
|
our resources for us on the last pass through the loop above */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXChangeSaveSet(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xChangeSaveSetReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xChangeSaveSetReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->window = win->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_ChangeSaveSet])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXReparentWindow(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win, *parent;
|
|
|
|
int result = 0, j;
|
|
|
|
int x, y;
|
|
|
|
Bool parentIsRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xReparentWindowReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xReparentWindowReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
if(!(parent = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->parent, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
x = stuff->x;
|
|
|
|
y = stuff->y;
|
2003-11-25 20:29:01 +01:00
|
|
|
parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
|
|
|
|
(stuff->parent == savedScreenInfo[0].wid);
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->window = win->info[j].id;
|
|
|
|
stuff->parent = parent->info[j].id;
|
|
|
|
if(parentIsRoot) {
|
|
|
|
stuff->x = x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = y - panoramiXdataPtr[j].y;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (*SavedProcVector[X_ReparentWindow])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXMapWindow(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_FORWARD(j) {
|
|
|
|
stuff->id = win->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_MapWindow])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXMapSubwindows(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_FORWARD(j) {
|
|
|
|
stuff->id = win->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (*SavedProcVector[X_MapSubwindows])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXUnmapWindow(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_FORWARD(j) {
|
|
|
|
stuff->id = win->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_UnmapWindow])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (result);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXUnmapSubwindows(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_FORWARD(j) {
|
|
|
|
stuff->id = win->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (*SavedProcVector[X_UnmapSubwindows])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
return (result);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXConfigureWindow(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
PanoramiXRes *sib = NULL;
|
|
|
|
WindowPtr pWin;
|
|
|
|
int result = 0, j, len, sib_offset = 0, x = 0, y = 0;
|
|
|
|
int x_offset = -1;
|
|
|
|
int y_offset = -1;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xConfigureWindowReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
|
2003-11-14 17:49:22 +01:00
|
|
|
if (Ones(stuff->mask) != len)
|
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
/* because we need the parent */
|
|
|
|
if (!(pWin = (WindowPtr)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, RT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
if (!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
if ((Mask)stuff->mask & CWSibling) {
|
|
|
|
XID tmp;
|
|
|
|
sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1));
|
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) {
|
|
|
|
if(!(sib = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
if(pWin->parent && ((pWin->parent == WindowTable[0]) ||
|
|
|
|
(pWin->parent->drawable.id == savedScreenInfo[0].wid)))
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->mask & CWX) {
|
|
|
|
x_offset = 0;
|
|
|
|
x = *((CARD32 *)&stuff[1]);
|
|
|
|
}
|
|
|
|
if ((Mask)stuff->mask & CWY) {
|
|
|
|
y_offset = (x_offset == -1) ? 0 : 1;
|
|
|
|
y = *((CARD32 *) &stuff[1] + y_offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* have to go forward or you get expose events before
|
|
|
|
ConfigureNotify events */
|
|
|
|
FOR_NSCREENS_FORWARD(j) {
|
|
|
|
stuff->window = win->info[j].id;
|
|
|
|
if(sib)
|
|
|
|
*((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id;
|
|
|
|
if(x_offset >= 0)
|
|
|
|
*((CARD32 *) &stuff[1] + x_offset) = x - panoramiXdataPtr[j].x;
|
|
|
|
if(y_offset >= 0)
|
|
|
|
*((CARD32 *) &stuff[1] + y_offset) = y - panoramiXdataPtr[j].y;
|
|
|
|
result = (*SavedProcVector[X_ConfigureWindow])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXCirculateWindow(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCirculateWindowReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCirculateWindowReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
FOR_NSCREENS_FORWARD(j) {
|
|
|
|
stuff->window = win->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (*SavedProcVector[X_CirculateWindow])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXGetGeometry(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
xGetGeometryReply rep;
|
2003-11-14 17:49:22 +01:00
|
|
|
DrawablePtr pDraw;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
|
|
|
VERIFY_GEOMETRABLE (pDraw, stuff->id, client);
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.length = 0;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
2003-11-14 17:49:22 +01:00
|
|
|
rep.root = WindowTable[0]->drawable.id;
|
2003-11-14 16:54:54 +01:00
|
|
|
rep.depth = pDraw->depth;
|
2003-11-14 17:49:22 +01:00
|
|
|
rep.width = pDraw->width;
|
|
|
|
rep.height = pDraw->height;
|
|
|
|
rep.x = rep.y = rep.borderWidth = 0;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if (stuff->id == rep.root) {
|
2003-11-14 16:54:54 +01:00
|
|
|
xWindowRoot *root = (xWindowRoot *)
|
|
|
|
(ConnectionInfo + connBlockScreenStart);
|
|
|
|
|
|
|
|
rep.width = root->pixWidth;
|
|
|
|
rep.height = root->pixHeight;
|
2003-11-14 17:49:22 +01:00
|
|
|
} else
|
|
|
|
if ((pDraw->type == UNDRAWABLE_WINDOW) || (pDraw->type == DRAWABLE_WINDOW))
|
|
|
|
{
|
|
|
|
WindowPtr pWin = (WindowPtr)pDraw;
|
2003-11-14 16:54:54 +01:00
|
|
|
rep.x = pWin->origin.x - wBorderWidth (pWin);
|
|
|
|
rep.y = pWin->origin.y - wBorderWidth (pWin);
|
2003-11-25 20:29:01 +01:00
|
|
|
if((pWin->parent == WindowTable[0]) ||
|
|
|
|
(pWin->parent->drawable.id == savedScreenInfo[0].wid))
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
rep.x += panoramiXdataPtr[0].x;
|
|
|
|
rep.y += panoramiXdataPtr[0].y;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
rep.borderWidth = pWin->borderWidth;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
|
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXTranslateCoords(ClientPtr client)
|
|
|
|
{
|
|
|
|
INT16 x, y;
|
|
|
|
REQUEST(xTranslateCoordsReq);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
register WindowPtr pWin, pDst;
|
|
|
|
xTranslateCoordsReply rep;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
|
|
|
pWin = (WindowPtr)SecurityLookupWindow(stuff->srcWid, client,
|
|
|
|
SecurityReadAccess);
|
|
|
|
if (!pWin)
|
|
|
|
return(BadWindow);
|
|
|
|
pDst = (WindowPtr)SecurityLookupWindow(stuff->dstWid, client,
|
|
|
|
SecurityReadAccess);
|
|
|
|
if (!pDst)
|
|
|
|
return(BadWindow);
|
|
|
|
rep.type = X_Reply;
|
|
|
|
rep.length = 0;
|
|
|
|
rep.sequenceNumber = client->sequence;
|
|
|
|
rep.sameScreen = xTrue;
|
|
|
|
rep.child = None;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
if((pWin == WindowTable[0]) ||
|
|
|
|
(pWin->drawable.id == savedScreenInfo[0].wid))
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
x = stuff->srcX - panoramiXdataPtr[0].x;
|
|
|
|
y = stuff->srcY - panoramiXdataPtr[0].y;
|
|
|
|
} else {
|
|
|
|
x = pWin->drawable.x + stuff->srcX;
|
|
|
|
y = pWin->drawable.y + stuff->srcY;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
pWin = pDst->firstChild;
|
|
|
|
while (pWin) {
|
|
|
|
#ifdef SHAPE
|
|
|
|
BoxRec box;
|
|
|
|
#endif
|
|
|
|
if ((pWin->mapped) &&
|
|
|
|
(x >= pWin->drawable.x - wBorderWidth (pWin)) &&
|
|
|
|
(x < pWin->drawable.x + (int)pWin->drawable.width +
|
|
|
|
wBorderWidth (pWin)) &&
|
|
|
|
(y >= pWin->drawable.y - wBorderWidth (pWin)) &&
|
|
|
|
(y < pWin->drawable.y + (int)pWin->drawable.height +
|
|
|
|
wBorderWidth (pWin))
|
|
|
|
#ifdef SHAPE
|
|
|
|
/* When a window is shaped, a further check
|
|
|
|
* is made to see if the point is inside
|
|
|
|
* borderSize
|
|
|
|
*/
|
|
|
|
&& (!wBoundingShape(pWin) ||
|
|
|
|
POINT_IN_REGION(pWin->drawable.pScreen,
|
|
|
|
wBoundingShape(pWin),
|
|
|
|
x - pWin->drawable.x,
|
|
|
|
y - pWin->drawable.y, &box))
|
|
|
|
#endif
|
|
|
|
)
|
|
|
|
{
|
|
|
|
rep.child = pWin->drawable.id;
|
|
|
|
pWin = (WindowPtr) NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pWin = pWin->nextSib;
|
|
|
|
}
|
|
|
|
rep.dstX = x - pDst->drawable.x;
|
|
|
|
rep.dstY = y - pDst->drawable.y;
|
2003-11-25 20:29:01 +01:00
|
|
|
if((pDst == WindowTable[0]) ||
|
|
|
|
(pDst->drawable.id == savedScreenInfo[0].wid))
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
rep.dstX += panoramiXdataPtr[0].x;
|
|
|
|
rep.dstY += panoramiXdataPtr[0].y;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
|
|
|
|
return(client->noClientException);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXCreatePixmap(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *refDraw, *newPix;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCreatePixmapReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCreatePixmapReq);
|
|
|
|
client->errorValue = stuff->pid;
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
newPix->type = XRT_PIXMAP;
|
|
|
|
newPix->u.pix.shared = FALSE;
|
|
|
|
newPix->info[0].id = stuff->pid;
|
|
|
|
for(j = 1; j < PanoramiXNumScreens; j++)
|
|
|
|
newPix->info[j].id = FakeClientID(client->index);
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->pid = newPix->info[j].id;
|
|
|
|
stuff->drawable = refDraw->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_CreatePixmap])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if (result == Success)
|
|
|
|
AddResource(newPix->info[0].id, XRT_PIXMAP, newPix);
|
|
|
|
else
|
|
|
|
xfree(newPix);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXFreePixmap(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *pix;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->id;
|
|
|
|
|
|
|
|
if(!(pix = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_PIXMAP, SecurityDestroyAccess)))
|
|
|
|
return BadPixmap;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->id = pix->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_FreePixmap])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
/* Since ProcFreePixmap is using FreeResource, it will free
|
|
|
|
our resource for us on the last pass through the loop above */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXCreateGC(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *refDraw;
|
|
|
|
PanoramiXRes *newGC;
|
|
|
|
PanoramiXRes *stip = NULL;
|
|
|
|
PanoramiXRes *tile = NULL;
|
|
|
|
PanoramiXRes *clip = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCreateGCReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
int tile_offset = 0, stip_offset = 0, clip_offset = 0;
|
|
|
|
int result = 0, len, j;
|
|
|
|
XID tmp;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
client->errorValue = stuff->gc;
|
2003-11-14 17:49:22 +01:00
|
|
|
len = client->req_len - (sizeof(xCreateGCReq) >> 2);
|
|
|
|
if (Ones(stuff->mask) != len)
|
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
if (!(refDraw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityReadAccess)))
|
|
|
|
return BadDrawable;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->mask & GCTile) {
|
2003-11-14 16:54:54 +01:00
|
|
|
tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
|
|
|
|
if(!(tile = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((Mask)stuff->mask & GCStipple) {
|
|
|
|
stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
|
|
|
|
if(!(stip = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((Mask)stuff->mask & GCClipMask) {
|
|
|
|
clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
|
|
|
|
if(!(clip = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(newGC = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
newGC->type = XRT_GC;
|
|
|
|
newGC->info[0].id = stuff->gc;
|
|
|
|
for(j = 1; j < PanoramiXNumScreens; j++)
|
|
|
|
newGC->info[j].id = FakeClientID(client->index);
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->gc = newGC->info[j].id;
|
|
|
|
stuff->drawable = refDraw->info[j].id;
|
|
|
|
if (tile)
|
|
|
|
*((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
|
|
|
|
if (stip)
|
|
|
|
*((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
|
|
|
|
if (clip)
|
|
|
|
*((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_CreateGC])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if (result == Success)
|
|
|
|
AddResource(newGC->info[0].id, XRT_GC, newGC);
|
|
|
|
else
|
|
|
|
xfree(newGC);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
int PanoramiXChangeGC(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc;
|
|
|
|
PanoramiXRes *stip = NULL;
|
|
|
|
PanoramiXRes *tile = NULL;
|
|
|
|
PanoramiXRes *clip = NULL;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xChangeGCReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
int tile_offset = 0, stip_offset = 0, clip_offset = 0;
|
|
|
|
int result = 0, len, j;
|
|
|
|
XID tmp;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xChangeGCReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
len = client->req_len - (sizeof(xChangeGCReq) >> 2);
|
|
|
|
if (Ones(stuff->mask) != len)
|
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
if (!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((Mask)stuff->mask & GCTile) {
|
|
|
|
tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
|
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
|
|
|
|
if(!(tile = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((Mask)stuff->mask & GCStipple) {
|
2003-11-14 17:49:22 +01:00
|
|
|
stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
|
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
|
|
|
|
if(!(stip = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((Mask)stuff->mask & GCClipMask) {
|
2003-11-14 17:49:22 +01:00
|
|
|
clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
|
|
|
|
if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
|
|
|
|
if(!(clip = (PanoramiXRes*) SecurityLookupIDByType(
|
|
|
|
client, tmp, XRT_PIXMAP, SecurityReadAccess)))
|
|
|
|
return BadPixmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (tile)
|
|
|
|
*((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
|
|
|
|
if (stip)
|
|
|
|
*((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
|
|
|
|
if (clip)
|
|
|
|
*((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_ChangeGC])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXCopyGC(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *srcGC, *dstGC;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCopyGCReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCopyGCReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(srcGC = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->srcGC, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
|
|
|
if(!(dstGC = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->dstGC, XRT_GC, SecurityWriteAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
|
|
|
FOR_NSCREENS(j) {
|
|
|
|
stuff->srcGC = srcGC->info[j].id;
|
|
|
|
stuff->dstGC = dstGC->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_CopyGC])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXSetDashes(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xSetDashesReq);
|
|
|
|
|
|
|
|
REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityWriteAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_SetDashes])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXSetClipRectangles(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xSetClipRectanglesReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityWriteAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_SetClipRectangles])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXFreeGC(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_GC, SecurityDestroyAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->id = gc->info[j].id;
|
|
|
|
result = (*SavedProcVector[X_FreeGC])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Since ProcFreeGC is using FreeResource, it will free
|
|
|
|
our resource for us on the last pass through the loop above */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXClearToBackground(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *win;
|
|
|
|
int result = 0, j, x, y;
|
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xClearAreaReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xClearAreaReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityWriteAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
x = stuff->x;
|
|
|
|
y = stuff->y;
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = win->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->window = win->info[j].id;
|
|
|
|
if(isRoot) {
|
|
|
|
stuff->x = x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = y - panoramiXdataPtr[j].y;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
result = (*SavedProcVector[X_ClearArea])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
/*
|
|
|
|
For Window to Pixmap copies you're screwed since each screen's
|
|
|
|
pixmap will look like what it sees on its screen. Unless the
|
|
|
|
screens overlap and the window lies on each, the two copies
|
|
|
|
will be out of sync. To remedy this we do a GetImage and PutImage
|
|
|
|
in place of the copy. Doing this as a single Image isn't quite
|
|
|
|
correct since it will include the obscured areas but we will
|
|
|
|
have to fix this later. (MArk).
|
|
|
|
*/
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
int PanoramiXCopyArea(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int j, result = 0, srcx, srcy, dstx, dsty;
|
|
|
|
PanoramiXRes *gc, *src, *dst;
|
|
|
|
Bool srcIsRoot = FALSE;
|
|
|
|
Bool dstIsRoot = FALSE;
|
|
|
|
Bool srcShared, dstShared;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCopyAreaReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCopyAreaReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(src = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
srcShared = IS_SHARED_PIXMAP(src);
|
|
|
|
|
|
|
|
if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
dstShared = IS_SHARED_PIXMAP(dst);
|
|
|
|
|
|
|
|
if(dstShared && srcShared)
|
|
|
|
return (* SavedProcVector[X_CopyArea])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
if((dst->type == XRT_WINDOW) && dst->u.win.root)
|
2003-11-14 17:49:22 +01:00
|
|
|
dstIsRoot = TRUE;
|
2003-11-25 20:29:01 +01:00
|
|
|
if((src->type == XRT_WINDOW) && src->u.win.root)
|
2003-11-14 17:49:22 +01:00
|
|
|
srcIsRoot = TRUE;
|
|
|
|
|
|
|
|
srcx = stuff->srcX; srcy = stuff->srcY;
|
|
|
|
dstx = stuff->dstX; dsty = stuff->dstY;
|
|
|
|
if((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
|
|
|
|
DrawablePtr drawables[MAXSCREENS];
|
|
|
|
DrawablePtr pDst;
|
|
|
|
GCPtr pGC;
|
|
|
|
char *data;
|
|
|
|
int pitch;
|
|
|
|
|
|
|
|
FOR_NSCREENS(j)
|
|
|
|
VERIFY_DRAWABLE(drawables[j], src->info[j].id, client);
|
|
|
|
|
|
|
|
pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
|
|
|
|
if(!(data = xcalloc(1, stuff->height * pitch)))
|
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
XineramaGetImageData(drawables, srcx, srcy,
|
|
|
|
stuff->width, stuff->height, ZPixmap, ~0, data, pitch,
|
|
|
|
srcIsRoot);
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, pGC, client);
|
|
|
|
|
|
|
|
if(drawables[0]->depth != pDst->depth) {
|
|
|
|
client->errorValue = stuff->dstDrawable;
|
|
|
|
xfree(data);
|
|
|
|
return (BadMatch);
|
|
|
|
}
|
|
|
|
|
|
|
|
(*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
|
|
|
|
stuff->width, stuff->height,
|
|
|
|
0, ZPixmap, data);
|
|
|
|
|
|
|
|
if(dstShared) break;
|
|
|
|
}
|
|
|
|
|
|
|
|
xfree(data);
|
|
|
|
|
|
|
|
result = Success;
|
2003-11-14 16:54:54 +01:00
|
|
|
} else {
|
2003-11-14 17:49:22 +01:00
|
|
|
DrawablePtr pDst = NULL, pSrc = NULL;
|
|
|
|
GCPtr pGC = NULL;
|
|
|
|
RegionPtr pRgn[MAXSCREENS];
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->dstDrawable = dst->info[j].id;
|
|
|
|
stuff->srcDrawable = src->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (srcIsRoot) {
|
|
|
|
stuff->srcX = srcx - panoramiXdataPtr[j].x;
|
|
|
|
stuff->srcY = srcy - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
if (dstIsRoot) {
|
|
|
|
stuff->dstX = dstx - panoramiXdataPtr[j].x;
|
|
|
|
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
|
|
|
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, pGC, client);
|
|
|
|
if (stuff->dstDrawable != stuff->srcDrawable) {
|
|
|
|
SECURITY_VERIFY_DRAWABLE(pSrc, stuff->srcDrawable, client,
|
|
|
|
SecurityReadAccess);
|
|
|
|
if ((pDst->pScreen != pSrc->pScreen) ||
|
|
|
|
(pDst->depth != pSrc->depth)) {
|
|
|
|
client->errorValue = stuff->dstDrawable;
|
|
|
|
return (BadMatch);
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
pSrc = pDst;
|
|
|
|
|
|
|
|
pRgn[j] = (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
|
|
|
|
stuff->srcX, stuff->srcY,
|
|
|
|
stuff->width, stuff->height,
|
|
|
|
stuff->dstX, stuff->dstY);
|
|
|
|
|
|
|
|
if(dstShared) {
|
|
|
|
while(j--) pRgn[j] = NULL;
|
|
|
|
break;
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(pGC->graphicsExposures) {
|
|
|
|
ScreenPtr pScreen = pDst->pScreen;
|
|
|
|
RegionRec totalReg;
|
|
|
|
Bool overlap;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
REGION_NULL(pScreen, &totalReg);
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
if(pRgn[j]) {
|
|
|
|
if(srcIsRoot) {
|
|
|
|
REGION_TRANSLATE(pScreen, pRgn[j],
|
|
|
|
panoramiXdataPtr[j].x, panoramiXdataPtr[j].y);
|
|
|
|
}
|
|
|
|
REGION_APPEND(pScreen, &totalReg, pRgn[j]);
|
|
|
|
REGION_DESTROY(pScreen, pRgn[j]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
REGION_VALIDATE(pScreen, &totalReg, &overlap);
|
|
|
|
(*pScreen->SendGraphicsExpose)(
|
|
|
|
client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
|
|
|
|
REGION_UNINIT(pScreen, &totalReg);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
result = client->noClientException;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
int PanoramiXCopyPlane(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int j, srcx, srcy, dstx, dsty;
|
|
|
|
PanoramiXRes *gc, *src, *dst;
|
|
|
|
Bool srcIsRoot = FALSE;
|
|
|
|
Bool dstIsRoot = FALSE;
|
|
|
|
Bool srcShared, dstShared;
|
|
|
|
DrawablePtr psrcDraw, pdstDraw = NULL;
|
|
|
|
GCPtr pGC = NULL;
|
|
|
|
RegionPtr pRgn[MAXSCREENS];
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCopyPlaneReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCopyPlaneReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(src = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->srcDrawable, XRC_DRAWABLE, SecurityReadAccess)))
|
|
|
|
return BadDrawable;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
srcShared = IS_SHARED_PIXMAP(src);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(dst = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->dstDrawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
dstShared = IS_SHARED_PIXMAP(dst);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(dstShared && srcShared)
|
|
|
|
return (* SavedProcVector[X_CopyPlane])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
if((dst->type == XRT_WINDOW) && dst->u.win.root)
|
2003-11-14 17:49:22 +01:00
|
|
|
dstIsRoot = TRUE;
|
2003-11-25 20:29:01 +01:00
|
|
|
if((src->type == XRT_WINDOW) && src->u.win.root)
|
2003-11-14 17:49:22 +01:00
|
|
|
srcIsRoot = TRUE;
|
|
|
|
|
|
|
|
srcx = stuff->srcX; srcy = stuff->srcY;
|
|
|
|
dstx = stuff->dstX; dsty = stuff->dstY;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->dstDrawable = dst->info[j].id;
|
|
|
|
stuff->srcDrawable = src->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (srcIsRoot) {
|
|
|
|
stuff->srcX = srcx - panoramiXdataPtr[j].x;
|
|
|
|
stuff->srcY = srcy - panoramiXdataPtr[j].y;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
if (dstIsRoot) {
|
|
|
|
stuff->dstX = dstx - panoramiXdataPtr[j].x;
|
|
|
|
stuff->dstY = dsty - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
|
|
|
|
VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, pGC, client);
|
|
|
|
if (stuff->dstDrawable != stuff->srcDrawable) {
|
|
|
|
SECURITY_VERIFY_DRAWABLE(psrcDraw, stuff->srcDrawable, client,
|
|
|
|
SecurityReadAccess);
|
|
|
|
if (pdstDraw->pScreen != psrcDraw->pScreen) {
|
|
|
|
client->errorValue = stuff->dstDrawable;
|
|
|
|
return (BadMatch);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
} else
|
|
|
|
psrcDraw = pdstDraw;
|
|
|
|
|
|
|
|
if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
|
|
|
|
(stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) {
|
|
|
|
client->errorValue = stuff->bitPlane;
|
|
|
|
return(BadValue);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
pRgn[j] = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC,
|
|
|
|
stuff->srcX, stuff->srcY,
|
|
|
|
stuff->width, stuff->height,
|
|
|
|
stuff->dstX, stuff->dstY, stuff->bitPlane);
|
|
|
|
|
|
|
|
if(dstShared) {
|
|
|
|
while(j--) pRgn[j] = NULL;
|
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(pGC->graphicsExposures) {
|
|
|
|
ScreenPtr pScreen = pdstDraw->pScreen;
|
|
|
|
RegionRec totalReg;
|
|
|
|
Bool overlap;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
REGION_NULL(pScreen, &totalReg);
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
if(pRgn[j]) {
|
|
|
|
REGION_APPEND(pScreen, &totalReg, pRgn[j]);
|
|
|
|
REGION_DESTROY(pScreen, pRgn[j]);
|
|
|
|
}
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
REGION_VALIDATE(pScreen, &totalReg, &overlap);
|
|
|
|
(*pScreen->SendGraphicsExpose)(
|
|
|
|
client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
|
|
|
|
REGION_UNINIT(pScreen, &totalReg);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolyPoint(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
int result = 0, npoint, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
xPoint *origPts;
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPolyPointReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyPointReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyPoint])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 16:54:54 +01:00
|
|
|
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
|
|
|
|
if (npoint > 0) {
|
|
|
|
origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint));
|
|
|
|
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xPoint *pnts = (xPoint*)&stuff[1];
|
|
|
|
int i = (stuff->coordMode==CoordModePrevious) ? 1 : npoint;
|
|
|
|
|
|
|
|
while(i--) {
|
|
|
|
pnts->x -= x_off;
|
|
|
|
pnts->y -= y_off;
|
|
|
|
pnts++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolyPoint])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
DEALLOCATE_LOCAL(origPts);
|
|
|
|
return (result);
|
2003-11-14 17:49:22 +01:00
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolyLine(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
int result = 0, npoint, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
xPoint *origPts;
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPolyLineReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyLineReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyLine])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 16:54:54 +01:00
|
|
|
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
|
|
|
|
if (npoint > 0){
|
|
|
|
origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint));
|
|
|
|
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xPoint *pnts = (xPoint*)&stuff[1];
|
|
|
|
int i = (stuff->coordMode==CoordModePrevious) ? 1 : npoint;
|
|
|
|
|
|
|
|
while(i--) {
|
|
|
|
pnts->x -= x_off;
|
|
|
|
pnts->y -= y_off;
|
|
|
|
pnts++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolyLine])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
DEALLOCATE_LOCAL(origPts);
|
|
|
|
return (result);
|
2003-11-14 17:49:22 +01:00
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolySegment(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, nsegs, i, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
2003-11-14 16:54:54 +01:00
|
|
|
xSegment *origSegs;
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPolySegmentReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolySegmentReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolySegment])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(nsegs & 4) return BadLength;
|
2003-11-14 16:54:54 +01:00
|
|
|
nsegs >>= 3;
|
|
|
|
if (nsegs > 0) {
|
2003-11-14 17:49:22 +01:00
|
|
|
origSegs = (xSegment *) ALLOCATE_LOCAL(nsegs * sizeof(xSegment));
|
|
|
|
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
|
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xSegment *segs = (xSegment*)&stuff[1];
|
|
|
|
|
|
|
|
for (i = nsegs; i--; segs++) {
|
|
|
|
segs->x1 -= x_off;
|
|
|
|
segs->x2 -= x_off;
|
|
|
|
segs->y1 -= y_off;
|
|
|
|
segs->y2 -= y_off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolySegment])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
DEALLOCATE_LOCAL(origSegs);
|
|
|
|
return (result);
|
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolyRectangle(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, nrects, i, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
xRectangle *origRecs;
|
|
|
|
REQUEST(xPolyRectangleReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyRectangleReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyRectangle])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(nrects & 4) return BadLength;
|
2003-11-14 16:54:54 +01:00
|
|
|
nrects >>= 3;
|
|
|
|
if (nrects > 0){
|
2003-11-14 17:49:22 +01:00
|
|
|
origRecs = (xRectangle *) ALLOCATE_LOCAL(nrects * sizeof(xRectangle));
|
|
|
|
memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle));
|
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xRectangle *rects = (xRectangle *) &stuff[1];
|
|
|
|
|
|
|
|
for (i = nrects; i--; rects++) {
|
|
|
|
rects->x -= x_off;
|
|
|
|
rects->y -= y_off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolyRectangle])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
DEALLOCATE_LOCAL(origRecs);
|
|
|
|
return (result);
|
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolyArc(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, narcs, i, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
xArc *origArcs;
|
|
|
|
REQUEST(xPolyArcReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyArcReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyArc])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(narcs % sizeof(xArc)) return BadLength;
|
2003-11-14 16:54:54 +01:00
|
|
|
narcs /= sizeof(xArc);
|
|
|
|
if (narcs > 0){
|
2003-11-14 17:49:22 +01:00
|
|
|
origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc));
|
|
|
|
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
|
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xArc *arcs = (xArc *) &stuff[1];
|
|
|
|
|
|
|
|
for (i = narcs; i--; arcs++) {
|
|
|
|
arcs->x -= x_off;
|
|
|
|
arcs->y -= y_off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolyArc])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
DEALLOCATE_LOCAL(origArcs);
|
|
|
|
return (result);
|
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXFillPoly(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, count, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
DDXPointPtr locPts;
|
|
|
|
REQUEST(xFillPolyReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xFillPolyReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_FillPoly])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
|
|
|
|
if (count > 0){
|
2003-11-14 17:49:22 +01:00
|
|
|
locPts = (DDXPointPtr) ALLOCATE_LOCAL(count * sizeof(DDXPointRec));
|
|
|
|
memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
|
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
DDXPointPtr pnts = (DDXPointPtr)&stuff[1];
|
|
|
|
int i = (stuff->coordMode==CoordModePrevious) ? 1 : count;
|
|
|
|
|
|
|
|
while(i--) {
|
|
|
|
pnts->x -= x_off;
|
|
|
|
pnts->y -= y_off;
|
|
|
|
pnts++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_FillPoly])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
DEALLOCATE_LOCAL(locPts);
|
|
|
|
return (result);
|
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolyFillRectangle(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, things, i, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
|
|
|
xRectangle *origRects;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPolyFillRectangleReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyFillRectangle])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(things & 4) return BadLength;
|
2003-11-14 16:54:54 +01:00
|
|
|
things >>= 3;
|
|
|
|
if (things > 0){
|
2003-11-14 17:49:22 +01:00
|
|
|
origRects = (xRectangle *) ALLOCATE_LOCAL(things * sizeof(xRectangle));
|
|
|
|
memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle));
|
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origRects, things * sizeof(xRectangle));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xRectangle *rects = (xRectangle *) &stuff[1];
|
|
|
|
|
|
|
|
for (i = things; i--; rects++) {
|
|
|
|
rects->x -= x_off;
|
|
|
|
rects->y -= y_off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolyFillRectangle])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
DEALLOCATE_LOCAL(origRects);
|
|
|
|
return (result);
|
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXPolyFillArc(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
|
|
|
int result = 0, narcs, i, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
xArc *origArcs;
|
|
|
|
REQUEST(xPolyFillArcReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyFillArcReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyFillArc])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
|
|
|
|
IF_RETURN((narcs % sizeof(xArc)), BadLength);
|
|
|
|
narcs /= sizeof(xArc);
|
|
|
|
if (narcs > 0) {
|
|
|
|
origArcs = (xArc *) ALLOCATE_LOCAL(narcs * sizeof(xArc));
|
|
|
|
memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc));
|
|
|
|
FOR_NSCREENS_FORWARD(j){
|
|
|
|
|
|
|
|
if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
|
|
|
|
|
|
|
|
if (isRoot) {
|
|
|
|
int x_off = panoramiXdataPtr[j].x;
|
|
|
|
int y_off = panoramiXdataPtr[j].y;
|
|
|
|
|
|
|
|
if(x_off || y_off) {
|
|
|
|
xArc *arcs = (xArc *) &stuff[1];
|
|
|
|
|
|
|
|
for (i = narcs; i--; arcs++) {
|
|
|
|
arcs->x -= x_off;
|
|
|
|
arcs->y -= y_off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PolyFillArc])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
DEALLOCATE_LOCAL(origArcs);
|
|
|
|
return (result);
|
|
|
|
} else
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXPutImage(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
|
|
|
int j, result = 0, orig_x, orig_y;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPutImageReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xPutImageReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PutImage])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_x = stuff->dstX;
|
|
|
|
orig_y = stuff->dstY;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
if (isRoot) {
|
2003-11-14 16:54:54 +01:00
|
|
|
stuff->dstX = orig_x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->dstY = orig_y - panoramiXdataPtr[j].y;
|
2003-11-14 17:49:22 +01:00
|
|
|
}
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_PutImage])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
return (result);
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXGetImage(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
DrawablePtr drawables[MAXSCREENS];
|
|
|
|
DrawablePtr pDraw;
|
|
|
|
PanoramiXRes *draw;
|
2003-11-14 16:54:54 +01:00
|
|
|
xGetImageReply xgi;
|
2003-11-14 17:49:22 +01:00
|
|
|
Bool isRoot;
|
|
|
|
char *pBuf;
|
|
|
|
int i, x, y, w, h, format;
|
|
|
|
Mask plane = 0, planemask;
|
|
|
|
int linesDone, nlines, linesPerBuf;
|
|
|
|
long widthBytesLine, length;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST(xGetImageReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xGetImageReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
|
|
|
|
client->errorValue = stuff->format;
|
|
|
|
return(BadValue);
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(draw->type == XRT_PIXMAP)
|
|
|
|
return (*SavedProcVector[X_GetImage])(client);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
VERIFY_DRAWABLE(pDraw, stuff->drawable, client);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(!((WindowPtr)pDraw)->realized)
|
|
|
|
return(BadMatch);
|
|
|
|
|
|
|
|
x = stuff->x;
|
|
|
|
y = stuff->y;
|
|
|
|
w = stuff->width;
|
|
|
|
h = stuff->height;
|
|
|
|
format = stuff->format;
|
|
|
|
planemask = stuff->planeMask;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if(isRoot) {
|
|
|
|
if( /* check for being onscreen */
|
|
|
|
x < 0 || x + w > PanoramiXPixWidth ||
|
|
|
|
y < 0 || y + h > PanoramiXPixHeight )
|
2003-11-14 16:54:54 +01:00
|
|
|
return(BadMatch);
|
|
|
|
} else {
|
2003-11-14 17:49:22 +01:00
|
|
|
if( /* check for being onscreen */
|
|
|
|
panoramiXdataPtr[0].x + pDraw->x + x < 0 ||
|
|
|
|
panoramiXdataPtr[0].x + pDraw->x + x + w > PanoramiXPixWidth ||
|
|
|
|
panoramiXdataPtr[0].y + pDraw->y + y < 0 ||
|
|
|
|
panoramiXdataPtr[0].y + pDraw->y + y + h > PanoramiXPixHeight ||
|
|
|
|
/* check for being inside of border */
|
|
|
|
x < - wBorderWidth((WindowPtr)pDraw) ||
|
|
|
|
x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
|
|
|
|
y < -wBorderWidth((WindowPtr)pDraw) ||
|
|
|
|
y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height)
|
2003-11-14 16:54:54 +01:00
|
|
|
return(BadMatch);
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
drawables[0] = pDraw;
|
|
|
|
for(i = 1; i < PanoramiXNumScreens; i++)
|
|
|
|
VERIFY_DRAWABLE(drawables[i], draw->info[i].id, client);
|
|
|
|
|
|
|
|
xgi.visual = wVisual (((WindowPtr) pDraw));
|
2003-11-14 16:54:54 +01:00
|
|
|
xgi.type = X_Reply;
|
|
|
|
xgi.sequenceNumber = client->sequence;
|
|
|
|
xgi.depth = pDraw->depth;
|
2003-11-14 17:49:22 +01:00
|
|
|
if(format == ZPixmap) {
|
|
|
|
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
|
|
|
length = widthBytesLine * h;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
} else {
|
2003-11-14 17:49:22 +01:00
|
|
|
widthBytesLine = BitmapBytePad(w);
|
2003-11-14 16:54:54 +01:00
|
|
|
plane = ((Mask)1) << (pDraw->depth - 1);
|
|
|
|
/* only planes asked for */
|
2003-11-14 17:49:22 +01:00
|
|
|
length = widthBytesLine * h *
|
|
|
|
Ones(planemask & (plane | (plane - 1)));
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
xgi.length = (length + 3) >> 2;
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if (widthBytesLine == 0 || h == 0)
|
2003-11-14 16:54:54 +01:00
|
|
|
linesPerBuf = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
else if (widthBytesLine >= XINERAMA_IMAGE_BUFSIZE)
|
2003-11-14 16:54:54 +01:00
|
|
|
linesPerBuf = 1;
|
2003-11-14 17:49:22 +01:00
|
|
|
else {
|
|
|
|
linesPerBuf = XINERAMA_IMAGE_BUFSIZE / widthBytesLine;
|
|
|
|
if (linesPerBuf > h)
|
|
|
|
linesPerBuf = h;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
length = linesPerBuf * widthBytesLine;
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(pBuf = xalloc(length)))
|
|
|
|
return (BadAlloc);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
|
|
|
|
|
|
|
|
if (linesPerBuf == 0) {
|
2003-11-14 17:49:22 +01:00
|
|
|
/* nothing to do */
|
|
|
|
}
|
|
|
|
else if (format == ZPixmap) {
|
2003-11-14 16:54:54 +01:00
|
|
|
linesDone = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
while (h - linesDone > 0) {
|
|
|
|
nlines = min(linesPerBuf, h - linesDone);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(pDraw->depth == 1)
|
|
|
|
bzero(pBuf, nlines * widthBytesLine);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
|
|
|
|
format, planemask, pBuf, widthBytesLine, isRoot);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
(void)WriteToClient(client,
|
|
|
|
(int)(nlines * widthBytesLine),
|
|
|
|
pBuf);
|
2003-11-14 16:54:54 +01:00
|
|
|
linesDone += nlines;
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
} else { /* XYPixmap */
|
2003-11-14 16:54:54 +01:00
|
|
|
for (; plane; plane >>= 1) {
|
2003-11-14 17:49:22 +01:00
|
|
|
if (planemask & plane) {
|
2003-11-14 16:54:54 +01:00
|
|
|
linesDone = 0;
|
2003-11-14 17:49:22 +01:00
|
|
|
while (h - linesDone > 0) {
|
|
|
|
nlines = min(linesPerBuf, h - linesDone);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
bzero(pBuf, nlines * widthBytesLine);
|
|
|
|
|
|
|
|
XineramaGetImageData(drawables, x, y + linesDone, w,
|
|
|
|
nlines, format, plane, pBuf,
|
|
|
|
widthBytesLine, isRoot);
|
|
|
|
|
|
|
|
(void)WriteToClient(client,
|
|
|
|
(int)(nlines * widthBytesLine),
|
|
|
|
pBuf);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
linesDone += nlines;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
xfree(pBuf);
|
2003-11-14 16:54:54 +01:00
|
|
|
return (client->noClientException);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
/* The text stuff should be rewritten so that duplication happens
|
|
|
|
at the GlyphBlt level. That is, loading the font and getting
|
|
|
|
the glyphs should only happen once */
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXPolyText8(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
|
|
|
int result = 0, j;
|
|
|
|
int orig_x, orig_y;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPolyTextReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
|
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyText8])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_x = stuff->x;
|
|
|
|
orig_y = stuff->y;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (isRoot) {
|
2003-11-14 16:54:54 +01:00
|
|
|
stuff->x = orig_x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = orig_y - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
result = (*SavedProcVector[X_PolyText8])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXPolyText16(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
|
|
|
int result = 0, j;
|
|
|
|
int orig_x, orig_y;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xPolyTextReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
|
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_PolyText16])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_x = stuff->x;
|
|
|
|
orig_y = stuff->y;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (isRoot) {
|
2003-11-14 16:54:54 +01:00
|
|
|
stuff->x = orig_x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = orig_y - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
result = (*SavedProcVector[X_PolyText16])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXImageText8(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
int orig_x, orig_y;
|
|
|
|
REQUEST(xImageTextReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars);
|
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_ImageText8])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_x = stuff->x;
|
|
|
|
orig_y = stuff->y;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (isRoot) {
|
2003-11-14 16:54:54 +01:00
|
|
|
stuff->x = orig_x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = orig_y - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
result = (*SavedProcVector[X_ImageText8])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXImageText16(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *gc, *draw;
|
|
|
|
Bool isRoot;
|
2003-11-14 16:54:54 +01:00
|
|
|
int orig_x, orig_y;
|
|
|
|
REQUEST(xImageTextReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1);
|
|
|
|
|
|
|
|
if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
|
|
|
|
client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if(IS_SHARED_PIXMAP(draw))
|
|
|
|
return (*SavedProcVector[X_ImageText16])(client);
|
|
|
|
|
|
|
|
if(!(gc = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->gc, XRT_GC, SecurityReadAccess)))
|
|
|
|
return BadGC;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_x = stuff->x;
|
|
|
|
orig_y = stuff->y;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->drawable = draw->info[j].id;
|
|
|
|
stuff->gc = gc->info[j].id;
|
|
|
|
if (isRoot) {
|
2003-11-14 16:54:54 +01:00
|
|
|
stuff->x = orig_x - panoramiXdataPtr[j].x;
|
|
|
|
stuff->y = orig_y - panoramiXdataPtr[j].y;
|
|
|
|
}
|
|
|
|
result = (*SavedProcVector[X_ImageText16])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXCreateColormap(ClientPtr client)
|
|
|
|
{
|
|
|
|
PanoramiXRes *win, *newCmap;
|
|
|
|
int result = 0, j, orig_visual;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xCreateColormapReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCreateColormapReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(win = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->window, XRT_WINDOW, SecurityReadAccess)))
|
|
|
|
return BadWindow;
|
|
|
|
|
|
|
|
if(!stuff->visual || (stuff->visual > 255))
|
|
|
|
return BadValue;
|
|
|
|
|
|
|
|
if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
newCmap->type = XRT_COLORMAP;
|
|
|
|
newCmap->info[0].id = stuff->mid;
|
|
|
|
for(j = 1; j < PanoramiXNumScreens; j++)
|
|
|
|
newCmap->info[j].id = FakeClientID(client->index);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
orig_visual = stuff->visual;
|
2003-11-14 17:49:22 +01:00
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->mid = newCmap->info[j].id;
|
|
|
|
stuff->window = win->info[j].id;
|
|
|
|
stuff->visual = PanoramiXVisualTable[(orig_visual * MAXSCREENS) + j];
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_CreateColormap])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if (result == Success)
|
|
|
|
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
|
|
|
|
else
|
|
|
|
xfree(newCmap);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXFreeColormap(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
PanoramiXRes *cmap;
|
|
|
|
int result = 0, j;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xResourceReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
client->errorValue = stuff->id;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_COLORMAP, SecurityDestroyAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->id = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_FreeColormap])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
/* Since ProcFreeColormap is using FreeResource, it will free
|
|
|
|
our resource for us on the last pass through the loop above */
|
|
|
|
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
PanoramiXCopyColormapAndFree(ClientPtr client)
|
|
|
|
{
|
|
|
|
PanoramiXRes *cmap, *newCmap;
|
|
|
|
int result = 0, j;
|
|
|
|
REQUEST(xCopyColormapAndFreeReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
|
|
|
|
|
|
|
|
client->errorValue = stuff->srcCmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->srcCmap, XRT_COLORMAP,
|
|
|
|
SecurityReadAccess | SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
|
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
newCmap->type = XRT_COLORMAP;
|
|
|
|
newCmap->info[0].id = stuff->mid;
|
|
|
|
for(j = 1; j < PanoramiXNumScreens; j++)
|
|
|
|
newCmap->info[j].id = FakeClientID(client->index);
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->srcCmap = cmap->info[j].id;
|
|
|
|
stuff->mid = newCmap->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_CopyColormapAndFree])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
if (result == Success)
|
|
|
|
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
|
|
|
|
else
|
|
|
|
xfree(newCmap);
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXInstallColormap(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
REQUEST(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->id;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_COLORMAP, SecurityReadAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->id = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_InstallColormap])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXUninstallColormap(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
REQUEST(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xResourceReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->id;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->id, XRT_COLORMAP, SecurityReadAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->id = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_UninstallColormap])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXAllocColor(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xAllocColorReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xAllocColorReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_AllocColor])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXAllocNamedColor(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xAllocNamedColorReq);
|
|
|
|
|
|
|
|
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_AllocNamedColor])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXAllocColorCells(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xAllocColorCellsReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xAllocColorCellsReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_AllocColorCells])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
int PanoramiXAllocColorPlanes(ClientPtr client)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
|
|
|
REQUEST(xAllocColorPlanesReq);
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
|
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_AllocColorPlanes])(client);
|
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXFreeColors(ClientPtr client)
|
|
|
|
{
|
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
|
|
|
REQUEST(xFreeColorsReq);
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j) {
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_FreeColors])(client);
|
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXStoreColors(ClientPtr client)
|
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
2003-11-14 16:54:54 +01:00
|
|
|
REQUEST(xStoreColorsReq);
|
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
|
2003-11-14 17:49:22 +01:00
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
2003-11-14 16:54:54 +01:00
|
|
|
result = (* SavedProcVector[X_StoreColors])(client);
|
2003-11-14 17:49:22 +01:00
|
|
|
if(result != Success) break;
|
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PanoramiXStoreNamedColor(ClientPtr client)
|
|
|
|
{
|
|
|
|
int result = 0, j;
|
|
|
|
PanoramiXRes *cmap;
|
|
|
|
REQUEST(xStoreNamedColorReq);
|
|
|
|
|
|
|
|
REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes);
|
|
|
|
|
|
|
|
client->errorValue = stuff->cmap;
|
|
|
|
|
|
|
|
if(!(cmap = (PanoramiXRes *)SecurityLookupIDByType(
|
|
|
|
client, stuff->cmap, XRT_COLORMAP, SecurityWriteAccess)))
|
|
|
|
return BadColor;
|
|
|
|
|
|
|
|
FOR_NSCREENS_BACKWARD(j){
|
|
|
|
stuff->cmap = cmap->info[j].id;
|
|
|
|
result = (* SavedProcVector[X_StoreNamedColor])(client);
|
|
|
|
if(result != Success) break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
return (result);
|
|
|
|
}
|