[Bf-blender-cvs] [3b15ff3fb4d] blender2.8: Cleanup: use enum typedef for manipulator drawstep

Campbell Barton noreply at git.blender.org
Mon Jul 31 06:31:59 CEST 2017


Commit: 3b15ff3fb4d4959ee801e8c4f5dac02e0fe05c8a
Author: Campbell Barton
Date:   Mon Jul 31 13:14:42 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB3b15ff3fb4d4959ee801e8c4f5dac02e0fe05c8a

Cleanup: use enum typedef for manipulator drawstep

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

M	source/blender/windowmanager/manipulators/WM_manipulator_api.h
M	source/blender/windowmanager/manipulators/WM_manipulator_types.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c

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

diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_api.h b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
index a4b4964384c..da3ec9667bd 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_api.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
@@ -206,7 +206,8 @@ struct wmManipulatorMap *WM_manipulatormap_new_from_type(
         const struct wmManipulatorMapType_Params *mmap_params);
 const struct ListBase *WM_manipulatormap_group_list(struct wmManipulatorMap *mmap);
 void WM_manipulatormap_tag_refresh(struct wmManipulatorMap *mmap);
-void WM_manipulatormap_draw(struct wmManipulatorMap *mmap, const struct bContext *C, const int drawstep);
+void WM_manipulatormap_draw(
+        struct wmManipulatorMap *mmap, const struct bContext *C, const eWM_ManipulatorMapDrawStep drawstep);
 void WM_manipulatormap_add_handlers(struct ARegion *ar, struct wmManipulatorMap *mmap);
 bool WM_manipulatormap_select_all(struct bContext *C, struct wmManipulatorMap *mmap, const int action);
 bool WM_manipulatormap_cursor_set(const struct wmManipulatorMap *mmap, struct wmWindow *win);
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 9ba82031db9..5b74414cc0b 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -367,7 +367,7 @@ typedef struct wmManipulatorGroup {
 /**
  * Pass a value of this enum to #WM_manipulatormap_draw to tell it what to draw.
  */
-enum {
+typedef enum eWM_ManipulatorMapDrawStep {
 	/* Draw 2D manipulator-groups (ManipulatorGroupType.is_3d == false) */
 	WM_MANIPULATORMAP_DRAWSTEP_2D = 0,
 	/* Draw 3D manipulator-groups (ManipulatorGroupType.is_3d == true) */
@@ -375,6 +375,6 @@ enum {
 	/* Draw only depth culled manipulators (WM_MANIPULATOR_SCENE_DEPTH flag).
 	 * Note that these are expected to be 3D manipulators too. */
 	WM_MANIPULATORMAP_DRAWSTEP_IN_SCENE,
-};
+} eWM_ManipulatorMapDrawStep;
 
 #endif  /* __WM_MANIPULATOR_TYPES_H__ */
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
index f9cce984708..237beddd02c 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_group.c
@@ -200,7 +200,8 @@ bool wm_manipulatorgroup_is_visible(const wmManipulatorGroup *mgroup, const bCon
 	return (!mgroup->type->poll || mgroup->type->poll(C, mgroup->type));
 }
 
-bool wm_manipulatorgroup_is_visible_in_drawstep(const wmManipulatorGroup *mgroup, const int drawstep)
+bool wm_manipulatorgroup_is_visible_in_drawstep(
+        const wmManipulatorGroup *mgroup, const eWM_ManipulatorMapDrawStep drawstep)
 {
 	switch (drawstep) {
 		case WM_MANIPULATORMAP_DRAWSTEP_2D:
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
index b4603d5281c..bed87a77b3d 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
@@ -76,7 +76,8 @@ void wm_manipulatorgroup_intersectable_manipulators_to_list(
         const struct wmManipulatorGroup *mgroup, struct ListBase *listbase);
 void wm_manipulatorgroup_ensure_initialized(struct wmManipulatorGroup *mgroup, const struct bContext *C);
 bool wm_manipulatorgroup_is_visible(const struct wmManipulatorGroup *mgroup, const struct bContext *C);
-bool wm_manipulatorgroup_is_visible_in_drawstep(const struct wmManipulatorGroup *mgroup, const int drawstep);
+bool wm_manipulatorgroup_is_visible_in_drawstep(
+        const struct wmManipulatorGroup *mgroup, const eWM_ManipulatorMapDrawStep drawstep);
 
 void wm_manipulatorgrouptype_setup_keymap(
         struct wmManipulatorGroupType *wgt, struct wmKeyConfig *keyconf);
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index 210243d5fff..1a52aa27d84 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -294,7 +294,8 @@ static bool manipulator_prepare_drawing(
  * should be drawn to list \a draw_manipulators, note that added items need freeing.
  */
 static void manipulatormap_prepare_drawing(
-        wmManipulatorMap *mmap, const bContext *C, ListBase *draw_manipulators, const int drawstep)
+        wmManipulatorMap *mmap, const bContext *C, ListBase *draw_manipulators,
+        const eWM_ManipulatorMapDrawStep drawstep)
 {
 	if (!mmap || BLI_listbase_is_empty(&mmap->groups))
 		return;
@@ -401,7 +402,9 @@ static void manipulators_draw_list(const wmManipulatorMap *mmap, const bContext
 	}
 }
 
-void WM_manipulatormap_draw(wmManipulatorMap *mmap, const bContext *C, const int drawstep)
+void WM_manipulatormap_draw(
+        wmManipulatorMap *mmap, const bContext *C,
+        const eWM_ManipulatorMapDrawStep drawstep)
 {
 	ListBase draw_manipulators = {NULL};




More information about the Bf-blender-cvs mailing list