[Bf-blender-cvs] [409756e65fa] custom-manipulators: Cleanup, naming (init and Python's __init__ too similar)

Campbell Barton noreply at git.blender.org
Thu Jun 8 20:50:20 CEST 2017


Commit: 409756e65faa155da54362c6ac305976c932e893
Author: Campbell Barton
Date:   Fri Jun 9 04:51:05 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB409756e65faa155da54362c6ac305976c932e893

Cleanup, naming (init and Python's __init__ too similar)

===================================================================

M	source/blender/editors/include/ED_transform.h
M	source/blender/editors/space_image/space_image.c
M	source/blender/editors/space_node/node_widgets.c
M	source/blender/editors/space_view3d/view3d_manipulators.c
M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/editors/transform/transform_manipulator2d.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_manipulator_intern.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c

===================================================================

diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 0a790c72686..a027f99eed1 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -161,10 +161,10 @@ void TRANSFORM_WGT_manipulator(struct wmManipulatorGroupType *wgt);
 
 void TRANSFORM_WGT_object(struct wmManipulatorGroupType *wgt);
 
-bool WIDGETGROUP_manipulator2d_poll(const struct bContext *C, struct wmManipulatorGroupType *wgt);
-void WIDGETGROUP_manipulator2d_init(const struct bContext *C, struct wmManipulatorGroup *wgroup);
-void WIDGETGROUP_manipulator2d_refresh(const struct bContext *C, struct wmManipulatorGroup *wgroup);
-void WIDGETGROUP_manipulator2d_draw_prepare(const struct bContext *C, struct wmManipulatorGroup *wgroup);
+bool ED_widgetgroup_manipulator2d_poll(const struct bContext *C, struct wmManipulatorGroupType *wgt);
+void ED_widgetgroup_manipulator2d_setup(const struct bContext *C, struct wmManipulatorGroup *wgroup);
+void ED_widgetgroup_manipulator2d_refresh(const struct bContext *C, struct wmManipulatorGroup *wgroup);
+void ED_widgetgroup_manipulator2d_draw_prepare(const struct bContext *C, struct wmManipulatorGroup *wgroup);
 
 
 /* Snapping */
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index af8ed40149f..c17391d8a54 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -594,10 +594,10 @@ static void IMAGE_WGT_manipulator2d(wmManipulatorGroupType *wgt)
 	wgt->name = "UV Transform Manipulator";
 	wgt->idname = "IMAGE_WGT_manipulator2d";
 
-	wgt->poll = WIDGETGROUP_manipulator2d_poll;
-	wgt->init = WIDGETGROUP_manipulator2d_init;
-	wgt->refresh = WIDGETGROUP_manipulator2d_refresh;
-	wgt->draw_prepare = WIDGETGROUP_manipulator2d_draw_prepare;
+	wgt->poll = ED_widgetgroup_manipulator2d_poll;
+	wgt->setup = ED_widgetgroup_manipulator2d_setup;
+	wgt->refresh = ED_widgetgroup_manipulator2d_refresh;
+	wgt->draw_prepare = ED_widgetgroup_manipulator2d_draw_prepare;
 }
 
 static void image_widgets(void)
diff --git a/source/blender/editors/space_node/node_widgets.c b/source/blender/editors/space_node/node_widgets.c
index 7c056e5592c..a79b9fcbb12 100644
--- a/source/blender/editors/space_node/node_widgets.c
+++ b/source/blender/editors/space_node/node_widgets.c
@@ -61,7 +61,7 @@ static bool WIDGETGROUP_node_transform_poll(const bContext *C, wmManipulatorGrou
 	return false;
 }
 
-static void WIDGETGROUP_node_transform_init(const bContext *UNUSED(C), wmManipulatorGroup *wgroup)
+static void WIDGETGROUP_node_transform_setup(const bContext *UNUSED(C), wmManipulatorGroup *wgroup)
 {
 	wmManipulatorWrapper *wwrapper = MEM_mallocN(sizeof(wmManipulatorWrapper), __func__);
 
@@ -111,6 +111,6 @@ void NODE_WGT_backdrop_transform(wmManipulatorGroupType *wgt)
 	wgt->idname = "NODE_WGT_backdrop_transform";
 
 	wgt->poll = WIDGETGROUP_node_transform_poll;
-	wgt->init = WIDGETGROUP_node_transform_init;
+	wgt->setup = WIDGETGROUP_node_transform_setup;
 	wgt->refresh = WIDGETGROUP_node_transform_refresh;
 }
diff --git a/source/blender/editors/space_view3d/view3d_manipulators.c b/source/blender/editors/space_view3d/view3d_manipulators.c
index 5f0379ded80..ece9a1642e1 100644
--- a/source/blender/editors/space_view3d/view3d_manipulators.c
+++ b/source/blender/editors/space_view3d/view3d_manipulators.c
@@ -71,7 +71,7 @@ static bool WIDGETGROUP_lamp_poll(const bContext *C, wmManipulatorGroupType *UNU
 	return false;
 }
 
-static void WIDGETGROUP_lamp_init(const bContext *UNUSED(C), wmManipulatorGroup *wgroup)
+static void WIDGETGROUP_lamp_setup(const bContext *UNUSED(C), wmManipulatorGroup *wgroup)
 {
 	const char *propname = "spot_size";
 
@@ -113,7 +113,7 @@ void VIEW3D_WGT_lamp(wmManipulatorGroupType *wgt)
 	wgt->idname = "VIEW3D_WGT_lamp";
 
 	wgt->poll = WIDGETGROUP_lamp_poll;
-	wgt->init = WIDGETGROUP_lamp_init;
+	wgt->setup = WIDGETGROUP_lamp_setup;
 	wgt->refresh = WIDGETGROUP_lamp_refresh;
 
 	wgt->flag |= (WM_MANIPULATORGROUPTYPE_IS_3D | WM_MANIPULATORGROUPTYPE_SCALE_3D);
@@ -164,7 +164,7 @@ static void cameragroup_property_setup(wmManipulator *widget, Object *ob, Camera
 	ED_manipulator_arrow3d_set_range_fac(widget, is_ortho ? (scale_fac * range) : (drawsize * range / half_sensor));
 }
 
-static void WIDGETGROUP_camera_init(const bContext *C, wmManipulatorGroup *wgroup)
+static void WIDGETGROUP_camera_setup(const bContext *C, wmManipulatorGroup *wgroup)
 {
 	Object *ob = CTX_data_active_object(C);
 	Camera *ca = ob->data;
@@ -285,7 +285,7 @@ void VIEW3D_WGT_camera(wmManipulatorGroupType *wgt)
 	wgt->idname = "VIEW3D_WGT_camera";
 
 	wgt->poll = WIDGETGROUP_camera_poll;
-	wgt->init = WIDGETGROUP_camera_init;
+	wgt->setup = WIDGETGROUP_camera_setup;
 	wgt->refresh = WIDGETGROUP_camera_refresh;
 
 	wgt->flag |= WM_MANIPULATORGROUPTYPE_IS_3D;
@@ -353,7 +353,7 @@ void VIEW3D_WGT_force_field(wmManipulatorGroupType *wgt)
 	wgt->idname = "VIEW3D_WGT_force_field";
 
 	wgt->poll = WIDGETGROUP_forcefield_poll;
-	wgt->init = WIDGETGROUP_forcefield_init;
+	wgt->setup = WIDGETGROUP_forcefield_init;
 	wgt->refresh = WIDGETGROUP_forcefield_refresh;
 
 	wgt->flag |= WM_MANIPULATORGROUPTYPE_IS_3D;
@@ -554,10 +554,10 @@ void VIEW3D_WGT_armature_facemaps(wmManipulatorGroupType *wgt)
 	wgt->idname = "VIEW3D_WGT_armature_facemaps";
 
 	wgt->poll = WIDGETGROUP_armature_facemaps_poll;
-	wgt->init = WIDGETGROUP_armature_facemaps_init;
+	wgt->setup = WIDGETGROUP_armature_facemaps_init;
 	wgt->refresh = WIDGETGROUP_armature_facemaps_refresh;
 
-	wgt->keymap_init = WM_manipulatorgroup_keymap_common_sel;
+	wgt->setup_keymap = WM_manipulatorgroup_keymap_common_sel;
 
 	wgt->flag |= (WM_MANIPULATORGROUPTYPE_IS_3D |
 	              WM_MANIPULATORGROUPTYPE_SCALE_3D |
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 149f5086846..d068a31e952 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1346,7 +1346,7 @@ void TRANSFORM_WGT_manipulator(wmManipulatorGroupType *wgt)
 	wgt->idname = "TRANSFORM_WGT_manipulator";
 
 	wgt->poll = WIDGETGROUP_manipulator_poll;
-	wgt->init = WIDGETGROUP_manipulator_init;
+	wgt->setup = WIDGETGROUP_manipulator_init;
 	wgt->refresh = WIDGETGROUP_manipulator_refresh;
 	wgt->draw_prepare = WIDGETGROUP_manipulator_draw_prepare;
 
@@ -1386,7 +1386,7 @@ void TRANSFORM_WGT_object(wmManipulatorGroupType *wgt)
 	wgt->name = "Object Widgets";
 
 	wgt->poll = WIDGETGROUP_object_manipulator_poll;
-	wgt->init = WIDGETGROUP_object_manipulator_init;
+	wgt->setup = WIDGETGROUP_object_manipulator_init;
 	wgt->refresh = WIDGETGROUP_manipulator_refresh;
 	wgt->draw_prepare = WIDGETGROUP_manipulator_draw_prepare;
 
diff --git a/source/blender/editors/transform/transform_manipulator2d.c b/source/blender/editors/transform/transform_manipulator2d.c
index 60e02648537..bf6730fa289 100644
--- a/source/blender/editors/transform/transform_manipulator2d.c
+++ b/source/blender/editors/transform/transform_manipulator2d.c
@@ -166,7 +166,7 @@ BLI_INLINE void manipulator2d_origin_to_region(ARegion *ar, float *r_origin)
 /**
  * Custom handler for manipulator widgets
  */
-static void manipulator2d_handler(
+static void manipulator2d_modal(
         bContext *C, wmManipulator *widget, const wmEvent *UNUSED(event), const int UNUSED(flag))
 {
 	ARegion *ar = CTX_wm_region(C);
@@ -179,7 +179,7 @@ static void manipulator2d_handler(
 	ED_region_tag_redraw(ar);
 }
 
-void WIDGETGROUP_manipulator2d_init(const bContext *UNUSED(C), wmManipulatorGroup *wgroup)
+void ED_widgetgroup_manipulator2d_setup(const bContext *UNUSED(C), wmManipulatorGroup *wgroup)
 {
 	ManipulatorGroup2D *man = manipulatorgroup2d_init(wgroup);
 	wgroup->customdata = man;
@@ -192,7 +192,7 @@ void WIDGETGROUP_manipulator2d_init(const bContext *UNUSED(C), wmManipulatorGrou
 		manipulator2d_get_axis_color(axis_idx, col, col_hi);
 
 		/* custom handler! */
-		WM_manipulator_set_fn_custom_modal(axis, manipulator2d_handler);
+		WM_manipulator_set_fn_custom_modal(axis, manipulator2d_modal);
 		/* set up widget data */
 		ED_manipulator_arrow2d_set_angle(axis, -M_PI_2 * axis_idx);
 		ED_manipulator_arrow2d_set_line_len(axis, 0.8f);
@@ -213,7 +213,7 @@ void WIDGETGROUP_manipulator2d_init(const bContext *UNUSED(C), wmManipulatorGrou
 	MAN2D_ITER_AXES_END;
 }
 
-void WIDGETGROUP_manipulator2d_refresh(const bContext *C, wmManipulatorGroup *wgroup)
+void ED_widgetgroup_manipulator2d_refresh(const bContext *C, wmManipulatorGroup *wgroup)
 {
 	ManipulatorGroup2D *man = wgroup->customdata;
 	float origin[3];
@@ -222,7 +222,7 @@ void WIDGETGROUP_manipulator2d_refresh(const bContext *C, wmManipulatorGroup *wg
 	copy_v2_v2(man->origin, origin);
 }
 
-void WIDGETGROUP_manipulator2d_draw_prepare(const bContext *C, wmManipulatorGroup *wgroup)
+void ED_widgetgroup_manipulator2d_draw_prepare(const bContext *C, wmManipulatorGroup *wgroup)
 {
 	ManipulatorGroup2D *man = wgroup->customdata;
 	float origin[3] = {UNPACK2(man->origin), 0.0f};
@@ -240,7 +240,7 @@ void WIDGETGROUP_manipulator2d_draw_prepare(const bContext *C, wmManipulatorGrou
  * - Called on every redraw, better to do a more simple poll and check for selection in _refresh
  * - UV editing only, could be expanded for other things.
  */
-bool WIDGETGROUP_manipulator2d_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
+bool ED_widgetgroup_manipulator2d_poll(const bContext *C, wmManipulatorGroupType *UNUSED(wgt))
 {
 	SpaceImage *sima = CTX_wm_space_image(C);
 	Object *obedit = CTX_data_edit_object(C);
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator.c b/source/blender/makesrna/intern/rna_wm_manipulator.c
index e054d4ab2b2..75b408a01d2 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator.c
@@ -457,16 +457,16 @@ static bool manipulatorgroup_poll(const bContext *C, wmManipulatorGroupType *wgt
 	return visible;
 }
 
-static void manipulatorgroup_init(const bContext *C, wmManipulatorGroup *wgroup)
+static void manipulatorgroup_setup

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list