|
Blender V4.3
|
#include <UI_abstract_view.hh>
Inherited by blender::ui::AbstractGridView, and blender::ui::AbstractTreeView.
Public Member Functions | |
| virtual | ~AbstractView ()=default |
| virtual void | foreach_view_item (FunctionRef< void(AbstractViewItem &)> iter_fn) const =0 |
| void | register_item (AbstractViewItem &item) |
Default implementations of virtual functions | |
| virtual std::unique_ptr< DropTargetInterface > | create_drop_target () |
| virtual bool | listen (const wmNotifier &) const |
| virtual bool | begin_filtering (const bContext &C) const |
| virtual void | draw_overlays (const ARegion ®ion, const uiBlock &block) const |
| virtual bool | supports_scrolling () const |
| virtual void | scroll (ViewScrollDirection direction) |
Renaming | |
| bool | is_renaming () const |
| bool | begin_renaming () |
| void | end_renaming () |
| Span< char > | get_rename_buffer () const |
| MutableSpan< char > | get_rename_buffer () |
| std::optional< rcti > | get_bounds () const |
| std::string | get_context_menu_title () const |
| void | set_context_menu_title (const std::string &title) |
| bool | get_popup_keep_open () const |
| void | set_popup_keep_open () |
| void | clear_search_highlight () |
Protected Member Functions | |
| AbstractView ()=default | |
| virtual void | update_children_from_old (const AbstractView &old_view)=0 |
State Management | |
| virtual void | change_state_delayed () |
View Reconstruction | |
| void | update_from_old (uiBlock &new_block) |
| bool | is_reconstructed () const |
| const AbstractViewItem * | search_highlight_item () const |
Filtering | |
| void | filter (std::optional< StringRef > filter_str) |
Friends | |
| class | AbstractViewItem |
| struct | ::ViewLink |
Definition at line 54 of file UI_abstract_view.hh.
|
virtualdefault |
|
protecteddefault |
|
virtual |
Enable filtering. Typically used to enable a filter text button. Triggered on Ctrl+F by default.
Reimplemented in blender::ed::asset::shelf::AssetView.
Definition at line 119 of file abstract_view.cc.
Referenced by ui_view_start_filter_invoke().
| bool blender::ui::AbstractView::begin_renaming | ( | ) |
Definition at line 183 of file abstract_view.cc.
References is_renaming().
|
protectedvirtual |
Items may want to do additional work when state changes. But these state changes can only be reliably detected after the view has completed reconstruction (see is_reconstructed()). So the actual state changes are done in a delayed manner through this function.
Overrides should call the base class implementation.
Definition at line 79 of file abstract_view.cc.
References BLI_assert_msg, blender::ui::AbstractViewItem::change_state_delayed(), foreach_view_item(), is_reconstructed(), and blender::ui::AbstractViewItem::should_be_active().
Referenced by blender::ui::GridViewBuilder::build_grid_view(), and blender::ui::TreeViewBuilder::build_tree_view().
| void blender::ui::AbstractView::clear_search_highlight | ( | ) |
Definition at line 233 of file abstract_view.cc.
References foreach_view_item(), and blender::ui::AbstractViewItem::is_highlighted_search_.
|
virtual |
If a view wants to support dropping data into it, it has to return a drop target here. That is an object implementing #DropTargetInterface.
Definition at line 107 of file abstract_view.cc.
|
virtual |
Reimplemented in blender::ui::AbstractTreeView.
Definition at line 124 of file abstract_view.cc.
| void blender::ui::AbstractView::end_renaming | ( | ) |
Definition at line 193 of file abstract_view.cc.
References BLI_assert, and is_renaming().
Referenced by blender::ui::AbstractViewItem::end_renaming().
|
protected |
Definition at line 145 of file abstract_view.cc.
References foreach_view_item(), blender::ui::AbstractViewItem::is_filtered_visible_, blender::ui::AbstractViewItem::is_highlighted_search_, and blender::ui::AbstractViewItem::should_be_filtered_visible().
Referenced by blender::ui::GridViewBuilder::build_grid_view(), and blender::ui::TreeViewBuilder::build_tree_view().
|
pure virtual |
| std::optional< rcti > blender::ui::AbstractView::get_bounds | ( | ) | const |
Get the rectangle containing all the view items that are in the layout, in button space. Updated as part of UI_block_end(), before that it's unset.
Definition at line 208 of file abstract_view.cc.
| std::string blender::ui::AbstractView::get_context_menu_title | ( | ) | const |
Definition at line 213 of file abstract_view.cc.
Referenced by UI_but_context_menu_title_from_button().
| bool blender::ui::AbstractView::get_popup_keep_open | ( | ) | const |
Definition at line 223 of file abstract_view.cc.
Referenced by UI_view_item_popup_keep_open().
| MutableSpan< char > blender::ui::AbstractView::get_rename_buffer | ( | ) |
Definition at line 203 of file abstract_view.cc.
| Span< char > blender::ui::AbstractView::get_rename_buffer | ( | ) | const |
Definition at line 199 of file abstract_view.cc.
|
protected |
Check if the view is fully (re-)constructed. That means, both the build function and update_from_old() have finished.
Definition at line 28 of file abstract_view.cc.
Referenced by change_state_delayed().
| bool blender::ui::AbstractView::is_renaming | ( | ) | const |
Only one item can be renamed at a time.
Definition at line 178 of file abstract_view.cc.
Referenced by begin_renaming(), blender::ui::AbstractViewItem::begin_renaming(), end_renaming(), and UI_view_item_can_rename().
|
virtual |
Listen to a notifier, returning true if a redraw is needed.
Reimplemented in blender::ui::bonecollections::BoneCollectionTreeView.
Definition at line 113 of file abstract_view.cc.
| void blender::ui::AbstractView::register_item | ( | AbstractViewItem & | item | ) |
Makes item valid for display in this view. Behavior is undefined for items not registered with this.
Definition at line 17 of file abstract_view.cc.
References blender::ui::AbstractViewItem::view_.
Referenced by blender::ui::TreeViewItemContainer::add_tree_item().
|
virtual |
Reimplemented in blender::ui::AbstractTreeView.
Definition at line 134 of file abstract_view.cc.
References BLI_assert_msg.
|
protected |
Definition at line 33 of file abstract_view.cc.
References foreach_view_item(), and blender::ui::AbstractViewItem::is_search_highlight().
Referenced by blender::ui::GridViewLayoutBuilder::build_from_view().
| void blender::ui::AbstractView::set_context_menu_title | ( | const std::string & | title | ) |
Definition at line 218 of file abstract_view.cc.
Referenced by blender::ed::asset::shelf::build_asset_view(), blender::ed::asset::shelf::catalog_selector_panel_draw(), blender::ed::asset_browser::file_create_asset_catalog_tree_view_in_layout(), blender::ed::spreadsheet::spreadsheet_data_set_panel_draw(), uiTemplateBoneCollectionTree(), uiTemplateGreasePencilLayerTree(), uiTemplateLightLinkingCollection(), and uiTemplateNodeTreeInterface().
| void blender::ui::AbstractView::set_popup_keep_open | ( | ) |
If this view is displayed in a popup, don't close it when clicking to activate items.
Definition at line 228 of file abstract_view.cc.
Referenced by blender::ed::asset::shelf::AssetCatalogTreeView::AssetCatalogTreeView().
|
virtual |
Definition at line 129 of file abstract_view.cc.
|
protectedpure virtual |
Referenced by update_from_old().
|
protected |
Match the view and its items against an earlier version of itself (if any) and copy the old UI state (e.g. collapsed, active, selected, renaming, etc.) to the new one. See AbstractViewItem.update_from_old(). After this, reconstruction is complete (see is_reconstructed()).
Definition at line 45 of file abstract_view.cc.
References uiBlock::oldblock, ui_block_view_find_matching_in_old_block(), and update_children_from_old().
Referenced by blender::ui::GridViewBuilder::build_grid_view(), and blender::ui::TreeViewBuilder::build_tree_view().
|
friend |
Definition at line 56 of file UI_abstract_view.hh.
|
friend |
Definition at line 55 of file UI_abstract_view.hh.