From 946a4fe85a1717001230ab5f256cf5cf10f045cb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Oct 2017 16:11:04 +1100 Subject: WM: Don't save mouse-paths to operator history In preparation for modal operators storing their properties, no need to keep mouse-paths around. Also use generic function for lasso properties. --- source/blender/windowmanager/WM_api.h | 2 ++ .../windowmanager/intern/wm_operator_props.c | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index d91c4a4efe0..40722736d58 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -309,6 +309,8 @@ void WM_operator_properties_border(struct wmOperatorType *ot); void WM_operator_properties_border_to_rcti(struct wmOperator *op, struct rcti *rect); void WM_operator_properties_border_to_rctf(struct wmOperator *op, rctf *rect); void WM_operator_properties_gesture_border(struct wmOperatorType *ot, bool extend); +void WM_operator_properties_gesture_lasso_ex(struct wmOperatorType *ot, bool deselect, bool extend); +void WM_operator_properties_gesture_lasso(struct wmOperatorType *ot); void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor); void WM_operator_properties_gesture_circle(struct wmOperatorType *ot); void WM_operator_properties_mouse_select(struct wmOperatorType *ot); diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 2a44b4997a2..569cd43a524 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -238,6 +238,28 @@ void WM_operator_properties_gesture_border(wmOperatorType *ot, bool extend) } } +/** + * Use with #WM_gesture_lasso_invoke + */ +void WM_operator_properties_gesture_lasso_ex(wmOperatorType *ot, bool deselect, bool extend) +{ + PropertyRNA *prop; + prop = RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", ""); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); + + if (deselect) { + RNA_def_boolean(ot->srna, "deselect", false, "Deselect", "Deselect rather than select items"); + } + if (extend) { + RNA_def_boolean(ot->srna, "extend", true, "Extend", "Extend selection instead of deselecting everything first"); + } +} + +void WM_operator_properties_gesture_lasso(wmOperatorType *ot) +{ + WM_operator_properties_gesture_lasso_ex(ot, true, true); +} + /** * Use with #WM_gesture_straightline_invoke */ -- cgit v1.2.3