Cleanup: use outliner_flag_* name prefix
authorCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2018 12:40:13 +0000 (14:40 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2018 12:40:13 +0000 (14:40 +0200)
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_select.c
source/blender/editors/space_outliner/outliner_tools.c

index 6eda2283b6a3e98102fc85ae5f1524efb43ceffa..3708b653ec4209bed0671fb8fb005df3a2cef9c4 100644 (file)
@@ -161,7 +161,7 @@ static int do_outliner_item_openclose(bContext *C, SpaceOops *soops, TreeElement
                /* all below close/open? */
                if (all) {
                        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 {
                        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;
 }
 
-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;
        TreeStoreElem *tselem;
@@ -737,13 +737,13 @@ int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel)
                tselem = TREESTORE(te);
                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;
        }
        return 0;
 }
 
-void outliner_set_flag(ListBase *lb, short flag, short set)
+void outliner_flag_set(ListBase *lb, short flag, short set)
 {
        TreeElement *te;
        TreeStoreElem *tselem;
@@ -752,7 +752,7 @@ void outliner_set_flag(ListBase *lb, short flag, short set)
                tselem = TREESTORE(te);
                if (set == 0) 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);
        ARegion *ar = CTX_wm_region(C);
 
-       if (outliner_has_one_flag(&soops->tree, TSE_CLOSED, 1))
-               outliner_set_flag(&soops->tree, TSE_CLOSED, 0);
+       if (outliner_flag_is_any_test(&soops->tree, TSE_CLOSED, 1))
+               outliner_flag_set(&soops->tree, TSE_CLOSED, 0);
        else
-               outliner_set_flag(&soops->tree, TSE_CLOSED, 1);
+               outliner_flag_set(&soops->tree, TSE_CLOSED, 1);
 
        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);
        Scene *scene = CTX_data_scene(C);
 
-       if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
-               outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
+       if (outliner_flag_is_any_test(&soops->tree, TSE_SELECTED, 1))
+               outliner_flag_set(&soops->tree, TSE_SELECTED, 0);
        else
-               outliner_set_flag(&soops->tree, TSE_SELECTED, 1);
+               outliner_flag_set(&soops->tree, TSE_SELECTED, 1);
 
        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);
 
                        /* 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;
 
                        /* 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");
        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 (level) outliner_openclose_level(&soops->tree, 1, level, 1);
        }
index 9bf2231b3130cac465e0cacec32c74e8a4f35233..49647a0d838cad6223d9e879c2a259ebdb0631bf 100644 (file)
@@ -172,8 +172,8 @@ void outliner_do_object_operation(
 
 int common_restrict_check(struct bContext *C, struct Object *ob);
 
-int outliner_has_one_flag(ListBase *lb, short flag, const int curlevel);
-void outliner_set_flag(ListBase *lb, short flag, short set);
+int outliner_flag_is_any_test(ListBase *lb, short flag, const int curlevel);
+void outliner_flag_set(ListBase *lb, short flag, short set);
 
 void object_toggle_visibility_cb(
         struct bContext *C, struct ReportList *reports, struct Scene *scene,
index 5149715740f2e277f37f252eb2efc00f2cc72864..e40ba8670496c6445149594d23aa744e86dcc866 100644 (file)
@@ -988,7 +988,7 @@ static bool do_outliner_item_activate_from_cursor(
                        /* all below close/open? */
                        if (extend) {
                                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 {
                                if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
index 75151325bdf0f62c753e244f383d4398667a6b7c..2707e13059819135665e92ca94d2598e2e5687f7 100644 (file)
@@ -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 */
                if (!(tselem->flag & TSE_SELECTED)) {
 
-                       if (outliner_has_one_flag(&soops->tree, TSE_SELECTED, 1))
-                               outliner_set_flag(&soops->tree, TSE_SELECTED, 0);
+                       if (outliner_flag_is_any_test(&soops->tree, TSE_SELECTED, 1))
+                               outliner_flag_set(&soops->tree, TSE_SELECTED, 0);
 
                        tselem->flag |= TSE_SELECTED;
                        /* redraw, same as outliner_select function */