indent fixes (OMG SO UGLY), and nuke old RCS keywords.
This commit is contained in:
parent
5480c537ce
commit
6d7083bd69
|
@ -40,6 +40,9 @@
|
|||
* Xi/ungrdevk.c:
|
||||
ANSIfy Xi/. Mostly automated via protoize(1).
|
||||
|
||||
* Xi/*.[ch]:
|
||||
indent fixes (OMG SO UGLY), and nuke old RCS keywords.
|
||||
|
||||
2006-02-16 Eric Anholt <anholt@FreeBSD.org>
|
||||
|
||||
* Xext/Makefile.am:
|
||||
|
|
78
Xi/allowev.c
78
Xi/allowev.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: allowev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/allowev.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "allowev.h"
|
||||
|
@ -87,8 +84,8 @@ SProcXAllowDeviceEvents(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
|
||||
swapl(&stuff->time, n);
|
||||
return(ProcXAllowDeviceEvents(client));
|
||||
}
|
||||
return (ProcXAllowDeviceEvents(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -99,45 +96,42 @@ SProcXAllowDeviceEvents(register ClientPtr client)
|
|||
int
|
||||
ProcXAllowDeviceEvents(register ClientPtr client)
|
||||
{
|
||||
TimeStamp time;
|
||||
DeviceIntPtr thisdev;
|
||||
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;
|
||||
}
|
||||
|
|
13
Xi/allowev.h
13
Xi/allowev.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/allowev.h,v 3.1 1996/04/15 11:18:23 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXAllowDeviceEvents(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXAllowDeviceEvents(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXAllowDeviceEvents(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* ALLOWEV_H */
|
||||
|
|
153
Xi/chgdctl.c
153
Xi/chgdctl.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: chgdctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/chgdctl.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,21 +50,21 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
#include <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"
|
||||
|
@ -88,8 +85,8 @@ SProcXChangeDeviceControl(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||
swaps(&stuff->control, n);
|
||||
return(ProcXChangeDeviceControl(client));
|
||||
}
|
||||
return (ProcXChangeDeviceControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -111,89 +108,73 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
REQUEST(xChangeDeviceControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
|
||||
|
||||
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;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
SendErrorToClient (client, IReqCode, X_ChangeDeviceControl, 0,
|
||||
BadValue);
|
||||
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;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
SendErrorToClient(client, IReqCode, X_ChangeDeviceControl, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
WriteReplyToClient(client, sizeof(xChangeDeviceControlReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -203,12 +184,12 @@ ProcXChangeDeviceControl(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXChangeDeviceControl (ClientPtr client, int size, xChangeDeviceControlReply *rep)
|
||||
SRepXChangeDeviceControl(ClientPtr client, int size,
|
||||
xChangeDeviceControlReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
23
Xi/chgdctl.h
23
Xi/chgdctl.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/chgdctl.h,v 3.1 1996/04/15 11:18:25 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXChangeDeviceControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXChangeDeviceControl(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXChangeDeviceControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXChangeDeviceControl (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xChangeDeviceControlReply * /* rep */
|
||||
);
|
||||
void SRepXChangeDeviceControl(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xChangeDeviceControlReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* CHGDCTL_H */
|
||||
|
|
602
Xi/chgfctl.c
602
Xi/chgfctl.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: chgfctl.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/chgfctl.c,v 3.3 2001/01/17 22:13:23 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,20 +50,20 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
#include <X11/extensions/XIproto.h> /* control constants */
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "chgfctl.h"
|
||||
|
@ -89,8 +86,8 @@ SProcXChangeFeedbackControl(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
swapl(&stuff->mask, n);
|
||||
return(ProcXChangeFeedbackControl(client));
|
||||
}
|
||||
return (ProcXChangeFeedbackControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -113,116 +110,108 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
REQUEST(xChangeFeedbackControlReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
|
||||
|
||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >>2);
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadDevice);
|
||||
len = stuff->length - (sizeof(xChangeFeedbackControlReq) >> 2);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
switch (stuff->feedbackid)
|
||||
{
|
||||
case KbdFeedbackClass:
|
||||
if (len != (sizeof(xKbdFeedbackCtl)>>2))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
switch (stuff->feedbackid) {
|
||||
case KbdFeedbackClass:
|
||||
if (len != (sizeof(xKbdFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
if (k->ctrl.id == ((xKbdFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeKbdFeedback(client, dev, stuff->mask, k,
|
||||
(xKbdFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
for (k=dev->kbdfeed; k; k=k->next)
|
||||
if (k->ctrl.id == ((xKbdFeedbackCtl *) &stuff[1])->id)
|
||||
{
|
||||
ChangeKbdFeedback (client, dev, stuff->mask, k, (xKbdFeedbackCtl *)&stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case PtrFeedbackClass:
|
||||
if (len != (sizeof(xPtrFeedbackCtl)>>2))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (p=dev->ptrfeed; p; p=p->next)
|
||||
if (p->ctrl.id == ((xPtrFeedbackCtl *) &stuff[1])->id)
|
||||
{
|
||||
ChangePtrFeedback (client, dev, stuff->mask, p, (xPtrFeedbackCtl *)&stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case StringFeedbackClass:
|
||||
{
|
||||
register char n;
|
||||
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) &stuff[1]);
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->num_keysyms,n);
|
||||
}
|
||||
if (len != ((sizeof(xStringFeedbackCtl)>>2) + f->num_keysyms))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (s=dev->stringfeed; s; s=s->next)
|
||||
if (s->ctrl.id == ((xStringFeedbackCtl *) &stuff[1])->id)
|
||||
{
|
||||
ChangeStringFeedback (client, dev, stuff->mask,s,(xStringFeedbackCtl *)&stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IntegerFeedbackClass:
|
||||
if (len != (sizeof(xIntegerFeedbackCtl)>>2))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
break;
|
||||
case PtrFeedbackClass:
|
||||
if (len != (sizeof(xPtrFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (p = dev->ptrfeed; p; p = p->next)
|
||||
if (p->ctrl.id == ((xPtrFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangePtrFeedback(client, dev, stuff->mask, p,
|
||||
(xPtrFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
for (i=dev->intfeed; i; i=i->next)
|
||||
if (i->ctrl.id == ((xIntegerFeedbackCtl *) &stuff[1])->id)
|
||||
{
|
||||
ChangeIntegerFeedback (client, dev,stuff->mask,i,(xIntegerFeedbackCtl *)&stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case LedFeedbackClass:
|
||||
if (len != (sizeof(xLedFeedbackCtl)>>2))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
}
|
||||
break;
|
||||
case StringFeedbackClass:
|
||||
{
|
||||
register char n;
|
||||
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&f->num_keysyms, n);
|
||||
}
|
||||
if (len != ((sizeof(xStringFeedbackCtl) >> 2) + f->num_keysyms)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (l=dev->leds; l; l=l->next)
|
||||
if (l->ctrl.id == ((xLedFeedbackCtl *) &stuff[1])->id)
|
||||
{
|
||||
ChangeLedFeedback (client, dev, stuff->mask, l, (xLedFeedbackCtl *)&stuff[1]);
|
||||
}
|
||||
for (s = dev->stringfeed; s; s = s->next)
|
||||
if (s->ctrl.id == ((xStringFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeStringFeedback(client, dev, stuff->mask, s,
|
||||
(xStringFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case BellFeedbackClass:
|
||||
if (len != (sizeof(xBellFeedbackCtl)>>2))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (b=dev->bell; b; b=b->next)
|
||||
if (b->ctrl.id == ((xBellFeedbackCtl *) &stuff[1])->id)
|
||||
{
|
||||
ChangeBellFeedback (client, dev, stuff->mask, b, (xBellFeedbackCtl *)&stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case IntegerFeedbackClass:
|
||||
if (len != (sizeof(xIntegerFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (i = dev->intfeed; i; i = i->next)
|
||||
if (i->ctrl.id == ((xIntegerFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeIntegerFeedback(client, dev, stuff->mask, i,
|
||||
(xIntegerFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case LedFeedbackClass:
|
||||
if (len != (sizeof(xLedFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (l = dev->leds; l; l = l->next)
|
||||
if (l->ctrl.id == ((xLedFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeLedFeedback(client, dev, stuff->mask, l,
|
||||
(xLedFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
case BellFeedbackClass:
|
||||
if (len != (sizeof(xBellFeedbackCtl) >> 2)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl,
|
||||
0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
for (b = dev->bell; b; b = b->next)
|
||||
if (b->ctrl.id == ((xBellFeedbackCtl *) & stuff[1])->id) {
|
||||
ChangeBellFeedback(client, dev, stuff->mask, b,
|
||||
(xBellFeedbackCtl *) & stuff[1]);
|
||||
return Success;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -231,149 +220,130 @@ ProcXChangeFeedbackControl(ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeKbdFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, KbdFeedbackPtr k, xKbdFeedbackCtl *f)
|
||||
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
KeybdCtrl kctrl;
|
||||
int t;
|
||||
int key = DO_ALL;
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->length,n);
|
||||
swaps(&f->pitch,n);
|
||||
swaps(&f->duration,n);
|
||||
swapl(&f->led_mask,n);
|
||||
swapl(&f->led_values,n);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swaps(&f->pitch, n);
|
||||
swaps(&f->duration, n);
|
||||
swapl(&f->led_mask, n);
|
||||
swapl(&f->led_values, n);
|
||||
}
|
||||
|
||||
kctrl = k->ctrl;
|
||||
if (mask & DvKeyClickPercent)
|
||||
{
|
||||
if (mask & DvKeyClickPercent) {
|
||||
t = f->click;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.click;
|
||||
else if (t < 0 || t > 100)
|
||||
{
|
||||
else if (t < 0 || t > 100) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
kctrl.click = t;
|
||||
}
|
||||
}
|
||||
|
||||
if (mask & DvPercent)
|
||||
{
|
||||
if (mask & DvPercent) {
|
||||
t = f->percent;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.bell;
|
||||
else if (t < 0 || t > 100)
|
||||
{
|
||||
else if (t < 0 || t > 100) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
kctrl.bell = t;
|
||||
}
|
||||
kctrl.bell = t;
|
||||
}
|
||||
|
||||
if (mask & DvPitch)
|
||||
{
|
||||
if (mask & DvPitch) {
|
||||
t = f->pitch;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.bell_pitch;
|
||||
else if (t < 0)
|
||||
{
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
kctrl.bell_pitch = t;
|
||||
}
|
||||
kctrl.bell_pitch = t;
|
||||
}
|
||||
|
||||
if (mask & DvDuration)
|
||||
{
|
||||
if (mask & DvDuration) {
|
||||
t = f->duration;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.bell_duration;
|
||||
else if (t < 0)
|
||||
{
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
kctrl.bell_duration = t;
|
||||
}
|
||||
}
|
||||
|
||||
if (mask & DvLed)
|
||||
{
|
||||
if (mask & DvLed) {
|
||||
kctrl.leds &= ~(f->led_mask);
|
||||
kctrl.leds |= (f->led_mask & f->led_values);
|
||||
}
|
||||
}
|
||||
|
||||
if (mask & DvKey)
|
||||
{
|
||||
if (mask & DvKey) {
|
||||
key = (KeyCode) f->key;
|
||||
if (key < 8 || key > 255)
|
||||
{
|
||||
if (key < 8 || key > 255) {
|
||||
client->errorValue = key;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
if (!(mask & DvAutoRepeatMode))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
if (!(mask & DvAutoRepeatMode)) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
if (mask & DvAutoRepeatMode)
|
||||
{
|
||||
if (mask & DvAutoRepeatMode) {
|
||||
int inx = (key >> 3);
|
||||
int kmask = (1 << (key & 7));
|
||||
|
||||
t = (CARD8) f->auto_repeat_mode;
|
||||
if (t == AutoRepeatModeOff)
|
||||
{
|
||||
if (t == AutoRepeatModeOff) {
|
||||
if (key == DO_ALL)
|
||||
kctrl.autoRepeat = FALSE;
|
||||
else
|
||||
kctrl.autoRepeats[inx] &= ~kmask;
|
||||
}
|
||||
else if (t == AutoRepeatModeOn)
|
||||
{
|
||||
} else if (t == AutoRepeatModeOn) {
|
||||
if (key == DO_ALL)
|
||||
kctrl.autoRepeat = TRUE;
|
||||
else
|
||||
kctrl.autoRepeats[inx] |= kmask;
|
||||
}
|
||||
else if (t == AutoRepeatModeDefault)
|
||||
{
|
||||
} else if (t == AutoRepeatModeDefault) {
|
||||
if (key == DO_ALL)
|
||||
kctrl.autoRepeat = defaultKeyboardControl.autoRepeat;
|
||||
else
|
||||
kctrl.autoRepeats[inx] &= ~kmask;
|
||||
kctrl.autoRepeats[inx] =
|
||||
(kctrl.autoRepeats[inx] & ~kmask) |
|
||||
(defaultKeyboardControl.autoRepeats[inx] & kmask);
|
||||
}
|
||||
else
|
||||
{
|
||||
kctrl.autoRepeats[inx] =
|
||||
(kctrl.autoRepeats[inx] & ~kmask) |
|
||||
(defaultKeyboardControl.autoRepeats[inx] & kmask);
|
||||
} else {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
k->ctrl = kctrl;
|
||||
(*k->CtrlProc)(dev, &k->ctrl);
|
||||
(*k->CtrlProc) (dev, &k->ctrl);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -382,75 +352,69 @@ ChangeKbdFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, K
|
|||
*/
|
||||
|
||||
int
|
||||
ChangePtrFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, PtrFeedbackPtr p, xPtrFeedbackCtl *f)
|
||||
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
PtrCtrl pctrl; /* might get BadValue part way through */
|
||||
PtrCtrl pctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->length,n);
|
||||
swaps(&f->num,n);
|
||||
swaps(&f->denom,n);
|
||||
swaps(&f->thresh,n);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swaps(&f->num, n);
|
||||
swaps(&f->denom, n);
|
||||
swaps(&f->thresh, n);
|
||||
}
|
||||
|
||||
pctrl = p->ctrl;
|
||||
if (mask & DvAccelNum)
|
||||
{
|
||||
int accelNum;
|
||||
if (mask & DvAccelNum) {
|
||||
int accelNum;
|
||||
|
||||
accelNum = f->num;
|
||||
if (accelNum == -1)
|
||||
pctrl.num = defaultPointerControl.num;
|
||||
else if (accelNum < 0)
|
||||
{
|
||||
else if (accelNum < 0) {
|
||||
client->errorValue = accelNum;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
else pctrl.num = accelNum;
|
||||
}
|
||||
} else
|
||||
pctrl.num = accelNum;
|
||||
}
|
||||
|
||||
if (mask & DvAccelDenom)
|
||||
{
|
||||
int accelDenom;
|
||||
if (mask & DvAccelDenom) {
|
||||
int accelDenom;
|
||||
|
||||
accelDenom = f->denom;
|
||||
if (accelDenom == -1)
|
||||
pctrl.den = defaultPointerControl.den;
|
||||
else if (accelDenom <= 0)
|
||||
{
|
||||
else if (accelDenom <= 0) {
|
||||
client->errorValue = accelDenom;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
else pctrl.den = accelDenom;
|
||||
}
|
||||
} else
|
||||
pctrl.den = accelDenom;
|
||||
}
|
||||
|
||||
if (mask & DvThreshold)
|
||||
{
|
||||
int threshold;
|
||||
if (mask & DvThreshold) {
|
||||
int threshold;
|
||||
|
||||
threshold = f->thresh;
|
||||
if (threshold == -1)
|
||||
pctrl.threshold = defaultPointerControl.threshold;
|
||||
else if (threshold < 0)
|
||||
{
|
||||
else if (threshold < 0) {
|
||||
client->errorValue = threshold;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
else pctrl.threshold = threshold;
|
||||
}
|
||||
} else
|
||||
pctrl.threshold = threshold;
|
||||
}
|
||||
|
||||
p->ctrl = pctrl;
|
||||
(*p->CtrlProc)(dev, &p->ctrl);
|
||||
(*p->CtrlProc) (dev, &p->ctrl);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -459,20 +423,21 @@ ChangePtrFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, P
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeIntegerFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, IntegerFeedbackPtr i, xIntegerFeedbackCtl *f)
|
||||
ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
|
||||
long unsigned int mask, IntegerFeedbackPtr i,
|
||||
xIntegerFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->length,n);
|
||||
swapl(&f->int_to_display,n);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swapl(&f->int_to_display, n);
|
||||
}
|
||||
|
||||
i->ctrl.integer_displayed = f->int_to_display;
|
||||
(*i->CtrlProc)(dev, &i->ctrl);
|
||||
(*i->CtrlProc) (dev, &i->ctrl);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -481,52 +446,48 @@ ChangeIntegerFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mas
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeStringFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, StringFeedbackPtr s, xStringFeedbackCtl *f)
|
||||
ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
StringFeedbackPtr s, xStringFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
int i, j;
|
||||
KeySym *syms, *sup_syms;
|
||||
int i, j;
|
||||
KeySym *syms, *sup_syms;
|
||||
|
||||
syms = (KeySym *) (f+1);
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->length,n); /* swapped num_keysyms in calling proc */
|
||||
p = (long *) (syms);
|
||||
for (i=0; i<f->num_keysyms; i++)
|
||||
{
|
||||
syms = (KeySym *) (f + 1);
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n); /* swapped num_keysyms in calling proc */
|
||||
p = (long *)(syms);
|
||||
for (i = 0; i < f->num_keysyms; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
||||
if (f->num_keysyms > s->ctrl.max_symbols)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
sup_syms = s->ctrl.symbols_supported;
|
||||
for (i=0; i<f->num_keysyms; i++)
|
||||
{
|
||||
for (j=0; j<s->ctrl.num_symbols_supported; j++)
|
||||
if (*(syms+i) == *(sup_syms+j))
|
||||
break;
|
||||
if (j==s->ctrl.num_symbols_supported)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
s->ctrl.num_symbols_displayed = f->num_keysyms;
|
||||
for (i=0; i<f->num_keysyms; i++)
|
||||
*(s->ctrl.symbols_displayed+i) = *(syms+i);
|
||||
(*s->CtrlProc)(dev, &s->ctrl);
|
||||
return Success;
|
||||
}
|
||||
|
||||
if (f->num_keysyms > s->ctrl.max_symbols) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
sup_syms = s->ctrl.symbols_supported;
|
||||
for (i = 0; i < f->num_keysyms; i++) {
|
||||
for (j = 0; j < s->ctrl.num_symbols_supported; j++)
|
||||
if (*(syms + i) == *(sup_syms + j))
|
||||
break;
|
||||
if (j == s->ctrl.num_symbols_supported) {
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
s->ctrl.num_symbols_displayed = f->num_keysyms;
|
||||
for (i = 0; i < f->num_keysyms; i++)
|
||||
*(s->ctrl.symbols_displayed + i) = *(syms + i);
|
||||
(*s->CtrlProc) (dev, &s->ctrl);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This procedure changes BellFeedbackClass data.
|
||||
|
@ -534,68 +495,62 @@ ChangeStringFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeBellFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, BellFeedbackPtr b, xBellFeedbackCtl *f)
|
||||
ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
BellFeedbackPtr b, xBellFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
int t;
|
||||
BellCtrl bctrl; /* might get BadValue part way through */
|
||||
BellCtrl bctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->length,n);
|
||||
swaps(&f->pitch,n);
|
||||
swaps(&f->duration,n);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swaps(&f->pitch, n);
|
||||
swaps(&f->duration, n);
|
||||
}
|
||||
|
||||
bctrl = b->ctrl;
|
||||
if (mask & DvPercent)
|
||||
{
|
||||
if (mask & DvPercent) {
|
||||
t = f->percent;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.bell;
|
||||
else if (t < 0 || t > 100)
|
||||
{
|
||||
else if (t < 0 || t > 100) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
bctrl.percent = t;
|
||||
}
|
||||
bctrl.percent = t;
|
||||
}
|
||||
|
||||
if (mask & DvPitch)
|
||||
{
|
||||
if (mask & DvPitch) {
|
||||
t = f->pitch;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.bell_pitch;
|
||||
else if (t < 0)
|
||||
{
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
bctrl.pitch = t;
|
||||
}
|
||||
bctrl.pitch = t;
|
||||
}
|
||||
|
||||
if (mask & DvDuration)
|
||||
{
|
||||
if (mask & DvDuration) {
|
||||
t = f->duration;
|
||||
if (t == -1)
|
||||
t = defaultKeyboardControl.bell_duration;
|
||||
else if (t < 0)
|
||||
{
|
||||
else if (t < 0) {
|
||||
client->errorValue = t;
|
||||
SendErrorToClient (client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_ChangeFeedbackControl, 0,
|
||||
BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
bctrl.duration = t;
|
||||
}
|
||||
b->ctrl = bctrl;
|
||||
(*b->CtrlProc)(dev, &b->ctrl);
|
||||
return Success;
|
||||
}
|
||||
b->ctrl = bctrl;
|
||||
(*b->CtrlProc) (dev, &b->ctrl);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
@ -604,28 +559,27 @@ ChangeBellFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeLedFeedback (ClientPtr client, DeviceIntPtr dev, long unsigned int mask, LedFeedbackPtr l, xLedFeedbackCtl *f)
|
||||
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
|
||||
LedFeedbackPtr l, xLedFeedbackCtl * f)
|
||||
{
|
||||
register char n;
|
||||
LedCtrl lctrl; /* might get BadValue part way through */
|
||||
LedCtrl lctrl; /* might get BadValue part way through */
|
||||
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&f->length,n);
|
||||
swapl(&f->led_values,n);
|
||||
swapl(&f->led_mask,n);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&f->length, n);
|
||||
swapl(&f->led_values, n);
|
||||
swapl(&f->led_mask, n);
|
||||
}
|
||||
|
||||
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
|
||||
f->led_values &= l->ctrl.led_mask; /* set only supported leds */
|
||||
if (mask & DvLed)
|
||||
{
|
||||
if (mask & DvLed) {
|
||||
lctrl.led_mask = f->led_mask;
|
||||
lctrl.led_values = f->led_values;
|
||||
(*l->CtrlProc)(dev, &lctrl);
|
||||
l->ctrl.led_values &= ~(f->led_mask); /* zero changed leds */
|
||||
l->ctrl.led_values |= (f->led_mask & f->led_values);/* OR in set leds*/
|
||||
}
|
||||
(*l->CtrlProc) (dev, &lctrl);
|
||||
l->ctrl.led_values &= ~(f->led_mask); /* zero changed leds */
|
||||
l->ctrl.led_values |= (f->led_mask & f->led_values); /* OR in set leds */
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
97
Xi/chgfctl.h
97
Xi/chgfctl.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/chgfctl.h,v 3.1 1996/04/15 11:18:26 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXChangeFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXChangeFeedbackControl(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXChangeFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ChangeKbdFeedback (
|
||||
ClientPtr /* client */,
|
||||
DeviceIntPtr /* dev */,
|
||||
unsigned long /* mask */,
|
||||
KbdFeedbackPtr /* k */,
|
||||
xKbdFeedbackCtl * /* f */
|
||||
);
|
||||
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 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 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 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 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 ChangeLedFeedback(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* dev */ ,
|
||||
unsigned long /* mask */ ,
|
||||
LedFeedbackPtr /* l */ ,
|
||||
xLedFeedbackCtl * /* f */
|
||||
);
|
||||
|
||||
#endif /* CHGFCTL_H */
|
||||
|
|
116
Xi/chgkbd.c
116
Xi/chgkbd.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: chgkbd.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/chgkbd.c,v 3.5 2001/08/23 14:56:19 alanh Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,15 +56,15 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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"
|
||||
|
@ -89,8 +86,8 @@ SProcXChangeKeyboardDevice(register ClientPtr client)
|
|||
REQUEST(xChangeKeyboardDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
|
||||
return(ProcXChangeKeyboardDevice(client));
|
||||
}
|
||||
return (ProcXChangeKeyboardDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -100,16 +97,16 @@ SProcXChangeKeyboardDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangeKeyboardDevice (register ClientPtr client)
|
||||
ProcXChangeKeyboardDevice(register ClientPtr client)
|
||||
{
|
||||
int i;
|
||||
DeviceIntPtr xkbd = inputInfo.keyboard;
|
||||
DeviceIntPtr dev;
|
||||
FocusClassPtr xf = xkbd->focus;
|
||||
FocusClassPtr df;
|
||||
KeyClassPtr k;
|
||||
xChangeKeyboardDeviceReply rep;
|
||||
changeDeviceNotify ev;
|
||||
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);
|
||||
|
@ -119,80 +116,76 @@ ProcXChangeKeyboardDevice (register ClientPtr 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 *) xrealloc(df->trace,
|
||||
xf->traceSize * sizeof(WindowPtr));
|
||||
Must_have_memory = FALSE; /* XXX */
|
||||
}
|
||||
if (df->traceSize != xf->traceSize) {
|
||||
Must_have_memory = TRUE; /* XXX */
|
||||
df->trace = (WindowPtr *) xrealloc(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);
|
||||
return Success;
|
||||
}
|
||||
|
||||
WriteReplyToClient(client, sizeof(xChangeKeyboardDeviceReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XChangeKeyboardDevice
|
||||
|
@ -201,11 +194,12 @@ ProcXChangeKeyboardDevice (register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXChangeKeyboardDevice (ClientPtr client, int size, xChangeKeyboardDeviceReply *rep)
|
||||
SRepXChangeKeyboardDevice(ClientPtr client, int size,
|
||||
xChangeKeyboardDeviceReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
24
Xi/chgkbd.h
24
Xi/chgkbd.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/chgkbd.h,v 3.1 1996/04/15 11:18:27 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXChangeKeyboardDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXChangeKeyboardDevice (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXChangeKeyboardDevice (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xChangeKeyboardDeviceReply * /* rep */
|
||||
);
|
||||
int ProcXChangeKeyboardDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXChangeKeyboardDevice(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xChangeKeyboardDeviceReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* CHGKBD_H */
|
||||
|
|
50
Xi/chgkmap.c
50
Xi/chgkmap.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: chgkmap.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/chgkmap.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,19 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -88,15 +85,14 @@ SProcXChangeDeviceKeyMapping(register ClientPtr client)
|
|||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
p = (long *) &stuff[1];
|
||||
p = (long *)&stuff[1];
|
||||
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
for (i = 0; i < count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
return(ProcXChangeDeviceKeyMapping(client));
|
||||
}
|
||||
return (ProcXChangeDeviceKeyMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -107,28 +103,26 @@ SProcXChangeDeviceKeyMapping(register ClientPtr client)
|
|||
int
|
||||
ProcXChangeDeviceKeyMapping(register ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
int ret;
|
||||
unsigned len;
|
||||
DeviceIntPtr dev;
|
||||
|
||||
REQUEST(xChangeDeviceKeyMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
13
Xi/chgkmap.h
13
Xi/chgkmap.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/chgkmap.h,v 3.1 1996/04/15 11:18:28 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXChangeDeviceKeyMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXChangeDeviceKeyMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXChangeDeviceKeyMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* CHGKMAP_H */
|
||||
|
|
85
Xi/chgprop.c
85
Xi/chgprop.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: chgprop.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/chgprop.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h"
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
@ -92,14 +89,13 @@ SProcXChangeDeviceDontPropagateList(register ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->count, n);
|
||||
p = (long *) &stuff[1];
|
||||
for (i=0; i<stuff->count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
return(ProcXChangeDeviceDontPropagateList(client));
|
||||
}
|
||||
return (ProcXChangeDeviceDontPropagateList(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -108,50 +104,47 @@ SProcXChangeDeviceDontPropagateList(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangeDeviceDontPropagateList (register ClientPtr client)
|
||||
ProcXChangeDeviceDontPropagateList(register ClientPtr client)
|
||||
{
|
||||
int i;
|
||||
WindowPtr pWin;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
OtherInputMasks *others;
|
||||
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;
|
||||
|
||||
|
@ -160,13 +153,13 @@ ProcXChangeDeviceDontPropagateList (register ClientPtr 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;
|
||||
}
|
||||
}
|
||||
|
|
13
Xi/chgprop.h
13
Xi/chgprop.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/chgprop.h,v 3.1 1996/04/15 11:18:29 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXChangeDeviceDontPropagateList(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXChangeDeviceDontPropagateList (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXChangeDeviceDontPropagateList(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* CHGPROP_H */
|
||||
|
|
117
Xi/chgptr.c
117
Xi/chgptr.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: chgptr.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/chgptr.c,v 3.6 2001/08/23 14:56:19 alanh Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,17 +56,17 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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"
|
||||
|
@ -92,8 +89,8 @@ SProcXChangePointerDevice(register ClientPtr client)
|
|||
REQUEST(xChangePointerDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
||||
return(ProcXChangePointerDevice(client));
|
||||
}
|
||||
return (ProcXChangePointerDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -102,13 +99,13 @@ SProcXChangePointerDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXChangePointerDevice (register ClientPtr client)
|
||||
ProcXChangePointerDevice(register ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr xptr = inputInfo.pointer;
|
||||
DeviceIntPtr dev;
|
||||
ValuatorClassPtr v;
|
||||
xChangePointerDeviceReply rep;
|
||||
changeDeviceNotify ev;
|
||||
DeviceIntPtr xptr = inputInfo.pointer;
|
||||
DeviceIntPtr dev;
|
||||
ValuatorClassPtr v;
|
||||
xChangePointerDeviceReply rep;
|
||||
changeDeviceNotify ev;
|
||||
|
||||
REQUEST(xChangePointerDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
|
||||
|
@ -118,74 +115,68 @@ ProcXChangePointerDevice (register ClientPtr 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);
|
||||
return Success;
|
||||
}
|
||||
|
||||
WriteReplyToClient(client, sizeof(xChangePointerDeviceReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
void
|
||||
DeleteFocusClassDeviceStruct(DeviceIntPtr dev)
|
||||
{
|
||||
xfree(dev->focus->trace);
|
||||
xfree(dev->focus);
|
||||
dev->focus = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -194,19 +185,18 @@ DeleteFocusClassDeviceStruct(DeviceIntPtr dev)
|
|||
*/
|
||||
|
||||
void
|
||||
SendEventToAllWindows (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 = WindowTable[i];
|
||||
(void)DeliverEventsToWindow(pWin, ev, count, mask, NullGrab, dev->id);
|
||||
p1 = pWin->firstChild;
|
||||
FindInterestedChildren (dev, p1, mask, ev, count);
|
||||
}
|
||||
FindInterestedChildren(dev, p1, mask, ev, count);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -216,18 +206,18 @@ SendEventToAllWindows (DeviceIntPtr dev, Mask mask, xEvent *ev, int count)
|
|||
*/
|
||||
|
||||
void
|
||||
FindInterestedChildren (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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -237,11 +227,12 @@ FindInterestedChildren (DeviceIntPtr dev, WindowPtr p1, Mask mask, xEvent *ev, i
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXChangePointerDevice (ClientPtr client, int size, xChangePointerDeviceReply *rep)
|
||||
SRepXChangePointerDevice(ClientPtr client, int size,
|
||||
xChangePointerDeviceReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
56
Xi/chgptr.h
56
Xi/chgptr.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/chgptr.h,v 3.1 1996/04/15 11:18:31 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXChangePointerDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXChangePointerDevice (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXChangePointerDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
DeleteFocusClassDeviceStruct(
|
||||
DeviceIntPtr /* dev */
|
||||
);
|
||||
void DeleteFocusClassDeviceStruct(DeviceIntPtr /* dev */
|
||||
);
|
||||
|
||||
void
|
||||
SendEventToAllWindows (
|
||||
DeviceIntPtr /* dev */,
|
||||
Mask /* mask */,
|
||||
xEvent * /* ev */,
|
||||
int /* count */
|
||||
);
|
||||
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 FindInterestedChildren( /* FIXME: could be static? */
|
||||
DeviceIntPtr /* dev */ ,
|
||||
WindowPtr /* p1 */ ,
|
||||
Mask /* mask */ ,
|
||||
xEvent * /* ev */ ,
|
||||
int /* count */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXChangePointerDevice (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xChangePointerDeviceReply * /* rep */
|
||||
);
|
||||
void SRepXChangePointerDevice(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xChangePointerDeviceReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* CHGPTR_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: closedev.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/closedev.c,v 3.3 2001/08/23 14:56:19 alanh Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,16 +56,16 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include "scrnintstr.h" /* screen structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "closedev.h"
|
||||
|
@ -87,8 +84,8 @@ SProcXCloseDevice(register ClientPtr client)
|
|||
REQUEST(xCloseDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xCloseDeviceReq);
|
||||
return(ProcXCloseDevice(client));
|
||||
}
|
||||
return (ProcXCloseDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -99,39 +96,37 @@ SProcXCloseDevice(register ClientPtr client)
|
|||
int
|
||||
ProcXCloseDevice(register ClientPtr client)
|
||||
{
|
||||
int i;
|
||||
WindowPtr pWin, p1;
|
||||
DeviceIntPtr d;
|
||||
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 = WindowTable[i];
|
||||
DeleteDeviceEvents (d, pWin, client);
|
||||
DeleteDeviceEvents(d, pWin, client);
|
||||
p1 = pWin->firstChild;
|
||||
DeleteEventsFromChildren (d, p1, client);
|
||||
}
|
||||
|
||||
CloseInputDevice (d, client);
|
||||
return Success;
|
||||
DeleteEventsFromChildren(d, p1, client);
|
||||
}
|
||||
|
||||
CloseInputDevice(d, client);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Walk througth the window tree, deleting event selections for this client
|
||||
|
@ -144,14 +139,13 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -161,23 +155,21 @@ DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
DeleteDeviceEvents (DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||
DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
|
||||
{
|
||||
InputClientsPtr others;
|
||||
OtherInputMasks *pOthers;
|
||||
GrabPtr grab, next;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/closedev.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXCloseDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXCloseDevice(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXCloseDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
DeleteEventsFromChildren(
|
||||
DeviceIntPtr /* dev */,
|
||||
WindowPtr /* p1 */,
|
||||
ClientPtr /* client */
|
||||
);
|
||||
void DeleteEventsFromChildren(DeviceIntPtr /* dev */ ,
|
||||
WindowPtr /* p1 */ ,
|
||||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
DeleteDeviceEvents (
|
||||
DeviceIntPtr /* dev */,
|
||||
WindowPtr /* pWin */,
|
||||
ClientPtr /* client */
|
||||
);
|
||||
void DeleteDeviceEvents(DeviceIntPtr /* dev */ ,
|
||||
WindowPtr /* pWin */ ,
|
||||
ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* CLOSEDEV_H */
|
||||
|
|
68
Xi/devbell.c
68
Xi/devbell.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: devbell.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/devbell.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,13 +56,13 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "devbell.h"
|
||||
|
@ -84,8 +81,8 @@ SProcXDeviceBell(register ClientPtr client)
|
|||
|
||||
REQUEST(xDeviceBellReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXDeviceBell(client));
|
||||
}
|
||||
return (ProcXDeviceBell(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -94,7 +91,7 @@ SProcXDeviceBell(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXDeviceBell (register ClientPtr client)
|
||||
ProcXDeviceBell(register ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
|
@ -108,64 +105,55 @@ ProcXDeviceBell (register ClientPtr 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 = (pointer) &(k->ctrl);
|
||||
ctrl = (pointer) & (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 = (pointer) &(b->ctrl);
|
||||
ctrl = (pointer) & (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;
|
||||
}
|
||||
}
|
||||
|
|
13
Xi/devbell.h
13
Xi/devbell.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/devbell.h,v 3.1 1996/04/15 11:18:32 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXDeviceBell(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXDeviceBell (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXDeviceBell(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* DEVBELL_H */
|
||||
|
|
994
Xi/exevents.c
994
Xi/exevents.c
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/exglobals.h,v 3.2 1996/05/06 05:56:03 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -36,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 */
|
||||
|
|
725
Xi/extinit.c
725
Xi/extinit.c
File diff suppressed because it is too large
Load Diff
59
Xi/getbmap.c
59
Xi/getbmap.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getbmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getbmap.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,13 +56,13 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getbmap.h"
|
||||
|
@ -83,8 +80,8 @@ SProcXGetDeviceButtonMapping(register ClientPtr client)
|
|||
|
||||
REQUEST(xGetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXGetDeviceButtonMapping(client));
|
||||
}
|
||||
return (ProcXGetDeviceButtonMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -93,11 +90,11 @@ SProcXGetDeviceButtonMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetDeviceButtonMapping (register ClientPtr client)
|
||||
ProcXGetDeviceButtonMapping(register ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
xGetDeviceButtonMappingReply rep;
|
||||
ButtonClassPtr b;
|
||||
DeviceIntPtr dev;
|
||||
xGetDeviceButtonMappingReply rep;
|
||||
ButtonClassPtr b;
|
||||
|
||||
REQUEST(xGetDeviceButtonMappingReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq);
|
||||
|
@ -108,28 +105,25 @@ ProcXGetDeviceButtonMapping (register ClientPtr 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);
|
||||
(void)WriteToClient(client, rep.nElts,
|
||||
(char *)&b->map[1]);
|
||||
return Success;
|
||||
}
|
||||
rep.nElts = b->numButtons;
|
||||
rep.length = (rep.nElts + (4 - 1)) / 4;
|
||||
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
||||
(void)WriteToClient(client, rep.nElts, (char *)&b->map[1]);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -139,11 +133,12 @@ ProcXGetDeviceButtonMapping (register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceButtonMapping (ClientPtr client, int size, xGetDeviceButtonMappingReply *rep)
|
||||
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
|
||||
xGetDeviceButtonMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/getbmap.h
23
Xi/getbmap.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getbmap.h,v 3.1 1996/04/15 11:18:37 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceButtonMapping (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceButtonMapping (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceButtonMappingReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceButtonMapping(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceButtonMappingReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETBMAP_H */
|
||||
|
|
136
Xi/getdctl.c
136
Xi/getdctl.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getdctl.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getdctl.c,v 3.3 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,19 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getdctl.h"
|
||||
|
@ -86,8 +83,8 @@ SProcXGetDeviceControl(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
|
||||
swaps(&stuff->control, n);
|
||||
return(ProcXGetDeviceControl(client));
|
||||
}
|
||||
return (ProcXGetDeviceControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -98,7 +95,7 @@ SProcXGetDeviceControl(register ClientPtr client)
|
|||
int
|
||||
ProcXGetDeviceControl(ClientPtr client)
|
||||
{
|
||||
int total_length = 0;
|
||||
int total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
register DeviceIntPtr dev;
|
||||
xGetDeviceControlReply rep;
|
||||
|
@ -106,62 +103,53 @@ ProcXGetDeviceControl(ClientPtr 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;
|
||||
}
|
||||
|
||||
buf = (char *) xalloc (total_length);
|
||||
if (!buf)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
|
||||
BadAlloc);
|
||||
total_length = sizeof(xDeviceResolutionState) +
|
||||
(3 * sizeof(int) * dev->valuator->numAxes);
|
||||
break;
|
||||
default:
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
savbuf=buf;
|
||||
}
|
||||
|
||||
switch (stuff->control)
|
||||
{
|
||||
case DEVICE_RESOLUTION:
|
||||
CopySwapDeviceResolution(client, dev->valuator, buf,
|
||||
total_length);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
buf = (char *)xalloc(total_length);
|
||||
if (!buf) {
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
savbuf = buf;
|
||||
|
||||
rep.length = (total_length+3) >> 2;
|
||||
switch (stuff->control) {
|
||||
case DEVICE_RESOLUTION:
|
||||
CopySwapDeviceResolution(client, dev->valuator, buf, total_length);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
rep.length = (total_length + 3) >> 2;
|
||||
WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep);
|
||||
WriteToClient(client, total_length, savbuf);
|
||||
xfree (savbuf);
|
||||
xfree(savbuf);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -170,37 +158,36 @@ ProcXGetDeviceControl(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapDeviceResolution (ClientPtr client, ValuatorClassPtr v, char *buf, int length)
|
||||
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
|
||||
int length)
|
||||
{
|
||||
register char n;
|
||||
AxisInfoPtr a;
|
||||
register char n;
|
||||
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,n);
|
||||
swaps (&r->length,n);
|
||||
swapl (&r->num_valuators,n);
|
||||
iptr = (int *) buf;
|
||||
for (i=0; i < (3 * v->numAxes); i++,iptr++)
|
||||
{
|
||||
swapl (iptr,n);
|
||||
}
|
||||
if (client->swapped) {
|
||||
swaps(&r->control, n);
|
||||
swaps(&r->length, n);
|
||||
swapl(&r->num_valuators, n);
|
||||
iptr = (int *)buf;
|
||||
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
|
||||
swapl(iptr, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -210,12 +197,11 @@ CopySwapDeviceResolution (ClientPtr client, ValuatorClassPtr v, char *buf, int l
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceControl (ClientPtr client, int size, xGetDeviceControlReply *rep)
|
||||
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
35
Xi/getdctl.h
35
Xi/getdctl.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getdctl.h,v 3.1 1996/04/15 11:18:38 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceControl (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapDeviceResolution (
|
||||
ClientPtr /* client */,
|
||||
ValuatorClassPtr /* v */,
|
||||
char * /* buf */,
|
||||
int /* length */
|
||||
);
|
||||
void CopySwapDeviceResolution(ClientPtr /* client */ ,
|
||||
ValuatorClassPtr /* v */ ,
|
||||
char * /* buf */ ,
|
||||
int /* length */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceControl (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceControlReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceControl(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceControlReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETDCTL_H */
|
||||
|
|
285
Xi/getfctl.c
285
Xi/getfctl.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getfctl.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getfctl.c,v 3.3 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,19 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getfctl.h"
|
||||
|
@ -84,8 +81,8 @@ SProcXGetFeedbackControl(register ClientPtr client)
|
|||
|
||||
REQUEST(xGetFeedbackControlReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXGetFeedbackControl(client));
|
||||
}
|
||||
return (ProcXGetFeedbackControl(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -96,7 +93,7 @@ SProcXGetFeedbackControl(register ClientPtr client)
|
|||
int
|
||||
ProcXGetFeedbackControl(ClientPtr client)
|
||||
{
|
||||
int total_length = 0;
|
||||
int total_length = 0;
|
||||
char *buf, *savbuf;
|
||||
register DeviceIntPtr dev;
|
||||
KbdFeedbackPtr k;
|
||||
|
@ -110,13 +107,11 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
REQUEST(xGetFeedbackControlReq);
|
||||
REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_GetFeedbackControl, 0,
|
||||
BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetFeedbackControl;
|
||||
|
@ -124,73 +119,63 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.num_feedbacks = 0;
|
||||
|
||||
for (k=dev->kbdfeed; k; k=k->next)
|
||||
{
|
||||
for (k = dev->kbdfeed; k; k = k->next) {
|
||||
rep.num_feedbacks++;
|
||||
total_length += sizeof(xKbdFeedbackState);
|
||||
}
|
||||
for (p=dev->ptrfeed; p; p=p->next)
|
||||
{
|
||||
}
|
||||
for (p = dev->ptrfeed; p; p = p->next) {
|
||||
rep.num_feedbacks++;
|
||||
total_length += sizeof(xPtrFeedbackState);
|
||||
}
|
||||
for (s=dev->stringfeed; s; s=s->next)
|
||||
{
|
||||
}
|
||||
for (s = dev->stringfeed; s; s = s->next) {
|
||||
rep.num_feedbacks++;
|
||||
total_length += sizeof(xStringFeedbackState) +
|
||||
(s->ctrl.num_symbols_supported * sizeof (KeySym));
|
||||
}
|
||||
for (i=dev->intfeed; i; i=i->next)
|
||||
{
|
||||
total_length += sizeof(xStringFeedbackState) +
|
||||
(s->ctrl.num_symbols_supported * sizeof(KeySym));
|
||||
}
|
||||
for (i = dev->intfeed; i; i = i->next) {
|
||||
rep.num_feedbacks++;
|
||||
total_length += sizeof(xIntegerFeedbackState);
|
||||
}
|
||||
for (l=dev->leds; l; l=l->next)
|
||||
{
|
||||
}
|
||||
for (l = dev->leds; l; l = l->next) {
|
||||
rep.num_feedbacks++;
|
||||
total_length += sizeof(xLedFeedbackState);
|
||||
}
|
||||
for (b=dev->bell; b; b=b->next)
|
||||
{
|
||||
}
|
||||
for (b = dev->bell; b; b = b->next) {
|
||||
rep.num_feedbacks++;
|
||||
total_length += sizeof(xBellFeedbackState);
|
||||
}
|
||||
}
|
||||
|
||||
if (total_length == 0)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0,
|
||||
BadMatch);
|
||||
if (total_length == 0) {
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
buf = (char *) xalloc (total_length);
|
||||
if (!buf)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0,
|
||||
BadAlloc);
|
||||
buf = (char *)xalloc(total_length);
|
||||
if (!buf) {
|
||||
SendErrorToClient(client, IReqCode, X_GetFeedbackControl, 0, BadAlloc);
|
||||
return Success;
|
||||
}
|
||||
savbuf=buf;
|
||||
}
|
||||
savbuf = buf;
|
||||
|
||||
for (k=dev->kbdfeed; k; k=k->next)
|
||||
CopySwapKbdFeedback (client, k, &buf);
|
||||
for (p=dev->ptrfeed; p; p=p->next)
|
||||
CopySwapPtrFeedback (client, p, &buf);
|
||||
for (s=dev->stringfeed; s; s=s->next)
|
||||
CopySwapStringFeedback (client, s, &buf);
|
||||
for (i=dev->intfeed; i; i=i->next)
|
||||
CopySwapIntegerFeedback (client, i, &buf);
|
||||
for (l=dev->leds; l; l=l->next)
|
||||
CopySwapLedFeedback (client, l, &buf);
|
||||
for (b=dev->bell; b; b=b->next)
|
||||
CopySwapBellFeedback (client, b, &buf);
|
||||
for (k = dev->kbdfeed; k; k = k->next)
|
||||
CopySwapKbdFeedback(client, k, &buf);
|
||||
for (p = dev->ptrfeed; p; p = p->next)
|
||||
CopySwapPtrFeedback(client, p, &buf);
|
||||
for (s = dev->stringfeed; s; s = s->next)
|
||||
CopySwapStringFeedback(client, s, &buf);
|
||||
for (i = dev->intfeed; i; i = i->next)
|
||||
CopySwapIntegerFeedback(client, i, &buf);
|
||||
for (l = dev->leds; l; l = l->next)
|
||||
CopySwapLedFeedback(client, l, &buf);
|
||||
for (b = dev->bell; b; b = b->next)
|
||||
CopySwapBellFeedback(client, b, &buf);
|
||||
|
||||
rep.length = (total_length+3) >> 2;
|
||||
rep.length = (total_length + 3) >> 2;
|
||||
WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
|
||||
WriteToClient(client, total_length, savbuf);
|
||||
xfree (savbuf);
|
||||
xfree(savbuf);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -199,15 +184,15 @@ ProcXGetFeedbackControl(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapKbdFeedback (ClientPtr client, KbdFeedbackPtr k, char **buf)
|
||||
CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
|
||||
{
|
||||
int i;
|
||||
register char n;
|
||||
xKbdFeedbackState *k2;
|
||||
int i;
|
||||
register char n;
|
||||
xKbdFeedbackState *k2;
|
||||
|
||||
k2 = (xKbdFeedbackState *) *buf;
|
||||
k2 = (xKbdFeedbackState *) * buf;
|
||||
k2->class = KbdFeedbackClass;
|
||||
k2->length = sizeof (xKbdFeedbackState);
|
||||
k2->length = sizeof(xKbdFeedbackState);
|
||||
k2->id = k->ctrl.id;
|
||||
k2->click = k->ctrl.click;
|
||||
k2->percent = k->ctrl.bell;
|
||||
|
@ -215,18 +200,17 @@ CopySwapKbdFeedback (ClientPtr client, KbdFeedbackPtr k, char **buf)
|
|||
k2->duration = k->ctrl.bell_duration;
|
||||
k2->led_mask = k->ctrl.leds;
|
||||
k2->global_auto_repeat = k->ctrl.autoRepeat;
|
||||
for (i=0; i<32; i++)
|
||||
for (i = 0; i < 32; i++)
|
||||
k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&k2->length,n);
|
||||
swaps(&k2->pitch,n);
|
||||
swaps(&k2->duration,n);
|
||||
swapl(&k2->led_mask,n);
|
||||
swapl(&k2->led_values,n);
|
||||
}
|
||||
*buf += sizeof (xKbdFeedbackState);
|
||||
if (client->swapped) {
|
||||
swaps(&k2->length, n);
|
||||
swaps(&k2->pitch, n);
|
||||
swaps(&k2->duration, n);
|
||||
swapl(&k2->led_mask, n);
|
||||
swapl(&k2->led_values, n);
|
||||
}
|
||||
*buf += sizeof(xKbdFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -235,27 +219,26 @@ CopySwapKbdFeedback (ClientPtr client, KbdFeedbackPtr k, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapPtrFeedback (ClientPtr client, PtrFeedbackPtr p, char **buf)
|
||||
CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xPtrFeedbackState *p2;
|
||||
register char n;
|
||||
xPtrFeedbackState *p2;
|
||||
|
||||
p2 = (xPtrFeedbackState *) *buf;
|
||||
p2 = (xPtrFeedbackState *) * buf;
|
||||
p2->class = PtrFeedbackClass;
|
||||
p2->length = sizeof (xPtrFeedbackState);
|
||||
p2->length = sizeof(xPtrFeedbackState);
|
||||
p2->id = p->ctrl.id;
|
||||
p2->accelNum = p->ctrl.num;
|
||||
p2->accelDenom = p->ctrl.den;
|
||||
p2->threshold = p->ctrl.threshold;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&p2->length,n);
|
||||
swaps(&p2->accelNum,n);
|
||||
swaps(&p2->accelDenom,n);
|
||||
swaps(&p2->threshold,n);
|
||||
}
|
||||
*buf += sizeof (xPtrFeedbackState);
|
||||
if (client->swapped) {
|
||||
swaps(&p2->length, n);
|
||||
swaps(&p2->accelNum, n);
|
||||
swaps(&p2->accelDenom, n);
|
||||
swaps(&p2->threshold, n);
|
||||
}
|
||||
*buf += sizeof(xPtrFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -264,27 +247,26 @@ CopySwapPtrFeedback (ClientPtr client, PtrFeedbackPtr p, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapIntegerFeedback (ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
||||
CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xIntegerFeedbackState *i2;
|
||||
register char n;
|
||||
xIntegerFeedbackState *i2;
|
||||
|
||||
i2 = (xIntegerFeedbackState *) *buf;
|
||||
i2 = (xIntegerFeedbackState *) * buf;
|
||||
i2->class = IntegerFeedbackClass;
|
||||
i2->length = sizeof (xIntegerFeedbackState);
|
||||
i2->length = sizeof(xIntegerFeedbackState);
|
||||
i2->id = i->ctrl.id;
|
||||
i2->resolution = i->ctrl.resolution;
|
||||
i2->min_value = i->ctrl.min_value;
|
||||
i2->max_value = i->ctrl.max_value;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&i2->length,n);
|
||||
swapl(&i2->resolution,n);
|
||||
swapl(&i2->min_value,n);
|
||||
swapl(&i2->max_value,n);
|
||||
}
|
||||
*buf += sizeof (xIntegerFeedbackState);
|
||||
if (client->swapped) {
|
||||
swaps(&i2->length, n);
|
||||
swapl(&i2->resolution, n);
|
||||
swapl(&i2->min_value, n);
|
||||
swapl(&i2->max_value, n);
|
||||
}
|
||||
*buf += sizeof(xIntegerFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -293,37 +275,35 @@ CopySwapIntegerFeedback (ClientPtr client, IntegerFeedbackPtr i, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapStringFeedback (ClientPtr client, StringFeedbackPtr s, char **buf)
|
||||
CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
|
||||
{
|
||||
int i;
|
||||
register char n;
|
||||
xStringFeedbackState *s2;
|
||||
KeySym *kptr;
|
||||
register char n;
|
||||
xStringFeedbackState *s2;
|
||||
KeySym *kptr;
|
||||
|
||||
s2 = (xStringFeedbackState *) *buf;
|
||||
s2 = (xStringFeedbackState *) * buf;
|
||||
s2->class = StringFeedbackClass;
|
||||
s2->length = sizeof (xStringFeedbackState) +
|
||||
s->ctrl.num_symbols_supported * sizeof (KeySym);
|
||||
s2->length = sizeof(xStringFeedbackState) +
|
||||
s->ctrl.num_symbols_supported * sizeof(KeySym);
|
||||
s2->id = s->ctrl.id;
|
||||
s2->max_symbols = s->ctrl.max_symbols;
|
||||
s2->num_syms_supported = s->ctrl.num_symbols_supported;
|
||||
*buf += sizeof (xStringFeedbackState);
|
||||
*buf += sizeof(xStringFeedbackState);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i=0; i<s->ctrl.num_symbols_supported; i++)
|
||||
*kptr++ = *(s->ctrl.symbols_supported+i);
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&s2->length,n);
|
||||
swaps(&s2->max_symbols,n);
|
||||
swaps(&s2->num_syms_supported,n);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i=0; i<s->ctrl.num_symbols_supported; i++,kptr++)
|
||||
{
|
||||
swapl(kptr,n);
|
||||
}
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++)
|
||||
*kptr++ = *(s->ctrl.symbols_supported + i);
|
||||
if (client->swapped) {
|
||||
swaps(&s2->length, n);
|
||||
swaps(&s2->max_symbols, n);
|
||||
swaps(&s2->num_syms_supported, n);
|
||||
kptr = (KeySym *) (*buf);
|
||||
for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
|
||||
swapl(kptr, n);
|
||||
}
|
||||
*buf += (s->ctrl.num_symbols_supported * sizeof (KeySym));
|
||||
}
|
||||
*buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -332,25 +312,24 @@ CopySwapStringFeedback (ClientPtr client, StringFeedbackPtr s, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapLedFeedback (ClientPtr client, LedFeedbackPtr l, char **buf)
|
||||
CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xLedFeedbackState *l2;
|
||||
register char n;
|
||||
xLedFeedbackState *l2;
|
||||
|
||||
l2 = (xLedFeedbackState *) *buf;
|
||||
l2 = (xLedFeedbackState *) * buf;
|
||||
l2->class = LedFeedbackClass;
|
||||
l2->length = sizeof (xLedFeedbackState);
|
||||
l2->length = sizeof(xLedFeedbackState);
|
||||
l2->id = l->ctrl.id;
|
||||
l2->led_values = l->ctrl.led_values;
|
||||
l2->led_mask = l->ctrl.led_mask;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&l2->length,n);
|
||||
swapl(&l2->led_values,n);
|
||||
swapl(&l2->led_mask,n);
|
||||
}
|
||||
*buf += sizeof (xLedFeedbackState);
|
||||
if (client->swapped) {
|
||||
swaps(&l2->length, n);
|
||||
swapl(&l2->led_values, n);
|
||||
swapl(&l2->led_mask, n);
|
||||
}
|
||||
*buf += sizeof(xLedFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -359,26 +338,25 @@ CopySwapLedFeedback (ClientPtr client, LedFeedbackPtr l, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapBellFeedback (ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||
CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xBellFeedbackState *b2;
|
||||
register char n;
|
||||
xBellFeedbackState *b2;
|
||||
|
||||
b2 = (xBellFeedbackState *) *buf;
|
||||
b2 = (xBellFeedbackState *) * buf;
|
||||
b2->class = BellFeedbackClass;
|
||||
b2->length = sizeof (xBellFeedbackState);
|
||||
b2->length = sizeof(xBellFeedbackState);
|
||||
b2->id = b->ctrl.id;
|
||||
b2->percent = b->ctrl.percent;
|
||||
b2->pitch = b->ctrl.pitch;
|
||||
b2->duration = b->ctrl.duration;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&b2->length,n);
|
||||
swaps(&b2->pitch,n);
|
||||
swaps(&b2->duration,n);
|
||||
}
|
||||
*buf += sizeof (xBellFeedbackState);
|
||||
if (client->swapped) {
|
||||
swaps(&b2->length, n);
|
||||
swaps(&b2->pitch, n);
|
||||
swaps(&b2->duration, n);
|
||||
}
|
||||
*buf += sizeof(xBellFeedbackState);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -388,7 +366,8 @@ CopySwapBellFeedback (ClientPtr client, BellFeedbackPtr b, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetFeedbackControl (ClientPtr client, int size, xGetFeedbackControlReply *rep)
|
||||
SRepXGetFeedbackControl(ClientPtr client, int size,
|
||||
xGetFeedbackControlReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
|
@ -396,4 +375,4 @@ SRepXGetFeedbackControl (ClientPtr client, int size, xGetFeedbackControlReply *r
|
|||
swapl(&rep->length, n);
|
||||
swaps(&rep->num_feedbacks, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
83
Xi/getfctl.h
83
Xi/getfctl.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getfctl.h,v 3.1 1996/04/15 11:18:39 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetFeedbackControl(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetFeedbackControl(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapKbdFeedback (
|
||||
ClientPtr /* client */,
|
||||
KbdFeedbackPtr /* k */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapKbdFeedback(ClientPtr /* client */ ,
|
||||
KbdFeedbackPtr /* k */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapPtrFeedback (
|
||||
ClientPtr /* client */,
|
||||
PtrFeedbackPtr /* p */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapPtrFeedback(ClientPtr /* client */ ,
|
||||
PtrFeedbackPtr /* p */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapIntegerFeedback (
|
||||
ClientPtr /* client */,
|
||||
IntegerFeedbackPtr /* i */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapIntegerFeedback(ClientPtr /* client */ ,
|
||||
IntegerFeedbackPtr /* i */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapStringFeedback (
|
||||
ClientPtr /* client */,
|
||||
StringFeedbackPtr /* s */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapStringFeedback(ClientPtr /* client */ ,
|
||||
StringFeedbackPtr /* s */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapLedFeedback (
|
||||
ClientPtr /* client */,
|
||||
LedFeedbackPtr /* l */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapLedFeedback(ClientPtr /* client */ ,
|
||||
LedFeedbackPtr /* l */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapBellFeedback (
|
||||
ClientPtr /* client */,
|
||||
BellFeedbackPtr /* b */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapBellFeedback(ClientPtr /* client */ ,
|
||||
BellFeedbackPtr /* b */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetFeedbackControl (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetFeedbackControlReply * /* rep */
|
||||
);
|
||||
void SRepXGetFeedbackControl(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetFeedbackControlReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETFCTL_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getfocus.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getfocus.c,v 3.2 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getfocus.h"
|
||||
|
@ -84,8 +81,8 @@ SProcXGetDeviceFocus(register ClientPtr client)
|
|||
|
||||
REQUEST(xGetDeviceFocusReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXGetDeviceFocus(client));
|
||||
}
|
||||
return (ProcXGetDeviceFocus(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -96,19 +93,18 @@ SProcXGetDeviceFocus(register ClientPtr client)
|
|||
int
|
||||
ProcXGetDeviceFocus(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
FocusClassPtr focus;
|
||||
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;
|
||||
|
@ -123,14 +119,14 @@ ProcXGetDeviceFocus(ClientPtr 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;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -140,7 +136,7 @@ ProcXGetDeviceFocus(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceFocus (ClientPtr client, int size, xGetDeviceFocusReply *rep)
|
||||
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
|
@ -149,4 +145,4 @@ SRepXGetDeviceFocus (ClientPtr client, int size, xGetDeviceFocusReply *rep)
|
|||
swapl(&rep->focus, n);
|
||||
swapl(&rep->time, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getfocus.h,v 3.1 1996/04/15 11:18:40 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceFocus(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceFocus(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceFocus(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceFocus (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceFocusReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceFocus(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceFocusReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETFOCUS_H */
|
||||
|
|
77
Xi/getkmap.c
77
Xi/getkmap.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getkmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getkmap.c,v 3.3 2001/01/17 22:13:24 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,19 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "swaprep.h"
|
||||
|
||||
|
@ -85,8 +82,8 @@ SProcXGetDeviceKeyMapping(register ClientPtr client)
|
|||
|
||||
REQUEST(xGetDeviceKeyMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXGetDeviceKeyMapping(client));
|
||||
}
|
||||
return (ProcXGetDeviceKeyMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -99,60 +96,52 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -162,12 +151,12 @@ ProcXGetDeviceKeyMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceKeyMapping (ClientPtr client, int size, xGetDeviceKeyMappingReply *rep)
|
||||
SRepXGetDeviceKeyMapping(ClientPtr client, int size,
|
||||
xGetDeviceKeyMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
23
Xi/getkmap.h
23
Xi/getkmap.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getkmap.h,v 3.1 1996/04/15 11:18:41 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceKeyMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceKeyMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceKeyMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceKeyMapping (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceKeyMappingReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceKeyMapping(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceKeyMappingReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETKMAP_H */
|
||||
|
|
62
Xi/getmmap.c
62
Xi/getmmap.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getmmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getmmap.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,19 +50,19 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||
#include <X11/extensions/XIproto.h> /* Request macro */
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getmmap.h"
|
||||
|
@ -84,8 +81,8 @@ SProcXGetDeviceModifierMapping(register ClientPtr client)
|
|||
|
||||
REQUEST(xGetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXGetDeviceModifierMapping(client));
|
||||
}
|
||||
return (ProcXGetDeviceModifierMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -96,44 +93,42 @@ SProcXGetDeviceModifierMapping(register ClientPtr client)
|
|||
int
|
||||
ProcXGetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
CARD8 maxkeys;
|
||||
DeviceIntPtr dev;
|
||||
xGetDeviceModifierMappingReply rep;
|
||||
KeyClassPtr kp;
|
||||
|
||||
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, (char *)kp->modifierKeyMap);
|
||||
WriteToClient(client, 8 * maxkeys, (char *)kp->modifierKeyMap);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -143,11 +138,12 @@ ProcXGetDeviceModifierMapping(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceModifierMapping (ClientPtr client, int size, xGetDeviceModifierMappingReply *rep)
|
||||
SRepXGetDeviceModifierMapping(ClientPtr client, int size,
|
||||
xGetDeviceModifierMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/getmmap.h
23
Xi/getmmap.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getmmap.h,v 3.1 1996/04/15 11:18:42 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceModifierMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceModifierMapping (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceModifierMappingReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceModifierMapping(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceModifierMappingReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETMMAP_H */
|
||||
|
|
122
Xi/getprop.c
122
Xi/getprop.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getprop.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getprop.c,v 3.5 2001/08/23 14:56:19 alanh Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,21 +56,21 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structs */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structs */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -90,8 +87,8 @@ SProcXGetDeviceDontPropagateList(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||
swapl(&stuff->window, n);
|
||||
return(ProcXGetDeviceDontPropagateList(client));
|
||||
}
|
||||
return (ProcXGetDeviceDontPropagateList(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -100,14 +97,14 @@ SProcXGetDeviceDontPropagateList(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetDeviceDontPropagateList (register ClientPtr client)
|
||||
ProcXGetDeviceDontPropagateList(register ClientPtr client)
|
||||
{
|
||||
CARD16 count = 0;
|
||||
int i;
|
||||
XEventClass *buf = NULL, *tbuf;
|
||||
WindowPtr pWin;
|
||||
xGetDeviceDontPropagateListReply rep;
|
||||
OtherInputMasks *others;
|
||||
CARD16 count = 0;
|
||||
int i;
|
||||
XEventClass *buf = NULL, *tbuf;
|
||||
WindowPtr pWin;
|
||||
xGetDeviceDontPropagateListReply rep;
|
||||
OtherInputMasks *others;
|
||||
|
||||
REQUEST(xGetDeviceDontPropagateListReq);
|
||||
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
|
||||
|
@ -118,45 +115,40 @@ ProcXGetDeviceDontPropagateList (register ClientPtr 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 *) xalloc (rep.count * sizeof(XEventClass));
|
||||
rep.length = (rep.count * sizeof (XEventClass) + 3) >> 2;
|
||||
buf = (XEventClass *) xalloc(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);
|
||||
|
||||
if (count)
|
||||
{
|
||||
client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
|
||||
WriteSwappedDataToClient( client, count * sizeof(XEventClass), buf);
|
||||
xfree (buf);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
|
||||
|
||||
if (count) {
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf);
|
||||
xfree(buf);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure gets a list of event classes from a mask word.
|
||||
|
@ -165,26 +157,25 @@ ProcXGetDeviceDontPropagateList (register ClientPtr client)
|
|||
*/
|
||||
|
||||
XEventClass
|
||||
*ClassFromMask (XEventClass *buf, Mask mask, int maskndx, CARD16 *count, int mode)
|
||||
* ClassFromMask(XEventClass * buf, Mask mask, int maskndx, CARD16 * count,
|
||||
int mode)
|
||||
{
|
||||
int i,j;
|
||||
int id = maskndx;
|
||||
Mask tmask = 0x80000000;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -194,7 +185,8 @@ XEventClass
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceDontPropagateList (ClientPtr client, int size, xGetDeviceDontPropagateListReply *rep)
|
||||
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
|
||||
xGetDeviceDontPropagateListReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
|
@ -202,4 +194,4 @@ SRepXGetDeviceDontPropagateList (ClientPtr client, int size, xGetDeviceDontPropa
|
|||
swapl(&rep->length, n);
|
||||
swaps(&rep->count, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
37
Xi/getprop.h
37
Xi/getprop.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getprop.h,v 3.1 1996/04/15 11:18:44 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceDontPropagateList(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceDontPropagateList (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceDontPropagateList(ClientPtr /* client */
|
||||
);
|
||||
|
||||
XEventClass *
|
||||
ClassFromMask (
|
||||
XEventClass * /* buf */,
|
||||
Mask /* mask */,
|
||||
int /* maskndx */,
|
||||
CARD16 * /* count */,
|
||||
int /* mode */
|
||||
);
|
||||
XEventClass *ClassFromMask(XEventClass * /* buf */ ,
|
||||
Mask /* mask */ ,
|
||||
int /* maskndx */ ,
|
||||
CARD16 * /* count */ ,
|
||||
int /* mode */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceDontPropagateList (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceDontPropagateListReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceDontPropagateList(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceDontPropagateListReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETPROP_H */
|
||||
|
|
112
Xi/getselev.c
112
Xi/getselev.c
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getselev.c,v 3.5 2001/10/28 03:32:53 tsi Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,8 +44,6 @@ SOFTWARE.
|
|||
|
||||
********************************************************/
|
||||
|
||||
/* $Xorg: getselev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Extension function to get the current selected events for a given window.
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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"
|
||||
|
||||
|
@ -88,8 +85,8 @@ SProcXGetSelectedExtensionEvents(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
|
||||
swapl(&stuff->window, n);
|
||||
return(ProcXGetSelectedExtensionEvents(client));
|
||||
}
|
||||
return (ProcXGetSelectedExtensionEvents(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -101,15 +98,15 @@ SProcXGetSelectedExtensionEvents(register ClientPtr client)
|
|||
int
|
||||
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;
|
||||
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);
|
||||
|
@ -121,56 +118,54 @@ ProcXGetSelectedExtensionEvents(register ClientPtr 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);
|
||||
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);
|
||||
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 *) xalloc (total_length);
|
||||
buf = (XEventClass *) xalloc(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 (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);
|
||||
|
||||
if (total_length)
|
||||
{
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient( client, total_length, buf);
|
||||
xfree (buf);
|
||||
}
|
||||
return Success;
|
||||
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);
|
||||
|
||||
if (total_length) {
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, total_length, buf);
|
||||
xfree(buf);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XGetSelectedExtensionEvents function,
|
||||
|
@ -179,7 +174,8 @@ ProcXGetSelectedExtensionEvents(register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetSelectedExtensionEvents (ClientPtr client, int size, xGetSelectedExtensionEventsReply *rep)
|
||||
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
|
||||
xGetSelectedExtensionEventsReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
|
@ -188,4 +184,4 @@ SRepXGetSelectedExtensionEvents (ClientPtr client, int size, xGetSelectedExtensi
|
|||
swaps(&rep->this_client_count, n);
|
||||
swaps(&rep->all_clients_count, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getselev.h,v 3.1 1996/04/15 11:18:49 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetSelectedExtensionEvents(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetSelectedExtensionEvents(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetSelectedExtensionEvents(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetSelectedExtensionEvents (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetSelectedExtensionEventsReply * /* rep */
|
||||
);
|
||||
void SRepXGetSelectedExtensionEvents(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetSelectedExtensionEventsReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETSELEV_H */
|
||||
|
|
52
Xi/getvers.c
52
Xi/getvers.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: getvers.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/getvers.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,18 +56,18 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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];
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -87,8 +84,8 @@ SProcXGetExtensionVersion(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
|
||||
swaps(&stuff->nbytes, n);
|
||||
return(ProcXGetExtensionVersion(client));
|
||||
}
|
||||
return (ProcXGetExtensionVersion(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,20 +94,19 @@ SProcXGetExtensionVersion(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXGetExtensionVersion (register ClientPtr client)
|
||||
ProcXGetExtensionVersion(register ClientPtr client)
|
||||
{
|
||||
xGetExtensionVersionReply rep;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_GetExtensionVersion;
|
||||
|
@ -120,17 +116,14 @@ ProcXGetExtensionVersion (register ClientPtr 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;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -140,7 +133,8 @@ ProcXGetExtensionVersion (register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetExtensionVersion (ClientPtr client, int size, xGetExtensionVersionReply *rep)
|
||||
SRepXGetExtensionVersion(ClientPtr client, int size,
|
||||
xGetExtensionVersionReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
|
@ -149,4 +143,4 @@ SRepXGetExtensionVersion (ClientPtr client, int size, xGetExtensionVersionReply
|
|||
swaps(&rep->major_version, n);
|
||||
swaps(&rep->minor_version, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/getvers.h
23
Xi/getvers.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/getvers.h,v 3.1 1996/04/15 11:18:50 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetExtensionVersion(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetExtensionVersion (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetExtensionVersion(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetExtensionVersion (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetExtensionVersionReply * /* rep */
|
||||
);
|
||||
void SRepXGetExtensionVersion(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetExtensionVersionReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETVERS_H */
|
||||
|
|
141
Xi/grabdev.c
141
Xi/grabdev.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: grabdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/grabdev.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -53,28 +50,27 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
#define NEED_EVENTS
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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;
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -95,16 +91,15 @@ SProcXGrabDevice(register ClientPtr client)
|
|||
swapl(&stuff->grabWindow, n);
|
||||
swapl(&stuff->time, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
p = (long *) &stuff[1];
|
||||
for (i=0; i<stuff->event_count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
|
||||
return(ProcXGrabDevice(client));
|
||||
}
|
||||
|
||||
return (ProcXGrabDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Grab an extension device.
|
||||
|
@ -114,49 +109,47 @@ SProcXGrabDevice(register ClientPtr client)
|
|||
int
|
||||
ProcXGrabDevice(ClientPtr client)
|
||||
{
|
||||
int error;
|
||||
xGrabDeviceReply rep;
|
||||
DeviceIntPtr dev;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
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)
|
||||
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);
|
||||
|
||||
if (error != Success)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, error);
|
||||
return Success;
|
||||
}
|
||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
||||
return 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);
|
||||
|
||||
if (error != Success) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDevice, 0, error);
|
||||
return Success;
|
||||
}
|
||||
WriteReplyToClient(client, sizeof(xGrabDeviceReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -165,43 +158,39 @@ ProcXGrabDevice(ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
CreateMaskFromList (ClientPtr client, XEventClass *list, int count, struct tmask *mask, DeviceIntPtr dev, int req)
|
||||
CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
|
||||
struct tmask *mask, DeviceIntPtr dev, int req)
|
||||
{
|
||||
int i,j;
|
||||
int device;
|
||||
DeviceIntPtr tdev;
|
||||
int i, j;
|
||||
int device;
|
||||
DeviceIntPtr tdev;
|
||||
|
||||
for (i=0; i<EMASKSIZE; i++)
|
||||
{
|
||||
for (i = 0; i < EMASKSIZE; i++) {
|
||||
mask[i].mask = 0;
|
||||
mask[i].dev = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < count; i++, list++) {
|
||||
device = *list >> 8;
|
||||
if (device > 255) {
|
||||
SendErrorToClient(client, IReqCode, req, 0, BadClass);
|
||||
return BadClass;
|
||||
}
|
||||
tdev = LookupDeviceIntRec(device);
|
||||
if (tdev == NULL || (dev != NULL && tdev != dev)) {
|
||||
SendErrorToClient(client, IReqCode, req, 0, BadClass);
|
||||
return BadClass;
|
||||
}
|
||||
|
||||
for (i=0; i<count; i++, list++)
|
||||
{
|
||||
device = *list >> 8;
|
||||
if (device > 255)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, req, 0, BadClass);
|
||||
return BadClass;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -211,11 +200,11 @@ CreateMaskFromList (ClientPtr client, XEventClass *list, int count, struct tmask
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGrabDevice (ClientPtr client, int size, xGrabDeviceReply *rep)
|
||||
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
39
Xi/grabdev.h
39
Xi/grabdev.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/grabdev.h,v 3.1 1996/04/15 11:18:51 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGrabDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGrabDevice(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGrabDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
CreateMaskFromList (
|
||||
ClientPtr /* client */,
|
||||
XEventClass * /* list */,
|
||||
int /* count */,
|
||||
struct tmask /* mask */[],
|
||||
DeviceIntPtr /* dev */,
|
||||
int /* req */
|
||||
);
|
||||
int CreateMaskFromList(ClientPtr /* client */ ,
|
||||
XEventClass * /* list */ ,
|
||||
int /* count */ ,
|
||||
struct tmask /* mask */ [],
|
||||
DeviceIntPtr /* dev */ ,
|
||||
int /* req */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGrabDevice (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGrabDeviceReply * /* rep */
|
||||
);
|
||||
void SRepXGrabDevice(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGrabDeviceReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GRABDEV_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: grabdevb.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/grabdevb.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,15 +56,15 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
|
@ -92,16 +89,15 @@ SProcXGrabDeviceButton(register ClientPtr client)
|
|||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
p = (long *) &stuff[1];
|
||||
for (i=0; i<stuff->event_count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
|
||||
return(ProcXGrabDeviceButton(client));
|
||||
}
|
||||
|
||||
return (ProcXGrabDeviceButton(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Grab a button on an extension device.
|
||||
|
@ -111,58 +107,53 @@ SProcXGrabDeviceButton(register ClientPtr client)
|
|||
int
|
||||
ProcXGrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
XEventClass *class;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
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);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceButton, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/grabdevb.h,v 3.1 1996/04/15 11:18:52 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGrabDeviceButton(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGrabDeviceButton(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGrabDeviceButton(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* GRABDEVB_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: grabdevk.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/grabdevk.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,15 +56,15 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "grabdev.h"
|
||||
|
@ -92,14 +89,13 @@ SProcXGrabDeviceKey(register ClientPtr client)
|
|||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
swaps(&stuff->event_count, n);
|
||||
p = (long *) &stuff[1];
|
||||
for (i=0; i<stuff->event_count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->event_count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
return(ProcXGrabDeviceKey(client));
|
||||
}
|
||||
return (ProcXGrabDeviceKey(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -110,63 +106,55 @@ SProcXGrabDeviceKey(register ClientPtr client)
|
|||
int
|
||||
ProcXGrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
XEventClass *class;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
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);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/grabdevk.h,v 3.1 1996/04/15 11:18:53 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGrabDeviceKey(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGrabDeviceKey(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGrabDeviceKey(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* GRABDEVK_H */
|
||||
|
|
103
Xi/gtmotion.c
103
Xi/gtmotion.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: gtmotion.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/gtmotion.c,v 3.6 2001/10/28 03:32:53 tsi Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,13 +56,13 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -87,8 +84,8 @@ SProcXGetDeviceMotionEvents(register ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
|
||||
swapl(&stuff->start, n);
|
||||
swapl(&stuff->stop, n);
|
||||
return(ProcXGetDeviceMotionEvents(client));
|
||||
}
|
||||
return (ProcXGetDeviceMotionEvents(client));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
@ -102,30 +99,28 @@ 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;
|
||||
|
@ -139,51 +134,44 @@ ProcXGetDeviceMotionEvents(ClientPtr 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 *) ALLOCATE_LOCAL(tsize);
|
||||
if (!coords)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_GetDeviceMotionEvents, 0,
|
||||
BadAlloc);
|
||||
if (!coords) {
|
||||
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)
|
||||
{
|
||||
register char n;
|
||||
if (nEvents) {
|
||||
if (client->swapped) {
|
||||
register char n;
|
||||
|
||||
bufptr = coords;
|
||||
for (i=0; i<nEvents * (axes+1); i++)
|
||||
{
|
||||
swapl(bufptr, n);
|
||||
for (i = 0; i < nEvents * (axes + 1); i++) {
|
||||
swapl(bufptr, n);
|
||||
bufptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
WriteToClient(client, length * 4, (char *)coords);
|
||||
}
|
||||
}
|
||||
if (coords)
|
||||
DEALLOCATE_LOCAL(coords);
|
||||
return Success;
|
||||
|
@ -197,7 +185,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXGetDeviceMotionEvents (ClientPtr client, int size, xGetDeviceMotionEventsReply *rep)
|
||||
SRepXGetDeviceMotionEvents(ClientPtr client, int size,
|
||||
xGetDeviceMotionEventsReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
|
@ -205,4 +194,4 @@ SRepXGetDeviceMotionEvents (ClientPtr client, int size, xGetDeviceMotionEventsRe
|
|||
swapl(&rep->length, n);
|
||||
swapl(&rep->nEvents, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/gtmotion.h,v 3.1 1996/04/15 11:18:56 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXGetDeviceMotionEvents(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXGetDeviceMotionEvents(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXGetDeviceMotionEvents(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXGetDeviceMotionEvents (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xGetDeviceMotionEventsReply * /* rep */
|
||||
);
|
||||
void SRepXGetDeviceMotionEvents(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetDeviceMotionEventsReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GTMOTION_H */
|
||||
|
|
238
Xi/listdev.c
238
Xi/listdev.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: listdev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/listdev.c,v 3.3 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,19 +56,19 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h" /* FIXME */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h" /* FIXME */
|
||||
|
||||
#include "listdev.h"
|
||||
|
||||
#define VPC 20 /* Max # valuators per chunk */
|
||||
#define VPC 20 /* Max # valuators per chunk */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -86,8 +83,8 @@ SProcXListInputDevices(register ClientPtr client)
|
|||
|
||||
REQUEST(xListInputDevicesReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXListInputDevices(client));
|
||||
}
|
||||
return (ProcXListInputDevices(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -96,19 +93,19 @@ SProcXListInputDevices(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXListInputDevices (register ClientPtr client)
|
||||
ProcXListInputDevices(register ClientPtr client)
|
||||
{
|
||||
xListInputDevicesReply rep;
|
||||
int numdevs;
|
||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||
int size = 0;
|
||||
int total_length;
|
||||
char *devbuf;
|
||||
char *classbuf;
|
||||
char *namebuf;
|
||||
char *savbuf;
|
||||
xDeviceInfo *dev;
|
||||
DeviceIntPtr d;
|
||||
xListInputDevicesReply rep;
|
||||
int numdevs;
|
||||
int namesize = 1; /* need 1 extra byte for strcpy */
|
||||
int size = 0;
|
||||
int total_length;
|
||||
char *devbuf;
|
||||
char *classbuf;
|
||||
char *namebuf;
|
||||
char *savbuf;
|
||||
xDeviceInfo *dev;
|
||||
DeviceIntPtr d;
|
||||
|
||||
REQUEST_SIZE_MATCH(xListInputDevicesReq);
|
||||
|
||||
|
@ -117,33 +114,33 @@ ProcXListInputDevices (register ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
AddOtherInputDevices ();
|
||||
AddOtherInputDevices();
|
||||
numdevs = inputInfo.numDevices;
|
||||
|
||||
for (d=inputInfo.devices; d; d=d->next)
|
||||
SizeDeviceInfo (d, &namesize, &size);
|
||||
for (d=inputInfo.off_devices; d; d=d->next)
|
||||
SizeDeviceInfo (d, &namesize, &size);
|
||||
for (d = inputInfo.devices; d; d = d->next)
|
||||
SizeDeviceInfo(d, &namesize, &size);
|
||||
for (d = inputInfo.off_devices; d; d = d->next)
|
||||
SizeDeviceInfo(d, &namesize, &size);
|
||||
|
||||
total_length = numdevs * sizeof (xDeviceInfo) + size + namesize;
|
||||
devbuf = (char *) xalloc (total_length);
|
||||
classbuf = devbuf + (numdevs * sizeof (xDeviceInfo));
|
||||
total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
|
||||
devbuf = (char *)xalloc(total_length);
|
||||
classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
|
||||
namebuf = classbuf + size;
|
||||
savbuf = devbuf;
|
||||
|
||||
dev = (xDeviceInfoPtr) devbuf;
|
||||
for (d=inputInfo.devices; d; d=d->next,dev++)
|
||||
ListDeviceInfo (client, d, dev, &devbuf, &classbuf, &namebuf);
|
||||
for (d=inputInfo.off_devices; d; d=d->next,dev++)
|
||||
ListDeviceInfo (client, d, dev, &devbuf, &classbuf, &namebuf);
|
||||
for (d = inputInfo.devices; d; d = d->next, dev++)
|
||||
ListDeviceInfo(client, d, dev, &devbuf, &classbuf, &namebuf);
|
||||
for (d = inputInfo.off_devices; d; d = d->next, dev++)
|
||||
ListDeviceInfo(client, d, dev, &devbuf, &classbuf, &namebuf);
|
||||
|
||||
rep.ndevices = numdevs;
|
||||
rep.length = (total_length + 3) >> 2;
|
||||
WriteReplyToClient (client, sizeof (xListInputDevicesReply), &rep);
|
||||
WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
|
||||
WriteToClient(client, total_length, savbuf);
|
||||
xfree (savbuf);
|
||||
xfree(savbuf);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -153,24 +150,23 @@ ProcXListInputDevices (register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SizeDeviceInfo (DeviceIntPtr d, int *namesize, int *size)
|
||||
SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
|
||||
{
|
||||
int chunks;
|
||||
|
||||
*namesize += 1;
|
||||
if (d->name)
|
||||
*namesize += strlen (d->name);
|
||||
*namesize += strlen(d->name);
|
||||
if (d->key != NULL)
|
||||
*size += sizeof (xKeyInfo);
|
||||
*size += sizeof(xKeyInfo);
|
||||
if (d->button != NULL)
|
||||
*size += sizeof (xButtonInfo);
|
||||
if (d->valuator != NULL)
|
||||
{
|
||||
chunks = ((int) d->valuator->numAxes + 19) / VPC;
|
||||
*size += (chunks * sizeof(xValuatorInfo) +
|
||||
d->valuator->numAxes * sizeof(xAxisInfo));
|
||||
}
|
||||
*size += sizeof(xButtonInfo);
|
||||
if (d->valuator != NULL) {
|
||||
chunks = ((int)d->valuator->numAxes + 19) / VPC;
|
||||
*size += (chunks * sizeof(xValuatorInfo) +
|
||||
d->valuator->numAxes * sizeof(xAxisInfo));
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -179,25 +175,24 @@ SizeDeviceInfo (DeviceIntPtr d, int *namesize, int *size)
|
|||
*/
|
||||
|
||||
void
|
||||
ListDeviceInfo (ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev, char **devbuf, char **classbuf, char **namebuf)
|
||||
ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
|
||||
char **devbuf, char **classbuf, char **namebuf)
|
||||
{
|
||||
CopyDeviceName (namebuf, d->name);
|
||||
CopySwapDevice (client, d, 0, devbuf);
|
||||
if (d->key != NULL)
|
||||
{
|
||||
CopyDeviceName(namebuf, d->name);
|
||||
CopySwapDevice(client, d, 0, devbuf);
|
||||
if (d->key != NULL) {
|
||||
CopySwapKeyClass(client, d->key, classbuf);
|
||||
dev->num_classes++;
|
||||
}
|
||||
if (d->button != NULL)
|
||||
{
|
||||
}
|
||||
if (d->button != NULL) {
|
||||
CopySwapButtonClass(client, d->button, classbuf);
|
||||
dev->num_classes++;
|
||||
}
|
||||
if (d->valuator != NULL)
|
||||
{
|
||||
dev->num_classes += CopySwapValuatorClass(client, d->valuator, classbuf);
|
||||
}
|
||||
}
|
||||
if (d->valuator != NULL) {
|
||||
dev->num_classes +=
|
||||
CopySwapValuatorClass(client, d->valuator, classbuf);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -210,22 +205,19 @@ ListDeviceInfo (ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev, char **dev
|
|||
*/
|
||||
|
||||
void
|
||||
CopyDeviceName (char **namebuf, char *name)
|
||||
CopyDeviceName(char **namebuf, char *name)
|
||||
{
|
||||
char *nameptr = (char *) *namebuf;
|
||||
char *nameptr = (char *)*namebuf;
|
||||
|
||||
if (name)
|
||||
{
|
||||
*nameptr++ = strlen (name);
|
||||
strcpy (nameptr, name);
|
||||
*namebuf += (strlen (name)+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (name) {
|
||||
*nameptr++ = strlen(name);
|
||||
strcpy(nameptr, name);
|
||||
*namebuf += (strlen(name) + 1);
|
||||
} else {
|
||||
*nameptr++ = 0;
|
||||
*namebuf += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -234,12 +226,13 @@ CopyDeviceName (char **namebuf, char *name)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapDevice (register ClientPtr client, DeviceIntPtr d, int num_classes, char **buf)
|
||||
CopySwapDevice(register ClientPtr client, DeviceIntPtr d, int num_classes,
|
||||
char **buf)
|
||||
{
|
||||
register char n;
|
||||
register char n;
|
||||
xDeviceInfoPtr dev;
|
||||
|
||||
dev = (xDeviceInfoPtr) *buf;
|
||||
dev = (xDeviceInfoPtr) * buf;
|
||||
|
||||
dev->id = d->id;
|
||||
dev->type = d->type;
|
||||
|
@ -250,12 +243,11 @@ CopySwapDevice (register ClientPtr client, DeviceIntPtr d, int num_classes, char
|
|||
dev->use = IsXPointer;
|
||||
else
|
||||
dev->use = IsXExtensionDevice;
|
||||
if (client->swapped)
|
||||
{
|
||||
if (client->swapped) {
|
||||
swapl(&dev->type, n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof (xDeviceInfo);
|
||||
}
|
||||
*buf += sizeof(xDeviceInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -264,23 +256,22 @@ CopySwapDevice (register ClientPtr client, DeviceIntPtr d, int num_classes, char
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapKeyClass (register ClientPtr client, KeyClassPtr k, char **buf)
|
||||
CopySwapKeyClass(register ClientPtr client, KeyClassPtr k, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xKeyInfoPtr k2;
|
||||
register char n;
|
||||
xKeyInfoPtr k2;
|
||||
|
||||
k2 = (xKeyInfoPtr) *buf;
|
||||
k2 = (xKeyInfoPtr) * buf;
|
||||
k2->class = KeyClass;
|
||||
k2->length = sizeof (xKeyInfo);
|
||||
k2->length = sizeof(xKeyInfo);
|
||||
k2->min_keycode = k->curKeySyms.minKeyCode;
|
||||
k2->max_keycode = k->curKeySyms.maxKeyCode;
|
||||
k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&k2->num_keys,n);
|
||||
}
|
||||
*buf += sizeof (xKeyInfo);
|
||||
if (client->swapped) {
|
||||
swaps(&k2->num_keys, n);
|
||||
}
|
||||
*buf += sizeof(xKeyInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -289,21 +280,20 @@ CopySwapKeyClass (register ClientPtr client, KeyClassPtr k, char **buf)
|
|||
*/
|
||||
|
||||
void
|
||||
CopySwapButtonClass (register ClientPtr client, ButtonClassPtr b, char **buf)
|
||||
CopySwapButtonClass(register ClientPtr client, ButtonClassPtr b, char **buf)
|
||||
{
|
||||
register char n;
|
||||
xButtonInfoPtr b2;
|
||||
register char n;
|
||||
xButtonInfoPtr b2;
|
||||
|
||||
b2 = (xButtonInfoPtr) *buf;
|
||||
b2 = (xButtonInfoPtr) * buf;
|
||||
b2->class = ButtonClass;
|
||||
b2->length = sizeof (xButtonInfo);
|
||||
b2->length = sizeof(xButtonInfo);
|
||||
b2->num_buttons = b->numButtons;
|
||||
if (client->swapped)
|
||||
{
|
||||
swaps(&b2->num_buttons,n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof (xButtonInfo);
|
||||
if (client->swapped) {
|
||||
swaps(&b2->num_buttons, n); /* macro - braces are required */
|
||||
}
|
||||
*buf += sizeof(xButtonInfo);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -318,43 +308,43 @@ CopySwapButtonClass (register ClientPtr client, ButtonClassPtr b, char **buf)
|
|||
*/
|
||||
|
||||
int
|
||||
CopySwapValuatorClass (register ClientPtr client, ValuatorClassPtr v, char **buf)
|
||||
CopySwapValuatorClass(register ClientPtr client, ValuatorClassPtr v, char **buf)
|
||||
{
|
||||
int i, j, axes, t_axes;
|
||||
register char n;
|
||||
xValuatorInfoPtr v2;
|
||||
AxisInfo *a;
|
||||
xAxisInfoPtr a2;
|
||||
int i, j, axes, t_axes;
|
||||
register char n;
|
||||
xValuatorInfoPtr v2;
|
||||
AxisInfo *a;
|
||||
xAxisInfoPtr a2;
|
||||
|
||||
for (i=0,axes=v->numAxes; i < ((v->numAxes+19)/VPC); i++, axes-=VPC) {
|
||||
for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
|
||||
i++, axes -= VPC) {
|
||||
t_axes = axes < VPC ? axes : VPC;
|
||||
if (t_axes < 0)
|
||||
t_axes = v->numAxes % VPC;
|
||||
v2 = (xValuatorInfoPtr) *buf;
|
||||
v2 = (xValuatorInfoPtr) * buf;
|
||||
v2->class = ValuatorClass;
|
||||
v2->length = sizeof (xValuatorInfo) + t_axes * sizeof (xAxisInfo);
|
||||
v2->num_axes = t_axes;
|
||||
v2->mode = v->mode & DeviceMode;
|
||||
v2->motion_buffer_size = v->numMotionEvents;
|
||||
if (client->swapped)
|
||||
{
|
||||
swapl(&v2->motion_buffer_size,n);
|
||||
}
|
||||
*buf += sizeof (xValuatorInfo);
|
||||
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
|
||||
v2->num_axes = t_axes;
|
||||
v2->mode = v->mode & DeviceMode;
|
||||
v2->motion_buffer_size = v->numMotionEvents;
|
||||
if (client->swapped) {
|
||||
swapl(&v2->motion_buffer_size, n);
|
||||
}
|
||||
*buf += sizeof(xValuatorInfo);
|
||||
a = v->axes + (VPC * i);
|
||||
a2 = (xAxisInfoPtr) *buf;
|
||||
for (j=0; j<t_axes; j++) {
|
||||
a2 = (xAxisInfoPtr) * buf;
|
||||
for (j = 0; j < t_axes; j++) {
|
||||
a2->min_value = a->min_value;
|
||||
a2->max_value = a->max_value;
|
||||
a2->resolution = a->resolution;
|
||||
if (client->swapped) {
|
||||
swapl(&a2->min_value,n);
|
||||
swapl(&a2->max_value,n);
|
||||
swapl(&a2->resolution,n);
|
||||
swapl(&a2->min_value, n);
|
||||
swapl(&a2->max_value, n);
|
||||
swapl(&a2->resolution, n);
|
||||
}
|
||||
a2++;
|
||||
a++;
|
||||
*buf += sizeof (xAxisInfo);
|
||||
*buf += sizeof(xAxisInfo);
|
||||
}
|
||||
}
|
||||
return (i);
|
||||
|
@ -368,11 +358,11 @@ CopySwapValuatorClass (register ClientPtr client, ValuatorClassPtr v, char **buf
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXListInputDevices (ClientPtr client, int size, xListInputDevicesReply *rep)
|
||||
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
99
Xi/listdev.h
99
Xi/listdev.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/listdev.h,v 3.1 1996/04/15 11:18:57 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXListInputDevices(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXListInputDevices (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXListInputDevices(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SizeDeviceInfo (
|
||||
DeviceIntPtr /* d */,
|
||||
int * /* namesize */,
|
||||
int * /* size */
|
||||
);
|
||||
void SizeDeviceInfo(DeviceIntPtr /* d */ ,
|
||||
int * /* namesize */ ,
|
||||
int * /* size */
|
||||
);
|
||||
|
||||
void
|
||||
ListDeviceInfo (
|
||||
ClientPtr /* client */,
|
||||
DeviceIntPtr /* d */,
|
||||
xDeviceInfoPtr /* dev */,
|
||||
char ** /* devbuf */,
|
||||
char ** /* classbuf */,
|
||||
char ** /* namebuf */
|
||||
);
|
||||
void ListDeviceInfo(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* d */ ,
|
||||
xDeviceInfoPtr /* dev */ ,
|
||||
char ** /* devbuf */ ,
|
||||
char ** /* classbuf */ ,
|
||||
char ** /* namebuf */
|
||||
);
|
||||
|
||||
void
|
||||
CopyDeviceName (
|
||||
char ** /* namebuf */,
|
||||
char * /* name */
|
||||
);
|
||||
void CopyDeviceName(char ** /* namebuf */ ,
|
||||
char * /* name */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapDevice (
|
||||
ClientPtr /* client */,
|
||||
DeviceIntPtr /* d */,
|
||||
int /* num_classes */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapDevice(ClientPtr /* client */ ,
|
||||
DeviceIntPtr /* d */ ,
|
||||
int /* num_classes */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapKeyClass (
|
||||
ClientPtr /* client */,
|
||||
KeyClassPtr /* k */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapKeyClass(ClientPtr /* client */ ,
|
||||
KeyClassPtr /* k */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
CopySwapButtonClass (
|
||||
ClientPtr /* client */,
|
||||
ButtonClassPtr /* b */,
|
||||
char ** /* buf */
|
||||
);
|
||||
void CopySwapButtonClass(ClientPtr /* client */ ,
|
||||
ButtonClassPtr /* b */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
int
|
||||
CopySwapValuatorClass (
|
||||
ClientPtr /* client */,
|
||||
ValuatorClassPtr /* v */,
|
||||
char ** /* buf */
|
||||
);
|
||||
int CopySwapValuatorClass(ClientPtr /* client */ ,
|
||||
ValuatorClassPtr /* v */ ,
|
||||
char ** /* buf */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXListInputDevices (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xListInputDevicesReply * /* rep */
|
||||
);
|
||||
void SRepXListInputDevices(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xListInputDevicesReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* LISTDEV_H */
|
||||
|
|
95
Xi/opendev.c
95
Xi/opendev.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: opendev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/opendev.c,v 3.2 2001/01/17 22:13:25 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,20 +56,20 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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[];
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -88,8 +85,8 @@ SProcXOpenDevice(register ClientPtr client)
|
|||
|
||||
REQUEST(xOpenDeviceReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXOpenDevice(client));
|
||||
}
|
||||
return (ProcXOpenDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -100,87 +97,77 @@ SProcXOpenDevice(register ClientPtr client)
|
|||
int
|
||||
ProcXOpenDevice(register ClientPtr client)
|
||||
{
|
||||
xInputClassInfo evbase [numInputClasses];
|
||||
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);
|
||||
|
||||
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);
|
||||
WriteToClient(client, j * sizeof (xInputClassInfo), (char *)evbase);
|
||||
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
|
||||
WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase);
|
||||
return (Success);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -190,11 +177,11 @@ ProcXOpenDevice(register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXOpenDevice (ClientPtr client, int size, xOpenDeviceReply *rep)
|
||||
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/opendev.h
23
Xi/opendev.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/opendev.h,v 3.1 1996/04/15 11:18:58 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXOpenDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXOpenDevice(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXOpenDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXOpenDevice (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xOpenDeviceReply * /* rep */
|
||||
);
|
||||
void SRepXOpenDevice(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xOpenDeviceReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* OPENDEV_H */
|
||||
|
|
139
Xi/queryst.c
139
Xi/queryst.c
|
@ -1,4 +1,3 @@
|
|||
/* $Xorg: queryst.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
/*
|
||||
|
||||
Copyright 1998, 1998 The Open Group
|
||||
|
@ -26,7 +25,6 @@ other dealings in this Software without prior written authorization
|
|||
from The Open Group.
|
||||
|
||||
*/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/queryst.c,v 3.4 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -40,14 +38,14 @@ from The Open Group.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exevents.h"
|
||||
#include "exglobals.h"
|
||||
|
||||
|
@ -66,8 +64,8 @@ SProcXQueryDeviceState(register ClientPtr client)
|
|||
|
||||
REQUEST(xQueryDeviceStateReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXQueryDeviceState(client));
|
||||
}
|
||||
return (ProcXQueryDeviceState(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -78,20 +76,20 @@ SProcXQueryDeviceState(register ClientPtr client)
|
|||
int
|
||||
ProcXQueryDeviceState(register ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
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;
|
||||
register char n;
|
||||
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);
|
||||
|
@ -101,96 +99,83 @@ ProcXQueryDeviceState(register ClientPtr 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 *) xalloc (total_length);
|
||||
if (!buf)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_QueryDeviceState, 0,
|
||||
BadAlloc);
|
||||
}
|
||||
buf = (char *)xalloc(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, n);/* 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, n); /* 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);
|
||||
xfree (savbuf);
|
||||
WriteToClient(client, total_length, savbuf);
|
||||
xfree(savbuf);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -200,11 +185,11 @@ ProcXQueryDeviceState(register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXQueryDeviceState (ClientPtr client, int size, xQueryDeviceStateReply *rep)
|
||||
SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/queryst.h
23
Xi/queryst.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/queryst.h,v 3.1 1996/04/15 11:19:00 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,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 SProcXQueryDeviceState(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXQueryDeviceState(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXQueryDeviceState(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXQueryDeviceState (
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xQueryDeviceStateReply * /* rep */
|
||||
);
|
||||
void SRepXQueryDeviceState(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xQueryDeviceStateReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* QUERYST_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: selectev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/selectev.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -60,22 +57,22 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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[];
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -84,7 +81,7 @@ extern Mask ExtValidMasks[];
|
|||
*/
|
||||
|
||||
int
|
||||
SProcXSelectExtensionEvent (register ClientPtr client)
|
||||
SProcXSelectExtensionEvent(register ClientPtr client)
|
||||
{
|
||||
register char n;
|
||||
register long *p;
|
||||
|
@ -95,14 +92,13 @@ SProcXSelectExtensionEvent (register ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
|
||||
swapl(&stuff->window, n);
|
||||
swaps(&stuff->count, n);
|
||||
p = (long *) &stuff[1];
|
||||
for (i=0; i<stuff->count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
p = (long *)&stuff[1];
|
||||
for (i = 0; i < stuff->count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
return(ProcXSelectExtensionEvent(client));
|
||||
}
|
||||
return (ProcXSelectExtensionEvent(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -111,47 +107,46 @@ SProcXSelectExtensionEvent (register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSelectExtensionEvent (register ClientPtr client)
|
||||
ProcXSelectExtensionEvent(register ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
int i;
|
||||
WindowPtr pWin;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
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) {
|
||||
client->errorValue = stuff->window;
|
||||
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
|
||||
BadWindow);
|
||||
return 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);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
pWin = (WindowPtr) LookupWindow (stuff->window, client);
|
||||
if (!pWin)
|
||||
{
|
||||
client->errorValue = stuff->window;
|
||||
SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0,
|
||||
BadWindow);
|
||||
return 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);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/selectev.h,v 3.1 1996/04/15 11:19:01 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SELECTEV_H
|
||||
#define SELECTEV_H 1
|
||||
|
||||
int
|
||||
SProcXSelectExtensionEvent (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSelectExtensionEvent(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSelectExtensionEvent (
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSelectExtensionEvent(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* SELECTEV_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: sendexev.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/sendexev.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -60,21 +57,21 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* Window */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* Window */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <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 "sendexev.h"
|
||||
|
||||
extern int lastEvent; /* Defined in extension.c */
|
||||
extern int lastEvent; /* Defined in extension.c */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,25 +94,23 @@ SProcXSendExtensionEvent(register ClientPtr client)
|
|||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
swapl(&stuff->destination, n);
|
||||
swaps(&stuff->count, n);
|
||||
eventP = (xEvent *) &stuff[1];
|
||||
for (i=0; i<stuff->num_events; i++,eventP++)
|
||||
{
|
||||
eventP = (xEvent *) & stuff[1];
|
||||
for (i = 0; i < stuff->num_events; i++, eventP++) {
|
||||
proc = EventSwapVector[eventP->u.u.type & 0177];
|
||||
if (proc == NotImplemented) /* no swapping proc; invalid event type? */
|
||||
if (proc == NotImplemented) /* no swapping proc; invalid event type? */
|
||||
return (BadValue);
|
||||
(*proc)(eventP, &eventT);
|
||||
(*proc) (eventP, &eventT);
|
||||
*eventP = eventT;
|
||||
}
|
||||
|
||||
p = (long *) (((xEvent *) &stuff[1]) + stuff->num_events);
|
||||
for (i=0; i<stuff->count; i++)
|
||||
{
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
return(ProcXSendExtensionEvent(client));
|
||||
}
|
||||
|
||||
p = (long *)(((xEvent *) & stuff[1]) + stuff->num_events);
|
||||
for (i = 0; i < stuff->count; i++) {
|
||||
swapl(p, n);
|
||||
p++;
|
||||
}
|
||||
return (ProcXSendExtensionEvent(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Send an event to some client, as if it had come from an extension input
|
||||
|
@ -124,56 +119,50 @@ SProcXSendExtensionEvent(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSendExtensionEvent (register ClientPtr client)
|
||||
ProcXSendExtensionEvent(register ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
DeviceIntPtr dev;
|
||||
xEvent *first;
|
||||
XEventClass *list;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
int ret;
|
||||
DeviceIntPtr dev;
|
||||
xEvent *first;
|
||||
XEventClass *list;
|
||||
struct tmask tmp[EMASKSIZE];
|
||||
|
||||
REQUEST(xSendExtensionEventReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
|
||||
|
||||
if (stuff->length !=(sizeof(xSendExtensionEventReq)>>2) + stuff->count +
|
||||
(stuff->num_events * (sizeof (xEvent) >> 2)))
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_SendExtensionEvent, 0,
|
||||
BadLength);
|
||||
if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count +
|
||||
(stuff->num_events * (sizeof(xEvent) >> 2))) {
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0,
|
||||
BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/* The client's event type must be one defined by an extension. */
|
||||
|
||||
first = ((xEvent *) &stuff[1]);
|
||||
if ( ! ((EXTENSION_EVENT_BASE <= first->u.u.type) &&
|
||||
(first->u.u.type < lastEvent)) )
|
||||
{
|
||||
first = ((xEvent *) & stuff[1]);
|
||||
if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
|
||||
(first->u.u.type < lastEvent))) {
|
||||
client->errorValue = first->u.u.type;
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0,
|
||||
BadValue);
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
list = (XEventClass *) (first + stuff->num_events);
|
||||
if ((ret = CreateMaskFromList (client, list, stuff->count, tmp, dev,
|
||||
X_SendExtensionEvent)) != Success)
|
||||
if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev,
|
||||
X_SendExtensionEvent)) != Success)
|
||||
return Success;
|
||||
|
||||
ret = (SendEvent (client, dev, stuff->destination,
|
||||
stuff->propagate, (xEvent *)&stuff[1], tmp[stuff->deviceid].mask,
|
||||
stuff->num_events));
|
||||
ret = (SendEvent(client, dev, stuff->destination,
|
||||
stuff->propagate, (xEvent *) & stuff[1],
|
||||
tmp[stuff->deviceid].mask, stuff->num_events));
|
||||
|
||||
if (ret != Success)
|
||||
SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, ret);
|
||||
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/sendexev.h,v 3.1 1996/04/15 11:19:02 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SENDEXEV_H
|
||||
#define SENDEXEV_H 1
|
||||
|
||||
int
|
||||
SProcXSendExtensionEvent(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSendExtensionEvent(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSendExtensionEvent(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSendExtensionEvent(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* SENDEXEV_H */
|
||||
|
|
66
Xi/setbmap.c
66
Xi/setbmap.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: setbmap.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/setbmap.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -62,14 +59,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setbmap.h"
|
||||
|
@ -87,8 +84,8 @@ SProcXSetDeviceButtonMapping(register ClientPtr client)
|
|||
|
||||
REQUEST(xSetDeviceButtonMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXSetDeviceButtonMapping(client));
|
||||
}
|
||||
return (ProcXSetDeviceButtonMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,22 +94,21 @@ SProcXSetDeviceButtonMapping(register ClientPtr client)
|
|||
*/
|
||||
|
||||
int
|
||||
ProcXSetDeviceButtonMapping (register ClientPtr client)
|
||||
ProcXSetDeviceButtonMapping(register ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
xSetDeviceButtonMappingReply rep;
|
||||
int ret;
|
||||
xSetDeviceButtonMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
|
||||
REQUEST(xSetDeviceButtonMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
|
||||
|
||||
if (stuff->length != (sizeof(xSetDeviceButtonMappingReq) +
|
||||
stuff->map_length + 3)>>2)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
BadLength);
|
||||
if (stuff->length != (sizeof(xSetDeviceButtonMappingReq) +
|
||||
stuff->map_length + 3) >> 2) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
BadLength);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_SetDeviceButtonMapping;
|
||||
|
@ -120,32 +116,27 @@ ProcXSetDeviceButtonMapping (register ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
rep.status = MappingSuccess;
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
ret = SetButtonMapping (client, dev, stuff->map_length, (BYTE *)&stuff[1]);
|
||||
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
|
||||
|
||||
if (ret == BadValue || ret == BadMatch)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
|
||||
ret);
|
||||
if (ret == BadValue || ret == BadMatch) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0, ret);
|
||||
return Success;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
rep.status = ret;
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != MappingBusy)
|
||||
SendDeviceMappingNotify(MappingPointer, 0, 0, dev);
|
||||
SendDeviceMappingNotify(MappingPointer, 0, 0, dev);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -155,11 +146,12 @@ ProcXSetDeviceButtonMapping (register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXSetDeviceButtonMapping (ClientPtr client, int size, xSetDeviceButtonMappingReply *rep)
|
||||
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
|
||||
xSetDeviceButtonMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/setbmap.h
23
Xi/setbmap.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/setbmap.h,v 3.1 1996/04/15 11:19:03 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETBMAP_H
|
||||
#define SETBMAP_H 1
|
||||
|
||||
int
|
||||
SProcXSetDeviceButtonMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSetDeviceButtonMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSetDeviceButtonMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXSetDeviceButtonMapping(
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xSetDeviceButtonMappingReply * /* rep */
|
||||
);
|
||||
void SRepXSetDeviceButtonMapping(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xSetDeviceButtonMappingReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* SETBMAP_H */
|
||||
|
|
71
Xi/setdval.c
71
Xi/setdval.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: setdval.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/setdval.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setdval.h"
|
||||
|
@ -84,8 +81,8 @@ SProcXSetDeviceValuators(register ClientPtr client)
|
|||
|
||||
REQUEST(xSetDeviceValuatorsReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXSetDeviceValuators(client));
|
||||
}
|
||||
return (ProcXSetDeviceValuators(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,7 +94,7 @@ int
|
|||
ProcXSetDeviceValuators(register ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
xSetDeviceValuatorsReply rep;
|
||||
xSetDeviceValuatorsReply rep;
|
||||
|
||||
REQUEST(xSetDeviceValuatorsReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq);
|
||||
|
@ -108,48 +105,41 @@ ProcXSetDeviceValuators(register ClientPtr client)
|
|||
rep.status = Success;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
if (stuff->length !=(sizeof(xSetDeviceValuatorsReq)>>2) +
|
||||
stuff->num_valuators)
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
|
||||
BadLength);
|
||||
if (stuff->length != (sizeof(xSetDeviceValuatorsReq) >> 2) +
|
||||
stuff->num_valuators) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadLength);
|
||||
return Success;
|
||||
}
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_SetDeviceValuators, 0,
|
||||
BadDevice);
|
||||
}
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->valuator == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
|
||||
BadMatch);
|
||||
}
|
||||
if (dev->valuator == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
|
||||
BadValue);
|
||||
if (stuff->first_valuator + stuff->num_valuators > dev->valuator->numAxes) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
if ((dev->grab) && !SameClient(dev->grab, client))
|
||||
rep.status = AlreadyGrabbed;
|
||||
else
|
||||
rep.status = SetDeviceValuators (client, dev, (int *) &stuff[1],
|
||||
stuff->first_valuator, stuff->num_valuators);
|
||||
rep.status = SetDeviceValuators(client, dev, (int *)&stuff[1],
|
||||
stuff->first_valuator,
|
||||
stuff->num_valuators);
|
||||
|
||||
if (rep.status != Success && rep.status != AlreadyGrabbed)
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
|
||||
rep.status);
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceValuators, 0,
|
||||
rep.status);
|
||||
else
|
||||
WriteReplyToClient (client, sizeof (xSetDeviceValuatorsReply), &rep);
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceValuatorsReply), &rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -159,11 +149,12 @@ ProcXSetDeviceValuators(register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXSetDeviceValuators (ClientPtr client, int size, xSetDeviceValuatorsReply *rep)
|
||||
SRepXSetDeviceValuators(ClientPtr client, int size,
|
||||
xSetDeviceValuatorsReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/setdval.h
23
Xi/setdval.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/setdval.h,v 3.1 1996/04/15 11:19:04 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETDVAL_H
|
||||
#define SETDVAL_H 1
|
||||
|
||||
int
|
||||
SProcXSetDeviceValuators(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSetDeviceValuators(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSetDeviceValuators(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSetDeviceValuators(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXSetDeviceValuators(
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xSetDeviceValuatorsReply * /* rep */
|
||||
);
|
||||
void SRepXSetDeviceValuators(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xSetDeviceValuatorsReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* SETDVAL_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: setfocus.c,v 1.4 2001/02/09 02:04:34 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/setfocus.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,17 +56,17 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "windowstr.h" /* focus struct */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dixevents.h"
|
||||
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setfocus.h"
|
||||
|
@ -90,8 +87,8 @@ SProcXSetDeviceFocus(register ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
swapl(&stuff->focus, n);
|
||||
swapl(&stuff->time, n);
|
||||
return(ProcXSetDeviceFocus(client));
|
||||
}
|
||||
return (ProcXSetDeviceFocus(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -102,23 +99,22 @@ SProcXSetDeviceFocus(register ClientPtr client)
|
|||
int
|
||||
ProcXSetDeviceFocus(register ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
register DeviceIntPtr dev;
|
||||
int ret;
|
||||
register DeviceIntPtr dev;
|
||||
|
||||
REQUEST(xSetDeviceFocusReq);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->device);
|
||||
if (dev==NULL || !dev->focus)
|
||||
{
|
||||
dev = LookupDeviceIntRec(stuff->device);
|
||||
if (dev == NULL || !dev->focus) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceFocus, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
ret = SetInputFocus (client, dev, stuff->focus, stuff->revertTo,
|
||||
stuff->time, TRUE);
|
||||
ret = SetInputFocus(client, dev, stuff->focus, stuff->revertTo,
|
||||
stuff->time, TRUE);
|
||||
if (ret != Success)
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceFocus, 0, ret);
|
||||
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/setfocus.h,v 3.1 1996/04/15 11:19:05 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETFOCUS_H
|
||||
#define SETFOCUS_H 1
|
||||
|
||||
int
|
||||
SProcXSetDeviceFocus(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSetDeviceFocus(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSetDeviceFocus(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSetDeviceFocus(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* SETFOCUS_H */
|
||||
|
|
72
Xi/setmmap.c
72
Xi/setmmap.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: setmmap.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/setmmap.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/********************************************************************
|
||||
*
|
||||
|
@ -53,20 +50,20 @@ SOFTWARE.
|
|||
*
|
||||
*/
|
||||
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_EVENTS /* for inputstr.h */
|
||||
#define NEED_REPLIES
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "exevents.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setmmap.h"
|
||||
|
@ -85,8 +82,8 @@ SProcXSetDeviceModifierMapping(register ClientPtr client)
|
|||
|
||||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXSetDeviceModifierMapping(client));
|
||||
}
|
||||
return (ProcXSetDeviceModifierMapping(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,21 +94,20 @@ SProcXSetDeviceModifierMapping(register ClientPtr client)
|
|||
int
|
||||
ProcXSetDeviceModifierMapping(ClientPtr client)
|
||||
{
|
||||
int ret;
|
||||
xSetDeviceModifierMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
KeyClassPtr kp;
|
||||
|
||||
int ret;
|
||||
xSetDeviceModifierMappingReply rep;
|
||||
DeviceIntPtr dev;
|
||||
KeyClassPtr kp;
|
||||
|
||||
REQUEST(xSetDeviceModifierMappingReq);
|
||||
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_SetDeviceModifierMapping, 0,
|
||||
BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceModifierMapping, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
rep.repType = X_Reply;
|
||||
rep.RepType = X_SetDeviceModifierMapping;
|
||||
|
@ -119,26 +115,24 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
|||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
ret = SetModifierMapping(client, dev, stuff->length,
|
||||
(sizeof (xSetDeviceModifierMappingReq)>>2), stuff->numKeyPerModifier,
|
||||
(BYTE *)&stuff[1], &kp);
|
||||
(sizeof(xSetDeviceModifierMappingReq) >> 2),
|
||||
stuff->numKeyPerModifier, (BYTE *) & stuff[1],
|
||||
&kp);
|
||||
|
||||
if (ret==MappingSuccess || ret==MappingBusy || ret==MappingFailed)
|
||||
{
|
||||
if (ret == MappingSuccess || ret == MappingBusy || ret == MappingFailed) {
|
||||
rep.success = ret;
|
||||
if (ret == MappingSuccess)
|
||||
SendDeviceMappingNotify(MappingModifier, 0, 0, dev);
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),&rep);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ret==-1)
|
||||
ret=BadValue;
|
||||
SendErrorToClient (client, IReqCode, X_SetDeviceModifierMapping, 0,ret);
|
||||
}
|
||||
|
||||
SendDeviceMappingNotify(MappingModifier, 0, 0, dev);
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
|
||||
&rep);
|
||||
} else {
|
||||
if (ret == -1)
|
||||
ret = BadValue;
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceModifierMapping, 0, ret);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -148,12 +142,12 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXSetDeviceModifierMapping (ClientPtr client, int size, xSetDeviceModifierMappingReply *rep)
|
||||
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
|
||||
xSetDeviceModifierMappingReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
23
Xi/setmmap.h
23
Xi/setmmap.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/setmmap.h,v 3.1 1996/04/15 11:19:06 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETMMAP_H
|
||||
#define SETMMAP_H 1
|
||||
|
||||
int
|
||||
SProcXSetDeviceModifierMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSetDeviceModifierMapping(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSetDeviceModifierMapping(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXSetDeviceModifierMapping(
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xSetDeviceModifierMappingReply * /* rep */
|
||||
);
|
||||
void SRepXSetDeviceModifierMapping(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xSetDeviceModifierMappingReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* SETMMAP_H */
|
||||
|
|
54
Xi/setmode.c
54
Xi/setmode.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: setmode.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/setmode.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "XIstubs.h"
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "setmode.h"
|
||||
|
@ -84,8 +81,8 @@ SProcXSetDeviceMode(register ClientPtr client)
|
|||
|
||||
REQUEST(xSetDeviceModeReq);
|
||||
swaps(&stuff->length, n);
|
||||
return(ProcXSetDeviceMode(client));
|
||||
}
|
||||
return (ProcXSetDeviceMode(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,7 +94,7 @@ int
|
|||
ProcXSetDeviceMode(register ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
xSetDeviceModeReply rep;
|
||||
xSetDeviceModeReply rep;
|
||||
|
||||
REQUEST(xSetDeviceModeReq);
|
||||
REQUEST_SIZE_MATCH(xSetDeviceModeReq);
|
||||
|
@ -107,34 +104,31 @@ ProcXSetDeviceMode(register ClientPtr client)
|
|||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient (client, IReqCode, X_SetDeviceMode, 0, BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->valuator == NULL)
|
||||
{
|
||||
}
|
||||
if (dev->valuator == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
if ((dev->grab) && !SameClient(dev->grab, client))
|
||||
rep.status = AlreadyGrabbed;
|
||||
else
|
||||
rep.status = SetDeviceMode (client, dev, stuff->mode);
|
||||
rep.status = SetDeviceMode(client, dev, stuff->mode);
|
||||
|
||||
if (rep.status == Success)
|
||||
dev->valuator->mode = stuff->mode;
|
||||
else if (rep.status != AlreadyGrabbed)
|
||||
{
|
||||
if (rep.status == Success)
|
||||
dev->valuator->mode = stuff->mode;
|
||||
else if (rep.status != AlreadyGrabbed) {
|
||||
SendErrorToClient(client, IReqCode, X_SetDeviceMode, 0, rep.status);
|
||||
return Success;
|
||||
}
|
||||
|
||||
WriteReplyToClient (client, sizeof (xSetDeviceModeReply), &rep);
|
||||
return Success;
|
||||
return Success;
|
||||
}
|
||||
|
||||
WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XSetDeviceMode function,
|
||||
|
@ -143,11 +137,11 @@ ProcXSetDeviceMode(register ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
SRepXSetDeviceMode (ClientPtr client, int size, xSetDeviceModeReply *rep)
|
||||
SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
|
||||
{
|
||||
register char n;
|
||||
|
||||
swaps(&rep->sequenceNumber, n);
|
||||
swapl(&rep->length, n);
|
||||
WriteToClient(client, size, (char *)rep);
|
||||
}
|
||||
}
|
||||
|
|
23
Xi/setmode.h
23
Xi/setmode.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/setmode.h,v 3.1 1996/04/15 11:19:07 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,21 +30,15 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef SETMODE_H
|
||||
#define SETMODE_H 1
|
||||
|
||||
int
|
||||
SProcXSetDeviceMode(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXSetDeviceMode(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXSetDeviceMode(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXSetDeviceMode(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void
|
||||
SRepXSetDeviceMode(
|
||||
ClientPtr /* client */,
|
||||
int /* size */,
|
||||
xSetDeviceModeReply * /* rep */
|
||||
);
|
||||
void SRepXSetDeviceMode(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xSetDeviceModeReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* SETMODE_H */
|
||||
|
|
56
Xi/stubs.c
56
Xi/stubs.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: stubs.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/stubs.c,v 3.4 2001/12/14 19:58:59 dawes Exp $ */
|
||||
|
||||
/*
|
||||
* stubs.c -- stub routines for the X server side of the XINPUT
|
||||
|
@ -94,14 +91,13 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev)
|
||||
ChangeKeyboardDevice(DeviceIntPtr old_dev, DeviceIntPtr new_dev)
|
||||
{
|
||||
/***********************************************************************
|
||||
DeleteFocusClassDeviceStruct(old_dev); * defined in xchgptr.c *
|
||||
**********************************************************************/
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -134,12 +130,9 @@ ChangeKeyboardDevice (DeviceIntPtr old_dev, DeviceIntPtr new_dev)
|
|||
*/
|
||||
|
||||
int
|
||||
ChangePointerDevice (
|
||||
DeviceIntPtr old_dev,
|
||||
DeviceIntPtr new_dev,
|
||||
unsigned char x,
|
||||
unsigned char y)
|
||||
{
|
||||
ChangePointerDevice(DeviceIntPtr old_dev,
|
||||
DeviceIntPtr new_dev, unsigned char x, unsigned char y)
|
||||
{
|
||||
/***********************************************************************
|
||||
InitFocusClassDeviceStruct(old_dev); * allow focusing old ptr*
|
||||
|
||||
|
@ -151,7 +144,7 @@ ChangePointerDevice (
|
|||
axes_changed = FALSE;
|
||||
*************************************************************************/
|
||||
return BadMatch;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -167,9 +160,9 @@ ChangePointerDevice (
|
|||
*/
|
||||
|
||||
void
|
||||
CloseInputDevice (DeviceIntPtr d, ClientPtr client)
|
||||
CloseInputDevice(DeviceIntPtr d, ClientPtr client)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -198,7 +191,7 @@ CloseInputDevice (DeviceIntPtr d, ClientPtr client)
|
|||
*/
|
||||
|
||||
void
|
||||
AddOtherInputDevices (void)
|
||||
AddOtherInputDevices(void)
|
||||
{
|
||||
/**********************************************************************
|
||||
for each uninitialized device, do something like:
|
||||
|
@ -213,7 +206,7 @@ AddOtherInputDevices (void)
|
|||
dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
|
||||
************************************************************************/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -238,9 +231,9 @@ AddOtherInputDevices (void)
|
|||
*/
|
||||
|
||||
void
|
||||
OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status)
|
||||
OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
@ -255,10 +248,10 @@ OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status)
|
|||
*/
|
||||
|
||||
int
|
||||
SetDeviceMode (register ClientPtr client, DeviceIntPtr dev, int mode)
|
||||
SetDeviceMode(register ClientPtr client, DeviceIntPtr dev, int mode)
|
||||
{
|
||||
return BadMatch;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
@ -273,10 +266,11 @@ SetDeviceMode (register ClientPtr client, DeviceIntPtr dev, int mode)
|
|||
*/
|
||||
|
||||
int
|
||||
SetDeviceValuators (register ClientPtr client, DeviceIntPtr dev, int *valuators, int first_valuator, int num_valuators)
|
||||
SetDeviceValuators(register ClientPtr client, DeviceIntPtr dev, int *valuators,
|
||||
int first_valuator, int num_valuators)
|
||||
{
|
||||
return BadMatch;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
|
@ -287,13 +281,13 @@ SetDeviceValuators (register ClientPtr client, DeviceIntPtr dev, int *valuators,
|
|||
*/
|
||||
|
||||
int
|
||||
ChangeDeviceControl (register ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control)
|
||||
ChangeDeviceControl(register ClientPtr client, DeviceIntPtr dev,
|
||||
xDeviceCtl * control)
|
||||
{
|
||||
switch (control->control)
|
||||
{
|
||||
case DEVICE_RESOLUTION:
|
||||
return (BadMatch);
|
||||
default:
|
||||
return (BadMatch);
|
||||
}
|
||||
switch (control->control) {
|
||||
case DEVICE_RESOLUTION:
|
||||
return (BadMatch);
|
||||
default:
|
||||
return (BadMatch);
|
||||
}
|
||||
}
|
||||
|
|
36
Xi/ungrdev.c
36
Xi/ungrdev.c
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: ungrdev.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/ungrdev.c,v 3.2 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,13 +56,13 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "ungrdev.h"
|
||||
|
@ -85,8 +82,8 @@ SProcXUngrabDevice(register ClientPtr client)
|
|||
swaps(&stuff->length, n);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||
swapl(&stuff->time, n);
|
||||
return(ProcXUngrabDevice(client));
|
||||
}
|
||||
return (ProcXUngrabDevice(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -97,25 +94,24 @@ SProcXUngrabDevice(register ClientPtr client)
|
|||
int
|
||||
ProcXUngrabDevice(register ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
GrabPtr grab;
|
||||
TimeStamp time;
|
||||
DeviceIntPtr dev;
|
||||
GrabPtr grab;
|
||||
TimeStamp time;
|
||||
|
||||
REQUEST(xUngrabDeviceReq);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->deviceid);
|
||||
if (dev == NULL)
|
||||
{
|
||||
dev = LookupDeviceIntRec(stuff->deviceid);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDevice, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
grab = dev->grab;
|
||||
}
|
||||
grab = dev->grab;
|
||||
|
||||
time = ClientTimeToServerTime(stuff->time);
|
||||
if ((CompareTimeStamps(time, currentTime) != LATER) &&
|
||||
(CompareTimeStamps(time, dev->grabTime) != EARLIER) &&
|
||||
(grab) && SameClient(grab, client))
|
||||
(*dev->DeactivateGrab)(dev);
|
||||
(*dev->DeactivateGrab) (dev);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
13
Xi/ungrdev.h
13
Xi/ungrdev.h
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/ungrdev.h,v 3.1 1996/04/15 11:19:08 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef UNGRDEV_H
|
||||
#define UNGRDEV_H 1
|
||||
|
||||
int
|
||||
SProcXUngrabDevice(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXUngrabDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXUngrabDevice(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXUngrabDevice(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* UNGRDEV_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: ungrdevb.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.c,v 3.3 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
||||
|
@ -92,8 +89,8 @@ SProcXUngrabDeviceButton(register ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
return(ProcXUngrabDeviceButton(client));
|
||||
}
|
||||
return (ProcXUngrabDeviceButton(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -104,62 +101,50 @@ SProcXUngrabDeviceButton(register ClientPtr client)
|
|||
int
|
||||
ProcXUngrabDeviceButton(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
WindowPtr pWin;
|
||||
GrabRec temporaryGrab;
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
WindowPtr pWin;
|
||||
GrabRec temporaryGrab;
|
||||
|
||||
REQUEST(xUngrabDeviceButtonReq);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->grabbed_device);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->button == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadMatch);
|
||||
}
|
||||
if (dev->button == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard)
|
||||
{
|
||||
mdev = LookupDeviceIntRec (stuff->modifier_device);
|
||||
if (mdev == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadDevice);
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (mdev->key == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
|
||||
pWin = LookupWindow(stuff->grabWindow, client);
|
||||
if (!pWin)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadWindow);
|
||||
if (!pWin) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadWindow);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
if ((stuff->modifiers != AnyModifier) &&
|
||||
(stuff->modifiers & ~AllModifiersMask))
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0,
|
||||
BadValue);
|
||||
(stuff->modifiers & ~AllModifiersMask)) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceButton, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
temporaryGrab.resource = client->clientAsMask;
|
||||
temporaryGrab.device = dev;
|
||||
|
@ -173,4 +158,4 @@ ProcXUngrabDeviceButton(ClientPtr client)
|
|||
|
||||
DeletePassiveGrabFromList(&temporaryGrab);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/ungrdevb.h,v 3.1 1996/04/15 11:19:10 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef UNGRDEVB_H
|
||||
#define UNGRDEVB_H 1
|
||||
|
||||
int
|
||||
SProcXUngrabDeviceButton(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXUngrabDeviceButton(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXUngrabDeviceButton(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXUngrabDeviceButton(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* UNGRDEVB_H */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Xorg: ungrdevk.c,v 1.4 2001/02/09 02:04:35 xorgcvs Exp $ */
|
||||
|
||||
/************************************************************
|
||||
|
||||
Copyright 1989, 1998 The Open Group
|
||||
|
@ -45,7 +43,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|||
SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.c,v 3.3 2001/01/17 22:13:26 dawes Exp $ */
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -59,14 +56,14 @@ SOFTWARE.
|
|||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/X.h> /* for inputstr.h */
|
||||
#include <X11/Xproto.h> /* Request macro */
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "windowstr.h" /* window structure */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "extnsionst.h"
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "extinit.h" /* LookupDeviceIntRec */
|
||||
#include "exglobals.h"
|
||||
#include "dixgrabs.h"
|
||||
|
||||
|
@ -92,8 +89,8 @@ SProcXUngrabDeviceKey(register ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||
swapl(&stuff->grabWindow, n);
|
||||
swaps(&stuff->modifiers, n);
|
||||
return(ProcXUngrabDeviceKey(client));
|
||||
}
|
||||
return (ProcXUngrabDeviceKey(client));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
|
@ -104,73 +101,59 @@ SProcXUngrabDeviceKey(register ClientPtr client)
|
|||
int
|
||||
ProcXUngrabDeviceKey(ClientPtr client)
|
||||
{
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
WindowPtr pWin;
|
||||
GrabRec temporaryGrab;
|
||||
DeviceIntPtr dev;
|
||||
DeviceIntPtr mdev;
|
||||
WindowPtr pWin;
|
||||
GrabRec temporaryGrab;
|
||||
|
||||
REQUEST(xUngrabDeviceKeyReq);
|
||||
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
|
||||
|
||||
dev = LookupDeviceIntRec (stuff->grabbed_device);
|
||||
if (dev == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadDevice);
|
||||
dev = LookupDeviceIntRec(stuff->grabbed_device);
|
||||
if (dev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (dev->key == NULL)
|
||||
{
|
||||
}
|
||||
if (dev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
if (stuff->modifier_device != UseXKeyboard)
|
||||
{
|
||||
mdev = LookupDeviceIntRec (stuff->modifier_device);
|
||||
if (mdev == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadDevice);
|
||||
if (stuff->modifier_device != UseXKeyboard) {
|
||||
mdev = LookupDeviceIntRec(stuff->modifier_device);
|
||||
if (mdev == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadDevice);
|
||||
return Success;
|
||||
}
|
||||
if (mdev->key == NULL)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadMatch);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (mdev->key == NULL) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadMatch);
|
||||
return Success;
|
||||
}
|
||||
} else
|
||||
mdev = (DeviceIntPtr) LookupKeyboardDevice();
|
||||
|
||||
pWin = LookupWindow(stuff->grabWindow, client);
|
||||
if (!pWin)
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadWindow);
|
||||
if (!pWin) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadWindow);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
if (((stuff->key > dev->key->curKeySyms.maxKeyCode) ||
|
||||
(stuff->key < dev->key->curKeySyms.minKeyCode))
|
||||
&& (stuff->key != AnyKey))
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadValue);
|
||||
&& (stuff->key != AnyKey)) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
if ((stuff->modifiers != AnyModifier) &&
|
||||
(stuff->modifiers & ~AllModifiersMask))
|
||||
{
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0,
|
||||
BadValue);
|
||||
(stuff->modifiers & ~AllModifiersMask)) {
|
||||
SendErrorToClient(client, IReqCode, X_UngrabDeviceKey, 0, BadValue);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
temporaryGrab.resource = client->clientAsMask;
|
||||
temporaryGrab.device = dev;
|
||||
temporaryGrab.window = pWin;
|
||||
temporaryGrab.type = DeviceKeyPress;
|
||||
temporaryGrab.type = DeviceKeyPress;
|
||||
temporaryGrab.modifierDevice = mdev;
|
||||
temporaryGrab.modifiersDetail.exact = stuff->modifiers;
|
||||
temporaryGrab.modifiersDetail.pMask = NULL;
|
||||
|
@ -179,4 +162,4 @@ ProcXUngrabDeviceKey(ClientPtr client)
|
|||
|
||||
DeletePassiveGrabFromList(&temporaryGrab);
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* $XFree86: xc/programs/Xserver/Xi/ungrdevk.h,v 3.1 1996/04/15 11:19:12 dawes Exp $ */
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
@ -31,14 +30,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#ifndef UNGRDEVK_H
|
||||
#define UNGRDEVK_H 1
|
||||
|
||||
int
|
||||
SProcXUngrabDeviceKey(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int SProcXUngrabDeviceKey(ClientPtr /* client */
|
||||
);
|
||||
|
||||
int
|
||||
ProcXUngrabDeviceKey(
|
||||
ClientPtr /* client */
|
||||
);
|
||||
int ProcXUngrabDeviceKey(ClientPtr /* client */
|
||||
);
|
||||
|
||||
#endif /* UNGRDEVK_H */
|
||||
|
|
Loading…
Reference in New Issue