xserver: delete pervasively use of DISPATCH_PROC
Some functions had to be moved around due some missing static definitions. Another minor clean up like inexistent function declarations and etc were made also. Part of this patch was cooked using: sed -i -e '/static DISPATCH_PROC*.*;/d' `git ls-files` Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
This commit is contained in:
parent
58bd317e29
commit
cbd4d5dbb7
|
@ -40,18 +40,8 @@ from The Open Group.
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include "modinit.h"
|
#include "modinit.h"
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcBigReqDispatch);
|
|
||||||
|
|
||||||
void BigReqExtensionInit(INITARGS);
|
void BigReqExtensionInit(INITARGS);
|
||||||
|
|
||||||
void
|
|
||||||
BigReqExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
AddExtension(XBigReqExtensionName, 0, 0,
|
|
||||||
ProcBigReqDispatch, ProcBigReqDispatch,
|
|
||||||
NULL, StandardMinorOpcode);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcBigReqDispatch (ClientPtr client)
|
ProcBigReqDispatch (ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -78,3 +68,11 @@ ProcBigReqDispatch (ClientPtr client)
|
||||||
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
|
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
BigReqExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
AddExtension(XBigReqExtensionName, 0, 0,
|
||||||
|
ProcBigReqDispatch, ProcBigReqDispatch,
|
||||||
|
NULL, StandardMinorOpcode);
|
||||||
|
}
|
||||||
|
|
88
Xext/saver.c
88
Xext/saver.c
|
@ -62,20 +62,6 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
|
|
||||||
static int ScreenSaverEventBase = 0;
|
static int ScreenSaverEventBase = 0;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverQueryInfo);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverDispatch);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverSelectInput);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverSetAttributes);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverUnsetAttributes);
|
|
||||||
static DISPATCH_PROC(ProcScreenSaverSuspend);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverDispatch);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverQueryInfo);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverSelectInput);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverSetAttributes);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverUnsetAttributes);
|
|
||||||
static DISPATCH_PROC(SProcScreenSaverSuspend);
|
|
||||||
|
|
||||||
static Bool ScreenSaverHandle (
|
static Bool ScreenSaverHandle (
|
||||||
ScreenPtr /* pScreen */,
|
ScreenPtr /* pScreen */,
|
||||||
|
@ -237,45 +223,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
||||||
|
|
||||||
#define New(t) (malloc(sizeof (t)))
|
#define New(t) (malloc(sizeof (t)))
|
||||||
|
|
||||||
/****************
|
|
||||||
* ScreenSaverExtensionInit
|
|
||||||
*
|
|
||||||
* Called from InitExtensions in main() or from QueryExtension() if the
|
|
||||||
* extension is dynamically loaded.
|
|
||||||
*
|
|
||||||
****************/
|
|
||||||
|
|
||||||
void
|
|
||||||
ScreenSaverExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
int i;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
|
|
||||||
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
|
|
||||||
"SaverEvent");
|
|
||||||
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
|
|
||||||
"SaverSuspend");
|
|
||||||
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
pScreen = screenInfo.screens[i];
|
|
||||||
SetScreenPrivate (pScreen, NULL);
|
|
||||||
}
|
|
||||||
if (AttrType && SaverEventType && SuspendType &&
|
|
||||||
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
|
||||||
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
|
||||||
NULL, StandardMinorOpcode)))
|
|
||||||
{
|
|
||||||
ScreenSaverEventBase = extEntry->eventBase;
|
|
||||||
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CheckScreenPrivate (ScreenPtr pScreen)
|
CheckScreenPrivate (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
|
@ -1412,7 +1359,7 @@ ProcScreenSaverSuspend (ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DISPATCH_PROC((*NormalVector[])) = {
|
static int (*NormalVector[]) (ClientPtr /* client */) = {
|
||||||
ProcScreenSaverQueryVersion,
|
ProcScreenSaverQueryVersion,
|
||||||
ProcScreenSaverQueryInfo,
|
ProcScreenSaverQueryInfo,
|
||||||
ProcScreenSaverSelectInput,
|
ProcScreenSaverSelectInput,
|
||||||
|
@ -1513,7 +1460,7 @@ SProcScreenSaverSuspend (ClientPtr client)
|
||||||
return ProcScreenSaverSuspend (client);
|
return ProcScreenSaverSuspend (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DISPATCH_PROC((*SwappedVector[])) = {
|
static int (*SwappedVector[]) (ClientPtr /* client */) = {
|
||||||
SProcScreenSaverQueryVersion,
|
SProcScreenSaverQueryVersion,
|
||||||
SProcScreenSaverQueryInfo,
|
SProcScreenSaverQueryInfo,
|
||||||
SProcScreenSaverSelectInput,
|
SProcScreenSaverSelectInput,
|
||||||
|
@ -1531,3 +1478,34 @@ SProcScreenSaverDispatch (ClientPtr client)
|
||||||
return (*SwappedVector[stuff->data])(client);
|
return (*SwappedVector[stuff->data])(client);
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ScreenSaverExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
int i;
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
|
||||||
|
SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
|
||||||
|
"SaverEvent");
|
||||||
|
SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
|
||||||
|
"SaverSuspend");
|
||||||
|
|
||||||
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
{
|
||||||
|
pScreen = screenInfo.screens[i];
|
||||||
|
SetScreenPrivate (pScreen, NULL);
|
||||||
|
}
|
||||||
|
if (AttrType && SaverEventType && SuspendType &&
|
||||||
|
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
||||||
|
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
|
||||||
|
NULL, StandardMinorOpcode)))
|
||||||
|
{
|
||||||
|
ScreenSaverEventBase = extEntry->eventBase;
|
||||||
|
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
54
Xext/shape.c
54
Xext/shape.c
|
@ -68,26 +68,6 @@ static void SShapeNotifyEvent(
|
||||||
* externally by the Xfixes extension and are now defined in window.h
|
* externally by the Xfixes extension and are now defined in window.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcShapeCombine);
|
|
||||||
static DISPATCH_PROC(ProcShapeDispatch);
|
|
||||||
static DISPATCH_PROC(ProcShapeGetRectangles);
|
|
||||||
static DISPATCH_PROC(ProcShapeInputSelected);
|
|
||||||
static DISPATCH_PROC(ProcShapeMask);
|
|
||||||
static DISPATCH_PROC(ProcShapeOffset);
|
|
||||||
static DISPATCH_PROC(ProcShapeQueryExtents);
|
|
||||||
static DISPATCH_PROC(ProcShapeQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcShapeRectangles);
|
|
||||||
static DISPATCH_PROC(ProcShapeSelectInput);
|
|
||||||
static DISPATCH_PROC(SProcShapeCombine);
|
|
||||||
static DISPATCH_PROC(SProcShapeDispatch);
|
|
||||||
static DISPATCH_PROC(SProcShapeGetRectangles);
|
|
||||||
static DISPATCH_PROC(SProcShapeInputSelected);
|
|
||||||
static DISPATCH_PROC(SProcShapeMask);
|
|
||||||
static DISPATCH_PROC(SProcShapeOffset);
|
|
||||||
static DISPATCH_PROC(SProcShapeQueryExtents);
|
|
||||||
static DISPATCH_PROC(SProcShapeQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcShapeRectangles);
|
|
||||||
static DISPATCH_PROC(SProcShapeSelectInput);
|
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
#include "panoramiX.h"
|
#include "panoramiX.h"
|
||||||
|
@ -122,23 +102,6 @@ typedef struct _ShapeEvent {
|
||||||
*
|
*
|
||||||
****************/
|
****************/
|
||||||
|
|
||||||
void
|
|
||||||
ShapeExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
|
|
||||||
ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
|
|
||||||
if (ClientType && ShapeEventType &&
|
|
||||||
(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
|
|
||||||
ProcShapeDispatch, SProcShapeDispatch,
|
|
||||||
NULL, StandardMinorOpcode)))
|
|
||||||
{
|
|
||||||
ShapeEventBase = extEntry->eventBase;
|
|
||||||
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
RegionOperate (
|
RegionOperate (
|
||||||
ClientPtr client,
|
ClientPtr client,
|
||||||
|
@ -1278,3 +1241,20 @@ SProcShapeDispatch (ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShapeExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
|
ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
|
||||||
|
ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
|
||||||
|
if (ClientType && ShapeEventType &&
|
||||||
|
(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
|
||||||
|
ProcShapeDispatch, SProcShapeDispatch,
|
||||||
|
NULL, StandardMinorOpcode)))
|
||||||
|
{
|
||||||
|
ShapeEventBase = extEntry->eventBase;
|
||||||
|
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
557
Xext/shm.c
557
Xext/shm.c
|
@ -120,20 +120,6 @@ static void SShmCompletionEvent(
|
||||||
|
|
||||||
static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
|
static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcShmAttach);
|
|
||||||
static DISPATCH_PROC(ProcShmCreatePixmap);
|
|
||||||
static DISPATCH_PROC(ProcShmDetach);
|
|
||||||
static DISPATCH_PROC(ProcShmDispatch);
|
|
||||||
static DISPATCH_PROC(ProcShmGetImage);
|
|
||||||
static DISPATCH_PROC(ProcShmPutImage);
|
|
||||||
static DISPATCH_PROC(ProcShmQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcShmAttach);
|
|
||||||
static DISPATCH_PROC(SProcShmCreatePixmap);
|
|
||||||
static DISPATCH_PROC(SProcShmDetach);
|
|
||||||
static DISPATCH_PROC(SProcShmDispatch);
|
|
||||||
static DISPATCH_PROC(SProcShmGetImage);
|
|
||||||
static DISPATCH_PROC(SProcShmPutImage);
|
|
||||||
static DISPATCH_PROC(SProcShmQueryVersion);
|
|
||||||
|
|
||||||
static unsigned char ShmReqCode;
|
static unsigned char ShmReqCode;
|
||||||
int ShmCompletionCode;
|
int ShmCompletionCode;
|
||||||
|
@ -254,56 +240,6 @@ ShmRegisterPrivates(void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ShmExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
|
||||||
if (!CheckForShmSyscall())
|
|
||||||
{
|
|
||||||
ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!ShmRegisterPrivates())
|
|
||||||
return;
|
|
||||||
|
|
||||||
sharedPixmaps = xFalse;
|
|
||||||
{
|
|
||||||
sharedPixmaps = xTrue;
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]);
|
|
||||||
if (!screen_priv->shmFuncs)
|
|
||||||
screen_priv->shmFuncs = &miFuncs;
|
|
||||||
if (!screen_priv->shmFuncs->CreatePixmap)
|
|
||||||
sharedPixmaps = xFalse;
|
|
||||||
}
|
|
||||||
if (sharedPixmaps)
|
|
||||||
for (i = 0; i < screenInfo.numScreens; i++)
|
|
||||||
{
|
|
||||||
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]);
|
|
||||||
screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap;
|
|
||||||
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
|
|
||||||
if (ShmSegType &&
|
|
||||||
(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
|
|
||||||
ProcShmDispatch, SProcShmDispatch,
|
|
||||||
ShmResetProc, StandardMinorOpcode)))
|
|
||||||
{
|
|
||||||
ShmReqCode = (unsigned char)extEntry->base;
|
|
||||||
ShmCompletionCode = extEntry->eventBase;
|
|
||||||
BadShmSegCode = extEntry->errorBase;
|
|
||||||
SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
|
|
||||||
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
ShmResetProc(ExtensionEntry *extEntry)
|
ShmResetProc(ExtensionEntry *extEntry)
|
||||||
|
@ -581,6 +517,226 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcShmPutImage(ClientPtr client)
|
||||||
|
{
|
||||||
|
GCPtr pGC;
|
||||||
|
DrawablePtr pDraw;
|
||||||
|
long length;
|
||||||
|
ShmDescPtr shmdesc;
|
||||||
|
REQUEST(xShmPutImageReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
||||||
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
||||||
|
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
||||||
|
return BadValue;
|
||||||
|
if (stuff->format == XYBitmap)
|
||||||
|
{
|
||||||
|
if (stuff->depth != 1)
|
||||||
|
return BadMatch;
|
||||||
|
length = PixmapBytePad(stuff->totalWidth, 1);
|
||||||
|
}
|
||||||
|
else if (stuff->format == XYPixmap)
|
||||||
|
{
|
||||||
|
if (pDraw->depth != stuff->depth)
|
||||||
|
return BadMatch;
|
||||||
|
length = PixmapBytePad(stuff->totalWidth, 1);
|
||||||
|
length *= stuff->depth;
|
||||||
|
}
|
||||||
|
else if (stuff->format == ZPixmap)
|
||||||
|
{
|
||||||
|
if (pDraw->depth != stuff->depth)
|
||||||
|
return BadMatch;
|
||||||
|
length = PixmapBytePad(stuff->totalWidth, stuff->depth);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->format;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There's a potential integer overflow in this check:
|
||||||
|
* VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
|
||||||
|
* client);
|
||||||
|
* the version below ought to avoid it
|
||||||
|
*/
|
||||||
|
if (stuff->totalHeight != 0 &&
|
||||||
|
length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
|
||||||
|
client->errorValue = stuff->totalWidth;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if (stuff->srcX > stuff->totalWidth)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcX;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if (stuff->srcY > stuff->totalHeight)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcY;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcWidth;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->srcHeight;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
|
||||||
|
((stuff->format != ZPixmap) &&
|
||||||
|
(stuff->srcX < screenInfo.bitmapScanlinePad) &&
|
||||||
|
((stuff->format == XYBitmap) ||
|
||||||
|
((stuff->srcY == 0) &&
|
||||||
|
(stuff->srcHeight == stuff->totalHeight))))) &&
|
||||||
|
((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
|
||||||
|
(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
|
||||||
|
stuff->dstX, stuff->dstY,
|
||||||
|
stuff->totalWidth, stuff->srcHeight,
|
||||||
|
stuff->srcX, stuff->format,
|
||||||
|
shmdesc->addr + stuff->offset +
|
||||||
|
(stuff->srcY * length));
|
||||||
|
else
|
||||||
|
doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
|
||||||
|
stuff->totalWidth, stuff->totalHeight,
|
||||||
|
stuff->srcX, stuff->srcY,
|
||||||
|
stuff->srcWidth, stuff->srcHeight,
|
||||||
|
stuff->dstX, stuff->dstY,
|
||||||
|
shmdesc->addr + stuff->offset);
|
||||||
|
|
||||||
|
if (stuff->sendEvent)
|
||||||
|
{
|
||||||
|
xShmCompletionEvent ev;
|
||||||
|
|
||||||
|
ev.type = ShmCompletionCode;
|
||||||
|
ev.drawable = stuff->drawable;
|
||||||
|
ev.minorEvent = X_ShmPutImage;
|
||||||
|
ev.majorEvent = ShmReqCode;
|
||||||
|
ev.shmseg = stuff->shmseg;
|
||||||
|
ev.offset = stuff->offset;
|
||||||
|
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
ProcShmGetImage(ClientPtr client)
|
||||||
|
{
|
||||||
|
DrawablePtr pDraw;
|
||||||
|
long lenPer = 0, length;
|
||||||
|
Mask plane = 0;
|
||||||
|
xShmGetImageReply xgi;
|
||||||
|
ShmDescPtr shmdesc;
|
||||||
|
int n, rc;
|
||||||
|
|
||||||
|
REQUEST(xShmGetImageReq);
|
||||||
|
|
||||||
|
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
||||||
|
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
|
||||||
|
{
|
||||||
|
client->errorValue = stuff->format;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
|
DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
||||||
|
if (pDraw->type == DRAWABLE_WINDOW)
|
||||||
|
{
|
||||||
|
if( /* check for being viewable */
|
||||||
|
!((WindowPtr) pDraw)->realized ||
|
||||||
|
/* check for being on screen */
|
||||||
|
pDraw->x + stuff->x < 0 ||
|
||||||
|
pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
|
||||||
|
pDraw->y + stuff->y < 0 ||
|
||||||
|
pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
|
||||||
|
/* check for being inside of border */
|
||||||
|
stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
|
||||||
|
stuff->x + (int)stuff->width >
|
||||||
|
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
|
||||||
|
stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
|
||||||
|
stuff->y + (int)stuff->height >
|
||||||
|
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
|
||||||
|
)
|
||||||
|
return BadMatch;
|
||||||
|
xgi.visual = wVisual(((WindowPtr)pDraw));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (stuff->x < 0 ||
|
||||||
|
stuff->x+(int)stuff->width > pDraw->width ||
|
||||||
|
stuff->y < 0 ||
|
||||||
|
stuff->y+(int)stuff->height > pDraw->height
|
||||||
|
)
|
||||||
|
return BadMatch;
|
||||||
|
xgi.visual = None;
|
||||||
|
}
|
||||||
|
xgi.type = X_Reply;
|
||||||
|
xgi.length = 0;
|
||||||
|
xgi.sequenceNumber = client->sequence;
|
||||||
|
xgi.depth = pDraw->depth;
|
||||||
|
if(stuff->format == ZPixmap)
|
||||||
|
{
|
||||||
|
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
|
||||||
|
plane = ((Mask)1) << (pDraw->depth - 1);
|
||||||
|
/* only planes asked for */
|
||||||
|
length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
||||||
|
xgi.size = length;
|
||||||
|
|
||||||
|
if (length == 0)
|
||||||
|
{
|
||||||
|
/* nothing to do */
|
||||||
|
}
|
||||||
|
else if (stuff->format == ZPixmap)
|
||||||
|
{
|
||||||
|
(*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
|
||||||
|
stuff->width, stuff->height,
|
||||||
|
stuff->format, stuff->planeMask,
|
||||||
|
shmdesc->addr + stuff->offset);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
length = stuff->offset;
|
||||||
|
for (; plane; plane >>= 1)
|
||||||
|
{
|
||||||
|
if (stuff->planeMask & plane)
|
||||||
|
{
|
||||||
|
(*pDraw->pScreen->GetImage)(pDraw,
|
||||||
|
stuff->x, stuff->y,
|
||||||
|
stuff->width, stuff->height,
|
||||||
|
stuff->format, plane,
|
||||||
|
shmdesc->addr + length);
|
||||||
|
length += lenPer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&xgi.sequenceNumber, n);
|
||||||
|
swapl(&xgi.length, n);
|
||||||
|
swapl(&xgi.visual, n);
|
||||||
|
swapl(&xgi.size, n);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmPutImage(ClientPtr client)
|
ProcPanoramiXShmPutImage(ClientPtr client)
|
||||||
|
@ -858,231 +1014,8 @@ CreatePmap:
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
|
||||||
ProcShmPutImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
GCPtr pGC;
|
|
||||||
DrawablePtr pDraw;
|
|
||||||
long length;
|
|
||||||
ShmDescPtr shmdesc;
|
|
||||||
REQUEST(xShmPutImageReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
|
||||||
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
|
||||||
return BadValue;
|
|
||||||
if (stuff->format == XYBitmap)
|
|
||||||
{
|
|
||||||
if (stuff->depth != 1)
|
|
||||||
return BadMatch;
|
|
||||||
length = PixmapBytePad(stuff->totalWidth, 1);
|
|
||||||
}
|
|
||||||
else if (stuff->format == XYPixmap)
|
|
||||||
{
|
|
||||||
if (pDraw->depth != stuff->depth)
|
|
||||||
return BadMatch;
|
|
||||||
length = PixmapBytePad(stuff->totalWidth, 1);
|
|
||||||
length *= stuff->depth;
|
|
||||||
}
|
|
||||||
else if (stuff->format == ZPixmap)
|
|
||||||
{
|
|
||||||
if (pDraw->depth != stuff->depth)
|
|
||||||
return BadMatch;
|
|
||||||
length = PixmapBytePad(stuff->totalWidth, stuff->depth);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->format;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There's a potential integer overflow in this check:
|
|
||||||
* VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
|
|
||||||
* client);
|
|
||||||
* the version below ought to avoid it
|
|
||||||
*/
|
|
||||||
if (stuff->totalHeight != 0 &&
|
|
||||||
length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
|
|
||||||
client->errorValue = stuff->totalWidth;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if (stuff->srcX > stuff->totalWidth)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcX;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if (stuff->srcY > stuff->totalHeight)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcY;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcWidth;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->srcHeight;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
|
|
||||||
((stuff->format != ZPixmap) &&
|
|
||||||
(stuff->srcX < screenInfo.bitmapScanlinePad) &&
|
|
||||||
((stuff->format == XYBitmap) ||
|
|
||||||
((stuff->srcY == 0) &&
|
|
||||||
(stuff->srcHeight == stuff->totalHeight))))) &&
|
|
||||||
((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
|
|
||||||
(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
|
|
||||||
stuff->dstX, stuff->dstY,
|
|
||||||
stuff->totalWidth, stuff->srcHeight,
|
|
||||||
stuff->srcX, stuff->format,
|
|
||||||
shmdesc->addr + stuff->offset +
|
|
||||||
(stuff->srcY * length));
|
|
||||||
else
|
|
||||||
doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
|
|
||||||
stuff->totalWidth, stuff->totalHeight,
|
|
||||||
stuff->srcX, stuff->srcY,
|
|
||||||
stuff->srcWidth, stuff->srcHeight,
|
|
||||||
stuff->dstX, stuff->dstY,
|
|
||||||
shmdesc->addr + stuff->offset);
|
|
||||||
|
|
||||||
if (stuff->sendEvent)
|
|
||||||
{
|
|
||||||
xShmCompletionEvent ev;
|
|
||||||
|
|
||||||
ev.type = ShmCompletionCode;
|
|
||||||
ev.drawable = stuff->drawable;
|
|
||||||
ev.minorEvent = X_ShmPutImage;
|
|
||||||
ev.majorEvent = ShmReqCode;
|
|
||||||
ev.shmseg = stuff->shmseg;
|
|
||||||
ev.offset = stuff->offset;
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
ProcShmGetImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
DrawablePtr pDraw;
|
|
||||||
long lenPer = 0, length;
|
|
||||||
Mask plane = 0;
|
|
||||||
xShmGetImageReply xgi;
|
|
||||||
ShmDescPtr shmdesc;
|
|
||||||
int n, rc;
|
|
||||||
|
|
||||||
REQUEST(xShmGetImageReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
|
||||||
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
|
|
||||||
{
|
|
||||||
client->errorValue = stuff->format;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
|
||||||
DixReadAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
|
|
||||||
if (pDraw->type == DRAWABLE_WINDOW)
|
|
||||||
{
|
|
||||||
if( /* check for being viewable */
|
|
||||||
!((WindowPtr) pDraw)->realized ||
|
|
||||||
/* check for being on screen */
|
|
||||||
pDraw->x + stuff->x < 0 ||
|
|
||||||
pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
|
|
||||||
pDraw->y + stuff->y < 0 ||
|
|
||||||
pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
|
|
||||||
/* check for being inside of border */
|
|
||||||
stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
|
|
||||||
stuff->x + (int)stuff->width >
|
|
||||||
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
|
|
||||||
stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
|
|
||||||
stuff->y + (int)stuff->height >
|
|
||||||
wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
|
|
||||||
)
|
|
||||||
return BadMatch;
|
|
||||||
xgi.visual = wVisual(((WindowPtr)pDraw));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (stuff->x < 0 ||
|
|
||||||
stuff->x+(int)stuff->width > pDraw->width ||
|
|
||||||
stuff->y < 0 ||
|
|
||||||
stuff->y+(int)stuff->height > pDraw->height
|
|
||||||
)
|
|
||||||
return BadMatch;
|
|
||||||
xgi.visual = None;
|
|
||||||
}
|
|
||||||
xgi.type = X_Reply;
|
|
||||||
xgi.length = 0;
|
|
||||||
xgi.sequenceNumber = client->sequence;
|
|
||||||
xgi.depth = pDraw->depth;
|
|
||||||
if(stuff->format == ZPixmap)
|
|
||||||
{
|
|
||||||
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
|
|
||||||
plane = ((Mask)1) << (pDraw->depth - 1);
|
|
||||||
/* only planes asked for */
|
|
||||||
length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
|
||||||
xgi.size = length;
|
|
||||||
|
|
||||||
if (length == 0)
|
|
||||||
{
|
|
||||||
/* nothing to do */
|
|
||||||
}
|
|
||||||
else if (stuff->format == ZPixmap)
|
|
||||||
{
|
|
||||||
(*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
|
|
||||||
stuff->width, stuff->height,
|
|
||||||
stuff->format, stuff->planeMask,
|
|
||||||
shmdesc->addr + stuff->offset);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
length = stuff->offset;
|
|
||||||
for (; plane; plane >>= 1)
|
|
||||||
{
|
|
||||||
if (stuff->planeMask & plane)
|
|
||||||
{
|
|
||||||
(*pDraw->pScreen->GetImage)(pDraw,
|
|
||||||
stuff->x, stuff->y,
|
|
||||||
stuff->width, stuff->height,
|
|
||||||
stuff->format, plane,
|
|
||||||
shmdesc->addr + length);
|
|
||||||
length += lenPer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&xgi.sequenceNumber, n);
|
|
||||||
swapl(&xgi.length, n);
|
|
||||||
swapl(&xgi.visual, n);
|
|
||||||
swapl(&xgi.size, n);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
fbShmCreatePixmap (ScreenPtr pScreen,
|
fbShmCreatePixmap (ScreenPtr pScreen,
|
||||||
int width, int height, int depth, char *addr)
|
int width, int height, int depth, char *addr)
|
||||||
|
@ -1342,3 +1275,53 @@ SProcShmDispatch (ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ShmExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
||||||
|
if (!CheckForShmSyscall())
|
||||||
|
{
|
||||||
|
ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (!ShmRegisterPrivates())
|
||||||
|
return;
|
||||||
|
|
||||||
|
sharedPixmaps = xFalse;
|
||||||
|
{
|
||||||
|
sharedPixmaps = xTrue;
|
||||||
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
{
|
||||||
|
ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]);
|
||||||
|
if (!screen_priv->shmFuncs)
|
||||||
|
screen_priv->shmFuncs = &miFuncs;
|
||||||
|
if (!screen_priv->shmFuncs->CreatePixmap)
|
||||||
|
sharedPixmaps = xFalse;
|
||||||
|
}
|
||||||
|
if (sharedPixmaps)
|
||||||
|
for (i = 0; i < screenInfo.numScreens; i++)
|
||||||
|
{
|
||||||
|
ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]);
|
||||||
|
screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap;
|
||||||
|
screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
|
||||||
|
if (ShmSegType &&
|
||||||
|
(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
|
||||||
|
ProcShmDispatch, SProcShmDispatch,
|
||||||
|
ShmResetProc, StandardMinorOpcode)))
|
||||||
|
{
|
||||||
|
ShmReqCode = (unsigned char)extEntry->base;
|
||||||
|
ShmCompletionCode = extEntry->eventBase;
|
||||||
|
BadShmSegCode = extEntry->errorBase;
|
||||||
|
SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
|
||||||
|
EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
30
Xext/sync.c
30
Xext/sync.c
|
@ -100,36 +100,6 @@ static void SyncInitServerTime(void);
|
||||||
|
|
||||||
static void SyncInitIdleTime(void);
|
static void SyncInitIdleTime(void);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcSyncAwait);
|
|
||||||
static DISPATCH_PROC(ProcSyncChangeAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncChangeCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncCreateAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncCreateCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncDestroyAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncDestroyCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncDispatch);
|
|
||||||
static DISPATCH_PROC(ProcSyncGetPriority);
|
|
||||||
static DISPATCH_PROC(ProcSyncInitialize);
|
|
||||||
static DISPATCH_PROC(ProcSyncListSystemCounters);
|
|
||||||
static DISPATCH_PROC(ProcSyncQueryAlarm);
|
|
||||||
static DISPATCH_PROC(ProcSyncQueryCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncSetCounter);
|
|
||||||
static DISPATCH_PROC(ProcSyncSetPriority);
|
|
||||||
static DISPATCH_PROC(SProcSyncAwait);
|
|
||||||
static DISPATCH_PROC(SProcSyncChangeAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncChangeCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncCreateAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncCreateCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncDestroyAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncDestroyCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncDispatch);
|
|
||||||
static DISPATCH_PROC(SProcSyncGetPriority);
|
|
||||||
static DISPATCH_PROC(SProcSyncInitialize);
|
|
||||||
static DISPATCH_PROC(SProcSyncListSystemCounters);
|
|
||||||
static DISPATCH_PROC(SProcSyncQueryAlarm);
|
|
||||||
static DISPATCH_PROC(SProcSyncQueryCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncSetCounter);
|
|
||||||
static DISPATCH_PROC(SProcSyncSetPriority);
|
|
||||||
|
|
||||||
/* Each counter maintains a simple linked list of triggers that are
|
/* Each counter maintains a simple linked list of triggers that are
|
||||||
* interested in the counter. The two functions below are used to
|
* interested in the counter. The two functions below are used to
|
||||||
|
|
|
@ -46,24 +46,6 @@ from The Open Group.
|
||||||
#define UINT32_MAX 0xffffffffU
|
#define UINT32_MAX 0xffffffffU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXCMiscDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXCMiscGetVersion);
|
|
||||||
static DISPATCH_PROC(ProcXCMiscGetXIDList);
|
|
||||||
static DISPATCH_PROC(ProcXCMiscGetXIDRange);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscGetVersion);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscGetXIDList);
|
|
||||||
static DISPATCH_PROC(SProcXCMiscGetXIDRange);
|
|
||||||
|
|
||||||
void XCMiscExtensionInit(INITARGS);
|
|
||||||
|
|
||||||
void
|
|
||||||
XCMiscExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
AddExtension(XCMiscExtensionName, 0, 0,
|
|
||||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
|
||||||
NULL, StandardMinorOpcode);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXCMiscGetVersion(ClientPtr client)
|
ProcXCMiscGetVersion(ClientPtr client)
|
||||||
|
@ -215,3 +197,11 @@ SProcXCMiscDispatch (ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XCMiscExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
AddExtension(XCMiscExtensionName, 0, 0,
|
||||||
|
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
||||||
|
NULL, StandardMinorOpcode);
|
||||||
|
}
|
||||||
|
|
|
@ -80,12 +80,6 @@ static void XF86BigfontResetProc(
|
||||||
ExtensionEntry * /* extEntry */
|
ExtensionEntry * /* extEntry */
|
||||||
);
|
);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86BigfontDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86BigfontQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86BigfontQueryFont);
|
|
||||||
static DISPATCH_PROC(SProcXF86BigfontDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
|
|
||||||
|
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
|
|
||||||
|
|
29
Xext/xtest.c
29
Xext/xtest.c
|
@ -84,26 +84,6 @@ static int XTestSwapFakeInput(
|
||||||
xReq * /* req */
|
xReq * /* req */
|
||||||
);
|
);
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXTestCompareCursor);
|
|
||||||
static DISPATCH_PROC(ProcXTestDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXTestFakeInput);
|
|
||||||
static DISPATCH_PROC(ProcXTestGetVersion);
|
|
||||||
static DISPATCH_PROC(ProcXTestGrabControl);
|
|
||||||
static DISPATCH_PROC(SProcXTestCompareCursor);
|
|
||||||
static DISPATCH_PROC(SProcXTestDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXTestFakeInput);
|
|
||||||
static DISPATCH_PROC(SProcXTestGetVersion);
|
|
||||||
static DISPATCH_PROC(SProcXTestGrabControl);
|
|
||||||
|
|
||||||
void
|
|
||||||
XTestExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
AddExtension(XTestExtensionName, 0, 0,
|
|
||||||
ProcXTestDispatch, SProcXTestDispatch,
|
|
||||||
NULL, StandardMinorOpcode);
|
|
||||||
|
|
||||||
xtest_evlist = InitEventList(GetMaximumEventsNum());
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXTestGetVersion(ClientPtr client)
|
ProcXTestGetVersion(ClientPtr client)
|
||||||
|
@ -699,3 +679,12 @@ GetXTestDevice(DeviceIntPtr master)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XTestExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
AddExtension(XTestExtensionName, 0, 0,
|
||||||
|
ProcXTestDispatch, SProcXTestDispatch,
|
||||||
|
NULL, StandardMinorOpcode);
|
||||||
|
|
||||||
|
xtest_evlist = InitEventList(GetMaximumEventsNum());
|
||||||
|
}
|
||||||
|
|
211
dix/dispatch.h
211
dix/dispatch.h
|
@ -36,111 +36,110 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef DISPATCH_H
|
#ifndef DISPATCH_H
|
||||||
#define DISPATCH_H 1
|
#define DISPATCH_H 1
|
||||||
|
|
||||||
DISPATCH_PROC(InitClientPrivates);
|
int ProcAllocColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocColor);
|
int ProcAllocColorCells(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocColorCells);
|
int ProcAllocColorPlanes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocColorPlanes);
|
int ProcAllocNamedColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcAllocNamedColor);
|
int ProcBell(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcBell);
|
int ProcChangeAccessControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeAccessControl);
|
int ProcChangeCloseDownMode(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeCloseDownMode);
|
int ProcChangeGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeGC);
|
int ProcChangeHosts(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeHosts);
|
int ProcChangeKeyboardControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeKeyboardControl);
|
int ProcChangeKeyboardMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeKeyboardMapping);
|
int ProcChangePointerControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangePointerControl);
|
int ProcChangeProperty(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeProperty);
|
int ProcChangeSaveSet(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeSaveSet);
|
int ProcChangeWindowAttributes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcChangeWindowAttributes);
|
int ProcCirculateWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCirculateWindow);
|
int ProcClearToBackground(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcClearToBackground);
|
int ProcCloseFont(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCloseFont);
|
int ProcConfigureWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcConfigureWindow);
|
int ProcConvertSelection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcConvertSelection);
|
int ProcCopyArea(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyArea);
|
int ProcCopyColormapAndFree(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyColormapAndFree);
|
int ProcCopyGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyGC);
|
int ProcCopyPlane(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCopyPlane);
|
int ProcCreateColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateColormap);
|
int ProcCreateCursor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateCursor);
|
int ProcCreateGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateGC);
|
int ProcCreateGlyphCursor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateGlyphCursor);
|
int ProcCreatePixmap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreatePixmap);
|
int ProcCreateWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcCreateWindow);
|
int ProcDeleteProperty(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcDeleteProperty);
|
int ProcDestroySubwindows(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcDestroySubwindows);
|
int ProcDestroyWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcDestroyWindow);
|
int ProcEstablishConnection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcEstablishConnection);
|
int ProcFillPoly(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFillPoly);
|
int ProcForceScreenSaver(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcForceScreenSaver);
|
int ProcFreeColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeColormap);
|
int ProcFreeColors(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeColors);
|
int ProcFreeCursor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeCursor);
|
int ProcFreeGC(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreeGC);
|
int ProcFreePixmap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcFreePixmap);
|
int ProcGetAtomName(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetAtomName);
|
int ProcGetFontPath(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetFontPath);
|
int ProcGetGeometry(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetGeometry);
|
int ProcGetImage(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetImage);
|
int ProcGetKeyboardControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetKeyboardControl);
|
int ProcGetKeyboardMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetKeyboardMapping);
|
int ProcGetModifierMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetModifierMapping);
|
int ProcGetMotionEvents(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetMotionEvents);
|
int ProcGetPointerControl(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetPointerControl);
|
int ProcGetPointerMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetPointerMapping);
|
int ProcGetProperty(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetProperty);
|
int ProcGetScreenSaver(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetScreenSaver);
|
int ProcGetSelectionOwner(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetSelectionOwner);
|
int ProcGetWindowAttributes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGetWindowAttributes);
|
int ProcGrabServer(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcGrabServer);
|
int ProcImageText16(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcImageText16);
|
int ProcImageText8(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcImageText8);
|
int ProcInitialConnection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcInitialConnection);
|
int ProcInstallColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcInstallColormap);
|
int ProcInternAtom(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcInternAtom);
|
int ProcKillClient(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcKillClient);
|
int ProcListExtensions(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListExtensions);
|
int ProcListFonts(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListFonts);
|
int ProcListFontsWithInfo(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListFontsWithInfo);
|
int ProcListHosts(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListHosts);
|
int ProcListInstalledColormaps(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListInstalledColormaps);
|
int ProcListProperties(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcListProperties);
|
int ProcLookupColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcLookupColor);
|
int ProcMapSubwindows(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcMapSubwindows);
|
int ProcMapWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcMapWindow);
|
int ProcNoOperation(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcNoOperation);
|
int ProcOpenFont(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcOpenFont);
|
int ProcPolyArc(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyArc);
|
int ProcPolyFillArc(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyFillArc);
|
int ProcPolyFillRectangle(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyFillRectangle);
|
int ProcPolyLine(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyLine);
|
int ProcPolyPoint(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyPoint);
|
int ProcPolyRectangle(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyRectangle);
|
int ProcPolySegment(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolySegment);
|
int ProcPolyText(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPolyText);
|
int ProcPutImage(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcPutImage);
|
int ProcQueryBestSize(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryBestSize);
|
int ProcQueryColors(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryColors);
|
int ProcQueryExtension(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryExtension);
|
int ProcQueryFont(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryFont);
|
int ProcQueryKeymap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryKeymap);
|
int ProcQueryTextExtents(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryTextExtents);
|
int ProcQueryTree(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcQueryTree);
|
int ProcReparentWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcReparentWindow);
|
int ProcRotateProperties(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcRotateProperties);
|
int ProcSetClipRectangles(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetClipRectangles);
|
int ProcSetDashes(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetDashes);
|
int ProcSetFontPath(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetFontPath);
|
int ProcSetModifierMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetModifierMapping);
|
int ProcSetPointerMapping(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetPointerMapping);
|
int ProcSetScreenSaver(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetScreenSaver);
|
int ProcSetSelectionOwner(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcSetSelectionOwner);
|
int ProcStoreColors(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcStoreColors);
|
int ProcStoreNamedColor(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcStoreNamedColor);
|
int ProcTranslateCoords(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcTranslateCoords);
|
int ProcUngrabServer(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUngrabServer);
|
int ProcUninstallColormap(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUninstallColormap);
|
int ProcUnmapSubwindows(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUnmapSubwindows);
|
int ProcUnmapWindow(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(ProcUnmapWindow);
|
|
||||||
|
|
||||||
#endif /* DISPATCH_H */
|
#endif /* DISPATCH_H */
|
||||||
|
|
54
hw/dmx/dmx.c
54
hw/dmx/dmx.c
|
@ -69,39 +69,7 @@ extern void DMXExtensionInit(void);
|
||||||
|
|
||||||
static unsigned char DMXCode;
|
static unsigned char DMXCode;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcDMXDispatch);
|
|
||||||
static DISPATCH_PROC(ProcDMXQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcDMXSync);
|
|
||||||
static DISPATCH_PROC(ProcDMXForceWindowCreation);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetScreenCount);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetScreenAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXChangeScreensAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXAddScreen);
|
|
||||||
static DISPATCH_PROC(ProcDMXRemoveScreen);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetWindowAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXChangeDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetInputCount);
|
|
||||||
static DISPATCH_PROC(ProcDMXGetInputAttributes);
|
|
||||||
static DISPATCH_PROC(ProcDMXAddInput);
|
|
||||||
static DISPATCH_PROC(ProcDMXRemoveInput);
|
|
||||||
|
|
||||||
static DISPATCH_PROC(SProcDMXDispatch);
|
|
||||||
static DISPATCH_PROC(SProcDMXQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcDMXSync);
|
|
||||||
static DISPATCH_PROC(SProcDMXForceWindowCreation);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetScreenCount);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetScreenAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXChangeScreensAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXAddScreen);
|
|
||||||
static DISPATCH_PROC(SProcDMXRemoveScreen);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetWindowAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXChangeDesktopAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetInputCount);
|
|
||||||
static DISPATCH_PROC(SProcDMXGetInputAttributes);
|
|
||||||
static DISPATCH_PROC(SProcDMXAddInput);
|
|
||||||
static DISPATCH_PROC(SProcDMXRemoveInput);
|
|
||||||
|
|
||||||
static int _DMXXineramaActive(void)
|
static int _DMXXineramaActive(void)
|
||||||
{
|
{
|
||||||
|
@ -111,17 +79,6 @@ static int _DMXXineramaActive(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initialize the extension. */
|
|
||||||
void DMXExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry *extEntry;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
|
|
||||||
ProcDMXDispatch, SProcDMXDispatch,
|
|
||||||
NULL, StandardMinorOpcode)))
|
|
||||||
DMXCode = extEntry->base;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
|
static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
|
||||||
CARD32 value)
|
CARD32 value)
|
||||||
{
|
{
|
||||||
|
@ -1125,3 +1082,14 @@ static int SProcDMXDispatch (ClientPtr client)
|
||||||
default: return BadRequest;
|
default: return BadRequest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Initialize the extension. */
|
||||||
|
void DMXExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry *extEntry;
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
|
||||||
|
ProcDMXDispatch, SProcDMXDispatch,
|
||||||
|
NULL, StandardMinorOpcode)))
|
||||||
|
DMXCode = extEntry->base;
|
||||||
|
}
|
||||||
|
|
|
@ -72,23 +72,7 @@ typedef EphyrDRIScreenPrivRec* EphyrDRIScreenPrivPtr;
|
||||||
|
|
||||||
static int DRIErrorBase;
|
static int DRIErrorBase;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIOpenConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICloseConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIAuthConnection);
|
|
||||||
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIDispatch);
|
|
||||||
|
|
||||||
static Bool ephyrDRIScreenInit (ScreenPtr a_screen) ;
|
static Bool ephyrDRIScreenInit (ScreenPtr a_screen) ;
|
||||||
static Bool ephyrDRICreateWindow (WindowPtr a_win) ;
|
static Bool ephyrDRICreateWindow (WindowPtr a_win) ;
|
||||||
|
@ -119,65 +103,6 @@ static DevPrivateKeyRec ephyrDRIScreenKeyRec;
|
||||||
#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \
|
#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \
|
||||||
dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey))
|
dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey))
|
||||||
|
|
||||||
|
|
||||||
Bool
|
|
||||||
ephyrDRIExtensionInit (ScreenPtr a_screen)
|
|
||||||
{
|
|
||||||
Bool is_ok=FALSE ;
|
|
||||||
ExtensionEntry* extEntry=NULL;
|
|
||||||
EphyrDRIScreenPrivPtr screen_priv=NULL ;
|
|
||||||
|
|
||||||
EPHYR_LOG ("enter\n") ;
|
|
||||||
if (!hostx_has_dri ()) {
|
|
||||||
EPHYR_LOG ("host does not have DRI extension\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
EPHYR_LOG ("host X does have DRI extension\n") ;
|
|
||||||
if (!hostx_has_xshape ()) {
|
|
||||||
EPHYR_LOG ("host does not have XShape extension\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
EPHYR_LOG ("host X does have XShape extension\n") ;
|
|
||||||
|
|
||||||
#ifdef XF86DRI_EVENTS
|
|
||||||
EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
|
|
||||||
if (!EventType) {
|
|
||||||
EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XF86DRINAME,
|
|
||||||
XF86DRINumberEvents,
|
|
||||||
XF86DRINumberErrors,
|
|
||||||
ProcXF86DRIDispatch,
|
|
||||||
SProcXF86DRIDispatch,
|
|
||||||
NULL,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
DRIReqCode = (unsigned char)extEntry->base;
|
|
||||||
DRIErrorBase = extEntry->errorBase;
|
|
||||||
} else {
|
|
||||||
EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
|
|
||||||
if (!screen_priv) {
|
|
||||||
EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
|
|
||||||
|
|
||||||
if (!ephyrDRIScreenInit (a_screen)) {
|
|
||||||
EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
|
|
||||||
goto out ;
|
|
||||||
}
|
|
||||||
EphyrMirrorHostVisuals (a_screen) ;
|
|
||||||
is_ok=TRUE ;
|
|
||||||
out:
|
|
||||||
EPHYR_LOG ("leave\n") ;
|
|
||||||
return is_ok ;
|
|
||||||
}
|
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
ephyrDRIScreenInit (ScreenPtr a_screen)
|
ephyrDRIScreenInit (ScreenPtr a_screen)
|
||||||
{
|
{
|
||||||
|
@ -1428,3 +1353,61 @@ SProcXF86DRIDispatch (register ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
ephyrDRIExtensionInit (ScreenPtr a_screen)
|
||||||
|
{
|
||||||
|
Bool is_ok=FALSE ;
|
||||||
|
ExtensionEntry* extEntry=NULL;
|
||||||
|
EphyrDRIScreenPrivPtr screen_priv=NULL ;
|
||||||
|
|
||||||
|
EPHYR_LOG ("enter\n") ;
|
||||||
|
if (!hostx_has_dri ()) {
|
||||||
|
EPHYR_LOG ("host does not have DRI extension\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
EPHYR_LOG ("host X does have DRI extension\n") ;
|
||||||
|
if (!hostx_has_xshape ()) {
|
||||||
|
EPHYR_LOG ("host does not have XShape extension\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
EPHYR_LOG ("host X does have XShape extension\n") ;
|
||||||
|
|
||||||
|
#ifdef XF86DRI_EVENTS
|
||||||
|
EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
|
||||||
|
if (!EventType) {
|
||||||
|
EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(XF86DRINAME,
|
||||||
|
XF86DRINumberEvents,
|
||||||
|
XF86DRINumberErrors,
|
||||||
|
ProcXF86DRIDispatch,
|
||||||
|
SProcXF86DRIDispatch,
|
||||||
|
NULL,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
DRIReqCode = (unsigned char)extEntry->base;
|
||||||
|
DRIErrorBase = extEntry->errorBase;
|
||||||
|
} else {
|
||||||
|
EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
|
||||||
|
if (!screen_priv) {
|
||||||
|
EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
|
||||||
|
|
||||||
|
if (!ephyrDRIScreenInit (a_screen)) {
|
||||||
|
EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
|
||||||
|
goto out ;
|
||||||
|
}
|
||||||
|
EphyrMirrorHostVisuals (a_screen) ;
|
||||||
|
is_ok=TRUE ;
|
||||||
|
out:
|
||||||
|
EPHYR_LOG ("leave\n") ;
|
||||||
|
return is_ok ;
|
||||||
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ extsmoduledir = $(moduledir)/extensions
|
||||||
extsmodule_LTLIBRARIES = libextmod.la
|
extsmodule_LTLIBRARIES = libextmod.la
|
||||||
|
|
||||||
if DGA
|
if DGA
|
||||||
DGA_SRCS = xf86dga2.c dgaproc.h xf86dgaext.h
|
DGA_SRCS = xf86dga2.c dgaproc.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if XV
|
if XV
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <X11/extensions/xf86dgaproto.h>
|
#include <X11/extensions/xf86dgaproto.h>
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include "dgaproc.h"
|
#include "dgaproc.h"
|
||||||
#include "xf86dgaext.h"
|
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -34,24 +33,6 @@
|
||||||
|
|
||||||
#define DGA_PROTOCOL_OLD_SUPPORT 1
|
#define DGA_PROTOCOL_OLD_SUPPORT 1
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXDGADispatch);
|
|
||||||
static DISPATCH_PROC(SProcXDGADispatch);
|
|
||||||
static DISPATCH_PROC(ProcXDGAQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXDGAQueryModes);
|
|
||||||
static DISPATCH_PROC(ProcXDGASetMode);
|
|
||||||
static DISPATCH_PROC(ProcXDGAOpenFramebuffer);
|
|
||||||
static DISPATCH_PROC(ProcXDGACloseFramebuffer);
|
|
||||||
static DISPATCH_PROC(ProcXDGASetViewport);
|
|
||||||
static DISPATCH_PROC(ProcXDGAInstallColormap);
|
|
||||||
static DISPATCH_PROC(ProcXDGASelectInput);
|
|
||||||
static DISPATCH_PROC(ProcXDGAFillRectangle);
|
|
||||||
static DISPATCH_PROC(ProcXDGACopyArea);
|
|
||||||
static DISPATCH_PROC(ProcXDGACopyTransparentArea);
|
|
||||||
static DISPATCH_PROC(ProcXDGAGetViewportStatus);
|
|
||||||
static DISPATCH_PROC(ProcXDGASync);
|
|
||||||
static DISPATCH_PROC(ProcXDGASetClientVersion);
|
|
||||||
static DISPATCH_PROC(ProcXDGAChangePixmapMode);
|
|
||||||
static DISPATCH_PROC(ProcXDGACreateColormap);
|
|
||||||
|
|
||||||
static void XDGAResetProc(ExtensionEntry *extEntry);
|
static void XDGAResetProc(ExtensionEntry *extEntry);
|
||||||
|
|
||||||
|
@ -85,36 +66,6 @@ typedef struct {
|
||||||
dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
|
dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
XFree86DGAExtensionInit(INITARGS)
|
|
||||||
{
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(XF86DGANAME,
|
|
||||||
XF86DGANumberEvents,
|
|
||||||
XF86DGANumberErrors,
|
|
||||||
ProcXDGADispatch,
|
|
||||||
SProcXDGADispatch,
|
|
||||||
XDGAResetProc,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
DGAReqCode = (unsigned char)extEntry->base;
|
|
||||||
DGAErrorBase = extEntry->errorBase;
|
|
||||||
DGAEventBase = extEntry->eventBase;
|
|
||||||
for (i = KeyPress; i <= MotionNotify; i++)
|
|
||||||
SetCriticalEvent (DGAEventBase + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
XDGAResetProc (ExtensionEntry *extEntry)
|
XDGAResetProc (ExtensionEntry *extEntry)
|
||||||
{
|
{
|
||||||
|
@ -663,15 +614,6 @@ ProcXDGACreateColormap(ClientPtr client)
|
||||||
|
|
||||||
#ifdef DGA_PROTOCOL_OLD_SUPPORT
|
#ifdef DGA_PROTOCOL_OLD_SUPPORT
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86DGADirectVideo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAGetVidPage);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAGetVideoLL);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAGetViewPortSize);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGASetVidPage);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGASetViewPort);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAInstallColormap);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DGAViewPortChanged);
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -1063,3 +1005,31 @@ XFree86DGARegister(INITARGS)
|
||||||
{
|
{
|
||||||
XDGAEventBase = &DGAEventBase;
|
XDGAEventBase = &DGAEventBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XFree86DGAExtensionInit(INITARGS)
|
||||||
|
{
|
||||||
|
ExtensionEntry* extEntry;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((extEntry = AddExtension(XF86DGANAME,
|
||||||
|
XF86DGANumberEvents,
|
||||||
|
XF86DGANumberErrors,
|
||||||
|
ProcXDGADispatch,
|
||||||
|
SProcXDGADispatch,
|
||||||
|
XDGAResetProc,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
DGAReqCode = (unsigned char)extEntry->base;
|
||||||
|
DGAErrorBase = extEntry->errorBase;
|
||||||
|
DGAEventBase = extEntry->eventBase;
|
||||||
|
for (i = KeyPress; i <= MotionNotify; i++)
|
||||||
|
SetCriticalEvent (DGAEventBase + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
#ifdef HAVE_DIX_CONFIG_H
|
|
||||||
#include <dix-config.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _XF86DGAEXT_H_
|
|
||||||
#define _XF86DGAEXT_H_
|
|
||||||
|
|
||||||
extern DISPATCH_PROC(ProcXF86DGADispatch);
|
|
||||||
|
|
||||||
#endif /* _XF86DGAEXT_H_ */
|
|
|
@ -65,48 +65,6 @@ typedef struct {
|
||||||
#define VM_SETPRIV(c,p) \
|
#define VM_SETPRIV(c,p) \
|
||||||
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
|
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetMonitor);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeLockModeSwitch);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeAddModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeDeleteModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeModModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeValidateModeLine);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSwitchMode);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSwitchToMode);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetViewPort);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetViewPort);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetDotClocks);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetGamma);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetGamma);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetClientVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp);
|
|
||||||
static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeDispatch);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetMonitor);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeLockModeSwitch);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeAddModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeDeleteModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeModModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeValidateModeLine);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSwitchMode);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSwitchToMode);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetViewPort);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetViewPort);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetDotClocks);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetGamma);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetGamma);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetClientVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
|
|
||||||
static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static unsigned char XF86VidModeReqCode = 0;
|
static unsigned char XF86VidModeReqCode = 0;
|
||||||
|
@ -159,58 +117,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
|
||||||
# define DEBUG_P(x) /**/
|
# define DEBUG_P(x) /**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
|
||||||
XFree86VidModeExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
ScreenPtr pScreen;
|
|
||||||
int i;
|
|
||||||
Bool enabled = FALSE;
|
|
||||||
|
|
||||||
DEBUG_P("XFree86VidModeExtensionInit");
|
|
||||||
|
|
||||||
if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
|
||||||
return;
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for(i = 0; i < screenInfo.numScreens; i++) {
|
|
||||||
pScreen = screenInfo.screens[i];
|
|
||||||
if (VidModeExtensionInit(pScreen))
|
|
||||||
enabled = TRUE;
|
|
||||||
}
|
|
||||||
/* This means that the DDX doesn't want the vidmode extension enabled */
|
|
||||||
if (!enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
EventType &&
|
|
||||||
#endif
|
|
||||||
(extEntry = AddExtension(XF86VIDMODENAME,
|
|
||||||
XF86VidModeNumberEvents,
|
|
||||||
XF86VidModeNumberErrors,
|
|
||||||
ProcXF86VidModeDispatch,
|
|
||||||
SProcXF86VidModeDispatch,
|
|
||||||
NULL,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
#if 0
|
|
||||||
XF86VidModeReqCode = (unsigned char)extEntry->base;
|
|
||||||
#endif
|
|
||||||
VidModeErrorBase = extEntry->errorBase;
|
|
||||||
#ifdef XF86VIDMODE_EVENTS
|
|
||||||
XF86VidModeEventBase = extEntry->eventBase;
|
|
||||||
EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ClientMajorVersion(ClientPtr client)
|
ClientMajorVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -2166,3 +2072,55 @@ SProcXF86VidModeDispatch(ClientPtr client)
|
||||||
return VidModeErrorBase + XF86VidModeClientNotLocal;
|
return VidModeErrorBase + XF86VidModeClientNotLocal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XFree86VidModeExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry* extEntry;
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
int i;
|
||||||
|
Bool enabled = FALSE;
|
||||||
|
|
||||||
|
DEBUG_P("XFree86VidModeExtensionInit");
|
||||||
|
|
||||||
|
if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
|
||||||
|
return;
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for(i = 0; i < screenInfo.numScreens; i++) {
|
||||||
|
pScreen = screenInfo.screens[i];
|
||||||
|
if (VidModeExtensionInit(pScreen))
|
||||||
|
enabled = TRUE;
|
||||||
|
}
|
||||||
|
/* This means that the DDX doesn't want the vidmode extension enabled */
|
||||||
|
if (!enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
EventType &&
|
||||||
|
#endif
|
||||||
|
(extEntry = AddExtension(XF86VIDMODENAME,
|
||||||
|
XF86VidModeNumberEvents,
|
||||||
|
XF86VidModeNumberErrors,
|
||||||
|
ProcXF86VidModeDispatch,
|
||||||
|
SProcXF86VidModeDispatch,
|
||||||
|
NULL,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
#if 0
|
||||||
|
XF86VidModeReqCode = (unsigned char)extEntry->base;
|
||||||
|
#endif
|
||||||
|
VidModeErrorBase = extEntry->errorBase;
|
||||||
|
#ifdef XF86VIDMODE_EVENTS
|
||||||
|
XF86VidModeEventBase = extEntry->eventBase;
|
||||||
|
EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -64,23 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
static int DRIErrorBase;
|
static int DRIErrorBase;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIOpenConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICloseConnection);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyContext);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRICreateDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIDispatch);
|
|
||||||
static DISPATCH_PROC(ProcXF86DRIAuthConnection);
|
|
||||||
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryVersion);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
|
|
||||||
static DISPATCH_PROC(SProcXF86DRIDispatch);
|
|
||||||
|
|
||||||
static void XF86DRIResetProc(ExtensionEntry* extEntry);
|
static void XF86DRIResetProc(ExtensionEntry* extEntry);
|
||||||
|
|
||||||
|
@ -88,32 +72,6 @@ static unsigned char DRIReqCode = 0;
|
||||||
|
|
||||||
extern void XFree86DRIExtensionInit(void);
|
extern void XFree86DRIExtensionInit(void);
|
||||||
|
|
||||||
void
|
|
||||||
XFree86DRIExtensionInit(void)
|
|
||||||
{
|
|
||||||
ExtensionEntry* extEntry;
|
|
||||||
|
|
||||||
#ifdef XF86DRI_EVENTS
|
|
||||||
EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (
|
|
||||||
DRIExtensionInit() &&
|
|
||||||
#ifdef XF86DRI_EVENTS
|
|
||||||
EventType && ScreenPrivateIndex != -1 &&
|
|
||||||
#endif
|
|
||||||
(extEntry = AddExtension(XF86DRINAME,
|
|
||||||
XF86DRINumberEvents,
|
|
||||||
XF86DRINumberErrors,
|
|
||||||
ProcXF86DRIDispatch,
|
|
||||||
SProcXF86DRIDispatch,
|
|
||||||
XF86DRIResetProc,
|
|
||||||
StandardMinorOpcode))) {
|
|
||||||
DRIReqCode = (unsigned char)extEntry->base;
|
|
||||||
DRIErrorBase = extEntry->errorBase;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static void
|
static void
|
||||||
XF86DRIResetProc (
|
XF86DRIResetProc (
|
||||||
|
@ -677,3 +635,29 @@ SProcXF86DRIDispatch (
|
||||||
return DRIErrorBase + XF86DRIClientNotLocal;
|
return DRIErrorBase + XF86DRIClientNotLocal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
XFree86DRIExtensionInit(void)
|
||||||
|
{
|
||||||
|
ExtensionEntry* extEntry;
|
||||||
|
|
||||||
|
#ifdef XF86DRI_EVENTS
|
||||||
|
EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (
|
||||||
|
DRIExtensionInit() &&
|
||||||
|
#ifdef XF86DRI_EVENTS
|
||||||
|
EventType && ScreenPrivateIndex != -1 &&
|
||||||
|
#endif
|
||||||
|
(extEntry = AddExtension(XF86DRINAME,
|
||||||
|
XF86DRINumberEvents,
|
||||||
|
XF86DRINumberErrors,
|
||||||
|
ProcXF86DRIDispatch,
|
||||||
|
SProcXF86DRIDispatch,
|
||||||
|
XF86DRIResetProc,
|
||||||
|
StandardMinorOpcode))) {
|
||||||
|
DRIReqCode = (unsigned char)extEntry->base;
|
||||||
|
DRIErrorBase = extEntry->errorBase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -70,8 +70,6 @@ static AppleWMProcsPtr appleWMProcs;
|
||||||
|
|
||||||
static int WMErrorBase;
|
static int WMErrorBase;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcAppleWMDispatch);
|
|
||||||
static DISPATCH_PROC(SProcAppleWMDispatch);
|
|
||||||
|
|
||||||
static unsigned char WMReqCode = 0;
|
static unsigned char WMReqCode = 0;
|
||||||
static int WMEventBase = 0;
|
static int WMEventBase = 0;
|
||||||
|
|
|
@ -59,8 +59,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
static int DRIErrorBase = 0;
|
static int DRIErrorBase = 0;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcAppleDRIDispatch);
|
|
||||||
static DISPATCH_PROC(SProcAppleDRIDispatch);
|
|
||||||
|
|
||||||
static void AppleDRIResetProc(ExtensionEntry* extEntry);
|
static void AppleDRIResetProc(ExtensionEntry* extEntry);
|
||||||
static int ProcAppleDRICreatePixmap(ClientPtr client);
|
static int ProcAppleDRICreatePixmap(ClientPtr client);
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef XWIN_CLIPBOARD
|
#ifdef XWIN_CLIPBOARD
|
||||||
DISPATCH_PROC(winProcEstablishConnection);
|
int winProcEstablishConnection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(winProcQueryTree);
|
int winProcQueryTree(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(winProcSetSelectionOwner);
|
int winProcSetSelectionOwner(ClientPtr /* client */);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
typedef int (*winDispatchProcPtr) (ClientPtr);
|
typedef int (*winDispatchProcPtr) (ClientPtr);
|
||||||
|
|
||||||
DISPATCH_PROC(winProcSetSelectionOwner);
|
int winProcSetSelectionOwner(ClientPtr /* client */);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -52,9 +52,9 @@
|
||||||
* Local function prototypes
|
* Local function prototypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DISPATCH_PROC(winProcEstablishConnection);
|
int winProcEstablishConnection(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(winProcQueryTree);
|
int winProcQueryTree(ClientPtr /* client */);
|
||||||
DISPATCH_PROC(winProcSetSelectionOwner);
|
int winProcSetSelectionOwner(ClientPtr /* client */);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -45,8 +45,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
static int WMErrorBase;
|
static int WMErrorBase;
|
||||||
|
|
||||||
static DISPATCH_PROC(ProcWindowsWMDispatch);
|
|
||||||
static DISPATCH_PROC(SProcWindowsWMDispatch);
|
|
||||||
|
|
||||||
static unsigned char WMReqCode = 0;
|
static unsigned char WMReqCode = 0;
|
||||||
static int WMEventBase = 0;
|
static int WMEventBase = 0;
|
||||||
|
|
Loading…
Reference in New Issue