|
Blender V5.0
|
#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 bool | is_fully_visible () const |
| virtual void | scroll (ViewScrollDirection direction) |
| virtual std::optional< uiViewState > | persistent_state () const |
| virtual void | persistent_state_apply (const uiViewState &state) |
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 () |
| void | allow_multiselect_items () |
| bool | is_multiselect_supported () const |
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 55 of file UI_abstract_view.hh.
|
virtualdefault |
References C.
|
protecteddefault |
| void blender::ui::AbstractView::allow_multiselect_items | ( | ) |
Definition at line 257 of file abstract_view.cc.
Referenced by blender::ed::object::shapekey::template_tree().
|
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 202 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 AbstractViewItem, 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 252 of file abstract_view.cc.
References AbstractViewItem, 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 212 of file abstract_view.cc.
References BLI_assert, and is_renaming().
Referenced by blender::ui::AbstractViewItem::end_renaming().
|
protected |
Definition at line 157 of file abstract_view.cc.
References AbstractViewItem, foreach_view_item(), blender::ui::AbstractViewItem::is_filtered_visible_, blender::ui::AbstractViewItem::is_highlighted_search_, blender::ui::AbstractViewItem::on_filter_change(), 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 |
References AbstractViewItem, and state.
Referenced by change_state_delayed(), clear_search_highlight(), filter(), search_highlight_item(), and blender::ui::AbstractViewItem::set_state_active().
| 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 227 of file abstract_view.cc.
| std::string blender::ui::AbstractView::get_context_menu_title | ( | ) | const |
Definition at line 232 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 242 of file abstract_view.cc.
Referenced by UI_view_item_popup_keep_open().
| MutableSpan< char > blender::ui::AbstractView::get_rename_buffer | ( | ) |
Definition at line 222 of file abstract_view.cc.
| Span< char > blender::ui::AbstractView::get_rename_buffer | ( | ) | const |
Definition at line 218 of file abstract_view.cc.
|
virtual |
Reimplemented in blender::ui::AbstractTreeView.
Definition at line 134 of file abstract_view.cc.
| bool blender::ui::AbstractView::is_multiselect_supported | ( | ) | const |
Definition at line 262 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 197 of file abstract_view.cc.
Referenced by begin_renaming(), blender::ui::AbstractViewItem::begin_renaming(), and end_renaming().
|
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.
|
virtual |
From the current view state, return certain state that will be written to files (stored in ARegion.view_states) to preserve it over UI changes and file loading. The state can be restored using persistent_state_apply().
Return an empty value if there's no state to preserve (default implementation).
Reimplemented in blender::ui::AbstractTreeView.
Definition at line 144 of file abstract_view.cc.
|
virtual |
Restore a view state given in state, which was created by persistent_state() for saving in files, and potentially loaded from a file.
Reimplemented in blender::ui::AbstractTreeView.
Definition at line 149 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 AbstractViewItem, and blender::ui::AbstractViewItem::view_.
Referenced by blender::ui::TreeViewItemContainer::add_tree_item().
|
virtual |
Reimplemented in blender::ui::AbstractTreeView.
Definition at line 139 of file abstract_view.cc.
References BLI_assert_msg.
|
protected |
Definition at line 33 of file abstract_view.cc.
References AbstractViewItem, 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 237 of file abstract_view.cc.
Referenced by blender::ed::asset::shelf::build_asset_view(), blender::ed::asset::shelf::catalog_selector_panel_draw(), blender::ed::spreadsheet::draw_viewer_data_panel(), blender::ed::spreadsheet::draw_viewer_path_panel(), blender::ed::asset_browser::file_create_asset_catalog_tree_view_in_layout(), blender::ed::spreadsheet::spreadsheet_data_set_panel_draw(), blender::ed::object::shapekey::template_tree(), 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 247 of file abstract_view.cc.
Referenced by blender::ed::asset::shelf::AssetCatalogTreeView::AssetCatalogTreeView().
|
virtual |
Definition at line 129 of file abstract_view.cc.
Referenced by blender::ui::AbstractTreeView::scroll().
|
protectedpure virtual |
References AbstractView(), and AbstractViewItem.
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 AbstractView(), 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 57 of file UI_abstract_view.hh.
|
friend |
Definition at line 56 of file UI_abstract_view.hh.
References AbstractViewItem.
Referenced by AbstractViewItem, blender::ui::AbstractGridView::build_items(), blender::ui::AbstractTreeView::build_tree(), change_state_delayed(), clear_search_highlight(), filter(), foreach_view_item(), register_item(), search_highlight_item(), and update_children_from_old().