[Bf-blender-cvs] [7e878492578] blender2.8: Cleanup: rename manipulator API functions

Campbell Barton noreply at git.blender.org
Mon Aug 21 18:05:36 CEST 2017


Commit: 7e8784925780642e9db4219cf10000228f775949
Author: Campbell Barton
Date:   Tue Aug 22 02:06:46 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB7e8784925780642e9db4219cf10000228f775949

Cleanup: rename manipulator API functions

- WM_manipulatorgrouptype_remove- > free
- WM_manipulator_group -> WM_manipulator_group_type

Naming here is still a bit confusing,
now at least free/remove are differentiated.

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

M	source/blender/editors/mesh/editmesh_bisect.c
M	source/blender/editors/mesh/editmesh_extrude.c
M	source/blender/makesrna/intern/rna_wm_api.c
M	source/blender/makesrna/intern/rna_wm_manipulator.c
M	source/blender/windowmanager/manipulators/WM_manipulator_api.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_group_type.c
M	source/blenderplayer/bad_level_call_stubs/stubs.c

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

diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c
index 228677a51c8..c9f083e2089 100644
--- a/source/blender/editors/mesh/editmesh_bisect.c
+++ b/source/blender/editors/mesh/editmesh_bisect.c
@@ -200,7 +200,7 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event)
 		{
 			View3D *v3d = CTX_wm_view3d(C);
 			if (v3d && (v3d->twtype & V3D_MANIPULATOR_DRAW)) {
-				WM_manipulator_group_add("MESH_WGT_bisect");
+				WM_manipulator_group_type_add("MESH_WGT_bisect");
 			}
 		}
 #endif
