diff options
Diffstat (limited to 'source/blender/windowmanager/manipulators/WM_manipulator_types.h')
-rw-r--r-- | source/blender/windowmanager/manipulators/WM_manipulator_types.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h index 01f5d1c0199..fbbbffd18b0 100644 --- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h +++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h @@ -48,6 +48,56 @@ struct wmKeyConfig; /* -------------------------------------------------------------------- */ /* wmManipulator */ +/* manipulators are set per region by registering them on manipulator-maps */ +struct wmManipulator { + struct wmManipulator *next, *prev; + + char idname[64 + 4]; /* MAX_NAME + 4 for unique '.001', '.002', etc suffix */ + + /* While we don't have a real type, use this to put type-like vars. */ + const struct wmManipulatorType *type; + + /* Overrides 'type->handler' when set. */ + wmManipulatorFnHandler custom_handler; + + void *custom_data; + + /* pointer back to group this manipulator is in (just for quick access) */ + struct wmManipulatorGroup *parent_mgroup; + + int flag; /* flags that influence the behavior or how the manipulators are drawn */ + short state; /* state flags (active, highlighted, selected) */ + + unsigned char highlighted_part; + + /* center of manipulator in space, 2d or 3d */ + float origin[3]; + /* custom offset from origin */ + float offset[3]; + /* runtime property, set the scale while drawing on the viewport */ + float scale; + /* user defined scale, in addition to the original one */ + float user_scale; + /* user defined width for line drawing */ + float line_width; + /* manipulator colors (uses default fallbacks if not defined) */ + float col[4], col_hi[4]; + + /* data used during interaction */ + void *interaction_data; + + /* name of operator to spawn when activating the manipulator */ + const char *opname; + /* operator properties if manipulator spawns and controls an operator, + * or owner pointer if manipulator spawns and controls a property */ + PointerRNA opptr; + + /* arrays of properties attached to various manipulator parameters. As + * the manipulator is interacted with, those properties get updated */ + PointerRNA *ptr; + PropertyRNA **props; +}; + /** * Simple utility wrapper for storing a single manipulator as wmManipulatorGroup.customdata (which gets freed). */ @@ -64,6 +114,23 @@ enum { WM_MANIPULATOR_HIDDEN = (1 << 3), }; +/* wmManipulator.state */ +enum { + WM_MANIPULATOR_STATE_HIGHLIGHT = (1 << 0), /* while hovered */ + WM_MANIPULATOR_STATE_ACTIVE = (1 << 1), /* while dragging */ + WM_MANIPULATOR_STATE_SELECT = (1 << 2), +}; + +/** + * \brief Manipulator tweak flag. + * Bitflag passed to manipulator while tweaking. + */ +enum { + /* drag with extra precision (shift) + * NOTE: Manipulators are responsible for handling this (manipulator->handler callback)! */ + WM_MANIPULATOR_TWEAK_PRECISE = (1 << 0), +}; + typedef struct wmManipulatorType { struct wmManipulatorGroupType *next, *prev; |