Blender  V3.3
Classes | Functions
interface_view.cc File Reference
#include <memory>
#include <type_traits>
#include <variant>
#include "DNA_screen_types.h"
#include "BKE_screen.h"
#include "BLI_listbase.h"
#include "ED_screen.h"
#include "interface_intern.h"
#include "UI_interface.hh"
#include "UI_abstract_view.hh"
#include "UI_grid_view.hh"
#include "UI_tree_view.hh"

Go to the source code of this file.

Classes

struct  ViewLink
 

Functions

template<class T >
static Tui_block_add_view_impl (uiBlock &block, StringRef idname, std::unique_ptr< AbstractView > view)
 
AbstractGridViewUI_block_add_view (uiBlock &block, StringRef idname, std::unique_ptr< AbstractGridView > grid_view)
 
AbstractTreeViewUI_block_add_view (uiBlock &block, StringRef idname, std::unique_ptr< AbstractTreeView > tree_view)
 
void ui_block_free_views (uiBlock *block)
 
void UI_block_views_listen (const uiBlock *block, const wmRegionListenerParams *listener_params)
 
uiViewItemHandleUI_region_views_find_item_at (const ARegion *region, const int xy[2])
 
uiViewItemHandleUI_region_views_find_active_item (const ARegion *region)
 
static StringRef ui_block_view_find_idname (const uiBlock &block, const AbstractView &view)
 
template<class T >
static Tui_block_view_find_matching_in_old_block_impl (const uiBlock &new_block, const T &new_view)
 
uiViewHandleui_block_view_find_matching_in_old_block (const uiBlock *new_block, const uiViewHandle *new_view_handle)
 
uiButViewItemui_block_view_find_matching_view_item_but_in_old_block (const uiBlock *new_block, const uiViewItemHandle *new_item_handle)
 

Detailed Description

Code to manage views as part of the regular screen hierarchy. E.g. managing ownership of views inside blocks (uiBlock.views), looking up items in the region, passing WM notifiers to views, etc.

Blocks and their contained views are reconstructed on every redraw. This file also contains functions related to this recreation of views inside blocks. For example to query state information before the view is done reconstructing (#AbstractView.is_reconstructed() returns false), it may be enough to query the previous version of the block/view/view-item. Since such queries rely on the details of the UI reconstruction process, they should remain internal to interface/ code.

Definition in file interface_view.cc.

Function Documentation

◆ UI_block_add_view() [1/2]

AbstractGridView* UI_block_add_view ( uiBlock block,
blender::StringRef  idname,
std::unique_ptr< blender::ui::AbstractGridView grid_view 
)

Override this for all available view types.

Definition at line 63 of file interface_view.cc.

Referenced by file_create_asset_catalog_tree_view_in_layout(), and blender::ed::spreadsheet::spreadsheet_data_set_panel_draw().

◆ UI_block_add_view() [2/2]

AbstractTreeView* UI_block_add_view ( uiBlock block,
StringRef  idname,
std::unique_ptr< AbstractTreeView tree_view 
)

Definition at line 70 of file interface_view.cc.

◆ ui_block_add_view_impl()

template<class T >
static T* ui_block_add_view_impl ( uiBlock block,
StringRef  idname,
std::unique_ptr< AbstractView view 
)
static

Definition at line 50 of file interface_view.cc.

References BLI_addtail(), ViewLink::idname, T, ViewLink::view, view, and uiBlock::views.

◆ ui_block_free_views()

void ui_block_free_views ( uiBlock block)

Definition at line 77 of file interface_view.cc.

References LISTBASE_FOREACH_MUTABLE, and uiBlock::views.

Referenced by UI_block_free().

◆ ui_block_view_find_idname()

static StringRef ui_block_view_find_idname ( const uiBlock block,
const AbstractView view 
)
static

Definition at line 115 of file interface_view.cc.

References LISTBASE_FOREACH, view, and uiBlock::views.

Referenced by ui_block_view_find_matching_in_old_block_impl().

◆ ui_block_view_find_matching_in_old_block()

uiViewHandle* ui_block_view_find_matching_in_old_block ( const uiBlock new_block,
const uiViewHandle new_view_handle 
)

◆ ui_block_view_find_matching_in_old_block_impl()

template<class T >
static T* ui_block_view_find_matching_in_old_block_impl ( const uiBlock new_block,
const T new_view 
)
static

◆ ui_block_view_find_matching_view_item_but_in_old_block()

uiButViewItem* ui_block_view_find_matching_view_item_but_in_old_block ( const uiBlock new_block,
const uiViewItemHandle new_item_handle 
)

◆ UI_block_views_listen()

void UI_block_views_listen ( const uiBlock block,
const wmRegionListenerParams listener_params 
)

◆ UI_region_views_find_active_item()

uiViewItemHandle* UI_region_views_find_active_item ( const ARegion region)

Definition at line 105 of file interface_view.cc.

References ui_view_item_find_active(), and uiButViewItem::view_item.

◆ UI_region_views_find_item_at()

uiViewItemHandle* UI_region_views_find_item_at ( const ARegion region,
const int  xy[2] 
)

Definition at line 95 of file interface_view.cc.

References ui_view_item_find_mouse_over(), uiButViewItem::view_item, and xy.