Compare commits
134 Commits
master
...
wip/swappi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c14c7ec016 | ||
|
|
48918f28d9 | ||
|
|
165eb1be2b | ||
|
|
d03d79f96b | ||
|
|
32f6a22dd1 | ||
|
|
c704eb884a | ||
|
|
bbfdb50b5c | ||
|
|
2a63c0911f | ||
|
|
0c3d3856cc | ||
|
|
3f37b07864 | ||
|
|
f1c658e581 | ||
|
|
1425d94daa | ||
|
|
71cbcb6f02 | ||
|
|
95301df1a9 | ||
|
|
9c6271258c | ||
|
|
dc39130899 | ||
|
|
a5f44e4c59 | ||
|
|
587e00e167 | ||
|
|
18331c6d19 | ||
|
|
9ab956a7ef | ||
|
|
67292b02e3 | ||
|
|
9b8638da17 | ||
|
|
c2270f38b3 | ||
|
|
83a63a64a0 | ||
|
|
adefed6226 | ||
|
|
7baf8767a0 | ||
|
|
8ca929a021 | ||
|
|
52bf89e19f | ||
|
|
c729bfd1f9 | ||
|
|
2892b49d26 | ||
|
|
757f6ab8bc | ||
|
|
d929424514 | ||
|
|
a9f50509bc | ||
|
|
105ee0f8ac | ||
|
|
a45230afac | ||
|
|
153361bdc9 | ||
|
|
fcb1bac94c | ||
|
|
9cc70cd9ff | ||
|
|
c133b094ef | ||
|
|
6f360d77bb | ||
|
|
0bf0da7b90 | ||
|
|
99e8b56421 | ||
|
|
75328e8356 | ||
|
|
5cded6356d | ||
|
|
034791c693 | ||
|
|
35e8a37b17 | ||
|
|
03b8cb506f | ||
|
|
ff1cb0df89 | ||
|
|
07ce669504 | ||
|
|
bac5e1fa2d | ||
|
|
a7f9bcaf39 | ||
|
|
f906f3afc4 | ||
|
|
87c9317714 | ||
|
|
7c92bf3937 | ||
|
|
6f6379ff54 | ||
|
|
0fde105e38 | ||
|
|
428855b0df | ||
|
|
9614b41afb | ||
|
|
893f56f6b0 | ||
|
|
1d9c412683 | ||
|
|
b619f19c84 | ||
|
|
8501dda10d | ||
|
|
63f510ebf2 | ||
|
|
e7262542d5 | ||
|
|
d84af813a2 | ||
|
|
d41b209a19 | ||
|
|
52542da36c | ||
|
|
6da5284195 | ||
|
|
8ef462c58a | ||
|
|
f8d6a480e4 | ||
|
|
8ca913faa2 | ||
|
|
c2760879c2 | ||
|
|
6bd069b343 | ||
|
|
165e48e286 | ||
|
|
50813e93c6 | ||
|
|
014954c3f7 | ||
|
|
10510cd528 | ||
|
|
70f77c510a | ||
|
|
0dd817f62c | ||
|
|
cfa82b85b0 | ||
|
|
d93b4614f0 | ||
|
|
ac5cdc3680 | ||
|
|
4f39b005a7 | ||
|
|
6c2fcf24a0 | ||
|
|
0baa232235 | ||
|
|
4da568c469 | ||
|
|
29dc21a93e | ||
|
|
9e29d9fe4f | ||
|
|
5b4485a90d | ||
|
|
6107438647 | ||
|
|
041da82154 | ||
|
|
757a729ad1 | ||
|
|
574b486872 | ||
|
|
c6408565b9 | ||
|
|
b8ce247d5d | ||
|
|
c530d6fb63 | ||
|
|
0e7c45d8d4 | ||
|
|
905ac4d3b2 | ||
|
|
7982f4c719 | ||
|
|
f0278176f5 | ||
|
|
875f684552 | ||
|
|
80b72910b8 | ||
|
|
a813a00c89 | ||
|
|
3598a1c57c | ||
|
|
9c787e8781 | ||
|
|
23f6e9ef8a | ||
|
|
76a58eb5fa | ||
|
|
cbeeccedc0 | ||
|
|
fbe85a576b | ||
|
|
e415861cfd | ||
|
|
55e5eb36ad | ||
|
|
abf1db322b | ||
|
|
1f806a6256 | ||
|
|
0802aecc1f | ||
|
|
41d6863370 | ||
|
|
94b58409ff | ||
|
|
143faef683 | ||
|
|
9070f6a543 | ||
|
|
9a85c8dd21 | ||
|
|
cffb71b947 | ||
|
|
0ed09b7093 | ||
|
|
efc149c763 | ||
|
|
2557593ab7 | ||
|
|
c9c5477aab | ||
|
|
3d4d655f2b | ||
|
|
3dd5b15421 | ||
|
|
28316162ef | ||
|
|
8b64458aa7 | ||
|
|
5c68141260 | ||
|
|
41da339328 | ||
|
|
73a8b21464 | ||
|
|
e32927e8cf | ||
|
|
e996fd6a95 | ||
|
|
254f467939 |
|
|
@ -33,6 +33,7 @@ from The Open Group.
|
||||||
#include <X11/extensions/bigreqsproto.h>
|
#include <X11/extensions/bigreqsproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
@ -44,25 +45,19 @@ from The Open Group.
|
||||||
static int
|
static int
|
||||||
ProcBigReqDispatch(ClientPtr client)
|
ProcBigReqDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xBigReqEnableReq);
|
REQUEST_HEAD_STRUCT(xBigReqEnableReq);
|
||||||
xBigReqEnableReply rep;
|
|
||||||
|
|
||||||
if (stuff->brReqType != X_BigReqEnable)
|
if (stuff->brReqType != X_BigReqEnable)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
REQUEST_SIZE_MATCH(xBigReqEnableReq);
|
|
||||||
client->big_requests = TRUE;
|
client->big_requests = TRUE;
|
||||||
rep = (xBigReqEnableReply) {
|
|
||||||
.type = X_Reply,
|
xBigReqEnableReply rep = {
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.max_request_size = maxBigRequestSize
|
.max_request_size = maxBigRequestSize
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(max_request_size);
|
||||||
swapl(&rep.max_request_size);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xBigReqEnableReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
174
Xext/dpms.c
174
Xext/dpms.c
|
|
@ -30,7 +30,9 @@ Equipment Corporation.
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
#include <X11/extensions/dpmsproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/screensaver.h"
|
#include "os/screensaver.h"
|
||||||
#include "Xext/geext_priv.h"
|
#include "Xext/geext_priv.h"
|
||||||
|
|
||||||
|
|
@ -39,7 +41,6 @@ Equipment Corporation.
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "opaque.h"
|
#include "opaque.h"
|
||||||
#include <X11/extensions/dpmsproto.h>
|
|
||||||
#include "dpmsproc.h"
|
#include "dpmsproc.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit_priv.h"
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
|
@ -124,12 +125,13 @@ SDPMSInfoNotifyEvent(xGenericEvent * from,
|
||||||
static int
|
static int
|
||||||
ProcDPMSSelectInput(register ClientPtr client)
|
ProcDPMSSelectInput(register ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSSelectInputReq);
|
REQUEST_HEAD_STRUCT(xDPMSSelectInputReq);
|
||||||
|
REQUEST_FIELD_CARD32(eventMask);
|
||||||
|
|
||||||
DPMSEventPtr pEvent, pNewEvent, *pHead;
|
DPMSEventPtr pEvent, pNewEvent, *pHead;
|
||||||
XID clientResource;
|
XID clientResource;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSSelectInputReq);
|
|
||||||
i = dixLookupResourceByType((void **)&pHead, eventResource, DPMSEventType,
|
i = dixLookupResourceByType((void **)&pHead, eventResource, DPMSEventType,
|
||||||
client,
|
client,
|
||||||
DixWriteAccess);
|
DixWriteAccess);
|
||||||
|
|
@ -295,77 +297,56 @@ DPMSSet(ClientPtr client, int level)
|
||||||
static int
|
static int
|
||||||
ProcDPMSGetVersion(ClientPtr client)
|
ProcDPMSGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSGetVersionReq); */
|
REQUEST_HEAD_STRUCT(xDPMSGetVersionReq);
|
||||||
|
REQUEST_FIELD_CARD16(majorVersion);
|
||||||
|
REQUEST_FIELD_CARD16(minorVersion);
|
||||||
|
|
||||||
xDPMSGetVersionReply rep = {
|
xDPMSGetVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_DPMS_MAJOR_VERSION,
|
.majorVersion = SERVER_DPMS_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_DPMS_MINOR_VERSION
|
.minorVersion = SERVER_DPMS_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcDPMSCapable(ClientPtr client)
|
ProcDPMSCapable(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSCapableReq); */
|
REQUEST_HEAD_STRUCT(xDPMSCapableReq);
|
||||||
|
|
||||||
xDPMSCapableReply rep = {
|
xDPMSCapableReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.capable = TRUE
|
.capable = TRUE
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xDPMSCapableReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcDPMSGetTimeouts(ClientPtr client)
|
ProcDPMSGetTimeouts(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSGetTimeoutsReq); */
|
REQUEST_HEAD_STRUCT(xDPMSGetTimeoutsReq);
|
||||||
|
|
||||||
xDPMSGetTimeoutsReply rep = {
|
xDPMSGetTimeoutsReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.standby = DPMSStandbyTime / MILLI_PER_SECOND,
|
.standby = DPMSStandbyTime / MILLI_PER_SECOND,
|
||||||
.suspend = DPMSSuspendTime / MILLI_PER_SECOND,
|
.suspend = DPMSSuspendTime / MILLI_PER_SECOND,
|
||||||
.off = DPMSOffTime / MILLI_PER_SECOND
|
.off = DPMSOffTime / MILLI_PER_SECOND
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
REPLY_FIELD_CARD16(standby);
|
||||||
|
REPLY_FIELD_CARD16(suspend);
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(off);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.standby);
|
|
||||||
swaps(&rep.suspend);
|
|
||||||
swaps(&rep.off);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcDPMSSetTimeouts(ClientPtr client)
|
ProcDPMSSetTimeouts(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSSetTimeoutsReq);
|
REQUEST_HEAD_STRUCT(xDPMSSetTimeoutsReq);
|
||||||
|
REQUEST_FIELD_CARD16(standby);
|
||||||
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
|
REQUEST_FIELD_CARD16(suspend);
|
||||||
|
REQUEST_FIELD_CARD16(off);
|
||||||
|
|
||||||
if ((stuff->off != 0) && (stuff->off < stuff->suspend)) {
|
if ((stuff->off != 0) && (stuff->off < stuff->suspend)) {
|
||||||
client->errorValue = stuff->off;
|
client->errorValue = stuff->off;
|
||||||
|
|
@ -387,9 +368,9 @@ ProcDPMSSetTimeouts(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcDPMSEnable(ClientPtr client)
|
ProcDPMSEnable(ClientPtr client)
|
||||||
{
|
{
|
||||||
Bool was_enabled = DPMSEnabled;
|
REQUEST_HEAD_STRUCT(xDPMSEnableReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSEnableReq);
|
Bool was_enabled = DPMSEnabled;
|
||||||
|
|
||||||
DPMSEnabled = TRUE;
|
DPMSEnabled = TRUE;
|
||||||
if (!was_enabled) {
|
if (!was_enabled) {
|
||||||
|
|
@ -403,12 +384,10 @@ ProcDPMSEnable(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcDPMSDisable(ClientPtr client)
|
ProcDPMSDisable(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xDPMSDisableReq);
|
||||||
|
|
||||||
Bool was_enabled = DPMSEnabled;
|
Bool was_enabled = DPMSEnabled;
|
||||||
|
|
||||||
/* REQUEST(xDPMSDisableReq); */
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSDisableReq);
|
|
||||||
|
|
||||||
DPMSSet(client, DPMSModeOn);
|
DPMSSet(client, DPMSModeOn);
|
||||||
|
|
||||||
DPMSEnabled = FALSE;
|
DPMSEnabled = FALSE;
|
||||||
|
|
@ -421,9 +400,8 @@ ProcDPMSDisable(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcDPMSForceLevel(ClientPtr client)
|
ProcDPMSForceLevel(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDPMSForceLevelReq);
|
REQUEST_HEAD_STRUCT(xDPMSForceLevelReq);
|
||||||
|
REQUEST_FIELD_CARD16(level);
|
||||||
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
|
|
||||||
|
|
||||||
if (!DPMSEnabled)
|
if (!DPMSEnabled)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
@ -443,23 +421,15 @@ ProcDPMSForceLevel(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcDPMSInfo(ClientPtr client)
|
ProcDPMSInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSInfoReq); */
|
REQUEST_HEAD_STRUCT(xDPMSInfoReq);
|
||||||
|
|
||||||
xDPMSInfoReply rep = {
|
xDPMSInfoReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.power_level = DPMSPowerLevel,
|
.power_level = DPMSPowerLevel,
|
||||||
.state = DPMSEnabled
|
.state = DPMSEnabled
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
REPLY_FIELD_CARD16(power_level);
|
||||||
|
REPLY_SEND_RET_SUCCESS();
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swaps(&rep.power_level);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xDPMSInfoReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -491,78 +461,6 @@ ProcDPMSDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcDPMSGetVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xDPMSGetVersionReq);
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
|
||||||
swaps(&stuff->majorVersion);
|
|
||||||
swaps(&stuff->minorVersion);
|
|
||||||
return ProcDPMSGetVersion(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcDPMSSetTimeouts(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xDPMSSetTimeoutsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
|
|
||||||
|
|
||||||
swaps(&stuff->standby);
|
|
||||||
swaps(&stuff->suspend);
|
|
||||||
swaps(&stuff->off);
|
|
||||||
return ProcDPMSSetTimeouts(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcDPMSForceLevel(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xDPMSForceLevelReq);
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
|
|
||||||
|
|
||||||
swaps(&stuff->level);
|
|
||||||
|
|
||||||
return ProcDPMSForceLevel(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcDPMSSelectInput(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xDPMSSelectInputReq);
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSSelectInputReq);
|
|
||||||
swapl(&stuff->eventMask);
|
|
||||||
return ProcDPMSSelectInput(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcDPMSDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_DPMSGetVersion:
|
|
||||||
return SProcDPMSGetVersion(client);
|
|
||||||
case X_DPMSCapable:
|
|
||||||
return ProcDPMSCapable(client);
|
|
||||||
case X_DPMSGetTimeouts:
|
|
||||||
return ProcDPMSGetTimeouts(client);
|
|
||||||
case X_DPMSSetTimeouts:
|
|
||||||
return SProcDPMSSetTimeouts(client);
|
|
||||||
case X_DPMSEnable:
|
|
||||||
return ProcDPMSEnable(client);
|
|
||||||
case X_DPMSDisable:
|
|
||||||
return ProcDPMSDisable(client);
|
|
||||||
case X_DPMSForceLevel:
|
|
||||||
return SProcDPMSForceLevel(client);
|
|
||||||
case X_DPMSInfo:
|
|
||||||
return ProcDPMSInfo(client);
|
|
||||||
case X_DPMSSelectInput:
|
|
||||||
return SProcDPMSSelectInput(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DPMSCloseDownExtension(ExtensionEntry *e)
|
DPMSCloseDownExtension(ExtensionEntry *e)
|
||||||
{
|
{
|
||||||
|
|
@ -592,7 +490,7 @@ DPMSExtensionInit(void)
|
||||||
|
|
||||||
if (DPMSEnabled && ClientType && DPMSEventType &&
|
if (DPMSEnabled && ClientType && DPMSEventType &&
|
||||||
(extEntry = AddExtension(DPMSExtensionName, 0, 0,
|
(extEntry = AddExtension(DPMSExtensionName, 0, 0,
|
||||||
ProcDPMSDispatch, SProcDPMSDispatch,
|
ProcDPMSDispatch, ProcDPMSDispatch,
|
||||||
DPMSCloseDownExtension, StandardMinorOpcode))) {
|
DPMSCloseDownExtension, StandardMinorOpcode))) {
|
||||||
DPMSReqCode = extEntry->base;
|
DPMSReqCode = extEntry->base;
|
||||||
GERegisterExtension(DPMSReqCode, SDPMSInfoNotifyEvent);
|
GERegisterExtension(DPMSReqCode, SDPMSInfoNotifyEvent);
|
||||||
|
|
|
||||||
59
Xext/geext.c
59
Xext/geext.c
|
|
@ -28,6 +28,7 @@
|
||||||
#include <X11/extensions/ge.h>
|
#include <X11/extensions/ge.h>
|
||||||
#include <X11/extensions/geproto.h>
|
#include <X11/extensions/geproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "Xext/geext_priv.h"
|
#include "Xext/geext_priv.h"
|
||||||
|
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -67,20 +68,14 @@ static void SGEGenericEvent(xEvent *from, xEvent *to);
|
||||||
static int
|
static int
|
||||||
ProcGEQueryVersion(ClientPtr client)
|
ProcGEQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xGEQueryVersionReq);
|
||||||
|
REQUEST_FIELD_CARD16(majorVersion);
|
||||||
|
REQUEST_FIELD_CARD16(minorVersion);
|
||||||
|
|
||||||
GEClientInfoPtr pGEClient = GEGetClient(client);
|
GEClientInfoPtr pGEClient = GEGetClient(client);
|
||||||
xGEQueryVersionReply rep;
|
|
||||||
|
|
||||||
REQUEST(xGEQueryVersionReq);
|
xGEQueryVersionReply rep = {
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
|
||||||
|
|
||||||
rep = (xGEQueryVersionReply) {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GEQueryVersion,
|
.RepType = X_GEQueryVersion,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
|
|
||||||
/* return the supported version by the server */
|
|
||||||
.majorVersion = SERVER_GE_MAJOR_VERSION,
|
.majorVersion = SERVER_GE_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_GE_MINOR_VERSION
|
.minorVersion = SERVER_GE_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
@ -89,28 +84,9 @@ ProcGEQueryVersion(ClientPtr client)
|
||||||
pGEClient->major_version = stuff->majorVersion;
|
pGEClient->major_version = stuff->majorVersion;
|
||||||
pGEClient->minor_version = stuff->minorVersion;
|
pGEClient->minor_version = stuff->minorVersion;
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xGEQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************/
|
|
||||||
/* swapped request handlers */
|
|
||||||
/************************************************************/
|
|
||||||
static int _X_COLD
|
|
||||||
SProcGEQueryVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGEQueryVersionReq);
|
|
||||||
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
|
||||||
swaps(&stuff->majorVersion);
|
|
||||||
swaps(&stuff->minorVersion);
|
|
||||||
return ProcGEQueryVersion(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
@ -131,21 +107,6 @@ ProcGEDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* dispatch swapped requests */
|
|
||||||
static int _X_COLD
|
|
||||||
SProcGEDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
swaps(&stuff->length);
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_GEQueryVersion:
|
|
||||||
return SProcGEQueryVersion(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reset extension. Called on server shutdown. */
|
/* Reset extension. Called on server shutdown. */
|
||||||
static void
|
static void
|
||||||
GEResetProc(ExtensionEntry * extEntry)
|
GEResetProc(ExtensionEntry * extEntry)
|
||||||
|
|
@ -186,7 +147,7 @@ GEExtensionInit(void)
|
||||||
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
||||||
FatalError("GEExtensionInit: GE private request failed.\n");
|
FatalError("GEExtensionInit: GE private request failed.\n");
|
||||||
|
|
||||||
if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, SProcGEDispatch,
|
if (!AddExtension(GE_NAME, 0, GENumberErrors, ProcGEDispatch, ProcGEDispatch,
|
||||||
GEResetProc, StandardMinorOpcode))
|
GEResetProc, StandardMinorOpcode))
|
||||||
FatalError("GEInit: AddExtensions failed.\n");
|
FatalError("GEInit: AddExtensions failed.\n");
|
||||||
|
|
||||||
|
|
|
||||||
151
Xext/panoramiX.c
151
Xext/panoramiX.c
|
|
@ -32,6 +32,7 @@ Equipment Corporation.
|
||||||
#include <X11/extensions/panoramiXproto.h>
|
#include <X11/extensions/panoramiXproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
#include "dix/screen_hooks_priv.h"
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "Xext/panoramiX.h"
|
#include "Xext/panoramiX.h"
|
||||||
|
|
@ -457,7 +458,8 @@ PanoramiXExtensionInit(void)
|
||||||
while (panoramiXGeneration != serverGeneration) {
|
while (panoramiXGeneration != serverGeneration) {
|
||||||
extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
|
extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
|
||||||
ProcPanoramiXDispatch,
|
ProcPanoramiXDispatch,
|
||||||
SProcPanoramiXDispatch, PanoramiXResetProc,
|
ProcPanoramiXDispatch,
|
||||||
|
PanoramiXResetProc,
|
||||||
StandardMinorOpcode);
|
StandardMinorOpcode);
|
||||||
if (!extEntry)
|
if (!extEntry)
|
||||||
break;
|
break;
|
||||||
|
|
@ -898,94 +900,70 @@ PanoramiXResetProc(ExtensionEntry * extEntry)
|
||||||
int
|
int
|
||||||
ProcPanoramiXQueryVersion(ClientPtr client)
|
ProcPanoramiXQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xPanoramiXQueryVersionReq); */
|
REQUEST_HEAD_STRUCT(xPanoramiXQueryVersionReq);
|
||||||
|
|
||||||
xPanoramiXQueryVersionReply rep = {
|
xPanoramiXQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION,
|
.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_PANORAMIX_MINOR_VERSION
|
.minorVersion = SERVER_PANORAMIX_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcPanoramiXGetState(ClientPtr client)
|
ProcPanoramiXGetState(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPanoramiXGetStateReq);
|
REQUEST_HEAD_STRUCT(xPanoramiXGetStateReq);
|
||||||
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xPanoramiXGetStateReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xPanoramiXGetStateReply) {
|
xPanoramiXGetStateReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.state = !noPanoramiXExtension,
|
.state = !noPanoramiXExtension,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.window = stuff->window
|
.window = stuff->window
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(window);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.window);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
|
|
||||||
return Success;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcPanoramiXGetScreenCount(ClientPtr client)
|
ProcPanoramiXGetScreenCount(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPanoramiXGetScreenCountReq);
|
REQUEST_HEAD_STRUCT(xPanoramiXGetScreenCountReq);
|
||||||
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xPanoramiXGetScreenCountReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xPanoramiXGetScreenCountReply) {
|
xPanoramiXGetScreenCountReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.ScreenCount = PanoramiXNumScreens,
|
.ScreenCount = PanoramiXNumScreens,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.window = stuff->window
|
.window = stuff->window
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(window);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.window);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcPanoramiXGetScreenSize(ClientPtr client)
|
ProcPanoramiXGetScreenSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
REQUEST_HEAD_STRUCT(xPanoramiXGetScreenSizeReq);
|
||||||
WindowPtr pWin;
|
REQUEST_FIELD_CARD32(window);
|
||||||
xPanoramiXGetScreenSizeReply rep;
|
REQUEST_FIELD_CARD32(screen);
|
||||||
int rc;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
WindowPtr pWin;
|
||||||
|
int rc;
|
||||||
|
|
||||||
if (stuff->screen >= PanoramiXNumScreens)
|
if (stuff->screen >= PanoramiXNumScreens)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
@ -994,40 +972,27 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xPanoramiXGetScreenSizeReply) {
|
xPanoramiXGetScreenSizeReply rep = {
|
||||||
.type = X_Reply,
|
/* screen dimensions */
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
/* screen dimensions */
|
|
||||||
.width = screenInfo.screens[stuff->screen]->width,
|
.width = screenInfo.screens[stuff->screen]->width,
|
||||||
.height = screenInfo.screens[stuff->screen]->height,
|
.height = screenInfo.screens[stuff->screen]->height,
|
||||||
.window = stuff->window,
|
.window = stuff->window,
|
||||||
.screen = stuff->screen
|
.screen = stuff->screen
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(width);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(height);
|
||||||
swapl(&rep.width);
|
REPLY_FIELD_CARD32(window);
|
||||||
swapl(&rep.height);
|
REPLY_FIELD_CARD32(screen);
|
||||||
swapl(&rep.window);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.screen);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXineramaIsActive(ClientPtr client)
|
ProcXineramaIsActive(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXineramaIsActiveReq); */
|
REQUEST_HEAD_STRUCT(xXineramaIsActiveReq);
|
||||||
xXineramaIsActiveReply rep;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
xXineramaIsActiveReply rep = {
|
||||||
|
|
||||||
rep = (xXineramaIsActiveReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
#if 1
|
#if 1
|
||||||
/* The following hack fools clients into thinking that Xinerama
|
/* The following hack fools clients into thinking that Xinerama
|
||||||
* is disabled even though it is not. */
|
* is disabled even though it is not. */
|
||||||
|
|
@ -1036,56 +1001,38 @@ ProcXineramaIsActive(ClientPtr client)
|
||||||
.state = !noPanoramiXExtension;
|
.state = !noPanoramiXExtension;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(state);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.state);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXineramaQueryScreens(ClientPtr client)
|
ProcXineramaQueryScreens(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXineramaQueryScreensReq); */
|
REQUEST_HEAD_STRUCT(xXineramaQueryScreensReq);
|
||||||
|
|
||||||
CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
||||||
xXineramaQueryScreensReply rep = {
|
xXineramaQueryScreensReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(number * sz_XineramaScreenInfo),
|
.length = bytes_to_int32(number * sz_XineramaScreenInfo),
|
||||||
.number = number
|
.number = number
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
xXineramaScreenInfo scratch[number]; // upper bound limited, number of screens
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.number);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
|
|
||||||
|
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
xXineramaScreenInfo scratch;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
FOR_NSCREENS_BACKWARD(i) {
|
FOR_NSCREENS_BACKWARD(i) {
|
||||||
scratch.x_org = screenInfo.screens[i]->x;
|
scratch[i].x_org = screenInfo.screens[i]->x;
|
||||||
scratch.y_org = screenInfo.screens[i]->y;
|
scratch[i].y_org = screenInfo.screens[i]->y;
|
||||||
scratch.width = screenInfo.screens[i]->width;
|
scratch[i].width = screenInfo.screens[i]->width;
|
||||||
scratch.height = screenInfo.screens[i]->height;
|
scratch[i].height = screenInfo.screens[i]->height;
|
||||||
|
CLIENT_STRUCT_CARD16_4(&scratch[i], x_org, y_org, width, height);
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&scratch.x_org);
|
|
||||||
swaps(&scratch.y_org);
|
|
||||||
swaps(&scratch.width);
|
|
||||||
swaps(&scratch.height);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sz_XineramaScreenInfo, &scratch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REPLY_FIELD_CARD32(number);
|
||||||
|
REPLY_SEND_EXTRA(scratch, sizeof(scratch));
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
/*****************************************************************
|
|
||||||
Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
|
|
||||||
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.
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice 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
|
|
||||||
DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
|
|
||||||
BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL 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.
|
|
||||||
|
|
||||||
Except as contained in this notice, the name of Digital Equipment Corporation
|
|
||||||
shall not be used in advertising or otherwise to promote the sale, use or other
|
|
||||||
dealings in this Software without prior written authorization from Digital
|
|
||||||
Equipment Corporation.
|
|
||||||
******************************************************************/
|
|
||||||
|
|
||||||
#include <dix-config.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <X11/X.h>
|
|
||||||
#include <X11/Xproto.h>
|
|
||||||
#include <X11/extensions/panoramiXproto.h>
|
|
||||||
|
|
||||||
#include "Xext/panoramiX.h"
|
|
||||||
#include "Xext/panoramiXsrv.h"
|
|
||||||
|
|
||||||
#include "misc.h"
|
|
||||||
#include "cursor.h"
|
|
||||||
#include "cursorstr.h"
|
|
||||||
#include "extnsionst.h"
|
|
||||||
#include "dixstruct.h"
|
|
||||||
#include "gc.h"
|
|
||||||
#include "gcstruct.h"
|
|
||||||
#include "scrnintstr.h"
|
|
||||||
#include "window.h"
|
|
||||||
#include "windowstr.h"
|
|
||||||
#include "pixmapstr.h"
|
|
||||||
#include "globals.h"
|
|
||||||
#include "panoramiXh.h"
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcPanoramiXGetState(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xPanoramiXGetStateReq);
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcPanoramiXGetState(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcPanoramiXGetScreenCount(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xPanoramiXGetScreenCountReq);
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcPanoramiXGetScreenCount(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcPanoramiXGetScreenSize(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xPanoramiXGetScreenSizeReq);
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
swapl(&stuff->screen);
|
|
||||||
return ProcPanoramiXGetScreenSize(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcPanoramiXDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_PanoramiXQueryVersion:
|
|
||||||
return ProcPanoramiXQueryVersion(client);
|
|
||||||
case X_PanoramiXGetState:
|
|
||||||
return SProcPanoramiXGetState(client);
|
|
||||||
case X_PanoramiXGetScreenCount:
|
|
||||||
return SProcPanoramiXGetScreenCount(client);
|
|
||||||
case X_PanoramiXGetScreenSize:
|
|
||||||
return SProcPanoramiXGetScreenSize(client);
|
|
||||||
case X_XineramaIsActive:
|
|
||||||
return ProcXineramaIsActive(client);
|
|
||||||
case X_XineramaQueryScreens:
|
|
||||||
return ProcXineramaQueryScreens(client);
|
|
||||||
}
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
|
|
@ -65,8 +65,6 @@ PROC_EXTERN(ProcPanoramiXGetScreenSize);
|
||||||
PROC_EXTERN(ProcXineramaQueryScreens);
|
PROC_EXTERN(ProcXineramaQueryScreens);
|
||||||
PROC_EXTERN(ProcXineramaIsActive);
|
PROC_EXTERN(ProcXineramaIsActive);
|
||||||
|
|
||||||
extern int SProcPanoramiXDispatch(ClientPtr client);
|
|
||||||
|
|
||||||
extern int connBlockScreenStart;
|
extern int connBlockScreenStart;
|
||||||
extern xConnSetupPrefix connSetupPrefix;
|
extern xConnSetupPrefix connSetupPrefix;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1960,7 +1960,6 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
Bool isRoot;
|
Bool isRoot;
|
||||||
char *pBuf;
|
|
||||||
int i, x, y, w, h, format, rc;
|
int i, x, y, w, h, format, rc;
|
||||||
Mask plane = 0, planemask;
|
Mask plane = 0, planemask;
|
||||||
int linesDone, nlines, linesPerBuf;
|
int linesDone, nlines, linesPerBuf;
|
||||||
|
|
@ -2032,7 +2031,6 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
IncludeInferiors);
|
IncludeInferiors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (format == ZPixmap) {
|
if (format == ZPixmap) {
|
||||||
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
||||||
length = widthBytesLine * h;
|
length = widthBytesLine * h;
|
||||||
|
|
@ -2046,14 +2044,6 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xGetImageReply rep = {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.visual = wVisual(((WindowPtr) pDraw)),
|
|
||||||
.depth = pDraw->depth,
|
|
||||||
.length = bytes_to_int32(length),
|
|
||||||
};
|
|
||||||
|
|
||||||
if (widthBytesLine == 0 || h == 0)
|
if (widthBytesLine == 0 || h == 0)
|
||||||
linesPerBuf = 0;
|
linesPerBuf = 0;
|
||||||
else if (widthBytesLine >= XINERAMA_IMAGE_BUFSIZE)
|
else if (widthBytesLine >= XINERAMA_IMAGE_BUFSIZE)
|
||||||
|
|
@ -2063,15 +2053,9 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
if (linesPerBuf > h)
|
if (linesPerBuf > h)
|
||||||
linesPerBuf = h;
|
linesPerBuf = h;
|
||||||
}
|
}
|
||||||
if (!(pBuf = calloc(linesPerBuf, widthBytesLine)))
|
|
||||||
return BadAlloc;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
char *payload = calloc(1, length);
|
||||||
swaps(&rep.sequenceNumber);
|
char *walk = payload;
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.visual);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
|
|
||||||
if (linesPerBuf == 0) {
|
if (linesPerBuf == 0) {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
|
|
@ -2081,14 +2065,11 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
while (h - linesDone > 0) {
|
while (h - linesDone > 0) {
|
||||||
nlines = min(linesPerBuf, h - linesDone);
|
nlines = min(linesPerBuf, h - linesDone);
|
||||||
|
|
||||||
if (pDraw->depth == 1)
|
|
||||||
memset(pBuf, 0, nlines * widthBytesLine);
|
|
||||||
|
|
||||||
XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
|
XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
|
||||||
format, planemask, pBuf, widthBytesLine,
|
format, planemask, walk, widthBytesLine,
|
||||||
isRoot);
|
isRoot);
|
||||||
|
|
||||||
WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
|
walk += nlines * widthBytesLine;
|
||||||
linesDone += nlines;
|
linesDone += nlines;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2099,20 +2080,30 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
while (h - linesDone > 0) {
|
while (h - linesDone > 0) {
|
||||||
nlines = min(linesPerBuf, h - linesDone);
|
nlines = min(linesPerBuf, h - linesDone);
|
||||||
|
|
||||||
memset(pBuf, 0, nlines * widthBytesLine);
|
|
||||||
|
|
||||||
XineramaGetImageData(drawables, x, y + linesDone, w,
|
XineramaGetImageData(drawables, x, y + linesDone, w,
|
||||||
nlines, format, plane, pBuf,
|
nlines, format, plane, walk,
|
||||||
widthBytesLine, isRoot);
|
widthBytesLine, isRoot);
|
||||||
|
|
||||||
WriteToClient(client, (int)(nlines * widthBytesLine), pBuf);
|
walk += nlines * widthBytesLine;
|
||||||
|
|
||||||
linesDone += nlines;
|
linesDone += nlines;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(pBuf);
|
|
||||||
|
xGetImageReply xgi = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.visual = wVisual(((WindowPtr) pDraw)),
|
||||||
|
.depth = pDraw->depth,
|
||||||
|
.length = bytes_to_int32(length),
|
||||||
|
};
|
||||||
|
|
||||||
|
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
|
||||||
|
|
||||||
|
if (length)
|
||||||
|
WriteToClient(client, length, payload);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
158
Xext/saver.c
158
Xext/saver.c
|
|
@ -36,6 +36,7 @@ in this Software without prior written authorization from the X Consortium.
|
||||||
#include "dix/colormap_priv.h"
|
#include "dix/colormap_priv.h"
|
||||||
#include "dix/cursor_priv.h"
|
#include "dix/cursor_priv.h"
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/window_priv.h"
|
#include "dix/window_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
#include "os/screensaver.h"
|
#include "os/screensaver.h"
|
||||||
|
|
@ -591,35 +592,30 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverQueryVersion(ClientPtr client)
|
ProcScreenSaverQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xScreenSaverQueryVersionReq);
|
||||||
|
|
||||||
xScreenSaverQueryVersionReply rep = {
|
xScreenSaverQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.majorVersion = SERVER_SAVER_MAJOR_VERSION,
|
.majorVersion = SERVER_SAVER_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_SAVER_MINOR_VERSION
|
.minorVersion = SERVER_SAVER_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverQueryInfo(ClientPtr client)
|
ProcScreenSaverQueryInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverQueryInfoReq);
|
REQUEST_HEAD_STRUCT(xScreenSaverQueryInfoReq);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
ScreenSaverStuffPtr pSaver;
|
ScreenSaverStuffPtr pSaver;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
CARD32 lastInput;
|
CARD32 lastInput;
|
||||||
ScreenSaverScreenPrivatePtr pPriv;
|
ScreenSaverScreenPrivatePtr pPriv;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -635,10 +631,11 @@ ProcScreenSaverQueryInfo(ClientPtr client)
|
||||||
lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds;
|
lastInput = GetTimeInMillis() - LastEventTime(XIAllDevices).milliseconds;
|
||||||
|
|
||||||
xScreenSaverQueryInfoReply rep = {
|
xScreenSaverQueryInfoReply rep = {
|
||||||
.type = X_Reply,
|
.window = pSaver->wid,
|
||||||
.sequenceNumber = client->sequence,
|
.idle = lastInput,
|
||||||
.window = pSaver->wid
|
.eventMask = getEventMask(pDraw->pScreen, client),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (screenIsSaved != SCREEN_SAVER_OFF) {
|
if (screenIsSaved != SCREEN_SAVER_OFF) {
|
||||||
rep.state = ScreenSaverOn;
|
rep.state = ScreenSaverOn;
|
||||||
if (ScreenSaverTime)
|
if (ScreenSaverTime)
|
||||||
|
|
@ -654,33 +651,30 @@ ProcScreenSaverQueryInfo(ClientPtr client)
|
||||||
rep.state = ScreenSaverDisabled;
|
rep.state = ScreenSaverDisabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.idle = lastInput;
|
|
||||||
rep.eventMask = getEventMask(pDraw->pScreen, client);
|
|
||||||
if (pPriv && pPriv->attr)
|
if (pPriv && pPriv->attr)
|
||||||
rep.kind = ScreenSaverExternal;
|
rep.kind = ScreenSaverExternal;
|
||||||
else if (ScreenSaverBlanking != DontPreferBlanking)
|
else if (ScreenSaverBlanking != DontPreferBlanking)
|
||||||
rep.kind = ScreenSaverBlanked;
|
rep.kind = ScreenSaverBlanked;
|
||||||
else
|
else
|
||||||
rep.kind = ScreenSaverInternal;
|
rep.kind = ScreenSaverInternal;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(window);
|
||||||
swapl(&rep.window);
|
REPLY_FIELD_CARD32(tilOrSince);
|
||||||
swapl(&rep.tilOrSince);
|
REPLY_FIELD_CARD32(idle);
|
||||||
swapl(&rep.idle);
|
REPLY_FIELD_CARD32(eventMask);
|
||||||
swapl(&rep.eventMask);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverSelectInput(ClientPtr client)
|
ProcScreenSaverSelectInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSelectInputReq);
|
REQUEST_HEAD_STRUCT(xScreenSaverSelectInputReq);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(eventMask);
|
||||||
|
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1058,8 +1052,16 @@ ScreenSaverUnsetAttributes(ClientPtr client, Drawable drawable)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverSetAttributes(ClientPtr client)
|
ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
REQUEST_HEAD_AT_LEAST(xScreenSaverSetAttributesReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD16(x);
|
||||||
|
REQUEST_FIELD_CARD16(y);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
REQUEST_FIELD_CARD16(borderWidth);
|
||||||
|
REQUEST_FIELD_CARD32(visualID);
|
||||||
|
REQUEST_FIELD_CARD32(mask);
|
||||||
|
REQUEST_REST_CARD32();
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
|
|
@ -1145,15 +1147,14 @@ ProcScreenSaverSetAttributes(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
REQUEST_HEAD_STRUCT(xScreenSaverUnsetAttributesReq);
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (!noPanoramiXExtension) {
|
if (!noPanoramiXExtension) {
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
int rc, i;
|
int rc, i;
|
||||||
|
|
||||||
|
|
||||||
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
rc = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1162,8 +1163,6 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
|
for (i = PanoramiXNumScreens - 1; i > 0; i--) {
|
||||||
ScreenSaverUnsetAttributes(client, draw->info[i].id);
|
ScreenSaverUnsetAttributes(client, draw->info[i].id);
|
||||||
}
|
}
|
||||||
|
|
||||||
stuff->drawable = draw->info[0].id;
|
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
|
||||||
|
|
@ -1173,12 +1172,11 @@ ProcScreenSaverUnsetAttributes(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverSuspend(ClientPtr client)
|
ProcScreenSaverSuspend(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xScreenSaverSuspendReq);
|
||||||
|
REQUEST_FIELD_CARD32(suspend);
|
||||||
|
|
||||||
ScreenSaverSuspensionPtr *prev, this;
|
ScreenSaverSuspensionPtr *prev, this;
|
||||||
BOOL suspend;
|
BOOL suspend;
|
||||||
|
|
||||||
REQUEST(xScreenSaverSuspendReq);
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Old versions of XCB encode suspend as 1 byte followed by three
|
* Old versions of XCB encode suspend as 1 byte followed by three
|
||||||
* pad bytes (which are always cleared), instead of a 4 byte
|
* pad bytes (which are always cleared), instead of a 4 byte
|
||||||
|
|
@ -1257,82 +1255,6 @@ ProcScreenSaverDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcScreenSaverQueryInfo(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xScreenSaverQueryInfoReq);
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
return ProcScreenSaverQueryInfo(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcScreenSaverSelectInput(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xScreenSaverSelectInputReq);
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->eventMask);
|
|
||||||
return ProcScreenSaverSelectInput(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcScreenSaverSetAttributes(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xScreenSaverSetAttributesReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swaps(&stuff->x);
|
|
||||||
swaps(&stuff->y);
|
|
||||||
swaps(&stuff->width);
|
|
||||||
swaps(&stuff->height);
|
|
||||||
swaps(&stuff->borderWidth);
|
|
||||||
swapl(&stuff->visualID);
|
|
||||||
swapl(&stuff->mask);
|
|
||||||
SwapRestL(stuff);
|
|
||||||
return ProcScreenSaverSetAttributes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcScreenSaverUnsetAttributes(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xScreenSaverUnsetAttributesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
return ProcScreenSaverUnsetAttributes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcScreenSaverSuspend(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xScreenSaverSuspendReq);
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
|
|
||||||
swapl(&stuff->suspend);
|
|
||||||
return ProcScreenSaverSuspend(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcScreenSaverDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_ScreenSaverQueryVersion:
|
|
||||||
return ProcScreenSaverQueryVersion(client);
|
|
||||||
case X_ScreenSaverQueryInfo:
|
|
||||||
return SProcScreenSaverQueryInfo(client);
|
|
||||||
case X_ScreenSaverSelectInput:
|
|
||||||
return SProcScreenSaverSelectInput(client);
|
|
||||||
case X_ScreenSaverSetAttributes:
|
|
||||||
return SProcScreenSaverSetAttributes(client);
|
|
||||||
case X_ScreenSaverUnsetAttributes:
|
|
||||||
return SProcScreenSaverUnsetAttributes(client);
|
|
||||||
case X_ScreenSaverSuspend:
|
|
||||||
return SProcScreenSaverSuspend(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ScreenSaverExtensionInit(void)
|
ScreenSaverExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
|
@ -1354,7 +1276,7 @@ ScreenSaverExtensionInit(void)
|
||||||
if (AttrType && SaverEventType && SuspendType &&
|
if (AttrType && SaverEventType && SuspendType &&
|
||||||
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
(extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
|
||||||
ProcScreenSaverDispatch,
|
ProcScreenSaverDispatch,
|
||||||
SProcScreenSaverDispatch, NULL,
|
ProcScreenSaverDispatch, NULL,
|
||||||
StandardMinorOpcode))) {
|
StandardMinorOpcode))) {
|
||||||
ScreenSaverEventBase = extEntry->eventBase;
|
ScreenSaverEventBase = extEntry->eventBase;
|
||||||
EventSwapVector[ScreenSaverEventBase] =
|
EventSwapVector[ScreenSaverEventBase] =
|
||||||
|
|
|
||||||
147
Xext/security.c
147
Xext/security.c
|
|
@ -32,6 +32,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/registry_priv.h"
|
#include "dix/registry_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
#include "include/extinit_priv.h"
|
#include "include/extinit_priv.h"
|
||||||
#include "os/audit.h"
|
#include "os/audit.h"
|
||||||
|
|
@ -348,25 +349,19 @@ SecurityStartAuthorizationTimer(SecurityAuthorizationPtr pAuth)
|
||||||
static int
|
static int
|
||||||
ProcSecurityQueryVersion(ClientPtr client)
|
ProcSecurityQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xSecurityQueryVersionReq); */
|
REQUEST_HEAD_STRUCT(xSecurityQueryVersionReq);
|
||||||
|
REQUEST_FIELD_CARD16(majorVersion);
|
||||||
|
REQUEST_FIELD_CARD16(minorVersion);
|
||||||
|
|
||||||
xSecurityQueryVersionReply rep = {
|
xSecurityQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_SECURITY_MAJOR_VERSION,
|
.majorVersion = SERVER_SECURITY_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_SECURITY_MINOR_VERSION
|
.minorVersion = SERVER_SECURITY_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
}
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
} /* ProcSecurityQueryVersion */
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
|
SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
|
||||||
|
|
@ -403,16 +398,32 @@ SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
|
||||||
static int
|
static int
|
||||||
ProcSecurityGenerateAuthorization(ClientPtr client)
|
ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSecurityGenerateAuthorizationReq);
|
REQUEST_HEAD_AT_LEAST(xSecurityGenerateAuthorizationReq);
|
||||||
|
REQUEST_FIELD_CARD16(nbytesAuthProto);
|
||||||
|
REQUEST_FIELD_CARD16(nbytesAuthData);
|
||||||
|
REQUEST_FIELD_CARD32(valueMask);
|
||||||
|
|
||||||
|
int values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
||||||
|
bytes_to_int32(stuff->nbytesAuthData);
|
||||||
|
|
||||||
|
if (values_offset > stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
|
CARD32 *values = (CARD32 *) (&stuff[1]) + values_offset;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
unsigned long nvalues;
|
||||||
|
nvalues = (((CARD32 *) stuff) + stuff->length) - values;
|
||||||
|
SwapLongs(values, nvalues);
|
||||||
|
}
|
||||||
|
|
||||||
int len; /* request length in CARD32s */
|
int len; /* request length in CARD32s */
|
||||||
Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
|
Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
|
||||||
int err; /* error to return from this function */
|
int err; /* error to return from this function */
|
||||||
XID authId; /* authorization ID assigned by os layer */
|
XID authId; /* authorization ID assigned by os layer */
|
||||||
xSecurityGenerateAuthorizationReply rep; /* reply struct */
|
|
||||||
unsigned int trustLevel; /* trust level of new auth */
|
unsigned int trustLevel; /* trust level of new auth */
|
||||||
XID group; /* group of new auth */
|
XID group; /* group of new auth */
|
||||||
CARD32 timeout; /* timeout of new auth */
|
CARD32 timeout; /* timeout of new auth */
|
||||||
CARD32 *values; /* list of supplied attributes */
|
|
||||||
char *protoname; /* auth proto name sent in request */
|
char *protoname; /* auth proto name sent in request */
|
||||||
char *protodata; /* auth proto data sent in request */
|
char *protodata; /* auth proto data sent in request */
|
||||||
unsigned int authdata_len; /* # bytes of generated auth data */
|
unsigned int authdata_len; /* # bytes of generated auth data */
|
||||||
|
|
@ -421,11 +432,8 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
|
|
||||||
/* check request length */
|
/* check request length */
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
len = bytes_to_int32(sizeof(xSecurityGenerateAuthorizationReq))
|
||||||
len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq));
|
+ values_offset;
|
||||||
len += bytes_to_int32(stuff->nbytesAuthProto);
|
|
||||||
len += bytes_to_int32(stuff->nbytesAuthData);
|
|
||||||
values = ((CARD32 *) stuff) + len;
|
|
||||||
len += Ones(stuff->valueMask);
|
len += Ones(stuff->valueMask);
|
||||||
if (client->req_len != len)
|
if (client->req_len != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
@ -536,31 +544,22 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
if (pAuth->timeout != 0)
|
if (pAuth->timeout != 0)
|
||||||
SecurityStartAuthorizationTimer(pAuth);
|
SecurityStartAuthorizationTimer(pAuth);
|
||||||
|
|
||||||
/* tell client the auth id and data */
|
|
||||||
|
|
||||||
rep = (xSecurityGenerateAuthorizationReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(authdata_len),
|
|
||||||
.authId = authId,
|
|
||||||
.dataLength = authdata_len
|
|
||||||
};
|
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.authId);
|
|
||||||
swaps(&rep.dataLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), &rep);
|
|
||||||
WriteToClient(client, authdata_len, pAuthdata);
|
|
||||||
|
|
||||||
SecurityAudit
|
SecurityAudit
|
||||||
("client %d generated authorization %lu trust %d timeout %lu group %lu events %lu\n",
|
("client %d generated authorization %lu trust %d timeout %lu group %lu events %lu\n",
|
||||||
client->index, (unsigned long)pAuth->id, pAuth->trustLevel, (unsigned long)pAuth->timeout,
|
client->index, (unsigned long)pAuth->id, pAuth->trustLevel, (unsigned long)pAuth->timeout,
|
||||||
(unsigned long)pAuth->group, (unsigned long)eventMask);
|
(unsigned long)pAuth->group, (unsigned long)eventMask);
|
||||||
|
|
||||||
|
/* tell client the auth id and data */
|
||||||
|
xSecurityGenerateAuthorizationReply rep = {
|
||||||
|
.authId = authId,
|
||||||
|
.dataLength = authdata_len
|
||||||
|
};
|
||||||
|
|
||||||
|
REPLY_FIELD_CARD32(authId);
|
||||||
|
REPLY_FIELD_CARD16(dataLength);
|
||||||
|
REPLY_SEND_EXTRA(pAuthdata, authdata_len);
|
||||||
|
|
||||||
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
|
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
|
|
@ -576,12 +575,12 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSecurityRevokeAuthorization(ClientPtr client)
|
ProcSecurityRevokeAuthorization(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSecurityRevokeAuthorizationReq);
|
REQUEST_HEAD_STRUCT(xSecurityRevokeAuthorizationReq);
|
||||||
|
REQUEST_FIELD_CARD32(authId);
|
||||||
|
|
||||||
SecurityAuthorizationPtr pAuth;
|
SecurityAuthorizationPtr pAuth;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pAuth, stuff->authId,
|
rc = dixLookupResourceByType((void **) &pAuth, stuff->authId,
|
||||||
SecurityAuthorizationResType, client,
|
SecurityAuthorizationResType, client,
|
||||||
DixDestroyAccess);
|
DixDestroyAccess);
|
||||||
|
|
@ -609,64 +608,6 @@ ProcSecurityDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
} /* ProcSecurityDispatch */
|
} /* ProcSecurityDispatch */
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSecurityQueryVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSecurityQueryVersionReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
|
||||||
swaps(&stuff->majorVersion);
|
|
||||||
swaps(&stuff->minorVersion);
|
|
||||||
return ProcSecurityQueryVersion(client);
|
|
||||||
} /* SProcSecurityQueryVersion */
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSecurityGenerateAuthorization(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSecurityGenerateAuthorizationReq);
|
|
||||||
CARD32 *values;
|
|
||||||
unsigned long nvalues;
|
|
||||||
int values_offset;
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
|
||||||
swaps(&stuff->nbytesAuthProto);
|
|
||||||
swaps(&stuff->nbytesAuthData);
|
|
||||||
swapl(&stuff->valueMask);
|
|
||||||
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
|
||||||
bytes_to_int32(stuff->nbytesAuthData);
|
|
||||||
if (values_offset >
|
|
||||||
client->req_len - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
|
||||||
return BadLength;
|
|
||||||
values = (CARD32 *) (&stuff[1]) + values_offset;
|
|
||||||
nvalues = (((CARD32 *) stuff) + client->req_len) - values;
|
|
||||||
SwapLongs(values, nvalues);
|
|
||||||
return ProcSecurityGenerateAuthorization(client);
|
|
||||||
} /* SProcSecurityGenerateAuthorization */
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSecurityRevokeAuthorization(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSecurityRevokeAuthorizationReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
|
|
||||||
swapl(&stuff->authId);
|
|
||||||
return ProcSecurityRevokeAuthorization(client);
|
|
||||||
} /* SProcSecurityRevokeAuthorization */
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSecurityDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_SecurityQueryVersion:
|
|
||||||
return SProcSecurityQueryVersion(client);
|
|
||||||
case X_SecurityGenerateAuthorization:
|
|
||||||
return SProcSecurityGenerateAuthorization(client);
|
|
||||||
case X_SecurityRevokeAuthorization:
|
|
||||||
return SProcSecurityRevokeAuthorization(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
} /* SProcSecurityDispatch */
|
|
||||||
|
|
||||||
static void _X_COLD
|
static void _X_COLD
|
||||||
SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from,
|
SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from,
|
||||||
xSecurityAuthorizationRevokedEvent * to)
|
xSecurityAuthorizationRevokedEvent * to)
|
||||||
|
|
@ -1078,7 +1019,7 @@ SecurityExtensionInit(void)
|
||||||
/* Add extension to server */
|
/* Add extension to server */
|
||||||
extEntry = AddExtension(SECURITY_EXTENSION_NAME,
|
extEntry = AddExtension(SECURITY_EXTENSION_NAME,
|
||||||
XSecurityNumberEvents, XSecurityNumberErrors,
|
XSecurityNumberEvents, XSecurityNumberErrors,
|
||||||
ProcSecurityDispatch, SProcSecurityDispatch,
|
ProcSecurityDispatch, ProcSecurityDispatch,
|
||||||
SecurityResetProc, StandardMinorOpcode);
|
SecurityResetProc, StandardMinorOpcode);
|
||||||
|
|
||||||
SecurityErrorBase = extEntry->errorBase;
|
SecurityErrorBase = extEntry->errorBase;
|
||||||
|
|
|
||||||
245
Xext/shape.c
245
Xext/shape.c
|
|
@ -33,6 +33,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/gc_priv.h"
|
#include "dix/gc_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "Xext/panoramiX.h"
|
#include "Xext/panoramiX.h"
|
||||||
#include "Xext/panoramiXsrv.h"
|
#include "Xext/panoramiXsrv.h"
|
||||||
|
|
||||||
|
|
@ -204,24 +205,16 @@ CreateClipShape(WindowPtr pWin)
|
||||||
static int
|
static int
|
||||||
ProcShapeQueryVersion(ClientPtr client)
|
ProcShapeQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShapeQueryVersionReq);
|
||||||
|
|
||||||
xShapeQueryVersionReply rep = {
|
xShapeQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_SHAPE_MAJOR_VERSION,
|
.majorVersion = SERVER_SHAPE_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_SHAPE_MINOR_VERSION
|
.minorVersion = SERVER_SHAPE_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeQueryVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShapeQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -291,8 +284,11 @@ ShapeRectangles(ClientPtr client, xShapeRectanglesReq *stuff)
|
||||||
static int
|
static int
|
||||||
ProcShapeRectangles(ClientPtr client)
|
ProcShapeRectangles(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeRectanglesReq);
|
REQUEST_HEAD_AT_LEAST(xShapeRectanglesReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
|
REQUEST_FIELD_CARD32(dest);
|
||||||
|
REQUEST_FIELD_CARD16(xOff);
|
||||||
|
REQUEST_FIELD_CARD16(yOff);
|
||||||
|
REQUEST_REST_CARD16();
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (noPanoramiXExtension)
|
if (noPanoramiXExtension)
|
||||||
|
|
@ -387,8 +383,11 @@ ShapeMask(ClientPtr client, xShapeMaskReq *stuff)
|
||||||
static int
|
static int
|
||||||
ProcShapeMask(ClientPtr client)
|
ProcShapeMask(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeMaskReq);
|
REQUEST_HEAD_STRUCT(xShapeMaskReq);
|
||||||
REQUEST_SIZE_MATCH(xShapeMaskReq);
|
REQUEST_FIELD_CARD32(dest);
|
||||||
|
REQUEST_FIELD_CARD16(xOff);
|
||||||
|
REQUEST_FIELD_CARD16(yOff);
|
||||||
|
REQUEST_FIELD_CARD32(src);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (noPanoramiXExtension)
|
if (noPanoramiXExtension)
|
||||||
|
|
@ -513,8 +512,11 @@ ShapeCombine(ClientPtr client, xShapeCombineReq *stuff)
|
||||||
static int
|
static int
|
||||||
ProcShapeCombine(ClientPtr client)
|
ProcShapeCombine(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeCombineReq);
|
REQUEST_HEAD_STRUCT(xShapeCombineReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xShapeCombineReq);
|
REQUEST_FIELD_CARD32(dest);
|
||||||
|
REQUEST_FIELD_CARD16(xOff);
|
||||||
|
REQUEST_FIELD_CARD16(yOff);
|
||||||
|
REQUEST_FIELD_CARD32(src);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (noPanoramiXExtension)
|
if (noPanoramiXExtension)
|
||||||
|
|
@ -582,8 +584,10 @@ ShapeOffset(ClientPtr client, xShapeOffsetReq *stuff)
|
||||||
static int
|
static int
|
||||||
ProcShapeOffset(ClientPtr client)
|
ProcShapeOffset(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeOffsetReq);
|
REQUEST_HEAD_AT_LEAST(xShapeOffsetReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xShapeOffsetReq);
|
REQUEST_FIELD_CARD32(dest);
|
||||||
|
REQUEST_FIELD_CARD16(yOff);
|
||||||
|
REQUEST_FIELD_CARD16(yOff);
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
PanoramiXRes *win;
|
PanoramiXRes *win;
|
||||||
|
|
@ -612,24 +616,23 @@ ProcShapeOffset(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcShapeQueryExtents(ClientPtr client)
|
ProcShapeQueryExtents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeQueryExtentsReq);
|
REQUEST_HEAD_STRUCT(xShapeQueryExtentsReq);
|
||||||
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xShapeQueryExtentsReply rep;
|
|
||||||
BoxRec extents, *pExtents;
|
BoxRec extents, *pExtents;
|
||||||
int rc;
|
int rc;
|
||||||
RegionPtr region;
|
RegionPtr region;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeQueryExtentsReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rep = (xShapeQueryExtentsReply) {
|
|
||||||
.type = X_Reply,
|
xShapeQueryExtentsReply rep = {
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.boundingShaped = (wBoundingShape(pWin) != 0),
|
.boundingShaped = (wBoundingShape(pWin) != 0),
|
||||||
.clipShaped = (wClipShape(pWin) != 0)
|
.clipShaped = (wClipShape(pWin) != 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((region = wBoundingShape(pWin))) {
|
if ((region = wBoundingShape(pWin))) {
|
||||||
/* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
|
/* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
|
||||||
pExtents = RegionExtents(region);
|
pExtents = RegionExtents(region);
|
||||||
|
|
@ -660,20 +663,16 @@ ProcShapeQueryExtents(ClientPtr client)
|
||||||
rep.yClipShape = extents.y1;
|
rep.yClipShape = extents.y1;
|
||||||
rep.widthClipShape = extents.x2 - extents.x1;
|
rep.widthClipShape = extents.x2 - extents.x1;
|
||||||
rep.heightClipShape = extents.y2 - extents.y1;
|
rep.heightClipShape = extents.y2 - extents.y1;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(xBoundingShape);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD16(yBoundingShape);
|
||||||
swaps(&rep.xBoundingShape);
|
REPLY_FIELD_CARD16(widthBoundingShape);
|
||||||
swaps(&rep.yBoundingShape);
|
REPLY_FIELD_CARD16(heightBoundingShape);
|
||||||
swaps(&rep.widthBoundingShape);
|
REPLY_FIELD_CARD16(xClipShape);
|
||||||
swaps(&rep.heightBoundingShape);
|
REPLY_FIELD_CARD16(yClipShape);
|
||||||
swaps(&rep.xClipShape);
|
REPLY_FIELD_CARD16(widthClipShape);
|
||||||
swaps(&rep.yClipShape);
|
REPLY_FIELD_CARD16(heightClipShape);
|
||||||
swaps(&rep.widthClipShape);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.heightClipShape);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShapeQueryExtentsReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*ARGSUSED*/ static int
|
/*ARGSUSED*/ static int
|
||||||
|
|
@ -721,13 +720,14 @@ ShapeFreeEvents(void *data, XID id)
|
||||||
static int
|
static int
|
||||||
ProcShapeSelectInput(ClientPtr client)
|
ProcShapeSelectInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeSelectInputReq);
|
REQUEST_HEAD_STRUCT(xShapeSelectInputReq);
|
||||||
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead;
|
ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead;
|
||||||
XID clientResource;
|
XID clientResource;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeSelectInputReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -892,13 +892,13 @@ SendShapeNotify(WindowPtr pWin, int which)
|
||||||
static int
|
static int
|
||||||
ProcShapeInputSelected(ClientPtr client)
|
ProcShapeInputSelected(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeInputSelectedReq);
|
REQUEST_HEAD_STRUCT(xShapeInputSelectedReq);
|
||||||
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
ShapeEventPtr pShapeEvent, *pHead;
|
ShapeEventPtr pShapeEvent, *pHead;
|
||||||
int enabled, rc;
|
int enabled, rc;
|
||||||
xShapeInputSelectedReply rep;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeInputSelectedReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -915,31 +915,25 @@ ProcShapeInputSelected(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep = (xShapeInputSelectedReply) {
|
|
||||||
.type = X_Reply,
|
xShapeInputSelectedReply rep = {
|
||||||
.enabled = enabled,
|
.enabled = enabled,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShapeInputSelectedReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcShapeGetRectangles(ClientPtr client)
|
ProcShapeGetRectangles(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xShapeGetRectanglesReq);
|
REQUEST_HEAD_STRUCT(xShapeGetRectanglesReq);
|
||||||
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xShapeGetRectanglesReply rep;
|
|
||||||
xRectangle *rects = NULL;
|
xRectangle *rects = NULL;
|
||||||
int nrects, i, rc;
|
int nrects, i, rc;
|
||||||
RegionPtr region;
|
RegionPtr region;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -1000,21 +994,15 @@ ProcShapeGetRectangles(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep = (xShapeGetRectanglesReply) {
|
|
||||||
.type = X_Reply,
|
xShapeGetRectanglesReply rep = {
|
||||||
.ordering = YXBanded,
|
.ordering = YXBanded,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(nrects * sizeof(xRectangle)),
|
|
||||||
.nrects = nrects
|
.nrects = nrects
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_BUF_CARD16(rects, (unsigned long) nrects * 4);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(nrects);
|
||||||
swapl(&rep.nrects);
|
REPLY_SEND_EXTRA(rects, nrects * sizeof(xRectangle));
|
||||||
SwapShorts((short *) rects, (unsigned long) nrects * 4);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
WriteToClient(client, nrects * sizeof(xRectangle), rects);
|
|
||||||
free(rects);
|
free(rects);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -1062,117 +1050,6 @@ SShapeNotifyEvent(xShapeNotifyEvent * from, xShapeNotifyEvent * to)
|
||||||
to->shaped = from->shaped;
|
to->shaped = from->shaped;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeRectangles(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeRectanglesReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xShapeRectanglesReq);
|
|
||||||
swapl(&stuff->dest);
|
|
||||||
swaps(&stuff->xOff);
|
|
||||||
swaps(&stuff->yOff);
|
|
||||||
SwapRestS(stuff);
|
|
||||||
return ProcShapeRectangles(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeMask(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeMaskReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeMaskReq);
|
|
||||||
swapl(&stuff->dest);
|
|
||||||
swaps(&stuff->xOff);
|
|
||||||
swaps(&stuff->yOff);
|
|
||||||
swapl(&stuff->src);
|
|
||||||
return ProcShapeMask(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeCombine(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeCombineReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeCombineReq);
|
|
||||||
swapl(&stuff->dest);
|
|
||||||
swaps(&stuff->xOff);
|
|
||||||
swaps(&stuff->yOff);
|
|
||||||
swapl(&stuff->src);
|
|
||||||
return ProcShapeCombine(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeOffset(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeOffsetReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeOffsetReq);
|
|
||||||
swapl(&stuff->dest);
|
|
||||||
swaps(&stuff->xOff);
|
|
||||||
swaps(&stuff->yOff);
|
|
||||||
return ProcShapeOffset(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeQueryExtents(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeQueryExtentsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeQueryExtentsReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcShapeQueryExtents(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeSelectInput(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeSelectInputReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeSelectInputReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcShapeSelectInput(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeInputSelected(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeInputSelectedReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeInputSelectedReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcShapeInputSelected(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeGetRectangles(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShapeGetRectanglesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return ProcShapeGetRectangles(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShapeDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_ShapeQueryVersion:
|
|
||||||
return ProcShapeQueryVersion(client);
|
|
||||||
case X_ShapeRectangles:
|
|
||||||
return SProcShapeRectangles(client);
|
|
||||||
case X_ShapeMask:
|
|
||||||
return SProcShapeMask(client);
|
|
||||||
case X_ShapeCombine:
|
|
||||||
return SProcShapeCombine(client);
|
|
||||||
case X_ShapeOffset:
|
|
||||||
return SProcShapeOffset(client);
|
|
||||||
case X_ShapeQueryExtents:
|
|
||||||
return SProcShapeQueryExtents(client);
|
|
||||||
case X_ShapeSelectInput:
|
|
||||||
return SProcShapeSelectInput(client);
|
|
||||||
case X_ShapeInputSelected:
|
|
||||||
return SProcShapeInputSelected(client);
|
|
||||||
case X_ShapeGetRectangles:
|
|
||||||
return SProcShapeGetRectangles(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ShapeExtensionInit(void)
|
ShapeExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
|
@ -1182,7 +1059,7 @@ ShapeExtensionInit(void)
|
||||||
ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
|
ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
|
||||||
if (ClientType && ShapeEventType &&
|
if (ClientType && ShapeEventType &&
|
||||||
(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
|
(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
|
||||||
ProcShapeDispatch, SProcShapeDispatch,
|
ProcShapeDispatch, ProcShapeDispatch,
|
||||||
NULL, StandardMinorOpcode))) {
|
NULL, StandardMinorOpcode))) {
|
||||||
ShapeEventBase = extEntry->eventBase;
|
ShapeEventBase = extEntry->eventBase;
|
||||||
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
|
||||||
|
|
|
||||||
374
Xext/shm.c
374
Xext/shm.c
|
|
@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/screen_hooks_priv.h"
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
#include "os/busfault.h"
|
#include "os/busfault.h"
|
||||||
|
|
@ -106,6 +107,8 @@ static void ShmResetProc(ExtensionEntry *extEntry);
|
||||||
static void SShmCompletionEvent(xShmCompletionEvent *from,
|
static void SShmCompletionEvent(xShmCompletionEvent *from,
|
||||||
xShmCompletionEvent *to);
|
xShmCompletionEvent *to);
|
||||||
|
|
||||||
|
static int ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff);
|
||||||
|
|
||||||
static unsigned char ShmReqCode;
|
static unsigned char ShmReqCode;
|
||||||
int ShmCompletionCode;
|
int ShmCompletionCode;
|
||||||
int BadShmSegCode;
|
int BadShmSegCode;
|
||||||
|
|
@ -249,11 +252,10 @@ ShmRegisterFbFuncs(ScreenPtr pScreen)
|
||||||
static int
|
static int
|
||||||
ProcShmQueryVersion(ClientPtr client)
|
ProcShmQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmQueryVersionReq);
|
||||||
|
|
||||||
xShmQueryVersionReply rep = {
|
xShmQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sharedPixmaps = sharedPixmaps,
|
.sharedPixmaps = sharedPixmaps,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_SHM_MAJOR_VERSION,
|
.majorVersion = SERVER_SHM_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_SHM_MINOR_VERSION,
|
.minorVersion = SERVER_SHM_MINOR_VERSION,
|
||||||
.uid = geteuid(),
|
.uid = geteuid(),
|
||||||
|
|
@ -261,18 +263,11 @@ ProcShmQueryVersion(ClientPtr client)
|
||||||
.pixmapFormat = sharedPixmaps ? ZPixmap : 0
|
.pixmapFormat = sharedPixmaps ? ZPixmap : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(uid);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(gid);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
swaps(&rep.uid);
|
|
||||||
swaps(&rep.gid);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShmQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -344,12 +339,16 @@ shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
|
||||||
static int
|
static int
|
||||||
ProcShmAttach(ClientPtr client)
|
ProcShmAttach(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmAttachReq);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
REQUEST_FIELD_CARD32(shmid);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
SHMSTAT_TYPE buf;
|
SHMSTAT_TYPE buf;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
|
|
||||||
REQUEST(xShmAttachReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmAttachReq);
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
||||||
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
||||||
client->errorValue = stuff->readOnly;
|
client->errorValue = stuff->readOnly;
|
||||||
|
|
@ -429,11 +428,14 @@ ShmDetachSegment(void *value, /* must conform to DeleteType */
|
||||||
static int
|
static int
|
||||||
ProcShmDetach(ClientPtr client)
|
ProcShmDetach(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmDetachReq);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
|
|
||||||
REQUEST(xShmDetachReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
|
||||||
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
VERIFY_SHMSEG(stuff->shmseg, shmdesc, client);
|
||||||
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
FreeResource(stuff->shmseg, X11_RESTYPE_NONE);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
@ -490,16 +492,13 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcShmPutImage(ClientPtr client)
|
ShmPutImage(ClientPtr client, xShmPutImageReq *stuff)
|
||||||
{
|
{
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
long length;
|
long length;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
|
|
||||||
REQUEST(xShmPutImageReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
|
||||||
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
|
||||||
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
|
||||||
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
|
||||||
|
|
@ -589,20 +588,16 @@ ProcShmPutImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcShmGetImage(ClientPtr client)
|
ShmGetImage(ClientPtr client, xShmGetImageReq *stuff)
|
||||||
{
|
{
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
long lenPer = 0, length;
|
long lenPer = 0, length;
|
||||||
Mask plane = 0;
|
Mask plane = 0;
|
||||||
xShmGetImageReply xgi;
|
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
VisualID visual = None;
|
VisualID visual = None;
|
||||||
RegionPtr pVisibleRegion = NULL;
|
RegionPtr pVisibleRegion = NULL;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xShmGetImageReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
|
||||||
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
|
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
|
||||||
client->errorValue = stuff->format;
|
client->errorValue = stuff->format;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
@ -642,13 +637,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
visual = None;
|
visual = None;
|
||||||
}
|
}
|
||||||
xgi = (xShmGetImageReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.visual = visual,
|
|
||||||
.depth = pDraw->depth
|
|
||||||
};
|
|
||||||
if (stuff->format == ZPixmap) {
|
if (stuff->format == ZPixmap) {
|
||||||
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
||||||
}
|
}
|
||||||
|
|
@ -660,7 +648,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
|
||||||
xgi.size = length;
|
|
||||||
|
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
|
|
@ -677,7 +664,6 @@ ProcShmGetImage(ClientPtr client)
|
||||||
stuff->format, shmdesc->addr + stuff->offset);
|
stuff->format, shmdesc->addr + stuff->offset);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
length = stuff->offset;
|
length = stuff->offset;
|
||||||
for (; plane; plane >>= 1) {
|
for (; plane; plane >>= 1) {
|
||||||
if (stuff->planeMask & plane) {
|
if (stuff->planeMask & plane) {
|
||||||
|
|
@ -696,27 +682,44 @@ ProcShmGetImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->swapped) {
|
xShmGetImageReply rep = {
|
||||||
swaps(&xgi.sequenceNumber);
|
.visual = visual,
|
||||||
swapl(&xgi.length);
|
.depth = pDraw->depth,
|
||||||
swapl(&xgi.visual);
|
.size = length,
|
||||||
swapl(&xgi.size);
|
};
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
|
|
||||||
|
|
||||||
return Success;
|
REPLY_FIELD_CARD32(visual);
|
||||||
|
REPLY_FIELD_CARD32(size);
|
||||||
|
REPLY_SEND_RET_SUCCESS();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmPutImage(ClientPtr client)
|
ProcShmPutImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmPutImageReq);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD32(gc);
|
||||||
|
REQUEST_FIELD_CARD16(totalWidth);
|
||||||
|
REQUEST_FIELD_CARD16(totalHeight);
|
||||||
|
REQUEST_FIELD_CARD16(srcX);
|
||||||
|
REQUEST_FIELD_CARD16(srcY);
|
||||||
|
REQUEST_FIELD_CARD16(srcWidth);
|
||||||
|
REQUEST_FIELD_CARD16(srcHeight);
|
||||||
|
REQUEST_FIELD_CARD16(dstX);
|
||||||
|
REQUEST_FIELD_CARD16(dstY);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
REQUEST_FIELD_CARD32(offset);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
#ifdef XINERAMA
|
||||||
int j, result, orig_x, orig_y;
|
int j, result, orig_x, orig_y;
|
||||||
PanoramiXRes *draw, *gc;
|
PanoramiXRes *draw, *gc;
|
||||||
Bool sendEvent, isRoot;
|
Bool sendEvent, isRoot;
|
||||||
|
|
||||||
REQUEST(xShmPutImageReq);
|
if (noPanoramiXExtension)
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
return ShmPutImage(client, stuff);
|
||||||
|
|
||||||
result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
result = dixLookupResourceByClass((void **) &draw, stuff->drawable,
|
||||||
XRC_DRAWABLE, client, DixWriteAccess);
|
XRC_DRAWABLE, client, DixWriteAccess);
|
||||||
|
|
@ -743,28 +746,43 @@ ProcPanoramiXShmPutImage(ClientPtr client)
|
||||||
stuff->dstX = orig_x - screenInfo.screens[j]->x;
|
stuff->dstX = orig_x - screenInfo.screens[j]->x;
|
||||||
stuff->dstY = orig_y - screenInfo.screens[j]->y;
|
stuff->dstY = orig_y - screenInfo.screens[j]->y;
|
||||||
}
|
}
|
||||||
result = ProcShmPutImage(client);
|
result = ShmPutImage(client, stuff);
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
#else
|
||||||
|
return ShmPutImage(client, stuff);
|
||||||
|
#endif /* XINERAMA */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmGetImage(ClientPtr client)
|
ProcShmGetImage(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmGetImageReq);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD16(x);
|
||||||
|
REQUEST_FIELD_CARD16(y);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
REQUEST_FIELD_CARD32(planeMask);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
REQUEST_FIELD_CARD32(offset);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
#ifdef XINERAMA
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
xShmGetImageReply xgi;
|
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
int i, x, y, w, h, format, rc;
|
int i, x, y, w, h, format, rc;
|
||||||
Mask plane = 0, planemask;
|
Mask plane = 0, planemask;
|
||||||
long lenPer = 0, length, widthBytesLine;
|
long lenPer = 0, length, widthBytesLine;
|
||||||
Bool isRoot;
|
Bool isRoot;
|
||||||
|
|
||||||
REQUEST(xShmGetImageReq);
|
if (noPanoramiXExtension)
|
||||||
|
return ShmGetImage(client, stuff);
|
||||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
|
||||||
|
|
||||||
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
|
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
|
||||||
client->errorValue = stuff->format;
|
client->errorValue = stuff->format;
|
||||||
|
|
@ -777,7 +795,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
return (rc == BadValue) ? BadDrawable : rc;
|
return (rc == BadValue) ? BadDrawable : rc;
|
||||||
|
|
||||||
if (draw->type == XRT_PIXMAP)
|
if (draw->type == XRT_PIXMAP)
|
||||||
return ProcShmGetImage(client);
|
return ShmGetImage(client, stuff);
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
|
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -848,16 +866,6 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
IncludeInferiors);
|
IncludeInferiors);
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi = (xShmGetImageReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.visual = wVisual(((WindowPtr) pDraw)),
|
|
||||||
.depth = pDraw->depth
|
|
||||||
};
|
|
||||||
|
|
||||||
xgi.size = length;
|
|
||||||
|
|
||||||
if (length == 0) { /* nothing to do */
|
if (length == 0) { /* nothing to do */
|
||||||
}
|
}
|
||||||
else if (format == ZPixmap) {
|
else if (format == ZPixmap) {
|
||||||
|
|
@ -879,33 +887,48 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
free(drawables);
|
free(drawables);
|
||||||
|
|
||||||
if (client->swapped) {
|
xShmGetImageReply rep = {
|
||||||
swaps(&xgi.sequenceNumber);
|
.visual = wVisual(((WindowPtr) pDraw)),
|
||||||
swapl(&xgi.length);
|
.depth = pDraw->depth,
|
||||||
swapl(&xgi.visual);
|
.size = length,
|
||||||
swapl(&xgi.size);
|
};
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xShmGetImageReply), &xgi);
|
|
||||||
|
|
||||||
return Success;
|
REPLY_FIELD_CARD32(visual);
|
||||||
|
REPLY_FIELD_CARD32(size);
|
||||||
|
REPLY_SEND_RET_SUCCESS();
|
||||||
|
#else
|
||||||
|
return ShmGetImage(client, stuff);
|
||||||
|
#endif /* XINERAMA */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
ProcShmCreatePixmap(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmCreatePixmapReq);
|
||||||
|
REQUEST_FIELD_CARD32(pid);
|
||||||
|
REQUEST_FIELD_CARD32(drawable);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
REQUEST_FIELD_CARD32(offset);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
|
#ifdef XINERAMA
|
||||||
|
if (noPanoramiXExtension)
|
||||||
|
return ShmCreatePixmap(client, stuff);
|
||||||
|
|
||||||
ScreenPtr pScreen = NULL;
|
ScreenPtr pScreen = NULL;
|
||||||
PixmapPtr pMap = NULL;
|
PixmapPtr pMap = NULL;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
DepthPtr pDepth;
|
DepthPtr pDepth;
|
||||||
int i, j, result, rc;
|
int i, j, result, rc;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
|
|
||||||
REQUEST(xShmCreatePixmapReq);
|
|
||||||
unsigned int width, height, depth;
|
unsigned int width, height, depth;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
PanoramiXRes *newPix;
|
PanoramiXRes *newPix;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
|
||||||
client->errorValue = stuff->pid;
|
client->errorValue = stuff->pid;
|
||||||
if (!sharedPixmaps)
|
if (!sharedPixmaps)
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
|
@ -1001,8 +1024,10 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||||
AddResource(stuff->pid, XRT_PIXMAP, newPix);
|
AddResource(stuff->pid, XRT_PIXMAP, newPix);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
#else
|
||||||
|
return ShmCreatePixmap(client, stuff);
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
}
|
||||||
|
|
||||||
static PixmapPtr
|
static PixmapPtr
|
||||||
fbShmCreatePixmap(ScreenPtr pScreen,
|
fbShmCreatePixmap(ScreenPtr pScreen,
|
||||||
|
|
@ -1025,7 +1050,7 @@ fbShmCreatePixmap(ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcShmCreatePixmap(ClientPtr client)
|
ShmCreatePixmap(ClientPtr client, xShmCreatePixmapReq *stuff)
|
||||||
{
|
{
|
||||||
PixmapPtr pMap;
|
PixmapPtr pMap;
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
|
|
@ -1033,12 +1058,9 @@ ProcShmCreatePixmap(ClientPtr client)
|
||||||
int i, rc;
|
int i, rc;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
ShmScrPrivateRec *screen_priv;
|
ShmScrPrivateRec *screen_priv;
|
||||||
|
|
||||||
REQUEST(xShmCreatePixmapReq);
|
|
||||||
unsigned int width, height, depth;
|
unsigned int width, height, depth;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
|
||||||
client->errorValue = stuff->pid;
|
client->errorValue = stuff->pid;
|
||||||
if (!sharedPixmaps)
|
if (!sharedPixmaps)
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
|
@ -1120,19 +1142,24 @@ ShmBusfaultNotify(void *context)
|
||||||
static int
|
static int
|
||||||
ProcShmAttachFd(ClientPtr client)
|
ProcShmAttachFd(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmAttachFdReq);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
REQUEST(xShmAttachFdReq);
|
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
|
|
||||||
SetReqFds(client, 1);
|
|
||||||
REQUEST_SIZE_MATCH(xShmAttachFdReq);
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
||||||
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
||||||
client->errorValue = stuff->readOnly;
|
client->errorValue = stuff->readOnly;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
fd = ReadFdFromClient(client);
|
fd = client->recv_fd_list[0];
|
||||||
|
client->recv_fd_list[0] = -1;
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
|
|
@ -1235,17 +1262,16 @@ shm_tmpfile(void)
|
||||||
static int
|
static int
|
||||||
ProcShmCreateSegment(ClientPtr client)
|
ProcShmCreateSegment(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xShmCreateSegmentReq);
|
||||||
|
REQUEST_FIELD_CARD32(shmseg);
|
||||||
|
REQUEST_FIELD_CARD32(size);
|
||||||
|
|
||||||
|
if (!client->local)
|
||||||
|
return BadRequest;
|
||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
ShmDescPtr shmdesc;
|
ShmDescPtr shmdesc;
|
||||||
REQUEST(xShmCreateSegmentReq);
|
|
||||||
xShmCreateSegmentReply rep = {
|
|
||||||
.type = X_Reply,
|
|
||||||
.nfd = 1,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
LEGAL_NEW_RESOURCE(stuff->shmseg, client);
|
||||||
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
if ((stuff->readOnly != xTrue) && (stuff->readOnly != xFalse)) {
|
||||||
client->errorValue = stuff->readOnly;
|
client->errorValue = stuff->readOnly;
|
||||||
|
|
@ -1300,8 +1326,12 @@ ProcShmCreateSegment(ClientPtr client)
|
||||||
close(fd);
|
close(fd);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
WriteToClient(client, sizeof (xShmCreateSegmentReply), &rep);
|
|
||||||
return Success;
|
xShmCreateSegmentReply rep = {
|
||||||
|
.nfd = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
REPLY_SEND_RET_SUCCESS();
|
||||||
}
|
}
|
||||||
#endif /* SHM_FD_PASSING */
|
#endif /* SHM_FD_PASSING */
|
||||||
|
|
||||||
|
|
@ -1310,34 +1340,18 @@ ProcShmDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
|
||||||
if (stuff->data == X_ShmQueryVersion)
|
|
||||||
return ProcShmQueryVersion(client);
|
|
||||||
|
|
||||||
if (!client->local)
|
|
||||||
return BadRequest;
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
switch (stuff->data) {
|
||||||
|
case X_ShmQueryVersion:
|
||||||
|
return ProcShmQueryVersion(client);
|
||||||
case X_ShmAttach:
|
case X_ShmAttach:
|
||||||
return ProcShmAttach(client);
|
return ProcShmAttach(client);
|
||||||
case X_ShmDetach:
|
case X_ShmDetach:
|
||||||
return ProcShmDetach(client);
|
return ProcShmDetach(client);
|
||||||
case X_ShmPutImage:
|
case X_ShmPutImage:
|
||||||
#ifdef XINERAMA
|
|
||||||
if (!noPanoramiXExtension)
|
|
||||||
return ProcPanoramiXShmPutImage(client);
|
|
||||||
#endif /* XINERAMA */
|
|
||||||
return ProcShmPutImage(client);
|
return ProcShmPutImage(client);
|
||||||
case X_ShmGetImage:
|
case X_ShmGetImage:
|
||||||
#ifdef XINERAMA
|
|
||||||
if (!noPanoramiXExtension)
|
|
||||||
return ProcPanoramiXShmGetImage(client);
|
|
||||||
#endif /* XINERAMA */
|
|
||||||
return ProcShmGetImage(client);
|
return ProcShmGetImage(client);
|
||||||
case X_ShmCreatePixmap:
|
case X_ShmCreatePixmap:
|
||||||
#ifdef XINERAMA
|
|
||||||
if (!noPanoramiXExtension)
|
|
||||||
return ProcPanoramiXShmCreatePixmap(client);
|
|
||||||
#endif /* XINERAMA */
|
|
||||||
return ProcShmCreatePixmap(client);
|
return ProcShmCreatePixmap(client);
|
||||||
#ifdef SHM_FD_PASSING
|
#ifdef SHM_FD_PASSING
|
||||||
case X_ShmAttachFd:
|
case X_ShmAttachFd:
|
||||||
|
|
@ -1362,130 +1376,6 @@ SShmCompletionEvent(xShmCompletionEvent * from, xShmCompletionEvent * to)
|
||||||
cpswapl(from->offset, to->offset);
|
cpswapl(from->offset, to->offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmAttach(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmAttachReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShmAttachReq);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
swapl(&stuff->shmid);
|
|
||||||
return ProcShmAttach(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmDetach(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmDetachReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShmDetachReq);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
return ProcShmDetach(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmPutImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmPutImageReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShmPutImageReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swapl(&stuff->gc);
|
|
||||||
swaps(&stuff->totalWidth);
|
|
||||||
swaps(&stuff->totalHeight);
|
|
||||||
swaps(&stuff->srcX);
|
|
||||||
swaps(&stuff->srcY);
|
|
||||||
swaps(&stuff->srcWidth);
|
|
||||||
swaps(&stuff->srcHeight);
|
|
||||||
swaps(&stuff->dstX);
|
|
||||||
swaps(&stuff->dstY);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
swapl(&stuff->offset);
|
|
||||||
return ProcShmPutImage(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmGetImage(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmGetImageReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShmGetImageReq);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swaps(&stuff->x);
|
|
||||||
swaps(&stuff->y);
|
|
||||||
swaps(&stuff->width);
|
|
||||||
swaps(&stuff->height);
|
|
||||||
swapl(&stuff->planeMask);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
swapl(&stuff->offset);
|
|
||||||
return ProcShmGetImage(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmCreatePixmap(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmCreatePixmapReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
|
|
||||||
swapl(&stuff->pid);
|
|
||||||
swapl(&stuff->drawable);
|
|
||||||
swaps(&stuff->width);
|
|
||||||
swaps(&stuff->height);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
swapl(&stuff->offset);
|
|
||||||
return ProcShmCreatePixmap(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SHM_FD_PASSING
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmAttachFd(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmAttachFdReq);
|
|
||||||
SetReqFds(client, 1);
|
|
||||||
REQUEST_SIZE_MATCH(xShmAttachFdReq);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
return ProcShmAttachFd(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmCreateSegment(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xShmCreateSegmentReq);
|
|
||||||
REQUEST_SIZE_MATCH(xShmCreateSegmentReq);
|
|
||||||
swapl(&stuff->shmseg);
|
|
||||||
swapl(&stuff->size);
|
|
||||||
return ProcShmCreateSegment(client);
|
|
||||||
}
|
|
||||||
#endif /* SHM_FD_PASSING */
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcShmDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
if (stuff->data == X_ShmQueryVersion)
|
|
||||||
return ProcShmQueryVersion(client);
|
|
||||||
|
|
||||||
if (!client->local)
|
|
||||||
return BadRequest;
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_ShmAttach:
|
|
||||||
return SProcShmAttach(client);
|
|
||||||
case X_ShmDetach:
|
|
||||||
return SProcShmDetach(client);
|
|
||||||
case X_ShmPutImage:
|
|
||||||
return SProcShmPutImage(client);
|
|
||||||
case X_ShmGetImage:
|
|
||||||
return SProcShmGetImage(client);
|
|
||||||
case X_ShmCreatePixmap:
|
|
||||||
return SProcShmCreatePixmap(client);
|
|
||||||
#ifdef SHM_FD_PASSING
|
|
||||||
case X_ShmAttachFd:
|
|
||||||
return SProcShmAttachFd(client);
|
|
||||||
case X_ShmCreateSegment:
|
|
||||||
return SProcShmCreateSegment(client);
|
|
||||||
#endif
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ShmPixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr pPixmap)
|
static void ShmPixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr pPixmap)
|
||||||
{
|
{
|
||||||
ShmDetachSegment(
|
ShmDetachSegment(
|
||||||
|
|
@ -1530,7 +1420,7 @@ ShmExtensionInit(void)
|
||||||
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
|
ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
|
||||||
if (ShmSegType &&
|
if (ShmSegType &&
|
||||||
(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
|
(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
|
||||||
ProcShmDispatch, SProcShmDispatch,
|
ProcShmDispatch, ProcShmDispatch,
|
||||||
ShmResetProc, StandardMinorOpcode))) {
|
ShmResetProc, StandardMinorOpcode))) {
|
||||||
ShmReqCode = (unsigned char) extEntry->base;
|
ShmReqCode = (unsigned char) extEntry->base;
|
||||||
ShmCompletionCode = extEntry->eventBase;
|
ShmCompletionCode = extEntry->eventBase;
|
||||||
|
|
|
||||||
489
Xext/sync.c
489
Xext/sync.c
|
|
@ -59,6 +59,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
#include <X11/extensions/syncproto.h>
|
#include <X11/extensions/syncproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
#include "os/osdep.h"
|
#include "os/osdep.h"
|
||||||
|
|
||||||
|
|
@ -1267,21 +1268,14 @@ FreeAlarmClient(void *value, XID id)
|
||||||
static int
|
static int
|
||||||
ProcSyncInitialize(ClientPtr client)
|
ProcSyncInitialize(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xSyncInitializeReq);
|
||||||
|
|
||||||
xSyncInitializeReply rep = {
|
xSyncInitializeReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_SYNC_MAJOR_VERSION,
|
.majorVersion = SERVER_SYNC_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_SYNC_MINOR_VERSION,
|
.minorVersion = SERVER_SYNC_MINOR_VERSION,
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncInitializeReq);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1290,17 +1284,16 @@ ProcSyncInitialize(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncListSystemCounters(ClientPtr client)
|
ProcSyncListSystemCounters(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xSyncListSystemCountersReq);
|
||||||
|
|
||||||
xSyncListSystemCountersReply rep = {
|
xSyncListSystemCountersReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.nCounters = 0,
|
.nCounters = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
SysCounterInfo *psci;
|
SysCounterInfo *psci;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
xSyncSystemCounter *list = NULL, *walklist = NULL;
|
xSyncSystemCounter *list = NULL, *walklist = NULL;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
|
|
||||||
|
|
||||||
xorg_list_for_each_entry(psci, &SysCounterList, entry) {
|
xorg_list_for_each_entry(psci, &SysCounterList, entry) {
|
||||||
/* pad to 4 byte boundary */
|
/* pad to 4 byte boundary */
|
||||||
len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name));
|
len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name));
|
||||||
|
|
@ -1313,13 +1306,7 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.length = bytes_to_int32(len);
|
REPLY_FIELD_CARD32(nCounters);
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.nCounters);
|
|
||||||
}
|
|
||||||
|
|
||||||
xorg_list_for_each_entry(psci, &SysCounterList, entry) {
|
xorg_list_for_each_entry(psci, &SysCounterList, entry) {
|
||||||
int namelen;
|
int namelen;
|
||||||
|
|
@ -1331,12 +1318,8 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
namelen = strlen(psci->name);
|
namelen = strlen(psci->name);
|
||||||
walklist->name_length = namelen;
|
walklist->name_length = namelen;
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_1(walklist, name_length);
|
||||||
swapl(&walklist->counter);
|
CLIENT_STRUCT_CARD32_3(walklist, counter, resolution_hi, resolution_lo);
|
||||||
swapl(&walklist->resolution_hi);
|
|
||||||
swapl(&walklist->resolution_lo);
|
|
||||||
swaps(&walklist->name_length);
|
|
||||||
}
|
|
||||||
|
|
||||||
pname_in_reply = ((char *) walklist) + sz_xSyncSystemCounter;
|
pname_in_reply = ((char *) walklist) + sz_xSyncSystemCounter;
|
||||||
strncpy(pname_in_reply, psci->name, namelen);
|
strncpy(pname_in_reply, psci->name, namelen);
|
||||||
|
|
@ -1345,12 +1328,7 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
namelen));
|
namelen));
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
REPLY_SEND_EXTRA(list, len);
|
||||||
if (len) {
|
|
||||||
WriteToClient(client, len, list);
|
|
||||||
free(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1361,12 +1339,13 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncSetPriority(ClientPtr client)
|
ProcSyncSetPriority(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncSetPriorityReq);
|
REQUEST_HEAD_STRUCT(xSyncSetPriorityReq);
|
||||||
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
REQUEST_FIELD_CARD32(priority);
|
||||||
|
|
||||||
ClientPtr priorityclient;
|
ClientPtr priorityclient;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
|
|
||||||
|
|
||||||
if (stuff->id == None)
|
if (stuff->id == None)
|
||||||
priorityclient = client;
|
priorityclient = client;
|
||||||
else {
|
else {
|
||||||
|
|
@ -1396,37 +1375,26 @@ ProcSyncSetPriority(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncGetPriority(ClientPtr client)
|
ProcSyncGetPriority(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncGetPriorityReq);
|
REQUEST_HEAD_STRUCT(xSyncGetPriorityReq);
|
||||||
xSyncGetPriorityReply rep;
|
REQUEST_FIELD_CARD32(id);
|
||||||
ClientPtr priorityclient;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
|
ClientPtr priorityclient;
|
||||||
|
|
||||||
if (stuff->id == None)
|
if (stuff->id == None)
|
||||||
priorityclient = client;
|
priorityclient = client;
|
||||||
else {
|
else {
|
||||||
rc = dixLookupResourceOwner(&priorityclient, stuff->id, client,
|
int rc = dixLookupResourceOwner(&priorityclient, stuff->id, client,
|
||||||
DixGetAttrAccess);
|
DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xSyncGetPriorityReply) {
|
xSyncGetPriorityReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.priority = priorityclient->priority
|
.priority = priorityclient->priority
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(priority);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xSyncGetPriorityReply), &rep);
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1435,10 +1403,12 @@ ProcSyncGetPriority(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncCreateCounter(ClientPtr client)
|
ProcSyncCreateCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncCreateCounterReq);
|
REQUEST_HEAD_STRUCT(xSyncCreateCounterReq);
|
||||||
int64_t initial;
|
REQUEST_FIELD_CARD32(cid);
|
||||||
|
REQUEST_FIELD_CARD32(initial_value_lo);
|
||||||
|
REQUEST_FIELD_CARD32(initial_value_hi);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
|
int64_t initial;
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->cid, client);
|
LEGAL_NEW_RESOURCE(stuff->cid, client);
|
||||||
|
|
||||||
|
|
@ -1456,13 +1426,15 @@ ProcSyncCreateCounter(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncSetCounter(ClientPtr client)
|
ProcSyncSetCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncSetCounterReq);
|
REQUEST_HEAD_STRUCT(xSyncSetCounterReq);
|
||||||
|
REQUEST_FIELD_CARD32(cid);
|
||||||
|
REQUEST_FIELD_CARD32(value_lo);
|
||||||
|
REQUEST_FIELD_CARD32(value_hi);
|
||||||
|
|
||||||
SyncCounter *pCounter;
|
SyncCounter *pCounter;
|
||||||
int64_t newvalue;
|
int64_t newvalue;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncSetCounterReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter,
|
rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter,
|
||||||
client, DixWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1484,14 +1456,16 @@ ProcSyncSetCounter(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncChangeCounter(ClientPtr client)
|
ProcSyncChangeCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncChangeCounterReq);
|
REQUEST_HEAD_STRUCT(xSyncChangeCounterReq);
|
||||||
|
REQUEST_FIELD_CARD32(cid);
|
||||||
|
REQUEST_FIELD_CARD32(value_lo);
|
||||||
|
REQUEST_FIELD_CARD32(value_hi);
|
||||||
|
|
||||||
SyncCounter *pCounter;
|
SyncCounter *pCounter;
|
||||||
int64_t newvalue;
|
int64_t newvalue;
|
||||||
Bool overflow;
|
Bool overflow;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter,
|
rc = dixLookupResourceByType((void **) &pCounter, stuff->cid, RTCounter,
|
||||||
client, DixWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1519,12 +1493,12 @@ ProcSyncChangeCounter(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncDestroyCounter(ClientPtr client)
|
ProcSyncDestroyCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncDestroyCounterReq);
|
REQUEST_HEAD_STRUCT(xSyncDestroyCounterReq);
|
||||||
|
REQUEST_FIELD_CARD32(counter);
|
||||||
|
|
||||||
SyncCounter *pCounter;
|
SyncCounter *pCounter;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pCounter, stuff->counter,
|
rc = dixLookupResourceByType((void **) &pCounter, stuff->counter,
|
||||||
RTCounter, client, DixDestroyAccess);
|
RTCounter, client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1600,7 +1574,9 @@ SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion * pAwaitUnion)
|
||||||
static int
|
static int
|
||||||
ProcSyncAwait(ClientPtr client)
|
ProcSyncAwait(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncAwaitReq);
|
REQUEST_HEAD_AT_LEAST(xSyncAwaitReq);
|
||||||
|
REQUEST_REST_CARD32();
|
||||||
|
|
||||||
int len, items;
|
int len, items;
|
||||||
int i;
|
int i;
|
||||||
xSyncWaitCondition *pProtocolWaitConds;
|
xSyncWaitCondition *pProtocolWaitConds;
|
||||||
|
|
@ -1608,8 +1584,6 @@ ProcSyncAwait(ClientPtr client)
|
||||||
SyncAwait *pAwait;
|
SyncAwait *pAwait;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
|
|
||||||
|
|
||||||
len = client->req_len << 2;
|
len = client->req_len << 2;
|
||||||
len -= sz_xSyncAwaitReq;
|
len -= sz_xSyncAwaitReq;
|
||||||
items = len / sz_xSyncWaitCondition;
|
items = len / sz_xSyncWaitCondition;
|
||||||
|
|
@ -1680,13 +1654,12 @@ ProcSyncAwait(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncQueryCounter(ClientPtr client)
|
ProcSyncQueryCounter(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncQueryCounterReq);
|
REQUEST_HEAD_STRUCT(xSyncQueryCounterReq);
|
||||||
xSyncQueryCounterReply rep;
|
REQUEST_FIELD_CARD32(counter);
|
||||||
|
|
||||||
SyncCounter *pCounter;
|
SyncCounter *pCounter;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pCounter, stuff->counter,
|
rc = dixLookupResourceByType((void **) &pCounter, stuff->counter,
|
||||||
RTCounter, client, DixReadAccess);
|
RTCounter, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1698,22 +1671,14 @@ ProcSyncQueryCounter(ClientPtr client)
|
||||||
&pCounter->value);
|
&pCounter->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xSyncQueryCounterReply) {
|
xSyncQueryCounterReply rep = (xSyncQueryCounterReply) {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.value_hi = pCounter->value >> 32,
|
.value_hi = pCounter->value >> 32,
|
||||||
.value_lo = pCounter->value
|
.value_lo = pCounter->value
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(value_hi);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(value_lo);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.value_hi);
|
|
||||||
swapl(&rep.value_lo);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xSyncQueryCounterReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1722,14 +1687,16 @@ ProcSyncQueryCounter(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncCreateAlarm(ClientPtr client)
|
ProcSyncCreateAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncCreateAlarmReq);
|
REQUEST_HEAD_AT_LEAST(xSyncCreateAlarmReq);
|
||||||
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
REQUEST_FIELD_CARD32(valueMask);
|
||||||
|
REQUEST_REST_CARD32();
|
||||||
|
|
||||||
SyncAlarm *pAlarm;
|
SyncAlarm *pAlarm;
|
||||||
int status;
|
int status;
|
||||||
unsigned long len, vmask;
|
unsigned long len, vmask;
|
||||||
SyncTrigger *pTrigger;
|
SyncTrigger *pTrigger;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
|
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(stuff->id, client);
|
LEGAL_NEW_RESOURCE(stuff->id, client);
|
||||||
|
|
||||||
vmask = stuff->valueMask;
|
vmask = stuff->valueMask;
|
||||||
|
|
@ -1805,14 +1772,16 @@ ProcSyncCreateAlarm(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncChangeAlarm(ClientPtr client)
|
ProcSyncChangeAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncChangeAlarmReq);
|
REQUEST_HEAD_AT_LEAST(xSyncChangeAlarmReq);
|
||||||
|
REQUEST_FIELD_CARD32(alarm);
|
||||||
|
REQUEST_FIELD_CARD32(valueMask);
|
||||||
|
REQUEST_REST_CARD32();
|
||||||
|
|
||||||
SyncAlarm *pAlarm;
|
SyncAlarm *pAlarm;
|
||||||
SyncCounter *pCounter = NULL;
|
SyncCounter *pCounter = NULL;
|
||||||
long vmask;
|
long vmask;
|
||||||
int len, status;
|
int len, status;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
|
|
||||||
|
|
||||||
status = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm,
|
status = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm,
|
||||||
client, DixWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
|
|
@ -1846,23 +1815,20 @@ ProcSyncChangeAlarm(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncQueryAlarm(ClientPtr client)
|
ProcSyncQueryAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncQueryAlarmReq);
|
REQUEST_HEAD_STRUCT(xSyncQueryAlarmReq);
|
||||||
|
REQUEST_FIELD_CARD32(alarm);
|
||||||
|
|
||||||
SyncAlarm *pAlarm;
|
SyncAlarm *pAlarm;
|
||||||
xSyncQueryAlarmReply rep;
|
|
||||||
SyncTrigger *pTrigger;
|
SyncTrigger *pTrigger;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm,
|
rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm,
|
||||||
client, DixReadAccess);
|
client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
pTrigger = &pAlarm->trigger;
|
pTrigger = &pAlarm->trigger;
|
||||||
rep = (xSyncQueryAlarmReply) {
|
xSyncQueryAlarmReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length =
|
.length =
|
||||||
bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)),
|
bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)),
|
||||||
.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None,
|
.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None,
|
||||||
|
|
@ -1887,31 +1853,24 @@ ProcSyncQueryAlarm(ClientPtr client)
|
||||||
.state = pAlarm->state
|
.state = pAlarm->state
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(counter);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(wait_value_hi);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(wait_value_lo);
|
||||||
swapl(&rep.counter);
|
REPLY_FIELD_CARD32(test_type);
|
||||||
swapl(&rep.wait_value_hi);
|
REPLY_FIELD_CARD32(delta_hi);
|
||||||
swapl(&rep.wait_value_lo);
|
REPLY_FIELD_CARD32(delta_lo);
|
||||||
swapl(&rep.test_type);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.delta_hi);
|
|
||||||
swapl(&rep.delta_lo);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcSyncDestroyAlarm(ClientPtr client)
|
ProcSyncDestroyAlarm(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xSyncDestroyAlarmReq);
|
||||||
|
REQUEST_FIELD_CARD32(alarm);
|
||||||
|
|
||||||
SyncAlarm *pAlarm;
|
SyncAlarm *pAlarm;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSyncDestroyAlarmReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm,
|
rc = dixLookupResourceByType((void **) &pAlarm, stuff->alarm, RTAlarm,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1924,13 +1883,14 @@ ProcSyncDestroyAlarm(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncCreateFence(ClientPtr client)
|
ProcSyncCreateFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncCreateFenceReq);
|
REQUEST_HEAD_STRUCT(xSyncCreateFenceReq);
|
||||||
|
REQUEST_FIELD_CARD32(d);
|
||||||
|
REQUEST_FIELD_CARD32(fid);
|
||||||
|
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
SyncFence *pFence;
|
SyncFence *pFence;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
|
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->d, client, M_ANY, DixGetAttrAccess);
|
rc = dixLookupDrawable(&pDraw, stuff->d, client, M_ANY, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -1970,12 +1930,12 @@ SyncVerifyFence(SyncFence ** ppSyncFence, XID fid, ClientPtr client, Mask mode)
|
||||||
static int
|
static int
|
||||||
ProcSyncTriggerFence(ClientPtr client)
|
ProcSyncTriggerFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncTriggerFenceReq);
|
REQUEST_HEAD_STRUCT(xSyncTriggerFenceReq);
|
||||||
|
REQUEST_FIELD_CARD32(fid);
|
||||||
|
|
||||||
SyncFence *pFence;
|
SyncFence *pFence;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence,
|
rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence,
|
||||||
client, DixWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1989,12 +1949,12 @@ ProcSyncTriggerFence(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncResetFence(ClientPtr client)
|
ProcSyncResetFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncResetFenceReq);
|
REQUEST_HEAD_STRUCT(xSyncResetFenceReq);
|
||||||
|
REQUEST_FIELD_CARD32(fid);
|
||||||
|
|
||||||
SyncFence *pFence;
|
SyncFence *pFence;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncResetFenceReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence,
|
rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence,
|
||||||
client, DixWriteAccess);
|
client, DixWriteAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -2011,12 +1971,12 @@ ProcSyncResetFence(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncDestroyFence(ClientPtr client)
|
ProcSyncDestroyFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncDestroyFenceReq);
|
REQUEST_HEAD_STRUCT(xSyncDestroyFenceReq);
|
||||||
|
REQUEST_FIELD_CARD32(fid);
|
||||||
|
|
||||||
SyncFence *pFence;
|
SyncFence *pFence;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence,
|
rc = dixLookupResourceByType((void **) &pFence, stuff->fid, RTFence,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -2029,39 +1989,30 @@ ProcSyncDestroyFence(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncQueryFence(ClientPtr client)
|
ProcSyncQueryFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncQueryFenceReq);
|
REQUEST_HEAD_STRUCT(xSyncQueryFenceReq);
|
||||||
xSyncQueryFenceReply rep;
|
REQUEST_FIELD_CARD32(fid);
|
||||||
|
|
||||||
SyncFence *pFence;
|
SyncFence *pFence;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType((void **) &pFence, stuff->fid,
|
rc = dixLookupResourceByType((void **) &pFence, stuff->fid,
|
||||||
RTFence, client, DixReadAccess);
|
RTFence, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xSyncQueryFenceReply) {
|
xSyncQueryFenceReply rep = (xSyncQueryFenceReply) {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
|
|
||||||
.triggered = pFence->funcs.CheckTriggered(pFence)
|
.triggered = pFence->funcs.CheckTriggered(pFence)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcSyncAwaitFence(ClientPtr client)
|
ProcSyncAwaitFence(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xSyncAwaitFenceReq);
|
REQUEST_HEAD_AT_LEAST(xSyncAwaitFenceReq);
|
||||||
|
REQUEST_REST_CARD32();
|
||||||
|
|
||||||
SyncAwaitUnion *pAwaitUnion;
|
SyncAwaitUnion *pAwaitUnion;
|
||||||
SyncAwait *pAwait;
|
SyncAwait *pAwait;
|
||||||
|
|
||||||
|
|
@ -2073,8 +2024,6 @@ ProcSyncAwaitFence(ClientPtr client)
|
||||||
int items;
|
int items;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
|
|
||||||
|
|
||||||
len = client->req_len << 2;
|
len = client->req_len << 2;
|
||||||
len -= sz_xSyncAwaitFenceReq;
|
len -= sz_xSyncAwaitFenceReq;
|
||||||
items = len / sizeof(CARD32);
|
items = len / sizeof(CARD32);
|
||||||
|
|
@ -2190,252 +2139,6 @@ ProcSyncDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Boring Swapping stuff ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncCreateCounter(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncCreateCounterReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
|
|
||||||
swapl(&stuff->cid);
|
|
||||||
swapl(&stuff->initial_value_lo);
|
|
||||||
swapl(&stuff->initial_value_hi);
|
|
||||||
|
|
||||||
return ProcSyncCreateCounter(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncSetCounter(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncSetCounterReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncSetCounterReq);
|
|
||||||
swapl(&stuff->cid);
|
|
||||||
swapl(&stuff->value_lo);
|
|
||||||
swapl(&stuff->value_hi);
|
|
||||||
|
|
||||||
return ProcSyncSetCounter(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncChangeCounter(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncChangeCounterReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
|
|
||||||
swapl(&stuff->cid);
|
|
||||||
swapl(&stuff->value_lo);
|
|
||||||
swapl(&stuff->value_hi);
|
|
||||||
|
|
||||||
return ProcSyncChangeCounter(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncQueryCounter(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncQueryCounterReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
|
|
||||||
swapl(&stuff->counter);
|
|
||||||
|
|
||||||
return ProcSyncQueryCounter(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncDestroyCounter(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncDestroyCounterReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
|
|
||||||
swapl(&stuff->counter);
|
|
||||||
|
|
||||||
return ProcSyncDestroyCounter(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncAwait(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncAwaitReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
|
|
||||||
SwapRestL(stuff);
|
|
||||||
|
|
||||||
return ProcSyncAwait(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncCreateAlarm(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncCreateAlarmReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
swapl(&stuff->valueMask);
|
|
||||||
SwapRestL(stuff);
|
|
||||||
|
|
||||||
return ProcSyncCreateAlarm(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncChangeAlarm(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncChangeAlarmReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
|
|
||||||
swapl(&stuff->alarm);
|
|
||||||
swapl(&stuff->valueMask);
|
|
||||||
SwapRestL(stuff);
|
|
||||||
return ProcSyncChangeAlarm(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncQueryAlarm(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncQueryAlarmReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
|
|
||||||
swapl(&stuff->alarm);
|
|
||||||
|
|
||||||
return ProcSyncQueryAlarm(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncDestroyAlarm(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncDestroyAlarmReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
|
|
||||||
swapl(&stuff->alarm);
|
|
||||||
|
|
||||||
return ProcSyncDestroyAlarm(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncSetPriority(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncSetPriorityReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
swapl(&stuff->priority);
|
|
||||||
|
|
||||||
return ProcSyncSetPriority(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncGetPriority(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncGetPriorityReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
|
|
||||||
return ProcSyncGetPriority(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncCreateFence(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncCreateFenceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
|
|
||||||
swapl(&stuff->d);
|
|
||||||
swapl(&stuff->fid);
|
|
||||||
|
|
||||||
return ProcSyncCreateFence(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncTriggerFence(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncTriggerFenceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
|
|
||||||
swapl(&stuff->fid);
|
|
||||||
|
|
||||||
return ProcSyncTriggerFence(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncResetFence(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncResetFenceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncResetFenceReq);
|
|
||||||
swapl(&stuff->fid);
|
|
||||||
|
|
||||||
return ProcSyncResetFence(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncDestroyFence(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncDestroyFenceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
|
|
||||||
swapl(&stuff->fid);
|
|
||||||
|
|
||||||
return ProcSyncDestroyFence(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncQueryFence(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncQueryFenceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
|
|
||||||
swapl(&stuff->fid);
|
|
||||||
|
|
||||||
return ProcSyncQueryFence(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncAwaitFence(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSyncAwaitFenceReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
|
|
||||||
SwapRestL(stuff);
|
|
||||||
|
|
||||||
return ProcSyncAwaitFence(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSyncDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_SyncInitialize:
|
|
||||||
return ProcSyncInitialize(client);
|
|
||||||
case X_SyncListSystemCounters:
|
|
||||||
return ProcSyncListSystemCounters(client);
|
|
||||||
case X_SyncCreateCounter:
|
|
||||||
return SProcSyncCreateCounter(client);
|
|
||||||
case X_SyncSetCounter:
|
|
||||||
return SProcSyncSetCounter(client);
|
|
||||||
case X_SyncChangeCounter:
|
|
||||||
return SProcSyncChangeCounter(client);
|
|
||||||
case X_SyncQueryCounter:
|
|
||||||
return SProcSyncQueryCounter(client);
|
|
||||||
case X_SyncDestroyCounter:
|
|
||||||
return SProcSyncDestroyCounter(client);
|
|
||||||
case X_SyncAwait:
|
|
||||||
return SProcSyncAwait(client);
|
|
||||||
case X_SyncCreateAlarm:
|
|
||||||
return SProcSyncCreateAlarm(client);
|
|
||||||
case X_SyncChangeAlarm:
|
|
||||||
return SProcSyncChangeAlarm(client);
|
|
||||||
case X_SyncQueryAlarm:
|
|
||||||
return SProcSyncQueryAlarm(client);
|
|
||||||
case X_SyncDestroyAlarm:
|
|
||||||
return SProcSyncDestroyAlarm(client);
|
|
||||||
case X_SyncSetPriority:
|
|
||||||
return SProcSyncSetPriority(client);
|
|
||||||
case X_SyncGetPriority:
|
|
||||||
return SProcSyncGetPriority(client);
|
|
||||||
case X_SyncCreateFence:
|
|
||||||
return SProcSyncCreateFence(client);
|
|
||||||
case X_SyncTriggerFence:
|
|
||||||
return SProcSyncTriggerFence(client);
|
|
||||||
case X_SyncResetFence:
|
|
||||||
return SProcSyncResetFence(client);
|
|
||||||
case X_SyncDestroyFence:
|
|
||||||
return SProcSyncDestroyFence(client);
|
|
||||||
case X_SyncQueryFence:
|
|
||||||
return SProcSyncQueryFence(client);
|
|
||||||
case X_SyncAwaitFence:
|
|
||||||
return SProcSyncAwaitFence(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Event Swapping
|
* Event Swapping
|
||||||
*/
|
*/
|
||||||
|
|
@ -2509,7 +2212,7 @@ SyncExtensionInit(void)
|
||||||
RTAlarmClient == 0 ||
|
RTAlarmClient == 0 ||
|
||||||
(extEntry = AddExtension(SYNC_NAME,
|
(extEntry = AddExtension(SYNC_NAME,
|
||||||
XSyncNumberEvents, XSyncNumberErrors,
|
XSyncNumberEvents, XSyncNumberErrors,
|
||||||
ProcSyncDispatch, SProcSyncDispatch,
|
ProcSyncDispatch, ProcSyncDispatch,
|
||||||
SyncResetProc, StandardMinorOpcode)) == NULL) {
|
SyncResetProc, StandardMinorOpcode)) == NULL) {
|
||||||
ErrorF("Sync Extension %d.%d failed to Initialise\n",
|
ErrorF("Sync Extension %d.%d failed to Initialise\n",
|
||||||
SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
|
SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
|
||||||
|
|
|
||||||
1600
Xext/vidmode.c
1600
Xext/vidmode.c
File diff suppressed because it is too large
Load Diff
104
Xext/xcmisc.c
104
Xext/xcmisc.c
|
|
@ -33,6 +33,7 @@ from The Open Group.
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
#include <X11/extensions/xcmiscproto.h>
|
#include <X11/extensions/xcmiscproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
@ -45,59 +46,49 @@ from The Open Group.
|
||||||
static int
|
static int
|
||||||
ProcXCMiscGetVersion(ClientPtr client)
|
ProcXCMiscGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXCMiscGetVersionReq);
|
||||||
|
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||||
|
REQUEST_FIELD_CARD16(majorVersion);
|
||||||
|
REQUEST_FIELD_CARD16(minorVersion);
|
||||||
|
|
||||||
xXCMiscGetVersionReply rep = {
|
xXCMiscGetVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = XCMiscMajorVersion,
|
.majorVersion = XCMiscMajorVersion,
|
||||||
.minorVersion = XCMiscMinorVersion
|
.minorVersion = XCMiscMinorVersion
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
REPLY_FIELD_CARD16(majorVersion);
|
||||||
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swaps(&rep.majorVersion);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXCMiscGetVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXCMiscGetXIDRange(ClientPtr client)
|
ProcXCMiscGetXIDRange(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXCMiscGetXIDRangeReply rep;
|
REQUEST_HEAD_STRUCT(xXCMiscGetXIDRangeReq);
|
||||||
XID min_id, max_id;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
|
XID min_id, max_id;
|
||||||
GetXIDRange(client->index, FALSE, &min_id, &max_id);
|
GetXIDRange(client->index, FALSE, &min_id, &max_id);
|
||||||
rep = (xXCMiscGetXIDRangeReply) {
|
|
||||||
.type = X_Reply,
|
xXCMiscGetXIDRangeReply rep = {
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.start_id = min_id,
|
.start_id = min_id,
|
||||||
.count = max_id - min_id + 1
|
.count = max_id - min_id + 1
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(start_id);
|
||||||
swapl(&rep.start_id);
|
REPLY_FIELD_CARD32(count);
|
||||||
swapl(&rep.count);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXCMiscGetXIDList(ClientPtr client)
|
ProcXCMiscGetXIDList(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXCMiscGetXIDListReq);
|
REQUEST_HEAD_STRUCT(xXCMiscGetXIDListReq);
|
||||||
xXCMiscGetXIDListReply rep;
|
REQUEST_FIELD_CARD16(length);
|
||||||
|
REQUEST_FIELD_CARD32(count);
|
||||||
|
|
||||||
XID *pids;
|
XID *pids;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
|
||||||
|
|
||||||
if (stuff->count > UINT32_MAX / sizeof(XID))
|
if (stuff->count > UINT32_MAX / sizeof(XID))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
|
@ -106,18 +97,15 @@ ProcXCMiscGetXIDList(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
count = GetXIDList(client, stuff->count, pids);
|
count = GetXIDList(client, stuff->count, pids);
|
||||||
rep = (xXCMiscGetXIDListReply) {
|
|
||||||
.type = X_Reply,
|
xXCMiscGetXIDListReply rep = {
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = count,
|
.length = count,
|
||||||
.count = count
|
.count = count
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(length);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(count);
|
||||||
swapl(&rep.length);
|
REPLY_SEND();
|
||||||
swapl(&rep.count);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXCMiscGetXIDListReply), &rep);
|
|
||||||
if (count) {
|
if (count) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||||
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
|
WriteSwappedDataToClient(client, count * sizeof(XID), pids);
|
||||||
|
|
@ -142,46 +130,10 @@ ProcXCMiscDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXCMiscGetVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXCMiscGetVersionReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
|
||||||
swaps(&stuff->majorVersion);
|
|
||||||
swaps(&stuff->minorVersion);
|
|
||||||
return ProcXCMiscGetVersion(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXCMiscGetXIDList(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXCMiscGetXIDListReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
|
||||||
|
|
||||||
swapl(&stuff->count);
|
|
||||||
return ProcXCMiscGetXIDList(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXCMiscDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_XCMiscGetVersion:
|
|
||||||
return SProcXCMiscGetVersion(client);
|
|
||||||
case X_XCMiscGetXIDRange:
|
|
||||||
return ProcXCMiscGetXIDRange(client);
|
|
||||||
case X_XCMiscGetXIDList:
|
|
||||||
return SProcXCMiscGetXIDList(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XCMiscExtensionInit(void)
|
XCMiscExtensionInit(void)
|
||||||
{
|
{
|
||||||
AddExtension(XCMiscExtensionName, 0, 0,
|
AddExtension(XCMiscExtensionName, 0, 0,
|
||||||
ProcXCMiscDispatch, SProcXCMiscDispatch,
|
ProcXCMiscDispatch, ProcXCMiscDispatch,
|
||||||
NULL, StandardMinorOpcode);
|
NULL, StandardMinorOpcode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -265,13 +265,9 @@ XF86BigfontResetProc(ExtensionEntry * extEntry)
|
||||||
static int
|
static int
|
||||||
ProcXF86BigfontQueryVersion(ClientPtr client)
|
ProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXF86BigfontQueryVersionReply reply;
|
REQUEST_HEAD_STRUCT(xXF86BigfontQueryVersionReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
|
xXF86BigfontQueryVersionReply reply = {
|
||||||
reply = (xXF86BigfontQueryVersionReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION,
|
.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION,
|
||||||
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
|
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
|
||||||
.uid = geteuid(),
|
.uid = geteuid(),
|
||||||
|
|
@ -280,22 +276,14 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
.signature = signature,
|
.signature = signature,
|
||||||
.capabilities = (client->local && !client->swapped)
|
.capabilities = (client->local && !client->swapped)
|
||||||
? XF86Bigfont_CAP_LocalShm : 0
|
? XF86Bigfont_CAP_LocalShm : 0
|
||||||
#else
|
|
||||||
.signature = 0,
|
|
||||||
.capabilities = 0
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(&reply.majorVersion);
|
||||||
swaps(&reply.sequenceNumber);
|
REPLY_FIELD_CARD16(&reply.minorVersion);
|
||||||
swapl(&reply.length);
|
REPLY_FIELD_CARD32(&reply.uid);
|
||||||
swaps(&reply.majorVersion);
|
REPLY_FIELD_CARD32(&reply.gid);
|
||||||
swaps(&reply.minorVersion);
|
REPLY_FIELD_CARD32(&reply.signature);
|
||||||
swapl(&reply.uid);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&reply.gid);
|
|
||||||
swapl(&reply.signature);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), &reply);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -319,9 +307,10 @@ swapCharInfo(xCharInfo * pCI)
|
||||||
static int
|
static int
|
||||||
ProcXF86BigfontQueryFont(ClientPtr client)
|
ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
{
|
{
|
||||||
FontPtr pFont;
|
REQUEST_HEAD_NO_CHECK(xXF86BigfontQueryFontReq);
|
||||||
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
|
||||||
REQUEST(xXF86BigfontQueryFontReq);
|
FontPtr pFont;
|
||||||
CARD32 stuff_flags;
|
CARD32 stuff_flags;
|
||||||
xCharInfo *pmax;
|
xCharInfo *pmax;
|
||||||
xCharInfo *pmin;
|
xCharInfo *pmin;
|
||||||
|
|
@ -538,9 +527,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
: 0);
|
: 0);
|
||||||
|
|
||||||
xXF86BigfontQueryFontReply rep = {
|
xXF86BigfontQueryFontReply rep = {
|
||||||
.type = X_Reply;
|
|
||||||
.length = bytes_to_int32(buflength),
|
.length = bytes_to_int32(buflength),
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.minBounds = pFont->info.ink_minbounds,
|
.minBounds = pFont->info.ink_minbounds,
|
||||||
.maxBounds = pFont->info.ink_maxbounds,
|
.maxBounds = pFont->info.ink_maxbounds,
|
||||||
.minCharOrByte2 = pFont->info.firstCol,
|
.minCharOrByte2 = pFont->info.firstCol,
|
||||||
|
|
@ -558,21 +545,20 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
.shmid = shmid,
|
.shmid = shmid,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
REPLY_FIELD_CARD16(minCharOrByte2);
|
||||||
|
REPLY_FIELD_CARD16(maxCharOrByte2);
|
||||||
|
REPLY_FIELD_CARD16(defaultChar);
|
||||||
|
REPLY_FIELD_CARD16(nFontProps);
|
||||||
|
REPLY_FIELD_CARD16(fontAscent);
|
||||||
|
REPLY_FIELD_CARD16(fontDescent);
|
||||||
|
REPLY_FIELD_CARD32(nCharInfos);
|
||||||
|
REPLY_FIELD_CARD32(nUniqCharInfos);
|
||||||
|
REPLY_FIELD_CARD32(shmid);
|
||||||
|
REPLY_FIELD_CARD32(shmsegoffset);
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swapCharInfo(&rep.minBounds);
|
swapCharInfo(&rep.minBounds);
|
||||||
swapCharInfo(&rep.maxBounds);
|
swapCharInfo(&rep.maxBounds);
|
||||||
swaps(&rep.minCharOrByte2);
|
|
||||||
swaps(&rep.maxCharOrByte2);
|
|
||||||
swaps(&rep.defaultChar);
|
|
||||||
swaps(&rep.nFontProps);
|
|
||||||
swaps(&rep.fontAscent);
|
|
||||||
swaps(&rep.fontDescent);
|
|
||||||
swapl(&rep.nCharInfos);
|
|
||||||
swapl(&rep.nUniqCharInfos);
|
|
||||||
swapl(&rep.shmid);
|
|
||||||
swapl(&rep.shmsegoffset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
|
@ -593,10 +579,7 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
i < nfontprops; i++, pFP++, prFP++) {
|
i < nfontprops; i++, pFP++, prFP++) {
|
||||||
prFP->name = pFP->name;
|
prFP->name = pFP->name;
|
||||||
prFP->value = pFP->value;
|
prFP->value = pFP->value;
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD32_2(prFP, name, value);
|
||||||
swapl(&prFP->name);
|
|
||||||
swapl(&prFP->value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
p = (char *) prFP;
|
p = (char *) prFP;
|
||||||
}
|
}
|
||||||
|
|
@ -614,14 +597,11 @@ ProcXF86BigfontQueryFont(ClientPtr client)
|
||||||
ps = (CARD16 *) pci;
|
ps = (CARD16 *) pci;
|
||||||
for (j = 0; j < nCharInfos; j++, ps++) {
|
for (j = 0; j < nCharInfos; j++, ps++) {
|
||||||
*ps = pIndex2UniqIndex[j];
|
*ps = pIndex2UniqIndex[j];
|
||||||
if (client->swapped) {
|
REPLY_BUF_CARD16(ps, 1);
|
||||||
swaps(ps);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xXF86BigfontQueryFontReply), &rep);
|
REPLY_SEND_EXTRA(buf, rlength);
|
||||||
WriteToClient(client, rlength, buf);
|
|
||||||
free(buf);
|
free(buf);
|
||||||
out:
|
out:
|
||||||
if (nCharInfos > 0) {
|
if (nCharInfos > 0) {
|
||||||
|
|
@ -649,37 +629,6 @@ ProcXF86BigfontDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXF86BigfontQueryVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXF86BigfontQueryVersionReq);
|
|
||||||
return ProcXF86BigfontQueryVersion(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXF86BigfontQueryFont(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXF86BigfontQueryFontReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
return ProcXF86BigfontQueryFont(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXF86BigfontDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_XF86BigfontQueryVersion:
|
|
||||||
return SProcXF86BigfontQueryVersion(client);
|
|
||||||
case X_XF86BigfontQueryFont:
|
|
||||||
return SProcXF86BigfontQueryFont(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XFree86BigfontExtensionInit(void)
|
XFree86BigfontExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
|
@ -687,7 +636,7 @@ XFree86BigfontExtensionInit(void)
|
||||||
XF86BigfontNumberEvents,
|
XF86BigfontNumberEvents,
|
||||||
XF86BigfontNumberErrors,
|
XF86BigfontNumberErrors,
|
||||||
ProcXF86BigfontDispatch,
|
ProcXF86BigfontDispatch,
|
||||||
SProcXF86BigfontDispatch,
|
ProcXF86BigfontDispatch,
|
||||||
XF86BigfontResetProc, StandardMinorOpcode)) {
|
XF86BigfontResetProc, StandardMinorOpcode)) {
|
||||||
#ifdef MITSHM
|
#ifdef MITSHM
|
||||||
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
|
||||||
|
|
|
||||||
323
Xext/xres.c
323
Xext/xres.c
|
|
@ -12,6 +12,7 @@
|
||||||
#include <X11/extensions/XResproto.h>
|
#include <X11/extensions/XResproto.h>
|
||||||
|
|
||||||
#include "dix/registry_priv.h"
|
#include "dix/registry_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
#include "Xext/xace.h"
|
#include "Xext/xace.h"
|
||||||
|
|
@ -28,7 +29,6 @@
|
||||||
#include "protocol-versions.h"
|
#include "protocol-versions.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include <string.h>
|
|
||||||
#include "hashtable.h"
|
#include "hashtable.h"
|
||||||
#include "picturestr.h"
|
#include "picturestr.h"
|
||||||
#include "compint.h"
|
#include "compint.h"
|
||||||
|
|
@ -112,21 +112,6 @@ AddFragment(struct xorg_list *frags, int bytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Sends all fragments in the list to the client. Does not
|
|
||||||
free anything.
|
|
||||||
|
|
||||||
@param client The client to send the fragments to
|
|
||||||
@param frags The head of the list of fragments
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
WriteFragmentsToClient(ClientPtr client, struct xorg_list *frags)
|
|
||||||
{
|
|
||||||
FragmentList *it;
|
|
||||||
xorg_list_for_each_entry(it, frags, l) {
|
|
||||||
WriteToClient(client, it->bytes, (char*) it + sizeof(*it));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief Frees a list of fragments. Does not free() root node.
|
/** @brief Frees a list of fragments. Does not free() root node.
|
||||||
|
|
||||||
@param frags The head of the list of fragments
|
@param frags The head of the list of fragments
|
||||||
|
|
@ -196,40 +181,29 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
|
||||||
static int
|
static int
|
||||||
ProcXResQueryVersion(ClientPtr client)
|
ProcXResQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
||||||
|
|
||||||
xXResQueryVersionReply rep = {
|
xXResQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.server_major = SERVER_XRES_MAJOR_VERSION,
|
.server_major = SERVER_XRES_MAJOR_VERSION,
|
||||||
.server_minor = SERVER_XRES_MINOR_VERSION
|
.server_minor = SERVER_XRES_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
REPLY_FIELD_CARD16(server_major);
|
||||||
|
REPLY_FIELD_CARD16(server_minor);
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.server_major);
|
|
||||||
swaps(&rep.server_minor);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXResQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXResQueryClients(ClientPtr client)
|
ProcXResQueryClients(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXResQueryClientsReq); */
|
REQUEST_HEAD_STRUCT(xXResQueryClientsReq);
|
||||||
xXResQueryClientsReply rep;
|
|
||||||
int i, num_clients;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
int i, num_clients = 0;
|
||||||
|
|
||||||
int *current_clients = calloc(currentMaxClients, sizeof(int));
|
int *current_clients = calloc(currentMaxClients, sizeof(int));
|
||||||
if (!current_clients)
|
if (!current_clients)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
num_clients = 0;
|
|
||||||
for (i = 0; i < currentMaxClients; i++) {
|
for (i = 0; i < currentMaxClients; i++) {
|
||||||
if (clients[i]) {
|
if (clients[i]) {
|
||||||
if (XaceHookClientAccess(client, clients[i], DixReadAccess) == Success) {
|
if (XaceHookClientAccess(client, clients[i], DixReadAccess) == Success) {
|
||||||
|
|
@ -239,36 +213,23 @@ ProcXResQueryClients(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xXResQueryClientsReply) {
|
xXResQueryClientsReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(num_clients * sz_xXResClient),
|
|
||||||
.num_clients = num_clients
|
.num_clients = num_clients
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
xXResClient scratch[num_clients];
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.num_clients);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
|
|
||||||
|
|
||||||
if (num_clients) {
|
if (num_clients) {
|
||||||
xXResClient scratch;
|
|
||||||
|
|
||||||
for (i = 0; i < num_clients; i++) {
|
for (i = 0; i < num_clients; i++) {
|
||||||
scratch.resource_base = clients[current_clients[i]]->clientAsMask;
|
scratch[i].resource_base = clients[current_clients[i]]->clientAsMask;
|
||||||
scratch.resource_mask = RESOURCE_ID_MASK;
|
scratch[i].resource_mask = RESOURCE_ID_MASK;
|
||||||
|
CLIENT_STRUCT_CARD32_2(&scratch[i], resource_base, resource_mask);
|
||||||
if (client->swapped) {
|
|
||||||
swapl(&scratch.resource_base);
|
|
||||||
swapl(&scratch.resource_mask);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sz_xXResClient, &scratch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REPLY_FIELD_CARD32(num_clients);
|
||||||
|
REPLY_SEND_EXTRA(scratch, sizeof(scratch));
|
||||||
free(current_clients);
|
free(current_clients);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,11 +262,8 @@ resourceTypeAtom(int i)
|
||||||
static int
|
static int
|
||||||
ProcXResQueryClientResources(ClientPtr client)
|
ProcXResQueryClientResources(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientResourcesReq);
|
REQUEST_HEAD_STRUCT(xXResQueryClientResourcesReq);
|
||||||
xXResQueryClientResourcesReply rep;
|
REQUEST_FIELD_CARD32(xid);
|
||||||
int i, num_types;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
|
|
||||||
|
|
||||||
ClientPtr resClient = dixClientForXID(stuff->xid);
|
ClientPtr resClient = dixClientForXID(stuff->xid);
|
||||||
|
|
||||||
|
|
@ -322,47 +280,30 @@ ProcXResQueryClientResources(ClientPtr client)
|
||||||
|
|
||||||
FindAllClientResources(resClient, ResFindAllRes, counts);
|
FindAllClientResources(resClient, ResFindAllRes, counts);
|
||||||
|
|
||||||
num_types = 0;
|
int cnt[lastResourceType + 1];
|
||||||
|
|
||||||
for (i = 0; i <= lastResourceType; i++) {
|
for (i = 0; i <= lastResourceType; i++) {
|
||||||
if (counts[i])
|
if (counts[i]) {
|
||||||
|
cnt[num_types] = counts[i];
|
||||||
num_types++;
|
num_types++;
|
||||||
}
|
|
||||||
|
|
||||||
rep = (xXResQueryClientResourcesReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(num_types * sz_xXResType),
|
|
||||||
.num_types = num_types
|
|
||||||
};
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.num_types);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep);
|
|
||||||
|
|
||||||
if (num_types) {
|
|
||||||
xXResType scratch;
|
|
||||||
|
|
||||||
for (i = 0; i < lastResourceType; i++) {
|
|
||||||
if (!counts[i])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
scratch.resource_type = resourceTypeAtom(i + 1);
|
|
||||||
scratch.count = counts[i];
|
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swapl(&scratch.resource_type);
|
|
||||||
swapl(&scratch.count);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sz_xXResType, &scratch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(counts);
|
xXResQueryClientResourcesReply rep = {
|
||||||
|
.num_types = num_types
|
||||||
|
};
|
||||||
|
|
||||||
|
xXResType scratch[num_types];
|
||||||
|
|
||||||
|
for (i = 0; i < num_types; i++) {
|
||||||
|
scratch[i].resource_type = resourceTypeAtom(i + 1);
|
||||||
|
scratch[i].count = cnt[i];
|
||||||
|
CLIENT_STRUCT_CARD32_2(&scratch[i], resource_type, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
REPLY_FIELD_CARD32(num_types);
|
||||||
|
REPLY_SEND_EXTRA(scratch, sizeof(scratch));
|
||||||
|
free(counts);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -380,10 +321,8 @@ ResFindResourcePixmaps(void *value, XID id, RESTYPE type, void *cdata)
|
||||||
static int
|
static int
|
||||||
ProcXResQueryClientPixmapBytes(ClientPtr client)
|
ProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientPixmapBytesReq);
|
REQUEST_HEAD_STRUCT(xXResQueryClientPixmapBytesReq);
|
||||||
xXResQueryClientPixmapBytesReply rep;
|
REQUEST_FIELD_CARD32(xid);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
|
|
||||||
|
|
||||||
ClientPtr owner = dixClientForXID(stuff->xid);
|
ClientPtr owner = dixClientForXID(stuff->xid);
|
||||||
if ((!owner) ||
|
if ((!owner) ||
|
||||||
|
|
@ -397,26 +336,15 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
FindAllClientResources(owner, ResFindResourcePixmaps,
|
FindAllClientResources(owner, ResFindResourcePixmaps,
|
||||||
(void *) (&bytes));
|
(void *) (&bytes));
|
||||||
|
|
||||||
rep = (xXResQueryClientPixmapBytesReply) {
|
xXResQueryClientPixmapBytesReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.bytes = bytes,
|
.bytes = bytes,
|
||||||
#ifdef _XSERVER64
|
#ifdef _XSERVER64
|
||||||
.bytes_overflow = bytes >> 32
|
.bytes_overflow = bytes >> 32
|
||||||
#else
|
|
||||||
.bytes_overflow = 0
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(bytes);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(bytes_overflow);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swapl(&rep.bytes);
|
|
||||||
swapl(&rep.bytes_overflow);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply), &rep);
|
|
||||||
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @brief Finds out if a client's information need to be put into the
|
/** @brief Finds out if a client's information need to be put into the
|
||||||
|
|
@ -464,12 +392,11 @@ static Bool
|
||||||
ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
|
ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
|
||||||
ConstructClientIdCtx *ctx)
|
ConstructClientIdCtx *ctx)
|
||||||
{
|
{
|
||||||
xXResClientIdValue rep;
|
xXResClientIdValue rep = {
|
||||||
|
.spec.client = client->clientAsMask,
|
||||||
|
};
|
||||||
|
|
||||||
rep.spec.client = client->clientAsMask;
|
REPLY_FIELD_CARD32(spec.client);
|
||||||
if (client->swapped) {
|
|
||||||
swapl (&rep.spec.client);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WillConstructMask(client, mask, ctx, X_XResClientXIDMask)) {
|
if (WillConstructMask(client, mask, ctx, X_XResClientXIDMask)) {
|
||||||
void *ptr = AddFragment(&ctx->response, sizeof(rep));
|
void *ptr = AddFragment(&ctx->response, sizeof(rep));
|
||||||
|
|
@ -478,11 +405,7 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.spec.mask = X_XResClientXIDMask;
|
rep.spec.mask = X_XResClientXIDMask;
|
||||||
rep.length = 0;
|
REPLY_FIELD_CARD32(spec.mask);
|
||||||
if (sendClient->swapped) {
|
|
||||||
swapl (&rep.spec.mask);
|
|
||||||
/* swapl (&rep.length, n); - not required for rep.length = 0 */
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(ptr, &rep, sizeof(rep));
|
memcpy(ptr, &rep, sizeof(rep));
|
||||||
|
|
||||||
|
|
@ -504,14 +427,11 @@ ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask,
|
||||||
rep.spec.mask = X_XResLocalClientPIDMask;
|
rep.spec.mask = X_XResLocalClientPIDMask;
|
||||||
rep.length = 4;
|
rep.length = 4;
|
||||||
|
|
||||||
if (sendClient->swapped) {
|
REPLY_FIELD_CARD32(spec.mask);
|
||||||
swapl (&rep.spec.mask);
|
REPLY_FIELD_CARD32(length); // need to do it, since not calling REPLY_SEND()
|
||||||
swapl (&rep.length);
|
|
||||||
}
|
REPLY_BUF_CARD32(value, 1);
|
||||||
|
|
||||||
if (sendClient->swapped) {
|
|
||||||
swapl (value);
|
|
||||||
}
|
|
||||||
memcpy(ptr, &rep, sizeof(rep));
|
memcpy(ptr, &rep, sizeof(rep));
|
||||||
*value = pid;
|
*value = pid;
|
||||||
|
|
||||||
|
|
@ -580,7 +500,8 @@ ConstructClientIds(ClientPtr client,
|
||||||
static int
|
static int
|
||||||
ProcXResQueryClientIds (ClientPtr client)
|
ProcXResQueryClientIds (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientIdsReq);
|
REQUEST_HEAD_AT_LEAST(xXResQueryClientIdsReq);
|
||||||
|
REQUEST_FIELD_CARD32(numSpecs);
|
||||||
|
|
||||||
xXResClientIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
xXResClientIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
||||||
int rc;
|
int rc;
|
||||||
|
|
@ -588,30 +509,28 @@ ProcXResQueryClientIds (ClientPtr client)
|
||||||
|
|
||||||
InitConstructClientIdCtx(&ctx);
|
InitConstructClientIdCtx(&ctx);
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXResQueryClientIdsReq);
|
|
||||||
REQUEST_FIXED_SIZE(xXResQueryClientIdsReq,
|
REQUEST_FIXED_SIZE(xXResQueryClientIdsReq,
|
||||||
stuff->numSpecs * sizeof(specs[0]));
|
stuff->numSpecs * sizeof(specs[0]));
|
||||||
|
|
||||||
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
|
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
|
||||||
|
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
xXResQueryClientIdsReply rep = {
|
char buf[ctx.resultBytes];
|
||||||
.type = X_Reply,
|
char *walk = buf;
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
|
FragmentList *it;
|
||||||
|
xorg_list_for_each_entry(it, &ctx.response, l) {
|
||||||
|
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
|
||||||
|
walk += it->bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
xXResQueryClientIdsReply rep = {
|
||||||
.length = bytes_to_int32(ctx.resultBytes),
|
.length = bytes_to_int32(ctx.resultBytes),
|
||||||
.numIds = ctx.numIds
|
.numIds = ctx.numIds
|
||||||
};
|
};
|
||||||
|
|
||||||
assert((ctx.resultBytes & 3) == 0);
|
REPLY_FIELD_CARD32(numIds);
|
||||||
|
REPLY_SEND_EXTRA(buf, sizeof(buf));
|
||||||
if (client->swapped) {
|
|
||||||
swaps (&rep.sequenceNumber);
|
|
||||||
swapl (&rep.length);
|
|
||||||
swapl (&rep.numIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
WriteFragmentsToClient(client, &ctx.response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyConstructClientIdCtx(&ctx);
|
DestroyConstructClientIdCtx(&ctx);
|
||||||
|
|
@ -951,17 +870,24 @@ ConstructResourceBytes(XID aboutClient,
|
||||||
static int
|
static int
|
||||||
ProcXResQueryResourceBytes (ClientPtr client)
|
ProcXResQueryResourceBytes (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryResourceBytesReq);
|
REQUEST_HEAD_AT_LEAST(xXResQueryResourceBytesReq);
|
||||||
|
REQUEST_FIELD_CARD32(numSpecs);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
ConstructResourceBytesCtx ctx;
|
ConstructResourceBytesCtx ctx;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
|
|
||||||
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
|
if (stuff->numSpecs > UINT32_MAX / sizeof(ctx.specs[0]))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
||||||
stuff->numSpecs * sizeof(ctx.specs[0]));
|
stuff->numSpecs * sizeof(ctx.specs[0]));
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
xXResResourceIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
||||||
|
for (int c = 0; c < stuff->numSpecs; ++c) {
|
||||||
|
SwapXResResourceIdSpec(specs + c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!InitConstructResourceBytesCtx(&ctx, client,
|
if (!InitConstructResourceBytesCtx(&ctx, client,
|
||||||
stuff->numSpecs,
|
stuff->numSpecs,
|
||||||
(void*) ((char*) stuff +
|
(void*) ((char*) stuff +
|
||||||
|
|
@ -973,22 +899,26 @@ ProcXResQueryResourceBytes (ClientPtr client)
|
||||||
|
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
xXResQueryResourceBytesReply rep = {
|
xXResQueryResourceBytesReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(ctx.resultBytes),
|
.length = bytes_to_int32(ctx.resultBytes),
|
||||||
.numSizes = ctx.numSizes
|
.numSizes = ctx.numSizes
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(numSizes);
|
||||||
swaps (&rep.sequenceNumber);
|
|
||||||
swapl (&rep.length);
|
|
||||||
swapl (&rep.numSizes);
|
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
SwapXResQueryResourceBytes(&ctx.response);
|
SwapXResQueryResourceBytes(&ctx.response);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
char buf[ctx.resultBytes];
|
||||||
WriteFragmentsToClient(client, &ctx.response);
|
{
|
||||||
|
char *walk = buf;
|
||||||
|
FragmentList *it;
|
||||||
|
xorg_list_for_each_entry(it, &ctx.response, l) {
|
||||||
|
memcpy(walk, FRAGMENT_DATA(it), it->bytes);
|
||||||
|
walk += it->bytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
REPLY_SEND_EXTRA(buf, sizeof(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyConstructResourceBytesCtx(&ctx);
|
DestroyConstructResourceBytesCtx(&ctx);
|
||||||
|
|
@ -1019,91 +949,10 @@ ProcResDispatch(ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXResQueryVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
|
||||||
return ProcXResQueryVersion(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXResQueryClientResources(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXResQueryClientResourcesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
|
|
||||||
swapl(&stuff->xid);
|
|
||||||
return ProcXResQueryClientResources(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXResQueryClientPixmapBytes(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXResQueryClientPixmapBytesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
|
|
||||||
swapl(&stuff->xid);
|
|
||||||
return ProcXResQueryClientPixmapBytes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXResQueryClientIds (ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXResQueryClientIdsReq);
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xXResQueryClientIdsReq);
|
|
||||||
swapl(&stuff->numSpecs);
|
|
||||||
return ProcXResQueryClientIds(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @brief Implements the XResQueryResourceBytes of XResProto v1.2.
|
|
||||||
This variant byteswaps request contents before issuing the
|
|
||||||
rest of the work to ProcXResQueryResourceBytes */
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXResQueryResourceBytes (ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXResQueryResourceBytesReq);
|
|
||||||
int c;
|
|
||||||
xXResResourceIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq);
|
|
||||||
swapl(&stuff->numSpecs);
|
|
||||||
REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq,
|
|
||||||
stuff->numSpecs * sizeof(specs[0]));
|
|
||||||
|
|
||||||
for (c = 0; c < stuff->numSpecs; ++c) {
|
|
||||||
SwapXResResourceIdSpec(specs + c);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ProcXResQueryResourceBytes(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcResDispatch (ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_XResQueryVersion:
|
|
||||||
return SProcXResQueryVersion(client);
|
|
||||||
case X_XResQueryClients: /* nothing to swap */
|
|
||||||
return ProcXResQueryClients(client);
|
|
||||||
case X_XResQueryClientResources:
|
|
||||||
return SProcXResQueryClientResources(client);
|
|
||||||
case X_XResQueryClientPixmapBytes:
|
|
||||||
return SProcXResQueryClientPixmapBytes(client);
|
|
||||||
case X_XResQueryClientIds:
|
|
||||||
return SProcXResQueryClientIds(client);
|
|
||||||
case X_XResQueryResourceBytes:
|
|
||||||
return SProcXResQueryResourceBytes(client);
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ResExtensionInit(void)
|
ResExtensionInit(void)
|
||||||
{
|
{
|
||||||
(void) AddExtension(XRES_NAME, 0, 0,
|
(void) AddExtension(XRES_NAME, 0, 0,
|
||||||
ProcResDispatch, SProcResDispatch,
|
ProcResDispatch, ProcResDispatch,
|
||||||
NULL, StandardMinorOpcode);
|
NULL, StandardMinorOpcode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/property_priv.h"
|
#include "dix/property_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "selection.h"
|
#include "selection.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
@ -68,19 +69,13 @@ static int
|
||||||
ProcSELinuxQueryVersion(ClientPtr client)
|
ProcSELinuxQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
SELinuxQueryVersionReply rep = {
|
SELinuxQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.server_major = SELINUX_MAJOR_VERSION,
|
.server_major = SELINUX_MAJOR_VERSION,
|
||||||
.server_minor = SELINUX_MINOR_VERSION
|
.server_minor = SELINUX_MINOR_VERSION
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(server_major);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD16(server_minor);
|
||||||
swaps(&rep.server_major);
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.server_minor);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -96,20 +91,11 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||||
}
|
}
|
||||||
|
|
||||||
SELinuxGetContextReply rep = {
|
SELinuxGetContextReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(len),
|
|
||||||
.context_len = len
|
.context_len = len
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(context_len);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_EXTRA(ctx, len);
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.context_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(SELinuxGetContextReply), &rep);
|
|
||||||
WriteToClient(client, len, ctx);
|
|
||||||
freecon(ctx);
|
freecon(ctx);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
@ -123,7 +109,8 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxSetCreateContextReq);
|
REQUEST_HEAD_AT_LEAST(SELinuxSetCreateContextReq);
|
||||||
|
REQUEST_FIELD_CARD32(context_len);
|
||||||
REQUEST_FIXED_SIZE(SELinuxSetCreateContextReq, stuff->context_len);
|
REQUEST_FIXED_SIZE(SELinuxSetCreateContextReq, stuff->context_len);
|
||||||
|
|
||||||
if (stuff->context_len > 0) {
|
if (stuff->context_len > 0) {
|
||||||
|
|
@ -153,7 +140,7 @@ ProcSELinuxGetCreateContext(ClientPtr client, unsigned offset)
|
||||||
security_id_t *pSid;
|
security_id_t *pSid;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetCreateContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetCreateContextReq);
|
||||||
|
|
||||||
if (offset == CTX_DEV)
|
if (offset == CTX_DEV)
|
||||||
ptr = dixLookupPrivate(&serverClient->devPrivates, subjectKey);
|
ptr = dixLookupPrivate(&serverClient->devPrivates, subjectKey);
|
||||||
|
|
@ -174,7 +161,9 @@ ProcSELinuxSetDeviceContext(ClientPtr client)
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxSetContextReq);
|
REQUEST_HEAD_AT_LEAST(SELinuxSetContextReq);
|
||||||
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
REQUEST_FIELD_CARD32(context_len);
|
||||||
REQUEST_FIXED_SIZE(SELinuxSetContextReq, stuff->context_len);
|
REQUEST_FIXED_SIZE(SELinuxSetContextReq, stuff->context_len);
|
||||||
|
|
||||||
if (stuff->context_len < 1)
|
if (stuff->context_len < 1)
|
||||||
|
|
@ -211,8 +200,8 @@ ProcSELinuxGetDeviceContext(ClientPtr client)
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetContextReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->id, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->id, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -230,8 +219,8 @@ ProcSELinuxGetDrawableContext(ClientPtr client)
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetContextReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, stuff->id, client, 0, DixGetAttrAccess);
|
rc = dixLookupDrawable(&pDraw, stuff->id, client, 0, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -254,8 +243,9 @@ ProcSELinuxGetPropertyContext(ClientPtr client, void *privKey)
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxGetPropertyContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetPropertyContextReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetPropAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetPropAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -277,8 +267,8 @@ ProcSELinuxGetSelectionContext(ClientPtr client, void *privKey)
|
||||||
SELinuxObjectRec *obj;
|
SELinuxObjectRec *obj;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetContextReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
|
||||||
rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
|
rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -295,8 +285,8 @@ ProcSELinuxGetClientContext(ClientPtr client)
|
||||||
SELinuxSubjectRec *subj;
|
SELinuxSubjectRec *subj;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetContextReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
|
||||||
rc = dixLookupResourceOwner(&target, stuff->id, client, DixGetAttrAccess);
|
rc = dixLookupResourceOwner(&target, stuff->id, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -348,10 +338,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||||
int size, int count)
|
int size, int count)
|
||||||
{
|
{
|
||||||
int rc = BadAlloc, k, pos = 0;
|
int rc = BadAlloc, k, pos = 0;
|
||||||
CARD32 *buf = calloc(size, sizeof(CARD32));
|
CARD32 buf[size];
|
||||||
if (size && !buf) {
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!buf) // silence analyzer warning
|
if (!buf) // silence analyzer warning
|
||||||
goto sendreply;
|
goto sendreply;
|
||||||
|
|
@ -359,18 +346,15 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||||
/* Fill in the buffer */
|
/* Fill in the buffer */
|
||||||
for (k = 0; k < count; k++) {
|
for (k = 0; k < count; k++) {
|
||||||
buf[pos] = items[k].id;
|
buf[pos] = items[k].id;
|
||||||
if (client->swapped)
|
REPLY_BUF_CARD32(buf + pos, 1);
|
||||||
swapl(buf + pos);
|
|
||||||
pos++;
|
pos++;
|
||||||
|
|
||||||
buf[pos] = items[k].octx_len * 4;
|
buf[pos] = items[k].octx_len * 4;
|
||||||
if (client->swapped)
|
REPLY_BUF_CARD32(buf + pos, 1);
|
||||||
swapl(buf + pos);
|
|
||||||
pos++;
|
pos++;
|
||||||
|
|
||||||
buf[pos] = items[k].dctx_len * 4;
|
buf[pos] = items[k].dctx_len * 4;
|
||||||
if (client->swapped)
|
REPLY_BUF_CARD32(buf + pos, 1);
|
||||||
swapl(buf + pos);
|
|
||||||
pos++;
|
pos++;
|
||||||
|
|
||||||
memcpy((char *) (buf + pos), items[k].octx, strlen(items[k].octx) + 1);
|
memcpy((char *) (buf + pos), items[k].octx, strlen(items[k].octx) + 1);
|
||||||
|
|
@ -382,27 +366,15 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||||
sendreply: ;
|
sendreply: ;
|
||||||
/* Send reply to client */
|
/* Send reply to client */
|
||||||
SELinuxListItemsReply rep = {
|
SELinuxListItemsReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = size,
|
|
||||||
.count = count
|
.count = count
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(count);
|
||||||
swapl(&rep.length);
|
REPLY_SEND_EXTRA(buf, size * sizeof(CARD32));
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.count);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(SELinuxListItemsReply), &rep);
|
|
||||||
WriteToClient(client, size * 4, buf);
|
|
||||||
|
|
||||||
/* Free stuff and return */
|
/* Free stuff and return */
|
||||||
rc = Success;
|
|
||||||
free(buf);
|
|
||||||
out:
|
|
||||||
SELinuxFreeItems(items, count);
|
SELinuxFreeItems(items, count);
|
||||||
return rc;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -414,8 +386,8 @@ ProcSELinuxListProperties(ClientPtr client)
|
||||||
int rc, count, size, i;
|
int rc, count, size, i;
|
||||||
CARD32 id;
|
CARD32 id;
|
||||||
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetContextReq);
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
REQUEST_FIELD_CARD32(id);
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixListPropAccess);
|
rc = dixLookupWindow(&pWin, stuff->id, client, DixListPropAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -453,7 +425,7 @@ ProcSELinuxListSelections(ClientPtr client)
|
||||||
int rc, count, size, i;
|
int rc, count, size, i;
|
||||||
CARD32 id;
|
CARD32 id;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetCreateContextReq);
|
REQUEST_HEAD_STRUCT(SELinuxGetCreateContextReq);
|
||||||
|
|
||||||
/* Count the number of selections and allocate items */
|
/* Count the number of selections and allocate items */
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
@ -535,151 +507,6 @@ ProcSELinuxDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxQueryVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
return ProcSELinuxQueryVersion(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxSetCreateContextReq);
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
|
|
||||||
swapl(&stuff->context_len);
|
|
||||||
return ProcSELinuxSetCreateContext(client, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxSetDeviceContext(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxSetContextReq);
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
swapl(&stuff->context_len);
|
|
||||||
return ProcSELinuxSetDeviceContext(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxGetDeviceContext(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
return ProcSELinuxGetDeviceContext(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxGetDrawableContext(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
return ProcSELinuxGetDrawableContext(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxGetPropertyContext(ClientPtr client, void *privKey)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxGetPropertyContextReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
swapl(&stuff->property);
|
|
||||||
return ProcSELinuxGetPropertyContext(client, privKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxGetSelectionContext(ClientPtr client, void *privKey)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
return ProcSELinuxGetSelectionContext(client, privKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxListProperties(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
return ProcSELinuxListProperties(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxGetClientContext(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(SELinuxGetContextReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
|
|
||||||
swapl(&stuff->id);
|
|
||||||
return ProcSELinuxGetClientContext(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcSELinuxDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_SELinuxQueryVersion:
|
|
||||||
return SProcSELinuxQueryVersion(client);
|
|
||||||
case X_SELinuxSetDeviceCreateContext:
|
|
||||||
return SProcSELinuxSetCreateContext(client, CTX_DEV);
|
|
||||||
case X_SELinuxGetDeviceCreateContext:
|
|
||||||
return ProcSELinuxGetCreateContext(client, CTX_DEV);
|
|
||||||
case X_SELinuxSetDeviceContext:
|
|
||||||
return SProcSELinuxSetDeviceContext(client);
|
|
||||||
case X_SELinuxGetDeviceContext:
|
|
||||||
return SProcSELinuxGetDeviceContext(client);
|
|
||||||
case X_SELinuxSetDrawableCreateContext:
|
|
||||||
return SProcSELinuxSetCreateContext(client, CTX_WIN);
|
|
||||||
case X_SELinuxGetDrawableCreateContext:
|
|
||||||
return ProcSELinuxGetCreateContext(client, CTX_WIN);
|
|
||||||
case X_SELinuxGetDrawableContext:
|
|
||||||
return SProcSELinuxGetDrawableContext(client);
|
|
||||||
case X_SELinuxSetPropertyCreateContext:
|
|
||||||
return SProcSELinuxSetCreateContext(client, CTX_PRP);
|
|
||||||
case X_SELinuxGetPropertyCreateContext:
|
|
||||||
return ProcSELinuxGetCreateContext(client, CTX_PRP);
|
|
||||||
case X_SELinuxSetPropertyUseContext:
|
|
||||||
return SProcSELinuxSetCreateContext(client, USE_PRP);
|
|
||||||
case X_SELinuxGetPropertyUseContext:
|
|
||||||
return ProcSELinuxGetCreateContext(client, USE_PRP);
|
|
||||||
case X_SELinuxGetPropertyContext:
|
|
||||||
return SProcSELinuxGetPropertyContext(client, objectKey);
|
|
||||||
case X_SELinuxGetPropertyDataContext:
|
|
||||||
return SProcSELinuxGetPropertyContext(client, dataKey);
|
|
||||||
case X_SELinuxListProperties:
|
|
||||||
return SProcSELinuxListProperties(client);
|
|
||||||
case X_SELinuxSetSelectionCreateContext:
|
|
||||||
return SProcSELinuxSetCreateContext(client, CTX_SEL);
|
|
||||||
case X_SELinuxGetSelectionCreateContext:
|
|
||||||
return ProcSELinuxGetCreateContext(client, CTX_SEL);
|
|
||||||
case X_SELinuxSetSelectionUseContext:
|
|
||||||
return SProcSELinuxSetCreateContext(client, USE_SEL);
|
|
||||||
case X_SELinuxGetSelectionUseContext:
|
|
||||||
return ProcSELinuxGetCreateContext(client, USE_SEL);
|
|
||||||
case X_SELinuxGetSelectionContext:
|
|
||||||
return SProcSELinuxGetSelectionContext(client, objectKey);
|
|
||||||
case X_SELinuxGetSelectionDataContext:
|
|
||||||
return SProcSELinuxGetSelectionContext(client, dataKey);
|
|
||||||
case X_SELinuxListSelections:
|
|
||||||
return ProcSELinuxListSelections(client);
|
|
||||||
case X_SELinuxGetClientContext:
|
|
||||||
return SProcSELinuxGetClientContext(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extension Setup / Teardown
|
* Extension Setup / Teardown
|
||||||
*/
|
*/
|
||||||
|
|
@ -715,5 +542,5 @@ SELinuxExtensionInit(void)
|
||||||
/* Add extension to server */
|
/* Add extension to server */
|
||||||
AddExtension(SELINUX_EXTENSION_NAME, SELinuxNumberEvents,
|
AddExtension(SELINUX_EXTENSION_NAME, SELinuxNumberEvents,
|
||||||
SELinuxNumberErrors, ProcSELinuxDispatch,
|
SELinuxNumberErrors, ProcSELinuxDispatch,
|
||||||
SProcSELinuxDispatch, SELinuxResetProc, StandardMinorOpcode);
|
ProcSELinuxDispatch, SELinuxResetProc, StandardMinorOpcode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
101
Xext/xtest.c
101
Xext/xtest.c
|
|
@ -38,6 +38,7 @@
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "mi/mipointer_priv.h"
|
#include "mi/mipointer_priv.h"
|
||||||
#include "os/client_priv.h"
|
#include "os/client_priv.h"
|
||||||
|
|
@ -89,35 +90,30 @@ static int XTestSwapFakeInput(ClientPtr /* client */ ,
|
||||||
static int
|
static int
|
||||||
ProcXTestGetVersion(ClientPtr client)
|
ProcXTestGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXTestGetVersionReq);
|
||||||
|
REQUEST_FIELD_CARD16(minorVersion);
|
||||||
|
|
||||||
xXTestGetVersionReply rep = {
|
xXTestGetVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.majorVersion = XTestMajorVersion,
|
.majorVersion = XTestMajorVersion,
|
||||||
.minorVersion = XTestMinorVersion
|
.minorVersion = XTestMinorVersion
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
REPLY_FIELD_CARD16(minorVersion);
|
||||||
|
REPLY_SEND_RET_SUCCESS();
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swaps(&rep.minorVersion);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXTestGetVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXTestCompareCursor(ClientPtr client)
|
ProcXTestCompareCursor(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXTestCompareCursorReq);
|
REQUEST_HEAD_STRUCT(xXTestCompareCursorReq);
|
||||||
xXTestCompareCursorReply rep;
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
REQUEST_FIELD_CARD32(cursor);
|
||||||
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int rc;
|
int rc;
|
||||||
DeviceIntPtr ptr = PickPointer(client);
|
DeviceIntPtr ptr = PickPointer(client);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -137,17 +133,11 @@ ProcXTestCompareCursor(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep = (xXTestCompareCursorReply) {
|
|
||||||
.type = X_Reply,
|
xXTestCompareCursorReply rep = {
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.same = (wCursor(pWin) == pCursor)
|
.same = (wCursor(pWin) == pCursor)
|
||||||
};
|
};
|
||||||
if (client->swapped) {
|
REPLY_SEND_RET_SUCCESS();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -182,7 +172,14 @@ XTestDeviceSendEvents(DeviceIntPtr dev,
|
||||||
static int
|
static int
|
||||||
ProcXTestFakeInput(ClientPtr client)
|
ProcXTestFakeInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXTestFakeInputReq);
|
REQUEST_HEAD_NO_CHECK(xXTestFakeInputReq);
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
int n = XTestSwapFakeInput(client, (xReq *)stuff);
|
||||||
|
if (n != Success)
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
int nev, n, type, rc;
|
int nev, n, type, rc;
|
||||||
xEvent *ev;
|
xEvent *ev;
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev = NULL;
|
||||||
|
|
@ -372,6 +369,7 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
/* swap the request back so we can simply re-execute it */
|
/* swap the request back so we can simply re-execute it */
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
(void) XTestSwapFakeInput(client, (xReq *) stuff);
|
(void) XTestSwapFakeInput(client, (xReq *) stuff);
|
||||||
|
REQUEST_FIELD_CARD16(length);
|
||||||
}
|
}
|
||||||
ResetCurrentRequest(client);
|
ResetCurrentRequest(client);
|
||||||
client->sequence--;
|
client->sequence--;
|
||||||
|
|
@ -449,9 +447,8 @@ ProcXTestFakeInput(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXTestGrabControl(ClientPtr client)
|
ProcXTestGrabControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXTestGrabControlReq);
|
REQUEST_HEAD_STRUCT(xXTestGrabControlReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
|
|
||||||
if ((stuff->impervious != xTrue) && (stuff->impervious != xFalse)) {
|
if ((stuff->impervious != xTrue) && (stuff->impervious != xFalse)) {
|
||||||
client->errorValue = stuff->impervious;
|
client->errorValue = stuff->impervious;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
@ -481,25 +478,6 @@ ProcXTestDispatch(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXTestGetVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXTestGetVersionReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
|
||||||
swaps(&stuff->minorVersion);
|
|
||||||
return ProcXTestGetVersion(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXTestCompareCursor(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXTestCompareCursorReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
swapl(&stuff->cursor);
|
|
||||||
return ProcXTestCompareCursor(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
static int _X_COLD
|
||||||
XTestSwapFakeInput(ClientPtr client, xReq * req)
|
XTestSwapFakeInput(ClientPtr client, xReq * req)
|
||||||
{
|
{
|
||||||
|
|
@ -524,37 +502,6 @@ XTestSwapFakeInput(ClientPtr client, xReq * req)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXTestFakeInput(ClientPtr client)
|
|
||||||
{
|
|
||||||
int n;
|
|
||||||
|
|
||||||
REQUEST(xReq);
|
|
||||||
|
|
||||||
n = XTestSwapFakeInput(client, stuff);
|
|
||||||
if (n != Success)
|
|
||||||
return n;
|
|
||||||
return ProcXTestFakeInput(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int _X_COLD
|
|
||||||
SProcXTestDispatch(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xReq);
|
|
||||||
switch (stuff->data) {
|
|
||||||
case X_XTestGetVersion:
|
|
||||||
return SProcXTestGetVersion(client);
|
|
||||||
case X_XTestCompareCursor:
|
|
||||||
return SProcXTestCompareCursor(client);
|
|
||||||
case X_XTestFakeInput:
|
|
||||||
return SProcXTestFakeInput(client);
|
|
||||||
case X_XTestGrabControl:
|
|
||||||
return ProcXTestGrabControl(client);
|
|
||||||
default:
|
|
||||||
return BadRequest;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate an virtual slave device for xtest events, this
|
* Allocate an virtual slave device for xtest events, this
|
||||||
* is a slave device to inputInfo master devices
|
* is a slave device to inputInfo master devices
|
||||||
|
|
@ -686,7 +633,7 @@ void
|
||||||
XTestExtensionInit(void)
|
XTestExtensionInit(void)
|
||||||
{
|
{
|
||||||
AddExtension(XTestExtensionName, 0, 0,
|
AddExtension(XTestExtensionName, 0, 0,
|
||||||
ProcXTestDispatch, SProcXTestDispatch,
|
ProcXTestDispatch, ProcXTestDispatch,
|
||||||
XTestExtensionTearDown, StandardMinorOpcode);
|
XTestExtensionTearDown, StandardMinorOpcode);
|
||||||
|
|
||||||
xtest_evlist = InitEventList(GetMaximumEventsNum());
|
xtest_evlist = InitEventList(GetMaximumEventsNum());
|
||||||
|
|
|
||||||
976
Xext/xvdisp.c
976
Xext/xvdisp.c
File diff suppressed because it is too large
Load Diff
|
|
@ -183,7 +183,7 @@ XvExtensionInit(void)
|
||||||
XvExtensionGeneration = serverGeneration;
|
XvExtensionGeneration = serverGeneration;
|
||||||
|
|
||||||
extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors,
|
extEntry = AddExtension(XvName, XvNumEvents, XvNumErrors,
|
||||||
ProcXvDispatch, SProcXvDispatch,
|
ProcXvDispatch, ProcXvDispatch,
|
||||||
XvResetProc, StandardMinorOpcode);
|
XvResetProc, StandardMinorOpcode);
|
||||||
if (!extEntry) {
|
if (!extEntry) {
|
||||||
FatalError("XvExtensionInit: AddExtensions failed\n");
|
FatalError("XvExtensionInit: AddExtensions failed\n");
|
||||||
|
|
|
||||||
330
Xext/xvmc.c
330
Xext/xvmc.c
|
|
@ -4,7 +4,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
#include <X11/Xfuncproto.h>
|
||||||
|
#include <X11/extensions/XvMC.h>
|
||||||
|
#include <X11/extensions/Xvproto.h>
|
||||||
|
#include <X11/extensions/XvMCproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/screen_hooks_priv.h"
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "Xext/xvdix_priv.h"
|
#include "Xext/xvdix_priv.h"
|
||||||
|
|
||||||
|
|
@ -16,10 +21,6 @@
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "extinit_priv.h"
|
#include "extinit_priv.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
#include <X11/Xfuncproto.h>
|
|
||||||
#include <X11/extensions/XvMC.h>
|
|
||||||
#include <X11/extensions/Xvproto.h>
|
|
||||||
#include <X11/extensions/XvMCproto.h>
|
|
||||||
#include "xvmcext.h"
|
#include "xvmcext.h"
|
||||||
|
|
||||||
#ifdef HAS_XVMCSHM
|
#ifdef HAS_XVMCSHM
|
||||||
|
|
@ -109,35 +110,27 @@ XvMCDestroySubpictureRes(void *data, XID id)
|
||||||
static int
|
static int
|
||||||
ProcXvMCQueryVersion(ClientPtr client)
|
ProcXvMCQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcQueryVersionReq);
|
||||||
|
|
||||||
xvmcQueryVersionReply rep = {
|
xvmcQueryVersionReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.major = SERVER_XVMC_MAJOR_VERSION,
|
.major = SERVER_XVMC_MAJOR_VERSION,
|
||||||
.minor = SERVER_XVMC_MINOR_VERSION
|
.minor = SERVER_XVMC_MINOR_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
/* REQUEST(xvmcQueryVersionReq); */
|
REPLY_FIELD_CARD32(major);
|
||||||
REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
|
REPLY_FIELD_CARD32(minor);
|
||||||
|
REPLY_SEND_RET_SUCCESS();
|
||||||
WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep);
|
|
||||||
return Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvMCListSurfaceTypes(ClientPtr client)
|
ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
{
|
{
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
int i;
|
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
xvmcListSurfaceTypesReply rep;
|
|
||||||
xvmcSurfaceInfo info;
|
|
||||||
XvMCAdaptorPtr adaptor = NULL;
|
XvMCAdaptorPtr adaptor = NULL;
|
||||||
XvMCSurfaceInfoPtr surface;
|
|
||||||
int num_surfaces;
|
|
||||||
|
|
||||||
REQUEST(xvmcListSurfaceTypesReq);
|
REQUEST_HEAD_STRUCT(xvmcListSurfaceTypesReq);
|
||||||
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
|
@ -145,7 +138,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
|
||||||
|
|
||||||
if ((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
|
if ((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
|
||||||
for (i = 0; i < pScreenPriv->num_adaptors; i++) {
|
for (int i = 0; i < pScreenPriv->num_adaptors; i++) {
|
||||||
if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
|
if (pPort->pAdaptor == pScreenPriv->adaptors[i].xv_adaptor) {
|
||||||
adaptor = &(pScreenPriv->adaptors[i]);
|
adaptor = &(pScreenPriv->adaptors[i]);
|
||||||
break;
|
break;
|
||||||
|
|
@ -154,29 +147,33 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
|
int num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
|
||||||
rep = (xvmcListSurfaceTypesReply) {
|
xvmcSurfaceInfo *info = calloc(sizeof(xvmcSurfaceInfo), num_surfaces);
|
||||||
.type = X_Reply,
|
if (!info)
|
||||||
.sequenceNumber = client->sequence,
|
return BadAlloc;
|
||||||
.num = num_surfaces,
|
|
||||||
.length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)),
|
|
||||||
};
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
|
for (int i = 0; i < num_surfaces; i++) {
|
||||||
|
XvMCSurfaceInfoPtr surface = adaptor->surfaces[i];
|
||||||
|
info[i].surface_type_id = surface->surface_type_id;
|
||||||
|
info[i].chroma_format = surface->chroma_format;
|
||||||
|
info[i].max_width = surface->max_width;
|
||||||
|
info[i].max_height = surface->max_height;
|
||||||
|
info[i].subpicture_max_width = surface->subpicture_max_width;
|
||||||
|
info[i].subpicture_max_height = surface->subpicture_max_height;
|
||||||
|
info[i].mc_type = surface->mc_type;
|
||||||
|
info[i].flags = surface->flags;
|
||||||
|
|
||||||
for (i = 0; i < num_surfaces; i++) {
|
CLIENT_STRUCT_CARD16_5(&info[i], chroma_format, max_width, max_height,
|
||||||
surface = adaptor->surfaces[i];
|
subpicture_max_width, subpicture_max_height);
|
||||||
info.surface_type_id = surface->surface_type_id;
|
CLIENT_STRUCT_CARD32_3(&info[i], surface_type_id, mc_type, flags);
|
||||||
info.chroma_format = surface->chroma_format;
|
|
||||||
info.max_width = surface->max_width;
|
|
||||||
info.max_height = surface->max_height;
|
|
||||||
info.subpicture_max_width = surface->subpicture_max_width;
|
|
||||||
info.subpicture_max_height = surface->subpicture_max_height;
|
|
||||||
info.mc_type = surface->mc_type;
|
|
||||||
info.flags = surface->flags;
|
|
||||||
WriteToClient(client, sizeof(xvmcSurfaceInfo), &info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xvmcListSurfaceTypesReply rep = {
|
||||||
|
.num = num_surfaces,
|
||||||
|
};
|
||||||
|
|
||||||
|
REPLY_FIELD_CARD32(num);
|
||||||
|
REPLY_SEND_EXTRA(info, sizeof(xvmcSurfaceInfo) * num_surfaces);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,10 +189,12 @@ ProcXvMCCreateContext(ClientPtr client)
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
XvMCAdaptorPtr adaptor = NULL;
|
XvMCAdaptorPtr adaptor = NULL;
|
||||||
XvMCSurfaceInfoPtr surface = NULL;
|
XvMCSurfaceInfoPtr surface = NULL;
|
||||||
xvmcCreateContextReply rep;
|
|
||||||
|
|
||||||
REQUEST(xvmcCreateContextReq);
|
REQUEST_HEAD_STRUCT(xvmcCreateContextReq);
|
||||||
REQUEST_SIZE_MATCH(xvmcCreateContextReq);
|
REQUEST_FIELD_CARD32(context_id);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
REQUEST_FIELD_CARD32(flags);
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
|
|
@ -257,33 +256,31 @@ ProcXvMCCreateContext(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xvmcCreateContextReply) {
|
xvmcCreateContextReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = dwords,
|
|
||||||
.width_actual = pContext->width,
|
.width_actual = pContext->width,
|
||||||
.height_actual = pContext->height,
|
.height_actual = pContext->height,
|
||||||
.flags_return = pContext->flags
|
.flags_return = pContext->flags
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
|
REPLY_FIELD_CARD16(width_actual);
|
||||||
if (dwords)
|
REPLY_FIELD_CARD16(height_actual);
|
||||||
WriteToClient(client, dwords << 2, data);
|
REPLY_FIELD_CARD32(flags_return);
|
||||||
|
REPLY_BUF_CARD32(data, dwords);
|
||||||
|
REPLY_SEND_EXTRA(data, dwords * sizeof(CARD32));
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvMCDestroyContext(ClientPtr client)
|
ProcXvMCDestroyContext(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcDestroyContextReq);
|
||||||
|
REQUEST_FIELD_CARD32(context_id);
|
||||||
|
|
||||||
void *val;
|
void *val;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xvmcDestroyContextReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcDestroyContextReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext,
|
rc = dixLookupResourceByType(&val, stuff->context_id, XvMCRTContext,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -297,16 +294,16 @@ ProcXvMCDestroyContext(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvMCCreateSurface(ClientPtr client)
|
ProcXvMCCreateSurface(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcCreateSurfaceReq);
|
||||||
|
REQUEST_FIELD_CARD32(surface_id);
|
||||||
|
REQUEST_FIELD_CARD32(context_id);
|
||||||
|
|
||||||
CARD32 *data = NULL;
|
CARD32 *data = NULL;
|
||||||
int dwords = 0;
|
int dwords = 0;
|
||||||
int result;
|
int result;
|
||||||
XvMCContextPtr pContext;
|
XvMCContextPtr pContext;
|
||||||
XvMCSurfacePtr pSurface;
|
XvMCSurfacePtr pSurface;
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
xvmcCreateSurfaceReply rep;
|
|
||||||
|
|
||||||
REQUEST(xvmcCreateSurfaceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcCreateSurfaceReq);
|
|
||||||
|
|
||||||
result = dixLookupResourceByType((void **) &pContext, stuff->context_id,
|
result = dixLookupResourceByType((void **) &pContext, stuff->context_id,
|
||||||
XvMCRTContext, client, DixUseAccess);
|
XvMCRTContext, client, DixUseAccess);
|
||||||
|
|
@ -336,15 +333,10 @@ ProcXvMCCreateSurface(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xvmcCreateSurfaceReply) {
|
xvmcCreateSurfaceReply rep = { 0 };
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = dwords
|
|
||||||
};
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
|
REPLY_BUF_CARD32(data, dwords);
|
||||||
if (dwords)
|
REPLY_SEND_EXTRA(data, dwords * sizeof(CARD32));
|
||||||
WriteToClient(client, dwords << 2, data);
|
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
|
@ -356,12 +348,12 @@ ProcXvMCCreateSurface(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvMCDestroySurface(ClientPtr client)
|
ProcXvMCDestroySurface(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcDestroySurfaceReq);
|
||||||
|
REQUEST_FIELD_CARD32(surface_id);
|
||||||
|
|
||||||
void *val;
|
void *val;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xvmcDestroySurfaceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcDestroySurfaceReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface,
|
rc = dixLookupResourceByType(&val, stuff->surface_id, XvMCRTSurface,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -375,19 +367,22 @@ ProcXvMCDestroySurface(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvMCCreateSubpicture(ClientPtr client)
|
ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcCreateSubpictureReq);
|
||||||
|
REQUEST_FIELD_CARD32(subpicture_id);
|
||||||
|
REQUEST_FIELD_CARD32(context_id);
|
||||||
|
REQUEST_FIELD_CARD32(xvimage_id);
|
||||||
|
REQUEST_FIELD_CARD16(width);
|
||||||
|
REQUEST_FIELD_CARD16(height);
|
||||||
|
|
||||||
Bool image_supported = FALSE;
|
Bool image_supported = FALSE;
|
||||||
CARD32 *data = NULL;
|
CARD32 *data = NULL;
|
||||||
int i, result, dwords = 0;
|
int i, result, dwords = 0;
|
||||||
XvMCContextPtr pContext;
|
XvMCContextPtr pContext;
|
||||||
XvMCSubpicturePtr pSubpicture;
|
XvMCSubpicturePtr pSubpicture;
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
xvmcCreateSubpictureReply rep;
|
|
||||||
XvMCAdaptorPtr adaptor;
|
XvMCAdaptorPtr adaptor;
|
||||||
XvMCSurfaceInfoPtr surface = NULL;
|
XvMCSurfaceInfoPtr surface = NULL;
|
||||||
|
|
||||||
REQUEST(xvmcCreateSubpictureReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcCreateSubpictureReq);
|
|
||||||
|
|
||||||
result = dixLookupResourceByType((void **) &pContext, stuff->context_id,
|
result = dixLookupResourceByType((void **) &pContext, stuff->context_id,
|
||||||
XvMCRTContext, client, DixUseAccess);
|
XvMCRTContext, client, DixUseAccess);
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
|
|
@ -456,10 +451,7 @@ ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xvmcCreateSubpictureReply) {
|
xvmcCreateSubpictureReply rep = {
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = dwords,
|
|
||||||
.width_actual = pSubpicture->width,
|
.width_actual = pSubpicture->width,
|
||||||
.height_actual = pSubpicture->height,
|
.height_actual = pSubpicture->height,
|
||||||
.num_palette_entries = pSubpicture->num_palette_entries,
|
.num_palette_entries = pSubpicture->num_palette_entries,
|
||||||
|
|
@ -470,9 +462,12 @@ ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
.component_order[3] = pSubpicture->component_order[3]
|
.component_order[3] = pSubpicture->component_order[3]
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
|
REPLY_FIELD_CARD16(width_actual);
|
||||||
if (dwords)
|
REPLY_FIELD_CARD16(height_actual);
|
||||||
WriteToClient(client, dwords << 2, data);
|
REPLY_FIELD_CARD16(num_palette_entries);
|
||||||
|
REPLY_FIELD_CARD16(entry_bytes);
|
||||||
|
REPLY_BUF_CARD32(data, dwords);
|
||||||
|
REPLY_SEND_EXTRA(data, dwords * sizeof(CARD32));
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
|
|
||||||
|
|
@ -484,12 +479,12 @@ ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvMCDestroySubpicture(ClientPtr client)
|
ProcXvMCDestroySubpicture(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcDestroySubpictureReq);
|
||||||
|
REQUEST_FIELD_CARD32(subpicture_id);
|
||||||
|
|
||||||
void *val;
|
void *val;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xvmcDestroySubpictureReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcDestroySubpictureReq);
|
|
||||||
|
|
||||||
rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture,
|
rc = dixLookupResourceByType(&val, stuff->subpicture_id, XvMCRTSubpicture,
|
||||||
client, DixDestroyAccess);
|
client, DixDestroyAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -503,19 +498,18 @@ ProcXvMCDestroySubpicture(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcXvMCListSubpictureTypes(ClientPtr client)
|
ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xvmcListSubpictureTypesReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(surface_type_id);
|
||||||
|
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
xvmcListSubpictureTypesReply rep;
|
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
XvMCAdaptorPtr adaptor = NULL;
|
XvMCAdaptorPtr adaptor = NULL;
|
||||||
XvMCSurfaceInfoPtr surface = NULL;
|
XvMCSurfaceInfoPtr surface = NULL;
|
||||||
xvImageFormatInfo info;
|
|
||||||
XvImagePtr pImage;
|
XvImagePtr pImage;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
REQUEST(xvmcListSubpictureTypesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcListSubpictureTypesReq);
|
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
pScreen = pPort->pAdaptor->pScreen;
|
pScreen = pPort->pAdaptor->pScreen;
|
||||||
|
|
@ -546,19 +540,11 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
if (!surface)
|
if (!surface)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
rep = (xvmcListSubpictureTypesReply) {
|
int num = (surface->compatible_subpictures ?
|
||||||
.type = X_Reply,
|
surface->compatible_subpictures->num_xvimages : 0);
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.num = 0
|
|
||||||
};
|
|
||||||
if (surface->compatible_subpictures)
|
|
||||||
rep.num = surface->compatible_subpictures->num_xvimages;
|
|
||||||
|
|
||||||
rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo));
|
xvImageFormatInfo info[num];
|
||||||
|
for (i = 0; i < num; i++) {
|
||||||
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep);
|
|
||||||
|
|
||||||
for (i = 0; i < rep.num; i++) {
|
|
||||||
pImage = NULL;
|
pImage = NULL;
|
||||||
for (j = 0; j < adaptor->num_subpictures; j++) {
|
for (j = 0; j < adaptor->num_subpictures; j++) {
|
||||||
if (surface->compatible_subpictures->xvimage_ids[i] ==
|
if (surface->compatible_subpictures->xvimage_ids[i] ==
|
||||||
|
|
@ -570,38 +556,50 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
if (!pImage)
|
if (!pImage)
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
|
||||||
info.id = pImage->id;
|
info[i].id = pImage->id;
|
||||||
info.type = pImage->type;
|
info[i].type = pImage->type;
|
||||||
info.byte_order = pImage->byte_order;
|
info[i].byte_order = pImage->byte_order;
|
||||||
memcpy(&info.guid, pImage->guid, 16);
|
memcpy(&info[i].guid, pImage->guid, 16);
|
||||||
info.bpp = pImage->bits_per_pixel;
|
info[i].bpp = pImage->bits_per_pixel;
|
||||||
info.num_planes = pImage->num_planes;
|
info[i].num_planes = pImage->num_planes;
|
||||||
info.depth = pImage->depth;
|
info[i].depth = pImage->depth;
|
||||||
info.red_mask = pImage->red_mask;
|
info[i].red_mask = pImage->red_mask;
|
||||||
info.green_mask = pImage->green_mask;
|
info[i].green_mask = pImage->green_mask;
|
||||||
info.blue_mask = pImage->blue_mask;
|
info[i].blue_mask = pImage->blue_mask;
|
||||||
info.format = pImage->format;
|
info[i].format = pImage->format;
|
||||||
info.y_sample_bits = pImage->y_sample_bits;
|
info[i].y_sample_bits = pImage->y_sample_bits;
|
||||||
info.u_sample_bits = pImage->u_sample_bits;
|
info[i].u_sample_bits = pImage->u_sample_bits;
|
||||||
info.v_sample_bits = pImage->v_sample_bits;
|
info[i].v_sample_bits = pImage->v_sample_bits;
|
||||||
info.horz_y_period = pImage->horz_y_period;
|
info[i].horz_y_period = pImage->horz_y_period;
|
||||||
info.horz_u_period = pImage->horz_u_period;
|
info[i].horz_u_period = pImage->horz_u_period;
|
||||||
info.horz_v_period = pImage->horz_v_period;
|
info[i].horz_v_period = pImage->horz_v_period;
|
||||||
info.vert_y_period = pImage->vert_y_period;
|
info[i].vert_y_period = pImage->vert_y_period;
|
||||||
info.vert_u_period = pImage->vert_u_period;
|
info[i].vert_u_period = pImage->vert_u_period;
|
||||||
info.vert_v_period = pImage->vert_v_period;
|
info[i].vert_v_period = pImage->vert_v_period;
|
||||||
memcpy(&info.comp_order, pImage->component_order, 32);
|
memcpy(&info[i].comp_order, pImage->component_order, 32);
|
||||||
info.scanline_order = pImage->scanline_order;
|
info[i].scanline_order = pImage->scanline_order;
|
||||||
WriteToClient(client, sizeof(xvImageFormatInfo), &info);
|
|
||||||
|
CLIENT_STRUCT_CARD32_5(&info[i], id, red_mask, green_mask, blue_mask, y_sample_bits);
|
||||||
|
CLIENT_STRUCT_CARD32_5(&info[i], u_sample_bits, v_sample_bits, horz_y_period, horz_u_period, horz_v_period);
|
||||||
|
CLIENT_STRUCT_CARD32_3(&info[i], vert_y_period, vert_u_period, vert_v_period);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xvmcListSubpictureTypesReply rep = {
|
||||||
|
.num = num,
|
||||||
|
};
|
||||||
|
|
||||||
|
REPLY_SEND_EXTRA(info, sizeof(info));
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvMCGetDRInfo(ClientPtr client)
|
ProcXvMCGetDRInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
xvmcGetDRInfoReply rep;
|
REQUEST_HEAD_STRUCT(xvmcGetDRInfoReq);
|
||||||
|
REQUEST_FIELD_CARD32(port);
|
||||||
|
REQUEST_FIELD_CARD32(shmKey);
|
||||||
|
REQUEST_FIELD_CARD32(magic);
|
||||||
|
|
||||||
XvPortPtr pPort;
|
XvPortPtr pPort;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
XvMCScreenPtr pScreenPriv;
|
XvMCScreenPtr pScreenPriv;
|
||||||
|
|
@ -610,29 +608,29 @@ ProcXvMCGetDRInfo(ClientPtr client)
|
||||||
volatile CARD32 *patternP;
|
volatile CARD32 *patternP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
REQUEST(xvmcGetDRInfoReq);
|
|
||||||
REQUEST_SIZE_MATCH(xvmcGetDRInfoReq);
|
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
pScreen = pPort->pAdaptor->pScreen;
|
pScreen = pPort->pAdaptor->pScreen;
|
||||||
pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
||||||
|
|
||||||
rep = (xvmcGetDRInfoReply) {
|
int nameLen = strlen(pScreenPriv->clientDriverName) + 1;
|
||||||
.type = X_Reply,
|
int busIDLen = strlen(pScreenPriv->busID) + 1;
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
|
// buffer holds two zero-terminated strings, padded to 4-byte ints
|
||||||
|
char buf[pad_to_int32(nameLen+busIDLen)];
|
||||||
|
memset(buf, 0, sizeof(buf));
|
||||||
|
memcpy(buf, pScreenPriv->clientDriverName, nameLen);
|
||||||
|
memcpy(buf+nameLen, pScreenPriv->busID, busIDLen);
|
||||||
|
|
||||||
|
xvmcGetDRInfoReply rep = {
|
||||||
.major = pScreenPriv->major,
|
.major = pScreenPriv->major,
|
||||||
.minor = pScreenPriv->minor,
|
.minor = pScreenPriv->minor,
|
||||||
.patchLevel = pScreenPriv->patchLevel,
|
.patchLevel = pScreenPriv->patchLevel,
|
||||||
.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1),
|
.nameLen = nameLen,
|
||||||
.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1),
|
.busIDLen = busIDLen,
|
||||||
.isLocal = 1
|
.isLocal = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
rep.length = rep.nameLen + rep.busIDLen;
|
|
||||||
rep.nameLen <<= 2;
|
|
||||||
rep.busIDLen <<= 2;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read back to the client what she has put in the shared memory
|
* Read back to the client what she has put in the shared memory
|
||||||
* segment she prepared for us.
|
* segment she prepared for us.
|
||||||
|
|
@ -659,41 +657,45 @@ ProcXvMCGetDRInfo(ClientPtr client)
|
||||||
}
|
}
|
||||||
#endif /* HAS_XVMCSHM */
|
#endif /* HAS_XVMCSHM */
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcGetDRInfoReply), &rep);
|
REPLY_FIELD_CARD32(major);
|
||||||
if (rep.length) {
|
REPLY_FIELD_CARD32(minor);
|
||||||
WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName);
|
REPLY_FIELD_CARD32(patchLevel);
|
||||||
WriteToClient(client, rep.busIDLen, pScreenPriv->busID);
|
REPLY_FIELD_CARD32(nameLen);
|
||||||
}
|
REPLY_FIELD_CARD32(busIDLen);
|
||||||
|
REPLY_FIELD_CARD32(isLocal);
|
||||||
|
REPLY_SEND_EXTRA(buf, sizeof(buf));
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int (*ProcXvMCVector[xvmcNumRequest]) (ClientPtr) = {
|
|
||||||
ProcXvMCQueryVersion,
|
|
||||||
ProcXvMCListSurfaceTypes,
|
|
||||||
ProcXvMCCreateContext,
|
|
||||||
ProcXvMCDestroyContext,
|
|
||||||
ProcXvMCCreateSurface,
|
|
||||||
ProcXvMCDestroySurface,
|
|
||||||
ProcXvMCCreateSubpicture,
|
|
||||||
ProcXvMCDestroySubpicture,
|
|
||||||
ProcXvMCListSubpictureTypes, ProcXvMCGetDRInfo};
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ProcXvMCDispatch(ClientPtr client)
|
ProcXvMCDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
|
switch (stuff->data)
|
||||||
if (stuff->data < xvmcNumRequest)
|
{
|
||||||
return (*ProcXvMCVector[stuff->data]) (client);
|
case xvmc_QueryVersion:
|
||||||
else
|
return ProcXvMCQueryVersion(client);
|
||||||
return BadRequest;
|
case xvmc_ListSurfaceTypes:
|
||||||
}
|
return ProcXvMCListSurfaceTypes(client);
|
||||||
|
case xvmc_CreateContext:
|
||||||
static int _X_COLD
|
return ProcXvMCCreateContext(client);
|
||||||
SProcXvMCDispatch(ClientPtr client)
|
case xvmc_DestroyContext:
|
||||||
{
|
return ProcXvMCDestroyContext(client);
|
||||||
/* We only support local */
|
case xvmc_CreateSurface:
|
||||||
return BadImplementation;
|
return ProcXvMCCreateSurface(client);
|
||||||
|
case xvmc_DestroySurface:
|
||||||
|
return ProcXvMCDestroySurface(client);
|
||||||
|
case xvmc_CreateSubpicture:
|
||||||
|
return ProcXvMCCreateSubpicture(client);
|
||||||
|
case xvmc_DestroySubpicture:
|
||||||
|
return ProcXvMCDestroySubpicture(client);
|
||||||
|
case xvmc_ListSubpictureTypes:
|
||||||
|
return ProcXvMCListSubpictureTypes(client);
|
||||||
|
case xvmc_GetDRInfo:
|
||||||
|
return ProcXvMCGetDRInfo(client);
|
||||||
|
default:
|
||||||
|
return BadRequest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -717,7 +719,7 @@ XvMCExtensionInit(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors,
|
extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors,
|
||||||
ProcXvMCDispatch, SProcXvMCDispatch,
|
ProcXvMCDispatch, ProcXvMCDispatch,
|
||||||
NULL, StandardMinorOpcode);
|
NULL, StandardMinorOpcode);
|
||||||
|
|
||||||
if (!extEntry)
|
if (!extEntry)
|
||||||
|
|
|
||||||
20
Xi/allowev.c
20
Xi/allowev.c
|
|
@ -58,25 +58,11 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "allowev.h"
|
#include "allowev.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure allows frozen events to be routed.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXAllowDeviceEvents(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xAllowDeviceEventsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
return (ProcXAllowDeviceEvents(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure allows frozen events to be routed.
|
* This procedure allows frozen events to be routed.
|
||||||
|
|
@ -90,8 +76,8 @@ ProcXAllowDeviceEvents(ClientPtr client)
|
||||||
DeviceIntPtr thisdev;
|
DeviceIntPtr thisdev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xAllowDeviceEventsReq);
|
REQUEST_HEAD_STRUCT(xAllowDeviceEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
|
||||||
rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&thisdev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef ALLOWEV_H
|
#ifndef ALLOWEV_H
|
||||||
#define ALLOWEV_H 1
|
#define ALLOWEV_H 1
|
||||||
|
|
||||||
int SProcXAllowDeviceEvents(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXAllowDeviceEvents(ClientPtr /* client */
|
int ProcXAllowDeviceEvents(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
47
Xi/chgdctl.c
47
Xi/chgdctl.c
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -64,37 +65,6 @@ SOFTWARE.
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "chgdctl.h"
|
#include "chgdctl.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure changes the control attributes for an extension device,
|
|
||||||
* for clients on machines with a different byte ordering than the server.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXChangeDeviceControl(ClientPtr client)
|
|
||||||
{
|
|
||||||
xDeviceCtl *ctl;
|
|
||||||
|
|
||||||
REQUEST(xChangeDeviceControlReq);
|
|
||||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
|
||||||
swaps(&stuff->control);
|
|
||||||
ctl = (xDeviceCtl *) &stuff[1];
|
|
||||||
swaps(&ctl->control);
|
|
||||||
swaps(&ctl->length);
|
|
||||||
switch (stuff->control) {
|
|
||||||
case DEVICE_ABS_CALIB:
|
|
||||||
case DEVICE_ABS_AREA:
|
|
||||||
case DEVICE_CORE:
|
|
||||||
case DEVICE_ENABLE:
|
|
||||||
case DEVICE_RESOLUTION:
|
|
||||||
/* hmm. beer. *drool* */
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return (ProcXChangeDeviceControl(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Change the control attributes.
|
* Change the control attributes.
|
||||||
|
|
@ -104,6 +74,11 @@ SProcXChangeDeviceControl(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXChangeDeviceControl(ClientPtr client)
|
ProcXChangeDeviceControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_AT_LEAST(xChangeDeviceControlReq);
|
||||||
|
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
||||||
|
REQUEST_FIELD_CARD16(control);
|
||||||
|
CLIENT_STRUCT_CARD16_2((xDeviceCtl*)&stuff[1], control, length);
|
||||||
|
|
||||||
unsigned len;
|
unsigned len;
|
||||||
int i, status, ret = BadValue;
|
int i, status, ret = BadValue;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
@ -112,9 +87,6 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
CARD32 *resolution;
|
CARD32 *resolution;
|
||||||
xDeviceEnableCtl *e;
|
xDeviceEnableCtl *e;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceControlReq);
|
|
||||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
|
|
||||||
|
|
||||||
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq));
|
len = client->req_len - bytes_to_int32(sizeof(xChangeDeviceControlReq));
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
@ -127,9 +99,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
xChangeDeviceControlReply rep = {
|
xChangeDeviceControlReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_ChangeDeviceControl,
|
.RepType = X_ChangeDeviceControl,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.status = Success,
|
.status = Success,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -231,10 +201,7 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
SendEventToAllWindows(dev, DevicePresenceNotifyMask,
|
||||||
(xEvent *) &dpn, 1);
|
(xEvent *) &dpn, 1);
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xChangeDeviceControlReply), &rep);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef CHGDCTL_H
|
#ifndef CHGDCTL_H
|
||||||
#define CHGDCTL_H 1
|
#define CHGDCTL_H 1
|
||||||
|
|
||||||
int SProcXChangeDeviceControl(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXChangeDeviceControl(ClientPtr /* client */
|
int ProcXChangeDeviceControl(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
72
Xi/chgfctl.c
72
Xi/chgfctl.c
|
|
@ -52,32 +52,18 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h> /* control constants */
|
#include <X11/extensions/XIproto.h> /* control constants */
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "chgfctl.h"
|
#include "chgfctl.h"
|
||||||
|
|
||||||
#define DO_ALL (-1)
|
#define DO_ALL (-1)
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure changes the control attributes for an extension device,
|
|
||||||
* for clients on machines with a different byte ordering than the server.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXChangeFeedbackControl(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xChangeFeedbackControlReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
|
||||||
swapl(&stuff->mask);
|
|
||||||
return (ProcXChangeFeedbackControl(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*
|
*
|
||||||
* This procedure changes KbdFeedbackClass data.
|
* This procedure changes KbdFeedbackClass data.
|
||||||
|
|
@ -92,13 +78,8 @@ ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||||
int t;
|
int t;
|
||||||
int key = DO_ALL;
|
int key = DO_ALL;
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_3(f, length, pitch, duration);
|
||||||
swaps(&f->length);
|
CLIENT_STRUCT_CARD32_2(f, led_mask, led_values);
|
||||||
swaps(&f->pitch);
|
|
||||||
swaps(&f->duration);
|
|
||||||
swapl(&f->led_mask);
|
|
||||||
swapl(&f->led_values);
|
|
||||||
}
|
|
||||||
|
|
||||||
kctrl = k->ctrl;
|
kctrl = k->ctrl;
|
||||||
if (mask & DvKeyClickPercent) {
|
if (mask & DvKeyClickPercent) {
|
||||||
|
|
@ -209,12 +190,7 @@ ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||||
{
|
{
|
||||||
PtrCtrl pctrl; /* might get BadValue part way through */
|
PtrCtrl pctrl; /* might get BadValue part way through */
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_4(f, length, num, denom, thresh);
|
||||||
swaps(&f->length);
|
|
||||||
swaps(&f->num);
|
|
||||||
swaps(&f->denom);
|
|
||||||
swaps(&f->thresh);
|
|
||||||
}
|
|
||||||
|
|
||||||
pctrl = p->ctrl;
|
pctrl = p->ctrl;
|
||||||
if (mask & DvAccelNum) {
|
if (mask & DvAccelNum) {
|
||||||
|
|
@ -275,10 +251,8 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||||
long unsigned int mask, IntegerFeedbackPtr i,
|
long unsigned int mask, IntegerFeedbackPtr i,
|
||||||
xIntegerFeedbackCtl * f)
|
xIntegerFeedbackCtl * f)
|
||||||
{
|
{
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_1(f, length);
|
||||||
swaps(&f->length);
|
CLIENT_STRUCT_CARD32_1(f, int_to_display);
|
||||||
swapl(&f->int_to_display);
|
|
||||||
}
|
|
||||||
|
|
||||||
i->ctrl.integer_displayed = f->int_to_display;
|
i->ctrl.integer_displayed = f->int_to_display;
|
||||||
(*i->CtrlProc) (dev, &i->ctrl);
|
(*i->CtrlProc) (dev, &i->ctrl);
|
||||||
|
|
@ -300,10 +274,9 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||||
KeySym *syms, *sup_syms;
|
KeySym *syms, *sup_syms;
|
||||||
|
|
||||||
syms = (KeySym *) (f + 1);
|
syms = (KeySym *) (f + 1);
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&f->length); /* swapped num_keysyms in calling proc */
|
CLIENT_STRUCT_CARD16_1(f, length); /* swapped num_keysyms in calling proc */
|
||||||
SwapLongs((CARD32 *) syms, f->num_keysyms);
|
REQUEST_BUF_CARD32((CARD32 *) syms, f->num_keysyms);
|
||||||
}
|
|
||||||
|
|
||||||
if (f->num_keysyms > s->ctrl.max_symbols)
|
if (f->num_keysyms > s->ctrl.max_symbols)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
@ -338,11 +311,7 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||||
int t;
|
int t;
|
||||||
BellCtrl bctrl; /* might get BadValue part way through */
|
BellCtrl bctrl; /* might get BadValue part way through */
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_3(f, length, pitch, duration);
|
||||||
swaps(&f->length);
|
|
||||||
swaps(&f->pitch);
|
|
||||||
swaps(&f->duration);
|
|
||||||
}
|
|
||||||
|
|
||||||
bctrl = b->ctrl;
|
bctrl = b->ctrl;
|
||||||
if (mask & DvPercent) {
|
if (mask & DvPercent) {
|
||||||
|
|
@ -394,11 +363,8 @@ ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||||
{
|
{
|
||||||
LedCtrl lctrl; /* might get BadValue part way through */
|
LedCtrl lctrl; /* might get BadValue part way through */
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_1(f, length);
|
||||||
swaps(&f->length);
|
CLIENT_STRUCT_CARD32_2(f, led_values, led_mask);
|
||||||
swapl(&f->led_values);
|
|
||||||
swapl(&f->led_mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
|
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
|
||||||
f->led_values &= l->ctrl.led_mask; /* set only supported leds */
|
f->led_values &= l->ctrl.led_mask; /* set only supported leds */
|
||||||
|
|
@ -432,8 +398,8 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
LedFeedbackPtr l;
|
LedFeedbackPtr l;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xChangeFeedbackControlReq);
|
REQUEST_HEAD_AT_LEAST(xChangeFeedbackControlReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
REQUEST_FIELD_CARD32(mask);
|
||||||
|
|
||||||
len = client->req_len - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
|
len = client->req_len - bytes_to_int32(sizeof(xChangeFeedbackControlReq));
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
|
|
@ -466,11 +432,7 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
||||||
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq,
|
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeFeedbackControlReq,
|
||||||
sizeof(xStringFeedbackCtl));
|
sizeof(xStringFeedbackCtl));
|
||||||
f = ((xStringFeedbackCtl *) &stuff[1]);
|
f = ((xStringFeedbackCtl *) &stuff[1]);
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_1(f, num_keysyms);
|
||||||
if (len < bytes_to_int32(sizeof(xStringFeedbackCtl)))
|
|
||||||
return BadLength;
|
|
||||||
swaps(&f->num_keysyms);
|
|
||||||
}
|
|
||||||
if (len !=
|
if (len !=
|
||||||
(bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
|
(bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef CHGFCTL_H
|
#ifndef CHGFCTL_H
|
||||||
#define CHGFCTL_H 1
|
#define CHGFCTL_H 1
|
||||||
|
|
||||||
int SProcXChangeFeedbackControl(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXChangeFeedbackControl(ClientPtr /* client */
|
int ProcXChangeFeedbackControl(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,14 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
|
@ -72,8 +74,7 @@ SOFTWARE.
|
||||||
int
|
int
|
||||||
ProcXChangeKeyboardDevice(ClientPtr client)
|
ProcXChangeKeyboardDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xChangeKeyboardDeviceReq); */
|
REQUEST_HEAD_STRUCT(xChangeKeyboardDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
|
|
||||||
|
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
Xi/chgkmap.c
26
Xi/chgkmap.c
|
|
@ -56,32 +56,13 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "chgkmap.h"
|
#include "chgkmap.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure swaps the request when the client and
|
|
||||||
* server have different byte orderings.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXChangeDeviceKeyMapping(ClientPtr client)
|
|
||||||
{
|
|
||||||
unsigned int count;
|
|
||||||
|
|
||||||
REQUEST(xChangeDeviceKeyMappingReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
|
||||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
|
||||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
|
||||||
SwapLongs((CARD32 *) (&stuff[1]), count);
|
|
||||||
return (ProcXChangeDeviceKeyMapping(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Change the device key mapping.
|
* Change the device key mapping.
|
||||||
|
|
@ -96,11 +77,10 @@ ProcXChangeDeviceKeyMapping(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceKeyMappingReq);
|
REQUEST_HEAD_AT_LEAST(xChangeDeviceKeyMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
|
||||||
|
|
||||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||||
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
|
||||||
|
REQUEST_BUF_CARD32(&stuff[1], count);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef CHGKMAP_H
|
#ifndef CHGKMAP_H
|
||||||
#define CHGKMAP_H 1
|
#define CHGKMAP_H 1
|
||||||
|
|
||||||
int SProcXChangeDeviceKeyMapping(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXChangeDeviceKeyMapping(ClientPtr /* client */
|
int ProcXChangeDeviceKeyMapping(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
33
Xi/chgprop.c
33
Xi/chgprop.c
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
|
|
@ -65,25 +66,6 @@ SOFTWARE.
|
||||||
#include "chgprop.h"
|
#include "chgprop.h"
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure returns the extension version.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXChangeDeviceDontPropagateList(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
swaps(&stuff->count);
|
|
||||||
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
|
|
||||||
stuff->count * sizeof(CARD32));
|
|
||||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
|
|
||||||
return (ProcXChangeDeviceDontPropagateList(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure changes the dont-propagate list for the specified window.
|
* This procedure changes the dont-propagate list for the specified window.
|
||||||
|
|
@ -98,13 +80,12 @@ ProcXChangeDeviceDontPropagateList(ClientPtr client)
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
OtherInputMasks *others;
|
OtherInputMasks *others;
|
||||||
|
|
||||||
REQUEST(xChangeDeviceDontPropagateListReq);
|
REQUEST_HEAD_AT_LEAST(xChangeDeviceDontPropagateListReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
REQUEST_FIELD_CARD16(count);
|
||||||
if (client->req_len !=
|
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
|
||||||
bytes_to_int32(sizeof(xChangeDeviceDontPropagateListReq)) +
|
stuff->count * sizeof(CARD32));
|
||||||
stuff->count)
|
REQUEST_BUF_CARD32(&stuff[1], stuff->count);
|
||||||
return BadLength;
|
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef CHGPROP_H
|
#ifndef CHGPROP_H
|
||||||
#define CHGPROP_H 1
|
#define CHGPROP_H 1
|
||||||
|
|
||||||
int SProcXChangeDeviceDontPropagateList(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */
|
int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,13 +52,15 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
#include "scrnintstr.h" /* screen structure */
|
#include "scrnintstr.h" /* screen structure */
|
||||||
|
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
|
@ -73,8 +75,7 @@ SOFTWARE.
|
||||||
int
|
int
|
||||||
ProcXChangePointerDevice(ClientPtr client)
|
ProcXChangePointerDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xChangePointerDeviceReq); */
|
REQUEST_HEAD_STRUCT(xChangePointerDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
|
||||||
|
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -125,8 +126,7 @@ ProcXCloseDevice(ClientPtr client)
|
||||||
WindowPtr pWin, p1;
|
WindowPtr pWin, p1;
|
||||||
DeviceIntPtr d;
|
DeviceIntPtr d;
|
||||||
|
|
||||||
REQUEST(xCloseDeviceReq);
|
REQUEST_HEAD_STRUCT(xCloseDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
|
rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "devbell.h"
|
#include "devbell.h"
|
||||||
|
|
@ -77,8 +80,7 @@ ProcXDeviceBell(ClientPtr client)
|
||||||
void *ctrl;
|
void *ctrl;
|
||||||
BellProcPtr proc;
|
BellProcPtr proc;
|
||||||
|
|
||||||
REQUEST(xDeviceBellReq);
|
REQUEST_HEAD_STRUCT(xDeviceBellReq);
|
||||||
REQUEST_SIZE_MATCH(xDeviceBellReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixBellAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
|
|
|
||||||
289
Xi/extinit.c
289
Xi/extinit.c
|
|
@ -181,143 +181,6 @@ XExtEventInfo EventInfo[32];
|
||||||
static DeviceIntRec xi_all_devices;
|
static DeviceIntRec xi_all_devices;
|
||||||
static DeviceIntRec xi_all_master_devices;
|
static DeviceIntRec xi_all_master_devices;
|
||||||
|
|
||||||
/**
|
|
||||||
* Dispatch vector. Functions defined in here will be called when the matching
|
|
||||||
* request arrives.
|
|
||||||
*/
|
|
||||||
static int (*ProcIVector[]) (ClientPtr) = {
|
|
||||||
NULL, /* 0 */
|
|
||||||
ProcXGetExtensionVersion, /* 1 */
|
|
||||||
ProcXListInputDevices, /* 2 */
|
|
||||||
ProcXOpenDevice, /* 3 */
|
|
||||||
ProcXCloseDevice, /* 4 */
|
|
||||||
ProcXSetDeviceMode, /* 5 */
|
|
||||||
ProcXSelectExtensionEvent, /* 6 */
|
|
||||||
ProcXGetSelectedExtensionEvents, /* 7 */
|
|
||||||
ProcXChangeDeviceDontPropagateList, /* 8 */
|
|
||||||
ProcXGetDeviceDontPropagateList, /* 9 */
|
|
||||||
ProcXGetDeviceMotionEvents, /* 10 */
|
|
||||||
ProcXChangeKeyboardDevice, /* 11 */
|
|
||||||
ProcXChangePointerDevice, /* 12 */
|
|
||||||
ProcXGrabDevice, /* 13 */
|
|
||||||
ProcXUngrabDevice, /* 14 */
|
|
||||||
ProcXGrabDeviceKey, /* 15 */
|
|
||||||
ProcXUngrabDeviceKey, /* 16 */
|
|
||||||
ProcXGrabDeviceButton, /* 17 */
|
|
||||||
ProcXUngrabDeviceButton, /* 18 */
|
|
||||||
ProcXAllowDeviceEvents, /* 19 */
|
|
||||||
ProcXGetDeviceFocus, /* 20 */
|
|
||||||
ProcXSetDeviceFocus, /* 21 */
|
|
||||||
ProcXGetFeedbackControl, /* 22 */
|
|
||||||
ProcXChangeFeedbackControl, /* 23 */
|
|
||||||
ProcXGetDeviceKeyMapping, /* 24 */
|
|
||||||
ProcXChangeDeviceKeyMapping, /* 25 */
|
|
||||||
ProcXGetDeviceModifierMapping, /* 26 */
|
|
||||||
ProcXSetDeviceModifierMapping, /* 27 */
|
|
||||||
ProcXGetDeviceButtonMapping, /* 28 */
|
|
||||||
ProcXSetDeviceButtonMapping, /* 29 */
|
|
||||||
ProcXQueryDeviceState, /* 30 */
|
|
||||||
ProcXSendExtensionEvent, /* 31 */
|
|
||||||
ProcXDeviceBell, /* 32 */
|
|
||||||
ProcXSetDeviceValuators, /* 33 */
|
|
||||||
ProcXGetDeviceControl, /* 34 */
|
|
||||||
ProcXChangeDeviceControl, /* 35 */
|
|
||||||
/* XI 1.5 */
|
|
||||||
ProcXListDeviceProperties, /* 36 */
|
|
||||||
ProcXChangeDeviceProperty, /* 37 */
|
|
||||||
ProcXDeleteDeviceProperty, /* 38 */
|
|
||||||
ProcXGetDeviceProperty, /* 39 */
|
|
||||||
/* XI 2 */
|
|
||||||
ProcXIQueryPointer, /* 40 */
|
|
||||||
ProcXIWarpPointer, /* 41 */
|
|
||||||
ProcXIChangeCursor, /* 42 */
|
|
||||||
ProcXIChangeHierarchy, /* 43 */
|
|
||||||
ProcXISetClientPointer, /* 44 */
|
|
||||||
ProcXIGetClientPointer, /* 45 */
|
|
||||||
ProcXISelectEvents, /* 46 */
|
|
||||||
ProcXIQueryVersion, /* 47 */
|
|
||||||
ProcXIQueryDevice, /* 48 */
|
|
||||||
ProcXISetFocus, /* 49 */
|
|
||||||
ProcXIGetFocus, /* 50 */
|
|
||||||
ProcXIGrabDevice, /* 51 */
|
|
||||||
ProcXIUngrabDevice, /* 52 */
|
|
||||||
ProcXIAllowEvents, /* 53 */
|
|
||||||
ProcXIPassiveGrabDevice, /* 54 */
|
|
||||||
ProcXIPassiveUngrabDevice, /* 55 */
|
|
||||||
ProcXIListProperties, /* 56 */
|
|
||||||
ProcXIChangeProperty, /* 57 */
|
|
||||||
ProcXIDeleteProperty, /* 58 */
|
|
||||||
ProcXIGetProperty, /* 59 */
|
|
||||||
ProcXIGetSelectedEvents, /* 60 */
|
|
||||||
ProcXIBarrierReleasePointer /* 61 */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* For swapped clients */
|
|
||||||
static int (*SProcIVector[]) (ClientPtr) = {
|
|
||||||
NULL, /* 0 */
|
|
||||||
SProcXGetExtensionVersion, /* 1 */
|
|
||||||
ProcXListInputDevices, /* 2 */
|
|
||||||
ProcXOpenDevice, /* 3 */
|
|
||||||
ProcXCloseDevice, /* 4 */
|
|
||||||
ProcXSetDeviceMode, /* 5 */
|
|
||||||
SProcXSelectExtensionEvent, /* 6 */
|
|
||||||
SProcXGetSelectedExtensionEvents, /* 7 */
|
|
||||||
SProcXChangeDeviceDontPropagateList, /* 8 */
|
|
||||||
SProcXGetDeviceDontPropagateList, /* 9 */
|
|
||||||
SProcXGetDeviceMotionEvents, /* 10 */
|
|
||||||
ProcXChangeKeyboardDevice, /* 11 */
|
|
||||||
ProcXChangePointerDevice, /* 12 */
|
|
||||||
SProcXGrabDevice, /* 13 */
|
|
||||||
SProcXUngrabDevice, /* 14 */
|
|
||||||
SProcXGrabDeviceKey, /* 15 */
|
|
||||||
SProcXUngrabDeviceKey, /* 16 */
|
|
||||||
SProcXGrabDeviceButton, /* 17 */
|
|
||||||
SProcXUngrabDeviceButton, /* 18 */
|
|
||||||
SProcXAllowDeviceEvents, /* 19 */
|
|
||||||
ProcXGetDeviceFocus, /* 20 */
|
|
||||||
SProcXSetDeviceFocus, /* 21 */
|
|
||||||
ProcXGetFeedbackControl, /* 22 */
|
|
||||||
SProcXChangeFeedbackControl, /* 23 */
|
|
||||||
ProcXGetDeviceKeyMapping, /* 24 */
|
|
||||||
SProcXChangeDeviceKeyMapping, /* 25 */
|
|
||||||
ProcXGetDeviceModifierMapping, /* 26 */
|
|
||||||
ProcXSetDeviceModifierMapping, /* 27 */
|
|
||||||
ProcXGetDeviceButtonMapping, /* 28 */
|
|
||||||
ProcXSetDeviceButtonMapping, /* 29 */
|
|
||||||
ProcXQueryDeviceState, /* 30 */
|
|
||||||
SProcXSendExtensionEvent, /* 31 */
|
|
||||||
ProcXDeviceBell, /* 32 */
|
|
||||||
ProcXSetDeviceValuators, /* 33 */
|
|
||||||
SProcXGetDeviceControl, /* 34 */
|
|
||||||
SProcXChangeDeviceControl, /* 35 */
|
|
||||||
ProcXListDeviceProperties, /* 36 */
|
|
||||||
SProcXChangeDeviceProperty, /* 37 */
|
|
||||||
SProcXDeleteDeviceProperty, /* 38 */
|
|
||||||
SProcXGetDeviceProperty, /* 39 */
|
|
||||||
SProcXIQueryPointer, /* 40 */
|
|
||||||
SProcXIWarpPointer, /* 41 */
|
|
||||||
SProcXIChangeCursor, /* 42 */
|
|
||||||
ProcXIChangeHierarchy, /* 43 */
|
|
||||||
SProcXISetClientPointer, /* 44 */
|
|
||||||
SProcXIGetClientPointer, /* 45 */
|
|
||||||
SProcXISelectEvents, /* 46 */
|
|
||||||
SProcXIQueryVersion, /* 47 */
|
|
||||||
SProcXIQueryDevice, /* 48 */
|
|
||||||
SProcXISetFocus, /* 49 */
|
|
||||||
SProcXIGetFocus, /* 50 */
|
|
||||||
SProcXIGrabDevice, /* 51 */
|
|
||||||
SProcXIUngrabDevice, /* 52 */
|
|
||||||
SProcXIAllowEvents, /* 53 */
|
|
||||||
SProcXIPassiveGrabDevice, /* 54 */
|
|
||||||
SProcXIPassiveUngrabDevice, /* 55 */
|
|
||||||
SProcXIListProperties, /* 56 */
|
|
||||||
SProcXIChangeProperty, /* 57 */
|
|
||||||
SProcXIDeleteProperty, /* 58 */
|
|
||||||
SProcXIGetProperty, /* 59 */
|
|
||||||
SProcXIGetSelectedEvents, /* 60 */
|
|
||||||
SProcXIBarrierReleasePointer /* 61 */
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************
|
/*****************************************************************
|
||||||
*
|
*
|
||||||
* Globals referenced elsewhere in the server.
|
* Globals referenced elsewhere in the server.
|
||||||
|
|
@ -384,31 +247,137 @@ static int
|
||||||
ProcIDispatch(ClientPtr client)
|
ProcIDispatch(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xReq);
|
REQUEST(xReq);
|
||||||
if (stuff->data >= ARRAY_SIZE(ProcIVector) || !ProcIVector[stuff->data])
|
|
||||||
return BadRequest;
|
|
||||||
|
|
||||||
UpdateCurrentTimeIf();
|
UpdateCurrentTimeIf();
|
||||||
return (*ProcIVector[stuff->data]) (client);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
switch (stuff->data) {
|
||||||
*
|
case X_GetExtensionVersion:
|
||||||
* SProcXDispatch
|
return ProcXGetExtensionVersion(client);
|
||||||
*
|
case X_ListInputDevices:
|
||||||
* Main swapped dispatch routine for requests to this extension.
|
return ProcXListInputDevices(client);
|
||||||
* This routine is used if server and client do not have the same byte ordering.
|
case X_OpenDevice:
|
||||||
*
|
return ProcXOpenDevice(client);
|
||||||
*/
|
case X_CloseDevice:
|
||||||
|
return ProcXCloseDevice(client);
|
||||||
static int _X_COLD
|
case X_SetDeviceMode:
|
||||||
SProcIDispatch(ClientPtr client)
|
return ProcXSetDeviceMode(client);
|
||||||
{
|
case X_SelectExtensionEvent:
|
||||||
REQUEST(xReq);
|
return ProcXSelectExtensionEvent(client);
|
||||||
if (stuff->data >= ARRAY_SIZE(SProcIVector) || !SProcIVector[stuff->data])
|
case X_GetSelectedExtensionEvents:
|
||||||
return BadRequest;
|
return ProcXGetSelectedExtensionEvents(client);
|
||||||
|
case X_ChangeDeviceDontPropagateList:
|
||||||
UpdateCurrentTimeIf();
|
return ProcXChangeDeviceDontPropagateList(client);
|
||||||
return (*SProcIVector[stuff->data]) (client);
|
case X_GetDeviceDontPropagateList:
|
||||||
|
return ProcXGetDeviceDontPropagateList(client);
|
||||||
|
case X_GetDeviceMotionEvents:
|
||||||
|
return ProcXGetDeviceMotionEvents(client);
|
||||||
|
case X_ChangeKeyboardDevice:
|
||||||
|
return ProcXChangeKeyboardDevice(client);
|
||||||
|
case X_ChangePointerDevice:
|
||||||
|
return ProcXChangePointerDevice(client);
|
||||||
|
case X_GrabDevice:
|
||||||
|
return ProcXGrabDevice(client);
|
||||||
|
case X_UngrabDevice:
|
||||||
|
return ProcXUngrabDevice(client);
|
||||||
|
case X_GrabDeviceKey:
|
||||||
|
return ProcXGrabDeviceKey(client);
|
||||||
|
case X_UngrabDeviceKey:
|
||||||
|
return ProcXUngrabDeviceKey(client);
|
||||||
|
case X_GrabDeviceButton:
|
||||||
|
return ProcXGrabDeviceButton(client);
|
||||||
|
case X_UngrabDeviceButton:
|
||||||
|
return ProcXUngrabDeviceButton(client);
|
||||||
|
case X_AllowDeviceEvents:
|
||||||
|
return ProcXAllowDeviceEvents(client);
|
||||||
|
case X_GetDeviceFocus:
|
||||||
|
return ProcXGetDeviceFocus(client);
|
||||||
|
case X_SetDeviceFocus:
|
||||||
|
return ProcXSetDeviceFocus(client);
|
||||||
|
case X_GetFeedbackControl:
|
||||||
|
return ProcXGetFeedbackControl(client);
|
||||||
|
case X_ChangeFeedbackControl:
|
||||||
|
return ProcXChangeFeedbackControl(client);
|
||||||
|
case X_GetDeviceKeyMapping:
|
||||||
|
return ProcXGetDeviceKeyMapping(client);
|
||||||
|
case X_ChangeDeviceKeyMapping:
|
||||||
|
return ProcXChangeDeviceKeyMapping(client);
|
||||||
|
case X_GetDeviceModifierMapping:
|
||||||
|
return ProcXGetDeviceModifierMapping(client);
|
||||||
|
case X_SetDeviceModifierMapping:
|
||||||
|
return ProcXSetDeviceModifierMapping(client);
|
||||||
|
case X_GetDeviceButtonMapping:
|
||||||
|
return ProcXGetDeviceButtonMapping(client);
|
||||||
|
case X_SetDeviceButtonMapping:
|
||||||
|
return ProcXSetDeviceButtonMapping(client);
|
||||||
|
case X_QueryDeviceState:
|
||||||
|
return ProcXQueryDeviceState(client);
|
||||||
|
case X_SendExtensionEvent:
|
||||||
|
return ProcXSendExtensionEvent(client);
|
||||||
|
case X_DeviceBell:
|
||||||
|
return ProcXDeviceBell(client);
|
||||||
|
case X_SetDeviceValuators:
|
||||||
|
return ProcXSetDeviceValuators(client);
|
||||||
|
case X_GetDeviceControl:
|
||||||
|
return ProcXGetDeviceControl(client);
|
||||||
|
case X_ChangeDeviceControl:
|
||||||
|
return ProcXChangeDeviceControl(client);
|
||||||
|
/* XI 1.5 */
|
||||||
|
case X_ListDeviceProperties:
|
||||||
|
return ProcXListDeviceProperties(client);
|
||||||
|
case X_ChangeDeviceProperty:
|
||||||
|
return ProcXChangeDeviceProperty(client);
|
||||||
|
case X_DeleteDeviceProperty:
|
||||||
|
return ProcXDeleteDeviceProperty(client);
|
||||||
|
case X_GetDeviceProperty:
|
||||||
|
return ProcXGetDeviceProperty(client);
|
||||||
|
/* XI 2 */
|
||||||
|
case X_XIQueryPointer:
|
||||||
|
return ProcXIQueryPointer(client);
|
||||||
|
case X_XIWarpPointer:
|
||||||
|
return ProcXIWarpPointer(client);
|
||||||
|
case X_XIChangeCursor:
|
||||||
|
return ProcXIChangeCursor(client);
|
||||||
|
case X_XIChangeHierarchy:
|
||||||
|
return ProcXIChangeHierarchy(client);
|
||||||
|
case X_XISetClientPointer:
|
||||||
|
return ProcXISetClientPointer(client);
|
||||||
|
case X_XIGetClientPointer:
|
||||||
|
return ProcXIGetClientPointer(client);
|
||||||
|
case X_XISelectEvents:
|
||||||
|
return ProcXISelectEvents(client);
|
||||||
|
case X_XIQueryVersion:
|
||||||
|
return ProcXIQueryVersion(client);
|
||||||
|
case X_XIQueryDevice:
|
||||||
|
return ProcXIQueryDevice(client);
|
||||||
|
case X_XISetFocus:
|
||||||
|
return ProcXISetFocus(client);
|
||||||
|
case X_XIGetFocus:
|
||||||
|
return ProcXIGetFocus(client);
|
||||||
|
case X_XIGrabDevice:
|
||||||
|
return ProcXIGrabDevice(client);
|
||||||
|
case X_XIUngrabDevice:
|
||||||
|
return ProcXIUngrabDevice(client);
|
||||||
|
case X_XIAllowEvents:
|
||||||
|
return ProcXIAllowEvents(client);
|
||||||
|
case X_XIPassiveGrabDevice:
|
||||||
|
return ProcXIPassiveGrabDevice(client);
|
||||||
|
case X_XIPassiveUngrabDevice:
|
||||||
|
return ProcXIPassiveUngrabDevice(client);
|
||||||
|
case X_XIListProperties:
|
||||||
|
return ProcXIListProperties(client);
|
||||||
|
case X_XIChangeProperty:
|
||||||
|
return ProcXIChangeProperty(client);
|
||||||
|
case X_XIDeleteProperty:
|
||||||
|
return ProcXIDeleteProperty(client);
|
||||||
|
case X_XIGetProperty:
|
||||||
|
return ProcXIGetProperty(client);
|
||||||
|
case X_XIGetSelectedEvents:
|
||||||
|
return ProcXIGetSelectedEvents(client);
|
||||||
|
case X_XIBarrierReleasePointer:
|
||||||
|
return ProcXIBarrierReleasePointer(client);
|
||||||
|
default:
|
||||||
|
return BadRequest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
|
@ -1229,7 +1198,7 @@ XInputExtensionInit(void)
|
||||||
FatalError("Could not initialize barriers.\n");
|
FatalError("Could not initialize barriers.\n");
|
||||||
|
|
||||||
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
|
extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
|
||||||
SProcIDispatch, IResetProc, StandardMinorOpcode);
|
ProcIDispatch, IResetProc, StandardMinorOpcode);
|
||||||
if (extEntry) {
|
if (extEntry) {
|
||||||
assert(extEntry->base == EXTENSION_MAJOR_XINPUT);
|
assert(extEntry->base == EXTENSION_MAJOR_XINPUT);
|
||||||
|
|
||||||
|
|
|
||||||
17
Xi/getbmap.c
17
Xi/getbmap.c
|
|
@ -52,9 +52,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getbmap.h"
|
#include "getbmap.h"
|
||||||
|
|
@ -72,8 +75,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
ButtonClassPtr b;
|
ButtonClassPtr b;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceButtonMappingReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceButtonMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -84,18 +86,11 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
xGetDeviceButtonMappingReply rep = {
|
xGetDeviceButtonMappingReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceButtonMapping,
|
.RepType = X_GetDeviceButtonMapping,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.nElts = b->numButtons,
|
.nElts = b->numButtons,
|
||||||
.length = bytes_to_int32(b->numButtons),
|
.length = bytes_to_int32(b->numButtons),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND_EXTRA(&b->map[1], rep.nElts);
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
|
||||||
WriteToClient(client, rep.nElts, &b->map[1]);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
61
Xi/getdctl.c
61
Xi/getdctl.c
|
|
@ -52,29 +52,16 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getdctl.h"
|
#include "getdctl.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure gets the control attributes for an extension device,
|
|
||||||
* for clients on machines with a different byte ordering than the server.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGetDeviceControl(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGetDeviceControlReq);
|
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
|
||||||
swaps(&stuff->control);
|
|
||||||
return (ProcXGetDeviceControl(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure copies DeviceResolution data, swapping if necessary.
|
* This procedure copies DeviceResolution data, swapping if necessary.
|
||||||
|
|
@ -101,15 +88,10 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
|
||||||
*iptr++ = a->min_resolution;
|
*iptr++ = a->min_resolution;
|
||||||
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
|
||||||
*iptr++ = a->max_resolution;
|
*iptr++ = a->max_resolution;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&r->control);
|
CLIENT_STRUCT_CARD16_2(r, control, length);
|
||||||
swaps(&r->length);
|
CLIENT_STRUCT_CARD32_1(r, num_valuators);
|
||||||
swapl(&r->num_valuators);
|
REPLY_BUF_CARD32(buf, (3 * v->numAxes));
|
||||||
iptr = (int *) buf;
|
|
||||||
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
|
|
||||||
swapl(iptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -122,10 +104,7 @@ CopySwapDeviceCore(ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||||
c->status = dev->coreEvents;
|
c->status = dev->coreEvents;
|
||||||
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
|
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_2(c, control, length);
|
||||||
swaps(&c->control);
|
|
||||||
swaps(&c->length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -137,10 +116,7 @@ CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf)
|
||||||
e->length = sizeof(xDeviceEnableState);
|
e->length = sizeof(xDeviceEnableState);
|
||||||
e->enable = dev->enabled;
|
e->enable = dev->enabled;
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_2(e, control, length);
|
||||||
swaps(&e->control);
|
|
||||||
swaps(&e->length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
@ -153,11 +129,10 @@ int
|
||||||
ProcXGetDeviceControl(ClientPtr client)
|
ProcXGetDeviceControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc, total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *savbuf;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xGetDeviceControlReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
REQUEST_FIELD_CARD16(control);
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -186,7 +161,7 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
char *buf = calloc(1, total_length);
|
char *buf = calloc(1, total_length);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
savbuf = buf;
|
char *savbuf = buf;
|
||||||
|
|
||||||
switch (stuff->control) {
|
switch (stuff->control) {
|
||||||
case DEVICE_RESOLUTION:
|
case DEVICE_RESOLUTION:
|
||||||
|
|
@ -203,18 +178,10 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
xGetDeviceControlReply rep = {
|
xGetDeviceControlReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceControl,
|
.RepType = X_GetDeviceControl,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(total_length),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND_EXTRA(buf, total_length);
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceControlReply), &rep);
|
|
||||||
WriteToClient(client, total_length, savbuf);
|
|
||||||
free(savbuf);
|
free(savbuf);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GETDCTL_H
|
#ifndef GETDCTL_H
|
||||||
#define GETDCTL_H 1
|
#define GETDCTL_H 1
|
||||||
|
|
||||||
int SProcXGetDeviceControl(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGetDeviceControl(ClientPtr /* client */
|
int ProcXGetDeviceControl(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
86
Xi/getfctl.c
86
Xi/getfctl.c
|
|
@ -52,9 +52,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getfctl.h"
|
#include "getfctl.h"
|
||||||
|
|
@ -83,13 +86,10 @@ CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
||||||
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&k2->length);
|
CLIENT_STRUCT_CARD16_3(k2, length, pitch, duration);
|
||||||
swaps(&k2->pitch);
|
CLIENT_STRUCT_CARD32_2(k2, led_mask, led_values);
|
||||||
swaps(&k2->duration);
|
|
||||||
swapl(&k2->led_mask);
|
|
||||||
swapl(&k2->led_values);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xKbdFeedbackState);
|
*buf += sizeof(xKbdFeedbackState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,12 +111,9 @@ CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
||||||
p2->accelNum = p->ctrl.num;
|
p2->accelNum = p->ctrl.num;
|
||||||
p2->accelDenom = p->ctrl.den;
|
p2->accelDenom = p->ctrl.den;
|
||||||
p2->threshold = p->ctrl.threshold;
|
p2->threshold = p->ctrl.threshold;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&p2->length);
|
CLIENT_STRUCT_CARD16_4(p2, length, accelNum, accelDenom, threshold);
|
||||||
swaps(&p2->accelNum);
|
|
||||||
swaps(&p2->accelDenom);
|
|
||||||
swaps(&p2->threshold);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xPtrFeedbackState);
|
*buf += sizeof(xPtrFeedbackState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,12 +135,10 @@ CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
||||||
i2->resolution = i->ctrl.resolution;
|
i2->resolution = i->ctrl.resolution;
|
||||||
i2->min_value = i->ctrl.min_value;
|
i2->min_value = i->ctrl.min_value;
|
||||||
i2->max_value = i->ctrl.max_value;
|
i2->max_value = i->ctrl.max_value;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&i2->length);
|
CLIENT_STRUCT_CARD16_1(i2, length);
|
||||||
swapl(&i2->resolution);
|
CLIENT_STRUCT_CARD32_3(i2, resolution, min_value, max_value);
|
||||||
swapl(&i2->min_value);
|
|
||||||
swapl(&i2->max_value);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xIntegerFeedbackState);
|
*buf += sizeof(xIntegerFeedbackState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -171,15 +166,10 @@ CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
||||||
kptr = (KeySym *) (*buf);
|
kptr = (KeySym *) (*buf);
|
||||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
|
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
|
||||||
*kptr++ = *(s->ctrl.symbols_supported + i);
|
*kptr++ = *(s->ctrl.symbols_supported + i);
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&s2->length);
|
CLIENT_STRUCT_CARD16_3(s2, length, max_symbols, num_syms_supported);
|
||||||
swaps(&s2->max_symbols);
|
REPLY_BUF_CARD32((CARD32*)buf, s->ctrl.num_symbols_supported);
|
||||||
swaps(&s2->num_syms_supported);
|
|
||||||
kptr = (KeySym *) (*buf);
|
|
||||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
|
|
||||||
swapl(kptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
|
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -200,11 +190,10 @@ CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
||||||
l2->id = l->ctrl.id;
|
l2->id = l->ctrl.id;
|
||||||
l2->led_values = l->ctrl.led_values;
|
l2->led_values = l->ctrl.led_values;
|
||||||
l2->led_mask = l->ctrl.led_mask;
|
l2->led_mask = l->ctrl.led_mask;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&l2->length);
|
CLIENT_STRUCT_CARD16_1(l2, length);
|
||||||
swapl(&l2->led_values);
|
CLIENT_STRUCT_CARD32_2(l2, led_values, led_mask);
|
||||||
swapl(&l2->led_mask);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xLedFeedbackState);
|
*buf += sizeof(xLedFeedbackState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,11 +215,9 @@ CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||||
b2->percent = b->ctrl.percent;
|
b2->percent = b->ctrl.percent;
|
||||||
b2->pitch = b->ctrl.pitch;
|
b2->pitch = b->ctrl.pitch;
|
||||||
b2->duration = b->ctrl.duration;
|
b2->duration = b->ctrl.duration;
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&b2->length);
|
CLIENT_STRUCT_CARD16_3(b2, length, pitch, duration);
|
||||||
swaps(&b2->pitch);
|
|
||||||
swaps(&b2->duration);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xBellFeedbackState);
|
*buf += sizeof(xBellFeedbackState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -244,7 +231,6 @@ int
|
||||||
ProcXGetFeedbackControl(ClientPtr client)
|
ProcXGetFeedbackControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc, total_length = 0;
|
int rc, total_length = 0;
|
||||||
char *savbuf;
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
KbdFeedbackPtr k;
|
KbdFeedbackPtr k;
|
||||||
PtrFeedbackPtr p;
|
PtrFeedbackPtr p;
|
||||||
|
|
@ -253,18 +239,14 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
BellFeedbackPtr b;
|
BellFeedbackPtr b;
|
||||||
LedFeedbackPtr l;
|
LedFeedbackPtr l;
|
||||||
|
|
||||||
REQUEST(xGetFeedbackControlReq);
|
REQUEST_HEAD_STRUCT(xGetFeedbackControlReq);
|
||||||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
xGetFeedbackControlReply rep = {
|
xGetFeedbackControlReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetFeedbackControl,
|
.RepType = X_GetFeedbackControl,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.num_feedbacks = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (k = dev->kbdfeed; k; k = k->next) {
|
for (k = dev->kbdfeed; k; k = k->next) {
|
||||||
|
|
@ -299,7 +281,7 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
char *buf = (char *) calloc(1, total_length);
|
char *buf = (char *) calloc(1, total_length);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
savbuf = buf;
|
char *savbuf = buf;
|
||||||
|
|
||||||
for (k = dev->kbdfeed; k; k = k->next)
|
for (k = dev->kbdfeed; k; k = k->next)
|
||||||
CopySwapKbdFeedback(client, k, &buf);
|
CopySwapKbdFeedback(client, k, &buf);
|
||||||
|
|
@ -314,15 +296,7 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
for (b = dev->bell; b; b = b->next)
|
for (b = dev->bell; b; b = b->next)
|
||||||
CopySwapBellFeedback(client, b, &buf);
|
CopySwapBellFeedback(client, b, &buf);
|
||||||
|
|
||||||
rep.length = bytes_to_int32(total_length);
|
REPLY_FIELD_CARD16(num_feedbacks);
|
||||||
|
REPLY_SEND_EXTRA(savbuf, total_length);
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.num_feedbacks);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetFeedbackControlReply), &rep);
|
|
||||||
WriteToClient(client, total_length, savbuf);
|
|
||||||
free(savbuf);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,13 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "windowstr.h" /* focus struct */
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "windowstr.h" /* focus struct */
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getfocus.h"
|
#include "getfocus.h"
|
||||||
|
|
@ -73,8 +76,7 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
FocusClassPtr focus;
|
FocusClassPtr focus;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceFocusReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceFocusReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetFocusAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -82,15 +84,14 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
if (!dev->focus)
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
xGetDeviceFocusReply rep = {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceFocus,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
focus = dev->focus;
|
focus = dev->focus;
|
||||||
|
|
||||||
|
xGetDeviceFocusReply rep = {
|
||||||
|
.RepType = X_GetDeviceFocus,
|
||||||
|
.time = focus->time.milliseconds,
|
||||||
|
.revertTo = focus->revert,
|
||||||
|
};
|
||||||
|
|
||||||
if (focus->win == NoneWin)
|
if (focus->win == NoneWin)
|
||||||
rep.focus = None;
|
rep.focus = None;
|
||||||
else if (focus->win == PointerRootWin)
|
else if (focus->win == PointerRootWin)
|
||||||
|
|
@ -100,15 +101,8 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
else
|
else
|
||||||
rep.focus = focus->win->drawable.id;
|
rep.focus = focus->win->drawable.id;
|
||||||
|
|
||||||
rep.time = focus->time.milliseconds;
|
REPLY_FIELD_CARD32(focus);
|
||||||
rep.revertTo = focus->revert;
|
REPLY_FIELD_CARD32(time);
|
||||||
|
REPLY_SEND();
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swapl(&rep.focus);
|
|
||||||
swapl(&rep.time);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceFocusReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
Xi/getkmap.c
16
Xi/getkmap.c
|
|
@ -52,9 +52,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "swaprep.h"
|
#include "swaprep.h"
|
||||||
#include "xkbsrv.h"
|
#include "xkbsrv.h"
|
||||||
|
|
@ -76,8 +79,7 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
KeySymsPtr syms;
|
KeySymsPtr syms;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xGetDeviceKeyMappingReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceKeyMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -102,18 +104,12 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
xGetDeviceKeyMappingReply rep = {
|
xGetDeviceKeyMappingReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceKeyMapping,
|
.RepType = X_GetDeviceKeyMapping,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.keySymsPerKeyCode = syms->mapWidth,
|
.keySymsPerKeyCode = syms->mapWidth,
|
||||||
.length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */
|
.length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
|
|
||||||
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
||||||
WriteSwappedDataToClient(client,
|
WriteSwappedDataToClient(client,
|
||||||
|
|
|
||||||
21
Xi/getmmap.c
21
Xi/getmmap.c
|
|
@ -52,9 +52,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
#include "getmmap.h"
|
#include "getmmap.h"
|
||||||
|
|
@ -72,8 +75,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
KeyCode *modkeymap = NULL;
|
KeyCode *modkeymap = NULL;
|
||||||
int ret, max_keys_per_mod;
|
int ret, max_keys_per_mod;
|
||||||
|
|
||||||
REQUEST(xGetDeviceModifierMappingReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceModifierMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
|
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
@ -84,21 +86,12 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
xGetDeviceModifierMappingReply rep = {
|
xGetDeviceModifierMappingReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceModifierMapping,
|
.RepType = X_GetDeviceModifierMapping,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.numKeyPerModifier = max_keys_per_mod,
|
.numKeyPerModifier = max_keys_per_mod,
|
||||||
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
|
|
||||||
.length = max_keys_per_mod << 1
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
/* 8 modifiers per key, each CARD8 */
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_EXTRA(modkeymap, max_keys_per_mod * 8);
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
|
|
||||||
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
|
|
||||||
|
|
||||||
free(modkeymap);
|
free(modkeymap);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
||||||
32
Xi/getprop.c
32
Xi/getprop.c
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structs */
|
#include "windowstr.h" /* window structs */
|
||||||
|
|
@ -66,21 +67,6 @@ SOFTWARE.
|
||||||
extern XExtEventInfo EventInfo[];
|
extern XExtEventInfo EventInfo[];
|
||||||
extern int ExtEventIndex;
|
extern int ExtEventIndex;
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle a request from a client with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGetDeviceDontPropagateList(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGetDeviceDontPropagateListReq);
|
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return (ProcXGetDeviceDontPropagateList(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure lists the input devices available to the server.
|
* This procedure lists the input devices available to the server.
|
||||||
|
|
@ -96,15 +82,11 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
OtherInputMasks *others;
|
OtherInputMasks *others;
|
||||||
|
|
||||||
REQUEST(xGetDeviceDontPropagateListReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceDontPropagateListReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
xGetDeviceDontPropagateListReply rep = {
|
xGetDeviceDontPropagateListReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceDontPropagateList,
|
.RepType = X_GetDeviceDontPropagateList,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.count = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
|
|
@ -126,12 +108,8 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(count);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND();
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.count);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
|
|
||||||
|
|
||||||
if (count) {
|
if (count) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GETPROP_H
|
#ifndef GETPROP_H
|
||||||
#define GETPROP_H 1
|
#define GETPROP_H 1
|
||||||
|
|
||||||
int SProcXGetDeviceDontPropagateList(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGetDeviceDontPropagateList(ClientPtr /* client */
|
int ProcXGetDeviceDontPropagateList(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -64,21 +65,6 @@ SOFTWARE.
|
||||||
#include "getprop.h"
|
#include "getprop.h"
|
||||||
#include "getselev.h"
|
#include "getselev.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure gets the current selected extension events.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGetSelectedExtensionEvents(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGetSelectedExtensionEventsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
return (ProcXGetSelectedExtensionEvents(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure gets the current device select mask,
|
* This procedure gets the current device select mask,
|
||||||
|
|
@ -97,16 +83,11 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
OtherInputMasks *pOthers;
|
OtherInputMasks *pOthers;
|
||||||
InputClientsPtr others;
|
InputClientsPtr others;
|
||||||
|
|
||||||
REQUEST(xGetSelectedExtensionEventsReq);
|
REQUEST_HEAD_STRUCT(xGetSelectedExtensionEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
|
||||||
xGetSelectedExtensionEventsReply rep = {
|
xGetSelectedExtensionEventsReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetSelectedExtensionEvents,
|
.RepType = X_GetSelectedExtensionEvents,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.this_client_count = 0,
|
|
||||||
.all_clients_count = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
|
|
@ -145,13 +126,9 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
ClassFromMask(aclient, others->mask[i], i, NULL, CREATE);
|
ClassFromMask(aclient, others->mask[i], i, NULL, CREATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(this_client_count);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(all_clients_count);
|
||||||
swapl(&rep.length);
|
REPLY_SEND();
|
||||||
swaps(&rep.this_client_count);
|
|
||||||
swaps(&rep.all_clients_count);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGetSelectedExtensionEventsReply), &rep);
|
|
||||||
|
|
||||||
if (total_length) {
|
if (total_length) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GETSELEV_H
|
#ifndef GETSELEV_H
|
||||||
#define GETSELEV_H 1
|
#define GETSELEV_H 1
|
||||||
|
|
||||||
int SProcXGetSelectedExtensionEvents(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
|
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
39
Xi/getvers.c
39
Xi/getvers.c
|
|
@ -52,9 +52,12 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <dix-config.h>
|
#include <dix-config.h>
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
|
||||||
#include <X11/extensions/XI.h>
|
#include <X11/extensions/XI.h>
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
|
|
||||||
|
|
@ -62,21 +65,6 @@ SOFTWARE.
|
||||||
|
|
||||||
XExtensionVersion XIVersion;
|
XExtensionVersion XIVersion;
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle a request from a client with a different byte order than us.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGetExtensionVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGetExtensionVersionReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
|
||||||
swaps(&stuff->nbytes);
|
|
||||||
return (ProcXGetExtensionVersion(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure returns the major/minor version of the X Input extension.
|
* This procedure returns the major/minor version of the X Input extension.
|
||||||
|
|
@ -86,31 +74,22 @@ SProcXGetExtensionVersion(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXGetExtensionVersion(ClientPtr client)
|
ProcXGetExtensionVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetExtensionVersionReq);
|
REQUEST_HEAD_STRUCT(xGetExtensionVersionReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
REQUEST_FIELD_CARD16(nbytes);
|
||||||
|
|
||||||
if (client->req_len != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
|
if (client->req_len != bytes_to_int32(sizeof(xGetExtensionVersionReq) +
|
||||||
stuff->nbytes))
|
stuff->nbytes))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
xGetExtensionVersionReply rep = {
|
xGetExtensionVersionReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetExtensionVersion,
|
.RepType = X_GetExtensionVersion,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.major_version = XIVersion.major_version,
|
.major_version = XIVersion.major_version,
|
||||||
.minor_version = XIVersion.minor_version,
|
.minor_version = XIVersion.minor_version,
|
||||||
.present = TRUE
|
.present = TRUE
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(major_version);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(minor_version);
|
||||||
swapl(&rep.length);
|
REPLY_SEND();
|
||||||
swaps(&rep.major_version);
|
|
||||||
swaps(&rep.minor_version);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xGetExtensionVersionReply), &rep);
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GETVERS_H
|
#ifndef GETVERS_H
|
||||||
#define GETVERS_H 1
|
#define GETVERS_H 1
|
||||||
|
|
||||||
int SProcXGetExtensionVersion(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGetExtensionVersion(ClientPtr /* client */
|
int ProcXGetExtensionVersion(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
43
Xi/grabdev.c
43
Xi/grabdev.c
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -65,31 +66,6 @@ SOFTWARE.
|
||||||
extern XExtEventInfo EventInfo[];
|
extern XExtEventInfo EventInfo[];
|
||||||
extern int ExtEventIndex;
|
extern int ExtEventIndex;
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Swap the request if the requestor has a different byte order than us.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGrabDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGrabDeviceReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
|
||||||
|
|
||||||
swapl(&stuff->grabWindow);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
swaps(&stuff->event_count);
|
|
||||||
|
|
||||||
if (client->req_len !=
|
|
||||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
|
||||||
return BadLength;
|
|
||||||
|
|
||||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
|
||||||
|
|
||||||
return (ProcXGrabDevice(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Grab an extension device.
|
* Grab an extension device.
|
||||||
|
|
@ -104,18 +80,19 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
GrabMask mask;
|
GrabMask mask;
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
|
|
||||||
REQUEST(xGrabDeviceReq);
|
REQUEST_HEAD_AT_LEAST(xGrabDeviceReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
|
REQUEST_FIELD_CARD32(grabWindow);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
REQUEST_FIELD_CARD16(event_count);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (client->req_len !=
|
||||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
REQUEST_BUF_CARD32(&stuff[1], stuff->event_count);
|
||||||
|
|
||||||
xGrabDeviceReply rep = {
|
xGrabDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GrabDevice,
|
.RepType = X_GrabDevice,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
|
|
@ -137,11 +114,7 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGrabDeviceReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GRABDEV_H
|
#ifndef GRABDEV_H
|
||||||
#define GRABDEV_H 1
|
#define GRABDEV_H 1
|
||||||
|
|
||||||
int SProcXGrabDevice(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGrabDevice(ClientPtr /* client */
|
int ProcXGrabDevice(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -65,27 +66,6 @@ SOFTWARE.
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevb.h"
|
#include "grabdevb.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from clients with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGrabDeviceButton(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGrabDeviceButtonReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
|
||||||
swapl(&stuff->grabWindow);
|
|
||||||
swaps(&stuff->modifiers);
|
|
||||||
swaps(&stuff->event_count);
|
|
||||||
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
|
|
||||||
stuff->event_count * sizeof(CARD32));
|
|
||||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
|
||||||
|
|
||||||
return (ProcXGrabDeviceButton(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Grab a button on an extension device.
|
* Grab a button on an extension device.
|
||||||
|
|
@ -100,15 +80,15 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
DeviceIntPtr mdev;
|
DeviceIntPtr mdev;
|
||||||
XEventClass *class;
|
XEventClass *class;
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
GrabParameters param;
|
|
||||||
GrabMask mask;
|
GrabMask mask;
|
||||||
|
|
||||||
REQUEST(xGrabDeviceButtonReq);
|
REQUEST_HEAD_AT_LEAST(xGrabDeviceButtonReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
|
REQUEST_FIELD_CARD32(grabWindow);
|
||||||
|
REQUEST_FIELD_CARD16(modifiers);
|
||||||
if (client->req_len !=
|
REQUEST_FIELD_CARD16(event_count);
|
||||||
bytes_to_int32(sizeof(xGrabDeviceButtonReq)) + stuff->event_count)
|
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
|
||||||
return BadLength;
|
stuff->event_count * sizeof(CARD32));
|
||||||
|
REQUEST_BUF_CARD32(&stuff[1], stuff->event_count);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
@ -136,7 +116,7 @@ ProcXGrabDeviceButton(ClientPtr client)
|
||||||
X_GrabDeviceButton)) != Success)
|
X_GrabDeviceButton)) != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
param = (GrabParameters) {
|
GrabParameters param = {
|
||||||
.grabtype = XI,
|
.grabtype = XI,
|
||||||
.ownerEvents = stuff->ownerEvents,
|
.ownerEvents = stuff->ownerEvents,
|
||||||
.this_device_mode = stuff->this_device_mode,
|
.this_device_mode = stuff->this_device_mode,
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GRABDEVB_H
|
#ifndef GRABDEVB_H
|
||||||
#define GRABDEVB_H 1
|
#define GRABDEVB_H 1
|
||||||
|
|
||||||
int SProcXGrabDeviceButton(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGrabDeviceButton(ClientPtr /* client */
|
int ProcXGrabDeviceButton(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -65,25 +66,6 @@ SOFTWARE.
|
||||||
#include "grabdev.h"
|
#include "grabdev.h"
|
||||||
#include "grabdevk.h"
|
#include "grabdevk.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from clients with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGrabDeviceKey(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGrabDeviceKeyReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
|
||||||
swapl(&stuff->grabWindow);
|
|
||||||
swaps(&stuff->modifiers);
|
|
||||||
swaps(&stuff->event_count);
|
|
||||||
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
|
|
||||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
|
|
||||||
return (ProcXGrabDeviceKey(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Grab a key on an extension device.
|
* Grab a key on an extension device.
|
||||||
|
|
@ -98,15 +80,14 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
DeviceIntPtr mdev;
|
DeviceIntPtr mdev;
|
||||||
XEventClass *class;
|
XEventClass *class;
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
GrabParameters param;
|
|
||||||
GrabMask mask;
|
GrabMask mask;
|
||||||
|
|
||||||
REQUEST(xGrabDeviceKeyReq);
|
REQUEST_HEAD_AT_LEAST(xGrabDeviceKeyReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
|
REQUEST_FIELD_CARD32(grabWindow);
|
||||||
|
REQUEST_FIELD_CARD16(modifiers);
|
||||||
if (client->req_len !=
|
REQUEST_FIELD_CARD16(event_count);
|
||||||
bytes_to_int32(sizeof(xGrabDeviceKeyReq)) + stuff->event_count)
|
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
|
||||||
return BadLength;
|
REQUEST_BUF_CARD32(&stuff[1], stuff->event_count);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
ret = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
@ -134,7 +115,7 @@ ProcXGrabDeviceKey(ClientPtr client)
|
||||||
X_GrabDeviceKey)) != Success)
|
X_GrabDeviceKey)) != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
param = (GrabParameters) {
|
GrabParameters param = {
|
||||||
.grabtype = XI,
|
.grabtype = XI,
|
||||||
.ownerEvents = stuff->ownerEvents,
|
.ownerEvents = stuff->ownerEvents,
|
||||||
.this_device_mode = stuff->this_device_mode,
|
.this_device_mode = stuff->this_device_mode,
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GRABDEVK_H
|
#ifndef GRABDEVK_H
|
||||||
#define GRABDEVK_H 1
|
#define GRABDEVK_H 1
|
||||||
|
|
||||||
int SProcXGrabDeviceKey(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGrabDeviceKey(ClientPtr /* client */
|
int ProcXGrabDeviceKey(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,27 +56,12 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "gtmotion.h"
|
#include "gtmotion.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Swap the request if server and client have different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGetDeviceMotionEvents(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGetDeviceMotionEventsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
|
||||||
swapl(&stuff->start);
|
|
||||||
swapl(&stuff->stop);
|
|
||||||
return (ProcXGetDeviceMotionEvents(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Get the motion history for an extension pointer devices.
|
* Get the motion history for an extension pointer devices.
|
||||||
|
|
@ -86,8 +71,9 @@ SProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXGetDeviceMotionEvents(ClientPtr client)
|
ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetDeviceMotionEventsReq);
|
REQUEST_HEAD_STRUCT(xGetDeviceMotionEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
REQUEST_FIELD_CARD32(start);
|
||||||
|
REQUEST_FIELD_CARD32(stop);
|
||||||
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
int rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
|
|
@ -102,11 +88,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
MaybeStopDeviceHint(dev, client);
|
MaybeStopDeviceHint(dev, client);
|
||||||
|
|
||||||
xGetDeviceMotionEventsReply rep = {
|
xGetDeviceMotionEventsReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceMotionEvents,
|
.RepType = X_GetDeviceMotionEvents,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.nEvents = 0,
|
|
||||||
.axes = v->numAxes,
|
.axes = v->numAxes,
|
||||||
.mode = Absolute /* XXX we don't do relative at the moment */
|
.mode = Absolute /* XXX we don't do relative at the moment */
|
||||||
};
|
};
|
||||||
|
|
@ -125,8 +107,10 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords, /* XXX */
|
rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords, /* XXX */
|
||||||
start.milliseconds, stop.milliseconds,
|
start.milliseconds, stop.milliseconds,
|
||||||
(ScreenPtr) NULL, FALSE);
|
(ScreenPtr) NULL, FALSE);
|
||||||
|
if (rep.nEvents < 0)
|
||||||
|
rep.nEvents = 0;
|
||||||
|
|
||||||
length = rep.nEvents * size;
|
length = rep.nEvents * size;
|
||||||
rep.length = bytes_to_int32(length);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,8 +121,9 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
swapl(&rep.nEvents);
|
swapl(&rep.nEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
|
REPLY_BUF_CARD32(coords, bytes_to_int32(length));
|
||||||
WriteToClient(client, length, coords);
|
REPLY_FIELD_CARD32(nEvents);
|
||||||
|
REPLY_SEND_EXTRA(coords, length);
|
||||||
free(coords);
|
free(coords);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef GTMOTION_H
|
#ifndef GTMOTION_H
|
||||||
#define GTMOTION_H 1
|
#define GTMOTION_H 1
|
||||||
|
|
||||||
int SProcXGetDeviceMotionEvents(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXGetDeviceMotionEvents(ClientPtr /* client */
|
int ProcXGetDeviceMotionEvents(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
51
Xi/listdev.c
51
Xi/listdev.c
|
|
@ -58,6 +58,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
|
@ -135,9 +136,9 @@ CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
|
||||||
b2->class = ButtonClass;
|
b2->class = ButtonClass;
|
||||||
b2->length = sizeof(xButtonInfo);
|
b2->length = sizeof(xButtonInfo);
|
||||||
b2->num_buttons = b->numButtons;
|
b2->num_buttons = b->numButtons;
|
||||||
if (client && client->swapped) {
|
|
||||||
swaps(&b2->num_buttons);
|
CLIENT_STRUCT_CARD16_1(b2, num_buttons);
|
||||||
}
|
|
||||||
*buf += sizeof(xButtonInfo);
|
*buf += sizeof(xButtonInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,9 +169,8 @@ CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes, char **buf)
|
||||||
else
|
else
|
||||||
dev->use = IsXExtensionDevice;
|
dev->use = IsXExtensionDevice;
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD32_1(dev, type);
|
||||||
swapl(&dev->type);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xDeviceInfo);
|
*buf += sizeof(xDeviceInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -191,9 +191,9 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
|
||||||
k2->min_keycode = k->xkbInfo->desc->min_key_code;
|
k2->min_keycode = k->xkbInfo->desc->min_key_code;
|
||||||
k2->max_keycode = k->xkbInfo->desc->max_key_code;
|
k2->max_keycode = k->xkbInfo->desc->max_key_code;
|
||||||
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
|
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
|
||||||
if (client && client->swapped) {
|
|
||||||
swaps(&k2->num_keys);
|
CLIENT_STRUCT_CARD16_1(k2, num_keys);
|
||||||
}
|
|
||||||
*buf += sizeof(xKeyInfo);
|
*buf += sizeof(xKeyInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,9 +229,7 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
|
||||||
v2->num_axes = t_axes;
|
v2->num_axes = t_axes;
|
||||||
v2->mode = valuator_get_mode(dev, 0);
|
v2->mode = valuator_get_mode(dev, 0);
|
||||||
v2->motion_buffer_size = v->numMotionEvents;
|
v2->motion_buffer_size = v->numMotionEvents;
|
||||||
if (client && client->swapped) {
|
CLIENT_STRUCT_CARD32_1(v2, motion_buffer_size);
|
||||||
swapl(&v2->motion_buffer_size);
|
|
||||||
}
|
|
||||||
*buf += sizeof(xValuatorInfo);
|
*buf += sizeof(xValuatorInfo);
|
||||||
a = v->axes + (VPC * i);
|
a = v->axes + (VPC * i);
|
||||||
a2 = (xAxisInfoPtr) * buf;
|
a2 = (xAxisInfoPtr) * buf;
|
||||||
|
|
@ -239,11 +237,7 @@ CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
|
||||||
a2->min_value = a->min_value;
|
a2->min_value = a->min_value;
|
||||||
a2->max_value = a->max_value;
|
a2->max_value = a->max_value;
|
||||||
a2->resolution = a->resolution;
|
a2->resolution = a->resolution;
|
||||||
if (client && client->swapped) {
|
CLIENT_STRUCT_CARD32_3(a2, min_value, max_value, resolution);
|
||||||
swapl(&a2->min_value);
|
|
||||||
swapl(&a2->max_value);
|
|
||||||
swapl(&a2->resolution);
|
|
||||||
}
|
|
||||||
a2++;
|
a2++;
|
||||||
a++;
|
a++;
|
||||||
*buf += sizeof(xAxisInfo);
|
*buf += sizeof(xAxisInfo);
|
||||||
|
|
@ -325,14 +319,7 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
xDeviceInfo *dev;
|
xDeviceInfo *dev;
|
||||||
DeviceIntPtr d;
|
DeviceIntPtr d;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xListInputDevicesReq);
|
REQUEST_HEAD_STRUCT(xListInputDevicesReq);
|
||||||
|
|
||||||
xListInputDevicesReply rep = {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_ListInputDevices,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
/* allocate space for saving skip value */
|
/* allocate space for saving skip value */
|
||||||
skip = calloc(inputInfo.numDevices, sizeof(Bool));
|
skip = calloc(inputInfo.numDevices, sizeof(Bool));
|
||||||
|
|
@ -382,16 +369,14 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
|
|
||||||
ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
|
ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
|
||||||
}
|
}
|
||||||
rep.ndevices = numdevs;
|
|
||||||
rep.length = bytes_to_int32(total_length);
|
|
||||||
|
|
||||||
if (client->swapped) {
|
xListInputDevicesReply rep = {
|
||||||
swaps(&rep.sequenceNumber);
|
.RepType = X_ListInputDevices,
|
||||||
swapl(&rep.length);
|
.ndevices = numdevs,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
REPLY_SEND_EXTRA(savbuf, total_length);
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xListInputDevicesReply), &rep);
|
|
||||||
WriteToClient(client, total_length, savbuf);
|
|
||||||
free(savbuf);
|
free(savbuf);
|
||||||
free(skip);
|
free(skip);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
||||||
15
Xi/opendev.c
15
Xi/opendev.c
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "XIstubs.h"
|
#include "XIstubs.h"
|
||||||
|
|
@ -81,8 +82,7 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
int status = Success;
|
int status = Success;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xOpenDeviceReq);
|
REQUEST_HEAD_STRUCT(xOpenDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xOpenDeviceReq);
|
|
||||||
|
|
||||||
status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
|
status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
|
||||||
|
|
||||||
|
|
@ -131,19 +131,10 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
evbase[j++].event_type_base = event_base[OtherClass];
|
evbase[j++].event_type_base = event_base[OtherClass];
|
||||||
|
|
||||||
xOpenDeviceReply rep = {
|
xOpenDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_OpenDevice,
|
.RepType = X_OpenDevice,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(j * sizeof(xInputClassInfo)),
|
|
||||||
.num_classes = j
|
.num_classes = j
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND_EXTRA(evbase, j * sizeof(xInputClassInfo));
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xOpenDeviceReply), &rep);
|
|
||||||
WriteToClient(client, j * sizeof(xInputClassInfo), evbase);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
31
Xi/queryst.c
31
Xi/queryst.c
|
|
@ -39,6 +39,7 @@ from The Open Group.
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -67,10 +68,8 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
ValuatorClassPtr v;
|
ValuatorClassPtr v;
|
||||||
xValuatorState *tv;
|
xValuatorState *tv;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
double *values;
|
|
||||||
|
|
||||||
REQUEST(xQueryDeviceStateReq);
|
REQUEST_HEAD_STRUCT(xQueryDeviceStateReq);
|
||||||
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (rc != Success && rc != BadAccess)
|
if (rc != Success && rc != BadAccess)
|
||||||
|
|
@ -107,9 +106,8 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
tk->length = sizeof(xKeyState);
|
tk->length = sizeof(xKeyState);
|
||||||
tk->num_keys = k->xkbInfo->desc->max_key_code -
|
tk->num_keys = k->xkbInfo->desc->max_key_code -
|
||||||
k->xkbInfo->desc->min_key_code + 1;
|
k->xkbInfo->desc->min_key_code + 1;
|
||||||
if (rc != BadAccess)
|
for (i = 0; i < 32; i++)
|
||||||
for (i = 0; i < 32; i++)
|
tk->keys[i] = k->down[i];
|
||||||
tk->keys[i] = k->down[i];
|
|
||||||
buf += sizeof(xKeyState);
|
buf += sizeof(xKeyState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,31 +130,20 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
tv->mode |= (dev->proximity &&
|
tv->mode |= (dev->proximity &&
|
||||||
!dev->proximity->in_proximity) ? OutOfProximity : 0;
|
!dev->proximity->in_proximity) ? OutOfProximity : 0;
|
||||||
buf += sizeof(xValuatorState);
|
buf += sizeof(xValuatorState);
|
||||||
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
|
int *buf2 = (int *)buf;
|
||||||
|
for (i = 0; i < v->numAxes; i++) {
|
||||||
if (rc != BadAccess)
|
if (rc != BadAccess)
|
||||||
*((int *) buf) = *values;
|
buf2[i] = v->axisVal[i];
|
||||||
values++;
|
|
||||||
if (client->swapped) {
|
|
||||||
swapl((int *) buf);
|
|
||||||
}
|
|
||||||
buf += sizeof(int);
|
|
||||||
}
|
}
|
||||||
|
REPLY_BUF_CARD32(buf2, v->numAxes);
|
||||||
}
|
}
|
||||||
|
|
||||||
xQueryDeviceStateReply rep = {
|
xQueryDeviceStateReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_QueryDeviceState,
|
.RepType = X_QueryDeviceState,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(total_length),
|
|
||||||
.num_classes = num_classes
|
.num_classes = num_classes
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND_EXTRA(savbuf, total_length);
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xQueryDeviceStateReply), &rep);
|
|
||||||
WriteToClient(client, total_length, savbuf);
|
|
||||||
free(savbuf);
|
free(savbuf);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -111,25 +112,6 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from clients with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXSelectExtensionEvent(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSelectExtensionEventReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
|
||||||
swapl(&stuff->window);
|
|
||||||
swaps(&stuff->count);
|
|
||||||
REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32));
|
|
||||||
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
|
|
||||||
|
|
||||||
return (ProcXSelectExtensionEvent(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure selects input from an extension device.
|
* This procedure selects input from an extension device.
|
||||||
|
|
@ -144,12 +126,11 @@ ProcXSelectExtensionEvent(ClientPtr client)
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
|
|
||||||
REQUEST(xSelectExtensionEventReq);
|
REQUEST_HEAD_AT_LEAST(xSelectExtensionEventReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
REQUEST_FIELD_CARD32(window);
|
||||||
|
REQUEST_FIELD_CARD16(count);
|
||||||
if (client->req_len !=
|
REQUEST_FIXED_SIZE(xSelectExtensionEventReq, stuff->count * sizeof(CARD32));
|
||||||
bytes_to_int32(sizeof(xSelectExtensionEventReq)) + stuff->count)
|
REQUEST_BUF_CARD32(&stuff[1], stuff->count);
|
||||||
return BadLength;
|
|
||||||
|
|
||||||
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
ret = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SELECTEV_H
|
#ifndef SELECTEV_H
|
||||||
#define SELECTEV_H 1
|
#define SELECTEV_H 1
|
||||||
|
|
||||||
int SProcXSelectExtensionEvent(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXSelectExtensionEvent(ClientPtr /* client */
|
int ProcXSelectExtensionEvent(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* Window */
|
#include "windowstr.h" /* Window */
|
||||||
|
|
@ -66,53 +67,6 @@ SOFTWARE.
|
||||||
|
|
||||||
extern int lastEvent; /* Defined in extension.c */
|
extern int lastEvent; /* Defined in extension.c */
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from clients with a different byte order than us.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXSendExtensionEvent(ClientPtr client)
|
|
||||||
{
|
|
||||||
CARD32 *p;
|
|
||||||
int i;
|
|
||||||
xEvent eventT = { .u.u.type = 0 };
|
|
||||||
xEvent *eventP;
|
|
||||||
EventSwapPtr proc;
|
|
||||||
|
|
||||||
REQUEST(xSendExtensionEventReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
|
||||||
swapl(&stuff->destination);
|
|
||||||
swaps(&stuff->count);
|
|
||||||
|
|
||||||
if (client->req_len !=
|
|
||||||
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
|
||||||
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
|
|
||||||
return BadLength;
|
|
||||||
|
|
||||||
eventP = (xEvent *) &stuff[1];
|
|
||||||
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
|
||||||
if (eventP->u.u.type == GenericEvent) {
|
|
||||||
client->errorValue = eventP->u.u.type;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
proc = EventSwapVector[eventP->u.u.type & 0177];
|
|
||||||
/* no swapping proc; invalid event type? */
|
|
||||||
if (proc == NotImplemented) {
|
|
||||||
client->errorValue = eventP->u.u.type;
|
|
||||||
return BadValue;
|
|
||||||
}
|
|
||||||
(*proc) (eventP, &eventT);
|
|
||||||
*eventP = eventT;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = (CARD32 *) (((xEvent *) &stuff[1]) + stuff->num_events);
|
|
||||||
SwapLongs(p, stuff->count);
|
|
||||||
return (ProcXSendExtensionEvent(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Send an event to some client, as if it had come from an extension input
|
* Send an event to some client, as if it had come from an extension input
|
||||||
|
|
@ -129,14 +83,42 @@ ProcXSendExtensionEvent(ClientPtr client)
|
||||||
XEventClass *list;
|
XEventClass *list;
|
||||||
struct tmask tmp[EMASKSIZE];
|
struct tmask tmp[EMASKSIZE];
|
||||||
|
|
||||||
REQUEST(xSendExtensionEventReq);
|
REQUEST_HEAD_AT_LEAST(xSendExtensionEventReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
REQUEST_FIELD_CARD32(destination);
|
||||||
|
REQUEST_FIELD_CARD16(count);
|
||||||
|
|
||||||
if (client->req_len !=
|
if (client->req_len !=
|
||||||
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
|
||||||
(stuff->num_events * bytes_to_int32(sizeof(xEvent))))
|
bytes_to_int32(stuff->num_events * sizeof(xEvent)))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
CARD32 *p;
|
||||||
|
xEvent eventT = { .u.u.type = 0 };
|
||||||
|
xEvent *eventP;
|
||||||
|
EventSwapPtr proc;
|
||||||
|
|
||||||
|
eventP = (xEvent *) &stuff[1];
|
||||||
|
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
||||||
|
if (eventP->u.u.type == GenericEvent) {
|
||||||
|
client->errorValue = eventP->u.u.type;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
proc = EventSwapVector[eventP->u.u.type & 0177];
|
||||||
|
/* no swapping proc; invalid event type? */
|
||||||
|
if (proc == NotImplemented) {
|
||||||
|
client->errorValue = eventP->u.u.type;
|
||||||
|
return BadValue;
|
||||||
|
}
|
||||||
|
(*proc) (eventP, &eventT);
|
||||||
|
*eventP = eventT;
|
||||||
|
}
|
||||||
|
|
||||||
|
p = (CARD32 *) (((xEvent *) &stuff[1]) + stuff->num_events);
|
||||||
|
SwapLongs(p, stuff->count);
|
||||||
|
}
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SENDEXEV_H
|
#ifndef SENDEXEV_H
|
||||||
#define SENDEXEV_H 1
|
#define SENDEXEV_H 1
|
||||||
|
|
||||||
int SProcXSendExtensionEvent(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXSendExtensionEvent(ClientPtr /* client */
|
int ProcXSendExtensionEvent(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
10
Xi/setbmap.c
10
Xi/setbmap.c
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
|
|
@ -74,8 +75,7 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
int ret;
|
int ret;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xSetDeviceButtonMappingReq);
|
REQUEST_HEAD_AT_LEAST(xSetDeviceButtonMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
|
|
||||||
|
|
||||||
if (client->req_len !=
|
if (client->req_len !=
|
||||||
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
|
bytes_to_int32(sizeof(xSetDeviceButtonMappingReq) + stuff->map_length))
|
||||||
|
|
@ -101,10 +101,6 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
.status = (ret == Success ? MappingSuccess : MappingBusy),
|
.status = (ret == Success ? MappingSuccess : MappingBusy),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
Xi/setdval.c
11
Xi/setdval.c
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -75,13 +76,10 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceValuatorsReq);
|
REQUEST_HEAD_AT_LEAST(xSetDeviceValuatorsReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
|
||||||
|
|
||||||
xSetDeviceValuatorsReply rep = {
|
xSetDeviceValuatorsReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_SetDeviceValuators,
|
.RepType = X_SetDeviceValuators,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.status = Success
|
.status = Success
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -111,9 +109,6 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
if (rep.status != Success && rep.status != AlreadyGrabbed)
|
if (rep.status != Success && rep.status != AlreadyGrabbed)
|
||||||
return rep.status;
|
return rep.status;
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,26 +59,11 @@ SOFTWARE.
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "setfocus.h"
|
#include "setfocus.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure sets the focus for a device.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXSetDeviceFocus(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xSetDeviceFocusReq);
|
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
|
||||||
swapl(&stuff->focus);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
return (ProcXSetDeviceFocus(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* This procedure sets the focus for a device.
|
* This procedure sets the focus for a device.
|
||||||
|
|
@ -91,8 +76,9 @@ ProcXSetDeviceFocus(ClientPtr client)
|
||||||
int ret;
|
int ret;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xSetDeviceFocusReq);
|
REQUEST_HEAD_STRUCT(xSetDeviceFocusReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
REQUEST_FIELD_CARD32(focus);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess);
|
ret = dixLookupDevice(&dev, stuff->device, client, DixSetFocusAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SETFOCUS_H
|
#ifndef SETFOCUS_H
|
||||||
#define SETFOCUS_H 1
|
#define SETFOCUS_H 1
|
||||||
|
|
||||||
int SProcXSetDeviceFocus(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXSetDeviceFocus(ClientPtr /* client */
|
int ProcXSetDeviceFocus(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
|
|
@ -75,8 +76,7 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
int ret;
|
int ret;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xSetDeviceModifierMappingReq);
|
REQUEST_HEAD_AT_LEAST(xSetDeviceModifierMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
|
||||||
|
|
||||||
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
|
if (client->req_len != bytes_to_int32(sizeof(xSetDeviceModifierMappingReq)) +
|
||||||
(stuff->numKeyPerModifier << 1))
|
(stuff->numKeyPerModifier << 1))
|
||||||
|
|
@ -101,9 +101,6 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
.success = ret,
|
.success = ret,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xSetDeviceModifierMappingReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
14
Xi/setmode.c
14
Xi/setmode.c
|
|
@ -56,6 +56,7 @@ SOFTWARE.
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -75,14 +76,10 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetDeviceModeReq);
|
REQUEST_HEAD_STRUCT(xSetDeviceModeReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
|
||||||
|
|
||||||
xSetDeviceModeReply rep = {
|
xSetDeviceModeReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_SetDeviceMode,
|
.RepType = X_SetDeviceMode,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
|
|
@ -113,11 +110,6 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
return rep.status;
|
return rep.status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xSetDeviceModeReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
Xi/ungrdev.c
20
Xi/ungrdev.c
|
|
@ -54,6 +54,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include <X11/extensions/XIproto.h>
|
#include <X11/extensions/XIproto.h>
|
||||||
|
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -61,21 +62,6 @@ SOFTWARE.
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "ungrdev.h"
|
#include "ungrdev.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from a client with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXUngrabDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xUngrabDeviceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
return (ProcXUngrabDevice(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Release a grab of an extension device.
|
* Release a grab of an extension device.
|
||||||
|
|
@ -90,8 +76,8 @@ ProcXUngrabDevice(ClientPtr client)
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xUngrabDeviceReq);
|
REQUEST_HEAD_STRUCT(xUngrabDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef UNGRDEV_H
|
#ifndef UNGRDEV_H
|
||||||
#define UNGRDEV_H 1
|
#define UNGRDEV_H 1
|
||||||
|
|
||||||
int SProcXUngrabDevice(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXUngrabDevice(ClientPtr /* client */
|
int ProcXUngrabDevice(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/dixgrabs_priv.h"
|
#include "dix/dixgrabs_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -67,22 +68,6 @@ SOFTWARE.
|
||||||
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
|
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
|
||||||
Mod3Mask | Mod4Mask | Mod5Mask )
|
Mod3Mask | Mod4Mask | Mod5Mask )
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from a client with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXUngrabDeviceButton(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xUngrabDeviceButtonReq);
|
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
|
||||||
swapl(&stuff->grabWindow);
|
|
||||||
swaps(&stuff->modifiers);
|
|
||||||
return (ProcXUngrabDeviceButton(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Release a grab of a button on an extension device.
|
* Release a grab of a button on an extension device.
|
||||||
|
|
@ -98,8 +83,9 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
||||||
GrabPtr temporaryGrab;
|
GrabPtr temporaryGrab;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xUngrabDeviceButtonReq);
|
REQUEST_HEAD_STRUCT(xUngrabDeviceButtonReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
REQUEST_FIELD_CARD32(grabWindow);
|
||||||
|
REQUEST_FIELD_CARD16(modifiers);
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef UNGRDEVB_H
|
#ifndef UNGRDEVB_H
|
||||||
#define UNGRDEVB_H 1
|
#define UNGRDEVB_H 1
|
||||||
|
|
||||||
int SProcXUngrabDeviceButton(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXUngrabDeviceButton(ClientPtr /* client */
|
int ProcXUngrabDeviceButton(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ SOFTWARE.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/dixgrabs_priv.h"
|
#include "dix/dixgrabs_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -69,22 +70,6 @@ SOFTWARE.
|
||||||
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
|
ShiftMask | LockMask | ControlMask | Mod1Mask | Mod2Mask | \
|
||||||
Mod3Mask | Mod4Mask | Mod5Mask )
|
Mod3Mask | Mod4Mask | Mod5Mask )
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* Handle requests from a client with a different byte order.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXUngrabDeviceKey(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xUngrabDeviceKeyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
|
||||||
swapl(&stuff->grabWindow);
|
|
||||||
swaps(&stuff->modifiers);
|
|
||||||
return (ProcXUngrabDeviceKey(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* Release a grab of a key on an extension device.
|
* Release a grab of a key on an extension device.
|
||||||
|
|
@ -100,8 +85,9 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
||||||
GrabPtr temporaryGrab;
|
GrabPtr temporaryGrab;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xUngrabDeviceKeyReq);
|
REQUEST_HEAD_STRUCT(xUngrabDeviceKeyReq);
|
||||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
REQUEST_FIELD_CARD32(grabWindow);
|
||||||
|
REQUEST_FIELD_CARD16(modifiers);
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef UNGRDEVK_H
|
#ifndef UNGRDEVK_H
|
||||||
#define UNGRDEVK_H 1
|
#define UNGRDEVK_H 1
|
||||||
|
|
||||||
int SProcXUngrabDeviceKey(ClientPtr /* client */
|
|
||||||
);
|
|
||||||
|
|
||||||
int ProcXUngrabDeviceKey(ClientPtr /* client */
|
int ProcXUngrabDeviceKey(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -46,42 +47,82 @@
|
||||||
#include "exglobals.h" /* BadDevice */
|
#include "exglobals.h" /* BadDevice */
|
||||||
#include "xiallowev.h"
|
#include "xiallowev.h"
|
||||||
|
|
||||||
int _X_COLD
|
static int allowEvents(ClientPtr client, xXIAllowEventsReq *stuff)
|
||||||
SProcXIAllowEvents(ClientPtr client)
|
|
||||||
{
|
{
|
||||||
REQUEST(xXIAllowEventsReq);
|
DeviceIntPtr dev;
|
||||||
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
int ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
swapl(&stuff->time);
|
if (ret != Success)
|
||||||
if (client->req_len > 3) {
|
return ret;
|
||||||
xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq *) stuff;
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
|
TimeStamp time = ClientTimeToServerTime(stuff->time);
|
||||||
swapl(&req_xi22->touchid);
|
|
||||||
swapl(&req_xi22->grab_window);
|
switch (stuff->mode) {
|
||||||
|
case XIReplayDevice:
|
||||||
|
AllowSome(client, time, dev, NOT_GRABBED);
|
||||||
|
break;
|
||||||
|
case XISyncDevice:
|
||||||
|
AllowSome(client, time, dev, FREEZE_NEXT_EVENT);
|
||||||
|
break;
|
||||||
|
case XIAsyncDevice:
|
||||||
|
AllowSome(client, time, dev, THAWED);
|
||||||
|
break;
|
||||||
|
case XIAsyncPairedDevice:
|
||||||
|
if (IsMaster(dev))
|
||||||
|
AllowSome(client, time, dev, THAW_OTHERS);
|
||||||
|
break;
|
||||||
|
case XISyncPair:
|
||||||
|
if (IsMaster(dev))
|
||||||
|
AllowSome(client, time, dev, FREEZE_BOTH_NEXT_EVENT);
|
||||||
|
break;
|
||||||
|
case XIAsyncPair:
|
||||||
|
if (IsMaster(dev))
|
||||||
|
AllowSome(client, time, dev, THAWED_BOTH);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
client->errorValue = stuff->mode;
|
||||||
|
ret = BadValue;
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return ProcXIAllowEvents(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIAllowEvents(ClientPtr client)
|
ProcXIAllowEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
TimeStamp time;
|
XIClientPtr xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
|
||||||
DeviceIntPtr dev;
|
|
||||||
int ret = Success;
|
|
||||||
XIClientPtr xi_client;
|
|
||||||
Bool have_xi22 = FALSE;
|
|
||||||
|
|
||||||
REQUEST(xXI2_2AllowEventsReq);
|
|
||||||
|
|
||||||
xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
|
|
||||||
|
|
||||||
if (version_compare(xi_client->major_version,
|
if (version_compare(xi_client->major_version,
|
||||||
xi_client->minor_version, 2, 2) >= 0) {
|
xi_client->minor_version, 2, 2) >= 0) {
|
||||||
REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
|
REQUEST_HEAD_AT_LEAST(xXI2_2AllowEventsReq);
|
||||||
have_xi22 = TRUE;
|
REQUEST_FIELD_CARD16(length);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
REQUEST_FIELD_CARD32(touchid);
|
||||||
|
REQUEST_FIELD_CARD32(grab_window);
|
||||||
|
|
||||||
|
if ((stuff->mode == XIRejectTouch) || (stuff->mode == XIAcceptTouch)) {
|
||||||
|
DeviceIntPtr dev;
|
||||||
|
int rc;
|
||||||
|
WindowPtr win;
|
||||||
|
|
||||||
|
int ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
|
if (ret != Success)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess);
|
||||||
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
return TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
|
||||||
|
stuff->grab_window, &client->errorValue);
|
||||||
|
}
|
||||||
|
return allowEvents(client, (xXIAllowEventsReq*)stuff);
|
||||||
|
} else {
|
||||||
|
REQUEST_HEAD_AT_LEAST(xXIAllowEventsReq);
|
||||||
|
REQUEST_FIELD_CARD16(length);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
return allowEvents(client, stuff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
|
REQUEST_AT_LEAST_SIZE(xXIAllowEventsReq);
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,5 @@
|
||||||
#define XIALLOWEV_H 1
|
#define XIALLOWEV_H 1
|
||||||
|
|
||||||
int ProcXIAllowEvents(ClientPtr client);
|
int ProcXIAllowEvents(ClientPtr client);
|
||||||
int SProcXIAllowEvents(ClientPtr client);
|
|
||||||
|
|
||||||
#endif /* XIALLOWEV_H */
|
#endif /* XIALLOWEV_H */
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@
|
||||||
#include "dix/cursor_priv.h"
|
#include "dix/cursor_priv.h"
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
|
|
@ -849,52 +850,33 @@ XIDestroyPointerBarrier(ClientPtr client,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIBarrierReleasePointer(ClientPtr client)
|
|
||||||
{
|
|
||||||
xXIBarrierReleasePointerInfo *info;
|
|
||||||
REQUEST(xXIBarrierReleasePointerReq);
|
|
||||||
int i;
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq);
|
|
||||||
|
|
||||||
swapl(&stuff->num_barriers);
|
|
||||||
if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo))
|
|
||||||
return BadLength;
|
|
||||||
REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo));
|
|
||||||
|
|
||||||
info = (xXIBarrierReleasePointerInfo*) &stuff[1];
|
|
||||||
for (i = 0; i < stuff->num_barriers; i++, info++) {
|
|
||||||
swaps(&info->deviceid);
|
|
||||||
swapl(&info->barrier);
|
|
||||||
swapl(&info->eventid);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ProcXIBarrierReleasePointer(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIBarrierReleasePointer(ClientPtr client)
|
ProcXIBarrierReleasePointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_AT_LEAST(xXIBarrierReleasePointerReq);
|
||||||
|
REQUEST_FIELD_CARD32(num_barriers);
|
||||||
|
|
||||||
|
if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo))
|
||||||
|
return BadLength;
|
||||||
|
|
||||||
|
REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo));
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
int err;
|
int err;
|
||||||
struct PointerBarrierClient *barrier;
|
struct PointerBarrierClient *barrier;
|
||||||
struct PointerBarrier *b;
|
struct PointerBarrier *b;
|
||||||
xXIBarrierReleasePointerInfo *info;
|
|
||||||
|
|
||||||
REQUEST(xXIBarrierReleasePointerReq);
|
xXIBarrierReleasePointerInfo *info = (xXIBarrierReleasePointerInfo*) &stuff[1];
|
||||||
REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq);
|
|
||||||
if (stuff->num_barriers > UINT32_MAX / sizeof(xXIBarrierReleasePointerInfo))
|
|
||||||
return BadLength;
|
|
||||||
REQUEST_FIXED_SIZE(xXIBarrierReleasePointerReq, stuff->num_barriers * sizeof(xXIBarrierReleasePointerInfo));
|
|
||||||
|
|
||||||
info = (xXIBarrierReleasePointerInfo*) &stuff[1];
|
|
||||||
for (i = 0; i < stuff->num_barriers; i++, info++) {
|
for (i = 0; i < stuff->num_barriers; i++, info++) {
|
||||||
struct PointerBarrierDevice *pbd;
|
struct PointerBarrierDevice *pbd;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
CARD32 barrier_id, event_id;
|
CARD32 barrier_id, event_id;
|
||||||
_X_UNUSED CARD32 device_id;
|
_X_UNUSED CARD32 device_id;
|
||||||
|
|
||||||
|
CLIENT_STRUCT_CARD16_1(info, deviceid);
|
||||||
|
CLIENT_STRUCT_CARD32_2(info, barrier, eventid);
|
||||||
|
|
||||||
barrier_id = info->barrier;
|
barrier_id = info->barrier;
|
||||||
event_id = info->eventid;
|
event_id = info->eventid;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ XIDestroyPointerBarrier(ClientPtr client,
|
||||||
Bool XIBarrierInit(void);
|
Bool XIBarrierInit(void);
|
||||||
void XIBarrierReset(void);
|
void XIBarrierReset(void);
|
||||||
|
|
||||||
int SProcXIBarrierReleasePointer(ClientPtr client);
|
|
||||||
int ProcXIBarrierReleasePointer(ClientPtr client);
|
int ProcXIBarrierReleasePointer(ClientPtr client);
|
||||||
|
|
||||||
void XIBarrierNewMasterDevice(ClientPtr client, int deviceid);
|
void XIBarrierNewMasterDevice(ClientPtr client, int deviceid);
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
|
|
||||||
#include "dix/cursor_priv.h"
|
#include "dix/cursor_priv.h"
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -54,17 +55,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIChangeCursor(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIChangeCursorReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
|
||||||
swapl(&stuff->win);
|
|
||||||
swapl(&stuff->cursor);
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
return (ProcXIChangeCursor(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIChangeCursor(ClientPtr client)
|
ProcXIChangeCursor(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -73,8 +63,10 @@ ProcXIChangeCursor(ClientPtr client)
|
||||||
DeviceIntPtr pDev = NULL;
|
DeviceIntPtr pDev = NULL;
|
||||||
CursorPtr pCursor = NULL;
|
CursorPtr pCursor = NULL;
|
||||||
|
|
||||||
REQUEST(xXIChangeCursorReq);
|
REQUEST_HEAD_STRUCT(xXIChangeCursorReq);
|
||||||
REQUEST_SIZE_MATCH(xXIChangeCursorReq);
|
REQUEST_FIELD_CARD32(win);
|
||||||
|
REQUEST_FIELD_CARD32(cursor);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
|
||||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
#ifndef CHDEVCUR_H
|
#ifndef CHDEVCUR_H
|
||||||
#define CHDEVCUR_H 1
|
#define CHDEVCUR_H 1
|
||||||
|
|
||||||
int SProcXIChangeCursor(ClientPtr /* client */ );
|
|
||||||
int ProcXIChangeCursor(ClientPtr /* client */ );
|
int ProcXIChangeCursor(ClientPtr /* client */ );
|
||||||
|
|
||||||
#endif /* CHDEVCUR_H */
|
#endif /* CHDEVCUR_H */
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/extension_priv.h"
|
#include "dix/extension_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/bug_priv.h"
|
#include "os/bug_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -122,13 +123,6 @@ XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
||||||
free(ev);
|
free(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure allows a client to change the device hierarchy through
|
|
||||||
* adding new master devices, removing them, etc.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
|
add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
|
||||||
{
|
{
|
||||||
|
|
@ -423,7 +417,12 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SWAPIF(cmd) if (client->swapped) { cmd; }
|
/***********************************************************************
|
||||||
|
*
|
||||||
|
* This procedure allows a client to change the device hierarchy through
|
||||||
|
* adding new master devices, removing them, etc.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIChangeHierarchy(ClientPtr client)
|
ProcXIChangeHierarchy(ClientPtr client)
|
||||||
|
|
@ -438,8 +437,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
CHANGED,
|
CHANGED,
|
||||||
} changes = NO_CHANGE;
|
} changes = NO_CHANGE;
|
||||||
|
|
||||||
REQUEST(xXIChangeHierarchyReq);
|
REQUEST_HEAD_AT_LEAST(xXIChangeHierarchyReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xXIChangeHierarchyReq);
|
|
||||||
|
|
||||||
if (!stuff->num_changes)
|
if (!stuff->num_changes)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -453,8 +451,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWAPIF(swaps(&any->type));
|
CLIENT_STRUCT_CARD16_2(any, type, length);
|
||||||
SWAPIF(swaps(&any->length));
|
|
||||||
|
|
||||||
if (len < ((size_t)any->length << 2))
|
if (len < ((size_t)any->length << 2))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
@ -477,7 +474,7 @@ ProcXIChangeHierarchy(ClientPtr client)
|
||||||
rc = BadLength;
|
rc = BadLength;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
}
|
}
|
||||||
SWAPIF(swaps(&c->name_len));
|
CLIENT_STRUCT_CARD16_1(c, name_len);
|
||||||
if (c->name_len > (len - sizeof(xXIAddMasterInfo))) {
|
if (c->name_len > (len - sizeof(xXIAddMasterInfo))) {
|
||||||
rc = BadLength;
|
rc = BadLength;
|
||||||
goto unwind;
|
goto unwind;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include <X11/extensions/XI2proto.h>
|
#include <X11/extensions/XI2proto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -41,53 +42,27 @@
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "xigetclientpointer.h"
|
#include "xigetclientpointer.h"
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* This procedure allows a client to query another client's client pointer
|
|
||||||
* setting.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIGetClientPointer(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIGetClientPointerReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
|
|
||||||
|
|
||||||
swapl(&stuff->win);
|
|
||||||
return ProcXIGetClientPointer(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIGetClientPointer(ClientPtr client)
|
ProcXIGetClientPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
REQUEST_HEAD_STRUCT(xXIGetClientPointerReq);
|
||||||
|
REQUEST_FIELD_CARD32(win);
|
||||||
|
|
||||||
ClientPtr winclient;
|
ClientPtr winclient;
|
||||||
|
|
||||||
REQUEST(xXIGetClientPointerReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIGetClientPointerReq);
|
|
||||||
|
|
||||||
if (stuff->win != None) {
|
if (stuff->win != None) {
|
||||||
rc = dixLookupResourceOwner(&winclient, stuff->win, client, DixGetAttrAccess);
|
if (dixLookupResourceOwner(&winclient, stuff->win, client, DixGetAttrAccess) != Success)
|
||||||
|
|
||||||
if (rc != Success)
|
|
||||||
return BadWindow;
|
return BadWindow;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
winclient = client;
|
winclient = client;
|
||||||
|
|
||||||
xXIGetClientPointerReply rep = {
|
xXIGetClientPointerReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIGetClientPointer,
|
.RepType = X_XIGetClientPointer,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.set = (winclient->clientPtr != NULL),
|
.set = (winclient->clientPtr != NULL),
|
||||||
.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0
|
.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(deviceid);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND();
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.deviceid);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIGetClientPointerReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
#ifndef GETCPTR_H
|
#ifndef GETCPTR_H
|
||||||
#define GETCPTR_H 1
|
#define GETCPTR_H 1
|
||||||
|
|
||||||
int SProcXIGetClientPointer(ClientPtr /* client */ );
|
|
||||||
int ProcXIGetClientPointer(ClientPtr /* client */ );
|
int ProcXIGetClientPointer(ClientPtr /* client */ );
|
||||||
|
|
||||||
#endif /* GETCPTR_H */
|
#endif /* GETCPTR_H */
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
|
|
@ -44,25 +45,6 @@
|
||||||
#include "xigrabdev.h"
|
#include "xigrabdev.h"
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIGrabDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIGrabDeviceReq);
|
|
||||||
/*
|
|
||||||
* Check here for at least the length of the struct we swap, then
|
|
||||||
* let ProcXIGrabDevice check the full size after we swap mask_len.
|
|
||||||
*/
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->grab_window);
|
|
||||||
swapl(&stuff->cursor);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
swaps(&stuff->mask_len);
|
|
||||||
|
|
||||||
return ProcXIGrabDevice(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIGrabDevice(ClientPtr client)
|
ProcXIGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -74,7 +56,12 @@ ProcXIGrabDevice(ClientPtr client)
|
||||||
unsigned int keyboard_mode;
|
unsigned int keyboard_mode;
|
||||||
unsigned int pointer_mode;
|
unsigned int pointer_mode;
|
||||||
|
|
||||||
REQUEST(xXIGrabDeviceReq);
|
REQUEST_HEAD_AT_LEAST(xXIGrabDeviceReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(grab_window);
|
||||||
|
REQUEST_FIELD_CARD32(cursor);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
REQUEST_FIELD_CARD16(mask_len);
|
||||||
REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4);
|
REQUEST_FIXED_SIZE(xXIGrabDeviceReq, ((size_t) stuff->mask_len) * 4);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
|
|
@ -123,29 +110,12 @@ ProcXIGrabDevice(ClientPtr client)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
xXIGrabDeviceReply rep = {
|
xXIGrabDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIGrabDevice,
|
.RepType = X_XIGrabDevice,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.status = status
|
.status = status
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_SEND();
|
||||||
swaps(&rep.sequenceNumber);
|
return Success;
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIUngrabDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIUngrabDeviceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
|
|
||||||
return ProcXIUngrabDevice(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -156,8 +126,9 @@ ProcXIUngrabDevice(ClientPtr client)
|
||||||
int ret = Success;
|
int ret = Success;
|
||||||
TimeStamp time;
|
TimeStamp time;
|
||||||
|
|
||||||
REQUEST(xXIUngrabDeviceReq);
|
REQUEST_HEAD_STRUCT(xXIUngrabDeviceReq);
|
||||||
REQUEST_SIZE_MATCH(xXIUngrabDeviceReq);
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@
|
||||||
#define XIGRABDEV_H 1
|
#define XIGRABDEV_H 1
|
||||||
|
|
||||||
int ProcXIGrabDevice(ClientPtr client);
|
int ProcXIGrabDevice(ClientPtr client);
|
||||||
int SProcXIGrabDevice(ClientPtr client);
|
|
||||||
|
|
||||||
int ProcXIUngrabDevice(ClientPtr client);
|
int ProcXIUngrabDevice(ClientPtr client);
|
||||||
int SProcXIUngrabDevice(ClientPtr client);
|
|
||||||
|
|
||||||
#endif /* XIGRABDEV_H */
|
#endif /* XIGRABDEV_H */
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/dixgrabs_priv.h"
|
#include "dix/dixgrabs_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#include "windowstr.h" /* window structure */
|
#include "windowstr.h" /* window structure */
|
||||||
|
|
@ -46,45 +47,10 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "inpututils.h"
|
#include "inpututils.h"
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIPassiveGrabDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
uint32_t *mods;
|
|
||||||
|
|
||||||
REQUEST(xXIPassiveGrabDeviceReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->grab_window);
|
|
||||||
swapl(&stuff->cursor);
|
|
||||||
swapl(&stuff->time);
|
|
||||||
swapl(&stuff->detail);
|
|
||||||
swaps(&stuff->mask_len);
|
|
||||||
swaps(&stuff->num_modifiers);
|
|
||||||
|
|
||||||
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
|
|
||||||
((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
|
|
||||||
mods = (uint32_t *) &stuff[1] + stuff->mask_len;
|
|
||||||
|
|
||||||
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
|
|
||||||
swapl(mods);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ProcXIPassiveGrabDevice(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIPassiveGrabDevice(ClientPtr client)
|
ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev, mod_dev;
|
DeviceIntPtr dev, mod_dev;
|
||||||
xXIPassiveGrabDeviceReply rep = {
|
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIPassiveGrabDevice,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.num_modifiers = 0
|
|
||||||
};
|
|
||||||
int i, ret = Success;
|
int i, ret = Success;
|
||||||
uint32_t *modifiers;
|
uint32_t *modifiers;
|
||||||
xXIGrabModifierInfo *modifiers_failed = NULL;
|
xXIGrabModifierInfo *modifiers_failed = NULL;
|
||||||
|
|
@ -93,9 +59,23 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
void *tmp;
|
void *tmp;
|
||||||
int mask_len;
|
int mask_len;
|
||||||
|
|
||||||
REQUEST(xXIPassiveGrabDeviceReq);
|
REQUEST_HEAD_AT_LEAST(xXIPassiveGrabDeviceReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(grab_window);
|
||||||
|
REQUEST_FIELD_CARD32(cursor);
|
||||||
|
REQUEST_FIELD_CARD32(time);
|
||||||
|
REQUEST_FIELD_CARD32(detail);
|
||||||
|
REQUEST_FIELD_CARD16(mask_len);
|
||||||
|
REQUEST_FIELD_CARD16(num_modifiers);
|
||||||
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
|
REQUEST_FIXED_SIZE(xXIPassiveGrabDeviceReq,
|
||||||
((uint32_t) stuff->mask_len + stuff->num_modifiers) * 4);
|
((uint32_t) stuff->mask_len + stuff->num_modifiers) *4);
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
uint32_t *mods = (uint32_t *) &stuff[1] + stuff->mask_len;
|
||||||
|
for (i = 0; i < stuff->num_modifiers; i++, mods++) {
|
||||||
|
swapl(mods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stuff->deviceid == XIAllDevices)
|
if (stuff->deviceid == XIAllDevices)
|
||||||
dev = inputInfo.all_devices;
|
dev = inputInfo.all_devices;
|
||||||
|
|
@ -198,6 +178,8 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
|
|
||||||
mod_dev = (InputDevIsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
|
mod_dev = (InputDevIsFloating(dev)) ? dev : GetMaster(dev, MASTER_KEYBOARD);
|
||||||
|
|
||||||
|
int num_mod = 0;
|
||||||
|
|
||||||
for (i = 0; i < stuff->num_modifiers; i++, modifiers++) {
|
for (i = 0; i < stuff->num_modifiers; i++, modifiers++) {
|
||||||
uint8_t status = Success;
|
uint8_t status = Success;
|
||||||
|
|
||||||
|
|
@ -234,27 +216,24 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != GrabSuccess) {
|
if (status != GrabSuccess) {
|
||||||
xXIGrabModifierInfo *info = modifiers_failed + rep.num_modifiers;
|
xXIGrabModifierInfo *info = modifiers_failed + num_mod;
|
||||||
|
|
||||||
info->status = status;
|
info->status = status;
|
||||||
info->modifiers = *modifiers;
|
info->modifiers = *modifiers;
|
||||||
if (client->swapped)
|
CLIENT_STRUCT_CARD32_1(info, modifiers);
|
||||||
swapl(&info->modifiers);
|
num_mod++;
|
||||||
|
|
||||||
rep.num_modifiers++;
|
|
||||||
rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t length = rep.length; /* save it before swapping */
|
xXIPassiveGrabDeviceReply rep = {
|
||||||
|
.RepType = X_XIPassiveGrabDevice,
|
||||||
|
.num_modifiers = num_mod,
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
uint32_t length = bytes_to_int32(sizeof(xXIGrabModifierInfo) * num_mod);
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD16(num_modifiers);
|
||||||
swaps(&rep.num_modifiers);
|
REPLY_SEND_EXTRA(modifiers_failed, length * 4);
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(rep), &rep);
|
|
||||||
WriteToClient(client, length * 4, modifiers_failed);
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
free(modifiers_failed);
|
free(modifiers_failed);
|
||||||
|
|
@ -262,30 +241,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIPassiveUngrabDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
uint32_t *modifiers;
|
|
||||||
|
|
||||||
REQUEST(xXIPassiveUngrabDeviceReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIPassiveUngrabDeviceReq);
|
|
||||||
|
|
||||||
swapl(&stuff->grab_window);
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->detail);
|
|
||||||
swaps(&stuff->num_modifiers);
|
|
||||||
|
|
||||||
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
|
|
||||||
((uint32_t) stuff->num_modifiers) << 2);
|
|
||||||
modifiers = (uint32_t *) &stuff[1];
|
|
||||||
|
|
||||||
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
|
|
||||||
swapl(modifiers);
|
|
||||||
|
|
||||||
return ProcXIPassiveUngrabDevice(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIPassiveUngrabDevice(ClientPtr client)
|
ProcXIPassiveUngrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
|
@ -295,10 +250,20 @@ ProcXIPassiveUngrabDevice(ClientPtr client)
|
||||||
uint32_t *modifiers;
|
uint32_t *modifiers;
|
||||||
int i, rc;
|
int i, rc;
|
||||||
|
|
||||||
REQUEST(xXIPassiveUngrabDeviceReq);
|
REQUEST_HEAD_AT_LEAST(xXIPassiveUngrabDeviceReq);
|
||||||
|
REQUEST_FIELD_CARD32(grab_window);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(detail);
|
||||||
|
REQUEST_FIELD_CARD16(num_modifiers);
|
||||||
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
|
REQUEST_FIXED_SIZE(xXIPassiveUngrabDeviceReq,
|
||||||
((uint32_t) stuff->num_modifiers) << 2);
|
((uint32_t) stuff->num_modifiers) << 2);
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
modifiers = (uint32_t *) &stuff[1];
|
||||||
|
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
|
||||||
|
swapl(modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
if (stuff->deviceid == XIAllDevices)
|
if (stuff->deviceid == XIAllDevices)
|
||||||
dev = inputInfo.all_devices;
|
dev = inputInfo.all_devices;
|
||||||
else if (stuff->deviceid == XIAllMasterDevices)
|
else if (stuff->deviceid == XIAllMasterDevices)
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,7 @@
|
||||||
#ifndef XIPASSIVEGRAB_H
|
#ifndef XIPASSIVEGRAB_H
|
||||||
#define XIPASSIVEGRAB_H 1
|
#define XIPASSIVEGRAB_H 1
|
||||||
|
|
||||||
int SProcXIPassiveUngrabDevice(ClientPtr client);
|
|
||||||
int ProcXIPassiveUngrabDevice(ClientPtr client);
|
int ProcXIPassiveUngrabDevice(ClientPtr client);
|
||||||
int ProcXIPassiveGrabDevice(ClientPtr client);
|
int ProcXIPassiveGrabDevice(ClientPtr client);
|
||||||
int SProcXIPassiveGrabDevice(ClientPtr client);
|
|
||||||
|
|
||||||
#endif /* XIPASSIVEGRAB_H */
|
#endif /* XIPASSIVEGRAB_H */
|
||||||
|
|
|
||||||
198
Xi/xiproperty.c
198
Xi/xiproperty.c
|
|
@ -35,6 +35,7 @@
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/extension_priv.h"
|
#include "dix/extension_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "dix.h"
|
#include "dix.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
@ -852,12 +853,10 @@ ProcXListDeviceProperties(ClientPtr client)
|
||||||
Atom *atoms;
|
Atom *atoms;
|
||||||
int natoms;
|
int natoms;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc = Success;
|
|
||||||
|
|
||||||
REQUEST(xListDevicePropertiesReq);
|
REQUEST_HEAD_STRUCT(xListDevicePropertiesReq);
|
||||||
REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess);
|
int rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
|
@ -866,37 +865,32 @@ ProcXListDeviceProperties(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
xListDevicePropertiesReply rep = {
|
xListDevicePropertiesReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_ListDeviceProperties,
|
.RepType = X_ListDeviceProperties,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = natoms,
|
.length = natoms,
|
||||||
.nAtoms = natoms
|
.nAtoms = natoms
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(nAtoms);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND();
|
||||||
swapl(&rep.length);
|
free(atoms);
|
||||||
swaps(&rep.nAtoms);
|
|
||||||
}
|
return Success;
|
||||||
WriteToClient(client, sizeof(xListDevicePropertiesReply), &rep);
|
|
||||||
if (natoms) {
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
|
||||||
WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
|
|
||||||
free(atoms);
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXChangeDeviceProperty(ClientPtr client)
|
ProcXChangeDeviceProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xChangeDevicePropertyReq);
|
REQUEST_HEAD_AT_LEAST(xChangeDevicePropertyReq);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
REQUEST_FIELD_CARD32(type);
|
||||||
|
REQUEST_FIELD_CARD32(nUnits);
|
||||||
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
uint64_t totalSize;
|
uint64_t totalSize;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
|
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
||||||
|
|
@ -923,11 +917,12 @@ ProcXChangeDeviceProperty(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXDeleteDeviceProperty(ClientPtr client)
|
ProcXDeleteDeviceProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xDeleteDevicePropertyReq);
|
REQUEST_HEAD_STRUCT(xDeleteDevicePropertyReq);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
|
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -945,14 +940,18 @@ ProcXDeleteDeviceProperty(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXGetDeviceProperty(ClientPtr client)
|
ProcXGetDeviceProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xGetDevicePropertyReq);
|
REQUEST_HEAD_STRUCT(xGetDevicePropertyReq);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
REQUEST_FIELD_CARD32(type);
|
||||||
|
REQUEST_FIELD_CARD32(longOffset);
|
||||||
|
REQUEST_FIELD_CARD32(longLength);
|
||||||
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int length;
|
int length;
|
||||||
int rc, format, nitems, bytes_after;
|
int rc, format, nitems, bytes_after;
|
||||||
char *data;
|
char *data;
|
||||||
Atom type;
|
Atom type;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
|
||||||
if (stuff->delete)
|
if (stuff->delete)
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client,
|
rc = dixLookupDevice(&dev, stuff->deviceid, client,
|
||||||
|
|
@ -968,9 +967,7 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
xGetDevicePropertyReply rep = {
|
xGetDevicePropertyReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_GetDeviceProperty,
|
.RepType = X_GetDeviceProperty,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(length),
|
.length = bytes_to_int32(length),
|
||||||
.propertyType = type,
|
.propertyType = type,
|
||||||
.bytesAfter = bytes_after,
|
.bytesAfter = bytes_after,
|
||||||
|
|
@ -982,14 +979,10 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
if (stuff->delete && (rep.bytesAfter == 0))
|
if (stuff->delete && (rep.bytesAfter == 0))
|
||||||
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(propertyType);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(bytesAfter);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(nItems);
|
||||||
swapl(&rep.propertyType);
|
REPLY_SEND();
|
||||||
swapl(&rep.bytesAfter);
|
|
||||||
swapl(&rep.nItems);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xGenericReply), &rep);
|
|
||||||
|
|
||||||
if (length) {
|
if (length) {
|
||||||
switch (rep.format) {
|
switch (rep.format) {
|
||||||
|
|
@ -1022,53 +1015,18 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXChangeDeviceProperty(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xChangeDevicePropertyReq);
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
|
|
||||||
swapl(&stuff->property);
|
|
||||||
swapl(&stuff->type);
|
|
||||||
swapl(&stuff->nUnits);
|
|
||||||
return (ProcXChangeDeviceProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXDeleteDeviceProperty(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xDeleteDevicePropertyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
|
|
||||||
|
|
||||||
swapl(&stuff->property);
|
|
||||||
return (ProcXDeleteDeviceProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXGetDeviceProperty(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xGetDevicePropertyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
|
|
||||||
|
|
||||||
swapl(&stuff->property);
|
|
||||||
swapl(&stuff->type);
|
|
||||||
swapl(&stuff->longOffset);
|
|
||||||
swapl(&stuff->longLength);
|
|
||||||
return (ProcXGetDeviceProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XI2 Request/reply handling */
|
/* XI2 Request/reply handling */
|
||||||
int
|
int
|
||||||
ProcXIListProperties(ClientPtr client)
|
ProcXIListProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXIListPropertiesReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
|
||||||
Atom *atoms;
|
Atom *atoms;
|
||||||
int natoms;
|
int natoms;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
|
|
||||||
REQUEST(xXIListPropertiesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixListPropAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -1078,19 +1036,14 @@ ProcXIListProperties(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
xXIListPropertiesReply rep = {
|
xXIListPropertiesReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIListProperties,
|
.RepType = X_XIListProperties,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = natoms,
|
.length = natoms,
|
||||||
.num_properties = natoms
|
.num_properties = natoms
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(num_properties);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND();
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.num_properties);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIListPropertiesReply), &rep);
|
|
||||||
if (natoms) {
|
if (natoms) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||||
WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
|
WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
|
||||||
|
|
@ -1102,13 +1055,17 @@ ProcXIListProperties(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXIChangeProperty(ClientPtr client)
|
ProcXIChangeProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_AT_LEAST(xXIChangePropertyReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
REQUEST_FIELD_CARD32(type);
|
||||||
|
REQUEST_FIELD_CARD32(num_items);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
uint64_t totalSize;
|
uint64_t totalSize;
|
||||||
unsigned long len;
|
unsigned long len;
|
||||||
|
|
||||||
REQUEST(xXIChangePropertyReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
|
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
||||||
|
|
@ -1135,12 +1092,13 @@ ProcXIChangeProperty(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXIDeleteProperty(ClientPtr client)
|
ProcXIDeleteProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXIDeletePropertyReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xXIDeletePropertyReq);
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
|
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetPropAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
@ -1158,14 +1116,20 @@ ProcXIDeleteProperty(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcXIGetProperty(ClientPtr client)
|
ProcXIGetProperty(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXIGetPropertyReq);
|
REQUEST_HEAD_STRUCT(xXIGetPropertyReq);
|
||||||
|
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(property);
|
||||||
|
REQUEST_FIELD_CARD32(type);
|
||||||
|
REQUEST_FIELD_CARD32(offset);
|
||||||
|
REQUEST_FIELD_CARD32(len);
|
||||||
|
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
int length;
|
int length;
|
||||||
int rc, format, nitems, bytes_after;
|
int rc, format, nitems, bytes_after;
|
||||||
char *data;
|
char *data;
|
||||||
Atom type;
|
Atom type;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
|
|
||||||
if (stuff->delete)
|
if (stuff->delete)
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client,
|
rc = dixLookupDevice(&dev, stuff->deviceid, client,
|
||||||
|
|
@ -1181,9 +1145,7 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
xXIGetPropertyReply rep = {
|
xXIGetPropertyReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIGetProperty,
|
.RepType = X_XIGetProperty,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = bytes_to_int32(length),
|
.length = bytes_to_int32(length),
|
||||||
.type = type,
|
.type = type,
|
||||||
.bytes_after = bytes_after,
|
.bytes_after = bytes_after,
|
||||||
|
|
@ -1194,14 +1156,10 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
if (length && stuff->delete && (rep.bytes_after == 0))
|
if (length && stuff->delete && (rep.bytes_after == 0))
|
||||||
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(type);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(bytes_after);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(num_items);
|
||||||
swapl(&rep.type);
|
REPLY_SEND();
|
||||||
swapl(&rep.bytes_after);
|
|
||||||
swapl(&rep.num_items);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIGetPropertyReply), &rep);
|
|
||||||
|
|
||||||
if (length) {
|
if (length) {
|
||||||
switch (rep.format) {
|
switch (rep.format) {
|
||||||
|
|
@ -1234,51 +1192,3 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIListProperties(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIListPropertiesReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIListPropertiesReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
return (ProcXIListProperties(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIChangeProperty(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIChangePropertyReq);
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->property);
|
|
||||||
swapl(&stuff->type);
|
|
||||||
swapl(&stuff->num_items);
|
|
||||||
return (ProcXIChangeProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIDeleteProperty(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIDeletePropertyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->property);
|
|
||||||
return (ProcXIDeleteProperty(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIGetProperty(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIGetPropertyReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIGetPropertyReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->property);
|
|
||||||
swapl(&stuff->type);
|
|
||||||
swapl(&stuff->offset);
|
|
||||||
swapl(&stuff->len);
|
|
||||||
return (ProcXIGetProperty(client));
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -35,22 +35,12 @@ int ProcXChangeDeviceProperty(ClientPtr client);
|
||||||
int ProcXDeleteDeviceProperty(ClientPtr client);
|
int ProcXDeleteDeviceProperty(ClientPtr client);
|
||||||
int ProcXGetDeviceProperty(ClientPtr client);
|
int ProcXGetDeviceProperty(ClientPtr client);
|
||||||
|
|
||||||
/* request swapping */
|
|
||||||
int SProcXChangeDeviceProperty(ClientPtr client);
|
|
||||||
int SProcXDeleteDeviceProperty(ClientPtr client);
|
|
||||||
int SProcXGetDeviceProperty(ClientPtr client);
|
|
||||||
|
|
||||||
/* XI2 request/reply handling */
|
/* XI2 request/reply handling */
|
||||||
int ProcXIListProperties(ClientPtr client);
|
int ProcXIListProperties(ClientPtr client);
|
||||||
int ProcXIChangeProperty(ClientPtr client);
|
int ProcXIChangeProperty(ClientPtr client);
|
||||||
int ProcXIDeleteProperty(ClientPtr client);
|
int ProcXIDeleteProperty(ClientPtr client);
|
||||||
int ProcXIGetProperty(ClientPtr client);
|
int ProcXIGetProperty(ClientPtr client);
|
||||||
|
|
||||||
int SProcXIListProperties(ClientPtr client);
|
|
||||||
int SProcXIChangeProperty(ClientPtr client);
|
|
||||||
int SProcXIDeleteProperty(ClientPtr client);
|
|
||||||
int SProcXIGetProperty(ClientPtr client);
|
|
||||||
|
|
||||||
void XIResetProperties(void);
|
void XIResetProperties(void);
|
||||||
|
|
||||||
#endif /* XIPROPERTY_H */
|
#endif /* XIPROPERTY_H */
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
@ -53,29 +54,19 @@ static int
|
||||||
ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info);
|
ListDeviceInfo(ClientPtr client, DeviceIntPtr dev, xXIDeviceInfo * info);
|
||||||
static int SizeDeviceInfo(DeviceIntPtr dev);
|
static int SizeDeviceInfo(DeviceIntPtr dev);
|
||||||
static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info);
|
static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo * info);
|
||||||
int _X_COLD
|
|
||||||
SProcXIQueryDevice(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIQueryDeviceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
|
|
||||||
return ProcXIQueryDevice(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIQueryDevice(ClientPtr client)
|
ProcXIQueryDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXIQueryDeviceReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev = NULL;
|
||||||
int rc = Success;
|
int rc = Success;
|
||||||
int i = 0, len = 0;
|
int i = 0, len = 0;
|
||||||
char *info, *ptr;
|
char *info, *ptr;
|
||||||
Bool *skip = NULL;
|
Bool *skip = NULL;
|
||||||
|
|
||||||
REQUEST(xXIQueryDeviceReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIQueryDeviceReq);
|
|
||||||
|
|
||||||
if (stuff->deviceid != XIAllDevices &&
|
if (stuff->deviceid != XIAllDevices &&
|
||||||
stuff->deviceid != XIAllMasterDevices) {
|
stuff->deviceid != XIAllMasterDevices) {
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
|
|
@ -110,13 +101,11 @@ ProcXIQueryDevice(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
xXIQueryDeviceReply rep = {
|
xXIQueryDeviceReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIQueryDevice,
|
.RepType = X_XIQueryDevice,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = len / 4,
|
|
||||||
.num_devices = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int buf_len = len;
|
||||||
|
|
||||||
ptr = info;
|
ptr = info;
|
||||||
if (dev) {
|
if (dev) {
|
||||||
len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info);
|
len = ListDeviceInfo(client, dev, (xXIDeviceInfo *) info);
|
||||||
|
|
@ -148,15 +137,9 @@ ProcXIQueryDevice(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
len = rep.length * 4;
|
REPLY_FIELD_CARD16(num_devices);
|
||||||
|
REPLY_SEND_EXTRA(ptr, buf_len);
|
||||||
|
|
||||||
if (client->swapped) {
|
|
||||||
swaps(&rep.sequenceNumber);
|
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.num_devices);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIQueryDeviceReply), &rep);
|
|
||||||
WriteToClient(client, len, ptr);
|
|
||||||
free(ptr);
|
free(ptr);
|
||||||
free(skip);
|
free(skip);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
#include <X11/extensions/XI2proto.h>
|
#include <X11/extensions/XI2proto.h>
|
||||||
|
|
||||||
int SProcXIQueryDevice(ClientPtr client);
|
|
||||||
int ProcXIQueryDevice(ClientPtr client);
|
int ProcXIQueryDevice(ClientPtr client);
|
||||||
int SizeDeviceClasses(DeviceIntPtr dev);
|
int SizeDeviceClasses(DeviceIntPtr dev);
|
||||||
int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
|
int ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
#include "dix/eventconvert.h"
|
#include "dix/eventconvert.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
#include "Xext/panoramiXsrv.h"
|
#include "Xext/panoramiXsrv.h"
|
||||||
|
|
||||||
|
|
@ -59,20 +60,13 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIQueryPointer(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIQueryPointerReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
|
|
||||||
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
swapl(&stuff->win);
|
|
||||||
return (ProcXIQueryPointer(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIQueryPointer(ClientPtr client)
|
ProcXIQueryPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXIQueryPointerReq);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
REQUEST_FIELD_CARD32(win);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
DeviceIntPtr pDev, kbd;
|
DeviceIntPtr pDev, kbd;
|
||||||
WindowPtr pWin, t;
|
WindowPtr pWin, t;
|
||||||
|
|
@ -83,9 +77,6 @@ ProcXIQueryPointer(ClientPtr client)
|
||||||
XIClientPtr xi_client;
|
XIClientPtr xi_client;
|
||||||
Bool have_xi22 = FALSE;
|
Bool have_xi22 = FALSE;
|
||||||
|
|
||||||
REQUEST(xXIQueryPointerReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIQueryPointerReq);
|
|
||||||
|
|
||||||
/* Check if client is compliant with XInput 2.2 or later. Earlier clients
|
/* Check if client is compliant with XInput 2.2 or later. Earlier clients
|
||||||
* do not know about touches, so we must report emulated button presses. 2.2
|
* do not know about touches, so we must report emulated button presses. 2.2
|
||||||
* and later clients are aware of touches, so we don't include emulated
|
* and later clients are aware of touches, so we don't include emulated
|
||||||
|
|
@ -124,9 +115,7 @@ ProcXIQueryPointer(ClientPtr client)
|
||||||
pSprite = pDev->spriteInfo->sprite;
|
pSprite = pDev->spriteInfo->sprite;
|
||||||
|
|
||||||
xXIQueryPointerReply rep = {
|
xXIQueryPointerReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIQueryPointer,
|
.RepType = X_XIQueryPointer,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 6,
|
.length = 6,
|
||||||
.root = (InputDevCurrentRootWindow(pDev))->drawable.id,
|
.root = (InputDevCurrentRootWindow(pDev))->drawable.id,
|
||||||
.root_x = double_to_fp1616(pSprite->hot.x),
|
.root_x = double_to_fp1616(pSprite->hot.x),
|
||||||
|
|
@ -192,19 +181,14 @@ ProcXIQueryPointer(ClientPtr client)
|
||||||
}
|
}
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD32(root);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD32(child);
|
||||||
swapl(&rep.length);
|
REPLY_FIELD_CARD32(root_x);
|
||||||
swapl(&rep.root);
|
REPLY_FIELD_CARD32(root_y);
|
||||||
swapl(&rep.child);
|
REPLY_FIELD_CARD32(win_x);
|
||||||
swapl(&rep.root_x);
|
REPLY_FIELD_CARD32(win_y);
|
||||||
swapl(&rep.root_y);
|
REPLY_FIELD_CARD16(buttons_len);
|
||||||
swapl(&rep.win_x);
|
REPLY_SEND_EXTRA(buttons, buttons_size);
|
||||||
swapl(&rep.win_y);
|
|
||||||
swaps(&rep.buttons_len);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIQueryPointerReply), &rep);
|
|
||||||
WriteToClient(client, buttons_size, buttons);
|
|
||||||
|
|
||||||
free(buttons);
|
free(buttons);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
#ifndef QUERYDP_H
|
#ifndef QUERYDP_H
|
||||||
#define QUERYDP_H 1
|
#define QUERYDP_H 1
|
||||||
|
|
||||||
int SProcXIQueryPointer(ClientPtr /* client */ );
|
|
||||||
int ProcXIQueryPointer(ClientPtr /* client */ );
|
int ProcXIQueryPointer(ClientPtr /* client */ );
|
||||||
|
|
||||||
#endif /* QUERYDP_H */
|
#endif /* QUERYDP_H */
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@
|
||||||
#include <X11/extensions/XI2proto.h>
|
#include <X11/extensions/XI2proto.h>
|
||||||
|
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "os/fmt.h"
|
#include "os/fmt.h"
|
||||||
|
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
@ -54,12 +55,13 @@ extern XExtensionVersion XIVersion; /* defined in getvers.c */
|
||||||
int
|
int
|
||||||
ProcXIQueryVersion(ClientPtr client)
|
ProcXIQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_AT_LEAST(xXIQueryVersionReq);
|
||||||
|
REQUEST_FIELD_CARD16(major_version);
|
||||||
|
REQUEST_FIELD_CARD16(minor_version);
|
||||||
|
|
||||||
XIClientPtr pXIClient;
|
XIClientPtr pXIClient;
|
||||||
int major, minor;
|
int major, minor;
|
||||||
|
|
||||||
REQUEST(xXIQueryVersionReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIQueryVersionReq);
|
|
||||||
|
|
||||||
/* This request only exists after XI2 */
|
/* This request only exists after XI2 */
|
||||||
if (stuff->major_version < 2) {
|
if (stuff->major_version < 2) {
|
||||||
client->errorValue = stuff->major_version;
|
client->errorValue = stuff->major_version;
|
||||||
|
|
@ -113,31 +115,12 @@ ProcXIQueryVersion(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
xXIQueryVersionReply rep = {
|
xXIQueryVersionReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIQueryVersion,
|
.RepType = X_XIQueryVersion,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.major_version = major,
|
.major_version = major,
|
||||||
.minor_version = minor
|
.minor_version = minor
|
||||||
};
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(major_version);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_FIELD_CARD16(minor_version);
|
||||||
swaps(&rep.major_version);
|
|
||||||
swaps(&rep.minor_version);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIQueryVersionReply), &rep);
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swapping routines */
|
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIQueryVersion(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIQueryVersionReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
|
|
||||||
swaps(&stuff->major_version);
|
|
||||||
swaps(&stuff->minor_version);
|
|
||||||
return (ProcXIQueryVersion(client));
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@
|
||||||
#ifndef QUERYVERSION_H
|
#ifndef QUERYVERSION_H
|
||||||
#define QUERYVERSION_H 1
|
#define QUERYVERSION_H 1
|
||||||
|
|
||||||
int SProcXIQueryVersion(ClientPtr client);
|
|
||||||
int ProcXIQueryVersion(ClientPtr client);
|
int ProcXIQueryVersion(ClientPtr client);
|
||||||
|
|
||||||
#endif /* QUERYVERSION_H */
|
#endif /* QUERYVERSION_H */
|
||||||
|
|
|
||||||
109
Xi/xiselectev.c
109
Xi/xiselectev.c
|
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/exevents_priv.h"
|
#include "dix/exevents_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
#include "dix/resource_priv.h"
|
#include "dix/resource_priv.h"
|
||||||
|
|
||||||
#include "dixstruct.h"
|
#include "dixstruct.h"
|
||||||
|
|
@ -113,39 +114,36 @@ XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXISelectEvents(ClientPtr client)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int len;
|
|
||||||
xXIEventMask *evmask;
|
|
||||||
|
|
||||||
REQUEST(xXISelectEventsReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
|
|
||||||
swapl(&stuff->win);
|
|
||||||
swaps(&stuff->num_masks);
|
|
||||||
|
|
||||||
len = client->req_len - bytes_to_int32(sizeof(xXISelectEventsReq));
|
|
||||||
evmask = (xXIEventMask *) &stuff[1];
|
|
||||||
for (i = 0; i < stuff->num_masks; i++) {
|
|
||||||
if (len < bytes_to_int32(sizeof(xXIEventMask)))
|
|
||||||
return BadLength;
|
|
||||||
len -= bytes_to_int32(sizeof(xXIEventMask));
|
|
||||||
swaps(&evmask->deviceid);
|
|
||||||
swaps(&evmask->mask_len);
|
|
||||||
if (len < evmask->mask_len)
|
|
||||||
return BadLength;
|
|
||||||
len -= evmask->mask_len;
|
|
||||||
evmask =
|
|
||||||
(xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (ProcXISelectEvents(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXISelectEvents(ClientPtr client)
|
ProcXISelectEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_AT_LEAST(xXISelectEventsReq);
|
||||||
|
REQUEST_FIELD_CARD32(win);
|
||||||
|
REQUEST_FIELD_CARD16(num_masks);
|
||||||
|
|
||||||
|
if (stuff->num_masks == 0)
|
||||||
|
return BadValue;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
int i;
|
||||||
|
int len;
|
||||||
|
xXIEventMask *evmask;
|
||||||
|
|
||||||
|
len = stuff->length - bytes_to_int32(sizeof(xXISelectEventsReq));
|
||||||
|
evmask = (xXIEventMask *) &stuff[1];
|
||||||
|
for (i = 0; i < stuff->num_masks; i++) {
|
||||||
|
if (len < bytes_to_int32(sizeof(xXIEventMask)))
|
||||||
|
return BadLength;
|
||||||
|
len -= bytes_to_int32(sizeof(xXIEventMask));
|
||||||
|
CLIENT_STRUCT_CARD16_2(evmask, deviceid, mask_len);
|
||||||
|
if (len < evmask->mask_len)
|
||||||
|
return BadLength;
|
||||||
|
len -= evmask->mask_len;
|
||||||
|
evmask =
|
||||||
|
(xXIEventMask *) (((char *) &evmask[1]) + evmask->mask_len * 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int rc, num_masks;
|
int rc, num_masks;
|
||||||
WindowPtr win;
|
WindowPtr win;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
@ -154,12 +152,6 @@ ProcXISelectEvents(ClientPtr client)
|
||||||
int *types = NULL;
|
int *types = NULL;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
REQUEST(xXISelectEventsReq);
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
|
|
||||||
|
|
||||||
if (stuff->num_masks == 0)
|
|
||||||
return BadValue;
|
|
||||||
|
|
||||||
rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
|
rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
@ -327,40 +319,25 @@ ProcXISelectEvents(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXIGetSelectedEvents(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXIGetSelectedEventsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
|
|
||||||
swapl(&stuff->win);
|
|
||||||
|
|
||||||
return (ProcXIGetSelectedEvents(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXIGetSelectedEvents(ClientPtr client)
|
ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXIGetSelectedEventsReq);
|
||||||
|
REQUEST_FIELD_CARD32(win);
|
||||||
|
|
||||||
int rc, i;
|
int rc, i;
|
||||||
WindowPtr win;
|
WindowPtr win;
|
||||||
char *buffer = NULL;
|
|
||||||
OtherInputMasks *masks;
|
OtherInputMasks *masks;
|
||||||
InputClientsPtr others = NULL;
|
InputClientsPtr others = NULL;
|
||||||
xXIEventMask *evmask = NULL;
|
xXIEventMask *evmask = NULL;
|
||||||
DeviceIntPtr dev;
|
DeviceIntPtr dev;
|
||||||
|
|
||||||
REQUEST(xXIGetSelectedEventsReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
|
|
||||||
|
|
||||||
rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
xXIGetSelectedEventsReply rep = {
|
xXIGetSelectedEventsReply rep = {
|
||||||
.repType = X_Reply,
|
|
||||||
.RepType = X_XIGetSelectedEvents,
|
.RepType = X_XIGetSelectedEvents,
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.num_masks = 0
|
|
||||||
};
|
};
|
||||||
|
|
||||||
masks = wOtherInputMasks(win);
|
masks = wOtherInputMasks(win);
|
||||||
|
|
@ -376,10 +353,8 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
if (!others)
|
if (!others)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
buffer =
|
char buffer[MAXDEVICES * (sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE))];
|
||||||
calloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE));
|
memset(buffer, 0, sizeof(buffer));
|
||||||
if (!buffer)
|
|
||||||
return BadAlloc;
|
|
||||||
|
|
||||||
evmask = (xXIEventMask *) buffer;
|
evmask = (xXIEventMask *) buffer;
|
||||||
for (i = 0; i < MAXDEVICES; i++) {
|
for (i = 0; i < MAXDEVICES; i++) {
|
||||||
|
|
@ -399,12 +374,9 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
evmask->deviceid = i;
|
evmask->deviceid = i;
|
||||||
evmask->mask_len = mask_len;
|
evmask->mask_len = mask_len;
|
||||||
rep.num_masks++;
|
rep.num_masks++;
|
||||||
rep.length += sizeof(xXIEventMask) / 4 + evmask->mask_len;
|
length += sizeof(xXIEventMask) + mask_len * 4;
|
||||||
|
|
||||||
if (client->swapped) {
|
CLIENT_STRUCT_CARD16_2(evmask, deviceid, mask_len);
|
||||||
swaps(&evmask->deviceid);
|
|
||||||
swaps(&evmask->mask_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(&evmask[1], devmask, j + 1);
|
memcpy(&evmask[1], devmask, j + 1);
|
||||||
evmask = (xXIEventMask *) ((char *) evmask +
|
evmask = (xXIEventMask *) ((char *) evmask +
|
||||||
|
|
@ -417,14 +389,7 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
finish: ;
|
finish: ;
|
||||||
uint32_t length = rep.length; /* save before swapping it */
|
uint32_t length = rep.length; /* save before swapping it */
|
||||||
|
|
||||||
if (client->swapped) {
|
REPLY_FIELD_CARD16(num_masks);
|
||||||
swaps(&rep.sequenceNumber);
|
REPLY_SEND_EXTRA(buffer, length);
|
||||||
swapl(&rep.length);
|
|
||||||
swaps(&rep.num_masks);
|
|
||||||
}
|
|
||||||
WriteToClient(client, sizeof(xXIGetSelectedEventsReply), &rep);
|
|
||||||
WriteToClient(client, length * 4, buffer);
|
|
||||||
|
|
||||||
free(buffer);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,7 @@
|
||||||
#ifndef XISELECTEVENTS_H
|
#ifndef XISELECTEVENTS_H
|
||||||
#define XISELECTEVENTS_H 1
|
#define XISELECTEVENTS_H 1
|
||||||
|
|
||||||
int SProcXISelectEvents(ClientPtr client);
|
|
||||||
int ProcXISelectEvents(ClientPtr client);
|
int ProcXISelectEvents(ClientPtr client);
|
||||||
int SProcXIGetSelectedEvents(ClientPtr client);
|
|
||||||
int ProcXIGetSelectedEvents(ClientPtr client);
|
int ProcXIGetSelectedEvents(ClientPtr client);
|
||||||
|
|
||||||
#endif /* _XISELECTEVENTS_H_ */
|
#endif /* _XISELECTEVENTS_H_ */
|
||||||
|
|
|
||||||
|
|
@ -34,40 +34,32 @@
|
||||||
|
|
||||||
#include <X11/X.h> /* for inputstr.h */
|
#include <X11/X.h> /* for inputstr.h */
|
||||||
#include <X11/Xproto.h> /* Request macro */
|
#include <X11/Xproto.h> /* Request macro */
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
#include <X11/extensions/XI2proto.h>
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/request_priv.h"
|
||||||
|
|
||||||
#include "inputstr.h" /* DeviceIntPtr */
|
#include "inputstr.h" /* DeviceIntPtr */
|
||||||
#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/XI2proto.h>
|
|
||||||
#include "extnsionst.h"
|
#include "extnsionst.h"
|
||||||
#include "exevents.h"
|
#include "exevents.h"
|
||||||
#include "exglobals.h"
|
#include "exglobals.h"
|
||||||
#include "xisetclientpointer.h"
|
#include "xisetclientpointer.h"
|
||||||
|
|
||||||
int _X_COLD
|
|
||||||
SProcXISetClientPointer(ClientPtr client)
|
|
||||||
{
|
|
||||||
REQUEST(xXISetClientPointerReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
|
||||||
|
|
||||||
swapl(&stuff->win);
|
|
||||||
swaps(&stuff->deviceid);
|
|
||||||
return (ProcXISetClientPointer(client));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcXISetClientPointer(ClientPtr client)
|
ProcXISetClientPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
REQUEST_HEAD_STRUCT(xXISetClientPointerReq);
|
||||||
|
|
||||||
|
REQUEST_FIELD_CARD32(win);
|
||||||
|
REQUEST_FIELD_CARD16(deviceid);
|
||||||
|
|
||||||
DeviceIntPtr pDev;
|
DeviceIntPtr pDev;
|
||||||
ClientPtr targetClient;
|
ClientPtr targetClient;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xXISetClientPointerReq);
|
|
||||||
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess);
|
rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
client->errorValue = stuff->deviceid;
|
client->errorValue = stuff->deviceid;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue