From 2eeedbbca96306971a7605ade18ee42053b17e41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Jul 2022 16:23:33 +1000 Subject: Cleanup: add ISMOUSE_MOTION macro Replace verbose ELEM(..) usage, now each kind of mouse event has it's own macro. --- source/blender/windowmanager/wm_event_types.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/blender/windowmanager/wm_event_types.h') diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index c356b275a7e..b4e81dc54c8 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -387,16 +387,14 @@ enum { /** * Test whether the event is any kind: - * #ISMOUSE_BUTTON, #ISMOUSE_WHEEL, #ISMOUSE_GESTURE & motion. + * #ISMOUSE_MOTION, #ISMOUSE_BUTTON, #ISMOUSE_WHEEL & #ISMOUSE_GESTURE. * * \note It's best to use more specific check if possible as mixing motion/buttons/gestures * is very broad and not necessarily obvious which kinds of events are important. */ #define ISMOUSE(event_type) ((event_type) >= _EVT_MOUSE_MIN && (event_type) <= _EVT_MOUSE_MAX) -/** Test whether the event is a mouse wheel. */ -#define ISMOUSE_WHEEL(event_type) ((event_type) >= WHEELUPMOUSE && (event_type) <= WHEELOUTMOUSE) -/** Test whether the event is a mouse (track-pad) gesture. */ -#define ISMOUSE_GESTURE(event_type) ((event_type) >= MOUSEPAN && (event_type) <= MOUSESMARTZOOM) +/** Test whether the event is a mouse button (excluding mouse-wheel). */ +#define ISMOUSE_MOTION(event_type) ELEM(event_type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) /** Test whether the event is a mouse button (excluding mouse-wheel). */ #define ISMOUSE_BUTTON(event_type) \ (ELEM(event_type, \ @@ -407,6 +405,10 @@ enum { BUTTON5MOUSE, \ BUTTON6MOUSE, \ BUTTON7MOUSE)) +/** Test whether the event is a mouse wheel. */ +#define ISMOUSE_WHEEL(event_type) ((event_type) >= WHEELUPMOUSE && (event_type) <= WHEELOUTMOUSE) +/** Test whether the event is a mouse (track-pad) gesture. */ +#define ISMOUSE_GESTURE(event_type) ((event_type) >= MOUSEPAN && (event_type) <= MOUSESMARTZOOM) /** Test whether the event is a NDOF event. */ #define ISNDOF(event_type) ((event_type) >= _NDOF_MIN && (event_type) <= _NDOF_MAX) -- cgit v1.2.3