2006-11-26 11:13:41 -07:00
|
|
|
/*
|
|
|
|
* Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* 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 on the rights to use, copy, modify, merge,
|
|
|
|
* publish, distribute, sublicense, and/or sell copies of the Software,
|
|
|
|
* and to permit persons to whom the Software is furnished to do so,
|
|
|
|
* subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) 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
|
|
|
|
* NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
|
|
|
|
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Authors:
|
|
|
|
* Rickard E. (Rik) Faith <faith@redhat.com>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* This file implements the server-side part of the DMX protocol. A
|
|
|
|
* vector of fucntions is provided at extension initialization time, so
|
|
|
|
* most all of the useful functions in this file are declared static and
|
|
|
|
* do not appear in the doxygen documentation.
|
|
|
|
*
|
2010-07-27 13:02:24 -06:00
|
|
|
* Much of the low-level work is done by functions in \a dmxextension.c
|
2006-11-26 11:13:41 -07:00
|
|
|
*
|
|
|
|
* Please see the Client-to-Server DMX Extension to the X Protocol
|
|
|
|
* document for details about the protocol. */
|
|
|
|
|
|
|
|
#ifdef HAVE_DMX_CONFIG_H
|
|
|
|
#include <dmx-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include "misc.h"
|
|
|
|
#include "os.h"
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "extnsionst.h"
|
2013-06-07 11:28:45 -06:00
|
|
|
#include "extinit.h"
|
2006-11-26 11:13:41 -07:00
|
|
|
#include "opaque.h"
|
|
|
|
|
|
|
|
#include "dmxextension.h"
|
|
|
|
#include <X11/extensions/dmxproto.h>
|
2010-07-27 13:02:24 -06:00
|
|
|
#include <X11/extensions/dmx.h>
|
|
|
|
#include "protocol-versions.h"
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
#include "panoramiX.h"
|
|
|
|
extern unsigned long XRT_WINDOW;
|
2012-06-10 07:21:05 -06:00
|
|
|
extern int PanoramiXNumScreens;
|
2006-11-26 11:13:41 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static unsigned char DMXCode;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
_DMXXineramaActive(void)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
return !noPanoramiXExtension;
|
2013-06-07 11:28:45 -06:00
|
|
|
#else
|
2006-11-26 11:13:41 -07:00
|
|
|
return 0;
|
2013-06-07 11:28:45 -06:00
|
|
|
#endif
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static void
|
|
|
|
dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr, CARD32 value)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
switch (1 << bit) {
|
2012-06-10 07:21:05 -06:00
|
|
|
case DMXScreenWindowWidth:
|
|
|
|
attr->screenWindowWidth = value;
|
|
|
|
break;
|
|
|
|
case DMXScreenWindowHeight:
|
|
|
|
attr->screenWindowHeight = value;
|
|
|
|
break;
|
|
|
|
case DMXScreenWindowXoffset:
|
|
|
|
attr->screenWindowXoffset = value;
|
|
|
|
break;
|
|
|
|
case DMXScreenWindowYoffset:
|
|
|
|
attr->screenWindowYoffset = value;
|
|
|
|
break;
|
|
|
|
case DMXRootWindowWidth:
|
|
|
|
attr->rootWindowWidth = value;
|
|
|
|
break;
|
|
|
|
case DMXRootWindowHeight:
|
|
|
|
attr->rootWindowHeight = value;
|
|
|
|
break;
|
|
|
|
case DMXRootWindowXoffset:
|
|
|
|
attr->rootWindowXoffset = value;
|
|
|
|
break;
|
|
|
|
case DMXRootWindowYoffset:
|
|
|
|
attr->rootWindowYoffset = value;
|
|
|
|
break;
|
|
|
|
case DMXRootWindowXorigin:
|
|
|
|
attr->rootWindowXorigin = value;
|
|
|
|
break;
|
|
|
|
case DMXRootWindowYorigin:
|
|
|
|
attr->rootWindowYorigin = value;
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
dmxFetchScreenAttributes(unsigned int mask,
|
|
|
|
DMXScreenAttributesPtr attr, CARD32 *value_list)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
2006-11-26 11:13:41 -07:00
|
|
|
CARD32 *value = value_list;
|
2012-06-10 07:21:05 -06:00
|
|
|
int count = 0;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
if (mask & (1 << i)) {
|
|
|
|
dmxSetScreenAttribute(i, attr, *value);
|
|
|
|
++value;
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static void
|
|
|
|
dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr, CARD32 value)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
switch (1 << bit) {
|
2012-06-10 07:21:05 -06:00
|
|
|
case DMXDesktopWidth:
|
|
|
|
attr->width = value;
|
|
|
|
break;
|
|
|
|
case DMXDesktopHeight:
|
|
|
|
attr->height = value;
|
|
|
|
break;
|
|
|
|
case DMXDesktopShiftX:
|
|
|
|
attr->shiftX = value;
|
|
|
|
break;
|
|
|
|
case DMXDesktopShiftY:
|
|
|
|
attr->shiftY = value;
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
dmxFetchDesktopAttributes(unsigned int mask,
|
|
|
|
DMXDesktopAttributesPtr attr, CARD32 *value_list)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
2006-11-26 11:13:41 -07:00
|
|
|
CARD32 *value = value_list;
|
2012-06-10 07:21:05 -06:00
|
|
|
int count = 0;
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
if (mask & (1 << i)) {
|
|
|
|
dmxSetDesktopAttribute(i, attr, *value);
|
2012-06-10 07:21:05 -06:00
|
|
|
++value;
|
2006-11-26 11:13:41 -07:00
|
|
|
++count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static void
|
|
|
|
dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr, CARD32 value)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
switch (1 << bit) {
|
2012-06-10 07:21:05 -06:00
|
|
|
case DMXInputType:
|
|
|
|
attr->inputType = value;
|
|
|
|
break;
|
|
|
|
case DMXInputPhysicalScreen:
|
|
|
|
attr->physicalScreen = value;
|
|
|
|
break;
|
|
|
|
case DMXInputSendsCore:
|
|
|
|
attr->sendsCore = ! !value;
|
|
|
|
break;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
dmxFetchInputAttributes(unsigned int mask,
|
|
|
|
DMXInputAttributesPtr attr, CARD32 *value_list)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
2006-11-26 11:13:41 -07:00
|
|
|
CARD32 *value = value_list;
|
2012-06-10 07:21:05 -06:00
|
|
|
int count = 0;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
for (i = 0; i < 32; i++) {
|
|
|
|
if (mask & (1 << i)) {
|
|
|
|
dmxSetInputAttribute(i, attr, *value);
|
|
|
|
++value;
|
|
|
|
++count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXQueryVersion(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2013-06-07 11:28:45 -06:00
|
|
|
xDMXQueryVersionReply rep = {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.majorVersion = SERVER_DMX_MAJOR_VERSION,
|
|
|
|
.minorVersion = SERVER_DMX_MINOR_VERSION,
|
|
|
|
.patchVersion = SERVER_DMX_PATCH_VERSION
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
|
|
|
|
|
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.majorVersion);
|
|
|
|
swapl(&rep.minorVersion);
|
|
|
|
swapl(&rep.patchVersion);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXQueryVersionReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXSync(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xDMXSyncReply rep;
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXSyncReq);
|
|
|
|
|
|
|
|
dmxFlushPendingSyncs();
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXSyncReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = 0
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXSyncReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXForceWindowCreation(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xDMXForceWindowCreationReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST(xDMXForceWindowCreationReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
WindowPtr pWin;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension) {
|
|
|
|
PanoramiXRes *win;
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (Success != dixLookupResourceByType((pointer *) &win,
|
|
|
|
stuff->window, XRT_WINDOW,
|
|
|
|
client, DixReadAccess))
|
|
|
|
return -1; /* BadWindow */
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
FOR_NSCREENS(i) {
|
2007-11-24 10:55:21 -07:00
|
|
|
if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
|
2012-06-10 07:21:05 -06:00
|
|
|
DixReadAccess))
|
|
|
|
return -1; /* BadWindow */
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
dmxForceWindowCreation(pWin);
|
|
|
|
}
|
|
|
|
goto doreply;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (Success != dixLookupWindow(&pWin, stuff->window, client, DixReadAccess))
|
|
|
|
return -1; /* BadWindow */
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
dmxForceWindowCreation(pWin);
|
2012-06-10 07:21:05 -06:00
|
|
|
doreply:
|
2006-11-26 11:13:41 -07:00
|
|
|
dmxFlushPendingSyncs();
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXForceWindowCreationReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = 0
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXForceWindowCreationReply), &rep);
|
2006-11-26 11:13:41 -07:00
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXGetScreenCount(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xDMXGetScreenCountReply rep;
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXGetScreenCountReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.screenCount = dmxGetNumScreens()
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.screenCount);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXGetScreenCountReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXGetScreenAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetScreenAttributesReq);
|
|
|
|
xDMXGetScreenAttributesReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
int length;
|
|
|
|
int paddedLength;
|
|
|
|
DMXScreenAttributesRec attr;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
|
|
|
|
|
|
|
|
if (stuff->physicalScreen < 0
|
2012-06-10 07:21:05 -06:00
|
|
|
|| stuff->physicalScreen >= dmxGetNumScreens())
|
|
|
|
return BadValue;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
|
|
|
|
return BadValue;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
length = attr.displayName ? strlen(attr.displayName) : 0;
|
|
|
|
paddedLength = pad_to_int32(length);
|
2013-06-07 11:28:45 -06:00
|
|
|
|
|
|
|
rep = (xDMXGetScreenAttributesReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length =
|
|
|
|
bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
|
|
|
|
sizeof(xGenericReply))
|
|
|
|
+ paddedLength),
|
|
|
|
.displayNameLength = length,
|
|
|
|
.logicalScreen = attr.logicalScreen,
|
|
|
|
.screenWindowWidth = attr.screenWindowWidth,
|
|
|
|
.screenWindowHeight = attr.screenWindowHeight,
|
|
|
|
.screenWindowXoffset = attr.screenWindowXoffset,
|
|
|
|
.screenWindowYoffset = attr.screenWindowYoffset,
|
|
|
|
.rootWindowWidth = attr.rootWindowWidth,
|
|
|
|
.rootWindowHeight = attr.rootWindowHeight,
|
|
|
|
.rootWindowXoffset = attr.rootWindowXoffset,
|
|
|
|
.rootWindowYoffset = attr.rootWindowYoffset,
|
|
|
|
.rootWindowXorigin = attr.rootWindowXorigin,
|
|
|
|
.rootWindowYorigin = attr.rootWindowYorigin
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.displayNameLength);
|
|
|
|
swapl(&rep.logicalScreen);
|
|
|
|
swaps(&rep.screenWindowWidth);
|
|
|
|
swaps(&rep.screenWindowHeight);
|
|
|
|
swaps(&rep.screenWindowXoffset);
|
|
|
|
swaps(&rep.screenWindowYoffset);
|
|
|
|
swaps(&rep.rootWindowWidth);
|
|
|
|
swaps(&rep.rootWindowHeight);
|
|
|
|
swaps(&rep.rootWindowXoffset);
|
|
|
|
swaps(&rep.rootWindowYoffset);
|
|
|
|
swaps(&rep.rootWindowXorigin);
|
|
|
|
swaps(&rep.rootWindowYorigin);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), &rep);
|
2012-06-10 07:21:05 -06:00
|
|
|
if (length)
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, length, attr.displayName);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXChangeScreensAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXChangeScreensAttributesReq);
|
|
|
|
xDMXChangeScreensAttributesReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
int status = DMX_BAD_XINERAMA;
|
|
|
|
unsigned int mask = 0;
|
|
|
|
unsigned int i;
|
|
|
|
CARD32 *screen_list;
|
|
|
|
CARD32 *mask_list;
|
|
|
|
CARD32 *value_list;
|
|
|
|
DMXScreenAttributesPtr attribs;
|
|
|
|
int errorScreen = 0;
|
|
|
|
unsigned int len;
|
|
|
|
int ones = 0;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
len =
|
|
|
|
client->req_len -
|
|
|
|
bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq));
|
2006-11-26 11:13:41 -07:00
|
|
|
if (len < stuff->screenCount + stuff->maskCount)
|
|
|
|
return BadLength;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
screen_list = (CARD32 *) (stuff + 1);
|
|
|
|
mask_list = &screen_list[stuff->screenCount];
|
|
|
|
value_list = &mask_list[stuff->maskCount];
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
for (i = 0; i < stuff->maskCount; i++)
|
|
|
|
ones += Ones(mask_list[i]);
|
2006-11-26 11:13:41 -07:00
|
|
|
if (len != stuff->screenCount + stuff->maskCount + ones)
|
|
|
|
return BadLength;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
|
|
|
if (!_DMXXineramaActive())
|
|
|
|
goto noxinerama;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs))))
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
|
|
|
|
|
|
|
for (i = 0; i < stuff->screenCount; i++) {
|
|
|
|
int count;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
|
|
|
if (i < stuff->maskCount)
|
|
|
|
mask = mask_list[i];
|
2006-11-26 11:13:41 -07:00
|
|
|
dmxGetScreenAttributes(screen_list[i], &attribs[i]);
|
|
|
|
count = dmxFetchScreenAttributes(mask, &attribs[i], value_list);
|
|
|
|
value_list += count;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if PANORAMIX
|
|
|
|
status = dmxConfigureScreenWindows(stuff->screenCount,
|
2012-06-10 07:21:05 -06:00
|
|
|
screen_list, attribs, &errorScreen);
|
2006-11-26 11:13:41 -07:00
|
|
|
#endif
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
free(attribs);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (status == BadValue)
|
|
|
|
return status;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
noxinerama:
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXChangeScreensAttributesReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = status,
|
|
|
|
.errorScreen = errorScreen
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
|
|
|
swapl(&rep.errorScreen);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXChangeScreensAttributesReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXAddScreen(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXAddScreenReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
xDMXAddScreenReply rep;
|
|
|
|
int status = 0;
|
|
|
|
CARD32 *value_list;
|
2006-11-26 11:13:41 -07:00
|
|
|
DMXScreenAttributesRec attr;
|
2012-06-10 07:21:05 -06:00
|
|
|
int count;
|
|
|
|
char *name;
|
|
|
|
int len;
|
|
|
|
int paddedLength;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
|
2010-07-27 13:02:24 -06:00
|
|
|
paddedLength = pad_to_int32(stuff->displayNameLength);
|
2012-06-10 07:21:05 -06:00
|
|
|
len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq));
|
|
|
|
if (len != Ones(stuff->valueMask) + paddedLength / 4)
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
memset(&attr, 0, sizeof(attr));
|
|
|
|
dmxGetScreenAttributes(stuff->physicalScreen, &attr);
|
2012-06-10 07:21:05 -06:00
|
|
|
value_list = (CARD32 *) (stuff + 1);
|
|
|
|
count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list);
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
|
|
|
memcpy(name, &value_list[count], stuff->displayNameLength);
|
|
|
|
name[stuff->displayNameLength] = '\0';
|
|
|
|
attr.displayName = name;
|
|
|
|
|
|
|
|
status = dmxAttachScreen(stuff->physicalScreen, &attr);
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
free(name);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXAddScreenReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = status,
|
|
|
|
.physicalScreen = stuff->physicalScreen
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
|
|
|
swapl(&rep.physicalScreen);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXAddScreenReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXRemoveScreen(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXRemoveScreenReq);
|
|
|
|
xDMXRemoveScreenReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
int status = 0;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
|
|
|
|
|
|
|
|
status = dmxDetachScreen(stuff->physicalScreen);
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXRemoveScreenReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = status
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXRemoveScreenReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
dmxPopulatePanoramiX(ClientPtr client, Window window,
|
|
|
|
CARD32 *screens, CARD32 *windows,
|
|
|
|
xRectangle *pos, xRectangle *vis)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
WindowPtr pWin;
|
|
|
|
PanoramiXRes *win;
|
|
|
|
int i;
|
|
|
|
int count = 0;
|
2006-11-26 11:13:41 -07:00
|
|
|
DMXWindowAttributesRec attr;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
|
|
|
if (Success != dixLookupResourceByType((pointer *) &win,
|
|
|
|
window, XRT_WINDOW,
|
|
|
|
client, DixReadAccess))
|
|
|
|
return -1; /* BadWindow */
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
FOR_NSCREENS(i) {
|
2007-11-24 10:55:21 -07:00
|
|
|
if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
|
2012-06-10 07:21:05 -06:00
|
|
|
DixReadAccess))
|
2006-11-26 11:13:41 -07:00
|
|
|
return -1; /* BadWindow */
|
|
|
|
if (dmxGetWindowAttributes(pWin, &attr)) {
|
|
|
|
screens[count] = attr.screen;
|
|
|
|
windows[count] = attr.window;
|
2012-06-10 07:21:05 -06:00
|
|
|
pos[count] = attr.pos;
|
|
|
|
vis[count] = attr.vis;
|
2006-11-26 11:13:41 -07:00
|
|
|
++count; /* Only count existing windows */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
|
|
|
|
CARD32 *windows, xRectangle *pos, xRectangle *vis)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
WindowPtr pWin;
|
2006-11-26 11:13:41 -07:00
|
|
|
DMXWindowAttributesRec attr;
|
|
|
|
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension)
|
2012-06-10 07:21:05 -06:00
|
|
|
return dmxPopulatePanoramiX(client, window, screens, windows, pos, vis);
|
2006-11-26 11:13:41 -07:00
|
|
|
#endif
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2007-11-24 10:55:21 -07:00
|
|
|
if (Success != dixLookupWindow(&pWin, window, client, DixReadAccess))
|
2012-06-10 07:21:05 -06:00
|
|
|
return -1; /* BadWindow */
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
dmxGetWindowAttributes(pWin, &attr);
|
|
|
|
*screens = attr.screen;
|
|
|
|
*windows = attr.window;
|
2012-06-10 07:21:05 -06:00
|
|
|
*pos = attr.pos;
|
|
|
|
*vis = attr.vis;
|
2006-11-26 11:13:41 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
dmxMaxNumScreens(void)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
#ifdef PANORAMIX
|
2012-06-10 07:21:05 -06:00
|
|
|
if (!noPanoramiXExtension)
|
|
|
|
return PanoramiXNumScreens;
|
2006-11-26 11:13:41 -07:00
|
|
|
#endif
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXGetWindowAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetWindowAttributesReq);
|
|
|
|
xDMXGetWindowAttributesReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
|
|
|
CARD32 *screens;
|
|
|
|
CARD32 *windows;
|
|
|
|
xRectangle *pos, *vis;
|
|
|
|
int count = dmxMaxNumScreens();
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(screens = malloc(count * sizeof(*screens))))
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(windows = malloc(count * sizeof(*windows)))) {
|
|
|
|
free(screens);
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(pos = malloc(count * sizeof(*pos)))) {
|
|
|
|
free(windows);
|
|
|
|
free(screens);
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
|
|
|
}
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(vis = malloc(count * sizeof(*vis)))) {
|
|
|
|
free(pos);
|
|
|
|
free(windows);
|
|
|
|
free(screens);
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((count = dmxPopulate(client, stuff->window, screens, windows,
|
|
|
|
pos, vis)) < 0) {
|
2010-12-05 08:36:02 -07:00
|
|
|
free(vis);
|
|
|
|
free(pos);
|
|
|
|
free(windows);
|
|
|
|
free(screens);
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadWindow;
|
|
|
|
}
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXGetWindowAttributesReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = count * 6,
|
|
|
|
.screenCount = count
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.screenCount);
|
2006-11-26 11:13:41 -07:00
|
|
|
for (i = 0; i < count; i++) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&screens[i]);
|
|
|
|
swapl(&windows[i]);
|
|
|
|
|
|
|
|
swaps(&pos[i].x);
|
|
|
|
swaps(&pos[i].y);
|
|
|
|
swaps(&pos[i].width);
|
|
|
|
swaps(&pos[i].height);
|
|
|
|
|
|
|
|
swaps(&vis[i].x);
|
|
|
|
swaps(&vis[i].y);
|
|
|
|
swaps(&vis[i].width);
|
|
|
|
swaps(&vis[i].height);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dmxFlushPendingSyncs();
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), &rep);
|
2006-11-26 11:13:41 -07:00
|
|
|
if (count) {
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, count * sizeof(*screens), screens);
|
|
|
|
WriteToClient(client, count * sizeof(*windows), windows);
|
|
|
|
WriteToClient(client, count * sizeof(*pos), pos);
|
|
|
|
WriteToClient(client, count * sizeof(*vis), vis);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
free(vis);
|
|
|
|
free(pos);
|
|
|
|
free(windows);
|
|
|
|
free(screens);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXGetDesktopAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xDMXGetDesktopAttributesReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
DMXDesktopAttributesRec attr;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
|
|
|
|
|
|
|
|
dmxGetDesktopAttributes(&attr);
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXGetDesktopAttributesReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.width = attr.width,
|
|
|
|
.height = attr.height,
|
|
|
|
.shiftX = attr.shiftX,
|
|
|
|
.shiftY = attr.shiftY
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swaps(&rep.width);
|
|
|
|
swaps(&rep.height);
|
|
|
|
swaps(&rep.shiftX);
|
|
|
|
swaps(&rep.shiftY);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXChangeDesktopAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXChangeDesktopAttributesReq);
|
|
|
|
xDMXChangeDesktopAttributesReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
int status = DMX_BAD_XINERAMA;
|
|
|
|
CARD32 *value_list;
|
|
|
|
DMXDesktopAttributesRec attr;
|
|
|
|
int len;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
|
|
|
|
len = client->req_len - (sizeof(xDMXChangeDesktopAttributesReq) >> 2);
|
|
|
|
if (len != Ones(stuff->valueMask))
|
|
|
|
return BadLength;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (!_DMXXineramaActive())
|
|
|
|
goto noxinerama;
|
|
|
|
|
|
|
|
value_list = (CARD32 *) (stuff + 1);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
dmxGetDesktopAttributes(&attr);
|
|
|
|
dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list);
|
|
|
|
|
|
|
|
#if PANORAMIX
|
|
|
|
status = dmxConfigureDesktop(&attr);
|
|
|
|
#endif
|
2012-06-10 07:21:05 -06:00
|
|
|
if (status == BadValue)
|
|
|
|
return status;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
noxinerama:
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXChangeDesktopAttributesReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = status
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXChangeDesktopAttributesReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXGetInputCount(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
xDMXGetInputCountReply rep;
|
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
|
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXGetInputCountReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.inputCount = dmxGetInputCount()
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.inputCount);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXGetInputCountReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXGetInputAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetInputAttributesReq);
|
|
|
|
xDMXGetInputAttributesReply rep;
|
2012-06-10 07:21:05 -06:00
|
|
|
int length;
|
|
|
|
int paddedLength;
|
|
|
|
DMXInputAttributesRec attr;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (dmxGetInputAttributes(stuff->deviceId, &attr))
|
|
|
|
return BadValue;
|
|
|
|
|
|
|
|
length = attr.name ? strlen(attr.name) : 0;
|
|
|
|
paddedLength = pad_to_int32(length);
|
2013-06-07 11:28:45 -06:00
|
|
|
|
|
|
|
rep = (xDMXGetInputAttributesReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = bytes_to_int32(paddedLength),
|
|
|
|
|
|
|
|
.inputType = attr.inputType,
|
|
|
|
.physicalScreen = attr.physicalScreen,
|
|
|
|
.physicalId = attr.physicalId,
|
|
|
|
.nameLength = length,
|
|
|
|
.isCore = attr.isCore,
|
|
|
|
.sendsCore = attr.sendsCore,
|
|
|
|
.detached = attr.detached
|
|
|
|
};
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.inputType);
|
|
|
|
swapl(&rep.physicalScreen);
|
|
|
|
swapl(&rep.physicalId);
|
|
|
|
swapl(&rep.nameLength);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXGetInputAttributesReply), &rep);
|
2012-06-10 07:21:05 -06:00
|
|
|
if (length)
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, length, attr.name);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXAddInput(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXAddInputReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
xDMXAddInputReply rep;
|
|
|
|
int status = 0;
|
|
|
|
CARD32 *value_list;
|
|
|
|
DMXInputAttributesRec attr;
|
|
|
|
int count;
|
|
|
|
char *name;
|
|
|
|
int len;
|
|
|
|
int paddedLength;
|
|
|
|
int id = -1;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
|
2010-07-27 13:02:24 -06:00
|
|
|
paddedLength = pad_to_int32(stuff->displayNameLength);
|
2012-06-10 07:21:05 -06:00
|
|
|
len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
|
|
|
|
if (len != Ones(stuff->valueMask) + paddedLength / 4)
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadLength;
|
|
|
|
|
|
|
|
memset(&attr, 0, sizeof(attr));
|
2012-06-10 07:21:05 -06:00
|
|
|
value_list = (CARD32 *) (stuff + 1);
|
|
|
|
count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list);
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
|
2006-11-26 11:13:41 -07:00
|
|
|
return BadAlloc;
|
|
|
|
memcpy(name, &value_list[count], stuff->displayNameLength);
|
|
|
|
name[stuff->displayNameLength] = '\0';
|
|
|
|
attr.name = name;
|
|
|
|
|
|
|
|
status = dmxAddInput(&attr, &id);
|
|
|
|
|
2010-12-05 08:36:02 -07:00
|
|
|
free(name);
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (status)
|
|
|
|
return status;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXAddInputReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = status,
|
|
|
|
.physicalId = id
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
|
|
|
swapl(&rep.physicalId);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXAddInputReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXRemoveInput(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXRemoveInputReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
xDMXRemoveInputReply rep;
|
|
|
|
int status = 0;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
|
|
|
REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
|
|
|
|
|
|
|
|
status = dmxRemoveInput(stuff->physicalId);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
if (status)
|
|
|
|
return status;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2013-06-07 11:28:45 -06:00
|
|
|
rep = (xDMXRemoveInputReply) {
|
|
|
|
.type = X_Reply,
|
|
|
|
.sequenceNumber = client->sequence,
|
|
|
|
.length = 0,
|
|
|
|
.status = status
|
|
|
|
};
|
2006-11-26 11:13:41 -07:00
|
|
|
if (client->swapped) {
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&rep.sequenceNumber);
|
|
|
|
swapl(&rep.length);
|
|
|
|
swapl(&rep.status);
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
2013-06-07 11:28:45 -06:00
|
|
|
WriteToClient(client, sizeof(xDMXRemoveInputReply), &rep);
|
2010-12-05 08:36:02 -07:00
|
|
|
return Success;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
ProcDMXDispatch(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
|
|
|
|
|
|
|
switch (stuff->data) {
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_DMXQueryVersion:
|
|
|
|
return ProcDMXQueryVersion(client);
|
|
|
|
case X_DMXSync:
|
|
|
|
return ProcDMXSync(client);
|
|
|
|
case X_DMXForceWindowCreation:
|
|
|
|
return ProcDMXForceWindowCreation(client);
|
|
|
|
case X_DMXGetScreenCount:
|
|
|
|
return ProcDMXGetScreenCount(client);
|
|
|
|
case X_DMXGetScreenAttributes:
|
|
|
|
return ProcDMXGetScreenAttributes(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_DMXChangeScreensAttributes:
|
|
|
|
return ProcDMXChangeScreensAttributes(client);
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_DMXAddScreen:
|
|
|
|
return ProcDMXAddScreen(client);
|
|
|
|
case X_DMXRemoveScreen:
|
|
|
|
return ProcDMXRemoveScreen(client);
|
|
|
|
case X_DMXGetWindowAttributes:
|
|
|
|
return ProcDMXGetWindowAttributes(client);
|
|
|
|
case X_DMXGetDesktopAttributes:
|
|
|
|
return ProcDMXGetDesktopAttributes(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_DMXChangeDesktopAttributes:
|
|
|
|
return ProcDMXChangeDesktopAttributes(client);
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_DMXGetInputCount:
|
|
|
|
return ProcDMXGetInputCount(client);
|
|
|
|
case X_DMXGetInputAttributes:
|
|
|
|
return ProcDMXGetInputAttributes(client);
|
|
|
|
case X_DMXAddInput:
|
|
|
|
return ProcDMXAddInput(client);
|
|
|
|
case X_DMXRemoveInput:
|
|
|
|
return ProcDMXRemoveInput(client);
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_DMXGetScreenInformationDEPRECATED:
|
|
|
|
case X_DMXForceWindowCreationDEPRECATED:
|
|
|
|
case X_DMXReconfigureScreenDEPRECATED:
|
|
|
|
return BadImplementation;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
default:
|
|
|
|
return BadRequest;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXQueryVersion(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXQueryVersionReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
|
|
|
|
return ProcDMXQueryVersion(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXSync(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXSyncReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXSyncReq);
|
|
|
|
return ProcDMXSync(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXForceWindowCreation(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXForceWindowCreationReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXForceWindowCreation(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXGetScreenCount(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetScreenCountReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
|
|
|
|
return ProcDMXGetScreenCount(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXGetScreenAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetScreenAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->physicalScreen);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXGetScreenAttributes(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXChangeScreensAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXChangeScreensAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->screenCount);
|
|
|
|
swapl(&stuff->maskCount);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
|
|
|
return ProcDMXGetScreenAttributes(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXAddScreen(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int paddedLength;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST(xDMXAddScreenReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->displayNameLength);
|
|
|
|
swapl(&stuff->valueMask);
|
2010-07-27 13:02:24 -06:00
|
|
|
paddedLength = pad_to_int32(stuff->displayNameLength);
|
2012-06-10 07:21:05 -06:00
|
|
|
SwapLongs((CARD32 *) (stuff + 1), LengthRestL(stuff) - paddedLength / 4);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXAddScreen(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXRemoveScreen(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXRemoveScreenReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->physicalScreen);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXRemoveScreen(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXGetWindowAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetWindowAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->window);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXGetWindowAttributes(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXGetDesktopAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetDesktopAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
|
|
|
|
return ProcDMXGetDesktopAttributes(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXChangeDesktopAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXChangeDesktopAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->valueMask);
|
2006-11-26 11:13:41 -07:00
|
|
|
SwapRestL(stuff);
|
|
|
|
return ProcDMXChangeDesktopAttributes(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXGetInputCount(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetInputCountReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
|
|
|
|
return ProcDMXGetInputCount(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXGetInputAttributes(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXGetInputAttributesReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->deviceId);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXGetInputAttributes(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXAddInput(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
int paddedLength;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST(xDMXAddInputReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->displayNameLength);
|
|
|
|
swapl(&stuff->valueMask);
|
2010-07-27 13:02:24 -06:00
|
|
|
paddedLength = pad_to_int32(stuff->displayNameLength);
|
2012-06-10 07:21:05 -06:00
|
|
|
SwapLongs((CARD32 *) (stuff + 1), LengthRestL(stuff) - paddedLength / 4);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXAddInput(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXRemoveInput(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xDMXRemoveInputReq);
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
swaps(&stuff->length);
|
2006-11-26 11:13:41 -07:00
|
|
|
REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
|
2012-06-10 07:21:05 -06:00
|
|
|
swapl(&stuff->physicalId);
|
2006-11-26 11:13:41 -07:00
|
|
|
return ProcDMXRemoveInput(client);
|
|
|
|
}
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
static int
|
|
|
|
SProcDMXDispatch(ClientPtr client)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
|
|
|
REQUEST(xReq);
|
|
|
|
|
|
|
|
switch (stuff->data) {
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_DMXQueryVersion:
|
|
|
|
return SProcDMXQueryVersion(client);
|
|
|
|
case X_DMXSync:
|
|
|
|
return SProcDMXSync(client);
|
|
|
|
case X_DMXForceWindowCreation:
|
|
|
|
return SProcDMXForceWindowCreation(client);
|
|
|
|
case X_DMXGetScreenCount:
|
|
|
|
return SProcDMXGetScreenCount(client);
|
|
|
|
case X_DMXGetScreenAttributes:
|
|
|
|
return SProcDMXGetScreenAttributes(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_DMXChangeScreensAttributes:
|
|
|
|
return SProcDMXChangeScreensAttributes(client);
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_DMXAddScreen:
|
|
|
|
return SProcDMXAddScreen(client);
|
|
|
|
case X_DMXRemoveScreen:
|
|
|
|
return SProcDMXRemoveScreen(client);
|
|
|
|
case X_DMXGetWindowAttributes:
|
|
|
|
return SProcDMXGetWindowAttributes(client);
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_DMXGetDesktopAttributes:
|
|
|
|
return SProcDMXGetDesktopAttributes(client);
|
|
|
|
case X_DMXChangeDesktopAttributes:
|
|
|
|
return SProcDMXChangeDesktopAttributes(client);
|
2012-06-10 07:21:05 -06:00
|
|
|
case X_DMXGetInputCount:
|
|
|
|
return SProcDMXGetInputCount(client);
|
|
|
|
case X_DMXGetInputAttributes:
|
|
|
|
return SProcDMXGetInputAttributes(client);
|
|
|
|
case X_DMXAddInput:
|
|
|
|
return SProcDMXAddInput(client);
|
|
|
|
case X_DMXRemoveInput:
|
|
|
|
return SProcDMXRemoveInput(client);
|
|
|
|
|
2006-11-26 11:13:41 -07:00
|
|
|
case X_DMXGetScreenInformationDEPRECATED:
|
|
|
|
case X_DMXForceWindowCreationDEPRECATED:
|
|
|
|
case X_DMXReconfigureScreenDEPRECATED:
|
|
|
|
return BadImplementation;
|
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
default:
|
|
|
|
return BadRequest;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
}
|
2011-11-05 07:32:40 -06:00
|
|
|
|
|
|
|
/** Initialize the extension. */
|
2012-06-10 07:21:05 -06:00
|
|
|
void
|
|
|
|
DMXExtensionInit(void)
|
2011-11-05 07:32:40 -06:00
|
|
|
{
|
|
|
|
ExtensionEntry *extEntry;
|
2012-06-10 07:21:05 -06:00
|
|
|
|
2011-11-05 07:32:40 -06:00
|
|
|
if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
|
|
|
|
ProcDMXDispatch, SProcDMXDispatch,
|
|
|
|
NULL, StandardMinorOpcode)))
|
2012-06-10 07:21:05 -06:00
|
|
|
DMXCode = extEntry->base;
|
2011-11-05 07:32:40 -06:00
|
|
|
}
|