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 <ideasman42@gmail.com>2012-08-09 00:38:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-09 00:38:55 +0400
commit5e0f254afa8caed1febbe02130cc313a53149efe (patch)
tree859b5590307db3310e070b258c04697dabaac2a1 /source/blender/windowmanager/intern
parent6cfb7f50d2856068f74125321a348e43b7c9c3d4 (diff)
utility functions for getting/setting rectangles for operators.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 685ef467ad3..52436b6564c 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -906,16 +906,31 @@ void WM_operator_properties_select_all(wmOperatorType *ot)
RNA_def_enum(ot->srna, "action", select_all_actions, SEL_TOGGLE, "Action", "Selection action to execute");
}
-void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
+void WM_operator_properties_border(wmOperatorType *ot)
{
- RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
+}
+
+void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
+{
+ rect->xmin = RNA_int_get(op->ptr, "xmin");
+ rect->ymin = RNA_int_get(op->ptr, "ymin");
+ rect->xmax = RNA_int_get(op->ptr, "xmax");
+ rect->ymax = RNA_int_get(op->ptr, "ymax");
+}
- if (extend)
+void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
+{
+ RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
+
+ WM_operator_properties_border(ot);
+
+ if (extend) {
RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
+ }
}
void WM_operator_properties_mouse_select(wmOperatorType *ot)