59
56
#include <dix-config.h>
62
#include <X11/X.h> /* for inputstr.h */
63
#include <X11/Xproto.h> /* Request macro */
64
#include "inputstr.h" /* DeviceIntPtr */
59
#include <X11/X.h> /* for inputstr.h */
60
#include <X11/Xproto.h> /* Request macro */
61
#include "inputstr.h" /* DeviceIntPtr */
65
62
#include <X11/extensions/XI.h>
66
63
#include <X11/extensions/XIproto.h>
67
64
#include "XIstubs.h"
68
65
#include "extnsionst.h"
69
#include "extinit.h" /* LookupDeviceIntRec */
66
#include "extinit.h" /* LookupDeviceIntRec */
70
67
#include "exglobals.h"
72
69
#include "setdval.h"
81
SProcXSetDeviceValuators(client)
82
register ClientPtr client;
78
SProcXSetDeviceValuators(register ClientPtr client)
86
82
REQUEST(xSetDeviceValuatorsReq);
87
83
swaps(&stuff->length, n);
88
return(ProcXSetDeviceValuators(client));
84
return (ProcXSetDeviceValuators(client));
91
87
/***********************************************************************
110
105
rep.status = Success;
111
106
rep.sequenceNumber = client->sequence;
113
if (stuff->length !=(sizeof(xSetDeviceValuatorsReq)>>2) +
114
stuff->num_valuators)
116
SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
120
dev = LookupDeviceIntRec (stuff->deviceid);
123
SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
127
if (dev->valuator == NULL)
129
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
108
if (stuff->length != (sizeof(xSetDeviceValuatorsReq) >> 2) +
109
stuff->num_valuators) {
110
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadLength);
113
dev = LookupDeviceIntRec(stuff->deviceid);
115
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadDevice);
118
if (dev->valuator == NULL) {
119
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadMatch);
134
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
136
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
123
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) {
124
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadValue);
141
128
if ((dev->grab) && !SameClient(dev->grab, client))
142
129
rep.status = AlreadyGrabbed;
144
rep.status = SetDeviceValuators (client, dev, (int *) &stuff[1],
145
stuff->first_valuator, stuff->num_valuators);
131
rep.status = SetDeviceValuators(client, dev, (int *)&stuff[1],
132
stuff->first_valuator,
133
stuff->num_valuators);
147
135
if (rep.status != Success && rep.status != AlreadyGrabbed)
148
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
136
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
151
WriteReplyToClient (client, sizeof (xSetDeviceValuatorsReply), &rep);
139
WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
156
144
/***********************************************************************
164
SRepXSetDeviceValuators (client, size, rep)
167
xSetDeviceValuatorsReply *rep;
152
SRepXSetDeviceValuators(ClientPtr client, int size,
153
xSetDeviceValuatorsReply * rep)
171
157
swaps(&rep->sequenceNumber, n);
172
158
swapl(&rep->length, n);
173
159
WriteToClient(client, size, (char *)rep);