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