Cleanup: use outliner_flag_* name prefix
This commit is contained in:
@@ -161,7 +161,7 @@ static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement
|
|||||||
/* all below close/open? */
|
/* all below close/open? */
|
||||||
if (all) {
|
if (all) {
|
||||||
tselem->flag &= ~TSE_CLOSED;
|
tselem->flag &= ~TSE_CLOSED;
|
||||||
outliner_set_flag(&te->subtree, TSE_CLOSED, !outliner_has_one_flag(&te->subtree, TSE_CLOSED, 1));
|
outliner_flag_set(&te->subtree, TSE_CLOSED, !outliner_flag_is_any_test(&te->subtree, TSE_CLOSED, 1));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
|
if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
|
||||||
@@ -727,7 +727,7 @@ static int outliner_count_levels(ListBase *lb, const int curlevel)
|
|||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel)
|
int outliner_flag_is_any_test(ListBase *lb, short flag, const int curlevel)
|
||||||
{
|
{
|
||||||
TreeElement *te;
|
TreeElement *te;
|
||||||
TreeStoreElem *tselem;
|
TreeStoreElem *tselem;
|
||||||
@@ -737,13 +737,13 @@ int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel)
|
|||||||
tselem = TREESTORE(te);
|
tselem = TREESTORE(te);
|
||||||
if (tselem->flag & flag) return curlevel;
|
if (tselem->flag & flag) return curlevel;
|
||||||
|
|
||||||
level = outliner_has_one_flag(&te->subtree, flag, curlevel + 1);
|
level = outliner_flag_is_any_test(&te->subtree, flag, curlevel + 1);
|
||||||
if (level) return level;
|
if (level) return level;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void outliner_set_flag(ListBase *lb, short flag, short set)
|
void outliner_flag_set(ListBase *lb, short flag, short set)
|
||||||
{
|
{
|
||||||
TreeElement *te;
|
TreeElement *te;
|
||||||
TreeStoreElem *tselem;
|
TreeStoreElem *tselem;
|
||||||
@@ -752,7 +752,7 @@ void outliner_set_flag(ListBase *lb, short flag, short set)
|
|||||||
tselem = TREESTORE(te);
|
tselem = TREESTORE(te);
|
||||||
if (set == 0) tselem->flag &= ~flag;
|
if (set == 0) tselem->flag &= ~flag;
|
||||||
else tselem->flag |= flag;
|
else tselem->flag |= flag;
|
||||||
outliner_set_flag(&te->subtree, flag, set);
|
outliner_flag_set(&te->subtree, flag, set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,10 +965,10 @@ static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
SpaceOops *soops = CTX_wm_space_outliner(C);
|
SpaceOops *soops = CTX_wm_space_outliner(C);
|
||||||
ARegion *ar = CTX_wm_region(C);
|
ARegion *ar = CTX_wm_region(C);
|
||||||
|
|
||||||
if (outliner_has_one_flag(&soops->tree, TSE_CLOSED, 1))
|
if (outliner_flag_is_any_test(&soops->tree, TSE_CLOSED, 1))
|
||||||
outliner_set_flag(&soops->tree, TSE_CLOSED, 0);
|
outliner_flag_set(&soops->tree, TSE_CLOSED, 0);
|
||||||
else
|
else
|
||||||
outliner_set_flag(&soops->tree, TSE_CLOSED, 1);
|
outliner_flag_set(&soops->tree, TSE_CLOSED, 1);
|
||||||
|
|
||||||
ED_region_tag_redraw(ar);
|
ED_region_tag_redraw(ar);
|
||||||
|
|
||||||
@@ -997,10 +997,10 @@ static int outliner_toggle_selected_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
ARegion *ar = CTX_wm_region(C);
|
ARegion *ar = CTX_wm_region(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
|
|
||||||
if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
|
if (outliner_flag_is_any_test(&soops->tree, TSE_SELECTED, 1))
|
||||||
outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
|
outliner_flag_set(&soops->tree, TSE_SELECTED, 0);
|
||||||
else
|
else
|
||||||
outliner_set_flag(&soops->tree, TSE_SELECTED, 1);
|
outliner_flag_set(&soops->tree, TSE_SELECTED, 1);
|
||||||
|
|
||||||
soops->storeflag |= SO_TREESTORE_REDRAW;
|
soops->storeflag |= SO_TREESTORE_REDRAW;
|
||||||
|
|
||||||
@@ -1265,7 +1265,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
|
|||||||
outliner_set_coordinates(ar, soops);
|
outliner_set_coordinates(ar, soops);
|
||||||
|
|
||||||
/* deselect all visible, and select found element */
|
/* deselect all visible, and select found element */
|
||||||
outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
|
outliner_flag_set(soops, &soops->tree, TSE_SELECTED, 0);
|
||||||
tselem->flag |= TSE_SELECTED;
|
tselem->flag |= TSE_SELECTED;
|
||||||
|
|
||||||
/* make te->ys center of view */
|
/* make te->ys center of view */
|
||||||
@@ -1325,7 +1325,7 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op)
|
|||||||
const bool add = RNA_boolean_get(op->ptr, "open");
|
const bool add = RNA_boolean_get(op->ptr, "open");
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
level = outliner_has_one_flag(&soops->tree, TSE_CLOSED, 1);
|
level = outliner_flag_is_any_test(&soops->tree, TSE_CLOSED, 1);
|
||||||
if (add == 1) {
|
if (add == 1) {
|
||||||
if (level) outliner_openclose_level(&soops->tree, 1, level, 1);
|
if (level) outliner_openclose_level(&soops->tree, 1, level, 1);
|
||||||
}
|
}
|
||||||
|
@@ -172,8 +172,8 @@ void outliner_do_object_operation(
|
|||||||
|
|
||||||
int common_restrict_check(struct bContext *C, struct Object *ob);
|
int common_restrict_check(struct bContext *C, struct Object *ob);
|
||||||
|
|
||||||
int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel);
|
int outliner_flag_is_any_test(ListBase *lb, short flag, const int curlevel);
|
||||||
void outliner_set_flag(ListBase *lb, short flag, short set);
|
void outliner_flag_set(ListBase *lb, short flag, short set);
|
||||||
|
|
||||||
void object_toggle_visibility_cb(
|
void object_toggle_visibility_cb(
|
||||||
struct bContext *C, struct ReportList *reports, struct Scene *scene,
|
struct bContext *C, struct ReportList *reports, struct Scene *scene,
|
||||||
|
@@ -988,7 +988,7 @@ static bool do_outliner_item_activate_from_cursor(
|
|||||||
/* all below close/open? */
|
/* all below close/open? */
|
||||||
if (extend) {
|
if (extend) {
|
||||||
tselem->flag &= ~TSE_CLOSED;
|
tselem->flag &= ~TSE_CLOSED;
|
||||||
outliner_set_flag(&te->subtree, TSE_CLOSED, !outliner_has_one_flag(&te->subtree, TSE_CLOSED, 1));
|
outliner_flag_set(&te->subtree, TSE_CLOSED, !outliner_flag_is_any_test(&te->subtree, TSE_CLOSED, 1));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
|
if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
|
||||||
|
@@ -1860,8 +1860,8 @@ static int do_outliner_operation_event(bContext *C, ARegion *ar, SpaceOops *soop
|
|||||||
/* select object that's clicked on and popup context menu */
|
/* select object that's clicked on and popup context menu */
|
||||||
if (!(tselem->flag & TSE_SELECTED)) {
|
if (!(tselem->flag & TSE_SELECTED)) {
|
||||||
|
|
||||||
if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
|
if (outliner_flag_is_any_test(&soops->tree, TSE_SELECTED, 1))
|
||||||
outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
|
outliner_flag_set(&soops->tree, TSE_SELECTED, 0);
|
||||||
|
|
||||||
tselem->flag |= TSE_SELECTED;
|
tselem->flag |= TSE_SELECTED;
|
||||||
/* redraw, same as outliner_select function */
|
/* redraw, same as outliner_select function */
|
||||||
|
Reference in New Issue
Block a user