diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_intern.h')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_intern.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 95e37dea249..23c883c0db3 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -200,6 +200,25 @@ typedef enum { #define TSELEM_OPEN(telm, sv) \ ((telm->flag & TSE_CLOSED) == 0 || (SEARCHING_OUTLINER(sv) && (telm->flag & TSE_CHILDSEARCH))) +/** + * Container to avoid passing around these variables to many functions. + * Also so we can have one place to assing these variables. + */ +typedef struct TreeViewContext { + /* Scene level. */ + struct Scene *scene; + struct ViewLayer *view_layer; + + /* Object level. */ + /** Avoid OBACT macro everywhere. */ + Object *obact; + Object *ob_edit; + /** + * The pose object may not be the active object (when in weight paint mode). + * Checking this in draw loops isn't efficient, so set only once. */ + Object *ob_pose; +} TreeViewContext; + /* outliner_tree.c ----------------------------------------------- */ void outliner_free_tree(ListBase *tree); @@ -237,16 +256,14 @@ int tree_element_id_type_to_index(TreeElement *te); /* outliner_select.c -------------------------------------------- */ eOLDrawState tree_element_type_active(struct bContext *C, - struct Scene *scene, - struct ViewLayer *view_layer, + const TreeViewContext *tvc, struct SpaceOutliner *soops, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive); eOLDrawState tree_element_active(struct bContext *C, - struct Scene *scene, - struct ViewLayer *view_layer, + const TreeViewContext *tvc, SpaceOutliner *soops, TreeElement *te, const eOLSetState set, @@ -267,7 +284,8 @@ void outliner_object_mode_toggle(struct bContext *C, void outliner_element_activate(struct SpaceOutliner *soops, struct TreeStoreElem *tselem); -bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_co_x); +bool outliner_item_is_co_over_name_icons(const TreeElement *te, float view_co_x); +bool outliner_item_is_co_within_close_toggle(const TreeElement *te, float view_co_x); /* outliner_edit.c ---------------------------------------------- */ typedef void (*outliner_operation_cb)(struct bContext *C, @@ -457,6 +475,8 @@ void OUTLINER_OT_unhide_all(struct wmOperatorType *ot); /* outliner_utils.c ---------------------------------------------- */ +void outliner_viewcontext_init(const struct bContext *C, TreeViewContext *tvc); + TreeElement *outliner_find_item_at_y(const SpaceOutliner *soops, const ListBase *tree, float view_co_y); |