Manipulator: rename is_visible -> poll

Rename to WM_manipulator_group_type_poll,
use convention of other poll functions.
This commit is contained in:
2018-02-25 23:52:20 +11:00
parent 2b158861a3
commit 24d51a05a9
4 changed files with 8 additions and 7 deletions

View File

@@ -331,4 +331,6 @@ void WM_manipulator_group_type_unlink_delayed(const char *idname);
/* Utilities */ /* Utilities */
bool WM_manipulator_context_check_drawstep(const struct bContext *C, eWM_ManipulatorMapDrawStep step); bool WM_manipulator_context_check_drawstep(const struct bContext *C, eWM_ManipulatorMapDrawStep step);
bool WM_manipulator_group_type_poll(const struct bContext *C, const struct wmManipulatorGroupType *wgt);
#endif /* __WM_MANIPULATOR_API_H__ */ #endif /* __WM_MANIPULATOR_API_H__ */

View File

@@ -201,10 +201,10 @@ void wm_manipulatorgroup_ensure_initialized(wmManipulatorGroup *mgroup, const bC
} }
} }
bool wm_manipulatorgroup_is_visible(const wmManipulatorGroup *mgroup, const bContext *C) bool WM_manipulator_group_type_poll(const bContext *C, const struct wmManipulatorGroupType *wgt)
{ {
/* Check for poll function, if manipulator-group belongs to an operator, also check if the operator is running. */ /* Check for poll function, if manipulator-group belongs to an operator, also check if the operator is running. */
return (!mgroup->type->poll || mgroup->type->poll(C, mgroup->type)); return (!wgt->poll || wgt->poll(C, (wmManipulatorGroupType *)wgt));
} }
bool wm_manipulatorgroup_is_visible_in_drawstep( bool wm_manipulatorgroup_is_visible_in_drawstep(

View File

@@ -75,7 +75,6 @@ struct wmManipulator *wm_manipulatorgroup_find_intersected_manipulator(
void wm_manipulatorgroup_intersectable_manipulators_to_list( void wm_manipulatorgroup_intersectable_manipulators_to_list(
const struct wmManipulatorGroup *mgroup, struct ListBase *listbase); const struct wmManipulatorGroup *mgroup, struct ListBase *listbase);
void wm_manipulatorgroup_ensure_initialized(struct wmManipulatorGroup *mgroup, const struct bContext *C); 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( bool wm_manipulatorgroup_is_visible_in_drawstep(
const struct wmManipulatorGroup *mgroup, const eWM_ManipulatorMapDrawStep drawstep); const struct wmManipulatorGroup *mgroup, const eWM_ManipulatorMapDrawStep drawstep);

View File

@@ -272,7 +272,7 @@ static GHash *WM_manipulatormap_manipulator_hash_new(
/* collect manipulators */ /* collect manipulators */
for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) { for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) {
if (!mgroup->type->poll || mgroup->type->poll(C, mgroup->type)) { if (WM_manipulator_group_type_poll(C, mgroup->type)) {
for (wmManipulator *mpr = mgroup->manipulators.first; mpr; mpr = mpr->next) { for (wmManipulator *mpr = mgroup->manipulators.first; mpr; mpr = mpr->next) {
if ((include_hidden || (mpr->flag & WM_MANIPULATOR_HIDDEN) == 0) && if ((include_hidden || (mpr->flag & WM_MANIPULATOR_HIDDEN) == 0) &&
(!poll || poll(mpr, data))) (!poll || poll(mpr, data)))
@@ -350,7 +350,7 @@ static void manipulatormap_prepare_drawing(
for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) { for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) {
/* check group visibility - drawstep first to avoid unnecessary call of group poll callback */ /* check group visibility - drawstep first to avoid unnecessary call of group poll callback */
if (!wm_manipulatorgroup_is_visible_in_drawstep(mgroup, drawstep) || if (!wm_manipulatorgroup_is_visible_in_drawstep(mgroup, drawstep) ||
!wm_manipulatorgroup_is_visible(mgroup, C)) !WM_manipulator_group_type_poll(C, mgroup->type))
{ {
continue; continue;
} }
@@ -597,7 +597,7 @@ wmManipulator *wm_manipulatormap_highlight_find(
continue; continue;
} }
if (wm_manipulatorgroup_is_visible(mgroup, C)) { if (WM_manipulator_group_type_poll(C, mgroup->type)) {
eWM_ManipulatorMapDrawStep step; eWM_ManipulatorMapDrawStep step;
if (mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) { if (mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
step = WM_MANIPULATORMAP_DRAWSTEP_3D; step = WM_MANIPULATORMAP_DRAWSTEP_3D;
@@ -984,7 +984,7 @@ void WM_manipulatormap_message_subscribe(
bContext *C, wmManipulatorMap *mmap, ARegion *ar, struct wmMsgBus *mbus) bContext *C, wmManipulatorMap *mmap, ARegion *ar, struct wmMsgBus *mbus)
{ {
for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) { for (wmManipulatorGroup *mgroup = mmap->groups.first; mgroup; mgroup = mgroup->next) {
if (!wm_manipulatorgroup_is_visible(mgroup, C)) { if (!WM_manipulator_group_type_poll(C, mgroup->type)) {
continue; continue;
} }
for (wmManipulator *mpr = mgroup->manipulators.first; mpr; mpr = mpr->next) { for (wmManipulator *mpr = mgroup->manipulators.first; mpr; mpr = mpr->next) {