Compare commits
42 Commits
master
...
submit/dix
Author | SHA1 | Date | |
---|---|---|---|
|
a5074bb749 | ||
|
900957760e | ||
|
0f03b898e1 | ||
|
50e2471ff8 | ||
|
54e9dcd06f | ||
|
d64ab27110 | ||
|
9fa0cf3c60 | ||
|
a492ebcb4c | ||
|
d15ea92195 | ||
|
12d32f26e2 | ||
|
9c234253a4 | ||
|
2910e83693 | ||
|
cc2c43c211 | ||
|
688e7abac4 | ||
|
c8b8d31d6a | ||
|
ef35352e2b | ||
|
be5d4a26b0 | ||
|
95a86127e9 | ||
|
d0525f1562 | ||
|
a1cc55453b | ||
|
9f7b63df14 | ||
|
3c6a5956b2 | ||
|
7b28994eb5 | ||
|
46325ef467 | ||
|
6a828150b5 | ||
|
c90b951d71 | ||
|
ec8948dd1d | ||
|
3d343498c2 | ||
|
67e784cb30 | ||
|
6c1a24c7cc | ||
|
a39d9e984c | ||
|
7bf52a5510 | ||
|
3f4b59f5b5 | ||
|
e1db3b431e | ||
|
95878b2dd3 | ||
|
d9b9906c45 | ||
|
4664c1a6f8 | ||
|
5620ee1752 | ||
|
b3db55be06 | ||
|
3cab73e790 | ||
|
345daa5830 | ||
|
31207481e2 |
|
@ -557,7 +557,6 @@ PanoramiXCirculateWindow(ClientPtr client)
|
||||||
int
|
int
|
||||||
PanoramiXGetGeometry(ClientPtr client)
|
PanoramiXGetGeometry(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetGeometryReply rep;
|
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -568,7 +567,7 @@ PanoramiXGetGeometry(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGetGeometryReply) {
|
xGetGeometryReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -602,7 +601,16 @@ PanoramiXGetGeometry(ClientPtr client)
|
||||||
rep.borderWidth = pWin->borderWidth;
|
rep.borderWidth = pWin->borderWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.root);
|
||||||
|
swaps(&rep.x);
|
||||||
|
swaps(&rep.y);
|
||||||
|
swaps(&rep.width);
|
||||||
|
swaps(&rep.height);
|
||||||
|
swaps(&rep.borderWidth);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,7 +622,6 @@ PanoramiXTranslateCoords(ClientPtr client)
|
||||||
REQUEST(xTranslateCoordsReq);
|
REQUEST(xTranslateCoordsReq);
|
||||||
int rc;
|
int rc;
|
||||||
WindowPtr pWin, pDst;
|
WindowPtr pWin, pDst;
|
||||||
xTranslateCoordsReply rep;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
||||||
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
|
rc = dixLookupWindow(&pWin, stuff->srcWid, client, DixReadAccess);
|
||||||
|
@ -623,7 +630,8 @@ PanoramiXTranslateCoords(ClientPtr client)
|
||||||
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
|
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rep = (xTranslateCoordsReply) {
|
|
||||||
|
xTranslateCoordsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -674,7 +682,13 @@ PanoramiXTranslateCoords(ClientPtr client)
|
||||||
rep.dstY += screenInfo.screens[0]->y;
|
rep.dstY += screenInfo.screens[0]->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.child);
|
||||||
|
swaps(&rep.dstX);
|
||||||
|
swaps(&rep.dstY);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1946,7 +1960,6 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
DrawablePtr drawables[MAXSCREENS];
|
DrawablePtr drawables[MAXSCREENS];
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
PanoramiXRes *draw;
|
PanoramiXRes *draw;
|
||||||
xGetImageReply xgi;
|
|
||||||
Bool isRoot;
|
Bool isRoot;
|
||||||
char *pBuf;
|
char *pBuf;
|
||||||
int i, x, y, w, h, format, rc;
|
int i, x, y, w, h, format, rc;
|
||||||
|
@ -2020,12 +2033,7 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
IncludeInferiors);
|
IncludeInferiors);
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi = (xGetImageReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.visual = wVisual(((WindowPtr) pDraw)),
|
|
||||||
.depth = pDraw->depth
|
|
||||||
};
|
|
||||||
if (format == ZPixmap) {
|
if (format == ZPixmap) {
|
||||||
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
||||||
length = widthBytesLine * h;
|
length = widthBytesLine * h;
|
||||||
|
@ -2039,7 +2047,13 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi.length = bytes_to_int32(length);
|
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;
|
||||||
|
@ -2053,7 +2067,12 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
if (!(pBuf = xallocarray(linesPerBuf, widthBytesLine)))
|
if (!(pBuf = xallocarray(linesPerBuf, widthBytesLine)))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.visual);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
|
||||||
if (linesPerBuf == 0) {
|
if (linesPerBuf == 0) {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
|
|
163
dix/devices.c
163
dix/devices.c
|
@ -1770,7 +1770,6 @@ BadDeviceMap(BYTE * buff, int length, unsigned low, unsigned high, XID *errval)
|
||||||
int
|
int
|
||||||
ProcSetModifierMapping(ClientPtr client)
|
ProcSetModifierMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
xSetModifierMappingReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST(xSetModifierMappingReq);
|
REQUEST(xSetModifierMappingReq);
|
||||||
|
@ -1780,11 +1779,6 @@ ProcSetModifierMapping(ClientPtr client)
|
||||||
bytes_to_int32(sizeof(xSetModifierMappingReq))))
|
bytes_to_int32(sizeof(xSetModifierMappingReq))))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep = (xSetModifierMappingReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
|
rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1],
|
||||||
stuff->numKeyPerModifier);
|
stuff->numKeyPerModifier);
|
||||||
|
@ -1793,16 +1787,23 @@ ProcSetModifierMapping(ClientPtr client)
|
||||||
if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
|
if (rc != MappingSuccess && rc != MappingFailed && rc != MappingBusy)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.success = rc;
|
xSetModifierMappingReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.success = rc,
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xSetModifierMappingReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcGetModifierMapping(ClientPtr client)
|
ProcGetModifierMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetModifierMappingReply rep;
|
|
||||||
int max_keys_per_mod = 0;
|
int max_keys_per_mod = 0;
|
||||||
KeyCode *modkeymap = NULL;
|
KeyCode *modkeymap = NULL;
|
||||||
|
|
||||||
|
@ -1811,7 +1812,7 @@ ProcGetModifierMapping(ClientPtr client)
|
||||||
generate_modkeymap(client, PickKeyboard(client), &modkeymap,
|
generate_modkeymap(client, PickKeyboard(client), &modkeymap,
|
||||||
&max_keys_per_mod);
|
&max_keys_per_mod);
|
||||||
|
|
||||||
rep = (xGetModifierMappingReply) {
|
xGetModifierMappingReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.numKeyPerModifier = max_keys_per_mod,
|
.numKeyPerModifier = max_keys_per_mod,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -1819,7 +1820,12 @@ ProcGetModifierMapping(ClientPtr client)
|
||||||
.length = max_keys_per_mod << 1
|
.length = max_keys_per_mod << 1
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
|
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
|
||||||
|
|
||||||
free(modkeymap);
|
free(modkeymap);
|
||||||
|
@ -1893,7 +1899,6 @@ ProcSetPointerMapping(ClientPtr client)
|
||||||
int ret;
|
int ret;
|
||||||
int i, j;
|
int i, j;
|
||||||
DeviceIntPtr ptr = PickPointer(client);
|
DeviceIntPtr ptr = PickPointer(client);
|
||||||
xSetPointerMappingReply rep;
|
|
||||||
|
|
||||||
REQUEST(xSetPointerMappingReq);
|
REQUEST(xSetPointerMappingReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
|
REQUEST_AT_LEAST_SIZE(xSetPointerMappingReq);
|
||||||
|
@ -1902,12 +1907,6 @@ ProcSetPointerMapping(ClientPtr client)
|
||||||
bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts))
|
bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep = (xSetPointerMappingReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.success = MappingSuccess,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0
|
|
||||||
};
|
|
||||||
map = (BYTE *) &stuff[1];
|
map = (BYTE *) &stuff[1];
|
||||||
|
|
||||||
/* So we're bounded here by the number of core buttons. This check
|
/* So we're bounded here by the number of core buttons. This check
|
||||||
|
@ -1933,21 +1932,30 @@ ProcSetPointerMapping(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = ApplyPointerMapping(ptr, map, stuff->nElts, client);
|
ret = ApplyPointerMapping(ptr, map, stuff->nElts, client);
|
||||||
if (ret == MappingBusy)
|
|
||||||
rep.success = ret;
|
if (ret == -1)
|
||||||
else if (ret == -1)
|
|
||||||
return BadValue;
|
return BadValue;
|
||||||
else if (ret != Success)
|
if (ret != Success && ret != MappingBusy)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xSetPointerMappingReply), &rep);
|
xSetPointerMappingReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.success = MappingSuccess,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.success = ret,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcGetKeyboardMapping(ClientPtr client)
|
ProcGetKeyboardMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetKeyboardMappingReply rep;
|
|
||||||
DeviceIntPtr kbd = PickKeyboard(client);
|
DeviceIntPtr kbd = PickKeyboard(client);
|
||||||
XkbDescPtr xkb;
|
XkbDescPtr xkb;
|
||||||
KeySymsPtr syms;
|
KeySymsPtr syms;
|
||||||
|
@ -1976,21 +1984,36 @@ ProcGetKeyboardMapping(ClientPtr client)
|
||||||
if (!syms)
|
if (!syms)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
rep = (xGetKeyboardMappingReply) {
|
const int count = syms->mapWidth * stuff->count;
|
||||||
|
const int size = count * sizeof(KeySym);
|
||||||
|
void *payload = calloc(count, sizeof(KeySym));
|
||||||
|
if (!payload)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
|
memcpy(payload,
|
||||||
|
&syms->map[syms->mapWidth * (stuff->firstKeyCode - syms->minKeyCode)],
|
||||||
|
size);
|
||||||
|
|
||||||
|
xGetKeyboardMappingReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.keySymsPerKeyCode = syms->mapWidth,
|
.keySymsPerKeyCode = syms->mapWidth,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
/* length is a count of 4 byte quantities and KeySyms are 4 bytes */
|
/* length is a count of 4 byte quantities and KeySyms are 4 bytes */
|
||||||
.length = syms->mapWidth * stuff->count
|
.length = count
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGetKeyboardMappingReply), &rep);
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
if (client->swapped) {
|
||||||
WriteSwappedDataToClient(client,
|
swaps(&rep.sequenceNumber);
|
||||||
syms->mapWidth * stuff->count * sizeof(KeySym),
|
swapl(&rep.length);
|
||||||
&syms->map[syms->mapWidth * (stuff->firstKeyCode -
|
SwapLongs(payload, count);
|
||||||
syms->minKeyCode)]);
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, size, payload);
|
||||||
|
|
||||||
free(syms->map);
|
free(syms->map);
|
||||||
free(syms);
|
free(syms);
|
||||||
|
free(payload);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1998,7 +2021,6 @@ ProcGetKeyboardMapping(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcGetPointerMapping(ClientPtr client)
|
ProcGetPointerMapping(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetPointerMappingReply rep;
|
|
||||||
|
|
||||||
/* Apps may get different values each time they call GetPointerMapping as
|
/* Apps may get different values each time they call GetPointerMapping as
|
||||||
* the ClientPointer could change. */
|
* the ClientPointer could change. */
|
||||||
|
@ -2014,14 +2036,20 @@ ProcGetPointerMapping(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
nElts = (butc) ? butc->numButtons : 0;
|
nElts = (butc) ? butc->numButtons : 0;
|
||||||
rep = (xGetPointerMappingReply) {
|
|
||||||
|
xGetPointerMappingReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.nElts = nElts,
|
.nElts = nElts,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = ((unsigned) nElts + (4 - 1)) / 4
|
.length = ((unsigned) nElts + (4 - 1)) / 4
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep);
|
|
||||||
if (butc)
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
WriteToClient(client, nElts, &butc->map[1]);
|
WriteToClient(client, nElts, &butc->map[1]);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -2247,18 +2275,16 @@ ProcChangeKeyboardControl(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcGetKeyboardControl(ClientPtr client)
|
ProcGetKeyboardControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc, i;
|
|
||||||
DeviceIntPtr kbd = PickKeyboard(client);
|
DeviceIntPtr kbd = PickKeyboard(client);
|
||||||
KeybdCtrl *ctrl = &kbd->kbdfeed->ctrl;
|
KeybdCtrl *ctrl = &kbd->kbdfeed->ctrl;
|
||||||
xGetKeyboardControlReply rep;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xReq);
|
REQUEST_SIZE_MATCH(xReq);
|
||||||
|
|
||||||
rc = XaceHookDeviceAccess(client, kbd, DixGetAttrAccess);
|
int rc = XaceHookDeviceAccess(client, kbd, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGetKeyboardControlReply) {
|
xGetKeyboardControlReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.globalAutoRepeat = ctrl->autoRepeat,
|
.globalAutoRepeat = ctrl->autoRepeat,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -2269,9 +2295,17 @@ ProcGetKeyboardControl(ClientPtr client)
|
||||||
.bellPitch = ctrl->bell_pitch,
|
.bellPitch = ctrl->bell_pitch,
|
||||||
.bellDuration = ctrl->bell_duration
|
.bellDuration = ctrl->bell_duration
|
||||||
};
|
};
|
||||||
for (i = 0; i < 32; i++)
|
for (int i = 0; i < 32; i++)
|
||||||
rep.map[i] = ctrl->autoRepeats[i];
|
rep.map[i] = ctrl->autoRepeats[i];
|
||||||
WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.ledMask);
|
||||||
|
swaps(&rep.bellPitch);
|
||||||
|
swaps(&rep.bellDuration);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2397,7 +2431,6 @@ ProcGetPointerControl(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr ptr = PickPointer(client);
|
DeviceIntPtr ptr = PickPointer(client);
|
||||||
PtrCtrl *ctrl;
|
PtrCtrl *ctrl;
|
||||||
xGetPointerControlReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (ptr->ptrfeed)
|
if (ptr->ptrfeed)
|
||||||
|
@ -2411,7 +2444,7 @@ ProcGetPointerControl(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGetPointerControlReply) {
|
xGetPointerControlReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -2419,7 +2452,14 @@ ProcGetPointerControl(ClientPtr client)
|
||||||
.accelDenominator = ctrl->den,
|
.accelDenominator = ctrl->den,
|
||||||
.threshold = ctrl->threshold
|
.threshold = ctrl->threshold
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGenericReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.accelNumerator);
|
||||||
|
swaps(&rep.accelDenominator);
|
||||||
|
swaps(&rep.threshold);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2444,7 +2484,6 @@ ProcGetMotionEvents(ClientPtr client)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xTimecoord *coords = (xTimecoord *) NULL;
|
xTimecoord *coords = (xTimecoord *) NULL;
|
||||||
xGetMotionEventsReply rep;
|
|
||||||
int i, count, xmin, xmax, ymin, ymax, rc;
|
int i, count, xmin, xmax, ymin, ymax, rc;
|
||||||
unsigned long nEvents;
|
unsigned long nEvents;
|
||||||
DeviceIntPtr mouse = PickPointer(client);
|
DeviceIntPtr mouse = PickPointer(client);
|
||||||
|
@ -2463,10 +2502,7 @@ ProcGetMotionEvents(ClientPtr client)
|
||||||
UpdateCurrentTimeIf();
|
UpdateCurrentTimeIf();
|
||||||
if (mouse->valuator->motionHintWindow)
|
if (mouse->valuator->motionHintWindow)
|
||||||
MaybeStopHint(mouse, client);
|
MaybeStopHint(mouse, client);
|
||||||
rep = (xGetMotionEventsReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence
|
|
||||||
};
|
|
||||||
nEvents = 0;
|
nEvents = 0;
|
||||||
start = ClientTimeToServerTime(stuff->start);
|
start = ClientTimeToServerTime(stuff->start);
|
||||||
stop = ClientTimeToServerTime(stuff->stop);
|
stop = ClientTimeToServerTime(stuff->stop);
|
||||||
|
@ -2493,9 +2529,20 @@ ProcGetMotionEvents(ClientPtr client)
|
||||||
nEvents++;
|
nEvents++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.length = nEvents * bytes_to_int32(sizeof(xTimecoord));
|
|
||||||
rep.nEvents = nEvents;
|
xGetMotionEventsReply rep = {
|
||||||
WriteReplyToClient(client, sizeof(xGetMotionEventsReply), &rep);
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = nEvents * bytes_to_int32(sizeof(xTimecoord)),
|
||||||
|
.nEvents = nEvents,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.nEvents);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(xGetMotionEventsReply), &rep);
|
||||||
if (nEvents) {
|
if (nEvents) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) SwapTimeCoordWrite;
|
client->pSwapReplyFunc = (ReplySwapPtr) SwapTimeCoordWrite;
|
||||||
WriteSwappedDataToClient(client, nEvents * sizeof(xTimecoord),
|
WriteSwappedDataToClient(client, nEvents * sizeof(xTimecoord),
|
||||||
|
@ -2508,13 +2555,13 @@ ProcGetMotionEvents(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcQueryKeymap(ClientPtr client)
|
ProcQueryKeymap(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryKeymapReply rep;
|
|
||||||
int rc, i;
|
int rc, i;
|
||||||
DeviceIntPtr keybd = PickKeyboard(client);
|
DeviceIntPtr keybd = PickKeyboard(client);
|
||||||
CARD8 *down = keybd->key->down;
|
CARD8 *down = keybd->key->down;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xReq);
|
REQUEST_SIZE_MATCH(xReq);
|
||||||
rep = (xQueryKeymapReply) {
|
|
||||||
|
xQueryKeymapReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 2
|
.length = 2
|
||||||
|
@ -2531,7 +2578,11 @@ ProcQueryKeymap(ClientPtr client)
|
||||||
else if (rc != BadAccess)
|
else if (rc != BadAccess)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
459
dix/dispatch.c
459
dix/dispatch.c
|
@ -803,25 +803,6 @@ ProcChangeWindowAttributes(ClientPtr client)
|
||||||
stuff->valueMask, (XID *) &stuff[1], client);
|
stuff->valueMask, (XID *) &stuff[1], client);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
ProcGetWindowAttributes(ClientPtr client)
|
|
||||||
{
|
|
||||||
WindowPtr pWin;
|
|
||||||
|
|
||||||
REQUEST(xResourceReq);
|
|
||||||
xGetWindowAttributesReply wa;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
|
|
||||||
if (rc != Success)
|
|
||||||
return rc;
|
|
||||||
memset(&wa, 0, sizeof(xGetWindowAttributesReply));
|
|
||||||
GetWindowAttributes(pWin, client, &wa);
|
|
||||||
WriteReplyToClient(client, sizeof(xGetWindowAttributesReply), &wa);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcDestroyWindow(ClientPtr client)
|
ProcDestroyWindow(ClientPtr client)
|
||||||
{
|
{
|
||||||
|
@ -1013,8 +994,8 @@ ProcCirculateWindow(ClientPtr client)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
GetGeometry(ClientPtr client, xGetGeometryReply * rep)
|
ProcGetGeometry(ClientPtr client)
|
||||||
{
|
{
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -1026,46 +1007,40 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep->type = X_Reply;
|
xGetGeometryReply rep = {
|
||||||
rep->length = 0;
|
.type = X_Reply,
|
||||||
rep->sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
rep->root = pDraw->pScreen->root->drawable.id;
|
.sequenceNumber = client->sequence,
|
||||||
rep->depth = pDraw->depth;
|
.root = pDraw->pScreen->root->drawable.id,
|
||||||
rep->width = pDraw->width;
|
.depth = pDraw->depth,
|
||||||
rep->height = pDraw->height;
|
.width = pDraw->width,
|
||||||
|
.height = pDraw->height,
|
||||||
|
};
|
||||||
|
|
||||||
if (WindowDrawable(pDraw->type)) {
|
if (WindowDrawable(pDraw->type)) {
|
||||||
WindowPtr pWin = (WindowPtr) pDraw;
|
WindowPtr pWin = (WindowPtr) pDraw;
|
||||||
|
|
||||||
rep->x = pWin->origin.x - wBorderWidth(pWin);
|
rep.x = pWin->origin.x - wBorderWidth(pWin);
|
||||||
rep->y = pWin->origin.y - wBorderWidth(pWin);
|
rep.y = pWin->origin.y - wBorderWidth(pWin);
|
||||||
rep->borderWidth = pWin->borderWidth;
|
rep.borderWidth = pWin->borderWidth;
|
||||||
}
|
|
||||||
else { /* DRAWABLE_PIXMAP */
|
|
||||||
|
|
||||||
rep->x = rep->y = rep->borderWidth = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.root);
|
||||||
|
swaps(&rep.x);
|
||||||
|
swaps(&rep.y);
|
||||||
|
swaps(&rep.width);
|
||||||
|
swaps(&rep.height);
|
||||||
|
swaps(&rep.borderWidth);
|
||||||
}
|
}
|
||||||
|
WriteToClient(client, sizeof(xGetGeometryReply), &rep);
|
||||||
int
|
|
||||||
ProcGetGeometry(ClientPtr client)
|
|
||||||
{
|
|
||||||
xGetGeometryReply rep = { .type = X_Reply };
|
|
||||||
int status;
|
|
||||||
|
|
||||||
if ((status = GetGeometry(client, &rep)) != Success)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcQueryTree(ClientPtr client)
|
ProcQueryTree(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryTreeReply reply;
|
|
||||||
int rc, numChildren = 0;
|
int rc, numChildren = 0;
|
||||||
WindowPtr pChild, pWin, pHead;
|
WindowPtr pChild, pWin, pHead;
|
||||||
Window *childIDs = (Window *) NULL;
|
Window *childIDs = (Window *) NULL;
|
||||||
|
@ -1077,12 +1052,6 @@ ProcQueryTree(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply = (xQueryTreeReply) {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.root = pWin->drawable.pScreen->root->drawable.id,
|
|
||||||
.parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None
|
|
||||||
};
|
|
||||||
pHead = RealChildHead(pWin);
|
pHead = RealChildHead(pWin);
|
||||||
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
|
for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib)
|
||||||
numChildren++;
|
numChildren++;
|
||||||
|
@ -1097,17 +1066,26 @@ ProcQueryTree(ClientPtr client)
|
||||||
childIDs[curChild++] = pChild->drawable.id;
|
childIDs[curChild++] = pChild->drawable.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.nChildren = numChildren;
|
xQueryTreeReply rep = {
|
||||||
reply.length = bytes_to_int32(numChildren * sizeof(Window));
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.root = pWin->drawable.pScreen->root->drawable.id,
|
||||||
|
.parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None,
|
||||||
|
.nChildren = numChildren,
|
||||||
|
.length = bytes_to_int32(numChildren * sizeof(Window)),
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xQueryTreeReply), &reply);
|
if (client->swapped) {
|
||||||
if (numChildren) {
|
SwapLongs(childIDs, rep.length);
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
swaps(&rep.sequenceNumber);
|
||||||
WriteSwappedDataToClient(client, numChildren * sizeof(Window),
|
swapl(&rep.length);
|
||||||
childIDs);
|
swapl(&rep.root);
|
||||||
free(childIDs);
|
swapl(&rep.parent);
|
||||||
|
swaps(&rep.nChildren);
|
||||||
}
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, numChildren * sizeof(Window), childIDs);
|
||||||
|
free(childIDs);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1126,18 +1104,22 @@ ProcInternAtom(ClientPtr client)
|
||||||
}
|
}
|
||||||
tchar = (char *) &stuff[1];
|
tchar = (char *) &stuff[1];
|
||||||
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
|
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
|
||||||
if (atom != BAD_RESOURCE) {
|
if (atom == BAD_RESOURCE)
|
||||||
xInternAtomReply reply = {
|
return BadAlloc;
|
||||||
|
|
||||||
|
xInternAtomReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
.atom = atom
|
.atom = atom
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
|
|
||||||
return Success;
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.atom);
|
||||||
}
|
}
|
||||||
else
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return BadAlloc;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -1148,24 +1130,28 @@ ProcGetAtomName(ClientPtr client)
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
if ((str = NameForAtom(stuff->id))) {
|
if (!(str = NameForAtom(stuff->id))) {
|
||||||
int len = strlen(str);
|
client->errorValue = stuff->id;
|
||||||
xGetAtomNameReply reply = {
|
return BadAtom;
|
||||||
|
}
|
||||||
|
|
||||||
|
const int len = strlen(str);
|
||||||
|
xGetAtomNameReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(len),
|
.length = bytes_to_int32(len),
|
||||||
.nameLength = len
|
.nameLength = len
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nameLength);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
WriteToClient(client, len, str);
|
WriteToClient(client, len, str);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
client->errorValue = stuff->id;
|
|
||||||
return BadAtom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcGrabServer(ClientPtr client)
|
ProcGrabServer(ClientPtr client)
|
||||||
|
@ -1238,7 +1224,6 @@ ProcTranslateCoords(ClientPtr client)
|
||||||
REQUEST(xTranslateCoordsReq);
|
REQUEST(xTranslateCoordsReq);
|
||||||
|
|
||||||
WindowPtr pWin, pDst;
|
WindowPtr pWin, pDst;
|
||||||
xTranslateCoordsReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
REQUEST_SIZE_MATCH(xTranslateCoordsReq);
|
||||||
|
@ -1249,7 +1234,7 @@ ProcTranslateCoords(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xTranslateCoordsReply) {
|
xTranslateCoordsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0
|
.length = 0
|
||||||
|
@ -1300,7 +1285,14 @@ ProcTranslateCoords(ClientPtr client)
|
||||||
rep.dstX = x - pDst->drawable.x;
|
rep.dstX = x - pDst->drawable.x;
|
||||||
rep.dstY = y - pDst->drawable.y;
|
rep.dstY = y - pDst->drawable.y;
|
||||||
}
|
}
|
||||||
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.child);
|
||||||
|
swaps(&rep.dstX);
|
||||||
|
swaps(&rep.dstY);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1384,7 +1376,11 @@ ProcQueryFont(ClientPtr client)
|
||||||
reply->sequenceNumber = client->sequence;
|
reply->sequenceNumber = client->sequence;
|
||||||
QueryFont(pFont, reply, nprotoxcistructs);
|
QueryFont(pFont, reply, nprotoxcistructs);
|
||||||
|
|
||||||
WriteReplyToClient(client, rlength, reply);
|
if (client->swapped) {
|
||||||
|
SwapFont(reply, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, rlength, reply);
|
||||||
free(reply);
|
free(reply);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -1393,7 +1389,6 @@ ProcQueryFont(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcQueryTextExtents(ClientPtr client)
|
ProcQueryTextExtents(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryTextExtentsReply reply;
|
|
||||||
FontPtr pFont;
|
FontPtr pFont;
|
||||||
ExtentInfoRec info;
|
ExtentInfoRec info;
|
||||||
unsigned long length;
|
unsigned long length;
|
||||||
|
@ -1415,7 +1410,8 @@ ProcQueryTextExtents(ClientPtr client)
|
||||||
}
|
}
|
||||||
if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info))
|
if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
reply = (xQueryTextExtentsReply) {
|
|
||||||
|
xQueryTextExtentsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.drawDirection = info.drawDirection,
|
.drawDirection = info.drawDirection,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -1428,7 +1424,18 @@ ProcQueryTextExtents(ClientPtr client)
|
||||||
.overallLeft = info.overallLeft,
|
.overallLeft = info.overallLeft,
|
||||||
.overallRight = info.overallRight
|
.overallRight = info.overallRight
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.fontAscent);
|
||||||
|
swaps(&rep.fontDescent);
|
||||||
|
swaps(&rep.overallAscent);
|
||||||
|
swaps(&rep.overallDescent);
|
||||||
|
swapl(&rep.overallWidth);
|
||||||
|
swapl(&rep.overallLeft);
|
||||||
|
swapl(&rep.overallRight);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2158,7 +2165,6 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
long widthBytesLine, length;
|
long widthBytesLine, length;
|
||||||
Mask plane = 0;
|
Mask plane = 0;
|
||||||
char *pBuf;
|
char *pBuf;
|
||||||
xGetImageReply xgi;
|
|
||||||
RegionPtr pVisibleRegion = NULL;
|
RegionPtr pVisibleRegion = NULL;
|
||||||
|
|
||||||
if ((format != XYPixmap) && (format != ZPixmap)) {
|
if ((format != XYPixmap) && (format != ZPixmap)) {
|
||||||
|
@ -2169,7 +2175,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
memset(&xgi, 0, sizeof(xGetImageReply));
|
xGetImageReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
};
|
||||||
|
|
||||||
relx = x;
|
relx = x;
|
||||||
rely = y;
|
rely = y;
|
||||||
|
@ -2206,11 +2215,11 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
pBoundingDraw = (DrawablePtr) pDraw->pScreen->root;
|
pBoundingDraw = (DrawablePtr) pDraw->pScreen->root;
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi.visual = wVisual(pWin);
|
rep.visual = wVisual(pWin);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pBoundingDraw = pDraw;
|
pBoundingDraw = pDraw;
|
||||||
xgi.visual = None;
|
rep.visual = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* "If the drawable is a pixmap, the given rectangle must be wholly
|
/* "If the drawable is a pixmap, the given rectangle must be wholly
|
||||||
|
@ -2228,9 +2237,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
rely < 0 || rely + height > (int) pBoundingDraw->height)
|
rely < 0 || rely + height > (int) pBoundingDraw->height)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
xgi.type = X_Reply;
|
rep.depth = pDraw->depth;
|
||||||
xgi.sequenceNumber = client->sequence;
|
|
||||||
xgi.depth = pDraw->depth;
|
|
||||||
if (format == ZPixmap) {
|
if (format == ZPixmap) {
|
||||||
widthBytesLine = PixmapBytePad(width, pDraw->depth);
|
widthBytesLine = PixmapBytePad(width, pDraw->depth);
|
||||||
length = widthBytesLine * height;
|
length = widthBytesLine * height;
|
||||||
|
@ -2245,9 +2252,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi.length = length;
|
rep.length = bytes_to_int32(length);
|
||||||
|
|
||||||
xgi.length = bytes_to_int32(xgi.length);
|
|
||||||
if (widthBytesLine == 0 || height == 0)
|
if (widthBytesLine == 0 || height == 0)
|
||||||
linesPerBuf = 0;
|
linesPerBuf = 0;
|
||||||
else if (widthBytesLine >= IMAGE_BUFSIZE)
|
else if (widthBytesLine >= IMAGE_BUFSIZE)
|
||||||
|
@ -2272,7 +2278,13 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
}
|
}
|
||||||
if (!(pBuf = calloc(1, length)))
|
if (!(pBuf = calloc(1, length)))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.visual);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
|
||||||
if (pDraw->type == DRAWABLE_WINDOW) {
|
if (pDraw->type == DRAWABLE_WINDOW) {
|
||||||
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
|
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
|
||||||
|
@ -2574,8 +2586,7 @@ ProcUninstallColormap(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcListInstalledColormaps(ClientPtr client)
|
ProcListInstalledColormaps(ClientPtr client)
|
||||||
{
|
{
|
||||||
xListInstalledColormapsReply *preply;
|
int rc;
|
||||||
int nummaps, rc;
|
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
|
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
|
@ -2589,22 +2600,31 @@ ProcListInstalledColormaps(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
preply = malloc(sizeof(xListInstalledColormapsReply) +
|
Colormap *cm = calloc(pWin->drawable.pScreen->maxInstalledCmaps,
|
||||||
pWin->drawable.pScreen->maxInstalledCmaps *
|
|
||||||
sizeof(Colormap));
|
sizeof(Colormap));
|
||||||
if (!preply)
|
if (!cm)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
preply->type = X_Reply;
|
const ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
preply->sequenceNumber = client->sequence;
|
const int nummaps = pScreen->ListInstalledColormaps(pScreen, cm);
|
||||||
nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps)
|
|
||||||
(pWin->drawable.pScreen, (Colormap *) &preply[1]);
|
xListInstalledColormapsReply rep = {
|
||||||
preply->nColormaps = nummaps;
|
.type = X_Reply,
|
||||||
preply->length = nummaps;
|
.sequenceNumber = client->sequence,
|
||||||
WriteReplyToClient(client, sizeof(xListInstalledColormapsReply), preply);
|
.nColormaps = nummaps,
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
.length = nummaps,
|
||||||
WriteSwappedDataToClient(client, nummaps * sizeof(Colormap), &preply[1]);
|
};
|
||||||
free(preply);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nColormaps);
|
||||||
|
SwapLongs(cm, nummaps * sizeof(Colormap) / 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, nummaps * sizeof(Colormap), cm);
|
||||||
|
free(cm);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2619,8 +2639,12 @@ ProcAllocColor(ClientPtr client)
|
||||||
REQUEST_SIZE_MATCH(xAllocColorReq);
|
REQUEST_SIZE_MATCH(xAllocColorReq);
|
||||||
rc = dixLookupResourceByType((void **) &pmap, stuff->cmap, X11_RESTYPE_COLORMAP,
|
rc = dixLookupResourceByType((void **) &pmap, stuff->cmap, X11_RESTYPE_COLORMAP,
|
||||||
client, DixAddAccess);
|
client, DixAddAccess);
|
||||||
if (rc == Success) {
|
if (rc != Success) {
|
||||||
xAllocColorReply acr = {
|
client->errorValue = stuff->cmap;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
xAllocColorReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -2629,20 +2653,24 @@ ProcAllocColor(ClientPtr client)
|
||||||
.blue = stuff->blue,
|
.blue = stuff->blue,
|
||||||
.pixel = 0
|
.pixel = 0
|
||||||
};
|
};
|
||||||
if ((rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue,
|
|
||||||
&acr.pixel, client->index)))
|
if ((rc = AllocColor(pmap, &rep.red, &rep.green, &rep.blue,
|
||||||
|
&rep.pixel, client->index)))
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.red);
|
||||||
|
swaps(&rep.green);
|
||||||
|
swaps(&rep.blue);
|
||||||
|
swapl(&rep.pixel);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (noPanoramiXExtension || !pmap->pScreen->myNum)
|
if (noPanoramiXExtension || !pmap->pScreen->myNum)
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
WriteReplyToClient(client, sizeof(xAllocColorReply), &acr);
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
client->errorValue = stuff->cmap;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -2656,39 +2684,49 @@ ProcAllocNamedColor(ClientPtr client)
|
||||||
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
|
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
|
||||||
rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, X11_RESTYPE_COLORMAP,
|
rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, X11_RESTYPE_COLORMAP,
|
||||||
client, DixAddAccess);
|
client, DixAddAccess);
|
||||||
if (rc == Success) {
|
if (rc != Success) {
|
||||||
xAllocNamedColorReply ancr = {
|
client->errorValue = stuff->cmap;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
xAllocNamedColorReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0
|
.length = 0
|
||||||
};
|
};
|
||||||
if (dixLookupBuiltinColor
|
|
||||||
|
if (!dixLookupBuiltinColor
|
||||||
(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
|
(pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes,
|
||||||
&ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) {
|
&rep.exactRed, &rep.exactGreen, &rep.exactBlue))
|
||||||
ancr.screenRed = ancr.exactRed;
|
return BadName;
|
||||||
ancr.screenGreen = ancr.exactGreen;
|
|
||||||
ancr.screenBlue = ancr.exactBlue;
|
rep.screenRed = rep.exactRed;
|
||||||
ancr.pixel = 0;
|
rep.screenGreen = rep.exactGreen;
|
||||||
|
rep.screenBlue = rep.exactBlue;
|
||||||
|
rep.pixel = 0;
|
||||||
|
|
||||||
if ((rc = AllocColor(pcmp,
|
if ((rc = AllocColor(pcmp,
|
||||||
&ancr.screenRed, &ancr.screenGreen,
|
&rep.screenRed, &rep.screenGreen,
|
||||||
&ancr.screenBlue, &ancr.pixel, client->index)))
|
&rep.screenBlue, &rep.pixel, client->index)))
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.pixel);
|
||||||
|
swaps(&rep.exactRed);
|
||||||
|
swaps(&rep.exactGreen);
|
||||||
|
swaps(&rep.exactBlue);
|
||||||
|
swaps(&rep.screenRed);
|
||||||
|
swaps(&rep.screenGreen);
|
||||||
|
swaps(&rep.screenBlue);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
WriteReplyToClient(client, sizeof(xAllocNamedColorReply),
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
&ancr);
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return BadName;
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
client->errorValue = stuff->cmap;
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcAllocColorCells(ClientPtr client)
|
ProcAllocColorCells(ClientPtr client)
|
||||||
|
@ -2731,16 +2769,22 @@ ProcAllocColorCells(ClientPtr client)
|
||||||
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
{
|
{
|
||||||
xAllocColorCellsReply accr = {
|
xAllocColorCellsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(length),
|
.length = bytes_to_int32(length),
|
||||||
.nPixels = npixels,
|
.nPixels = npixels,
|
||||||
.nMasks = nmasks
|
.nMasks = nmasks
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr);
|
if (client->swapped) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
swaps(&rep.sequenceNumber);
|
||||||
WriteSwappedDataToClient(client, length, ppixels);
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nPixels);
|
||||||
|
swaps(&rep.nMasks);
|
||||||
|
SwapLongs(ppixels, length / 4);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, length, ppixels);
|
||||||
}
|
}
|
||||||
free(ppixels);
|
free(ppixels);
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -2763,7 +2807,6 @@ ProcAllocColorPlanes(ClientPtr client)
|
||||||
rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, X11_RESTYPE_COLORMAP,
|
rc = dixLookupResourceByType((void **) &pcmp, stuff->cmap, X11_RESTYPE_COLORMAP,
|
||||||
client, DixAddAccess);
|
client, DixAddAccess);
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
xAllocColorPlanesReply acpr;
|
|
||||||
int npixels;
|
int npixels;
|
||||||
long length;
|
long length;
|
||||||
Pixel *ppixels;
|
Pixel *ppixels;
|
||||||
|
@ -2777,7 +2820,8 @@ ProcAllocColorPlanes(ClientPtr client)
|
||||||
client->errorValue = stuff->contiguous;
|
client->errorValue = stuff->contiguous;
|
||||||
return BadValue;
|
return BadValue;
|
||||||
}
|
}
|
||||||
acpr = (xAllocColorPlanesReply) {
|
|
||||||
|
xAllocColorPlanesReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.nPixels = npixels
|
.nPixels = npixels
|
||||||
|
@ -2790,19 +2834,29 @@ ProcAllocColorPlanes(ClientPtr client)
|
||||||
if ((rc = AllocColorPlanes(client->index, pcmp, npixels,
|
if ((rc = AllocColorPlanes(client->index, pcmp, npixels,
|
||||||
(int) stuff->red, (int) stuff->green,
|
(int) stuff->red, (int) stuff->green,
|
||||||
(int) stuff->blue, (Bool) stuff->contiguous,
|
(int) stuff->blue, (Bool) stuff->contiguous,
|
||||||
ppixels, &acpr.redMask, &acpr.greenMask,
|
ppixels, &rep.redMask, &rep.greenMask,
|
||||||
&acpr.blueMask))) {
|
&rep.blueMask))) {
|
||||||
free(ppixels);
|
free(ppixels);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
acpr.length = bytes_to_int32(length);
|
rep.length = bytes_to_int32(length);
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
SwapLongs(ppixels, rep.length);
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nPixels);
|
||||||
|
swapl(&rep.redMask);
|
||||||
|
swapl(&rep.greenMask);
|
||||||
|
swapl(&rep.blueMask);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
|
||||||
#endif /* XINERAMA */
|
#endif /* XINERAMA */
|
||||||
{
|
{
|
||||||
WriteReplyToClient(client, sizeof(xAllocColorPlanesReply), &acpr);
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
WriteToClient(client, length, ppixels);
|
||||||
WriteSwappedDataToClient(client, length, ppixels);
|
|
||||||
}
|
}
|
||||||
free(ppixels);
|
free(ppixels);
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -2911,7 +2965,6 @@ ProcQueryColors(ClientPtr client)
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
int count;
|
int count;
|
||||||
xrgb *prgbs;
|
xrgb *prgbs;
|
||||||
xQueryColorsReply qcr;
|
|
||||||
|
|
||||||
count =
|
count =
|
||||||
bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq));
|
bytes_to_int32((client->req_len << 2) - sizeof(xQueryColorsReq));
|
||||||
|
@ -2923,20 +2976,25 @@ ProcQueryColors(ClientPtr client)
|
||||||
free(prgbs);
|
free(prgbs);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
qcr = (xQueryColorsReply) {
|
|
||||||
|
xQueryColorsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(count * sizeof(xrgb)),
|
.length = bytes_to_int32(count * sizeof(xrgb)),
|
||||||
.nColors = count
|
.nColors = count
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr);
|
|
||||||
if (count) {
|
if (client->swapped) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend;
|
swaps(&rep.sequenceNumber);
|
||||||
WriteSwappedDataToClient(client, count * sizeof(xrgb), prgbs);
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nColors);
|
||||||
|
SwapShorts((short*)prgbs, count * 4); // xrgb = 4 shorts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, count * sizeof(xrgb), prgbs);
|
||||||
free(prgbs);
|
free(prgbs);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
client->errorValue = stuff->cmap;
|
client->errorValue = stuff->cmap;
|
||||||
|
@ -2964,7 +3022,7 @@ ProcLookupColor(ClientPtr client)
|
||||||
&exactRed,
|
&exactRed,
|
||||||
&exactGreen,
|
&exactGreen,
|
||||||
&exactBlue)) {
|
&exactBlue)) {
|
||||||
xLookupColorReply lcr = {
|
xLookupColorReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -2975,10 +3033,19 @@ ProcLookupColor(ClientPtr client)
|
||||||
.screenGreen = exactGreen,
|
.screenGreen = exactGreen,
|
||||||
.screenBlue = exactBlue
|
.screenBlue = exactBlue
|
||||||
};
|
};
|
||||||
(*pcmp->pScreen->ResolveColor) (&lcr.screenRed,
|
(*pcmp->pScreen->ResolveColor) (&rep.screenRed,
|
||||||
&lcr.screenGreen,
|
&rep.screenGreen,
|
||||||
&lcr.screenBlue, pcmp->pVisual);
|
&rep.screenBlue, pcmp->pVisual);
|
||||||
WriteReplyToClient(client, sizeof(xLookupColorReply), &lcr);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.exactRed);
|
||||||
|
swaps(&rep.exactGreen);
|
||||||
|
swaps(&rep.exactBlue);
|
||||||
|
swaps(&rep.screenRed);
|
||||||
|
swaps(&rep.screenGreen);
|
||||||
|
swaps(&rep.screenBlue);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
return BadName;
|
return BadName;
|
||||||
|
@ -3139,7 +3206,6 @@ ProcFreeCursor(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcQueryBestSize(ClientPtr client)
|
ProcQueryBestSize(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryBestSizeReply reply;
|
|
||||||
DrawablePtr pDraw;
|
DrawablePtr pDraw;
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -3165,14 +3231,21 @@ ProcQueryBestSize(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
(*pScreen->QueryBestSize) (stuff->class, &stuff->width,
|
(*pScreen->QueryBestSize) (stuff->class, &stuff->width,
|
||||||
&stuff->height, pScreen);
|
&stuff->height, pScreen);
|
||||||
reply = (xQueryBestSizeReply) {
|
|
||||||
|
xQueryBestSizeReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
.width = stuff->width,
|
.width = stuff->width,
|
||||||
.height = stuff->height
|
.height = stuff->height
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.width);
|
||||||
|
swaps(&rep.height);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3239,7 +3312,6 @@ ProcSetScreenSaver(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcGetScreenSaver(ClientPtr client)
|
ProcGetScreenSaver(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetScreenSaverReply rep;
|
|
||||||
int rc, i;
|
int rc, i;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xReq);
|
REQUEST_SIZE_MATCH(xReq);
|
||||||
|
@ -3251,7 +3323,7 @@ ProcGetScreenSaver(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep = (xGetScreenSaverReply) {
|
xGetScreenSaverReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -3260,7 +3332,13 @@ ProcGetScreenSaver(ClientPtr client)
|
||||||
.preferBlanking = ScreenSaverBlanking,
|
.preferBlanking = ScreenSaverBlanking,
|
||||||
.allowExposures = ScreenSaverAllowExposures
|
.allowExposures = ScreenSaverAllowExposures
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swaps(&rep.timeout);
|
||||||
|
swaps(&rep.interval);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3284,7 +3362,6 @@ ProcChangeHosts(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcListHosts(ClientPtr client)
|
ProcListHosts(ClientPtr client)
|
||||||
{
|
{
|
||||||
xListHostsReply reply;
|
|
||||||
int len, nHosts, result;
|
int len, nHosts, result;
|
||||||
BOOL enabled;
|
BOOL enabled;
|
||||||
void *pdata;
|
void *pdata;
|
||||||
|
@ -3302,18 +3379,33 @@ ProcListHosts(ClientPtr client)
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
reply = (xListHostsReply) {
|
xListHostsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.enabled = enabled,
|
.enabled = enabled,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(len),
|
.length = bytes_to_int32(len),
|
||||||
.nHosts = nHosts
|
.nHosts = nHosts
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xListHostsReply), &reply);
|
|
||||||
if (nHosts) {
|
if (client->swapped) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend;
|
char *bufT = pdata;
|
||||||
WriteSwappedDataToClient(client, len, pdata);
|
char *endbuf = bufT + len;
|
||||||
|
|
||||||
|
while (bufT < endbuf) {
|
||||||
|
xHostEntry *host = (xHostEntry *) bufT;
|
||||||
|
int l1 = host->length;
|
||||||
|
swaps(&host->length);
|
||||||
|
bufT += sizeof(xHostEntry) + pad_to_int32(l1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nHosts);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, len, pdata);
|
||||||
|
|
||||||
free(pdata);
|
free(pdata);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -3410,7 +3502,6 @@ ProcSetFontPath(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcGetFontPath(ClientPtr client)
|
ProcGetFontPath(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGetFontPathReply reply;
|
|
||||||
int rc, stringLens, numpaths;
|
int rc, stringLens, numpaths;
|
||||||
unsigned char *bufferStart;
|
unsigned char *bufferStart;
|
||||||
|
|
||||||
|
@ -3421,15 +3512,19 @@ ProcGetFontPath(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply = (xGetFontPathReply) {
|
xGetFontPathReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(stringLens + numpaths),
|
.length = bytes_to_int32(stringLens + numpaths),
|
||||||
.nPaths = numpaths
|
.nPaths = numpaths
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
|
if (client->swapped) {
|
||||||
if (stringLens || numpaths)
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nPaths);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
WriteToClient(client, stringLens + numpaths, bufferStart);
|
WriteToClient(client, stringLens + numpaths, bufferStart);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ Equipment Corporation.
|
||||||
|
|
||||||
#include "dix/dix_priv.h"
|
#include "dix/dix_priv.h"
|
||||||
#include "dix/gc_priv.h"
|
#include "dix/gc_priv.h"
|
||||||
|
#include "include/swaprep.h"
|
||||||
#include "os/auth.h"
|
#include "os/auth.h"
|
||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
@ -565,9 +566,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
||||||
int nnames;
|
int nnames;
|
||||||
int stringLens;
|
int stringLens;
|
||||||
int i;
|
int i;
|
||||||
xListFontsReply reply;
|
|
||||||
char *bufptr;
|
|
||||||
char *bufferStart;
|
|
||||||
int aliascount = 0;
|
int aliascount = 0;
|
||||||
|
|
||||||
if (client->clientGone) {
|
if (client->clientGone) {
|
||||||
|
@ -749,16 +747,17 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
||||||
for (i = 0; i < nnames; i++)
|
for (i = 0; i < nnames; i++)
|
||||||
stringLens += (names->length[i] <= 255) ? names->length[i] : 0;
|
stringLens += (names->length[i] <= 255) ? names->length[i] : 0;
|
||||||
|
|
||||||
reply = (xListFontsReply) {
|
xListFontsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.length = bytes_to_int32(stringLens + nnames),
|
.length = bytes_to_int32(stringLens + nnames),
|
||||||
.nFonts = nnames,
|
.nFonts = nnames,
|
||||||
.sequenceNumber = client->sequence
|
.sequenceNumber = client->sequence
|
||||||
};
|
};
|
||||||
|
|
||||||
bufptr = bufferStart = malloc(reply.length << 2);
|
char *bufferStart = calloc(1, rep.length << 2);
|
||||||
|
char *bufptr = bufferStart;
|
||||||
|
|
||||||
if (!bufptr && reply.length) {
|
if (!bufptr && rep.length) {
|
||||||
SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc);
|
SendErrorToClient(client, X_ListFonts, 0, 0, BadAlloc);
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
@ -768,17 +767,23 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < nnames; i++) {
|
for (i = 0; i < nnames; i++) {
|
||||||
if (names->length[i] > 255)
|
if (names->length[i] > 255)
|
||||||
reply.nFonts--;
|
rep.nFonts--;
|
||||||
else {
|
else {
|
||||||
*bufptr++ = names->length[i];
|
*bufptr++ = names->length[i];
|
||||||
memcpy(bufptr, names->names[i], names->length[i]);
|
memcpy(bufptr, names->names[i], names->length[i]);
|
||||||
bufptr += names->length[i];
|
bufptr += names->length[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nnames = reply.nFonts;
|
nnames = rep.nFonts;
|
||||||
reply.length = bytes_to_int32(stringLens + nnames);
|
rep.length = bytes_to_int32(stringLens + nnames);
|
||||||
client->pSwapReplyFunc = ReplySwapVector[X_ListFonts];
|
|
||||||
WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swaps(&rep.nFonts);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
WriteToClient(client, stringLens + nnames, bufferStart);
|
WriteToClient(client, stringLens + nnames, bufferStart);
|
||||||
free(bufferStart);
|
free(bufferStart);
|
||||||
|
|
||||||
|
@ -859,7 +864,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
||||||
xFontProp *pFP;
|
xFontProp *pFP;
|
||||||
int i;
|
int i;
|
||||||
int aliascount = 0;
|
int aliascount = 0;
|
||||||
xListFontsWithInfoReply finalReply;
|
|
||||||
|
|
||||||
if (client->clientGone) {
|
if (client->clientGone) {
|
||||||
if (c->current.current_fpe < c->num_fpes) {
|
if (c->current.current_fpe < c->num_fpes) {
|
||||||
|
@ -869,7 +873,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
||||||
err = Successful;
|
err = Successful;
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo];
|
|
||||||
if (!c->current.patlen)
|
if (!c->current.patlen)
|
||||||
goto finish;
|
goto finish;
|
||||||
while (c->current.current_fpe < c->num_fpes) {
|
while (c->current.current_fpe < c->num_fpes) {
|
||||||
|
@ -1011,7 +1014,10 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
||||||
pFP->value = pFontInfo->props[i].value;
|
pFP->value = pFontInfo->props[i].value;
|
||||||
pFP++;
|
pFP++;
|
||||||
}
|
}
|
||||||
WriteSwappedDataToClient(client, length, reply);
|
if (client->swapped) {
|
||||||
|
SwapFont((xQueryFontReply *) reply, FALSE);
|
||||||
|
}
|
||||||
|
WriteToClient(client, length, reply);
|
||||||
WriteToClient(client, namelen, name);
|
WriteToClient(client, namelen, name);
|
||||||
if (pFontInfo == &fontInfo) {
|
if (pFontInfo == &fontInfo) {
|
||||||
free(fontInfo.props);
|
free(fontInfo.props);
|
||||||
|
@ -1022,13 +1028,16 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
||||||
}
|
}
|
||||||
finish:
|
finish:
|
||||||
length = sizeof(xListFontsWithInfoReply);
|
length = sizeof(xListFontsWithInfoReply);
|
||||||
finalReply = (xListFontsWithInfoReply) {
|
xListFontsWithInfoReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
|
.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
|
||||||
- sizeof(xGenericReply))
|
- sizeof(xGenericReply))
|
||||||
};
|
};
|
||||||
WriteSwappedDataToClient(client, length, &finalReply);
|
if (client->swapped) {
|
||||||
|
SwapFont((xQueryFontReply *) &rep, FALSE);
|
||||||
|
}
|
||||||
|
WriteToClient(client, length, &rep);
|
||||||
bail:
|
bail:
|
||||||
ClientWakeup(client);
|
ClientWakeup(client);
|
||||||
for (i = 0; i < c->num_fpes; i++)
|
for (i = 0; i < c->num_fpes; i++)
|
||||||
|
|
45
dix/events.c
45
dix/events.c
|
@ -4938,7 +4938,6 @@ int
|
||||||
ProcGetInputFocus(ClientPtr client)
|
ProcGetInputFocus(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr kbd = PickKeyboard(client);
|
DeviceIntPtr kbd = PickKeyboard(client);
|
||||||
xGetInputFocusReply rep;
|
|
||||||
FocusClassPtr focus = kbd->focus;
|
FocusClassPtr focus = kbd->focus;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -4949,7 +4948,7 @@ ProcGetInputFocus(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGetInputFocusReply) {
|
xGetInputFocusReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -4963,7 +4962,11 @@ ProcGetInputFocus(ClientPtr client)
|
||||||
else
|
else
|
||||||
rep.focus = focus->win->drawable.id;
|
rep.focus = focus->win->drawable.id;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.focus);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4976,7 +4979,6 @@ ProcGetInputFocus(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcGrabPointer(ClientPtr client)
|
ProcGrabPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGrabPointerReply rep;
|
|
||||||
DeviceIntPtr device = PickPointer(client);
|
DeviceIntPtr device = PickPointer(client);
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
GrabMask mask;
|
GrabMask mask;
|
||||||
|
@ -5016,13 +5018,17 @@ ProcGrabPointer(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep = (xGrabPointerReply) {
|
xGrabPointerReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.status = status,
|
.status = status,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0
|
.length = 0
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5238,7 +5244,6 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev,
|
||||||
int
|
int
|
||||||
ProcGrabKeyboard(ClientPtr client)
|
ProcGrabKeyboard(ClientPtr client)
|
||||||
{
|
{
|
||||||
xGrabKeyboardReply rep;
|
|
||||||
BYTE status;
|
BYTE status;
|
||||||
|
|
||||||
REQUEST(xGrabKeyboardReq);
|
REQUEST(xGrabKeyboardReq);
|
||||||
|
@ -5259,13 +5264,18 @@ ProcGrabKeyboard(ClientPtr client)
|
||||||
if (result != Success)
|
if (result != Success)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
rep = (xGrabKeyboardReply) {
|
xGrabKeyboardReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.status = status,
|
.status = status,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0
|
.length = 0
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5305,7 +5315,6 @@ ProcUngrabKeyboard(ClientPtr client)
|
||||||
int
|
int
|
||||||
ProcQueryPointer(ClientPtr client)
|
ProcQueryPointer(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryPointerReply rep;
|
|
||||||
WindowPtr pWin, t;
|
WindowPtr pWin, t;
|
||||||
DeviceIntPtr mouse = PickPointer(client);
|
DeviceIntPtr mouse = PickPointer(client);
|
||||||
DeviceIntPtr keyboard;
|
DeviceIntPtr keyboard;
|
||||||
|
@ -5327,7 +5336,8 @@ ProcQueryPointer(ClientPtr client)
|
||||||
pSprite = mouse->spriteInfo->sprite;
|
pSprite = mouse->spriteInfo->sprite;
|
||||||
if (mouse->valuator->motionHintWindow)
|
if (mouse->valuator->motionHintWindow)
|
||||||
MaybeStopHint(mouse, client);
|
MaybeStopHint(mouse, client);
|
||||||
rep = (xQueryPointerReply) {
|
|
||||||
|
xQueryPointerReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -5373,8 +5383,17 @@ ProcQueryPointer(ClientPtr client)
|
||||||
rep.winY = 0;
|
rep.winY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xQueryPointerReply), &rep);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.root);
|
||||||
|
swapl(&rep.child);
|
||||||
|
swaps(&rep.rootX);
|
||||||
|
swaps(&rep.rootY);
|
||||||
|
swaps(&rep.winX);
|
||||||
|
swaps(&rep.winY);
|
||||||
|
swaps(&rep.mask);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,47 +223,46 @@ ExtensionAvailable(ClientPtr client, ExtensionEntry *ext)
|
||||||
int
|
int
|
||||||
ProcQueryExtension(ClientPtr client)
|
ProcQueryExtension(ClientPtr client)
|
||||||
{
|
{
|
||||||
xQueryExtensionReply reply;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
REQUEST(xQueryExtensionReq);
|
REQUEST(xQueryExtensionReq);
|
||||||
|
|
||||||
REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes);
|
REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes);
|
||||||
|
|
||||||
reply = (xQueryExtensionReply) {
|
xQueryExtensionReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
.major_opcode = 0
|
.major_opcode = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!NumExtensions)
|
if (!NumExtensions || !extensions)
|
||||||
reply.present = xFalse;
|
rep.present = xFalse;
|
||||||
else {
|
else {
|
||||||
i = FindExtension((char *) &stuff[1], stuff->nbytes);
|
int i = FindExtension((char *) &stuff[1], stuff->nbytes);
|
||||||
if (i < 0 || !ExtensionAvailable(client, extensions[i]))
|
if (i < 0 || !ExtensionAvailable(client, extensions[i]))
|
||||||
reply.present = xFalse;
|
rep.present = xFalse;
|
||||||
else {
|
else {
|
||||||
reply.present = xTrue;
|
rep.present = xTrue;
|
||||||
reply.major_opcode = extensions[i]->base;
|
rep.major_opcode = extensions[i]->base;
|
||||||
reply.first_event = extensions[i]->eventBase;
|
rep.first_event = extensions[i]->eventBase;
|
||||||
reply.first_error = extensions[i]->errorBase;
|
rep.first_error = extensions[i]->errorBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteReplyToClient(client, sizeof(xQueryExtensionReply), &reply);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ProcListExtensions(ClientPtr client)
|
ProcListExtensions(ClientPtr client)
|
||||||
{
|
{
|
||||||
xListExtensionsReply reply;
|
|
||||||
char *bufptr, *buffer;
|
char *bufptr, *buffer;
|
||||||
int total_length = 0;
|
int total_length = 0;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xReq);
|
REQUEST_SIZE_MATCH(xReq);
|
||||||
|
|
||||||
reply = (xListExtensionsReply) {
|
xListExtensionsReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.nExtensions = 0,
|
.nExtensions = 0,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
|
@ -280,9 +279,9 @@ ProcListExtensions(ClientPtr client)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
total_length += strlen(extensions[i]->name) + 1;
|
total_length += strlen(extensions[i]->name) + 1;
|
||||||
reply.nExtensions += 1;
|
rep.nExtensions += 1;
|
||||||
}
|
}
|
||||||
reply.length = bytes_to_int32(total_length);
|
rep.length = bytes_to_int32(total_length);
|
||||||
buffer = bufptr = malloc(total_length);
|
buffer = bufptr = malloc(total_length);
|
||||||
if (!buffer)
|
if (!buffer)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
@ -297,8 +296,12 @@ ProcListExtensions(ClientPtr client)
|
||||||
bufptr += len;
|
bufptr += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply);
|
|
||||||
if (reply.length)
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
WriteToClient(client, total_length, buffer);
|
WriteToClient(client, total_length, buffer);
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
|
101
dix/property.c
101
dix/property.c
|
@ -421,22 +421,6 @@ DeleteAllWindowProperties(WindowPtr pWin)
|
||||||
pWin->optional->userProps = NULL;
|
pWin->optional->userProps = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
NullPropertyReply(ClientPtr client, ATOM propertyType, int format)
|
|
||||||
{
|
|
||||||
xGetPropertyReply reply = {
|
|
||||||
.type = X_Reply,
|
|
||||||
.format = format,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.propertyType = propertyType,
|
|
||||||
.bytesAfter = 0,
|
|
||||||
.nItems = 0
|
|
||||||
};
|
|
||||||
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************
|
/*****************
|
||||||
* GetProperty
|
* GetProperty
|
||||||
* If type Any is specified, returns the property from the specified
|
* If type Any is specified, returns the property from the specified
|
||||||
|
@ -454,7 +438,6 @@ ProcGetProperty(ClientPtr client)
|
||||||
unsigned long n, len, ind;
|
unsigned long n, len, ind;
|
||||||
int rc;
|
int rc;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
xGetPropertyReply reply;
|
|
||||||
Mask win_mode = DixGetPropAccess, prop_mode = DixReadAccess;
|
Mask win_mode = DixGetPropAccess, prop_mode = DixReadAccess;
|
||||||
|
|
||||||
REQUEST(xGetPropertyReq);
|
REQUEST(xGetPropertyReq);
|
||||||
|
@ -483,8 +466,17 @@ ProcGetProperty(ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode);
|
rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode);
|
||||||
if (rc == BadMatch)
|
if (rc == BadMatch) {
|
||||||
return NullPropertyReply(client, None, 0);
|
xGetPropertyReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
};
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
else if (rc != Success)
|
else if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@ -493,16 +485,19 @@ ProcGetProperty(ClientPtr client)
|
||||||
|
|
||||||
if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType))
|
if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType))
|
||||||
) {
|
) {
|
||||||
reply = (xGetPropertyReply) {
|
xGetPropertyReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.bytesAfter = pProp->size,
|
.bytesAfter = pProp->size,
|
||||||
.format = pProp->format,
|
.format = pProp->format,
|
||||||
.length = 0,
|
|
||||||
.nItems = 0,
|
|
||||||
.propertyType = pProp->type
|
.propertyType = pProp->type
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.propertyType);
|
||||||
|
swapl(&rep.bytesAfter);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +517,7 @@ ProcGetProperty(ClientPtr client)
|
||||||
|
|
||||||
len = min(n - ind, 4 * stuff->longLength);
|
len = min(n - ind, 4 * stuff->longLength);
|
||||||
|
|
||||||
reply = (xGetPropertyReply) {
|
xGetPropertyReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.bytesAfter = n - (ind + len),
|
.bytesAfter = n - (ind + len),
|
||||||
|
@ -532,26 +527,15 @@ ProcGetProperty(ClientPtr client)
|
||||||
.propertyType = pProp->type
|
.propertyType = pProp->type
|
||||||
};
|
};
|
||||||
|
|
||||||
if (stuff->delete && (reply.bytesAfter == 0))
|
if (stuff->delete && (rep.bytesAfter == 0))
|
||||||
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
|
deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp);
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGenericReply), &reply);
|
void *payload = calloc(1, len);
|
||||||
if (len) {
|
if (!payload)
|
||||||
switch (reply.format) {
|
return BadAlloc;
|
||||||
case 32:
|
memcpy(payload, (char*)(pProp->data) + ind, len);
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
|
||||||
break;
|
|
||||||
case 16:
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
WriteSwappedDataToClient(client, len, (char *) pProp->data + ind);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stuff->delete && (reply.bytesAfter == 0)) {
|
if (stuff->delete && (rep.bytesAfter == 0)) {
|
||||||
/* Delete the Property */
|
/* Delete the Property */
|
||||||
if (pWin->optional->userProps == pProp) {
|
if (pWin->optional->userProps == pProp) {
|
||||||
/* Takes care of head */
|
/* Takes care of head */
|
||||||
|
@ -569,6 +553,22 @@ ProcGetProperty(ClientPtr client)
|
||||||
free(pProp->data);
|
free(pProp->data);
|
||||||
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
|
dixFreeObjectWithPrivates(pProp, PRIVATE_PROPERTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.propertyType);
|
||||||
|
swapl(&rep.bytesAfter);
|
||||||
|
swapl(&rep.nItems);
|
||||||
|
if (rep.format == 32)
|
||||||
|
SwapLongs(payload, len / 4);
|
||||||
|
else if (rep.format == 16)
|
||||||
|
SwapShorts(payload, len / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, len, payload);
|
||||||
|
free(payload);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,7 +576,6 @@ int
|
||||||
ProcListProperties(ClientPtr client)
|
ProcListProperties(ClientPtr client)
|
||||||
{
|
{
|
||||||
Atom *pAtoms = NULL, *temppAtoms;
|
Atom *pAtoms = NULL, *temppAtoms;
|
||||||
xListPropertiesReply xlpr;
|
|
||||||
int rc, numProps = 0;
|
int rc, numProps = 0;
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
PropertyPtr pProp, realProp;
|
PropertyPtr pProp, realProp;
|
||||||
|
@ -608,18 +607,24 @@ ProcListProperties(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xlpr = (xListPropertiesReply) {
|
xListPropertiesReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(numProps * sizeof(Atom)),
|
.length = bytes_to_int32(numProps * sizeof(Atom)),
|
||||||
.nProperties = numProps
|
.nProperties = numProps
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGenericReply), &xlpr);
|
|
||||||
if (numProps) {
|
if (client->swapped) {
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
swaps(&rep.sequenceNumber);
|
||||||
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
|
swapl(&rep.length);
|
||||||
free(pAtoms);
|
swaps(&rep.nProperties);
|
||||||
|
SwapLongs(pAtoms, numProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
WriteToClient(client, numProps * sizeof(Atom), pAtoms);
|
||||||
|
free(pAtoms);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,6 @@ ProcGetSelectionOwner(ClientPtr client)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
Selection *pSel;
|
Selection *pSel;
|
||||||
xGetSelectionOwnerReply reply;
|
|
||||||
|
|
||||||
REQUEST(xResourceReq);
|
REQUEST(xResourceReq);
|
||||||
REQUEST_SIZE_MATCH(xResourceReq);
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
|
@ -229,7 +228,7 @@ ProcGetSelectionOwner(ClientPtr client)
|
||||||
return BadAtom;
|
return BadAtom;
|
||||||
}
|
}
|
||||||
|
|
||||||
reply = (xGetSelectionOwnerReply) {
|
xGetSelectionOwnerReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = 0,
|
.length = 0,
|
||||||
|
@ -237,13 +236,18 @@ ProcGetSelectionOwner(ClientPtr client)
|
||||||
|
|
||||||
rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
|
rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess);
|
||||||
if (rc == Success)
|
if (rc == Success)
|
||||||
reply.owner = pSel->window;
|
rep.owner = pSel->window;
|
||||||
else if (rc == BadMatch)
|
else if (rc == BadMatch)
|
||||||
reply.owner = None;
|
rep.owner = None;
|
||||||
else
|
else
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetSelectionOwnerReply), &reply);
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
406
dix/swaprep.c
406
dix/swaprep.c
|
@ -59,8 +59,6 @@ static void SwapFontInfo(xQueryFontReply * pr);
|
||||||
|
|
||||||
static void SwapCharInfo(xCharInfo * pInfo);
|
static void SwapCharInfo(xCharInfo * pInfo);
|
||||||
|
|
||||||
static void SwapFont(xQueryFontReply * pr, Bool hasGlyphs);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thanks to Jack Palevich for testing and subsequently rewriting all this
|
* Thanks to Jack Palevich for testing and subsequently rewriting all this
|
||||||
*
|
*
|
||||||
|
@ -183,108 +181,6 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep)
|
||||||
WriteToClient(pClient, size, pRep);
|
WriteToClient(pClient, size, pRep);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extra-large reply */
|
|
||||||
void _X_COLD
|
|
||||||
SGetWindowAttributesReply(ClientPtr pClient, int size,
|
|
||||||
xGetWindowAttributesReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swapl(&pRep->visualID);
|
|
||||||
swaps(&pRep->class);
|
|
||||||
swapl(&pRep->backingBitPlanes);
|
|
||||||
swapl(&pRep->backingPixel);
|
|
||||||
swapl(&pRep->colormap);
|
|
||||||
swapl(&pRep->allEventMasks);
|
|
||||||
swapl(&pRep->yourEventMask);
|
|
||||||
swaps(&pRep->doNotPropagateMask);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->root);
|
|
||||||
swaps(&pRep->x);
|
|
||||||
swaps(&pRep->y);
|
|
||||||
swaps(&pRep->width);
|
|
||||||
swaps(&pRep->height);
|
|
||||||
swaps(&pRep->borderWidth);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swapl(&pRep->root);
|
|
||||||
swapl(&pRep->parent);
|
|
||||||
swaps(&pRep->nChildren);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->atom);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nameLength);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swapl(&pRep->propertyType);
|
|
||||||
swapl(&pRep->bytesAfter);
|
|
||||||
swapl(&pRep->nItems);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nProperties);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetSelectionOwnerReply(ClientPtr pClient, int size,
|
|
||||||
xGetSelectionOwnerReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->owner);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->root);
|
|
||||||
swapl(&pRep->child);
|
|
||||||
swaps(&pRep->rootX);
|
|
||||||
swaps(&pRep->rootY);
|
|
||||||
swaps(&pRep->winX);
|
|
||||||
swaps(&pRep->winY);
|
|
||||||
swaps(&pRep->mask);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _X_COLD
|
static void _X_COLD
|
||||||
SwapTimecoord(xTimecoord * pCoord)
|
SwapTimecoord(xTimecoord * pCoord)
|
||||||
{
|
{
|
||||||
|
@ -309,42 +205,6 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swapl(&pRep->nEvents);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->child);
|
|
||||||
swaps(&pRep->dstX);
|
|
||||||
swaps(&pRep->dstY);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->focus);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* extra long reply */
|
|
||||||
void _X_COLD
|
|
||||||
SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _X_COLD
|
static void _X_COLD
|
||||||
SwapCharInfo(xCharInfo * pInfo)
|
SwapCharInfo(xCharInfo * pInfo)
|
||||||
{
|
{
|
||||||
|
@ -356,7 +216,7 @@ SwapCharInfo(xCharInfo * pInfo)
|
||||||
swaps(&pInfo->attributes);
|
swaps(&pInfo->attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
void
|
||||||
SwapFontInfo(xQueryFontReply * pr)
|
SwapFontInfo(xQueryFontReply * pr)
|
||||||
{
|
{
|
||||||
swaps(&pr->minCharOrByte2);
|
swaps(&pr->minCharOrByte2);
|
||||||
|
@ -370,7 +230,7 @@ SwapFontInfo(xQueryFontReply * pr)
|
||||||
swapl(&pr->nCharInfos);
|
swapl(&pr->nCharInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _X_COLD
|
void _X_COLD
|
||||||
SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
|
SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
@ -399,268 +259,6 @@ SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep)
|
|
||||||
{
|
|
||||||
SwapFont(pRep, TRUE);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQueryTextExtentsReply(ClientPtr pClient, int size,
|
|
||||||
xQueryTextExtentsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->fontAscent);
|
|
||||||
swaps(&pRep->fontDescent);
|
|
||||||
swaps(&pRep->overallAscent);
|
|
||||||
swaps(&pRep->overallDescent);
|
|
||||||
swapl(&pRep->overallWidth);
|
|
||||||
swapl(&pRep->overallLeft);
|
|
||||||
swapl(&pRep->overallRight);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nFonts);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SListFontsWithInfoReply(ClientPtr pClient, int size,
|
|
||||||
xListFontsWithInfoReply * pRep)
|
|
||||||
{
|
|
||||||
SwapFont((xQueryFontReply *) pRep, FALSE);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nPaths);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swapl(&pRep->visual);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
/* Fortunately, image doesn't need swapping */
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SListInstalledColormapsReply(ClientPtr pClient, int size,
|
|
||||||
xListInstalledColormapsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nColormaps);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->red);
|
|
||||||
swaps(&pRep->green);
|
|
||||||
swaps(&pRep->blue);
|
|
||||||
swapl(&pRep->pixel);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->pixel);
|
|
||||||
swaps(&pRep->exactRed);
|
|
||||||
swaps(&pRep->exactGreen);
|
|
||||||
swaps(&pRep->exactBlue);
|
|
||||||
swaps(&pRep->screenRed);
|
|
||||||
swaps(&pRep->screenGreen);
|
|
||||||
swaps(&pRep->screenBlue);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nPixels);
|
|
||||||
swaps(&pRep->nMasks);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SAllocColorPlanesReply(ClientPtr pClient, int size,
|
|
||||||
xAllocColorPlanesReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nPixels);
|
|
||||||
swapl(&pRep->redMask);
|
|
||||||
swapl(&pRep->greenMask);
|
|
||||||
swapl(&pRep->blueMask);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _X_COLD
|
|
||||||
SwapRGB(xrgb * prgb)
|
|
||||||
{
|
|
||||||
swaps(&prgb->red);
|
|
||||||
swaps(&prgb->green);
|
|
||||||
swaps(&prgb->blue);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb)
|
|
||||||
{
|
|
||||||
int i, n;
|
|
||||||
xrgb *prgbT;
|
|
||||||
|
|
||||||
n = size / sizeof(xrgb);
|
|
||||||
prgbT = prgb;
|
|
||||||
for (i = 0; i < n; i++) {
|
|
||||||
SwapRGB(prgbT);
|
|
||||||
prgbT++;
|
|
||||||
}
|
|
||||||
WriteToClient(pClient, size, prgb);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nColors);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->exactRed);
|
|
||||||
swaps(&pRep->exactGreen);
|
|
||||||
swaps(&pRep->exactBlue);
|
|
||||||
swaps(&pRep->screenRed);
|
|
||||||
swaps(&pRep->screenGreen);
|
|
||||||
swaps(&pRep->screenBlue);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->width);
|
|
||||||
swaps(&pRep->height);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetKeyboardMappingReply(ClientPtr pClient, int size,
|
|
||||||
xGetKeyboardMappingReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetPointerMappingReply(ClientPtr pClient, int size,
|
|
||||||
xGetPointerMappingReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetModifierMappingReply(ClientPtr pClient, int size,
|
|
||||||
xGetModifierMappingReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetKeyboardControlReply(ClientPtr pClient, int size,
|
|
||||||
xGetKeyboardControlReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swapl(&pRep->ledMask);
|
|
||||||
swaps(&pRep->bellPitch);
|
|
||||||
swaps(&pRep->bellDuration);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetPointerControlReply(ClientPtr pClient, int size,
|
|
||||||
xGetPointerControlReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->accelNumerator);
|
|
||||||
swaps(&pRep->accelDenominator);
|
|
||||||
swaps(&pRep->threshold);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swaps(&pRep->timeout);
|
|
||||||
swaps(&pRep->interval);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SLHostsExtend(ClientPtr pClient, int size, char *buf)
|
|
||||||
{
|
|
||||||
char *bufT = buf;
|
|
||||||
char *endbuf = buf + size;
|
|
||||||
|
|
||||||
while (bufT < endbuf) {
|
|
||||||
xHostEntry *host = (xHostEntry *) bufT;
|
|
||||||
int len = host->length;
|
|
||||||
|
|
||||||
swaps(&host->length);
|
|
||||||
bufT += sizeof(xHostEntry) + pad_to_int32(len);
|
|
||||||
}
|
|
||||||
WriteToClient(pClient, size, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->length);
|
|
||||||
swaps(&pRep->nHosts);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
void _X_COLD
|
||||||
SErrorEvent(xError * from, xError * to)
|
SErrorEvent(xError * from, xError * to)
|
||||||
{
|
{
|
||||||
|
|
82
dix/tables.c
82
dix/tables.c
|
@ -715,7 +715,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetWindowAttributesReply,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 5 */
|
ReplyNotSwappd, /* 5 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
|
@ -726,45 +726,45 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetGeometryReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SQueryTreeReply, /* 15 */
|
ReplyNotSwappd, /* 15 */
|
||||||
(ReplySwapPtr) SInternAtomReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetAtomNameReply,
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd, /* 20 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetPropertyReply, /* 20 */
|
|
||||||
(ReplySwapPtr) SListPropertiesReply,
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetSelectionOwnerReply,
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 25 */
|
ReplyNotSwappd, /* 25 */
|
||||||
(ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 30 */
|
ReplyNotSwappd, /* 30 */
|
||||||
(ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 35 */
|
ReplyNotSwappd, /* 35 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SQueryPointerReply,
|
|
||||||
(ReplySwapPtr) SGetMotionEventsReply,
|
|
||||||
(ReplySwapPtr) STranslateCoordsReply, /* 40 */
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetInputFocusReply,
|
ReplyNotSwappd, /* 40 */
|
||||||
(ReplySwapPtr) SQueryKeymapReply,
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 45 */
|
ReplyNotSwappd, /* 45 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SQueryFontReply,
|
|
||||||
(ReplySwapPtr) SQueryTextExtentsReply,
|
|
||||||
(ReplySwapPtr) SListFontsReply,
|
|
||||||
(ReplySwapPtr) SListFontsWithInfoReply, /* 50 */
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetFontPathReply,
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd, /* 50 */
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 55 */
|
ReplyNotSwappd, /* 55 */
|
||||||
|
@ -785,7 +785,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd, /* 70 */
|
ReplyNotSwappd, /* 70 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetImageReply,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 75 */
|
ReplyNotSwappd, /* 75 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
|
@ -795,43 +795,43 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd, /* 80 */
|
ReplyNotSwappd, /* 80 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SListInstalledColormapsReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SAllocColorReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SAllocNamedColorReply, /* 85 */
|
ReplyNotSwappd, /* 85 */
|
||||||
(ReplySwapPtr) SAllocColorCellsReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SAllocColorPlanesReply,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 90 */
|
ReplyNotSwappd, /* 90 */
|
||||||
(ReplySwapPtr) SQueryColorsReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SLookupColorReply,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 95 */
|
ReplyNotSwappd, /* 95 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SQueryBestSizeReply,
|
|
||||||
(ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */
|
|
||||||
(ReplySwapPtr) SListExtensionsReply,
|
|
||||||
ReplyNotSwappd, /* 100 */
|
|
||||||
(ReplySwapPtr) SGetKeyboardMappingReply,
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetKeyboardControlReply,
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd, /* 100 */
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 105 */
|
ReplyNotSwappd, /* 105 */
|
||||||
(ReplySwapPtr) SGetPointerControlReply,
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetScreenSaverReply,
|
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SListHostsReply, /* 110 */
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd,
|
||||||
|
ReplyNotSwappd, /* 110 */
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 115 */
|
ReplyNotSwappd, /* 115 */
|
||||||
(ReplySwapPtr) SGenericReply, /* SetPointerMapping */
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetPointerMappingReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGenericReply, /* SetModifierMapping */
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetModifierMappingReply, /* 119 */
|
ReplyNotSwappd, /* 119 */
|
||||||
ReplyNotSwappd, /* 120 */
|
ReplyNotSwappd, /* 120 */
|
||||||
ReplyNotSwappd, /* 121 */
|
ReplyNotSwappd, /* 121 */
|
||||||
ReplyNotSwappd, /* 122 */
|
ReplyNotSwappd, /* 122 */
|
||||||
|
|
80
dix/window.c
80
dix/window.c
|
@ -100,6 +100,7 @@ Equipment Corporation.
|
||||||
|
|
||||||
#include "dix/colormap_priv.h"
|
#include "dix/colormap_priv.h"
|
||||||
#include "dix/cursor_priv.h"
|
#include "dix/cursor_priv.h"
|
||||||
|
#include "dix/dispatch.h"
|
||||||
#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"
|
||||||
|
@ -1595,42 +1596,55 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****
|
int
|
||||||
* GetWindowAttributes
|
ProcGetWindowAttributes(ClientPtr client)
|
||||||
* Notice that this is different than ChangeWindowAttributes
|
|
||||||
*****/
|
|
||||||
|
|
||||||
void
|
|
||||||
GetWindowAttributes(WindowPtr pWin, ClientPtr client,
|
|
||||||
xGetWindowAttributesReply * wa)
|
|
||||||
{
|
{
|
||||||
wa->type = X_Reply;
|
REQUEST(xResourceReq);
|
||||||
wa->bitGravity = pWin->bitGravity;
|
REQUEST_SIZE_MATCH(xResourceReq);
|
||||||
wa->winGravity = pWin->winGravity;
|
|
||||||
wa->backingStore = pWin->backingStore;
|
|
||||||
wa->length = bytes_to_int32(sizeof(xGetWindowAttributesReply) -
|
|
||||||
sizeof(xGenericReply));
|
|
||||||
wa->sequenceNumber = client->sequence;
|
|
||||||
wa->backingBitPlanes = wBackingBitPlanes(pWin);
|
|
||||||
wa->backingPixel = wBackingPixel(pWin);
|
|
||||||
wa->saveUnder = (BOOL) pWin->saveUnder;
|
|
||||||
wa->override = pWin->overrideRedirect;
|
|
||||||
if (!pWin->mapped)
|
|
||||||
wa->mapState = IsUnmapped;
|
|
||||||
else if (pWin->realized)
|
|
||||||
wa->mapState = IsViewable;
|
|
||||||
else
|
|
||||||
wa->mapState = IsUnviewable;
|
|
||||||
|
|
||||||
wa->colormap = wColormap(pWin);
|
WindowPtr pWin;
|
||||||
wa->mapInstalled = (wa->colormap == None) ? xFalse
|
int rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
|
||||||
: IsMapInstalled(wa->colormap, pWin);
|
if (rc != Success)
|
||||||
|
return rc;
|
||||||
|
|
||||||
wa->yourEventMask = EventMaskForClient(pWin, client);
|
xGetWindowAttributesReply rep = {
|
||||||
wa->allEventMasks = pWin->eventMask | wOtherEventMasks(pWin);
|
.type = X_Reply,
|
||||||
wa->doNotPropagateMask = wDontPropagateMask(pWin);
|
.bitGravity = pWin->bitGravity,
|
||||||
wa->class = pWin->drawable.class;
|
.winGravity = pWin->winGravity,
|
||||||
wa->visualID = wVisual(pWin);
|
.backingStore = pWin->backingStore,
|
||||||
|
.length = bytes_to_int32(sizeof(xGetWindowAttributesReply) -
|
||||||
|
sizeof(xGenericReply)),
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.backingBitPlanes = wBackingBitPlanes(pWin),
|
||||||
|
.backingPixel = wBackingPixel(pWin),
|
||||||
|
.saveUnder = (BOOL) pWin->saveUnder,
|
||||||
|
.override = pWin->overrideRedirect,
|
||||||
|
.mapState = (!pWin->mapped ? IsUnmapped :
|
||||||
|
(pWin->realized ? IsViewable : IsUnviewable)),
|
||||||
|
.colormap = wColormap(pWin),
|
||||||
|
.mapInstalled = (wColormap(pWin) == None) ? xFalse
|
||||||
|
: IsMapInstalled(wColormap(pWin), pWin),
|
||||||
|
.yourEventMask = EventMaskForClient(pWin, client),
|
||||||
|
.allEventMasks = pWin->eventMask | wOtherEventMasks(pWin),
|
||||||
|
.doNotPropagateMask = wDontPropagateMask(pWin),
|
||||||
|
.class = pWin->drawable.class,
|
||||||
|
.visualID = wVisual(pWin),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
swapl(&rep.visualID);
|
||||||
|
swaps(&rep.class);
|
||||||
|
swapl(&rep.backingBitPlanes);
|
||||||
|
swapl(&rep.backingPixel);
|
||||||
|
swapl(&rep.colormap);
|
||||||
|
swapl(&rep.allEventMasks);
|
||||||
|
swapl(&rep.yourEventMask);
|
||||||
|
swaps(&rep.doNotPropagateMask);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowPtr
|
WindowPtr
|
||||||
|
|
|
@ -26,6 +26,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#ifndef SWAPREP_H
|
#ifndef SWAPREP_H
|
||||||
#define SWAPREP_H 1
|
#define SWAPREP_H 1
|
||||||
|
|
||||||
|
void SwapFont(xQueryFontReply * pr, Bool hasGlyphs);
|
||||||
|
|
||||||
extern void Swap32Write(ClientPtr /* pClient */ ,
|
extern void Swap32Write(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
CARD32 * /* pbuf */ );
|
CARD32 * /* pbuf */ );
|
||||||
|
@ -42,173 +44,10 @@ extern void SGenericReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xGenericReply * /* pRep */ );
|
xGenericReply * /* pRep */ );
|
||||||
|
|
||||||
extern void SGetWindowAttributesReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetWindowAttributesReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetGeometryReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetGeometryReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryTreeReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryTreeReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SInternAtomReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xInternAtomReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetAtomNameReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetAtomNameReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetPropertyReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetPropertyReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SListPropertiesReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xListPropertiesReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetSelectionOwnerReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetSelectionOwnerReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryPointerReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryPointerReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
|
extern void SwapTimeCoordWrite(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xTimecoord * /* pRep */ );
|
xTimecoord * /* pRep */ );
|
||||||
|
|
||||||
extern void SGetMotionEventsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetMotionEventsReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void STranslateCoordsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xTranslateCoordsReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetInputFocusReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryKeymapReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryKeymapReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryFontReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryFontReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryTextExtentsReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void SListFontsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xListFontsReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SListFontsWithInfoReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xListFontsWithInfoReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetFontPathReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetFontPathReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetImageReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetImageReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SListInstalledColormapsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xListInstalledColormapsReply
|
|
||||||
* /* pRep */ );
|
|
||||||
|
|
||||||
extern void SAllocColorReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xAllocColorReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SAllocNamedColorReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xAllocNamedColorReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void SAllocColorCellsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xAllocColorCellsReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void SAllocColorPlanesReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xAllocColorPlanesReply * /* pRep */
|
|
||||||
);
|
|
||||||
|
|
||||||
extern void SQColorsExtend(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xrgb * /* prgb */ );
|
|
||||||
|
|
||||||
extern void SQueryColorsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryColorsReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SLookupColorReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xLookupColorReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SQueryBestSizeReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xQueryBestSizeReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SListExtensionsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xListExtensionsReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetKeyboardMappingReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetKeyboardMappingReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetPointerMappingReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetPointerMappingReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetModifierMappingReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetModifierMappingReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetKeyboardControlReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetKeyboardControlReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetPointerControlReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetPointerControlReply *
|
|
||||||
/* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetScreenSaverReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xGetScreenSaverReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SLHostsExtend(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
char * /* buf */ );
|
|
||||||
|
|
||||||
extern void SListHostsReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xListHostsReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SErrorEvent(xError * /* from */ ,
|
extern void SErrorEvent(xError * /* from */ ,
|
||||||
xError * /* to */ );
|
xError * /* to */ );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue