Use C99 designated initializers in Xinput Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
6a721e3af5
commit
2f5caeaddb
10
Xi/chgdctl.c
10
Xi/chgdctl.c
|
@ -123,10 +123,12 @@ ProcXChangeDeviceControl(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xChangeDeviceControlReply) {
|
||||||
rep.RepType = X_ChangeDeviceControl;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_ChangeDeviceControl,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
switch (stuff->control) {
|
switch (stuff->control) {
|
||||||
case DEVICE_RESOLUTION:
|
case DEVICE_RESOLUTION:
|
||||||
|
|
12
Xi/getbmap.c
12
Xi/getbmap.c
|
@ -92,11 +92,13 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||||
REQUEST(xGetDeviceButtonMappingReq);
|
REQUEST(xGetDeviceButtonMappingReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceButtonMappingReply) {
|
||||||
rep.RepType = X_GetDeviceButtonMapping;
|
.repType = X_Reply,
|
||||||
rep.nElts = 0;
|
.RepType = X_GetDeviceButtonMapping,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.nElts = 0,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
10
Xi/getdctl.c
10
Xi/getdctl.c
|
@ -182,10 +182,12 @@ ProcXGetDeviceControl(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceControlReply) {
|
||||||
rep.RepType = X_GetDeviceControl;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_GetDeviceControl,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
switch (stuff->control) {
|
switch (stuff->control) {
|
||||||
case DEVICE_RESOLUTION:
|
case DEVICE_RESOLUTION:
|
||||||
|
|
12
Xi/getfctl.c
12
Xi/getfctl.c
|
@ -295,11 +295,13 @@ ProcXGetFeedbackControl(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetFeedbackControlReply) {
|
||||||
rep.RepType = X_GetFeedbackControl;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_GetFeedbackControl,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.num_feedbacks = 0;
|
.length = 0,
|
||||||
|
.num_feedbacks = 0
|
||||||
|
};
|
||||||
|
|
||||||
for (k = dev->kbdfeed; k; k = k->next) {
|
for (k = dev->kbdfeed; k; k = k->next) {
|
||||||
rep.num_feedbacks++;
|
rep.num_feedbacks++;
|
||||||
|
|
|
@ -99,10 +99,12 @@ ProcXGetDeviceFocus(ClientPtr client)
|
||||||
if (!dev->focus)
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceFocusReply) {
|
||||||
rep.RepType = X_GetDeviceFocus;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_GetDeviceFocus,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
focus = dev->focus;
|
focus = dev->focus;
|
||||||
|
|
||||||
|
|
12
Xi/getkmap.c
12
Xi/getkmap.c
|
@ -119,11 +119,13 @@ ProcXGetDeviceKeyMapping(ClientPtr client)
|
||||||
if (!syms)
|
if (!syms)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceKeyMappingReply) {
|
||||||
rep.RepType = X_GetDeviceKeyMapping;
|
.repType = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.RepType = X_GetDeviceKeyMapping,
|
||||||
rep.keySymsPerKeyCode = syms->mapWidth;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = (syms->mapWidth * stuff->count); /* KeySyms are 4 bytes */
|
.keySymsPerKeyCode = syms->mapWidth,
|
||||||
|
.length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */
|
||||||
|
};
|
||||||
WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
|
WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
|
||||||
|
|
||||||
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
|
||||||
|
|
12
Xi/getmmap.c
12
Xi/getmmap.c
|
@ -101,12 +101,14 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceModifierMappingReply) {
|
||||||
rep.RepType = X_GetDeviceModifierMapping;
|
.repType = X_Reply,
|
||||||
rep.numKeyPerModifier = max_keys_per_mod;
|
.RepType = X_GetDeviceModifierMapping,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.numKeyPerModifier = max_keys_per_mod,
|
||||||
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
|
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
|
||||||
rep.length = max_keys_per_mod << 1;
|
.length = max_keys_per_mod << 1
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
|
WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
|
||||||
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
|
WriteToClient(client, max_keys_per_mod * 8, modkeymap);
|
||||||
|
|
12
Xi/getprop.c
12
Xi/getprop.c
|
@ -101,11 +101,13 @@ ProcXGetDeviceDontPropagateList(ClientPtr client)
|
||||||
REQUEST(xGetDeviceDontPropagateListReq);
|
REQUEST(xGetDeviceDontPropagateListReq);
|
||||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceDontPropagateListReply) {
|
||||||
rep.RepType = X_GetDeviceDontPropagateList;
|
.repType = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.RepType = X_GetDeviceDontPropagateList,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.count = 0;
|
.length = 0,
|
||||||
|
.count = 0
|
||||||
|
};
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
@ -102,12 +102,14 @@ ProcXGetSelectedExtensionEvents(ClientPtr client)
|
||||||
REQUEST(xGetSelectedExtensionEventsReq);
|
REQUEST(xGetSelectedExtensionEventsReq);
|
||||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGetSelectedExtensionEventsReply) {
|
||||||
rep.RepType = X_GetSelectedExtensionEvents;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_GetSelectedExtensionEvents,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.this_client_count = 0;
|
.length = 0,
|
||||||
rep.all_clients_count = 0;
|
.this_client_count = 0,
|
||||||
|
.all_clients_count = 0
|
||||||
|
};
|
||||||
|
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
17
Xi/getvers.c
17
Xi/getvers.c
|
@ -98,14 +98,15 @@ ProcXGetExtensionVersion(ClientPtr client)
|
||||||
stuff->nbytes))
|
stuff->nbytes))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(xGetExtensionVersionReply));
|
rep = (xGetExtensionVersionReply) {
|
||||||
rep.repType = X_Reply;
|
.repType = X_Reply,
|
||||||
rep.RepType = X_GetExtensionVersion;
|
.RepType = X_GetExtensionVersion,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
rep.present = TRUE;
|
.major_version = XIVersion.major_version,
|
||||||
rep.major_version = XIVersion.major_version;
|
.minor_version = XIVersion.minor_version,
|
||||||
rep.minor_version = XIVersion.minor_version;
|
.present = TRUE
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep);
|
WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep);
|
||||||
|
|
||||||
|
|
10
Xi/grabdev.c
10
Xi/grabdev.c
|
@ -113,10 +113,12 @@ ProcXGrabDevice(ClientPtr client)
|
||||||
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGrabDeviceReply) {
|
||||||
rep.RepType = X_GrabDevice;
|
.repType = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.RepType = X_GrabDevice,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
};
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
@ -110,13 +110,15 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
||||||
if (dev->valuator->motionHintWindow)
|
if (dev->valuator->motionHintWindow)
|
||||||
MaybeStopDeviceHint(dev, client);
|
MaybeStopDeviceHint(dev, client);
|
||||||
axes = v->numAxes;
|
axes = v->numAxes;
|
||||||
rep.repType = X_Reply;
|
rep = (xGetDeviceMotionEventsReply) {
|
||||||
rep.RepType = X_GetDeviceMotionEvents;
|
.repType = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.RepType = X_GetDeviceMotionEvents,
|
||||||
rep.nEvents = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.axes = axes;
|
.length = 0,
|
||||||
rep.mode = Absolute; /* XXX we don't do relative at the moment */
|
.nEvents = 0,
|
||||||
rep.length = 0;
|
.axes = axes,
|
||||||
|
.mode = Absolute /* XXX we don't do relative at the moment */
|
||||||
|
};
|
||||||
start = ClientTimeToServerTime(stuff->start);
|
start = ClientTimeToServerTime(stuff->start);
|
||||||
stop = ClientTimeToServerTime(stuff->stop);
|
stop = ClientTimeToServerTime(stuff->stop);
|
||||||
if (CompareTimeStamps(start, stop) == LATER ||
|
if (CompareTimeStamps(start, stop) == LATER ||
|
||||||
|
|
11
Xi/listdev.c
11
Xi/listdev.c
|
@ -342,11 +342,12 @@ ProcXListInputDevices(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xListInputDevicesReq);
|
REQUEST_SIZE_MATCH(xListInputDevicesReq);
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(xListInputDevicesReply));
|
rep = (xListInputDevicesReply) {
|
||||||
rep.repType = X_Reply;
|
.repType = X_Reply,
|
||||||
rep.RepType = X_ListInputDevices;
|
.RepType = X_ListInputDevices,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
/* allocate space for saving skip value */
|
/* allocate space for saving skip value */
|
||||||
skip = calloc(sizeof(Bool), inputInfo.numDevices);
|
skip = calloc(sizeof(Bool), inputInfo.numDevices);
|
||||||
|
|
13
Xi/opendev.c
13
Xi/opendev.c
|
@ -117,10 +117,6 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(xOpenDeviceReply));
|
|
||||||
rep.repType = X_Reply;
|
|
||||||
rep.RepType = X_OpenDevice;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
if (dev->key != NULL) {
|
if (dev->key != NULL) {
|
||||||
evbase[j].class = KeyClass;
|
evbase[j].class = KeyClass;
|
||||||
evbase[j++].event_type_base = event_base[KeyClass];
|
evbase[j++].event_type_base = event_base[KeyClass];
|
||||||
|
@ -148,8 +144,13 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
}
|
}
|
||||||
evbase[j].class = OtherClass;
|
evbase[j].class = OtherClass;
|
||||||
evbase[j++].event_type_base = event_base[OtherClass];
|
evbase[j++].event_type_base = event_base[OtherClass];
|
||||||
rep.length = bytes_to_int32(j * sizeof(xInputClassInfo));
|
rep = (xOpenDeviceReply) {
|
||||||
rep.num_classes = j;
|
.repType = X_Reply,
|
||||||
|
.RepType = X_OpenDevice,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = bytes_to_int32(j * sizeof(xInputClassInfo)),
|
||||||
|
.num_classes = j
|
||||||
|
};
|
||||||
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
|
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
|
||||||
WriteToClient(client, j * sizeof(xInputClassInfo), evbase);
|
WriteToClient(client, j * sizeof(xInputClassInfo), evbase);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
14
Xi/queryst.c
14
Xi/queryst.c
|
@ -87,11 +87,6 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
REQUEST(xQueryDeviceStateReq);
|
REQUEST(xQueryDeviceStateReq);
|
||||||
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
|
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
|
||||||
rep.RepType = X_QueryDeviceState;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
|
||||||
if (rc != Success && rc != BadAccess)
|
if (rc != Success && rc != BadAccess)
|
||||||
return rc;
|
return rc;
|
||||||
|
@ -163,8 +158,13 @@ ProcXQueryDeviceState(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.num_classes = num_classes;
|
rep = (xQueryDeviceStateReply) {
|
||||||
rep.length = bytes_to_int32(total_length);
|
.repType = X_Reply,
|
||||||
|
.RepType = X_QueryDeviceState,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = bytes_to_int32(total_length),
|
||||||
|
.num_classes = num_classes
|
||||||
|
};
|
||||||
WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
|
WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
|
||||||
if (total_length > 0)
|
if (total_length > 0)
|
||||||
WriteToClient(client, total_length, savbuf);
|
WriteToClient(client, total_length, savbuf);
|
||||||
|
|
12
Xi/setbmap.c
12
Xi/setbmap.c
|
@ -100,11 +100,13 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xSetDeviceButtonMappingReply) {
|
||||||
rep.RepType = X_SetDeviceButtonMapping;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_SetDeviceButtonMapping,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.status = MappingSuccess;
|
.length = 0,
|
||||||
|
.status = MappingSuccess
|
||||||
|
};
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length,
|
ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length,
|
||||||
|
|
12
Xi/setdval.c
12
Xi/setdval.c
|
@ -92,11 +92,13 @@ ProcXSetDeviceValuators(ClientPtr client)
|
||||||
REQUEST(xSetDeviceValuatorsReq);
|
REQUEST(xSetDeviceValuatorsReq);
|
||||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xSetDeviceValuatorsReply) {
|
||||||
rep.RepType = X_SetDeviceValuators;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_SetDeviceValuators,
|
||||||
rep.status = Success;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
|
.status = Success
|
||||||
|
};
|
||||||
|
|
||||||
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
|
if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) +
|
||||||
stuff->num_valuators)
|
stuff->num_valuators)
|
||||||
|
|
10
Xi/setmmap.c
10
Xi/setmmap.c
|
@ -98,10 +98,12 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||||
(stuff->numKeyPerModifier << 1))
|
(stuff->numKeyPerModifier << 1))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xSetDeviceModifierMappingReply) {
|
||||||
rep.RepType = X_SetDeviceModifierMapping;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_SetDeviceModifierMapping,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess);
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
|
|
10
Xi/setmode.c
10
Xi/setmode.c
|
@ -92,10 +92,12 @@ ProcXSetDeviceMode(ClientPtr client)
|
||||||
REQUEST(xSetDeviceModeReq);
|
REQUEST(xSetDeviceModeReq);
|
||||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xSetDeviceModeReply) {
|
||||||
rep.RepType = X_SetDeviceMode;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_SetDeviceMode,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
|
|
|
@ -75,12 +75,14 @@ ProcXIGetClientPointer(ClientPtr client)
|
||||||
else
|
else
|
||||||
winclient = client;
|
winclient = client;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xXIGetClientPointerReply) {
|
||||||
rep.RepType = X_XIGetClientPointer;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_XIGetClientPointer,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.set = (winclient->clientPtr != NULL);
|
.length = 0,
|
||||||
rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0;
|
.set = (winclient->clientPtr != NULL),
|
||||||
|
.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep);
|
WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -104,11 +104,13 @@ ProcXIGrabDevice(ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xXIGrabDeviceReply) {
|
||||||
rep.RepType = X_XIGrabDevice;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_XIGrabDevice,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.status = status;
|
.length = 0,
|
||||||
|
.status = status
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(rep), &rep);
|
WriteReplyToClient(client, sizeof(rep), &rep);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -78,7 +78,13 @@ int
|
||||||
ProcXIPassiveGrabDevice(ClientPtr client)
|
ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev, mod_dev;
|
DeviceIntPtr dev, mod_dev;
|
||||||
xXIPassiveGrabDeviceReply rep;
|
xXIPassiveGrabDeviceReply rep = {
|
||||||
|
.repType = X_Reply,
|
||||||
|
.RepType = X_XIPassiveGrabDevice,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.num_modifiers = 0
|
||||||
|
};
|
||||||
int i, ret = Success;
|
int i, ret = Success;
|
||||||
uint32_t *modifiers;
|
uint32_t *modifiers;
|
||||||
xXIGrabModifierInfo *modifiers_failed;
|
xXIGrabModifierInfo *modifiers_failed;
|
||||||
|
@ -137,12 +143,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
||||||
xi2mask_set_one_mask(mask.xi2mask, stuff->deviceid,
|
xi2mask_set_one_mask(mask.xi2mask, stuff->deviceid,
|
||||||
(unsigned char *) &stuff[1], mask_len * 4);
|
(unsigned char *) &stuff[1], mask_len * 4);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
|
||||||
rep.RepType = X_XIPassiveGrabDevice;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.num_modifiers = 0;
|
|
||||||
|
|
||||||
memset(¶m, 0, sizeof(param));
|
memset(¶m, 0, sizeof(param));
|
||||||
param.grabtype = XI2;
|
param.grabtype = XI2;
|
||||||
param.ownerEvents = stuff->owner_events;
|
param.ownerEvents = stuff->owner_events;
|
||||||
|
|
|
@ -864,11 +864,13 @@ ProcXListDeviceProperties(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xListDevicePropertiesReply) {
|
||||||
rep.RepType = X_ListDeviceProperties;
|
.repType = X_Reply,
|
||||||
rep.length = natoms;
|
.RepType = X_ListDeviceProperties,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.nAtoms = natoms;
|
.length = natoms,
|
||||||
|
.nAtoms = natoms
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep);
|
WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep);
|
||||||
if (natoms) {
|
if (natoms) {
|
||||||
|
@ -958,15 +960,17 @@ ProcXGetDeviceProperty(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply.repType = X_Reply;
|
reply = (xGetDevicePropertyReply) {
|
||||||
reply.RepType = X_GetDeviceProperty;
|
.repType = X_Reply,
|
||||||
reply.sequenceNumber = client->sequence;
|
.RepType = X_GetDeviceProperty,
|
||||||
reply.deviceid = dev->id;
|
.sequenceNumber = client->sequence,
|
||||||
reply.nItems = nitems;
|
.length = bytes_to_int32(length),
|
||||||
reply.format = format;
|
.propertyType = type,
|
||||||
reply.bytesAfter = bytes_after;
|
.bytesAfter = bytes_after,
|
||||||
reply.propertyType = type;
|
.nItems = nitems,
|
||||||
reply.length = bytes_to_int32(length);
|
.format = format,
|
||||||
|
.deviceid = dev->id
|
||||||
|
};
|
||||||
|
|
||||||
if (stuff->delete && (reply.bytesAfter == 0))
|
if (stuff->delete && (reply.bytesAfter == 0))
|
||||||
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
||||||
|
@ -1100,11 +1104,13 @@ ProcXIListProperties(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xXIListPropertiesReply) {
|
||||||
rep.RepType = X_XIListProperties;
|
.repType = X_Reply,
|
||||||
rep.length = natoms;
|
.RepType = X_XIListProperties,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.num_properties = natoms;
|
.length = natoms,
|
||||||
|
.num_properties = natoms
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep);
|
WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep);
|
||||||
if (natoms) {
|
if (natoms) {
|
||||||
|
@ -1194,14 +1200,16 @@ ProcXIGetProperty(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply.repType = X_Reply;
|
reply = (xXIGetPropertyReply) {
|
||||||
reply.RepType = X_XIGetProperty;
|
.repType = X_Reply,
|
||||||
reply.sequenceNumber = client->sequence;
|
.RepType = X_XIGetProperty,
|
||||||
reply.num_items = nitems;
|
.sequenceNumber = client->sequence,
|
||||||
reply.format = format;
|
.length = bytes_to_int32(length),
|
||||||
reply.bytes_after = bytes_after;
|
.type = type,
|
||||||
reply.type = type;
|
.bytes_after = bytes_after,
|
||||||
reply.length = bytes_to_int32(length);
|
.num_items = nitems,
|
||||||
|
.format = format
|
||||||
|
};
|
||||||
|
|
||||||
if (length && stuff->delete && (reply.bytes_after == 0))
|
if (length && stuff->delete && (reply.bytes_after == 0))
|
||||||
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
send_property_event(dev, stuff->property, XIPropertyDeleted);
|
||||||
|
|
|
@ -107,12 +107,13 @@ ProcXIQueryDevice(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(xXIQueryDeviceReply));
|
rep = (xXIQueryDeviceReply) {
|
||||||
rep.repType = X_Reply;
|
.repType = X_Reply,
|
||||||
rep.RepType = X_XIQueryDevice;
|
.RepType = X_XIQueryDevice,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = len / 4;
|
.length = len / 4,
|
||||||
rep.num_devices = 0;
|
.num_devices = 0
|
||||||
|
};
|
||||||
|
|
||||||
ptr = info;
|
ptr = info;
|
||||||
if (dev) {
|
if (dev) {
|
||||||
|
|
|
@ -121,15 +121,16 @@ ProcXIQueryPointer(ClientPtr client)
|
||||||
|
|
||||||
pSprite = pDev->spriteInfo->sprite;
|
pSprite = pDev->spriteInfo->sprite;
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(rep));
|
rep = (xXIQueryPointerReply) {
|
||||||
rep.repType = X_Reply;
|
.repType = X_Reply,
|
||||||
rep.RepType = X_XIQueryPointer;
|
.RepType = X_XIQueryPointer,
|
||||||
rep.length = 6;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 6,
|
||||||
rep.root = (GetCurrentRootWindow(pDev))->drawable.id;
|
.root = (GetCurrentRootWindow(pDev))->drawable.id,
|
||||||
rep.root_x = FP1616(pSprite->hot.x, 0);
|
.root_x = FP1616(pSprite->hot.x, 0),
|
||||||
rep.root_y = FP1616(pSprite->hot.y, 0);
|
.root_y = FP1616(pSprite->hot.y, 0),
|
||||||
rep.child = None;
|
.child = None
|
||||||
|
};
|
||||||
|
|
||||||
if (kbd) {
|
if (kbd) {
|
||||||
state = &kbd->key->xkbInfo->state;
|
state = &kbd->key->xkbInfo->state;
|
||||||
|
|
|
@ -93,13 +93,14 @@ ProcXIQueryVersion(ClientPtr client)
|
||||||
pXIClient->minor_version = minor;
|
pXIClient->minor_version = minor;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(xXIQueryVersionReply));
|
rep = (xXIQueryVersionReply) {
|
||||||
rep.repType = X_Reply;
|
.repType = X_Reply,
|
||||||
rep.RepType = X_XIQueryVersion;
|
.RepType = X_XIQueryVersion,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
rep.major_version = major;
|
.major_version = major,
|
||||||
rep.minor_version = minor;
|
.minor_version = minor
|
||||||
|
};
|
||||||
|
|
||||||
WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep);
|
WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep);
|
||||||
|
|
||||||
|
|
|
@ -260,11 +260,13 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
reply.repType = X_Reply;
|
reply = (xXIGetSelectedEventsReply) {
|
||||||
reply.RepType = X_XIGetSelectedEvents;
|
.repType = X_Reply,
|
||||||
reply.length = 0;
|
.RepType = X_XIGetSelectedEvents,
|
||||||
reply.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
reply.num_masks = 0;
|
.length = 0,
|
||||||
|
.num_masks = 0
|
||||||
|
};
|
||||||
|
|
||||||
masks = wOtherInputMasks(win);
|
masks = wOtherInputMasks(win);
|
||||||
if (masks) {
|
if (masks) {
|
||||||
|
|
|
@ -97,10 +97,12 @@ ProcXIGetFocus(ClientPtr client)
|
||||||
if (!dev->focus)
|
if (!dev->focus)
|
||||||
return BadDevice;
|
return BadDevice;
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xXIGetFocusReply) {
|
||||||
rep.RepType = X_XIGetFocus;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_XIGetFocus,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
|
|
||||||
if (dev->focus->win == NoneWin)
|
if (dev->focus->win == NoneWin)
|
||||||
rep.focus = None;
|
rep.focus = None;
|
||||||
|
|
Loading…
Reference in New Issue