aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xi/opendev.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/opendev.c')
-rw-r--r--nx-X11/programs/Xserver/Xi/opendev.c105
1 files changed, 45 insertions, 60 deletions
diff --git a/nx-X11/programs/Xserver/Xi/opendev.c b/nx-X11/programs/Xserver/Xi/opendev.c
index 1b0a2476b..5927546de 100644
--- a/nx-X11/programs/Xserver/Xi/opendev.c
+++ b/nx-X11/programs/Xserver/Xi/opendev.c
@@ -55,20 +55,20 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#include <nx-X11/X.h> /* for inputstr.h */
-#include <nx-X11/Xproto.h> /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
+#include <nx-X11/X.h> /* for inputstr.h */
+#include <nx-X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
#include "XIstubs.h"
-#include "windowstr.h" /* window structure */
+#include "windowstr.h" /* window structure */
#include "extnsionst.h"
-#include "extinit.h" /* LookupDeviceIntRec */
+#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
#include "opendev.h"
-extern CARD8 event_base [];
+extern CARD8 event_base[];
/***********************************************************************
*
@@ -78,13 +78,12 @@ extern CARD8 event_base [];
*/
int
-SProcXOpenDevice(client)
- register ClientPtr client;
- {
+SProcXOpenDevice(register ClientPtr client)
+{
REQUEST(xOpenDeviceReq);
swaps(&stuff->length);
- return(ProcXOpenDevice(client));
- }
+ return (ProcXOpenDevice(client));
+}
/***********************************************************************
*
@@ -93,45 +92,40 @@ SProcXOpenDevice(client)
*/
int
-ProcXOpenDevice(client)
- register ClientPtr client;
- {
- xInputClassInfo evbase [numInputClasses];
+ProcXOpenDevice(register ClientPtr client)
+{
+ xInputClassInfo evbase[numInputClasses];
Bool enableit = FALSE;
- int j=0;
+ int j = 0;
int status = Success;
- xOpenDeviceReply rep;
+ xOpenDeviceReply rep;
DeviceIntPtr dev;
REQUEST(xOpenDeviceReq);
REQUEST_SIZE_MATCH(xOpenDeviceReq);
- if (stuff->deviceid == inputInfo.pointer->id ||
- stuff->deviceid == inputInfo.keyboard->id)
- {
+ if (stuff->deviceid == inputInfo.pointer->id ||
+ stuff->deviceid == inputInfo.keyboard->id) {
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
- return Success;
- }
+ return Success;
+ }
- if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) /* not open */
- {
- for (dev=inputInfo.off_devices; dev; dev=dev->next)
+ if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
+ for (dev = inputInfo.off_devices; dev; dev = dev->next)
if (dev->id == stuff->deviceid)
break;
- if (dev == NULL)
- {
+ if (dev == NULL) {
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
return Success;
- }
- enableit = TRUE;
}
+ enableit = TRUE;
+ }
- OpenInputDevice (dev, client, &status);
- if (status != Success)
- {
+ OpenInputDevice(dev, client, &status);
+ if (status != Success) {
SendErrorToClient(client, IReqCode, X_OpenDevice, 0, status);
return Success;
- }
+ }
if (enableit && dev->inited && dev->startup)
(void)EnableDevice(dev);
@@ -139,45 +133,39 @@ ProcXOpenDevice(client)
rep.repType = X_Reply;
rep.RepType = X_OpenDevice;
rep.sequenceNumber = client->sequence;
- if (dev->key != NULL)
- {
+ if (dev->key != NULL) {
evbase[j].class = KeyClass;
evbase[j++].event_type_base = event_base[KeyClass];
- }
- if (dev->button != NULL)
- {
+ }
+ if (dev->button != NULL) {
evbase[j].class = ButtonClass;
evbase[j++].event_type_base = event_base[ButtonClass];
- }
- if (dev->valuator != NULL)
- {
+ }
+ if (dev->valuator != NULL) {
evbase[j].class = ValuatorClass;
evbase[j++].event_type_base = event_base[ValuatorClass];
- }
+ }
if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
- dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL)
- {
+ dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) {
evbase[j].class = FeedbackClass;
evbase[j++].event_type_base = event_base[FeedbackClass];
- }
- if (dev->focus != NULL)
- {
+ }
+ if (dev->focus != NULL) {
evbase[j].class = FocusClass;
evbase[j++].event_type_base = event_base[FocusClass];
- }
- if (dev->proximity != NULL)
- {
+ }
+ if (dev->proximity != NULL) {
evbase[j].class = ProximityClass;
evbase[j++].event_type_base = event_base[ProximityClass];
- }
+ }
evbase[j].class = OtherClass;
evbase[j++].event_type_base = event_base[OtherClass];
- rep.length = (j * sizeof (xInputClassInfo) + 3) >> 2;
+ rep.length = (j * sizeof(xInputClassInfo) + 3) >> 2;
rep.num_classes = j;
- WriteReplyToClient (client, sizeof (xOpenDeviceReply), &rep);
+ WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
WriteToClient(client, j * sizeof (xInputClassInfo), evbase);
return (Success);
- }
+}
/***********************************************************************
*
@@ -187,12 +175,9 @@ ProcXOpenDevice(client)
*/
void
-SRepXOpenDevice (client, size, rep)
- ClientPtr client;
- int size;
- xOpenDeviceReply *rep;
- {
+SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
+{
swaps(&rep->sequenceNumber);
swapl(&rep->length);
WriteToClient(client, size, rep);
- }
+}