Xi: remove all new XI2 protocol requests and their handling.
This commit reverts to XI 1.4 requests, plus the input device property requests. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
This commit is contained in:
parent
db115e7870
commit
cfe7301bcf
|
@ -5,12 +5,8 @@ AM_CFLAGS = $(DIX_CFLAGS)
|
|||
libXi_la_SOURCES = \
|
||||
allowev.c \
|
||||
allowev.h \
|
||||
chdevcur.c \
|
||||
chdevcur.h \
|
||||
chgdctl.c \
|
||||
chgdctl.h \
|
||||
chdevhier.c \
|
||||
chdevhier.h \
|
||||
chgfctl.c \
|
||||
chgfctl.h \
|
||||
chgkbd.c \
|
||||
|
@ -27,13 +23,9 @@ libXi_la_SOURCES = \
|
|||
devbell.h \
|
||||
exevents.c \
|
||||
exglobals.h \
|
||||
extgrbdev.c \
|
||||
extgrbdev.h \
|
||||
extinit.c \
|
||||
getbmap.c \
|
||||
getbmap.h \
|
||||
getcptr.c \
|
||||
getcptr.h \
|
||||
getdctl.c \
|
||||
getdctl.h \
|
||||
getfctl.c \
|
||||
|
@ -62,8 +54,6 @@ libXi_la_SOURCES = \
|
|||
listdev.h \
|
||||
opendev.c \
|
||||
opendev.h \
|
||||
querydp.c \
|
||||
querydp.h \
|
||||
queryst.c \
|
||||
queryst.h \
|
||||
selectev.c \
|
||||
|
@ -72,8 +62,6 @@ libXi_la_SOURCES = \
|
|||
sendexev.h \
|
||||
setbmap.c \
|
||||
setbmap.h \
|
||||
setcptr.c \
|
||||
setcptr.h \
|
||||
setdval.c \
|
||||
setdval.h \
|
||||
setfocus.c \
|
||||
|
@ -88,11 +76,7 @@ libXi_la_SOURCES = \
|
|||
ungrdevb.h \
|
||||
ungrdevk.c \
|
||||
ungrdevk.h \
|
||||
warpdevp.c \
|
||||
warpdevp.h \
|
||||
xiproperty.c \
|
||||
xiproperty.h \
|
||||
xiselev.c \
|
||||
xiselev.h
|
||||
xiproperty.h
|
||||
|
||||
EXTRA_DIST = stubs.c
|
||||
|
|
111
Xi/chdevcur.c
111
Xi/chdevcur.c
|
@ -1,111 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request to change a given device pointer's cursor.
|
||||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "input.h"
|
||||
|
||||
#include "chdevcur.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows a client to set one pointer's cursor.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
SProcXChangeDeviceCursor(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceCursorReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
|
||||
return (ProcXChangeDeviceCursor(client));
|
||||
}
|
||||
|
||||
int ProcXChangeDeviceCursor(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
WindowPtr pWin = NULL;
|
||||
DeviceIntPtr pDev = NULL;
|
||||
CursorPtr pCursor = NULL;
|
||||
|
||||
REQUEST(xChangeDeviceCursorReq);
|
||||
REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (stuff->win != None)
|
||||
{
|
||||
rc = dixLookupWindow(&pWin, stuff->win, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (stuff->cursor == None)
|
||||
{
|
||||
if (pWin == WindowTable[pWin->drawable.pScreen->myNum])
|
||||
pCursor = rootCursor;
|
||||
else
|
||||
pCursor = (CursorPtr)None;
|
||||
}
|
||||
else
|
||||
{
|
||||
pCursor = (CursorPtr)SecurityLookupIDByType(client, stuff->cursor,
|
||||
RT_CURSOR, DixReadAccess);
|
||||
if (!pCursor)
|
||||
{
|
||||
return BadCursor;
|
||||
}
|
||||
}
|
||||
|
||||
ChangeWindowDeviceCursor(pWin, pDev, pCursor);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef CHDEVCUR_H
|
||||
#define CHDEVCUR_H 1
|
||||
|
||||
int SProcXChangeDeviceCursor(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXChangeDeviceCursor(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* CHDEVCUR_H */
|
305
Xi/chdevhier.c
305
Xi/chdevhier.c
|
@ -1,305 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request change in the device hierarchy.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "geext.h"
|
||||
#include "xace.h"
|
||||
|
||||
#include "chdevhier.h"
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows a client to change the device hierarchy through
|
||||
* adding new master devices, removing them, etc.
|
||||
*
|
||||
*/
|
||||
|
||||
int SProcXChangeDeviceHierarchy(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceHierarchyReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXChangeDeviceHierarchy(client));
|
||||
}
|
||||
|
||||
#define SWAPIF(cmd) if (client->swapped) { cmd; }
|
||||
|
||||
int
|
||||
ProcXChangeDeviceHierarchy(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr ptr, keybd;
|
||||
DeviceIntRec dummyDev;
|
||||
xAnyHierarchyChangeInfo *any;
|
||||
int required_len = sizeof(xChangeDeviceHierarchyReq);
|
||||
char n;
|
||||
int rc = Success;
|
||||
int nchanges = 0;
|
||||
deviceHierarchyChangedEvent ev;
|
||||
|
||||
REQUEST(xChangeDeviceHierarchyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceHierarchyReq);
|
||||
|
||||
any = (xAnyHierarchyChangeInfo*)&stuff[1];
|
||||
while(stuff->num_changes--)
|
||||
{
|
||||
SWAPIF(swapl(&any->type, n));
|
||||
SWAPIF(swaps(&any->length, n));
|
||||
|
||||
required_len += any->length;
|
||||
if ((stuff->length * 4) < required_len)
|
||||
return BadLength;
|
||||
|
||||
switch(any->type)
|
||||
{
|
||||
case CH_CreateMasterDevice:
|
||||
{
|
||||
xCreateMasterInfo* c = (xCreateMasterInfo*)any;
|
||||
char* name;
|
||||
|
||||
SWAPIF(swaps(&c->namelen, n));
|
||||
name = xcalloc(c->namelen + 1, sizeof(char));
|
||||
strncpy(name, (char*)&c[1], c->namelen);
|
||||
|
||||
|
||||
rc = AllocMasterDevice(client, name, &ptr, &keybd);
|
||||
if (rc != Success)
|
||||
{
|
||||
xfree(name);
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
if (!c->sendCore)
|
||||
ptr->coreEvents = keybd->coreEvents = FALSE;
|
||||
|
||||
ActivateDevice(ptr);
|
||||
ActivateDevice(keybd);
|
||||
|
||||
if (c->enable)
|
||||
{
|
||||
EnableDevice(ptr);
|
||||
EnableDevice(keybd);
|
||||
}
|
||||
xfree(name);
|
||||
nchanges++;
|
||||
}
|
||||
break;
|
||||
case CH_RemoveMasterDevice:
|
||||
{
|
||||
xRemoveMasterInfo* r = (xRemoveMasterInfo*)any;
|
||||
|
||||
if (r->returnMode != AttachToMaster &&
|
||||
r->returnMode != Floating)
|
||||
return BadValue;
|
||||
|
||||
rc = dixLookupDevice(&ptr, r->deviceid, client,
|
||||
DixDestroyAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!ptr->isMaster)
|
||||
{
|
||||
client->errorValue = r->deviceid;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
/* XXX: For now, don't allow removal of VCP, VCK */
|
||||
if (ptr == inputInfo.pointer ||
|
||||
ptr == inputInfo.keyboard)
|
||||
{
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
/* disable keyboards first */
|
||||
if (IsPointerDevice(ptr))
|
||||
{
|
||||
rc = dixLookupDevice(&keybd,
|
||||
ptr->spriteInfo->paired->id,
|
||||
client,
|
||||
DixDestroyAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
}
|
||||
else
|
||||
{
|
||||
keybd = ptr;
|
||||
rc = dixLookupDevice(&ptr,
|
||||
keybd->spriteInfo->paired->id,
|
||||
client,
|
||||
DixDestroyAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
|
||||
/* Disabling sends the devices floating, reattach them if
|
||||
* desired. */
|
||||
if (r->returnMode == AttachToMaster)
|
||||
{
|
||||
DeviceIntPtr attached,
|
||||
newptr,
|
||||
newkeybd;
|
||||
|
||||
rc = dixLookupDevice(&newptr, r->returnPointer,
|
||||
client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!newptr->isMaster)
|
||||
{
|
||||
client->errorValue = r->returnPointer;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
rc = dixLookupDevice(&newkeybd, r->returnKeyboard,
|
||||
client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!newkeybd->isMaster)
|
||||
{
|
||||
client->errorValue = r->returnKeyboard;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
for (attached = inputInfo.devices;
|
||||
attached;
|
||||
attached = attached->next)
|
||||
{
|
||||
if (!attached->isMaster) {
|
||||
if (attached->u.master == ptr)
|
||||
AttachDevice(client, attached, newptr);
|
||||
if (attached->u.master == keybd)
|
||||
AttachDevice(client, attached, newkeybd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* can't disable until we removed pairing */
|
||||
keybd->spriteInfo->paired = NULL;
|
||||
ptr->spriteInfo->paired = NULL;
|
||||
DisableDevice(keybd);
|
||||
DisableDevice(ptr);
|
||||
|
||||
RemoveDevice(keybd);
|
||||
RemoveDevice(ptr);
|
||||
nchanges++;
|
||||
}
|
||||
break;
|
||||
case CH_ChangeAttachment:
|
||||
{
|
||||
xChangeAttachmentInfo* c = (xChangeAttachmentInfo*)any;
|
||||
|
||||
rc = dixLookupDevice(&ptr, c->deviceid, client,
|
||||
DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (ptr->isMaster)
|
||||
{
|
||||
client->errorValue = c->deviceid;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
if (c->changeMode == Floating)
|
||||
AttachDevice(client, ptr, NULL);
|
||||
else
|
||||
{
|
||||
DeviceIntPtr newmaster;
|
||||
rc = dixLookupDevice(&newmaster, c->newMaster,
|
||||
client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
if (!newmaster->isMaster)
|
||||
{
|
||||
client->errorValue = c->newMaster;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
if (!((IsPointerDevice(newmaster) &&
|
||||
IsPointerDevice(ptr)) ||
|
||||
(IsKeyboardDevice(newmaster) &&
|
||||
IsKeyboardDevice(ptr))))
|
||||
{
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
AttachDevice(client, ptr, newmaster);
|
||||
}
|
||||
nchanges++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
any = (xAnyHierarchyChangeInfo*)((char*)any + any->length);
|
||||
}
|
||||
|
||||
unwind:
|
||||
|
||||
if (nchanges > 0) /* even if an error occured, we need to send an event if
|
||||
we changed anything in the hierarchy. */
|
||||
{
|
||||
ev.type = GenericEvent;
|
||||
ev.extension = IReqCode;
|
||||
ev.length = 0;
|
||||
ev.evtype = XI_DeviceHierarchyChangedNotify;
|
||||
ev.time = GetTimeInMillis();
|
||||
|
||||
SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
|
||||
(xEvent*)&ev, 1);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request change in the device hierarchy.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef CHDEVHIER_H
|
||||
#define CHDEVHIER_H 1
|
||||
|
||||
int SProcXChangeDeviceHierarchy(ClientPtr /* client */);
|
||||
int ProcXChangeDeviceHierarchy(ClientPtr /* client */);
|
||||
|
||||
#endif
|
216
Xi/extgrbdev.c
216
Xi/extgrbdev.c
|
@ -1,216 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request to fake data for a given device.
|
||||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/Xge.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "grabdev.h" /* CreateMaskFromList */
|
||||
|
||||
#include "extgrbdev.h"
|
||||
|
||||
int
|
||||
SProcXExtendedGrabDevice(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
int i;
|
||||
long* p;
|
||||
|
||||
REQUEST(xExtendedGrabDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xExtendedGrabDeviceReq);
|
||||
|
||||
swapl(&stuff->grab_window, n);
|
||||
swapl(&stuff->time, n);
|
||||
swapl(&stuff->confine_to, n);
|
||||
swapl(&stuff->cursor, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
swaps(&stuff->generic_event_count, n);
|
||||
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
|
||||
for (i = 0; i < stuff->generic_event_count; i++) {
|
||||
p++; /* first 4 bytes are extension type and padding */
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
|
||||
return ProcXExtendedGrabDevice(client);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ProcXExtendedGrabDevice(ClientPtr client)
|
||||
{
|
||||
xExtendedGrabDeviceReply rep;
|
||||
DeviceIntPtr dev;
|
||||
int rc = Success,
|
||||
errval = 0,
|
||||
i;
|
||||
WindowPtr grab_window,
|
||||
confineTo = 0;
|
||||
CursorPtr cursor = NULL;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
TimeStamp time;
|
||||
XGenericEventMask* xgeMask;
|
||||
GenericMaskPtr gemasks = NULL;
|
||||
|
||||
REQUEST(xExtendedGrabDeviceReq);
|
||||
REQUEST_AT_LEAST_SIZE(xExtendedGrabDeviceReq);
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_ExtendedGrabDevice;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.length = 0;
|
||||
|
||||
if (stuff->length != (sizeof(xExtendedGrabDeviceReq) >> 2) +
|
||||
stuff->event_count + 2 * stuff->generic_event_count)
|
||||
{
|
||||
errval = 0;
|
||||
rc = BadLength;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||
if (rc != Success) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
rc = dixLookupWindow(&grab_window,
|
||||
stuff->grab_window,
|
||||
client,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
errval = stuff->grab_window;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (stuff->confine_to)
|
||||
{
|
||||
rc = dixLookupWindow(&confineTo,
|
||||
stuff->confine_to,
|
||||
client,
|
||||
DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
errval = stuff->confine_to;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (stuff->cursor)
|
||||
{
|
||||
cursor = (CursorPtr)SecurityLookupIDByType(client,
|
||||
stuff->cursor,
|
||||
RT_CURSOR,
|
||||
DixReadAccess);
|
||||
if (!cursor)
|
||||
{
|
||||
errval = stuff->cursor;
|
||||
rc = BadCursor;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
if (CreateMaskFromList(client,
|
||||
(XEventClass*)&stuff[1],
|
||||
stuff->event_count,
|
||||
tmp,
|
||||
dev,
|
||||
X_GrabDevice) != Success)
|
||||
return Success;
|
||||
|
||||
time = ClientTimeToServerTime(stuff->time);
|
||||
|
||||
if (stuff->generic_event_count)
|
||||
{
|
||||
xgeMask =
|
||||
(XGenericEventMask*)(((XEventClass*)&stuff[1]) + stuff->event_count);
|
||||
|
||||
gemasks = xcalloc(1, sizeof(GenericMaskRec));
|
||||
gemasks->resource = FakeClientID(client->index);
|
||||
gemasks->next = NULL;
|
||||
gemasks->eventMask[xgeMask->extension & 0x7F] = xgeMask->evmask;
|
||||
|
||||
xgeMask++;
|
||||
for (i = 1; i < stuff->generic_event_count; i++, xgeMask++)
|
||||
gemasks->eventMask[xgeMask->extension & 0x7F]= xgeMask->evmask;
|
||||
}
|
||||
|
||||
rep.status = ExtGrabDevice(client, dev, stuff->device_mode,
|
||||
grab_window, confineTo, time,
|
||||
stuff->owner_events, cursor,
|
||||
tmp[stuff->deviceid].mask,
|
||||
gemasks);
|
||||
cleanup:
|
||||
|
||||
if (gemasks)
|
||||
xfree(gemasks);
|
||||
|
||||
if (rc == Success)
|
||||
{
|
||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
||||
}
|
||||
else
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
SRepXExtendedGrabDevice(ClientPtr client, int size,
|
||||
xExtendedGrabDeviceReply* rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swaps(&rep->length, n);
|
||||
WriteToClient(client, size, (char*)rep);
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef EXTGRBDEV_H
|
||||
#define EXTGRBDEV_H 1
|
||||
|
||||
int SProcXExtendedGrabDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXExtendedGrabDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXExtendedGrabDevice(ClientPtr client,
|
||||
int size,
|
||||
xExtendedGrabDeviceReply* rep);
|
||||
|
||||
#endif /* EXTGRBDEV_H */
|
39
Xi/extinit.c
39
Xi/extinit.c
|
@ -76,19 +76,15 @@ SOFTWARE.
|
|||
|
||||
/* modules local to Xi */
|
||||
#include "allowev.h"
|
||||
#include "chdevcur.h"
|
||||
#include "chgdctl.h"
|
||||
#include "chdevhier.h"
|
||||
#include "chgfctl.h"
|
||||
#include "chgkbd.h"
|
||||
#include "chgprop.h"
|
||||
#include "chgptr.h"
|
||||
#include "closedev.h"
|
||||
#include "extgrbdev.h"
|
||||
#include "devbell.h"
|
||||
#include "getbmap.h"
|
||||
#include "getbmap.h"
|
||||
#include "getcptr.h"
|
||||
#include "getdctl.h"
|
||||
#include "getfctl.h"
|
||||
#include "getfocus.h"
|
||||
|
@ -104,13 +100,11 @@ SOFTWARE.
|
|||
#include "gtmotion.h"
|
||||
#include "listdev.h"
|
||||
#include "opendev.h"
|
||||
#include "querydp.h"
|
||||
#include "queryst.h"
|
||||
#include "selectev.h"
|
||||
#include "sendexev.h"
|
||||
#include "chgkmap.h"
|
||||
#include "setbmap.h"
|
||||
#include "setcptr.h"
|
||||
#include "setdval.h"
|
||||
#include "setfocus.h"
|
||||
#include "setmmap.h"
|
||||
|
@ -118,8 +112,6 @@ SOFTWARE.
|
|||
#include "ungrdev.h"
|
||||
#include "ungrdevb.h"
|
||||
#include "ungrdevk.h"
|
||||
#include "warpdevp.h"
|
||||
#include "xiselev.h"
|
||||
#include "xiproperty.h"
|
||||
|
||||
|
||||
|
@ -134,8 +126,7 @@ Mask ExtExclusiveMasks[EMASKSIZE];
|
|||
* Evtype is index, mask is value at index.
|
||||
*/
|
||||
static Mask xi_filters[4] = {
|
||||
XI_DeviceHierarchyChangedMask,
|
||||
XI_DeviceClassesChangedMask,
|
||||
XI_DeviceClassesChangedMask
|
||||
};
|
||||
|
||||
static struct dev_type
|
||||
|
@ -211,16 +202,7 @@ static int (*ProcIVector[])(ClientPtr) = {
|
|||
ProcXListDeviceProperties, /* 36 */
|
||||
ProcXChangeDeviceProperty, /* 37 */
|
||||
ProcXDeleteDeviceProperty, /* 38 */
|
||||
ProcXGetDeviceProperty, /* 39 */
|
||||
/* XI 2 */
|
||||
ProcXQueryDevicePointer, /* 40 */
|
||||
ProcXWarpDevicePointer, /* 41 */
|
||||
ProcXChangeDeviceCursor, /* 42 */
|
||||
ProcXChangeDeviceHierarchy, /* 43 */
|
||||
ProcXSetClientPointer, /* 44 */
|
||||
ProcXGetClientPointer, /* 45 */
|
||||
ProcXiSelectEvent, /* 46 */
|
||||
ProcXExtendedGrabDevice /* 47 */
|
||||
ProcXGetDeviceProperty /* 39 */
|
||||
};
|
||||
|
||||
/* For swapped clients */
|
||||
|
@ -264,15 +246,7 @@ static int (*SProcIVector[])(ClientPtr) = {
|
|||
SProcXListDeviceProperties, /* 36 */
|
||||
SProcXChangeDeviceProperty, /* 37 */
|
||||
SProcXDeleteDeviceProperty, /* 38 */
|
||||
SProcXGetDeviceProperty, /* 39 */
|
||||
SProcXQueryDevicePointer, /* 40 */
|
||||
SProcXWarpDevicePointer, /* 41 */
|
||||
SProcXChangeDeviceCursor, /* 42 */
|
||||
SProcXChangeDeviceHierarchy, /* 43 */
|
||||
SProcXSetClientPointer, /* 44 */
|
||||
SProcXGetClientPointer, /* 45 */
|
||||
SProcXiSelectEvent, /* 46 */
|
||||
SProcXExtendedGrabDevice /* 47 */
|
||||
SProcXGetDeviceProperty /* 39 */
|
||||
};
|
||||
|
||||
/*****************************************************************
|
||||
|
@ -472,13 +446,6 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
|||
SRepXListDeviceProperties(client, len, (xListDevicePropertiesReply*)rep);
|
||||
else if (rep->RepType == X_GetDeviceProperty)
|
||||
SRepXGetDeviceProperty(client, len, (xGetDevicePropertyReply *) rep);
|
||||
else if (rep->RepType == X_QueryDevicePointer)
|
||||
SRepXQueryDevicePointer(client, len,
|
||||
(xQueryDevicePointerReply *) rep);
|
||||
else if (rep->RepType == X_GetClientPointer)
|
||||
SRepXGetClientPointer(client, len, (xGetClientPointerReply*) rep);
|
||||
else if (rep->RepType == X_ExtendedGrabDevice)
|
||||
SRepXExtendedGrabDevice(client, len, (xExtendedGrabDeviceReply*) rep);
|
||||
else {
|
||||
FatalError("XINPUT confused sending swapped reply");
|
||||
}
|
||||
|
|
108
Xi/getcptr.c
108
Xi/getcptr.c
|
@ -1,108 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getcptr.h"
|
||||
|
||||
/***********************************************************************
|
||||
* This procedure allows a client to query another client's client pointer
|
||||
* setting.
|
||||
*/
|
||||
|
||||
int
|
||||
SProcXGetClientPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xGetClientPointerReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->win, n);
|
||||
return ProcXGetClientPointer(client);
|
||||
}
|
||||
|
||||
int ProcXGetClientPointer(ClientPtr client)
|
||||
{
|
||||
int err;
|
||||
WindowPtr win;
|
||||
ClientPtr winclient;
|
||||
xGetClientPointerReply rep;
|
||||
REQUEST(xGetClientPointerReq);
|
||||
REQUEST_SIZE_MATCH(xGetClientPointerReq);
|
||||
|
||||
err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetClientPointer,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
||||
winclient = wClient(win);
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetClientPointer;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.set = (winclient->clientPtr != NULL);
|
||||
rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xGetClientPointerReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XGetClientPointer function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXGetClientPointer(ClientPtr client, int size,
|
||||
xGetClientPointerReply* rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
43
Xi/getcptr.h
43
Xi/getcptr.h
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef GETCPTR_H
|
||||
#define GETCPTR_H 1
|
||||
int SProcXGetClientPointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetClientPointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXGetClientPointer(ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetClientPointerReply* /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETCPTR_H */
|
168
Xi/querydp.c
168
Xi/querydp.c
|
@ -1,168 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request to query the pointer location of an extension input device.
|
||||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#include "panoramiXsrv.h"
|
||||
#endif
|
||||
|
||||
#include "querydp.h"
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows a client to query the pointer of a device.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
SProcXQueryDevicePointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xQueryDevicePointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXQueryDevicePointer(client));
|
||||
}
|
||||
|
||||
int
|
||||
ProcXQueryDevicePointer(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
xQueryDevicePointerReply rep;
|
||||
DeviceIntPtr pDev, kbd;
|
||||
WindowPtr pWin, t;
|
||||
SpritePtr pSprite;
|
||||
|
||||
REQUEST(xQueryDevicePointerReq);
|
||||
REQUEST_SIZE_MATCH(xQueryDevicePointerReq);
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (pDev->valuator == NULL)
|
||||
{
|
||||
client->errorValue = stuff->deviceid;
|
||||
return BadDevice;
|
||||
}
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
|
||||
stuff->win, rc);
|
||||
return Success;
|
||||
}
|
||||
|
||||
if (pDev->valuator->motionHintWindow)
|
||||
MaybeStopHint(pDev, client);
|
||||
|
||||
kbd = GetPairedDevice(pDev);
|
||||
|
||||
pSprite = pDev->spriteInfo->sprite;
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_QueryDevicePointer;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.mask = pDev->button->state | (kbd && kbd->key) ? kbd->key->state : 0;
|
||||
rep.root = (GetCurrentRootWindow(pDev))->drawable.id;
|
||||
rep.rootX = pSprite->hot.x;
|
||||
rep.rootY = pSprite->hot.y;
|
||||
rep.child = None;
|
||||
rep.deviceid = pDev->id;
|
||||
|
||||
if (pSprite->hot.pScreen == pWin->drawable.pScreen)
|
||||
{
|
||||
rep.sameScreen = xTrue;
|
||||
rep.winX = pSprite->hot.x - pWin->drawable.x;
|
||||
rep.winY = pSprite->hot.y - pWin->drawable.y;
|
||||
for (t = pSprite->win; t; t = t->parent)
|
||||
if (t->parent == pWin)
|
||||
{
|
||||
rep.child = t->drawable.id;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
rep.sameScreen = xFalse;
|
||||
rep.winX = 0;
|
||||
rep.winY = 0;
|
||||
}
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if(!noPanoramiXExtension) {
|
||||
rep.rootX += panoramiXdataPtr[0].x;
|
||||
rep.rootY += panoramiXdataPtr[0].y;
|
||||
if (stuff->win == rep.root)
|
||||
{
|
||||
rep.winX += panoramiXdataPtr[0].x;
|
||||
rep.winY += panoramiXdataPtr[0].y;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
WriteReplyToClient(client, sizeof(xQueryDevicePointerReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XQueryDevicePointer function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXQueryDevicePointer(ClientPtr client, int size,
|
||||
xQueryDevicePointerReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
44
Xi/querydp.h
44
Xi/querydp.h
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef QUERYDP_H
|
||||
#define QUERYDP_H 1
|
||||
|
||||
int SProcXQueryDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXQueryDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXQueryDevicePointer(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xQueryDevicePointerReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* QUERYDP_H */
|
103
Xi/setcptr.c
103
Xi/setcptr.c
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request to set the client pointer for the owner of the given window.
|
||||
* All subsequent calls that are ambiguous will choose the client pointer as
|
||||
* default value.
|
||||
*/
|
||||
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setcptr.h"
|
||||
|
||||
int
|
||||
SProcXSetClientPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetClientPointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xSetClientPointerReq);
|
||||
return (ProcXSetClientPointer(client));
|
||||
}
|
||||
|
||||
int
|
||||
ProcXSetClientPointer(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr pDev;
|
||||
ClientPtr targetClient;
|
||||
int rc;
|
||||
|
||||
REQUEST(xSetClientPointerReq);
|
||||
REQUEST_SIZE_MATCH(xSetClientPointerReq);
|
||||
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (!IsPointerDevice(pDev) || !pDev->isMaster)
|
||||
{
|
||||
client->errorValue = stuff->deviceid;
|
||||
return BadDevice;
|
||||
}
|
||||
|
||||
if (stuff->win != None)
|
||||
{
|
||||
rc = dixLookupClient(&targetClient, stuff->win, client,
|
||||
DixWriteAccess);
|
||||
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
} else
|
||||
targetClient = client;
|
||||
|
||||
if (!SetClientPointer(targetClient, client, pDev))
|
||||
{
|
||||
client->errorValue = stuff->win;
|
||||
return BadAccess;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
36
Xi/setcptr.h
36
Xi/setcptr.h
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef SETCPTR_H
|
||||
#define SETCPTR_H 1
|
||||
|
||||
int SProcXSetClientPointer(ClientPtr /* client */);
|
||||
int ProcXSetClientPointer(ClientPtr /* client */);
|
||||
|
||||
#endif /* SETCPTR_H */
|
175
Xi/warpdevp.c
175
Xi/warpdevp.c
|
@ -1,175 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Request to Warp the pointer location of an extension input device.
|
||||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
#include "mipointer.h" /* for miPointerUpdateSprite */
|
||||
|
||||
|
||||
#include "warpdevp.h"
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure allows a client to warp the pointer of a device.
|
||||
*
|
||||
*/
|
||||
|
||||
int
|
||||
SProcXWarpDevicePointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xWarpDevicePointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXWarpDevicePointer(client));
|
||||
}
|
||||
|
||||
int
|
||||
ProcXWarpDevicePointer(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
int x, y;
|
||||
WindowPtr dest = NULL;
|
||||
DeviceIntPtr pDev;
|
||||
SpritePtr pSprite;
|
||||
ScreenPtr newScreen;
|
||||
|
||||
REQUEST(xWarpDevicePointerReq);
|
||||
REQUEST_SIZE_MATCH(xWarpDevicePointerReq);
|
||||
|
||||
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
|
||||
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (stuff->dst_win != None)
|
||||
{
|
||||
rc = dixLookupWindow(&dest, stuff->dst_win, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
pSprite = pDev->spriteInfo->sprite;
|
||||
x = pSprite->hotPhys.x;
|
||||
y = pSprite->hotPhys.y;
|
||||
|
||||
if (stuff->src_win != None)
|
||||
{
|
||||
int winX, winY;
|
||||
WindowPtr src;
|
||||
|
||||
rc = dixLookupWindow(&src, stuff->src_win, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
|
||||
winX = src->drawable.x;
|
||||
winY = src->drawable.y;
|
||||
if (src->drawable.pScreen != pSprite->hotPhys.pScreen ||
|
||||
x < winX + stuff->src_x ||
|
||||
y < winY + stuff->src_y ||
|
||||
(stuff->src_width != 0 &&
|
||||
winX + stuff->src_x + (int)stuff->src_width < 0) ||
|
||||
(stuff->src_height != 0 &&
|
||||
winY + stuff->src_y + (int)stuff->src_height < y) ||
|
||||
!PointInWindowIsVisible(src, x, y))
|
||||
return Success;
|
||||
}
|
||||
|
||||
if (dest)
|
||||
{
|
||||
x = dest->drawable.x;
|
||||
y = dest->drawable.y;
|
||||
newScreen = dest->drawable.pScreen;
|
||||
} else
|
||||
newScreen = pSprite->hotPhys.pScreen;
|
||||
|
||||
x += stuff->dst_x;
|
||||
y += stuff->dst_y;
|
||||
|
||||
if (x < 0)
|
||||
x = 0;
|
||||
else if (x > newScreen->width)
|
||||
x = newScreen->width - 1;
|
||||
|
||||
if (y < 0)
|
||||
y = 0;
|
||||
else if (y > newScreen->height)
|
||||
y = newScreen->height - 1;
|
||||
|
||||
if (newScreen == pSprite->hotPhys.pScreen)
|
||||
{
|
||||
if (x < pSprite->physLimits.x1)
|
||||
x = pSprite->physLimits.x1;
|
||||
else if (x >= pSprite->physLimits.x2)
|
||||
x = pSprite->physLimits.x2 - 1;
|
||||
|
||||
if (y < pSprite->physLimits.y1)
|
||||
y = pSprite->physLimits.y1;
|
||||
else if (y >= pSprite->physLimits.y2)
|
||||
y = pSprite->physLimits.y2 - 1;
|
||||
|
||||
if (pSprite->hotShape)
|
||||
ConfineToShape(pDev, pSprite->hotShape, &x, &y);
|
||||
(*newScreen->SetCursorPosition)(pDev, newScreen, x, y, TRUE);
|
||||
} else if (!PointerConfinedToScreen(pDev))
|
||||
{
|
||||
NewCurrentScreen(pDev, newScreen, x, y);
|
||||
}
|
||||
|
||||
/* if we don't update the device, we get a jump next time it moves */
|
||||
pDev->last.valuators[0] = x;
|
||||
pDev->last.valuators[1] = x;
|
||||
miPointerUpdateSprite(pDev);
|
||||
|
||||
/* FIXME: XWarpPointer is supposed to generate an event. It doesn't do it
|
||||
here though. */
|
||||
return Success;
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef WARPDEVP_H
|
||||
#define WARPDEVP_H 1
|
||||
|
||||
int SProcXWarpDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXWarpDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* WARPDEVP_H */
|
81
Xi/xiselev.c
81
Xi/xiselev.c
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dixstruct.h"
|
||||
#include "windowstr.h"
|
||||
|
||||
#include "exglobals.h"
|
||||
#include "xiselev.h"
|
||||
#include "geext.h"
|
||||
|
||||
int
|
||||
SProcXiSelectEvent(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xXiSelectEventReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xXiSelectEventReq);
|
||||
swapl(&stuff->window, n);
|
||||
swapl(&stuff->mask, n);
|
||||
return (ProcXiSelectEvent(client));
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
ProcXiSelectEvent(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
WindowPtr pWin;
|
||||
DeviceIntPtr pDev;
|
||||
REQUEST(xXiSelectEventReq);
|
||||
REQUEST_SIZE_MATCH(xXiSelectEventReq);
|
||||
|
||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
if (stuff->deviceid & (0x1 << 7)) /* all devices */
|
||||
pDev = NULL;
|
||||
else {
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
}
|
||||
|
||||
GEWindowSetMask(client, pDev, pWin, IReqCode, stuff->mask);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
40
Xi/xiselev.h
40
Xi/xiselev.h
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-2008 Peter Hutterer
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, 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 NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
|
||||
*
|
||||
* Author: Peter Hutterer, University of South Australia, NICTA
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef XISELEV_H
|
||||
#define XISELEV_H 1
|
||||
|
||||
int SProcXiSelectEvent(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXiSelectEvent(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* XISELEV_H */
|
||||
|
Loading…
Reference in New Issue
Block a user