Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-01 03:59:21 +0300
committerCampbell Barton <campbell@blender.org>2022-03-01 04:21:27 +0300
commit8a8424021c6bd7666375b5d93804c2693fab4a0d (patch)
tree7df04308ecfabcaf2524526e8fc3f632c01dcf86 /source/blender/windowmanager/WM_types.h
parenteb0f8317e231c4a02940d0269125a96a47e94c7e (diff)
Cleanup: move Event.is_repeat & is_direction_inverted to flags
Use a flag for events to avoid adding struct members every time a new kind of tag is needed - so events remain small. This also simplifies copying settings as flags can be copied at once with a mask.
Diffstat (limited to 'source/blender/windowmanager/WM_types.h')
-rw-r--r--source/blender/windowmanager/WM_types.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index e9f12287d29..cdbaa2739ba 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -560,6 +560,22 @@ typedef struct wmGesture {
/* ************** wmEvent ************************ */
+typedef enum eWM_EventFlag {
+ /**
+ * True if the operating system inverted the delta x/y values and resulting
+ * `prev_xy` values, for natural scroll direction.
+ * For absolute scroll direction, the delta must be negated again.
+ */
+ WM_EVENT_SCROLL_INVERT = (1 << 0),
+ /**
+ * Generated by auto-repeat, note that this must only ever be set for keyboard events
+ * where `ISKEYBOARD(event->type) == true`.
+ *
+ * See #KMI_REPEAT_IGNORE for details on how key-map handling uses this.
+ */
+ WM_EVENT_IS_REPEAT = (1 << 1),
+} eWM_EventFlag;
+
typedef struct wmTabletData {
/** 0=EVT_TABLET_NONE, 1=EVT_TABLET_STYLUS, 2=EVT_TABLET_ERASER. */
int active;
@@ -616,14 +632,6 @@ typedef struct wmEvent {
/** From ghost, fallback if utf8 isn't set. */
char ascii;
- /**
- * Generated by auto-repeat, note that this must only ever be set for keyboard events
- * where `ISKEYBOARD(event->type) == true`.
- *
- * See #KMI_REPEAT_IGNORE for details on how key-map handling uses this.
- */
- char is_repeat;
-
/** The previous value of `type`. */
short prev_type;
/** The previous value of `val`. */
@@ -656,20 +664,14 @@ typedef struct wmEvent {
/** Tablet info, available for mouse move and button events. */
wmTabletData tablet;
+ eWM_EventFlag flag;
+
/* Custom data. */
/** Custom data type, stylus, 6dof, see wm_event_types.h */
short custom;
short customdata_free;
- int pad2;
/** Ascii, unicode, mouse-coords, angles, vectors, NDOF data, drag-drop info. */
void *customdata;
-
- /**
- * True if the operating system inverted the delta x/y values and resulting
- * `prev_xy` values, for natural scroll direction.
- * For absolute scroll direction, the delta must be negated again.
- */
- char is_direction_inverted;
} wmEvent;
/**