Unverified Commit 05152b78 authored by Mihai Moldovan's avatar Mihai Moldovan

Merge branch 'uli42-pr/update_xi' into arctica-3.6.x

parents e247900e 4598c0c3
......@@ -55,14 +55,14 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "allowev.h"
......@@ -75,15 +75,14 @@ SOFTWARE.
*/
int
SProcXAllowDeviceEvents(client)
register ClientPtr client;
{
SProcXAllowDeviceEvents(register ClientPtr client)
{
REQUEST(xAllowDeviceEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
swapl(&stuff->time);
return(ProcXAllowDeviceEvents(client));
}
return (ProcXAllowDeviceEvents(client));
}
/***********************************************************************
*
......@@ -92,48 +91,44 @@ SProcXAllowDeviceEvents(client)
*/
int
ProcXAllowDeviceEvents(client)
register ClientPtr client;
{
TimeStamp time;
DeviceIntPtr thisdev;
ProcXAllowDeviceEvents(register ClientPtr client)
{
TimeStamp time;
DeviceIntPtr thisdev;
REQUEST(xAllowDeviceEventsReq);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
thisdev = LookupDeviceIntRec (stuff->deviceid);
if (thisdev == NULL)
{
thisdev = LookupDeviceIntRec(stuff->deviceid);
if (thisdev == NULL) {
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadDevice);
return Success;
}
}
time = ClientTimeToServerTime(stuff->time);
switch (stuff->mode)
{
case ReplayThisDevice:
AllowSome(client, time, thisdev, NOT_GRABBED);
break;
case SyncThisDevice:
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
break;
case AsyncThisDevice:
AllowSome(client, time, thisdev, THAWED);
break;
case AsyncOtherDevices:
AllowSome(client, time, thisdev, THAW_OTHERS);
break;
case SyncAll:
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
break;
case AsyncAll:
AllowSome(client, time, thisdev, THAWED_BOTH);
break;
default:
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0,
BadValue);
client->errorValue = stuff->mode;
return Success;
}
return Success;
switch (stuff->mode) {
case ReplayThisDevice:
AllowSome(client, time, thisdev, NOT_GRABBED);
break;
case SyncThisDevice:
AllowSome(client, time, thisdev, FREEZE_NEXT_EVENT);
break;
case AsyncThisDevice:
AllowSome(client, time, thisdev, THAWED);
break;
case AsyncOtherDevices:
AllowSome(client, time, thisdev, THAW_OTHERS);
break;
case SyncAll:
AllowSome(client, time, thisdev, FREEZE_BOTH_NEXT_EVENT);
break;
case AsyncAll:
AllowSome(client, time, thisdev, THAWED_BOTH);
break;
default:
SendErrorToClient(client, IReqCode, X_AllowDeviceEvents, 0, BadValue);
client->errorValue = stuff->mode;
return Success;
}
return Success;
}
......@@ -30,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef ALLOWEV_H
#define ALLOWEV_H 1
int
SProcXAllowDeviceEvents(
ClientPtr /* client */
);
int
ProcXAllowDeviceEvents(
ClientPtr /* client */
);
int SProcXAllowDeviceEvents(ClientPtr /* client */
);
int ProcXAllowDeviceEvents(ClientPtr /* client */
);
#endif /* ALLOWEV_H */
......@@ -55,15 +55,15 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h> /* control constants */
#include <nx-X11/extensions/XIproto.h> /* control constants */
#include "XIstubs.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "chgdctl.h"
......@@ -76,15 +76,14 @@ SOFTWARE.
*/
int
SProcXChangeDeviceControl(client)
register ClientPtr client;
{
SProcXChangeDeviceControl(register ClientPtr client)
{
REQUEST(xChangeDeviceControlReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
swaps(&stuff->control);
return(ProcXChangeDeviceControl(client));
}
return (ProcXChangeDeviceControl(client));
}
/***********************************************************************
*
......@@ -93,9 +92,8 @@ SProcXChangeDeviceControl(client)
*/
int
ProcXChangeDeviceControl(client)
ClientPtr client;
{
ProcXChangeDeviceControl(ClientPtr client)
{
unsigned len;
int i, status;
DeviceIntPtr dev;
......@@ -107,89 +105,73 @@ ProcXChangeDeviceControl(client)
REQUEST(xChangeDeviceControlReq);
REQUEST_AT_LEAST_EXTRA_SIZE(xChangeDeviceControlReq, sizeof(xDeviceCtl));
len = stuff->length - (sizeof(xChangeDeviceControlReq) >>2);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadDevice);
len = stuff->length - (sizeof(xChangeDeviceControlReq) >> 2);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadDevice);
return Success;
}
}
rep.repType = X_Reply;
rep.RepType = X_ChangeDeviceControl;
rep.length = 0;
rep.sequenceNumber = client->sequence;
switch (stuff->control)
{
case DEVICE_RESOLUTION:
r = (xDeviceResolutionCtl *) &stuff[1];
if ((len < (sizeof(xDeviceResolutionCtl)>>2)) ||
(len != (sizeof(xDeviceResolutionCtl)>>2) +
r->num_valuators))
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl,
0, BadLength);
return Success;
}
if (!dev->valuator)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
}
if ((dev->grab) && !SameClient(dev->grab, client))
{
rep.status = AlreadyGrabbed;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
&rep);
return Success;
}
resolution = (CARD32 *) (r + 1);
if (r->first_valuator + r->num_valuators > dev->valuator->numAxes)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
return Success;
}
status = ChangeDeviceControl(client, dev, (xDeviceCtl*) r);
if (status == Success)
{
a = &dev->valuator->axes[r->first_valuator];
for (i=0; i<r->num_valuators; i++)
if (*(resolution+i) < (a+i)->min_resolution ||
*(resolution+i) > (a+i)->max_resolution)
{
SendErrorToClient (client, IReqCode,
X_ChangeDeviceControl, 0, BadValue);
return Success;
}
for (i=0; i<r->num_valuators; i++)
(a++)->resolution = *resolution++;
}
else if (status == DeviceBusy)
{
rep.status = DeviceBusy;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply),
&rep);
return Success;
}
else
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
switch (stuff->control) {
case DEVICE_RESOLUTION:
r = (xDeviceResolutionCtl *) & stuff[1];
if ((len < (sizeof(xDeviceResolutionCtl) >> 2)) ||
(len != (sizeof(xDeviceResolutionCtl) >> 2) + r->num_valuators)) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl,
0, BadLength);
return Success;
}
if (!dev->valuator) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
}
if ((dev->grab) && !SameClient(dev->grab, client)) {
rep.status = AlreadyGrabbed;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
return Success;
}
resolution = (CARD32 *) (r + 1);
if (r->first_valuator + r->num_valuators > dev->valuator->numAxes) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
return Success;
}
status = ChangeDeviceControl(client, dev, (xDeviceCtl *) r);
if (status == Success) {
a = &dev->valuator->axes[r->first_valuator];
for (i = 0; i < r->num_valuators; i++)
if (*(resolution + i) < (a + i)->min_resolution ||
*(resolution + i) > (a + i)->max_resolution) {
SendErrorToClient(client, IReqCode,
X_ChangeDeviceControl, 0, BadValue);
return Success;
}
break;
default:
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
BadValue);
for (i = 0; i < r->num_valuators; i++)
(a++)->resolution = *resolution++;
} else if (status == DeviceBusy) {
rep.status = DeviceBusy;
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
return Success;
} else {
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0,
BadMatch);
return Success;
}
break;
default:
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, BadValue);
return Success;
}
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
return Success;
}
}
/***********************************************************************
*
......@@ -199,13 +181,10 @@ ProcXChangeDeviceControl(client)
*/
void
SRepXChangeDeviceControl (client, size, rep)
ClientPtr client;
int size;
xChangeDeviceControlReply *rep;
{
SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGDCTL_H
#define CHGDCTL_H 1
int
SProcXChangeDeviceControl(
ClientPtr /* client */
);
int
ProcXChangeDeviceControl(
ClientPtr /* client */
);
void
SRepXChangeDeviceControl (
ClientPtr /* client */,
int /* size */,
xChangeDeviceControlReply * /* rep */
);
int SProcXChangeDeviceControl(ClientPtr /* client */
);
int ProcXChangeDeviceControl(ClientPtr /* client */
);
void SRepXChangeDeviceControl(ClientPtr /* client */ ,
int /* size */ ,
xChangeDeviceControlReply * /* rep */
);
#endif /* CHGDCTL_H */
......@@ -30,68 +30,52 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGFCTL_H
#define CHGFCTL_H 1
int
SProcXChangeFeedbackControl(
ClientPtr /* client */
);
int
ProcXChangeFeedbackControl(
ClientPtr /* client */
);
int
ChangeKbdFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
KbdFeedbackPtr /* k */,
xKbdFeedbackCtl * /* f */
);
int
ChangePtrFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
PtrFeedbackPtr /* p */,
xPtrFeedbackCtl * /* f */
);
int
ChangeIntegerFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
IntegerFeedbackPtr /* i */,
xIntegerFeedbackCtl * /* f */
);
int
ChangeStringFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
StringFeedbackPtr /* s */,
xStringFeedbackCtl * /* f */
);
int
ChangeBellFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
BellFeedbackPtr /* b */,
xBellFeedbackCtl * /* f */
);
int
ChangeLedFeedback (
ClientPtr /* client */,
DeviceIntPtr /* dev */,
unsigned long /* mask */,
LedFeedbackPtr /* l */,
xLedFeedbackCtl * /* f */
);
int SProcXChangeFeedbackControl(ClientPtr /* client */
);
int ProcXChangeFeedbackControl(ClientPtr /* client */
);
int ChangeKbdFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
KbdFeedbackPtr /* k */ ,
xKbdFeedbackCtl * /* f */
);
int ChangePtrFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
PtrFeedbackPtr /* p */ ,
xPtrFeedbackCtl * /* f */
);
int ChangeIntegerFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
IntegerFeedbackPtr /* i */ ,
xIntegerFeedbackCtl * /* f */
);
int ChangeStringFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
StringFeedbackPtr /* s */ ,
xStringFeedbackCtl * /* f */
);
int ChangeBellFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
BellFeedbackPtr /* b */ ,
xBellFeedbackCtl * /* f */
);
int ChangeLedFeedback(ClientPtr /* client */ ,
DeviceIntPtr /* dev */ ,
unsigned long /* mask */ ,
LedFeedbackPtr /* l */ ,
xLedFeedbackCtl * /* f */
);
#endif /* CHGFCTL_H */
......@@ -55,15 +55,15 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "XIstubs.h"
#include "globals.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
......@@ -78,14 +78,13 @@ SOFTWARE.
*/
int
SProcXChangeKeyboardDevice(client)
register ClientPtr client;
{
SProcXChangeKeyboardDevice(register ClientPtr client)
{
REQUEST(xChangeKeyboardDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return(ProcXChangeKeyboardDevice(client));
}
return (ProcXChangeKeyboardDevice(client));
}
/***********************************************************************
*
......@@ -95,17 +94,16 @@ SProcXChangeKeyboardDevice(client)
*/
int
ProcXChangeKeyboardDevice (client)
register ClientPtr client;
{
int i;
DeviceIntPtr xkbd = inputInfo.keyboard;
DeviceIntPtr dev;
FocusClassPtr xf = xkbd->focus;
FocusClassPtr df;
KeyClassPtr k;
xChangeKeyboardDeviceReply rep;
changeDeviceNotify ev;
ProcXChangeKeyboardDevice(register ClientPtr client)
{
int i;
DeviceIntPtr xkbd = inputInfo.keyboard;
DeviceIntPtr dev;
FocusClassPtr xf = xkbd->focus;
FocusClassPtr df;
KeyClassPtr k;
xChangeKeyboardDeviceReply rep;
changeDeviceNotify ev;
REQUEST(xChangeKeyboardDeviceReq);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
......@@ -115,79 +113,75 @@ ProcXChangeKeyboardDevice (client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
rep.status = -1;
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
return Success;
}
}
k = dev->key;
if (k == NULL)
{
if (k == NULL) {
rep.status = -1;
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadMatch);
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadMatch);
return Success;
}
}
if (((dev->grab) && !SameClient(dev->grab, client)) ||
((xkbd->grab) && !SameClient(xkbd->grab, client)))
((xkbd->grab) && !SameClient(xkbd->grab, client)))
rep.status = AlreadyGrabbed;
else if ((dev->sync.frozen &&
dev->sync.other && !SameClient(dev->sync.other, client)) ||
dev->sync.other && !SameClient(dev->sync.other, client)) ||
(xkbd->sync.frozen &&
xkbd->sync.other && !SameClient(xkbd->sync.other, client)))
rep.status = GrabFrozen;
else
{
if (ChangeKeyboardDevice (xkbd, dev) != Success)
{
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
else {
if (ChangeKeyboardDevice(xkbd, dev) != Success) {
SendErrorToClient(client, IReqCode, X_ChangeKeyboardDevice, 0,
BadDevice);
return Success;
}
}
if (!dev->focus)
InitFocusClassDeviceStruct (dev);
InitFocusClassDeviceStruct(dev);
if (!dev->kbdfeed)
InitKbdFeedbackClassDeviceStruct(dev, (BellProcPtr)NoopDDA,
(KbdCtrlProcPtr)NoopDDA);
InitKbdFeedbackClassDeviceStruct(dev, (BellProcPtr) NoopDDA,
(KbdCtrlProcPtr) NoopDDA);
df = dev->focus;
df->win = xf->win;
df->revert = xf->revert;
df->time = xf->time;
df->traceGood = xf->traceGood;
if (df->traceSize != xf->traceSize)
{
Must_have_memory = TRUE; /* XXX */
df->trace = (WindowPtr *) realloc(df->trace,
xf->traceSize * sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
if (df->traceSize != xf->traceSize) {
Must_have_memory = TRUE; /* XXX */
df->trace = (WindowPtr *) realloc(df->trace,
xf->traceSize *
sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
}
df->traceSize = xf->traceSize;
for (i=0; i<df->traceSize; i++)
for (i = 0; i < df->traceSize; i++)
df->trace[i] = xf->trace[i];
RegisterOtherDevice (xkbd);
RegisterKeyboardDevice (dev);
RegisterOtherDevice(xkbd);
RegisterKeyboardDevice(dev);
ev.type = ChangeDeviceNotify;
ev.deviceid = stuff->deviceid;
ev.time = currentTime.milliseconds;
ev.request = NewKeyboard;
SendEventToAllWindows (dev, ChangeDeviceNotifyMask, (xEvent *)&ev, 1);
SendMappingNotify (MappingKeyboard, k->curKeySyms.minKeyCode,
k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode + 1,client);
SendEventToAllWindows(dev, ChangeDeviceNotifyMask, (xEvent *) & ev, 1);
SendMappingNotify(MappingKeyboard, k->curKeySyms.minKeyCode,
k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode +
1, client);
rep.status = 0;
}
}
WriteReplyToClient (client, sizeof (xChangeKeyboardDeviceReply),
&rep);
WriteReplyToClient(client, sizeof(xChangeKeyboardDeviceReply), &rep);
return Success;
}
}
/***********************************************************************
*
......@@ -197,12 +191,10 @@ ProcXChangeKeyboardDevice (client)
*/
void
SRepXChangeKeyboardDevice (client, size, rep)
ClientPtr client;
int size;
xChangeKeyboardDeviceReply *rep;
{
SRepXChangeKeyboardDevice(ClientPtr client, int size,
xChangeKeyboardDeviceReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,22 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGKBD_H
#define CHGKBD_H 1
int
SProcXChangeKeyboardDevice(
ClientPtr /* client */
);
int
ProcXChangeKeyboardDevice (
ClientPtr /* client */
);
void
SRepXChangeKeyboardDevice (
ClientPtr /* client */,
int /* size */,
xChangeKeyboardDeviceReply * /* rep */
);
int SProcXChangeKeyboardDevice(ClientPtr /* client */
);
int ProcXChangeKeyboardDevice(ClientPtr /* client */
);
void SRepXChangeKeyboardDevice(ClientPtr /* client */ ,
int /* size */ ,
xChangeKeyboardDeviceReply * /* rep */
);
#endif /* CHGKBD_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
......@@ -75,9 +75,8 @@ SOFTWARE.
*/
int
SProcXChangeDeviceKeyMapping(client)
register ClientPtr client;
{
SProcXChangeDeviceKeyMapping(register ClientPtr client)
{
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
......@@ -86,8 +85,8 @@ SProcXChangeDeviceKeyMapping(client)
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), count);
return(ProcXChangeDeviceKeyMapping(client));
}
return (ProcXChangeDeviceKeyMapping(client));
}
/***********************************************************************
*
......@@ -96,10 +95,9 @@ SProcXChangeDeviceKeyMapping(client)
*/
int
ProcXChangeDeviceKeyMapping(client)
register ClientPtr client;
{
int ret;
ProcXChangeDeviceKeyMapping(register ClientPtr client)
{
int ret;
unsigned len;
DeviceIntPtr dev;
unsigned int count;
......@@ -110,21 +108,19 @@ ProcXChangeDeviceKeyMapping(client)
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceKeyMapping, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceKeyMapping, 0,
BadDevice);
return Success;
}
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
}
len = stuff->length - (sizeof(xChangeDeviceKeyMappingReq) >> 2);
ret = ChangeKeyMapping (client, dev, len, DeviceMappingNotify,
stuff->firstKeyCode, stuff->keyCodes, stuff->keySymsPerKeyCode,
(KeySym *)&stuff[1]);
ret = ChangeKeyMapping(client, dev, len, DeviceMappingNotify,
stuff->firstKeyCode, stuff->keyCodes,
stuff->keySymsPerKeyCode, (KeySym *) & stuff[1]);
if (ret != Success)
SendErrorToClient (client, IReqCode, X_ChangeDeviceKeyMapping, 0,
ret);
SendErrorToClient(client, IReqCode, X_ChangeDeviceKeyMapping, 0, ret);
return Success;
}
}
......@@ -30,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGKMAP_H
#define CHGKMAP_H 1
int
SProcXChangeDeviceKeyMapping(
ClientPtr /* client */
);
int
ProcXChangeDeviceKeyMapping(
ClientPtr /* client */
);
int SProcXChangeDeviceKeyMapping(ClientPtr /* client */
);
int ProcXChangeDeviceKeyMapping(ClientPtr /* client */
);
#endif /* CHGKMAP_H */
......@@ -55,14 +55,14 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h"
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
......@@ -77,9 +77,8 @@ SOFTWARE.
*/
int
SProcXChangeDeviceDontPropagateList(client)
register ClientPtr client;
{
SProcXChangeDeviceDontPropagateList(register ClientPtr client)
{
REQUEST(xChangeDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
......@@ -88,8 +87,8 @@ SProcXChangeDeviceDontPropagateList(client)
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
return(ProcXChangeDeviceDontPropagateList(client));
}
return (ProcXChangeDeviceDontPropagateList(client));
}
/***********************************************************************
*
......@@ -98,51 +97,47 @@ SProcXChangeDeviceDontPropagateList(client)
*/
int
ProcXChangeDeviceDontPropagateList (client)
register ClientPtr client;
{
int i;
WindowPtr pWin;
struct tmask tmp[EMASKSIZE];
OtherInputMasks *others;
ProcXChangeDeviceDontPropagateList(register ClientPtr client)
{
int i;
WindowPtr pWin;
struct tmask tmp[EMASKSIZE];
OtherInputMasks *others;
REQUEST(xChangeDeviceDontPropagateListReq);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
if (stuff->length !=(sizeof(xChangeDeviceDontPropagateListReq)>>2) +
stuff->count)
{
SendErrorToClient (client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadLength);
if (stuff->length != (sizeof(xChangeDeviceDontPropagateListReq) >> 2) +
stuff->count) {
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadLength);
return Success;
}
}
pWin = (WindowPtr) LookupWindow (stuff->window, client);
if (!pWin)
{
pWin = (WindowPtr) LookupWindow(stuff->window, client);
if (!pWin) {
client->errorValue = stuff->window;
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadWindow);
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadWindow);
return Success;
}
}
if (stuff->mode != AddToList && stuff->mode != DeleteFromList)
{
if (stuff->mode != AddToList && stuff->mode != DeleteFromList) {
client->errorValue = stuff->window;
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadMode);
SendErrorToClient(client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadMode);
return Success;
}
}
if (CreateMaskFromList (client, (XEventClass *)&stuff[1],
stuff->count, tmp, NULL, X_ChangeDeviceDontPropagateList) != Success)
return Success;
if (CreateMaskFromList(client, (XEventClass *) & stuff[1],
stuff->count, tmp, NULL,
X_ChangeDeviceDontPropagateList) != Success)
return Success;
others = wOtherInputMasks(pWin);
if (!others && stuff->mode == DeleteFromList)
return Success;
for (i=0; i<EMASKSIZE; i++)
{
for (i = 0; i < EMASKSIZE; i++) {
if (tmp[i].mask == 0)
continue;
......@@ -151,13 +146,13 @@ ProcXChangeDeviceDontPropagateList (client)
else if (others)
tmp[i].mask |= others->dontPropagateMask[i];
if (DeviceEventSuppressForWindow (pWin,client,tmp[i].mask,i) != Success)
{
SendErrorToClient ( client, IReqCode, X_ChangeDeviceDontPropagateList, 0,
BadClass);
if (DeviceEventSuppressForWindow(pWin, client, tmp[i].mask, i) !=
Success) {
SendErrorToClient(client, IReqCode,
X_ChangeDeviceDontPropagateList, 0, BadClass);
return Success;
}
}
}
return Success;
}
}
......@@ -30,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGPROP_H
#define CHGPROP_H 1
int
SProcXChangeDeviceDontPropagateList (
ClientPtr /* client */
);
int
ProcXChangeDeviceDontPropagateList (
ClientPtr /* client */
);
int SProcXChangeDeviceDontPropagateList(ClientPtr /* client */
);
int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */
);
#endif /* CHGPROP_H */
......@@ -55,17 +55,17 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "XIstubs.h"
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "dixevents.h"
#include "exevents.h"
......@@ -81,14 +81,13 @@ SOFTWARE.
*/
int
SProcXChangePointerDevice(client)
register ClientPtr client;
{
SProcXChangePointerDevice(register ClientPtr client)
{
REQUEST(xChangePointerDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
return(ProcXChangePointerDevice(client));
}
return (ProcXChangePointerDevice(client));
}
/***********************************************************************
*
......@@ -97,14 +96,13 @@ SProcXChangePointerDevice(client)
*/
int
ProcXChangePointerDevice (client)
register ClientPtr client;
{
DeviceIntPtr xptr = inputInfo.pointer;
DeviceIntPtr dev;
ValuatorClassPtr v;
xChangePointerDeviceReply rep;
changeDeviceNotify ev;
ProcXChangePointerDevice(register ClientPtr client)
{
DeviceIntPtr xptr = inputInfo.pointer;
DeviceIntPtr dev;
ValuatorClassPtr v;
xChangePointerDeviceReply rep;
changeDeviceNotify ev;
REQUEST(xChangePointerDeviceReq);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
......@@ -114,75 +112,68 @@ ProcXChangePointerDevice (client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
rep.status = -1;
SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
BadDevice);
SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
BadDevice);
return Success;
}
}
v = dev->valuator;
if (v == NULL || v->numAxes < 2 ||
stuff->xaxis >= v->numAxes ||
stuff->yaxis >= v->numAxes)
{
if (v == NULL || v->numAxes < 2 ||
stuff->xaxis >= v->numAxes || stuff->yaxis >= v->numAxes) {
rep.status = -1;
SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0, BadMatch);
return Success;
}
}
if (((dev->grab) && !SameClient(dev->grab, client)) ||
((xptr->grab) && !SameClient(xptr->grab, client)))
((xptr->grab) && !SameClient(xptr->grab, client)))
rep.status = AlreadyGrabbed;
else if ((dev->sync.frozen &&
dev->sync.other && !SameClient(dev->sync.other, client)) ||
dev->sync.other && !SameClient(dev->sync.other, client)) ||
(xptr->sync.frozen &&
xptr->sync.other && !SameClient(xptr->sync.other, client)))
rep.status = GrabFrozen;
else
{
if (ChangePointerDevice (
xptr, dev, stuff->xaxis, stuff->yaxis) != Success)
{
SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
BadDevice);
else {
if (ChangePointerDevice(xptr, dev, stuff->xaxis, stuff->yaxis) !=
Success) {
SendErrorToClient(client, IReqCode, X_ChangePointerDevice, 0,
BadDevice);
return Success;
}
}
if (dev->focus)
DeleteFocusClassDeviceStruct(dev);
if (!dev->button)
InitButtonClassDeviceStruct (dev, 0, NULL);
InitButtonClassDeviceStruct(dev, 0, NULL);
if (!dev->ptrfeed)
InitPtrFeedbackClassDeviceStruct(dev, (PtrCtrlProcPtr)NoopDDA);
RegisterOtherDevice (xptr);
RegisterPointerDevice (dev);
InitPtrFeedbackClassDeviceStruct(dev, (PtrCtrlProcPtr) NoopDDA);
RegisterOtherDevice(xptr);
RegisterPointerDevice(dev);
ev.type = ChangeDeviceNotify;
ev.deviceid = stuff->deviceid;
ev.time = currentTime.milliseconds;
ev.request = NewPointer;
SendEventToAllWindows (dev, ChangeDeviceNotifyMask, (xEvent *)&ev, 1);
SendMappingNotify (MappingPointer, 0, 0, client);
SendEventToAllWindows(dev, ChangeDeviceNotifyMask, (xEvent *) & ev, 1);
SendMappingNotify(MappingPointer, 0, 0, client);
rep.status = 0;
}
}
WriteReplyToClient (client, sizeof (xChangePointerDeviceReply),
&rep);
WriteReplyToClient(client, sizeof(xChangePointerDeviceReply), &rep);
return Success;
}
}
void
DeleteFocusClassDeviceStruct(dev)
DeviceIntPtr dev;
{
DeleteFocusClassDeviceStruct(DeviceIntPtr dev)
{
free(dev->focus->trace);
free(dev->focus);
dev->focus = NULL;
}
}
/***********************************************************************
*
......@@ -191,23 +182,18 @@ DeleteFocusClassDeviceStruct(dev)
*/
void
SendEventToAllWindows (dev, mask, ev, count)
DeviceIntPtr dev;
Mask mask;
xEvent *ev;
int count;
{
SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count)
{
int i;
WindowPtr pWin, p1;
for (i=0; i<screenInfo.numScreens; i++)
{
for (i = 0; i < screenInfo.numScreens; i++) {
pWin = screenInfo.screens[i]->root;
(void)DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, dev->id);
p1 = pWin->firstChild;
FindInterestedChildren (dev, p1, mask, ev, count);
}
FindInterestedChildren(dev, p1, mask, ev, count);
}
}
/***********************************************************************
*
......@@ -217,23 +203,18 @@ SendEventToAllWindows (dev, mask, ev, count)
*/
void
FindInterestedChildren (dev, p1, mask, ev, count)
DeviceIntPtr dev;
WindowPtr p1;
Mask mask;
xEvent *ev;
int count;
{
FindInterestedChildren(DeviceIntPtr dev, WindowPtr p1, Mask mask,
xEvent * ev, int count)
{
WindowPtr p2;
while (p1)
{
p2 = p1->firstChild;
while (p1) {
p2 = p1->firstChild;
(void)DeliverEventsToWindow(p1, ev, count, mask, NullGrab, dev->id);
FindInterestedChildren (dev, p2, mask, ev, count);
FindInterestedChildren(dev, p2, mask, ev, count);
p1 = p1->nextSib;
}
}
}
/***********************************************************************
*
......@@ -243,12 +224,10 @@ FindInterestedChildren (dev, p1, mask, ev, count)
*/
void
SRepXChangePointerDevice (client, size, rep)
ClientPtr client;
int size;
xChangePointerDeviceReply *rep;
{
SRepXChangePointerDevice(ClientPtr client, int size,
xChangePointerDeviceReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,43 +30,32 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CHGPTR_H
#define CHGPTR_H 1
int
SProcXChangePointerDevice(
ClientPtr /* client */
);
int
ProcXChangePointerDevice (
ClientPtr /* client */
);
void
DeleteFocusClassDeviceStruct(
DeviceIntPtr /* dev */
);
void
SendEventToAllWindows (
DeviceIntPtr /* dev */,
Mask /* mask */,
xEvent * /* ev */,
int /* count */
);
void
FindInterestedChildren ( /* FIXME: could be static? */
DeviceIntPtr /* dev */,
WindowPtr /* p1 */,
Mask /* mask */,
xEvent * /* ev */,
int /* count */
);
void
SRepXChangePointerDevice (
ClientPtr /* client */,
int /* size */,
xChangePointerDeviceReply * /* rep */
);
int SProcXChangePointerDevice(ClientPtr /* client */
);
int ProcXChangePointerDevice(ClientPtr /* client */
);
void DeleteFocusClassDeviceStruct(DeviceIntPtr /* dev */
);
void SendEventToAllWindows(DeviceIntPtr /* dev */ ,
Mask /* mask */ ,
xEvent * /* ev */ ,
int /* count */
);
void FindInterestedChildren( /* FIXME: could be static? */
DeviceIntPtr /* dev */ ,
WindowPtr /* p1 */ ,
Mask /* mask */ ,
xEvent * /* ev */ ,
int /* count */
);
void SRepXChangePointerDevice(ClientPtr /* client */ ,
int /* size */ ,
xChangePointerDeviceReply * /* rep */
);
#endif /* CHGPTR_H */
......@@ -55,16 +55,16 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include "scrnintstr.h" /* screen structure */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "XIstubs.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "closedev.h"
......@@ -76,14 +76,13 @@ SOFTWARE.
*/
int
SProcXCloseDevice(client)
register ClientPtr client;
{
SProcXCloseDevice(register ClientPtr client)
{
REQUEST(xCloseDeviceReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
return(ProcXCloseDevice(client));
}
return (ProcXCloseDevice(client));
}
/***********************************************************************
*
......@@ -92,41 +91,38 @@ SProcXCloseDevice(client)
*/
int
ProcXCloseDevice(client)
register ClientPtr client;
{
int i;
WindowPtr pWin, p1;
DeviceIntPtr d;
ProcXCloseDevice(register ClientPtr client)
{
int i;
WindowPtr pWin, p1;
DeviceIntPtr d;
REQUEST(xCloseDeviceReq);
REQUEST_SIZE_MATCH(xCloseDeviceReq);
d = LookupDeviceIntRec (stuff->deviceid);
if (d == NULL)
{
d = LookupDeviceIntRec(stuff->deviceid);
if (d == NULL) {
SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice);
return Success;
}
return Success;
}
if (d->grab && SameClient(d->grab, client))
(*d->DeactivateGrab)(d); /* release active grab */
(*d->DeactivateGrab) (d); /* release active grab */
/* Remove event selections from all windows for events from this device
and selected by this client.
Delete passive grabs from all windows for this device. */
* and selected by this client.
* Delete passive grabs from all windows for this device. */
for (i=0; i<screenInfo.numScreens; i++)
{
for (i = 0; i < screenInfo.numScreens; i++) {
pWin = screenInfo.screens[i]->root;
DeleteDeviceEvents (d, pWin, client);
DeleteDeviceEvents(d, pWin, client);
p1 = pWin->firstChild;
DeleteEventsFromChildren (d, p1, client);
}
DeleteEventsFromChildren(d, p1, client);
}
CloseInputDevice (d, client);
CloseInputDevice(d, client);
return Success;
}
}
/***********************************************************************
*
......@@ -136,21 +132,17 @@ ProcXCloseDevice(client)
*/
void
DeleteEventsFromChildren(dev, p1, client)
DeviceIntPtr dev;
WindowPtr p1;
ClientPtr client;
{
DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
{
WindowPtr p2;
while (p1)
{
p2 = p1->firstChild;
DeleteDeviceEvents (dev, p1, client);
while (p1) {
p2 = p1->firstChild;
DeleteDeviceEvents(dev, p1, client);
DeleteEventsFromChildren(dev, p2, client);
p1 = p1->nextSib;
}
}
}
/***********************************************************************
*
......@@ -160,26 +152,21 @@ DeleteEventsFromChildren(dev, p1, client)
*/
void
DeleteDeviceEvents (dev, pWin, client)
DeviceIntPtr dev;
WindowPtr pWin;
ClientPtr client;
{
InputClientsPtr others;
OtherInputMasks *pOthers;
GrabPtr grab, next;
DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
{
InputClientsPtr others;
OtherInputMasks *pOthers;
GrabPtr grab, next;
if ((pOthers = wOtherInputMasks(pWin)) != 0)
for (others=pOthers->inputClients; others;
others = others->next)
if (SameClient(others,client))
for (others = pOthers->inputClients; others; others = others->next)
if (SameClient(others, client))
others->mask[dev->id] = NoEventMask;
for (grab = wPassiveGrabs(pWin); grab; grab=next)
{
for (grab = wPassiveGrabs(pWin); grab; grab = next) {
next = grab->next;
if ((grab->device == dev) &&
(client->clientAsMask == CLIENT_BITS(grab->resource)))
FreeResource (grab->resource, RT_NONE);
}
FreeResource(grab->resource, RT_NONE);
}
}
......@@ -30,28 +30,20 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CLOSEDEV_H
#define CLOSEDEV_H 1
int
SProcXCloseDevice(
ClientPtr /* client */
);
int
ProcXCloseDevice(
ClientPtr /* client */
);
void
DeleteEventsFromChildren(
DeviceIntPtr /* dev */,
WindowPtr /* p1 */,
ClientPtr /* client */
);
void
DeleteDeviceEvents (
DeviceIntPtr /* dev */,
WindowPtr /* pWin */,
ClientPtr /* client */
);
int SProcXCloseDevice(ClientPtr /* client */
);
int ProcXCloseDevice(ClientPtr /* client */
);
void DeleteEventsFromChildren(DeviceIntPtr /* dev */ ,
WindowPtr /* p1 */ ,
ClientPtr /* client */
);
void DeleteDeviceEvents(DeviceIntPtr /* dev */ ,
WindowPtr /* pWin */ ,
ClientPtr /* client */
);
#endif /* CLOSEDEV_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "devbell.h"
......@@ -74,13 +74,12 @@ SOFTWARE.
*/
int
SProcXDeviceBell(client)
register ClientPtr client;
{
SProcXDeviceBell(register ClientPtr client)
{
REQUEST(xDeviceBellReq);
swaps(&stuff->length);
return(ProcXDeviceBell(client));
}
return (ProcXDeviceBell(client));
}
/***********************************************************************
*
......@@ -89,9 +88,8 @@ SProcXDeviceBell(client)
*/
int
ProcXDeviceBell (client)
register ClientPtr client;
{
ProcXDeviceBell(register ClientPtr client)
{
DeviceIntPtr dev;
KbdFeedbackPtr k;
BellFeedbackPtr b;
......@@ -104,64 +102,55 @@ ProcXDeviceBell (client)
REQUEST(xDeviceBellReq);
REQUEST_SIZE_MATCH(xDeviceBellReq);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
client->errorValue = stuff->deviceid;
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadDevice);
return Success;
}
}
if (stuff->percent < -100 || stuff->percent > 100)
{
if (stuff->percent < -100 || stuff->percent > 100) {
client->errorValue = stuff->percent;
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
return Success;
}
if (stuff->feedbackclass == KbdFeedbackClass)
{
for (k=dev->kbdfeed; k; k=k->next)
}
if (stuff->feedbackclass == KbdFeedbackClass) {
for (k = dev->kbdfeed; k; k = k->next)
if (k->ctrl.id == stuff->feedbackid)
break;
if (!k)
{
if (!k) {
client->errorValue = stuff->feedbackid;
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
return Success;
}
}
base = k->ctrl.bell;
proc = k->BellProc;
ctrl = (void *) &(k->ctrl);
class = KbdFeedbackClass;
}
else if (stuff->feedbackclass == BellFeedbackClass)
{
for (b=dev->bell; b; b=b->next)
} else if (stuff->feedbackclass == BellFeedbackClass) {
for (b = dev->bell; b; b = b->next)
if (b->ctrl.id == stuff->feedbackid)
break;
if (!b)
{
if (!b) {
client->errorValue = stuff->feedbackid;
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
return Success;
}
}
base = b->ctrl.percent;
proc = b->BellProc;
ctrl = (void *) &(b->ctrl);
class = BellFeedbackClass;
}
else
{
} else {
client->errorValue = stuff->feedbackclass;
SendErrorToClient(client, IReqCode, X_DeviceBell, 0, BadValue);
return Success;
}
}
newpercent = (base * stuff->percent) / 100;
if (stuff->percent < 0)
newpercent = base + newpercent;
newpercent = base + newpercent;
else
newpercent = base - newpercent + stuff->percent;
(*proc)(newpercent, dev, ctrl, class);
newpercent = base - newpercent + stuff->percent;
(*proc) (newpercent, dev, ctrl, class);
return Success;
}
}
......@@ -30,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef DEVBELL_H
#define DEVBELL_H 1
int
SProcXDeviceBell (
ClientPtr /* client */
);
int
ProcXDeviceBell (
ClientPtr /* client */
);
int SProcXDeviceBell(ClientPtr /* client */
);
int ProcXDeviceBell(ClientPtr /* client */
);
#endif /* DEVBELL_H */
......@@ -35,45 +35,45 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef EXGLOBALS_H
#define EXGLOBALS_H 1
extern int IReqCode;
extern int BadDevice;
extern int BadEvent;
extern int BadMode;
extern int DeviceBusy;
extern int BadClass;
extern int IReqCode;
extern int BadDevice;
extern int BadEvent;
extern int BadMode;
extern int DeviceBusy;
extern int BadClass;
extern Mask DevicePointerMotionMask;
extern Mask DevicePointerMotionHintMask;
extern Mask DeviceFocusChangeMask;
extern Mask DeviceStateNotifyMask;
extern Mask ChangeDeviceNotifyMask;
extern Mask DeviceMappingNotifyMask;
extern Mask DeviceOwnerGrabButtonMask;
extern Mask DeviceButtonGrabMask;
extern Mask DeviceButtonMotionMask;
extern Mask PropagateMask[];
extern Mask DevicePointerMotionMask;
extern Mask DevicePointerMotionHintMask;
extern Mask DeviceFocusChangeMask;
extern Mask DeviceStateNotifyMask;
extern Mask ChangeDeviceNotifyMask;
extern Mask DeviceMappingNotifyMask;
extern Mask DeviceOwnerGrabButtonMask;
extern Mask DeviceButtonGrabMask;
extern Mask DeviceButtonMotionMask;
extern Mask PropagateMask[];
extern int DeviceValuator;
extern int DeviceKeyPress;
extern int DeviceKeyRelease;
extern int DeviceButtonPress;
extern int DeviceButtonRelease;
extern int DeviceMotionNotify;
extern int DeviceFocusIn;
extern int DeviceFocusOut;
extern int ProximityIn;
extern int ProximityOut;
extern int DeviceStateNotify;
extern int DeviceKeyStateNotify;
extern int DeviceButtonStateNotify;
extern int DeviceMappingNotify;
extern int ChangeDeviceNotify;
extern int DeviceValuator;
extern int DeviceKeyPress;
extern int DeviceKeyRelease;
extern int DeviceButtonPress;
extern int DeviceButtonRelease;
extern int DeviceMotionNotify;
extern int DeviceFocusIn;
extern int DeviceFocusOut;
extern int ProximityIn;
extern int ProximityOut;
extern int DeviceStateNotify;
extern int DeviceKeyStateNotify;
extern int DeviceButtonStateNotify;
extern int DeviceMappingNotify;
extern int ChangeDeviceNotify;
extern int RT_INPUTCLIENT;
extern int RT_INPUTCLIENT;
#if 0
/* FIXME: in dix */
extern InputInfo inputInfo;
extern InputInfo inputInfo;
#endif
#endif /* EXGLOBALS_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "getbmap.h"
......@@ -73,13 +73,12 @@ SOFTWARE.
*/
int
SProcXGetDeviceButtonMapping(client)
register ClientPtr client;
{
SProcXGetDeviceButtonMapping(register ClientPtr client)
{
REQUEST(xGetDeviceButtonMappingReq);
swaps(&stuff->length);
return(ProcXGetDeviceButtonMapping(client));
}
return (ProcXGetDeviceButtonMapping(client));
}
/***********************************************************************
*
......@@ -88,12 +87,11 @@ SProcXGetDeviceButtonMapping(client)
*/
int
ProcXGetDeviceButtonMapping (client)
register ClientPtr client;
{
DeviceIntPtr dev;
xGetDeviceButtonMappingReply rep;
ButtonClassPtr b;
ProcXGetDeviceButtonMapping(register ClientPtr client)
{
DeviceIntPtr dev;
xGetDeviceButtonMappingReply rep;
ButtonClassPtr b;
REQUEST(xGetDeviceButtonMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
......@@ -104,28 +102,25 @@ ProcXGetDeviceButtonMapping (client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
BadDevice);
return Success;
}
}
b = dev->button;
if (b == NULL)
{
SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
BadMatch);
if (b == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
BadMatch);
return Success;
}
}
rep.nElts = b->numButtons;
rep.length = (rep.nElts + (4-1))/4;
WriteReplyToClient (client, sizeof (xGetDeviceButtonMappingReply), &rep);
WriteToClient(client, rep.nElts,
(char *)&b->map[1]);
rep.length = (rep.nElts + (4 - 1)) / 4;
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
WriteToClient(client, rep.nElts, &b->map[1]);
return Success;
}
}
/***********************************************************************
*
......@@ -135,12 +130,10 @@ ProcXGetDeviceButtonMapping (client)
*/
void
SRepXGetDeviceButtonMapping (client, size, rep)
ClientPtr client;
int size;
xGetDeviceButtonMappingReply *rep;
{
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
xGetDeviceButtonMappingReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETBMAP_H
#define GETBMAP_H 1
int
SProcXGetDeviceButtonMapping(
ClientPtr /* client */
);
int
ProcXGetDeviceButtonMapping (
ClientPtr /* client */
);
void
SRepXGetDeviceButtonMapping (
ClientPtr /* client */,
int /* size */,
xGetDeviceButtonMappingReply * /* rep */
);
int SProcXGetDeviceButtonMapping(ClientPtr /* client */
);
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
);
void SRepXGetDeviceButtonMapping(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceButtonMappingReply * /* rep */
);
#endif /* GETBMAP_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "getdctl.h"
......@@ -74,15 +74,14 @@ SOFTWARE.
*/
int
SProcXGetDeviceControl(client)
register ClientPtr client;
{
SProcXGetDeviceControl(register ClientPtr client)
{
REQUEST(xGetDeviceControlReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
swaps(&stuff->control);
return(ProcXGetDeviceControl(client));
}
return (ProcXGetDeviceControl(client));
}
/***********************************************************************
*
......@@ -91,10 +90,9 @@ SProcXGetDeviceControl(client)
*/
int
ProcXGetDeviceControl(client)
ClientPtr client;
{
int total_length = 0;
ProcXGetDeviceControl(ClientPtr client)
{
int total_length = 0;
char *buf, *savbuf;
register DeviceIntPtr dev;
xGetDeviceControlReply rep;
......@@ -102,62 +100,53 @@ ProcXGetDeviceControl(client)
REQUEST(xGetDeviceControlReq);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient (client, IReqCode, X_GetDeviceControl, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadDevice);
return Success;
}
}
rep.repType = X_Reply;
rep.RepType = X_GetDeviceControl;
rep.length = 0;
rep.sequenceNumber = client->sequence;
switch (stuff->control)
{
case DEVICE_RESOLUTION:
if (!dev->valuator)
{
SendErrorToClient (client, IReqCode, X_GetDeviceControl, 0,
BadMatch);
return Success;
}
total_length = sizeof (xDeviceResolutionState) +
(3 * sizeof(int) * dev->valuator->numAxes);
break;
default:
SendErrorToClient (client, IReqCode, X_GetDeviceControl, 0,
BadValue);
switch (stuff->control) {
case DEVICE_RESOLUTION:
if (!dev->valuator) {
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
BadMatch);
return Success;
}
total_length = sizeof(xDeviceResolutionState) +
(3 * sizeof(int) * dev->valuator->numAxes);
break;
default:
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadValue);
return Success;
}
buf = (char *) malloc (total_length);
if (!buf)
{
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
BadAlloc);
buf = (char *)malloc(total_length);
if (!buf) {
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadAlloc);
return Success;
}
savbuf=buf;
switch (stuff->control)
{
case DEVICE_RESOLUTION:
CopySwapDeviceResolution(client, dev->valuator, buf,
total_length);
break;
default:
break;
}
}
savbuf = buf;
switch (stuff->control) {
case DEVICE_RESOLUTION:
CopySwapDeviceResolution(client, dev->valuator, buf, total_length);
break;
default:
break;
}
rep.length = (total_length+3) >> 2;
rep.length = (total_length + 3) >> 2;
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
WriteToClient(client, total_length, savbuf);
free (savbuf);
free(savbuf);
return Success;
}
}
/***********************************************************************
*
......@@ -166,40 +155,35 @@ ProcXGetDeviceControl(client)
*/
void
CopySwapDeviceResolution (client, v, buf, length)
ClientPtr client;
ValuatorClassPtr v;
char *buf;
int length;
{
AxisInfoPtr a;
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
r = (xDeviceResolutionState *) buf;
r->control = DEVICE_RESOLUTION;
r->length = length;
r->num_valuators = v->numAxes;
buf += sizeof (xDeviceResolutionState);
iptr = (int *) buf;
for (i=0,a=v->axes; i<v->numAxes; i++,a++)
r->length = length;
r->num_valuators = v->numAxes;
buf += sizeof(xDeviceResolutionState);
iptr = (int *)buf;
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->resolution;
for (i=0,a=v->axes; i<v->numAxes; i++,a++)
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->min_resolution;
for (i=0,a=v->axes; i<v->numAxes; i++,a++)
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->max_resolution;
if (client->swapped)
{
swaps (&r->control);
swaps (&r->length);
swapl (&r->num_valuators);
iptr = (int *) buf;
for (i=0; i < (3 * v->numAxes); i++,iptr++)
{
swapl (iptr);
}
if (client->swapped) {
swaps(&r->control);
swaps(&r->length);
swapl(&r->num_valuators);
iptr = (int *)buf;
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
swapl(iptr);
}
}
}
/***********************************************************************
*
......@@ -209,13 +193,9 @@ CopySwapDeviceResolution (client, v, buf, length)
*/
void
SRepXGetDeviceControl (client, size, rep)
ClientPtr client;
int size;
xGetDeviceControlReply *rep;
{
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,29 +30,21 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETDCTL_H
#define GETDCTL_H 1
int
SProcXGetDeviceControl (
ClientPtr /* client */
);
int
ProcXGetDeviceControl (
ClientPtr /* client */
);
void
CopySwapDeviceResolution (
ClientPtr /* client */,
ValuatorClassPtr /* v */,
char * /* buf */,
int /* length */
);
void
SRepXGetDeviceControl (
ClientPtr /* client */,
int /* size */,
xGetDeviceControlReply * /* rep */
);
int SProcXGetDeviceControl(ClientPtr /* client */
);
int ProcXGetDeviceControl(ClientPtr /* client */
);
void CopySwapDeviceResolution(ClientPtr /* client */ ,
ValuatorClassPtr /* v */ ,
char * /* buf */ ,
int /* length */
);
void SRepXGetDeviceControl(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceControlReply * /* rep */
);
#endif /* GETDCTL_H */
......@@ -30,63 +30,45 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETFCTL_H
#define GETFCTL_H 1
int
SProcXGetFeedbackControl(
ClientPtr /* client */
);
int
ProcXGetFeedbackControl(
ClientPtr /* client */
);
void
CopySwapKbdFeedback (
ClientPtr /* client */,
KbdFeedbackPtr /* k */,
char ** /* buf */
);
void
CopySwapPtrFeedback (
ClientPtr /* client */,
PtrFeedbackPtr /* p */,
char ** /* buf */
);
void
CopySwapIntegerFeedback (
ClientPtr /* client */,
IntegerFeedbackPtr /* i */,
char ** /* buf */
);
void
CopySwapStringFeedback (
ClientPtr /* client */,
StringFeedbackPtr /* s */,
char ** /* buf */
);
void
CopySwapLedFeedback (
ClientPtr /* client */,
LedFeedbackPtr /* l */,
char ** /* buf */
);
void
CopySwapBellFeedback (
ClientPtr /* client */,
BellFeedbackPtr /* b */,
char ** /* buf */
);
void
SRepXGetFeedbackControl (
ClientPtr /* client */,
int /* size */,
xGetFeedbackControlReply * /* rep */
);
int SProcXGetFeedbackControl(ClientPtr /* client */
);
int ProcXGetFeedbackControl(ClientPtr /* client */
);
void CopySwapKbdFeedback(ClientPtr /* client */ ,
KbdFeedbackPtr /* k */ ,
char ** /* buf */
);
void CopySwapPtrFeedback(ClientPtr /* client */ ,
PtrFeedbackPtr /* p */ ,
char ** /* buf */
);
void CopySwapIntegerFeedback(ClientPtr /* client */ ,
IntegerFeedbackPtr /* i */ ,
char ** /* buf */
);
void CopySwapStringFeedback(ClientPtr /* client */ ,
StringFeedbackPtr /* s */ ,
char ** /* buf */
);
void CopySwapLedFeedback(ClientPtr /* client */ ,
LedFeedbackPtr /* l */ ,
char ** /* buf */
);
void CopySwapBellFeedback(ClientPtr /* client */ ,
BellFeedbackPtr /* b */ ,
char ** /* buf */
);
void SRepXGetFeedbackControl(ClientPtr /* client */ ,
int /* size */ ,
xGetFeedbackControlReply * /* rep */
);
#endif /* GETFCTL_H */
......@@ -55,14 +55,14 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "windowstr.h" /* focus struct */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "windowstr.h" /* focus struct */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "getfocus.h"
......@@ -74,13 +74,12 @@ SOFTWARE.
*/
int
SProcXGetDeviceFocus(client)
register ClientPtr client;
{
SProcXGetDeviceFocus(register ClientPtr client)
{
REQUEST(xGetDeviceFocusReq);
swaps(&stuff->length);
return(ProcXGetDeviceFocus(client));
}
return (ProcXGetDeviceFocus(client));
}
/***********************************************************************
*
......@@ -89,22 +88,20 @@ SProcXGetDeviceFocus(client)
*/
int
ProcXGetDeviceFocus(client)
ClientPtr client;
{
DeviceIntPtr dev;
FocusClassPtr focus;
ProcXGetDeviceFocus(ClientPtr client)
{
DeviceIntPtr dev;
FocusClassPtr focus;
xGetDeviceFocusReply rep;
REQUEST(xGetDeviceFocusReq);
REQUEST_SIZE_MATCH(xGetDeviceFocusReq);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL || !dev->focus)
{
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL || !dev->focus) {
SendErrorToClient(client, IReqCode, X_GetDeviceFocus, 0, BadDevice);
return Success;
}
}
rep.repType = X_Reply;
rep.RepType = X_GetDeviceFocus;
......@@ -119,14 +116,14 @@ ProcXGetDeviceFocus(client)
rep.focus = PointerRoot;
else if (focus->win == FollowKeyboardWin)
rep.focus = FollowKeyboard;
else
else
rep.focus = focus->win->drawable.id;
rep.time = focus->time.milliseconds;
rep.revertTo = focus->revert;
WriteReplyToClient (client, sizeof(xGetDeviceFocusReply), &rep);
WriteReplyToClient(client, sizeof(xGetDeviceFocusReply), &rep);
return Success;
}
}
/***********************************************************************
*
......@@ -136,14 +133,11 @@ ProcXGetDeviceFocus(client)
*/
void
SRepXGetDeviceFocus (client, size, rep)
ClientPtr client;
int size;
xGetDeviceFocusReply *rep;
{
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->focus);
swapl(&rep->time);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETFOCUS_H
#define GETFOCUS_H 1
int
SProcXGetDeviceFocus(
ClientPtr /* client */
);
int
ProcXGetDeviceFocus(
ClientPtr /* client */
);
void
SRepXGetDeviceFocus (
ClientPtr /* client */,
int /* size */,
xGetDeviceFocusReply * /* rep */
);
int SProcXGetDeviceFocus(ClientPtr /* client */
);
int ProcXGetDeviceFocus(ClientPtr /* client */
);
void SRepXGetDeviceFocus(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceFocusReply * /* rep */
);
#endif /* GETFOCUS_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "swaprep.h"
......@@ -75,13 +75,12 @@ SOFTWARE.
*/
int
SProcXGetDeviceKeyMapping(client)
register ClientPtr client;
{
SProcXGetDeviceKeyMapping(register ClientPtr client)
{
REQUEST(xGetDeviceKeyMappingReq);
swaps(&stuff->length);
return(ProcXGetDeviceKeyMapping(client));
}
return (ProcXGetDeviceKeyMapping(client));
}
/***********************************************************************
*
......@@ -90,65 +89,56 @@ SProcXGetDeviceKeyMapping(client)
*/
int
ProcXGetDeviceKeyMapping(client)
register ClientPtr client;
{
ProcXGetDeviceKeyMapping(register ClientPtr client)
{
xGetDeviceKeyMappingReply rep;
DeviceIntPtr dev;
KeySymsPtr k;
KeySymsPtr k;
REQUEST(xGetDeviceKeyMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0,
BadDevice);
return Success;
}
}
if (dev->key == NULL)
{
SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
BadMatch);
if (dev->key == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadMatch);
return Success;
}
k = &dev->key->curKeySyms;
}
k = &dev->key->curKeySyms;
if ((stuff->firstKeyCode < k->minKeyCode) ||
(stuff->firstKeyCode > k->maxKeyCode))
{
(stuff->firstKeyCode > k->maxKeyCode)) {
client->errorValue = stuff->firstKeyCode;
SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
BadValue);
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadValue);
return Success;
}
}
if (stuff->firstKeyCode + stuff->count > k->maxKeyCode + 1)
{
if (stuff->firstKeyCode + stuff->count > k->maxKeyCode + 1) {
client->errorValue = stuff->count;
SendErrorToClient (client, IReqCode, X_GetDeviceKeyMapping, 0,
BadValue);
SendErrorToClient(client, IReqCode, X_GetDeviceKeyMapping, 0, BadValue);
return Success;
}
}
rep.repType = X_Reply;
rep.RepType = X_GetDeviceKeyMapping;
rep.sequenceNumber = client->sequence;
rep.keySymsPerKeyCode = k->mapWidth;
rep.length = (k->mapWidth * stuff->count); /* KeySyms are 4 bytes */
rep.length = (k->mapWidth * stuff->count); /* KeySyms are 4 bytes */
WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write;
WriteSwappedDataToClient(
client,
k->mapWidth * stuff->count * sizeof(KeySym),
&k->map[(stuff->firstKeyCode - k->minKeyCode) *
k->mapWidth]);
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
WriteSwappedDataToClient(client,
k->mapWidth * stuff->count * sizeof(KeySym),
&k->map[(stuff->firstKeyCode - k->minKeyCode) *
k->mapWidth]);
return Success;
}
}
/***********************************************************************
*
......@@ -158,13 +148,10 @@ ProcXGetDeviceKeyMapping(client)
*/
void
SRepXGetDeviceKeyMapping (client, size, rep)
ClientPtr client;
int size;
xGetDeviceKeyMappingReply *rep;
{
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
xGetDeviceKeyMappingReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETKMAP_H
#define GETKMAP_H 1
int
SProcXGetDeviceKeyMapping(
ClientPtr /* client */
);
int
ProcXGetDeviceKeyMapping(
ClientPtr /* client */
);
void
SRepXGetDeviceKeyMapping (
ClientPtr /* client */,
int /* size */,
xGetDeviceKeyMappingReply * /* rep */
);
int SProcXGetDeviceKeyMapping(ClientPtr /* client */
);
int ProcXGetDeviceKeyMapping(ClientPtr /* client */
);
void SRepXGetDeviceKeyMapping(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceKeyMappingReply * /* rep */
);
#endif /* GETKMAP_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h> /* Request macro */
#include <nx-X11/extensions/XIproto.h> /* Request macro */
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "getmmap.h"
......@@ -74,13 +74,12 @@ SOFTWARE.
*/
int
SProcXGetDeviceModifierMapping(client)
register ClientPtr client;
{
SProcXGetDeviceModifierMapping(register ClientPtr client)
{
REQUEST(xGetDeviceModifierMappingReq);
swaps(&stuff->length);
return(ProcXGetDeviceModifierMapping(client));
}
return (ProcXGetDeviceModifierMapping(client));
}
/***********************************************************************
*
......@@ -89,47 +88,44 @@ SProcXGetDeviceModifierMapping(client)
*/
int
ProcXGetDeviceModifierMapping(client)
ClientPtr client;
{
CARD8 maxkeys;
DeviceIntPtr dev;
xGetDeviceModifierMappingReply rep;
KeyClassPtr kp;
ProcXGetDeviceModifierMapping(ClientPtr client)
{
CARD8 maxkeys;
DeviceIntPtr dev;
xGetDeviceModifierMappingReply rep;
KeyClassPtr kp;
REQUEST(xGetDeviceModifierMappingReq);
REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient (client, IReqCode, X_GetDeviceModifierMapping, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceModifierMapping, 0,
BadDevice);
return Success;
}
}
kp = dev->key;
if (kp == NULL)
{
SendErrorToClient (client, IReqCode, X_GetDeviceModifierMapping, 0,
BadMatch);
if (kp == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceModifierMapping, 0,
BadMatch);
return Success;
}
maxkeys = kp->maxKeysPerModifier;
}
maxkeys = kp->maxKeysPerModifier;
rep.repType = X_Reply;
rep.RepType = X_GetDeviceModifierMapping;
rep.numKeyPerModifier = maxkeys;
rep.sequenceNumber = client->sequence;
/* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
rep.length = 2*maxkeys;
rep.length = 2 * maxkeys;
WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
/* Reply with the (modified by DDX) map that SetModifierMapping passed in */
WriteToClient(client, 8*maxkeys, kp->modifierKeyMap);
WriteToClient(client, 8 * maxkeys, kp->modifierKeyMap);
return Success;
}
}
/***********************************************************************
*
......@@ -139,12 +135,10 @@ ProcXGetDeviceModifierMapping(client)
*/
void
SRepXGetDeviceModifierMapping (client, size, rep)
ClientPtr client;
int size;
xGetDeviceModifierMappingReply *rep;
{
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
xGetDeviceModifierMappingReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETMMAP_H
#define GETMMAP_H 1
int
SProcXGetDeviceModifierMapping(
ClientPtr /* client */
);
int
ProcXGetDeviceModifierMapping(
ClientPtr /* client */
);
void
SRepXGetDeviceModifierMapping (
ClientPtr /* client */,
int /* size */,
xGetDeviceModifierMappingReply * /* rep */
);
int SProcXGetDeviceModifierMapping(ClientPtr /* client */
);
int ProcXGetDeviceModifierMapping(ClientPtr /* client */
);
void SRepXGetDeviceModifierMapping(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceModifierMappingReply * /* rep */
);
#endif /* GETMMAP_H */
......@@ -55,21 +55,21 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structs */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structs */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "swaprep.h"
#include "getprop.h"
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
/***********************************************************************
*
......@@ -78,15 +78,14 @@ extern int ExtEventIndex;
*/
int
SProcXGetDeviceDontPropagateList(client)
register ClientPtr client;
{
SProcXGetDeviceDontPropagateList(register ClientPtr client)
{
REQUEST(xGetDeviceDontPropagateListReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
swapl(&stuff->window);
return(ProcXGetDeviceDontPropagateList(client));
}
return (ProcXGetDeviceDontPropagateList(client));
}
/***********************************************************************
*
......@@ -95,15 +94,14 @@ SProcXGetDeviceDontPropagateList(client)
*/
int
ProcXGetDeviceDontPropagateList (client)
register ClientPtr client;
{
CARD16 count = 0;
int i;
XEventClass *buf = NULL, *tbuf;
WindowPtr pWin;
xGetDeviceDontPropagateListReply rep;
OtherInputMasks *others;
ProcXGetDeviceDontPropagateList(register ClientPtr client)
{
CARD16 count = 0;
int i;
XEventClass *buf = NULL, *tbuf;
WindowPtr pWin;
xGetDeviceDontPropagateListReply rep;
OtherInputMasks *others;
REQUEST(xGetDeviceDontPropagateListReq);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
......@@ -114,44 +112,39 @@ ProcXGetDeviceDontPropagateList (client)
rep.length = 0;
rep.count = 0;
pWin = (WindowPtr) LookupWindow (stuff->window, client);
if (!pWin)
{
pWin = (WindowPtr) LookupWindow(stuff->window, client);
if (!pWin) {
client->errorValue = stuff->window;
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
BadWindow);
SendErrorToClient(client, IReqCode, X_GetDeviceDontPropagateList, 0,
BadWindow);
return Success;
}
if ((others = wOtherInputMasks(pWin)) != 0)
{
for (i=0; i<EMASKSIZE; i++)
tbuf = ClassFromMask (NULL, others->dontPropagateMask[i], i,
&count, COUNT);
if (count)
{
}
if ((others = wOtherInputMasks(pWin)) != 0) {
for (i = 0; i < EMASKSIZE; i++)
tbuf = ClassFromMask(NULL, others->dontPropagateMask[i], i,
&count, COUNT);
if (count) {
rep.count = count;
buf = (XEventClass *) malloc (rep.count * sizeof(XEventClass));
rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2;
buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass));
rep.length = (rep.count * sizeof(XEventClass) + 3) >> 2;
tbuf = buf;
for (i=0; i<EMASKSIZE; i++)
tbuf = ClassFromMask (tbuf, others->dontPropagateMask[i], i,
NULL, CREATE);
}
for (i = 0; i < EMASKSIZE; i++)
tbuf = ClassFromMask(tbuf, others->dontPropagateMask[i], i,
NULL, CREATE);
}
}
WriteReplyToClient (client, sizeof (xGetDeviceDontPropagateListReply),
&rep);
WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
if (count)
{
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf);
free (buf);
}
return Success;
if (count) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf);
free(buf);
}
return Success;
}
/***********************************************************************
*
......@@ -161,31 +154,25 @@ ProcXGetDeviceDontPropagateList (client)
*/
XEventClass
*ClassFromMask (buf, mask, maskndx, count, mode)
XEventClass *buf;
Mask mask;
int maskndx;
CARD16 *count;
int mode;
{
int i,j;
int id = maskndx;
Mask tmask = 0x80000000;
for (i=0; i<32; i++,tmask>>=1)
if (tmask & mask)
{
for (j=0; j<ExtEventIndex; j++)
if (EventInfo[j].mask == tmask)
{
* ClassFromMask(XEventClass * buf, Mask mask, int maskndx, CARD16 * count,
int mode)
{
int i, j;
int id = maskndx;
Mask tmask = 0x80000000;
for (i = 0; i < 32; i++, tmask >>= 1)
if (tmask & mask) {
for (j = 0; j < ExtEventIndex; j++)
if (EventInfo[j].mask == tmask) {
if (mode == COUNT)
(*count)++;
else
*buf++ = (id << 8) | EventInfo[j].type;
}
}
*buf++ = (id << 8) | EventInfo[j].type;
}
}
return (buf);
}
}
/***********************************************************************
*
......@@ -195,13 +182,11 @@ XEventClass
*/
void
SRepXGetDeviceDontPropagateList (client, size, rep)
ClientPtr client;
int size;
xGetDeviceDontPropagateListReply *rep;
{
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->count);
WriteToClient(client, size, rep);
}
}
......@@ -30,30 +30,22 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETPROP_H
#define GETPROP_H 1
int
SProcXGetDeviceDontPropagateList(
ClientPtr /* client */
);
int
ProcXGetDeviceDontPropagateList (
ClientPtr /* client */
);
XEventClass *
ClassFromMask (
XEventClass * /* buf */,
Mask /* mask */,
int /* maskndx */,
CARD16 * /* count */,
int /* mode */
);
void
SRepXGetDeviceDontPropagateList (
ClientPtr /* client */,
int /* size */,
xGetDeviceDontPropagateListReply * /* rep */
);
int SProcXGetDeviceDontPropagateList(ClientPtr /* client */
);
int ProcXGetDeviceDontPropagateList(ClientPtr /* client */
);
XEventClass *ClassFromMask(XEventClass * /* buf */ ,
Mask /* mask */ ,
int /* maskndx */ ,
CARD16 * /* count */ ,
int /* mode */
);
void SRepXGetDeviceDontPropagateList(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceDontPropagateListReply * /* rep */
);
#endif /* GETPROP_H */
......@@ -55,14 +55,14 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window struct */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window struct */
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "swaprep.h"
......@@ -76,15 +76,14 @@ SOFTWARE.
*/
int
SProcXGetSelectedExtensionEvents(client)
register ClientPtr client;
{
SProcXGetSelectedExtensionEvents(register ClientPtr client)
{
REQUEST(xGetSelectedExtensionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
swapl(&stuff->window);
return(ProcXGetSelectedExtensionEvents(client));
}
return (ProcXGetSelectedExtensionEvents(client));
}
/***********************************************************************
*
......@@ -94,18 +93,17 @@ SProcXGetSelectedExtensionEvents(client)
*/
int
ProcXGetSelectedExtensionEvents(client)
register ClientPtr client;
{
int i;
int total_length = 0;
xGetSelectedExtensionEventsReply rep;
WindowPtr pWin;
XEventClass *buf = NULL;
XEventClass *tclient;
XEventClass *aclient;
OtherInputMasks *pOthers;
InputClientsPtr others;
ProcXGetSelectedExtensionEvents(register ClientPtr client)
{
int i;
int total_length = 0;
xGetSelectedExtensionEventsReply rep;
WindowPtr pWin;
XEventClass *buf = NULL;
XEventClass *tclient;
XEventClass *aclient;
OtherInputMasks *pOthers;
InputClientsPtr others;
REQUEST(xGetSelectedExtensionEventsReq);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
......@@ -117,55 +115,53 @@ ProcXGetSelectedExtensionEvents(client)
rep.this_client_count = 0;
rep.all_clients_count = 0;
if (!(pWin = LookupWindow(stuff->window, client)))
{
SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0,
BadWindow);
if (!(pWin = LookupWindow(stuff->window, client))) {
SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0,
BadWindow);
return Success;
}
if ((pOthers = wOtherInputMasks(pWin)) != 0)
{
for (others = pOthers->inputClients; others; others=others->next)
for (i=0; i<EMASKSIZE; i++)
tclient = ClassFromMask (NULL, others->mask[i], i,
&rep.all_clients_count, COUNT);
for (others = pOthers->inputClients; others; others=others->next)
if (SameClient(others, client))
{
for (i=0; i<EMASKSIZE; i++)
tclient = ClassFromMask (NULL, others->mask[i], i,
&rep.this_client_count, COUNT);
}
if ((pOthers = wOtherInputMasks(pWin)) != 0) {
for (others = pOthers->inputClients; others; others = others->next)
for (i = 0; i < EMASKSIZE; i++)
tclient = ClassFromMask(NULL, others->mask[i], i,
&rep.all_clients_count, COUNT);
for (others = pOthers->inputClients; others; others = others->next)
if (SameClient(others, client)) {
for (i = 0; i < EMASKSIZE; i++)
tclient = ClassFromMask(NULL, others->mask[i], i,
&rep.this_client_count, COUNT);
break;
}
}
total_length = (rep.all_clients_count + rep.this_client_count) *
sizeof (XEventClass);
total_length = (rep.all_clients_count + rep.this_client_count) *
sizeof(XEventClass);
rep.length = (total_length + 3) >> 2;
buf = (XEventClass *) malloc (total_length);
buf = (XEventClass *) malloc(total_length);
tclient = buf;
aclient = buf + rep.this_client_count;
if (others)
for (i=0; i<EMASKSIZE; i++)
tclient = ClassFromMask (tclient, others->mask[i], i, NULL, CREATE);
for (others = pOthers->inputClients; others; others=others->next)
for (i=0; i<EMASKSIZE; i++)
aclient = ClassFromMask (aclient, others->mask[i], i, NULL, CREATE);
}
for (i = 0; i < EMASKSIZE; i++)
tclient =
ClassFromMask(tclient, others->mask[i], i, NULL, CREATE);
for (others = pOthers->inputClients; others; others = others->next)
for (i = 0; i < EMASKSIZE; i++)
aclient =
ClassFromMask(aclient, others->mask[i], i, NULL, CREATE);
}
WriteReplyToClient (client, sizeof(xGetSelectedExtensionEventsReply), &rep);
WriteReplyToClient(client, sizeof(xGetSelectedExtensionEventsReply), &rep);
if (total_length)
{
if (total_length) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient( client, total_length, buf);
free (buf);
}
return Success;
WriteSwappedDataToClient(client, total_length, buf);
free(buf);
}
return Success;
}
/***********************************************************************
*
......@@ -175,14 +171,12 @@ ProcXGetSelectedExtensionEvents(client)
*/
void
SRepXGetSelectedExtensionEvents (client, size, rep)
ClientPtr client;
int size;
xGetSelectedExtensionEventsReply *rep;
{
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
xGetSelectedExtensionEventsReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->this_client_count);
swaps(&rep->all_clients_count);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETSELEV_H
#define GETSELEV_H 1
int
SProcXGetSelectedExtensionEvents(
ClientPtr /* client */
);
int
ProcXGetSelectedExtensionEvents(
ClientPtr /* client */
);
void
SRepXGetSelectedExtensionEvents (
ClientPtr /* client */,
int /* size */,
xGetSelectedExtensionEventsReply * /* rep */
);
int SProcXGetSelectedExtensionEvents(ClientPtr /* client */
);
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
);
void SRepXGetSelectedExtensionEvents(ClientPtr /* client */ ,
int /* size */ ,
xGetSelectedExtensionEventsReply * /* rep */
);
#endif /* GETSELEV_H */
......@@ -55,18 +55,18 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "getvers.h"
XExtensionVersion AllExtensionVersions[128];
XExtensionVersion AllExtensionVersions[128];
/***********************************************************************
*
......@@ -75,15 +75,14 @@ XExtensionVersion AllExtensionVersions[128];
*/
int
SProcXGetExtensionVersion(client)
register ClientPtr client;
{
SProcXGetExtensionVersion(register ClientPtr client)
{
REQUEST(xGetExtensionVersionReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
swaps(&stuff->nbytes);
return(ProcXGetExtensionVersion(client));
}
return (ProcXGetExtensionVersion(client));
}
/***********************************************************************
*
......@@ -92,21 +91,19 @@ SProcXGetExtensionVersion(client)
*/
int
ProcXGetExtensionVersion (client)
register ClientPtr client;
{
xGetExtensionVersionReply rep;
ProcXGetExtensionVersion(register ClientPtr client)
{
xGetExtensionVersionReply rep;
REQUEST(xGetExtensionVersionReq);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
if (stuff->length != (sizeof(xGetExtensionVersionReq) +
stuff->nbytes + 3)>>2)
{
SendErrorToClient(client, IReqCode, X_GetExtensionVersion, 0,
BadLength);
if (stuff->length != (sizeof(xGetExtensionVersionReq) +
stuff->nbytes + 3) >> 2) {
SendErrorToClient(client, IReqCode, X_GetExtensionVersion, 0,
BadLength);
return Success;
}
}
memset(&rep, 0, sizeof(xGetExtensionVersionReply));
rep.repType = X_Reply;
......@@ -117,17 +114,14 @@ ProcXGetExtensionVersion (client)
rep.minor_version = 0;
rep.present = TRUE;
if (rep.present)
{
rep.major_version =
AllExtensionVersions[IReqCode-128].major_version;
rep.minor_version =
AllExtensionVersions[IReqCode-128].minor_version;
}
WriteReplyToClient (client, sizeof (xGetExtensionVersionReply), &rep);
if (rep.present) {
rep.major_version = AllExtensionVersions[IReqCode - 128].major_version;
rep.minor_version = AllExtensionVersions[IReqCode - 128].minor_version;
}
WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep);
return Success;
}
}
/***********************************************************************
*
......@@ -137,14 +131,12 @@ ProcXGetExtensionVersion (client)
*/
void
SRepXGetExtensionVersion (client, size, rep)
ClientPtr client;
int size;
xGetExtensionVersionReply *rep;
{
SRepXGetExtensionVersion(ClientPtr client, int size,
xGetExtensionVersionReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swaps(&rep->major_version);
swaps(&rep->minor_version);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GETVERS_H
#define GETVERS_H 1
int
SProcXGetExtensionVersion(
ClientPtr /* client */
);
int
ProcXGetExtensionVersion (
ClientPtr /* client */
);
void
SRepXGetExtensionVersion (
ClientPtr /* client */,
int /* size */,
xGetExtensionVersionReply * /* rep */
);
int SProcXGetExtensionVersion(ClientPtr /* client */
);
int ProcXGetExtensionVersion(ClientPtr /* client */
);
void SRepXGetExtensionVersion(ClientPtr /* client */ ,
int /* size */ ,
xGetExtensionVersionReply * /* rep */
);
#endif /* GETVERS_H */
......@@ -51,26 +51,25 @@ SOFTWARE.
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "dixevents.h" /* GrabDevice */
#include "dixevents.h" /* GrabDevice */
#include "grabdev.h"
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
extern XExtEventInfo EventInfo[];
extern int ExtEventIndex;
/***********************************************************************
*
......@@ -79,9 +78,8 @@ extern int ExtEventIndex;
*/
int
SProcXGrabDevice(client)
register ClientPtr client;
{
SProcXGrabDevice(register ClientPtr client)
{
REQUEST(xGrabDeviceReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
......@@ -94,8 +92,8 @@ SProcXGrabDevice(client)
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return(ProcXGrabDevice(client));
}
return (ProcXGrabDevice(client));
}
/***********************************************************************
*
......@@ -104,52 +102,49 @@ SProcXGrabDevice(client)
*/
int
ProcXGrabDevice(client)
ClientPtr client;
{
int error;
xGrabDeviceReply rep;
DeviceIntPtr dev;
struct tmask tmp[EMASKSIZE];
ProcXGrabDevice(ClientPtr client)
{
int error;
xGrabDeviceReply rep;
DeviceIntPtr dev;
struct tmask tmp[EMASKSIZE];
REQUEST(xGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
if (stuff->length !=(sizeof(xGrabDeviceReq)>>2) + stuff->event_count)
{
SendErrorToClient (client, IReqCode, X_GrabDevice, 0, BadLength);
if (stuff->length != (sizeof(xGrabDeviceReq) >> 2) + stuff->event_count) {
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, BadLength);
return Success;
}
}
rep.repType = X_Reply;
rep.RepType = X_GrabDevice;
rep.sequenceNumber = client->sequence;
rep.length = 0;
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, BadDevice);
return Success;
}
}
if (CreateMaskFromList (client, (XEventClass *)&stuff[1],
stuff->event_count, tmp, dev, X_GrabDevice) != Success)
if (CreateMaskFromList(client, (XEventClass *) & stuff[1],
stuff->event_count, tmp, dev,
X_GrabDevice) != Success)
return Success;
error = GrabDevice (client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->grabWindow, stuff->ownerEvents,
stuff->time, tmp[stuff->deviceid].mask, &rep.status);
error = GrabDevice(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->grabWindow,
stuff->ownerEvents, stuff->time,
tmp[stuff->deviceid].mask, &rep.status);
if (error != Success)
{
if (error != Success) {
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, error);
return Success;
}
}
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
return Success;
}
}
/***********************************************************************
*
......@@ -158,49 +153,39 @@ ProcXGrabDevice(client)
*/
int
CreateMaskFromList (client, list, count, mask, dev, req)
ClientPtr client;
XEventClass *list;
int count;
struct tmask mask[];
DeviceIntPtr dev;
int req;
{
int i,j;
int device;
DeviceIntPtr tdev;
for (i=0; i<EMASKSIZE; i++)
{
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
struct tmask *mask, DeviceIntPtr dev, int req)
{
int i, j;
int device;
DeviceIntPtr tdev;
for (i = 0; i < EMASKSIZE; i++) {
mask[i].mask = 0;
mask[i].dev = NULL;
}
}
for (i=0; i<count; i++, list++)
{
for (i = 0; i < count; i++, list++) {
device = *list >> 8;
if (device > 255)
{
if (device > 255) {
SendErrorToClient(client, IReqCode, req, 0, BadClass);
return BadClass;
}
tdev = LookupDeviceIntRec (device);
if (tdev==NULL || (dev != NULL && tdev != dev))
{
}
tdev = LookupDeviceIntRec(device);
if (tdev == NULL || (dev != NULL && tdev != dev)) {
SendErrorToClient(client, IReqCode, req, 0, BadClass);
return BadClass;
}
}
for (j=0; j<ExtEventIndex; j++)
if (EventInfo[j].type == (*list & 0xff))
{
for (j = 0; j < ExtEventIndex; j++)
if (EventInfo[j].type == (*list & 0xff)) {
mask[device].mask |= EventInfo[j].mask;
mask[device].dev = (Pointer) tdev;
break;
}
}
return Success;
}
}
return Success;
}
/***********************************************************************
*
......@@ -210,12 +195,9 @@ CreateMaskFromList (client, list, count, mask, dev, req)
*/
void
SRepXGrabDevice (client, size, rep)
ClientPtr client;
int size;
xGrabDeviceReply *rep;
{
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,31 +30,23 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GRABDEV_H
#define GRABDEV_H 1
int
SProcXGrabDevice(
ClientPtr /* client */
);
int
ProcXGrabDevice(
ClientPtr /* client */
);
int
CreateMaskFromList (
ClientPtr /* client */,
XEventClass * /* list */,
int /* count */,
struct tmask /* mask */[],
DeviceIntPtr /* dev */,
int /* req */
);
void
SRepXGrabDevice (
ClientPtr /* client */,
int /* size */,
xGrabDeviceReply * /* rep */
);
int SProcXGrabDevice(ClientPtr /* client */
);
int ProcXGrabDevice(ClientPtr /* client */
);
int CreateMaskFromList(ClientPtr /* client */ ,
XEventClass * /* list */ ,
int /* count */ ,
struct tmask /* mask */ [],
DeviceIntPtr /* dev */ ,
int /* req */
);
void SRepXGrabDevice(ClientPtr /* client */ ,
int /* size */ ,
xGrabDeviceReply * /* rep */
);
#endif /* GRABDEV_H */
......@@ -55,15 +55,15 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "exevents.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "grabdev.h"
......@@ -76,9 +76,8 @@ SOFTWARE.
*/
int
SProcXGrabDeviceButton(client)
register ClientPtr client;
{
SProcXGrabDeviceButton(register ClientPtr client)
{
REQUEST(xGrabDeviceButtonReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
......@@ -89,8 +88,8 @@ SProcXGrabDeviceButton(client)
stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return(ProcXGrabDeviceButton(client));
}
return (ProcXGrabDeviceButton(client));
}
/***********************************************************************
*
......@@ -99,61 +98,55 @@ SProcXGrabDeviceButton(client)
*/
int
ProcXGrabDeviceButton(client)
ClientPtr client;
{
int ret;
DeviceIntPtr dev;
DeviceIntPtr mdev;
XEventClass *class;
struct tmask tmp[EMASKSIZE];
ProcXGrabDeviceButton(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
DeviceIntPtr mdev;
XEventClass *class;
struct tmask tmp[EMASKSIZE];
REQUEST(xGrabDeviceButtonReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
if (stuff->length !=(sizeof(xGrabDeviceButtonReq)>>2) + stuff->event_count)
{
SendErrorToClient (client, IReqCode, X_GrabDeviceButton, 0, BadLength);
if (stuff->length !=
(sizeof(xGrabDeviceButtonReq) >> 2) + stuff->event_count) {
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadLength);
return Success;
}
}
dev = LookupDeviceIntRec (stuff->grabbed_device);
if (dev == NULL)
{
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->grabbed_device);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, BadDevice);
return Success;
}
if (stuff->modifier_device != UseXKeyboard)
{
mdev = LookupDeviceIntRec (stuff->modifier_device);
if (mdev == NULL)
{
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
BadDevice);
}
if (stuff->modifier_device != UseXKeyboard) {
mdev = LookupDeviceIntRec(stuff->modifier_device);
if (mdev == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
BadDevice);
return Success;
}
if (mdev->key == NULL)
{
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
BadMatch);
}
if (mdev->key == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
BadMatch);
return Success;
}
}
else
} else
mdev = (DeviceIntPtr) LookupKeyboardDevice();
class = (XEventClass *) (&stuff[1]); /* first word of values */
if ((ret = CreateMaskFromList (client, class,
stuff->event_count, tmp, dev, X_GrabDeviceButton)) != Success)
return Success;
ret = GrabButton(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->modifiers, mdev, stuff->button,
stuff->grabWindow, stuff->ownerEvents, (Cursor)0, (Window)0,
tmp[stuff->grabbed_device].mask);
if ((ret = CreateMaskFromList(client, class,
stuff->event_count, tmp, dev,
X_GrabDeviceButton)) != Success)
return Success;
ret = GrabButton(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->modifiers, mdev,
stuff->button, stuff->grabWindow, stuff->ownerEvents,
(Cursor) 0, (Window) 0, tmp[stuff->grabbed_device].mask);
if (ret != Success)
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0, ret);
return(Success);
}
return (Success);
}
......@@ -30,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GRABDEVB_H
#define GRABDEVB_H 1
int
SProcXGrabDeviceButton(
ClientPtr /* client */
);
int
ProcXGrabDeviceButton(
ClientPtr /* client */
);
int SProcXGrabDeviceButton(ClientPtr /* client */
);
int ProcXGrabDeviceButton(ClientPtr /* client */
);
#endif /* GRABDEVB_H */
......@@ -55,15 +55,15 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "exevents.h"
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "grabdev.h"
......@@ -76,9 +76,8 @@ SOFTWARE.
*/
int
SProcXGrabDeviceKey(client)
register ClientPtr client;
{
SProcXGrabDeviceKey(register ClientPtr client)
{
REQUEST(xGrabDeviceKeyReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
......@@ -87,8 +86,8 @@ SProcXGrabDeviceKey(client)
swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return(ProcXGrabDeviceKey(client));
}
return (ProcXGrabDeviceKey(client));
}
/***********************************************************************
*
......@@ -97,66 +96,57 @@ SProcXGrabDeviceKey(client)
*/
int
ProcXGrabDeviceKey(client)
ClientPtr client;
{
int ret;
DeviceIntPtr dev;
DeviceIntPtr mdev;
XEventClass *class;
struct tmask tmp[EMASKSIZE];
ProcXGrabDeviceKey(ClientPtr client)
{
int ret;
DeviceIntPtr dev;
DeviceIntPtr mdev;
XEventClass *class;
struct tmask tmp[EMASKSIZE];
REQUEST(xGrabDeviceKeyReq);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
if (stuff->length !=(sizeof(xGrabDeviceKeyReq)>>2) + stuff->event_count)
{
SendErrorToClient (client, IReqCode, X_GrabDeviceKey, 0, BadLength);
if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count) {
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadLength);
return Success;
}
}
dev = LookupDeviceIntRec (stuff->grabbed_device);
if (dev == NULL)
{
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->grabbed_device);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadDevice);
return Success;
}
}
if (stuff->modifier_device != UseXKeyboard)
{
mdev = LookupDeviceIntRec (stuff->modifier_device);
if (mdev == NULL)
{
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0,
BadDevice);
if (stuff->modifier_device != UseXKeyboard) {
mdev = LookupDeviceIntRec(stuff->modifier_device);
if (mdev == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadDevice);
return Success;
}
if (mdev->key == NULL)
{
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0,
BadMatch);
}
if (mdev->key == NULL) {
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadMatch);
return Success;
}
}
else
} else
mdev = (DeviceIntPtr) LookupKeyboardDevice();
class = (XEventClass *) (&stuff[1]); /* first word of values */
if ((ret = CreateMaskFromList (client, class,
stuff->event_count, tmp, dev, X_GrabDeviceKey)) != Success)
return Success;
if ((ret = CreateMaskFromList(client, class,
stuff->event_count, tmp, dev,
X_GrabDeviceKey)) != Success)
return Success;
ret = GrabKey(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->modifiers, mdev, stuff->key,
stuff->grabWindow, stuff->ownerEvents, tmp[stuff->grabbed_device].mask);
ret = GrabKey(client, dev, stuff->this_device_mode,
stuff->other_devices_mode, stuff->modifiers, mdev,
stuff->key, stuff->grabWindow, stuff->ownerEvents,
tmp[stuff->grabbed_device].mask);
if (ret != Success)
{
if (ret != Success) {
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, ret);
return Success;
}
return Success;
}
return Success;
}
}
......@@ -30,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GRABDEVK_H
#define GRABDEVK_H 1
int
SProcXGrabDeviceKey(
ClientPtr /* client */
);
int
ProcXGrabDeviceKey(
ClientPtr /* client */
);
int SProcXGrabDeviceKey(ClientPtr /* client */
);
int ProcXGrabDeviceKey(ClientPtr /* client */
);
#endif /* GRABDEVK_H */
......@@ -55,13 +55,13 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
......@@ -74,16 +74,15 @@ SOFTWARE.
*/
int
SProcXGetDeviceMotionEvents(client)
register ClientPtr client;
{
SProcXGetDeviceMotionEvents(register ClientPtr client)
{
REQUEST(xGetDeviceMotionEventsReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
swapl(&stuff->start);
swapl(&stuff->stop);
return(ProcXGetDeviceMotionEvents(client));
}
return (ProcXGetDeviceMotionEvents(client));
}
/****************************************************************************
*
......@@ -92,36 +91,33 @@ register ClientPtr client;
*/
int
ProcXGetDeviceMotionEvents(client)
ClientPtr client;
ProcXGetDeviceMotionEvents(ClientPtr client)
{
INT32 *coords = NULL, *bufptr;
xGetDeviceMotionEventsReply rep;
unsigned long i;
int num_events, axes, size = 0, tsize;
int num_events, axes, size = 0, tsize;
unsigned long nEvents;
DeviceIntPtr dev;
TimeStamp start, stop;
int length = 0;
ValuatorClassPtr v;
int length = 0;
ValuatorClassPtr v;
REQUEST(xGetDeviceMotionEventsReq);
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
BadDevice);
return Success;
}
}
v = dev->valuator;
if (v==NULL || v->numAxes == 0)
{
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
BadMatch);
if (v == NULL || v->numAxes == 0) {
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
BadMatch);
return Success;
}
}
if (dev->valuator->motionHintWindow)
MaybeStopDeviceHint(dev, client);
axes = v->numAxes;
......@@ -135,49 +131,43 @@ ProcXGetDeviceMotionEvents(client)
start = ClientTimeToServerTime(stuff->start);
stop = ClientTimeToServerTime(stuff->stop);
if (CompareTimeStamps(start, stop) == LATER ||
CompareTimeStamps(start, currentTime) == LATER)
{
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
return Success;
}
CompareTimeStamps(start, currentTime) == LATER) {
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
return Success;
}
if (CompareTimeStamps(stop, currentTime) == LATER)
stop = currentTime;
stop = currentTime;
num_events = v->numMotionEvents;
if (num_events)
{
size = sizeof(Time) + (axes * sizeof (INT32));
if (num_events) {
size = sizeof(Time) + (axes * sizeof(INT32));
tsize = num_events * size;
coords = (INT32 *) malloc(tsize);
if (!coords)
{
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
BadAlloc);
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
BadAlloc);
return Success;
}
rep.nEvents = (v->GetMotionProc) (
dev, (xTimecoord *)coords, /* XXX */
start.milliseconds, stop.milliseconds, (ScreenPtr)NULL);
}
if (rep.nEvents > 0)
{
length = (rep.nEvents * size +3) >> 2;
rep.length = length;
}
rep.nEvents = (v->GetMotionProc) (dev, (xTimecoord *) coords, /* XXX */
start.milliseconds, stop.milliseconds,
(ScreenPtr) NULL);
}
if (rep.nEvents > 0) {
length = (rep.nEvents * size + 3) >> 2;
rep.length = length;
}
nEvents = rep.nEvents;
WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
if (nEvents)
{
if (client->swapped)
{
if (nEvents) {
if (client->swapped) {
bufptr = coords;
for (i=0; i<nEvents * (axes+1); i++)
{
for (i = 0; i < nEvents * (axes + 1); i++) {
swapl(bufptr);
bufptr++;
}
}
}
WriteToClient(client, length * 4, coords);
}
}
if (coords)
free(coords);
return Success;
......@@ -191,13 +181,11 @@ ProcXGetDeviceMotionEvents(client)
*/
void
SRepXGetDeviceMotionEvents (client, size, rep)
ClientPtr client;
int size;
xGetDeviceMotionEventsReply *rep;
{
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
xGetDeviceMotionEventsReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
swapl(&rep->nEvents);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef GTMOTION_H
#define GTMOTION_H 1
int
SProcXGetDeviceMotionEvents(
ClientPtr /* client */
);
int
ProcXGetDeviceMotionEvents(
ClientPtr /* client */
);
void
SRepXGetDeviceMotionEvents (
ClientPtr /* client */,
int /* size */,
xGetDeviceMotionEventsReply * /* rep */
);
int SProcXGetDeviceMotionEvents(ClientPtr /* client */
);
int ProcXGetDeviceMotionEvents(ClientPtr /* client */
);
void SRepXGetDeviceMotionEvents(ClientPtr /* client */ ,
int /* size */ ,
xGetDeviceMotionEventsReply * /* rep */
);
#endif /* GTMOTION_H */
......@@ -30,73 +30,53 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef LISTDEV_H
#define LISTDEV_H 1
int
SProcXListInputDevices(
ClientPtr /* client */
);
int
ProcXListInputDevices (
ClientPtr /* client */
);
void
SizeDeviceInfo (
DeviceIntPtr /* d */,
int * /* namesize */,
int * /* size */
);
void
ListDeviceInfo (
ClientPtr /* client */,
DeviceIntPtr /* d */,
xDeviceInfoPtr /* dev */,
char ** /* devbuf */,
char ** /* classbuf */,
char ** /* namebuf */
);
void
CopyDeviceName (
char ** /* namebuf */,
char * /* name */
);
void
CopySwapDevice (
ClientPtr /* client */,
DeviceIntPtr /* d */,
int /* num_classes */,
char ** /* buf */
);
void
CopySwapKeyClass (
ClientPtr /* client */,
KeyClassPtr /* k */,
char ** /* buf */
);
void
CopySwapButtonClass (
ClientPtr /* client */,
ButtonClassPtr /* b */,
char ** /* buf */
);
int
CopySwapValuatorClass (
ClientPtr /* client */,
ValuatorClassPtr /* v */,
char ** /* buf */
);
void
SRepXListInputDevices (
ClientPtr /* client */,
int /* size */,
xListInputDevicesReply * /* rep */
);
int SProcXListInputDevices(ClientPtr /* client */
);
int ProcXListInputDevices(ClientPtr /* client */
);
void SizeDeviceInfo(DeviceIntPtr /* d */ ,
int * /* namesize */ ,
int * /* size */
);
void ListDeviceInfo(ClientPtr /* client */ ,
DeviceIntPtr /* d */ ,
xDeviceInfoPtr /* dev */ ,
char ** /* devbuf */ ,
char ** /* classbuf */ ,
char ** /* namebuf */
);
void CopyDeviceName(char ** /* namebuf */ ,
char * /* name */
);
void CopySwapDevice(ClientPtr /* client */ ,
DeviceIntPtr /* d */ ,
int /* num_classes */ ,
char ** /* buf */
);
void CopySwapKeyClass(ClientPtr /* client */ ,
KeyClassPtr /* k */ ,
char ** /* buf */
);
void CopySwapButtonClass(ClientPtr /* client */ ,
ButtonClassPtr /* b */ ,
char ** /* buf */
);
int CopySwapValuatorClass(ClientPtr /* client */ ,
ValuatorClassPtr /* v */ ,
char ** /* buf */
);
void SRepXListInputDevices(ClientPtr /* client */ ,
int /* size */ ,
xListInputDevicesReply * /* rep */
);
#endif /* LISTDEV_H */
......@@ -55,20 +55,20 @@ SOFTWARE.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "XIstubs.h"
#include "windowstr.h" /* window structure */
#include "windowstr.h" /* window structure */
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "opendev.h"
extern CARD8 event_base [];
extern CARD8 event_base[];
/***********************************************************************
*
......@@ -78,13 +78,12 @@ extern CARD8 event_base [];
*/
int
SProcXOpenDevice(client)
register ClientPtr client;
{
SProcXOpenDevice(register ClientPtr client)
{
REQUEST(xOpenDeviceReq);
swaps(&stuff->length);
return(ProcXOpenDevice(client));
}
return (ProcXOpenDevice(client));
}
/***********************************************************************
*
......@@ -93,45 +92,40 @@ SProcXOpenDevice(client)
*/
int
ProcXOpenDevice(client)
register ClientPtr client;
{
xInputClassInfo evbase [numInputClasses];
ProcXOpenDevice(register ClientPtr client)
{
xInputClassInfo evbase[numInputClasses];
Bool enableit = FALSE;
int j=0;
int j = 0;
int status = Success;
xOpenDeviceReply rep;
xOpenDeviceReply rep;
DeviceIntPtr dev;
REQUEST(xOpenDeviceReq);
REQUEST_SIZE_MATCH(xOpenDeviceReq);
if (stuff->deviceid == inputInfo.pointer->id ||
stuff->deviceid == inputInfo.keyboard->id)
{
if (stuff->deviceid == inputInfo.pointer->id ||
stuff->deviceid == inputInfo.keyboard->id) {
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
return Success;
}
return Success;
}
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) /* not open */
{
for (dev=inputInfo.off_devices; dev; dev=dev->next)
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
for (dev = inputInfo.off_devices; dev; dev = dev->next)
if (dev->id == stuff->deviceid)
break;
if (dev == NULL)
{
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
return Success;
}
enableit = TRUE;
}
enableit = TRUE;
}
OpenInputDevice (dev, client, &status);
if (status != Success)
{
OpenInputDevice(dev, client, &status);
if (status != Success) {
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, status);
return Success;
}
}
if (enableit && dev->inited && dev->startup)
(void)EnableDevice(dev);
......@@ -139,45 +133,39 @@ ProcXOpenDevice(client)
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++].event_type_base = event_base[KeyClass];
}
if (dev->button != NULL)
{
}
if (dev->button != NULL) {
evbase[j].class = ButtonClass;
evbase[j++].event_type_base = event_base[ButtonClass];
}
if (dev->valuator != NULL)
{
}
if (dev->valuator != NULL) {
evbase[j].class = ValuatorClass;
evbase[j++].event_type_base = event_base[ValuatorClass];
}
}
if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL)
{
dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) {
evbase[j].class = FeedbackClass;
evbase[j++].event_type_base = event_base[FeedbackClass];
}
if (dev->focus != NULL)
{
}
if (dev->focus != NULL) {
evbase[j].class = FocusClass;
evbase[j++].event_type_base = event_base[FocusClass];
}
if (dev->proximity != NULL)
{
}
if (dev->proximity != NULL) {
evbase[j].class = ProximityClass;
evbase[j++].event_type_base = event_base[ProximityClass];
}
}
evbase[j].class = OtherClass;
evbase[j++].event_type_base = event_base[OtherClass];
rep.length = (j * sizeof (xInputClassInfo) + 3) >> 2;
rep.length = (j * sizeof(xInputClassInfo) + 3) >> 2;
rep.num_classes = j;
WriteReplyToClient (client, sizeof (xOpenDeviceReply), &rep);
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
WriteToClient(client, j * sizeof (xInputClassInfo), evbase);
return (Success);
}
}
/***********************************************************************
*
......@@ -187,12 +175,9 @@ ProcXOpenDevice(client)
*/
void
SRepXOpenDevice (client, size, rep)
ClientPtr client;
int size;
xOpenDeviceReply *rep;
{
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef OPENDEV_H
#define OPENDEV_H 1
int
SProcXOpenDevice(
ClientPtr /* client */
);
int
ProcXOpenDevice(
ClientPtr /* client */
);
void
SRepXOpenDevice (
ClientPtr /* client */,
int /* size */,
xOpenDeviceReply * /* rep */
);
int SProcXOpenDevice(ClientPtr /* client */
);
int ProcXOpenDevice(ClientPtr /* client */
);
void SRepXOpenDevice(ClientPtr /* client */ ,
int /* size */ ,
xOpenDeviceReply * /* rep */
);
#endif /* OPENDEV_H */
......@@ -36,14 +36,14 @@ from The Open Group.
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
......@@ -56,13 +56,12 @@ from The Open Group.
*/
int
SProcXQueryDeviceState(client)
register ClientPtr client;
{
SProcXQueryDeviceState(register ClientPtr client)
{
REQUEST(xQueryDeviceStateReq);
swaps(&stuff->length);
return(ProcXQueryDeviceState(client));
}
return (ProcXQueryDeviceState(client));
}
/***********************************************************************
*
......@@ -71,22 +70,21 @@ SProcXQueryDeviceState(client)
*/
int
ProcXQueryDeviceState(client)
register ClientPtr client;
{
int i;
int num_classes = 0;
int total_length = 0;
char *buf, *savbuf;
KeyClassPtr k;
xKeyState *tk;
ButtonClassPtr b;
xButtonState *tb;
ValuatorClassPtr v;
xValuatorState *tv;
xQueryDeviceStateReply rep;
DeviceIntPtr dev;
int *values;
ProcXQueryDeviceState(register ClientPtr client)
{
int i;
int num_classes = 0;
int total_length = 0;
char *buf, *savbuf;
KeyClassPtr k;
xKeyState *tk;
ButtonClassPtr b;
xButtonState *tb;
ValuatorClassPtr v;
xValuatorState *tv;
xQueryDeviceStateReply rep;
DeviceIntPtr dev;
int *values;
REQUEST(xQueryDeviceStateReq);
REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
......@@ -96,96 +94,83 @@ ProcXQueryDeviceState(client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
dev = LookupDeviceIntRec (stuff->deviceid);
if (dev == NULL)
{
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
BadDevice);
dev = LookupDeviceIntRec(stuff->deviceid);
if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadDevice);
return Success;
}
}
v = dev->valuator;
if (v != NULL && v->motionHintWindow != NULL)
MaybeStopDeviceHint(dev, client);
k = dev->key;
if (k != NULL)
{
total_length += sizeof (xKeyState);
if (k != NULL) {
total_length += sizeof(xKeyState);
num_classes++;
}
}
b = dev->button;
if (b != NULL)
{
total_length += sizeof (xButtonState);
if (b != NULL) {
total_length += sizeof(xButtonState);
num_classes++;
}
}
if (v != NULL)
{
total_length += (sizeof(xValuatorState) +
(v->numAxes * sizeof(int)));
if (v != NULL) {
total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int)));
num_classes++;
}
buf = (char *) malloc (total_length);
if (!buf)
{
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
BadAlloc);
}
buf = (char *)malloc(total_length);
if (!buf) {
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0, BadAlloc);
return Success;
}
}
savbuf = buf;
if (k != NULL)
{
if (k != NULL) {
tk = (xKeyState *) buf;
tk->class = KeyClass;
tk->length = sizeof (xKeyState);
tk->length = sizeof(xKeyState);
tk->num_keys = k->curKeySyms.maxKeyCode - k->curKeySyms.minKeyCode + 1;
for (i = 0; i<32; i++)
for (i = 0; i < 32; i++)
tk->keys[i] = k->down[i];
buf += sizeof (xKeyState);
}
buf += sizeof(xKeyState);
}
if (b != NULL)
{
if (b != NULL) {
tb = (xButtonState *) buf;
tb->class = ButtonClass;
tb->length = sizeof (xButtonState);
tb->length = sizeof(xButtonState);
tb->num_buttons = b->numButtons;
for (i = 0; i<32; i++)
for (i = 0; i < 32; i++)
tb->buttons[i] = b->down[i];
buf += sizeof (xButtonState);
}
buf += sizeof(xButtonState);
}
if (v != NULL)
{
if (v != NULL) {
tv = (xValuatorState *) buf;
tv->class = ValuatorClass;
tv->length = sizeof (xValuatorState);
tv->length = sizeof(xValuatorState);
tv->num_valuators = v->numAxes;
tv->mode = v->mode;
buf += sizeof(xValuatorState);
for (i=0, values=v->axisVal; i<v->numAxes; i++)
{
*((int *) buf) = *values++;
if (client->swapped)
{
swapl ((int *) buf);/* macro - braces needed */
}
buf += sizeof(int);
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
*((int *)buf) = *values++;
if (client->swapped) {
swapl((int *)buf); /* macro - braces needed */
}
buf += sizeof(int);
}
}
rep.num_classes = num_classes;
rep.length = (total_length + 3) >> 2;
WriteReplyToClient (client, sizeof(xQueryDeviceStateReply), &rep);
WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
if (total_length > 0)
WriteToClient (client, total_length, savbuf);
free (savbuf);
WriteToClient(client, total_length, savbuf);
free(savbuf);
return Success;
}
}
/***********************************************************************
*
......@@ -195,12 +180,9 @@ ProcXQueryDeviceState(client)
*/
void
SRepXQueryDeviceState (client, size, rep)
ClientPtr client;
int size;
xQueryDeviceStateReply *rep;
{
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
}
}
......@@ -30,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef QUERYST_H
#define QUERYST_H 1
int
SProcXQueryDeviceState(
ClientPtr /* client */
);
int
ProcXQueryDeviceState(
ClientPtr /* client */
);
void
SRepXQueryDeviceState (
ClientPtr /* client */,
int /* size */,
xQueryDeviceStateReply * /* rep */
);
int SProcXQueryDeviceState(ClientPtr /* client */
);
int ProcXQueryDeviceState(ClientPtr /* client */
);
void SRepXQueryDeviceState(ClientPtr /* client */ ,
int /* size */ ,
xQueryDeviceStateReply * /* rep */
);
#endif /* QUERYST_H */
......@@ -51,26 +51,27 @@ SOFTWARE.
*
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/X.h> /* for inputstr.h */
#include <nx-X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include "windowstr.h" /* window structure */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "extinit.h" /* LookupDeviceIntRec */
#include "exevents.h"
#include "exglobals.h"
#include "grabdev.h"
#include "selectev.h"
extern Mask ExtExclusiveMasks[];
extern Mask ExtValidMasks[];
extern Mask ExtExclusiveMasks[];
extern Mask ExtValidMasks[];
/***********************************************************************
*
......@@ -79,9 +80,8 @@ extern Mask ExtValidMasks[];
*/
int
SProcXSelectExtensionEvent (client)
register ClientPtr client;
{
SProcXSelectExtensionEvent(register ClientPtr client)
{
REQUEST(xSelectExtensionEventReq);
swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
......@@ -91,8 +91,8 @@ register ClientPtr client;
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
return(ProcXSelectExtensionEvent(client));
}
return (ProcXSelectExtensionEvent(client));
}
/***********************************************************************
*
......@@ -101,48 +101,46 @@ register ClientPtr client;
*/
int
ProcXSelectExtensionEvent (client)
register ClientPtr client;
{
int ret;
int i;
WindowPtr pWin;
struct tmask tmp[EMASKSIZE];
ProcXSelectExtensionEvent(register ClientPtr client)
{
int ret;
int i;
WindowPtr pWin;
struct tmask tmp[EMASKSIZE];
REQUEST(xSelectExtensionEventReq);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
if (stuff->length !=(sizeof(xSelectExtensionEventReq)>>2) + stuff->count)
{
SendErrorToClient (client, IReqCode, X_SelectExtensionEvent, 0,
BadLength);
if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count) {
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
BadLength);
return Success;
}
}
pWin = (WindowPtr) LookupWindow (stuff->window, client);
if (!pWin)
{
pWin = (WindowPtr) LookupWindow(stuff->window, client);
if (!pWin) {
client->errorValue = stuff->window;
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
BadWindow);
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
BadWindow);
return Success;
}
}
if ((ret = CreateMaskFromList (client, (XEventClass *)&stuff[1],
stuff->count, tmp, NULL, X_SelectExtensionEvent)) != Success)
if ((ret = CreateMaskFromList(client, (XEventClass *) & stuff[1],
stuff->count, tmp, NULL,
X_SelectExtensionEvent)) != Success)
return Success;
for (i=0; i<EMASKSIZE; i++)
if (tmp[i].dev != NULL)
{
if ((ret = SelectForWindow((DeviceIntPtr)tmp[i].dev, pWin, client, tmp[i].mask,
ExtExclusiveMasks[i], ExtValidMasks[i])) != Success)
{
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
ret);
for (i = 0; i < EMASKSIZE; i++)
if (tmp[i].dev != NULL) {
if ((ret =
SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client,
tmp[i].mask, ExtExclusiveMasks[i],
ExtValidMasks[i])) != Success) {
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
ret);
return Success;
}
}
}
return Success;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment