Blender V4.3
interface_view.cc File Reference
#include <memory>
#include <type_traits>
#include <variant>
#include "DNA_screen_types.h"
#include "BKE_screen.hh"
#include "BLI_listbase.h"
#include "BLI_map.hh"
#include "ED_screen.hh"
#include "interface_intern.hh"
#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
 

Namespaces

namespace  blender
 
namespace  blender::ui
 

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_bounds_calc (const uiBlock *block)
 
void ui_block_views_listen (const uiBlock *block, const wmRegionListenerParams *listener_params)
 
void ui_block_views_draw_overlays (const ARegion *region, const uiBlock *block)
 
blender::ui::AbstractViewUI_region_view_find_at (const ARegion *region, const int xy[2], const int pad)
 
ui::AbstractViewItemUI_region_views_find_item_at (const ARegion &region, const int xy[2])
 
ui::AbstractViewItemUI_region_views_find_active_item (const ARegion *region)
 
uiButUI_region_views_find_active_item_but (const ARegion *region)
 
void UI_region_views_clear_search_highlight (const ARegion *region)
 
std::unique_ptr< DropTargetInterfaceblender::ui::region_views_find_drop_target_at (const ARegion *region, const int xy[2])
 
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)
 
blender::ui::AbstractViewui_block_view_find_matching_in_old_block (const uiBlock &new_block, const blender::ui::AbstractView &new_view)
 
uiButViewItemui_block_view_find_matching_view_item_but_in_old_block (const uiBlock &new_block, const ui::AbstractViewItem &new_item)
 

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]

◆ UI_block_add_view() [2/2]

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

Definition at line 75 of file interface_view.cc.

References ui_block_add_view_impl().

◆ 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 55 of file interface_view.cc.

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

Referenced by UI_block_add_view(), and UI_block_add_view().

◆ ui_block_free_views()

void ui_block_free_views ( uiBlock * block)

Definition at line 82 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 242 of file interface_view.cc.

References LISTBASE_FOREACH, and uiBlock::views.

Referenced by ui_block_view_find_matching_in_old_block_impl().

◆ ui_block_view_find_matching_in_old_block()

blender::ui::AbstractView * ui_block_view_find_matching_in_old_block ( const uiBlock & new_block,
const blender::ui::AbstractView & new_view )

◆ 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()

◆ ui_block_views_bounds_calc()

void ui_block_views_bounds_calc ( const uiBlock * block)

Definition at line 129 of file interface_view.cc.

References ViewLink::views_bounds_calc().

Referenced by UI_block_end_ex(), and UI_panels_end().

◆ ui_block_views_draw_overlays()

void ui_block_views_draw_overlays ( const ARegion * region,
const uiBlock * block )

Definition at line 145 of file interface_view.cc.

References LISTBASE_FOREACH, and uiBlock::views.

Referenced by UI_block_draw().

◆ ui_block_views_listen()

void ui_block_views_listen ( const uiBlock * block,
const wmRegionListenerParams * listener_params )

◆ UI_region_view_find_at()

blender::ui::AbstractView * UI_region_view_find_at ( const ARegion * region,
const int xy[2],
int pad )
Parameters
xyCoordinate to find a view item at, in window space.
padExtra padding added to the bounding box of the view.

Definition at line 152 of file interface_view.cc.

References BLI_rcti_isect_pt(), BLI_rcti_pad(), LISTBASE_FOREACH, pad, ui_region_contains_point_px(), ui_window_to_block_fl(), and xy.

Referenced by get_view_focused(), blender::ui::region_views_find_drop_target_at(), and ui_view_start_filter_invoke().

◆ UI_region_views_clear_search_highlight()

void UI_region_views_clear_search_highlight ( const ARegion * region)

Definition at line 209 of file interface_view.cc.

References LISTBASE_FOREACH.

Referenced by ui_handle_view_item_event().

◆ UI_region_views_find_active_item()

ui::AbstractViewItem * UI_region_views_find_active_item ( const ARegion * region)

◆ UI_region_views_find_active_item_but()

uiBut * UI_region_views_find_active_item_but ( const ARegion * region)

Definition at line 204 of file interface_view.cc.

References ui_view_item_find_active().

Referenced by blender::ed::asset::shelf::context().

◆ UI_region_views_find_item_at()

ui::AbstractViewItem * UI_region_views_find_item_at ( const ARegion & region,
const int xy[2] )
Parameters
xyCoordinate to find a view item at, in window space.

Definition at line 184 of file interface_view.cc.

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

Referenced by blender::ui::region_views_find_drop_target_at().