[Bf-blender-cvs] [8b91a7e8e91] custom-manipulators: Rename intersect callback to test_select
Campbell Barton
noreply at git.blender.org
Fri Jun 9 07:50:30 CEST 2017
Commit: 8b91a7e8e91bb589a26956b0b33a11a4687dee07
Author: Campbell Barton
Date: Fri Jun 9 15:51:59 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB8b91a7e8e91bb589a26956b0b33a11a4687dee07
Rename intersect callback to test_select
Be specific since this isn't for general intersection tests.
===================================================================
M source/blender/editors/manipulator_library/arrow2d_manipulator.c
M source/blender/editors/manipulator_library/cage2d_manipulator.c
M source/blender/makesrna/intern/rna_wm_manipulator.c
M source/blender/windowmanager/manipulators/WM_manipulator_types.h
M source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
===================================================================
diff --git a/source/blender/editors/manipulator_library/arrow2d_manipulator.c b/source/blender/editors/manipulator_library/arrow2d_manipulator.c
index a3b0f6a0480..14b0fa06a1a 100644
--- a/source/blender/editors/manipulator_library/arrow2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/arrow2d_manipulator.c
@@ -135,7 +135,7 @@ static void manipulator_arrow2d_invoke(
manipulator->interaction_data = inter;
}
-static int manipulator_arrow2d_intersect(
+static int manipulator_arrow2d_test_select(
bContext *UNUSED(C), struct wmManipulator *manipulator, const wmEvent *event)
{
ArrowManipulator2D *arrow = (ArrowManipulator2D *)manipulator;
@@ -220,7 +220,7 @@ static void MANIPULATOR_WT_arrow_2d(wmManipulatorType *wt)
/* api callbacks */
wt->draw = manipulator_arrow2d_draw;
wt->invoke = manipulator_arrow2d_invoke;
- wt->intersect = manipulator_arrow2d_intersect;
+ wt->test_select = manipulator_arrow2d_test_select;
wt->struct_size = sizeof(ArrowManipulator2D);
}
diff --git a/source/blender/editors/manipulator_library/cage2d_manipulator.c b/source/blender/editors/manipulator_library/cage2d_manipulator.c
index 8bd449c5b1f..c314da9042d 100644
--- a/source/blender/editors/manipulator_library/cage2d_manipulator.c
+++ b/source/blender/editors/manipulator_library/cage2d_manipulator.c
@@ -267,7 +267,7 @@ static int manipulator_rect_transform_get_cursor(wmManipulator *manipulator)
}
}
-static int manipulator_rect_transform_intersect(
+static int manipulator_rect_transform_test_select(
bContext *UNUSED(C), wmManipulator *manipulator, const wmEvent *event)
{
RectTransformManipulator *cage = (RectTransformManipulator *)manipulator;
@@ -582,7 +582,7 @@ static void MANIPULATOR_WT_cage(wmManipulatorType *wt)
wt->invoke = manipulator_rect_transform_invoke;
wt->prop_data_update = manipulator_rect_transform_prop_data_update;
wt->modal = manipulator_rect_transform_modal;
- wt->intersect = manipulator_rect_transform_intersect;
+ wt->test_select = manipulator_rect_transform_test_select;
wt->exit = manipulator_rect_transform_exit;
wt->cursor_get = manipulator_rect_transform_get_cursor;
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator.c b/source/blender/makesrna/intern/rna_wm_manipulator.c
index f21c11acf61..4e861c0fd56 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator.c
@@ -112,17 +112,17 @@ static void rna_manipulator_draw_select_cb(
RNA_parameter_list_free(&list);
}
-static int rna_manipulator_intersect_cb(
+static int rna_manipulator_test_select_cb(
struct bContext *C, struct wmManipulator *mpr, const struct wmEvent *event)
{
- extern FunctionRNA rna_Manipulator_intersect_func;
+ extern FunctionRNA rna_Manipulator_test_select_func;
wmManipulatorGroup *mgroup = WM_manipulator_get_parent_group(mpr);
PointerRNA mpr_ptr;
ParameterList list;
FunctionRNA *func;
RNA_pointer_create(NULL, mpr->type->ext.srna, mpr, &mpr_ptr);
- /* RNA_struct_find_function(&mpr_ptr, "intersect"); */
- func = &rna_Manipulator_intersect_func;
+ /* RNA_struct_find_function(&mpr_ptr, "test_select"); */
+ func = &rna_Manipulator_test_select_func;
RNA_parameter_list_create(&list, &mpr_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "manipulator", &mpr);
@@ -308,7 +308,7 @@ static StructRNA *rna_Manipulator_register(
int i = 0;
dummywt.draw = (have_function[i++]) ? rna_manipulator_draw_cb : NULL;
dummywt.draw_select = (have_function[i++]) ? rna_manipulator_draw_select_cb : NULL;
- dummywt.intersect = (have_function[i++]) ? rna_manipulator_intersect_cb : NULL;
+ dummywt.test_select = (have_function[i++]) ? rna_manipulator_test_select_cb : NULL;
dummywt.modal = (have_function[i++]) ? rna_manipulator_modal_cb : NULL;
// dummywt.prop_data_update = (have_function[i++]) ? rna_manipulator_prop_data_update : NULL;
// dummywt.position_get = (have_function[i++]) ? rna_manipulator_position_get : NULL;
@@ -758,8 +758,8 @@ static void rna_def_manipulator(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
parm = RNA_def_int(func, "select_id", 0, 0, INT_MAX, "", "", 0, INT_MAX);
- /* wmManipulator.intersect */
- func = RNA_def_function(srna, "intersect", NULL);
+ /* wmManipulator.test_select */
+ func = RNA_def_function(srna, "test_select", NULL);
RNA_def_function_ui_description(func, "");
RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
parm = RNA_def_pointer(func, "context", "Context", "", "");
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 235f068654e..1115939301c 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -146,7 +146,7 @@ typedef struct wmManipulatorType {
wmManipulatorFnDrawSelect draw_select;
/* determine if the mouse intersects with the manipulator. The calculation should be done in the callback itself */
- wmManipulatorFnIntersect intersect;
+ wmManipulatorFnIntersect test_select;
/* handler used by the manipulator. Usually handles interaction tied to a manipulator type */
wmManipulatorFnModal modal;
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c b/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
index ab8a2344560..45f31fe0504 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
@@ -139,8 +139,8 @@ wmManipulator *wm_manipulatorgroup_find_intersected_mainpulator(
int *r_part)
{
for (wmManipulator *manipulator = mgroup->manipulators.first; manipulator; manipulator = manipulator->next) {
- if (manipulator->type->intersect && (manipulator->flag & WM_MANIPULATOR_HIDDEN) == 0) {
- if ((*r_part = manipulator->type->intersect(C, manipulator, event))) {
+ if (manipulator->type->test_select && (manipulator->flag & WM_MANIPULATOR_HIDDEN) == 0) {
+ if ((*r_part = manipulator->type->test_select(C, manipulator, event))) {
return manipulator;
}
}
@@ -157,7 +157,7 @@ void wm_manipulatorgroup_intersectable_manipulators_to_list(const wmManipulatorG
for (wmManipulator *manipulator = mgroup->manipulators.first; manipulator; manipulator = manipulator->next) {
if ((manipulator->flag & WM_MANIPULATOR_HIDDEN) == 0) {
if (((mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) && manipulator->type->draw_select) ||
- ((mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) == 0 && manipulator->type->intersect))
+ ((mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) == 0 && manipulator->type->test_select))
{
BLI_addhead(listbase, BLI_genericNodeN(manipulator));
}
More information about the Bf-blender-cvs
mailing list