From 04bb8d633f922e12f76b17de5b876320b0fe3b69 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 14 Jul 2019 16:30:05 -0400 Subject: 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 --- src/Pointer.c | 87 ++++++++++++++++++++++++++++------------------------------- 1 file 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; } -- cgit v1.2.3