summaryrefslogtreecommitdiff
path: root/src/Pointer.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-07-14 16:30:05 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-07-14 16:30:05 -0400
commit04bb8d633f922e12f76b17de5b876320b0fe3b69 (patch)
treec963028702ce0d6d5408c62a7b2ea4c8252767ab /src/Pointer.c
parent2ff3f1fa183be97e66afb863cb9fec391ee3cd5c (diff)
indent'd like "x-indent.sh", but with a more complete set of typedefs - see
https://github.com/ThomasDickey/cindent-snapshots/blob/master/scripts/xxx-profile Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Pointer.c')
-rw-r--r--src/Pointer.c87
1 files changed, 41 insertions, 46 deletions
diff --git a/src/Pointer.c b/src/Pointer.c
index 70b0ea8..910db99 100644
--- a/src/Pointer.c
+++ b/src/Pointer.c
@@ -54,60 +54,55 @@ in this Software without prior written authorization from The Open Group.
#include "IntrinsicI.h"
#include "PassivGraI.h"
-
#define AllButtonsMask (Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask)
-Widget _XtProcessPointerEvent(
- XButtonEvent *event,
- Widget widget,
- XtPerDisplayInput pdi)
+Widget
+_XtProcessPointerEvent(XButtonEvent *event,
+ Widget widget,
+ XtPerDisplayInput pdi)
{
- XtDevice device = &pdi->pointer;
- XtServerGrabPtr newGrab = NULL, devGrab = &device->grab;
- Widget dspWidget = NULL;
- Boolean deactivateGrab = FALSE;
-
- switch (event->type)
- {
- case ButtonPress:
- {
- if (!IsServerGrab(device->grabType))
- {
- Cardinal i;
-
- for (i = (Cardinal) pdi->traceDepth;
- i > 0 && !newGrab;
- i--)
- newGrab = _XtCheckServerGrabsOnWidget((XEvent*)event,
- pdi->trace[i-1],
- POINTER);
- }
- if (newGrab)
- {
- /* Activate the grab */
- device->grab = *newGrab;
- device->grabType = XtPassiveServerGrab;
- }
- }
- break;
-
- case ButtonRelease:
- {
- if ((device->grabType == XtPassiveServerGrab) &&
- !(event->state & (unsigned)(~(Button1Mask << (event->button - 1))) &
- AllButtonsMask))
- deactivateGrab = TRUE;
- }
- break;
- }
+ XtDevice device = &pdi->pointer;
+ XtServerGrabPtr newGrab = NULL, devGrab = &device->grab;
+ Widget dspWidget = NULL;
+ Boolean deactivateGrab = FALSE;
+
+ switch (event->type) {
+ case ButtonPress:
+ {
+ if (!IsServerGrab(device->grabType)) {
+ Cardinal i;
+
+ for (i = (Cardinal) pdi->traceDepth; i > 0 && !newGrab; i--)
+ newGrab = _XtCheckServerGrabsOnWidget((XEvent *) event,
+ pdi->trace[i - 1],
+ POINTER);
+ }
+ if (newGrab) {
+ /* Activate the grab */
+ device->grab = *newGrab;
+ device->grabType = XtPassiveServerGrab;
+ }
+ }
+ break;
+
+ case ButtonRelease:
+ {
+ if ((device->grabType == XtPassiveServerGrab) &&
+ !(event->
+ state & (unsigned) (~(Button1Mask << (event->button - 1))) &
+ AllButtonsMask))
+ deactivateGrab = TRUE;
+ }
+ break;
+ }
if (IsServerGrab(device->grabType) && !(devGrab)->ownerEvents)
- dspWidget = (devGrab)->widget;
+ dspWidget = (devGrab)->widget;
else
- dspWidget = widget;
+ dspWidget = widget;
if (deactivateGrab)
- device->grabType = XtNoServerGrab;
+ device->grabType = XtNoServerGrab;
return dspWidget;
}