diff options
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/grabdevk.c')
-rw-r--r-- | nx-X11/programs/Xserver/Xi/grabdevk.c | 96 |
1 files changed, 43 insertions, 53 deletions
diff --git a/nx-X11/programs/Xserver/Xi/grabdevk.c b/nx-X11/programs/Xserver/Xi/grabdevk.c index cc7d2f034..aceeec170 100644 --- a/nx-X11/programs/Xserver/Xi/grabdevk.c +++ b/nx-X11/programs/Xserver/Xi/grabdevk.c @@ -55,15 +55,15 @@ SOFTWARE. #include <dix-config.h> #endif -#include <nx-X11/X.h> /* for inputstr.h */ -#include <nx-X11/Xproto.h> /* Request macro */ -#include "inputstr.h" /* DeviceIntPtr */ -#include "windowstr.h" /* window structure */ +#include <nx-X11/X.h> /* for inputstr.h */ +#include <nx-X11/Xproto.h> /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ +#include "windowstr.h" /* window structure */ #include <nx-X11/extensions/XI.h> #include <nx-X11/extensions/XIproto.h> #include "exevents.h" #include "extnsionst.h" -#include "extinit.h" /* LookupDeviceIntRec */ +#include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "grabdev.h" @@ -76,9 +76,8 @@ SOFTWARE. */ int -SProcXGrabDeviceKey(client) - register ClientPtr client; - { +SProcXGrabDeviceKey(register ClientPtr client) +{ REQUEST(xGrabDeviceKeyReq); swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); @@ -87,8 +86,8 @@ SProcXGrabDeviceKey(client) swaps(&stuff->event_count); REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32)); SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count); - return(ProcXGrabDeviceKey(client)); - } + return (ProcXGrabDeviceKey(client)); +} /*********************************************************************** * @@ -97,66 +96,57 @@ SProcXGrabDeviceKey(client) */ int -ProcXGrabDeviceKey(client) - ClientPtr client; - { - int ret; - DeviceIntPtr dev; - DeviceIntPtr mdev; - XEventClass *class; - struct tmask tmp[EMASKSIZE]; +ProcXGrabDeviceKey(ClientPtr client) +{ + int ret; + DeviceIntPtr dev; + DeviceIntPtr mdev; + XEventClass *class; + struct tmask tmp[EMASKSIZE]; REQUEST(xGrabDeviceKeyReq); REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq); - if (stuff->length !=(sizeof(xGrabDeviceKeyReq)>>2) + stuff->event_count) - { - SendErrorToClient (client, IReqCode, X_GrabDeviceKey, 0, BadLength); + if (stuff->length != (sizeof(xGrabDeviceKeyReq) >> 2) + stuff->event_count) { + SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadLength); return Success; - } + } - dev = LookupDeviceIntRec (stuff->grabbed_device); - if (dev == NULL) - { - SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, - BadDevice); + dev = LookupDeviceIntRec(stuff->grabbed_device); + if (dev == NULL) { + SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadDevice); return Success; - } + } - if (stuff->modifier_device != UseXKeyboard) - { - mdev = LookupDeviceIntRec (stuff->modifier_device); - if (mdev == NULL) - { - SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, - BadDevice); + if (stuff->modifier_device != UseXKeyboard) { + mdev = LookupDeviceIntRec(stuff->modifier_device); + if (mdev == NULL) { + SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadDevice); return Success; - } - if (mdev->key == NULL) - { - SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, - BadMatch); + } + if (mdev->key == NULL) { + SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, BadMatch); return Success; - } } - else + } else mdev = (DeviceIntPtr) LookupKeyboardDevice(); class = (XEventClass *) (&stuff[1]); /* first word of values */ - if ((ret = CreateMaskFromList (client, class, - stuff->event_count, tmp, dev, X_GrabDeviceKey)) != Success) - return Success; + if ((ret = CreateMaskFromList(client, class, + stuff->event_count, tmp, dev, + X_GrabDeviceKey)) != Success) + return Success; - ret = GrabKey(client, dev, stuff->this_device_mode, - stuff->other_devices_mode, stuff->modifiers, mdev, stuff->key, - stuff->grabWindow, stuff->ownerEvents, tmp[stuff->grabbed_device].mask); + ret = GrabKey(client, dev, stuff->this_device_mode, + stuff->other_devices_mode, stuff->modifiers, mdev, + stuff->key, stuff->grabWindow, stuff->ownerEvents, + tmp[stuff->grabbed_device].mask); - if (ret != Success) - { + if (ret != Success) { SendErrorToClient(client, IReqCode, X_GrabDeviceKey, 0, ret); - return Success; - } + return Success; + } return Success; - } +} |