diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-31 06:14:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-31 06:15:02 +0300 |
commit | 3b15ff3fb4d4959ee801e8c4f5dac02e0fe05c8a (patch) | |
tree | dc9e72601be27fb52d00909a4e61b5b906c71f45 /source | |
parent | 538b191a03087d925f8cfe6d62080f356e04321d (diff) |
Cleanup: use enum typedef for manipulator drawstep
Diffstat (limited to 'source')
5 files changed, 13 insertions, 7 deletions
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}; |