Xi: name-space and fix XI2 requests
All XI2 requests have XI prefixes. Requests affected: ChangeDeviceCursor QueryDevicePointer WarpDevicePointer SetClientPointer GetClientPointer XIChangeDeviceHierarchy.
This commit is contained in:
parent
903449615b
commit
560c58b53e
|
@ -39,7 +39,7 @@
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -54,25 +54,25 @@
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXChangeDeviceCursor(ClientPtr client)
|
||||
SProcXIChangeDeviceCursor(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceCursorReq);
|
||||
REQUEST(xXIChangeDeviceCursorReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
|
||||
return (ProcXChangeDeviceCursor(client));
|
||||
REQUEST_SIZE_MATCH(xXIChangeDeviceCursorReq);
|
||||
return (ProcXIChangeDeviceCursor(client));
|
||||
}
|
||||
|
||||
int ProcXChangeDeviceCursor(ClientPtr client)
|
||||
int ProcXIChangeDeviceCursor(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
WindowPtr pWin = NULL;
|
||||
DeviceIntPtr pDev = NULL;
|
||||
CursorPtr pCursor = NULL;
|
||||
|
||||
REQUEST(xChangeDeviceCursorReq);
|
||||
REQUEST_SIZE_MATCH(xChangeDeviceCursorReq);
|
||||
REQUEST(xXIChangeDeviceCursorReq);
|
||||
REQUEST_SIZE_MATCH(xXIChangeDeviceCursorReq);
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
||||
if (rc != Success)
|
||||
|
|
|
@ -30,10 +30,7 @@
|
|||
#ifndef CHDEVCUR_H
|
||||
#define CHDEVCUR_H 1
|
||||
|
||||
int SProcXChangeDeviceCursor(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXChangeDeviceCursor(ClientPtr /* client */
|
||||
);
|
||||
int SProcXIChangeDeviceCursor(ClientPtr /* client */);
|
||||
int ProcXIChangeDeviceCursor(ClientPtr /* client */);
|
||||
|
||||
#endif /* CHDEVCUR_H */
|
||||
|
|
113
Xi/chdevhier.c
113
Xi/chdevhier.c
|
@ -40,7 +40,7 @@
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
|
@ -60,33 +60,33 @@
|
|||
*
|
||||
*/
|
||||
|
||||
int SProcXChangeDeviceHierarchy(ClientPtr client)
|
||||
int SProcXIChangeDeviceHierarchy(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xChangeDeviceHierarchyReq);
|
||||
REQUEST(xXIChangeDeviceHierarchyReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXChangeDeviceHierarchy(client));
|
||||
return (ProcXIChangeDeviceHierarchy(client));
|
||||
}
|
||||
|
||||
#define SWAPIF(cmd) if (client->swapped) { cmd; }
|
||||
|
||||
int
|
||||
ProcXChangeDeviceHierarchy(ClientPtr client)
|
||||
ProcXIChangeDeviceHierarchy(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr ptr, keybd;
|
||||
DeviceIntRec dummyDev;
|
||||
xAnyHierarchyChangeInfo *any;
|
||||
int required_len = sizeof(xChangeDeviceHierarchyReq);
|
||||
xXIAnyHierarchyChangeInfo *any;
|
||||
int required_len = sizeof(xXIChangeDeviceHierarchyReq);
|
||||
char n;
|
||||
int rc = Success;
|
||||
int nchanges = 0;
|
||||
deviceHierarchyChangedEvent ev;
|
||||
xXIDeviceHierarchyEvent ev;
|
||||
|
||||
REQUEST(xChangeDeviceHierarchyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceHierarchyReq);
|
||||
REQUEST(xXIChangeDeviceHierarchyReq);
|
||||
REQUEST_AT_LEAST_SIZE(xXIChangeDeviceHierarchyReq);
|
||||
|
||||
any = (xAnyHierarchyChangeInfo*)&stuff[1];
|
||||
any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
|
||||
while(stuff->num_changes--)
|
||||
{
|
||||
SWAPIF(swapl(&any->type, n));
|
||||
|
@ -100,12 +100,12 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
{
|
||||
case CH_CreateMasterDevice:
|
||||
{
|
||||
xCreateMasterInfo* c = (xCreateMasterInfo*)any;
|
||||
xXICreateMasterInfo* c = (xXICreateMasterInfo*)any;
|
||||
char* name;
|
||||
|
||||
SWAPIF(swaps(&c->namelen, n));
|
||||
name = xcalloc(c->namelen + 1, sizeof(char));
|
||||
strncpy(name, (char*)&c[1], c->namelen);
|
||||
SWAPIF(swaps(&c->name_len, n));
|
||||
name = xcalloc(c->name_len + 1, sizeof(char));
|
||||
strncpy(name, (char*)&c[1], c->name_len);
|
||||
|
||||
|
||||
rc = AllocMasterDevice(client, name, &ptr, &keybd);
|
||||
|
@ -115,7 +115,7 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
goto unwind;
|
||||
}
|
||||
|
||||
if (!c->sendCore)
|
||||
if (!c->send_core)
|
||||
ptr->coreEvents = keybd->coreEvents = FALSE;
|
||||
|
||||
ActivateDevice(ptr);
|
||||
|
@ -132,10 +132,10 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
break;
|
||||
case CH_RemoveMasterDevice:
|
||||
{
|
||||
xRemoveMasterInfo* r = (xRemoveMasterInfo*)any;
|
||||
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
|
||||
|
||||
if (r->returnMode != AttachToMaster &&
|
||||
r->returnMode != Floating)
|
||||
if (r->return_mode != AttachToMaster &&
|
||||
r->return_mode != Floating)
|
||||
return BadValue;
|
||||
|
||||
rc = dixLookupDevice(&ptr, r->deviceid, client,
|
||||
|
@ -182,32 +182,32 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
|
||||
/* Disabling sends the devices floating, reattach them if
|
||||
* desired. */
|
||||
if (r->returnMode == AttachToMaster)
|
||||
if (r->return_mode == AttachToMaster)
|
||||
{
|
||||
DeviceIntPtr attached,
|
||||
newptr,
|
||||
newkeybd;
|
||||
|
||||
rc = dixLookupDevice(&newptr, r->returnPointer,
|
||||
rc = dixLookupDevice(&newptr, r->return_pointer,
|
||||
client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!newptr->isMaster)
|
||||
{
|
||||
client->errorValue = r->returnPointer;
|
||||
client->errorValue = r->return_pointer;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
rc = dixLookupDevice(&newkeybd, r->returnKeyboard,
|
||||
rc = dixLookupDevice(&newkeybd, r->return_keyboard,
|
||||
client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (!newkeybd->isMaster)
|
||||
{
|
||||
client->errorValue = r->returnKeyboard;
|
||||
client->errorValue = r->return_keyboard;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
@ -236,9 +236,9 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
nchanges++;
|
||||
}
|
||||
break;
|
||||
case CH_ChangeAttachment:
|
||||
case CH_DetachSlave:
|
||||
{
|
||||
xChangeAttachmentInfo* c = (xChangeAttachmentInfo*)any;
|
||||
xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any;
|
||||
|
||||
rc = dixLookupDevice(&ptr, c->deviceid, client,
|
||||
DixWriteAccess);
|
||||
|
@ -252,38 +252,53 @@ ProcXChangeDeviceHierarchy(ClientPtr client)
|
|||
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;
|
||||
}
|
||||
AttachDevice(client, ptr, NULL);
|
||||
nchanges++;
|
||||
}
|
||||
break;
|
||||
case CH_AttachSlave:
|
||||
{
|
||||
xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any;
|
||||
DeviceIntPtr newmaster;
|
||||
|
||||
if (!((IsPointerDevice(newmaster) &&
|
||||
rc = dixLookupDevice(&ptr, c->deviceid, client,
|
||||
DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
|
||||
if (ptr->isMaster)
|
||||
{
|
||||
client->errorValue = c->deviceid;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
rc = dixLookupDevice(&newmaster, c->new_master,
|
||||
client, DixWriteAccess);
|
||||
if (rc != Success)
|
||||
goto unwind;
|
||||
if (!newmaster->isMaster)
|
||||
{
|
||||
client->errorValue = c->new_master;
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
|
||||
if (!((IsPointerDevice(newmaster) &&
|
||||
IsPointerDevice(ptr)) ||
|
||||
(IsKeyboardDevice(newmaster) &&
|
||||
IsKeyboardDevice(ptr))))
|
||||
{
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
AttachDevice(client, ptr, newmaster);
|
||||
{
|
||||
rc = BadDevice;
|
||||
goto unwind;
|
||||
}
|
||||
AttachDevice(client, ptr, newmaster);
|
||||
nchanges++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
any = (xAnyHierarchyChangeInfo*)((char*)any + any->length);
|
||||
any = (xXIAnyHierarchyChangeInfo*)((char*)any + any->length * 4);
|
||||
}
|
||||
|
||||
unwind:
|
||||
|
@ -294,7 +309,7 @@ unwind:
|
|||
ev.type = GenericEvent;
|
||||
ev.extension = IReqCode;
|
||||
ev.length = 0;
|
||||
ev.evtype = XI_DeviceHierarchyChangedNotify;
|
||||
ev.evtype = XI_HierarchyChanged;
|
||||
ev.time = GetTimeInMillis();
|
||||
|
||||
SendEventToAllWindows(&dummyDev, XI_DeviceHierarchyChangedMask,
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#ifndef CHDEVHIER_H
|
||||
#define CHDEVHIER_H 1
|
||||
|
||||
int SProcXChangeDeviceHierarchy(ClientPtr /* client */);
|
||||
int ProcXChangeDeviceHierarchy(ClientPtr /* client */);
|
||||
int SProcXIChangeDeviceHierarchy(ClientPtr /* client */);
|
||||
int ProcXIChangeDeviceHierarchy(ClientPtr /* client */);
|
||||
|
||||
#endif
|
||||
|
|
35
Xi/extinit.c
35
Xi/extinit.c
|
@ -61,6 +61,7 @@ SOFTWARE.
|
|||
#include "extnsionst.h" /* extension entry */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include <X11/extensions/geproto.h>
|
||||
#include "geext.h" /* extension interfaces for ge */
|
||||
|
||||
|
@ -229,12 +230,12 @@ static int (*ProcIVector[])(ClientPtr) = {
|
|||
ProcXDeleteDeviceProperty, /* 38 */
|
||||
ProcXGetDeviceProperty, /* 39 */
|
||||
/* XI 2 */
|
||||
ProcXQueryDevicePointer, /* 40 */
|
||||
ProcXWarpDevicePointer, /* 41 */
|
||||
ProcXChangeDeviceCursor, /* 42 */
|
||||
ProcXChangeDeviceHierarchy, /* 43 */
|
||||
ProcXSetClientPointer, /* 44 */
|
||||
ProcXGetClientPointer, /* 45 */
|
||||
ProcXIQueryDevicePointer, /* 40 */
|
||||
ProcXIWarpDevicePointer, /* 41 */
|
||||
ProcXIChangeDeviceCursor, /* 42 */
|
||||
ProcXIChangeDeviceHierarchy, /* 43 */
|
||||
ProcXISetClientPointer, /* 44 */
|
||||
ProcXIGetClientPointer, /* 45 */
|
||||
ProcXiSelectEvent, /* 46 */
|
||||
ProcXIQueryVersion /* 47 */
|
||||
};
|
||||
|
@ -281,12 +282,12 @@ static int (*SProcIVector[])(ClientPtr) = {
|
|||
SProcXChangeDeviceProperty, /* 37 */
|
||||
SProcXDeleteDeviceProperty, /* 38 */
|
||||
SProcXGetDeviceProperty, /* 39 */
|
||||
SProcXQueryDevicePointer, /* 40 */
|
||||
SProcXWarpDevicePointer, /* 41 */
|
||||
SProcXChangeDeviceCursor, /* 42 */
|
||||
SProcXChangeDeviceHierarchy, /* 43 */
|
||||
SProcXSetClientPointer, /* 44 */
|
||||
SProcXGetClientPointer, /* 45 */
|
||||
SProcXIQueryDevicePointer, /* 40 */
|
||||
SProcXIWarpDevicePointer, /* 41 */
|
||||
SProcXIChangeDeviceCursor, /* 42 */
|
||||
SProcXIChangeDeviceHierarchy, /* 43 */
|
||||
SProcXISetClientPointer, /* 44 */
|
||||
SProcXIGetClientPointer, /* 45 */
|
||||
SProcXiSelectEvent, /* 46 */
|
||||
SProcXIQueryVersion /* 47 */
|
||||
};
|
||||
|
@ -474,11 +475,11 @@ 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_XIQueryDevicePointer)
|
||||
SRepXIQueryDevicePointer(client, len,
|
||||
(xXIQueryDevicePointerReply *) rep);
|
||||
else if (rep->RepType == X_XIGetClientPointer)
|
||||
SRepXIGetClientPointer(client, len, (xXIGetClientPointerReply*) rep);
|
||||
else {
|
||||
FatalError("XINPUT confused sending swapped reply");
|
||||
}
|
||||
|
|
26
Xi/getcptr.c
26
Xi/getcptr.c
|
@ -33,7 +33,7 @@
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
|
@ -47,29 +47,29 @@
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXGetClientPointer(ClientPtr client)
|
||||
SProcXIGetClientPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
REQUEST(xGetClientPointerReq);
|
||||
REQUEST(xXIGetClientPointerReq);
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
swapl(&stuff->win, n);
|
||||
return ProcXGetClientPointer(client);
|
||||
return ProcXIGetClientPointer(client);
|
||||
}
|
||||
|
||||
int ProcXGetClientPointer(ClientPtr client)
|
||||
int ProcXIGetClientPointer(ClientPtr client)
|
||||
{
|
||||
int err;
|
||||
WindowPtr win;
|
||||
ClientPtr winclient;
|
||||
xGetClientPointerReply rep;
|
||||
REQUEST(xGetClientPointerReq);
|
||||
REQUEST_SIZE_MATCH(xGetClientPointerReq);
|
||||
xXIGetClientPointerReply rep;
|
||||
REQUEST(xXIGetClientPointerReq);
|
||||
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
|
||||
|
||||
err = dixLookupWindow(&win, stuff->win, client, DixReadAccess);
|
||||
if (err != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetClientPointer,
|
||||
SendErrorToClient(client, IReqCode, X_XIGetClientPointer,
|
||||
stuff->win, err);
|
||||
return Success;
|
||||
}
|
||||
|
@ -77,13 +77,13 @@ int ProcXGetClientPointer(ClientPtr client)
|
|||
winclient = wClient(win);
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetClientPointer;
|
||||
rep.RepType = X_XIGetClientPointer;
|
||||
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);
|
||||
WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
@ -95,8 +95,8 @@ int ProcXGetClientPointer(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetClientPointer(ClientPtr client, int size,
|
||||
xGetClientPointerReply* rep)
|
||||
SRepXIGetClientPointer(ClientPtr client, int size,
|
||||
xXIGetClientPointerReply* rep)
|
||||
{
|
||||
char n;
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
|
|
13
Xi/getcptr.h
13
Xi/getcptr.h
|
@ -29,15 +29,10 @@
|
|||
|
||||
#ifndef GETCPTR_H
|
||||
#define GETCPTR_H 1
|
||||
int SProcXGetClientPointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXGetClientPointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXGetClientPointer(ClientPtr /* client */,
|
||||
int SProcXIGetClientPointer(ClientPtr /* client */);
|
||||
int ProcXIGetClientPointer(ClientPtr /* client */);
|
||||
void SRepXIGetClientPointer(ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetClientPointerReply* /* rep */
|
||||
);
|
||||
xXIGetClientPointerReply* /* rep */);
|
||||
|
||||
#endif /* GETCPTR_H */
|
||||
|
|
52
Xi/querydp.c
52
Xi/querydp.c
|
@ -38,7 +38,7 @@
|
|||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -57,26 +57,26 @@
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXQueryDevicePointer(ClientPtr client)
|
||||
SProcXIQueryDevicePointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xQueryDevicePointerReq);
|
||||
REQUEST(xXIQueryDevicePointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXQueryDevicePointer(client));
|
||||
return (ProcXIQueryDevicePointer(client));
|
||||
}
|
||||
|
||||
int
|
||||
ProcXQueryDevicePointer(ClientPtr client)
|
||||
ProcXIQueryDevicePointer(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
xQueryDevicePointerReply rep;
|
||||
xXIQueryDevicePointerReply rep;
|
||||
DeviceIntPtr pDev, kbd;
|
||||
WindowPtr pWin, t;
|
||||
SpritePtr pSprite;
|
||||
|
||||
REQUEST(xQueryDevicePointerReq);
|
||||
REQUEST_SIZE_MATCH(xQueryDevicePointerReq);
|
||||
REQUEST(xXIQueryDevicePointerReq);
|
||||
REQUEST_SIZE_MATCH(xXIQueryDevicePointerReq);
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
|
@ -91,7 +91,7 @@ ProcXQueryDevicePointer(ClientPtr client)
|
|||
rc = dixLookupWindow(&pWin, stuff->win, client, DixReadAccess);
|
||||
if (rc != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_QueryDevicePointer,
|
||||
SendErrorToClient(client, IReqCode, X_XIQueryDevicePointer,
|
||||
stuff->win, rc);
|
||||
return Success;
|
||||
}
|
||||
|
@ -103,23 +103,23 @@ ProcXQueryDevicePointer(ClientPtr client)
|
|||
|
||||
pSprite = pDev->spriteInfo->sprite;
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_QueryDevicePointer;
|
||||
rep.RepType = X_XIQueryDevicePointer;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.mask = pDev->button->state;
|
||||
if (kbd && kbd->key)
|
||||
rep.mask |= XkbStateFieldFromRec(&kbd->key->xkbInfo->state);
|
||||
rep.root = (GetCurrentRootWindow(pDev))->drawable.id;
|
||||
rep.rootX = pSprite->hot.x;
|
||||
rep.rootY = pSprite->hot.y;
|
||||
rep.root_x.integral = pSprite->hot.x;
|
||||
rep.root_y.integral = 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;
|
||||
rep.same_screen = xTrue;
|
||||
rep.win_x.integral = pSprite->hot.x - pWin->drawable.x;
|
||||
rep.win_y.integral = pSprite->hot.y - pWin->drawable.y;
|
||||
for (t = pSprite->win; t; t = t->parent)
|
||||
if (t->parent == pWin)
|
||||
{
|
||||
|
@ -128,37 +128,37 @@ ProcXQueryDevicePointer(ClientPtr client)
|
|||
}
|
||||
} else
|
||||
{
|
||||
rep.sameScreen = xFalse;
|
||||
rep.winX = 0;
|
||||
rep.winY = 0;
|
||||
rep.same_screen = xFalse;
|
||||
rep.win_x.integral = 0;
|
||||
rep.win_y.integral = 0;
|
||||
}
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if(!noPanoramiXExtension) {
|
||||
rep.rootX += panoramiXdataPtr[0].x;
|
||||
rep.rootY += panoramiXdataPtr[0].y;
|
||||
rep.root_x.integral += panoramiXdataPtr[0].x;
|
||||
rep.root_y.integral += panoramiXdataPtr[0].y;
|
||||
if (stuff->win == rep.root)
|
||||
{
|
||||
rep.winX += panoramiXdataPtr[0].x;
|
||||
rep.winY += panoramiXdataPtr[0].y;
|
||||
rep.win_x.integral += panoramiXdataPtr[0].x;
|
||||
rep.win_y.integral += panoramiXdataPtr[0].y;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
WriteReplyToClient(client, sizeof(xQueryDevicePointerReply), &rep);
|
||||
WriteReplyToClient(client, sizeof(xXIQueryDevicePointerReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XQueryDevicePointer function,
|
||||
* This procedure writes the reply for the XIQueryDevicePointer function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
SRepXQueryDevicePointer(ClientPtr client, int size,
|
||||
xQueryDevicePointerReply * rep)
|
||||
SRepXIQueryDevicePointer(ClientPtr client, int size,
|
||||
xXIQueryDevicePointerReply * rep)
|
||||
{
|
||||
char n;
|
||||
|
||||
|
|
13
Xi/querydp.h
13
Xi/querydp.h
|
@ -30,15 +30,10 @@
|
|||
#ifndef QUERYDP_H
|
||||
#define QUERYDP_H 1
|
||||
|
||||
int SProcXQueryDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXQueryDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXQueryDevicePointer(ClientPtr /* client */ ,
|
||||
int SProcXIQueryDevicePointer(ClientPtr /* client */);
|
||||
int ProcXIQueryDevicePointer(ClientPtr /* client */);
|
||||
void SRepXIQueryDevicePointer(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xQueryDevicePointerReply * /* rep */
|
||||
);
|
||||
xXIQueryDevicePointerReply * /* rep */);
|
||||
|
||||
#endif /* QUERYDP_H */
|
||||
|
|
16
Xi/setcptr.c
16
Xi/setcptr.c
|
@ -41,7 +41,7 @@
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -49,25 +49,25 @@
|
|||
#include "setcptr.h"
|
||||
|
||||
int
|
||||
SProcXSetClientPointer(ClientPtr client)
|
||||
SProcXISetClientPointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xSetClientPointerReq);
|
||||
REQUEST(xXISetClientPointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xSetClientPointerReq);
|
||||
return (ProcXSetClientPointer(client));
|
||||
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
||||
return (ProcXISetClientPointer(client));
|
||||
}
|
||||
|
||||
int
|
||||
ProcXSetClientPointer(ClientPtr client)
|
||||
ProcXISetClientPointer(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr pDev;
|
||||
ClientPtr targetClient;
|
||||
int rc;
|
||||
|
||||
REQUEST(xSetClientPointerReq);
|
||||
REQUEST_SIZE_MATCH(xSetClientPointerReq);
|
||||
REQUEST(xXISetClientPointerReq);
|
||||
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
||||
|
||||
|
||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixWriteAccess);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifndef SETCPTR_H
|
||||
#define SETCPTR_H 1
|
||||
|
||||
int SProcXSetClientPointer(ClientPtr /* client */);
|
||||
int ProcXSetClientPointer(ClientPtr /* client */);
|
||||
int SProcXISetClientPointer(ClientPtr /* client */);
|
||||
int ProcXISetClientPointer(ClientPtr /* client */);
|
||||
|
||||
#endif /* SETCPTR_H */
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -54,17 +54,17 @@
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXWarpDevicePointer(ClientPtr client)
|
||||
SProcXIWarpDevicePointer(ClientPtr client)
|
||||
{
|
||||
char n;
|
||||
|
||||
REQUEST(xWarpDevicePointerReq);
|
||||
REQUEST(xXIWarpDevicePointerReq);
|
||||
swaps(&stuff->length, n);
|
||||
return (ProcXWarpDevicePointer(client));
|
||||
return (ProcXIWarpDevicePointer(client));
|
||||
}
|
||||
|
||||
int
|
||||
ProcXWarpDevicePointer(ClientPtr client)
|
||||
ProcXIWarpDevicePointer(ClientPtr client)
|
||||
{
|
||||
int rc;
|
||||
int x, y;
|
||||
|
@ -73,8 +73,8 @@ ProcXWarpDevicePointer(ClientPtr client)
|
|||
SpritePtr pSprite;
|
||||
ScreenPtr newScreen;
|
||||
|
||||
REQUEST(xWarpDevicePointerReq);
|
||||
REQUEST_SIZE_MATCH(xWarpDevicePointerReq);
|
||||
REQUEST(xXIWarpDevicePointerReq);
|
||||
REQUEST_SIZE_MATCH(xXIWarpDevicePointerReq);
|
||||
|
||||
/* FIXME: panoramix stuff is missing, look at ProcWarpPointer */
|
||||
|
||||
|
|
|
@ -30,10 +30,7 @@
|
|||
#ifndef WARPDEVP_H
|
||||
#define WARPDEVP_H 1
|
||||
|
||||
int SProcXWarpDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int ProcXWarpDevicePointer(ClientPtr /* client */
|
||||
);
|
||||
int SProcXIWarpDevicePointer(ClientPtr /* client */);
|
||||
int ProcXIWarpDevicePointer(ClientPtr /* client */);
|
||||
|
||||
#endif /* WARPDEVP_H */
|
||||
|
|
Loading…
Reference in New Issue
Block a user