@@ -596,7 +596,7 @@ static bool manipulator_mesh_bisect_poll(const bContext *C, wmManipulatorGroupTy
 {
 	wmOperator *op = WM_operator_last_redo(C);
 	if (op == NULL || !STREQ(op->type->idname, "MESH_OT_bisect")) {
-		WM_manipulator_group_remove_ptr_delayed(wgt);
+		WM_manipulator_group_type_remove_ptr_delayed(wgt);
 		return false;
 	}
 	return true;
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index e7fcad9e633..9bc01687122 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -761,7 +761,7 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
 	if (ret & OPERATOR_FINISHED) {
 		/* Setup manipulators */
 		if (v3d && (v3d->twtype & V3D_MANIPULATOR_DRAW)) {
-			WM_manipulator_group_add("MESH_WGT_spin");
+			WM_manipulator_group_type_add("MESH_WGT_spin");
 		}
 	}
 #endif
@@ -1059,7 +1059,7 @@ static bool manipulator_mesh_spin_poll(const bContext *C, wmManipulatorGroupType
 {
 	wmOperator *op = WM_operator_last_redo(C);
 	if (op == NULL || !STREQ(op->type->idname, "MESH_OT_spin")) {
-		WM_manipulator_group_remove_ptr_delayed(wgt);
+		WM_manipulator_group_type_remove_ptr_delayed(wgt);
 		return false;
 	}
 	return true;
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 166b6f96956..b9f0ae22fd2 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -136,7 +136,7 @@ static void rna_manipulator_group_type_add(ReportList *reports, const char *idna
 {
 	wmManipulatorGroupType *wgt = wm_manipulatorgrouptype_find_for_add_remove(reports, idname);
 	if (wgt != NULL) {
-		WM_manipulator_group_add_ptr(wgt);
+		WM_manipulator_group_type_add_ptr(wgt);
 	}
 }
 
@@ -144,7 +144,7 @@ static void rna_manipulator_group_type_remove(Main *bmain, ReportList *reports,
 {
 	wmManipulatorGroupType *wgt = wm_manipulatorgrouptype_find_for_add_remove(reports, idname);
 	if (wgt != NULL) {
-		WM_manipulator_group_remove_ptr(bmain, wgt);
+		WM_manipulator_group_type_remove_ptr(bmain, wgt);
 	}
 }
 
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator.c b/source/blender/makesrna/intern/rna_wm_manipulator.c
index a8d03e6f4c2..a0fdd76e4a3 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator.c
@@ -778,7 +778,7 @@ static StructRNA *rna_ManipulatorGroup_register(
 	        BPY_RNA_manipulatorgroup_wrapper, (void *)&dummywgt);
 
 	if (wgt->flag & WM_MANIPULATORGROUPTYPE_PERSISTENT) {
-		WM_manipulator_group_add_ptr_ex(wgt, mmap_type);
+		WM_manipulator_group_type_add_ptr_ex(wgt, mmap_type);
 
 		/* update while blender is running */
 		WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
@@ -799,7 +799,7 @@ static void rna_ManipulatorGroup_unregister(struct Main *bmain, StructRNA *type)
 
 	WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
 
-	WM_manipulator_group_remove_ptr(bmain, wgt);
+	WM_manipulator_group_type_remove_ptr(bmain, wgt);
 }
 
 static void **rna_ManipulatorGroup_instance(PointerRNA *ptr)
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_api.h b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
index 2939070db01..84e93c2ca29 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_api.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
@@ -141,8 +141,8 @@ void WM_manipulatortype_iter(struct GHashIterator *ghi);
 struct wmManipulatorGroupType *WM_manipulatorgrouptype_find(const char *idname, bool quiet);
 struct wmManipulatorGroupType *WM_manipulatorgrouptype_append(void (*wtfunc)(struct wmManipulatorGroupType *));
 struct wmManipulatorGroupType *WM_manipulatorgrouptype_append_ptr(void (*mnpfunc)(struct wmManipulatorGroupType *, void *), void *userdata);
-bool WM_manipulatorgrouptype_remove(const char *idname);
-void WM_manipulatorgrouptype_remove_ptr(struct wmManipulatorGroupType *wt);
+bool WM_manipulatorgrouptype_free(const char *idname);
+void WM_manipulatorgrouptype_free_ptr(struct wmManipulatorGroupType *wt);
 void WM_manipulatorgrouptype_iter(struct GHashIterator *ghi);
 
 struct wmManipulatorGroupTypeRef *WM_manipulatorgrouptype_append_and_link(
@@ -273,28 +273,28 @@ void WM_manipulatormaptype_group_free(struct wmManipulatorGroupTypeRef *wgt);
 
 /* Add/Remove (High level API) */
 
-void WM_manipulator_group_add_ptr_ex(
+void WM_manipulator_group_type_add_ptr_ex(
         struct wmManipulatorGroupType *wgt,
         struct wmManipulatorMapType *mmap_type);
-void WM_manipulator_group_add_ptr(
+void WM_manipulator_group_type_add_ptr(
         struct wmManipulatorGroupType *wgt);
-void WM_manipulator_group_add(const char *idname);
+void WM_manipulator_group_type_add(const char *idname);
 
-void WM_manipulator_group_remove_ptr_ex(
+void WM_manipulator_group_type_remove_ptr_ex(
         struct Main *bmain, struct wmManipulatorGroupType *wgt,
         struct wmManipulatorMapType *mmap_type);
-void WM_manipulator_group_remove_ptr(
+void WM_manipulator_group_type_remove_ptr(
         struct Main *bmain, struct wmManipulatorGroupType *wgt);
-void WM_manipulator_group_remove(struct Main *bmain, const char *idname);
+void WM_manipulator_group_type_remove(struct Main *bmain, const char *idname);
 
-void WM_manipulator_group_remove_ptr_delayed_ex(
+void WM_manipulator_group_type_remove_ptr_delayed_ex(
         struct wmManipulatorGroupType *wgt,
         struct wmManipulatorMapType *mmap_type);
-void WM_manipulator_group_remove_ptr_delayed(
+void WM_manipulator_group_type_remove_ptr_delayed(
         struct wmManipulatorGroupType *wgt);
-void WM_manipulator_group_remove_delayed(const char *idname);
+void WM_manipulator_group_type_remove_delayed(const char *idname);
 
 /* Utilities */
-void WM_manipulator_group_is_any_selected(const char *idname);
+void WM_manipulator_group_type_is_any_selected(const char *idname);
 
 #endif  /* __WM_MANIPULATOR_API_H__ */
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
index 87a5ee11d18..4ace8695555 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
@@ -683,7 +683,7 @@ void wm_manipulatorgrouptype_setup_keymap(
  *
  * \note In context of manipulator API these names are a bit misleading,
  * but for general use terms its OK.
- * `WM_manipulator_group_add` would be more correctly called:
+ * `WM_manipulator_group_type_add` would be more correctly called:
  * `WM_manipulatormaptype_grouptype_reference_link`
  * but for general purpose API this is too detailed & annoying.
  *
@@ -691,7 +691,7 @@ void wm_manipulatorgrouptype_setup_keymap(
  *
  * \{ */
 
-void WM_manipulator_group_add_ptr_ex(
+void WM_manipulator_group_type_add_ptr_ex(
         wmManipulatorGroupType *wgt,
         wmManipulatorMapType *mmap_type)
 {
@@ -700,63 +700,64 @@ void WM_manipulator_group_add_ptr_ex(
 	WM_manipulatorconfig_update_tag_init(mmap_type, wgt);
 }
 
-void WM_manipulator_group_add_ptr(
+void WM_manipulator_group_type_add_ptr(
         wmManipulatorGroupType *wgt)
 {
 	wmManipulatorMapType *mmap_type = WM_manipulatormaptype_ensure(&wgt->mmap_params);
-	WM_manipulator_group_add_ptr_ex(wgt, mmap_type);
+	WM_manipulator_group_type_add_ptr_ex(wgt, mmap_type);
 }
 
-void WM_manipulator_group_add(const char *idname)
+void WM_manipulator_group_type_add(const char *idname)
 {
 	wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find(idname, false);
 	BLI_assert(wgt != NULL);
-	WM_manipulator_group_add_ptr(wgt);
+	WM_manipulator_group_type_add_ptr(wgt);
 }
 
-void WM_manipulator_group_remove_ptr_ex(
+
+void WM_manipulator_group_type_remove_ptr_ex(
         struct Main *bmain, wmManipulatorGroupType *wgt,
         wmManipulatorMapType *mmap_type)
 {
 	WM_manipulatormaptype_group_unlink(NULL, bmain, mmap_type, wgt);
-	WM_manipulatorgrouptype_remove_ptr(wgt);
+	WM_manipulatorgrouptype_free_ptr(wgt);
 }
 
-void WM_manipulator_group_remove_ptr(
+void WM_manipulator_group_type_remove_ptr(
         struct Main *bmain, wmManipulatorGroupType *wgt)
 {
 	wmManipulatorMapType *mmap_type = WM_manipulatormaptype_ensure(&wgt->mmap_params);
-	WM_manipulator_group_remove_ptr_ex(bmain, wgt, mmap_type);
+	WM_manipulator_group_type_remove_ptr_ex(bmain, wgt, mmap_type);
 }
 
-void WM_manipulator_group_remove(struct Main *bmain, const char *idname)
+void WM_manipulator_group_type_remove(struct Main *bmain, const char *idname)
 {
 	wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find(idname, false);
 	BLI_assert(wgt != NULL);
-	WM_manipulator_group_remove_ptr(bmain, wgt);
+	WM_manipulator_group_type_remove_ptr(bmain, wgt);
 }
 
 /* delayed versions */
 
-void WM_manipulator_group_remove_ptr_delayed_ex(
+void WM_manipulator_group_type_remove_ptr_delayed_ex(
         wmManipulatorGroupType *wgt,
         wmManipulatorMapType *mmap_type)
 {
 	WM_manipulatorconfig_update_tag_remove(mmap_type, wgt);
 }
 
-void WM_manipulator_group_remove_ptr_delayed(
+void WM_manipulator_group_type_remove_ptr_delayed(
         wmManipulatorGroupType *wgt)
 {
 	wmManipulatorMapType *mmap_type = WM_manipulatormaptype_ensure(&wgt->mmap_params);
-	WM_manipulator_group_remove_ptr_delayed_ex(wgt, mmap_type);
+	WM_manipulator_group_type_remove_ptr_delayed_ex(wgt, mmap_type);
 }
 
-void WM_manipulator_group_remove_delayed(const char *idname)
+void WM_manipulator_group_type_remove_delayed(const char *idname)
 {
 	wmManipulatorGro

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list