Blender V5.0
blender::ui Namespace Reference

Namespaces

namespace  string_search
namespace  greasepencil
namespace  bonecollections
namespace  light_linking
namespace  nodes

Classes

class  AbstractView
class  AbstractViewItem
class  AbstractViewItemDragController
class  AbstractGridViewItem
struct  GridViewStyle
class  AbstractGridView
class  GridViewItemDropTarget
class  GridViewBuilder
class  PreviewGridItem
struct  ContextPathItem
struct  DragInfo
class  DropTargetInterface
class  TreeViewItemContainer
class  AbstractTreeView
class  AbstractTreeViewItem
 Abstract base class for defining a customizable tree-view item. More...
class  BasicTreeViewItem
class  TreeViewItemDropTarget
class  TreeViewBuilder
struct  BoneDropper
struct  BoneSampleData
struct  EyedropperColorband
struct  EyedropperColorband_Context
struct  ItemInternal
struct  LayoutInternal
class  ViewItemAPIWrapper
class  BuildOnlyVisibleButtonsHelper
class  GridViewLayoutBuilder
class  TreeViewLayoutBuilder

Enumerations

enum class  ViewScrollDirection { UP , DOWN }
enum class  DropBehavior { Reorder , Insert , ReorderAndInsert }
enum class  DropLocation { Into , Before , After }
enum class  EmbossType : uint8_t {
  Emboss = 0 , None = 1 , Pulldown = 2 , PieMenu = 3 ,
  NoneOrStatus = 4 , Undefined = 255
}
enum class  LayoutDirection : int8_t { Horizontal = 0 , Vertical = 1 }
enum class  LayoutType : int8_t {
  Panel = 0 , Header = 1 , Menu = 2 , Toolbar = 3 ,
  PieMenu = 4 , VerticalBar = 5
}
enum class  LayoutAlign : int8_t { Expand = 0 , Left = 1 , Center = 2 , Right = 3 }
enum class  ButProgressType : int8_t { Bar = 0 , Ring = 1 }
enum class  SampleResult {
  UNKNOWN_FAILURE , SUCCESS , NO_BONE_3DVIEW , NO_BONE_OUTLINER ,
  WRONG_AREA , WRONG_ARMATURE
}
enum class  ItemType : int8_t {
  Button , LayoutRow , LayoutPanelHeader , LayoutPanelBody ,
  LayoutColumn , LayoutColumnFlow , LayoutRowFlow , LayoutGridFlow ,
  LayoutBox , LayoutAbsolute , LayoutSplit , LayoutOverlap ,
  LayoutRadial , LayoutRoot
}
enum class  ItemInternalFlag : uint8_t {
  AutoFixedSize = 1 << 0 , FixedSize = 1 << 1 , BoxItem = 1 << 2 , PropSep = 1 << 3 ,
  InsidePropSep = 1 << 4 , PropDecorate = 1 << 5 , PropDecorateNoPad = 1 << 6
}

Functions

void context_path_add_generic (Vector< ContextPathItem > &path, StructRNA &rna_type, void *ptr, const BIFIconID icon_override=ICON_NONE, std::function< void(bContext &)> handle_func=nullptr)
void attribute_search_add_items (StringRef str, bool can_create_attribute, Span< const nodes::geo_eval_log::GeometryAttributeInfo * > infos, uiSearchItems *items, bool is_first)
void grease_pencil_layer_search_add_items (StringRef str, Span< const std::string * > layer_names, uiSearchItems &items, bool is_first)
bool asset_shelf_popover_invoke (bContext &C, blender::StringRef asset_shelf_idname, ReportList &reports)
bool drop_target_apply_drop (bContext &C, const ARegion &region, const wmEvent &event, const DropTargetInterface &drop_target, const ListBase &drags)
std::string drop_target_tooltip (const ARegion &region, const DropTargetInterface &drop_target, const wmDrag &drag, const wmEvent &event)
std::unique_ptr< DropTargetInterfaceregion_views_find_drop_target_at (const ARegion *region, const int xy[2])
char but_pointer_bit_max_index (ButPointerType pointer_type)
void template_asset_shelf_popover (uiLayout &layout, const bContext &C, StringRefNull asset_shelf_id, StringRef name, int icon)
uiLayoutblock_layout (uiBlock *block, LayoutDirection direction, LayoutType type, int x, int y, int size, int em, int padding, const uiStyle *style)
int2 block_layout_resolve (uiBlock *block)
void block_layout_set_current (uiBlock *block, uiLayout *layout)
bool block_layout_needs_resolving (const uiBlock *block)
void block_layout_free (uiBlock *block)
static void datadropper_draw_cb (const bContext *, ARegion *, void *arg)
static bool is_bone_dropper_valid (BoneDropper *bone_dropper)
static int bonedropper_init (bContext *C, wmOperator *op)
static void bonedropper_exit (bContext *C, wmOperator *op)
static void bonedropper_cancel (bContext *C, wmOperator *op)
static void bonedropper_set_draw_callback_region (ScrArea &area, BoneDropper &bdr)
static BoneSampleData sample_data_from_3d_view (bContext *C, const int mval[2], const BoneDropper &bdr)
static BoneSampleData sample_data_from_outliner (bContext *C, const int mval[2], const BoneDropper &bdr)
static BoneSampleData bonedropper_sample_pt (bContext *C, wmWindow &win, ScrArea &area, BoneDropper &bdr, const int event_xy[2])
static SampleResult bonedropper_sample (bContext *C, BoneDropper &bdr, const int event_xy[2])
static void generate_sample_warning (SampleResult result, wmOperator *op)
static wmOperatorStatus bonedropper_modal (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus bonedropper_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus bonedropper_exec (bContext *C, wmOperator *op)
static bool bonedropper_poll (bContext *C)
void UI_OT_eyedropper_bone (wmOperatorType *ot)
static bool eyedropper_colorband_init (bContext *C, wmOperator *op)
static void eyedropper_colorband_sample_point (bContext *C, EyedropperColorband *eye, const int m_xy[2])
static bool eyedropper_colorband_sample_callback (int mx, int my, void *userdata)
static void eyedropper_colorband_sample_segment (bContext *C, EyedropperColorband *eye, const int m_xy[2])
static void eyedropper_colorband_exit (bContext *C, wmOperator *op)
static void eyedropper_colorband_apply (bContext *C, wmOperator *op)
static void eyedropper_colorband_cancel (bContext *C, wmOperator *op)
static wmOperatorStatus eyedropper_colorband_modal (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus eyedropper_colorband_point_modal (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus eyedropper_colorband_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus eyedropper_colorband_exec (bContext *C, wmOperator *op)
static bool eyedropper_colorband_poll (bContext *C)
void UI_OT_eyedropper_colorramp (wmOperatorType *ot)
void UI_OT_eyedropper_colorramp_point (wmOperatorType *ot)
static StringRef attribute_data_type_string (const eCustomDataType type)
static StringRef attribute_domain_string (const bke::AttrDomain domain)
static bool attribute_search_item_add (uiSearchItems *items, const GeometryAttributeInfo &item)
void grease_pencil_layer_search_add_items (const StringRef str, const Span< const std::string * > layer_names, uiSearchItems &seach_items, const bool is_first)
static std::optional< int > find_filtered_item_index (const AbstractGridViewItem &item)
static int unpadded_item_height ()
static int padded_item_height ()
static uiButViewItemfind_first_view_item_but (const uiBlock &block, const AbstractTreeView &view)
static int count_visible_items (AbstractTreeView &tree_view)
Breadcrumb Template
void template_breadcrumbs (uiLayout &layout, Span< ContextPathItem > context_path)
Renaming
static AbstractViewItemfind_item_from_rename_button (const uiBut &rename_but)
static void rename_button_fn (bContext *C, void *arg, char *)

Tree-View Item Container

Base class for tree-view and tree-view items, so both can contain children.

using TreeViewOrItem = TreeViewItemContainer
 ENUM_OPERATORS (TreeViewItemContainer::IterOptions, TreeViewItemContainer::IterOptions::SkipCollapsed)

Typedef Documentation

◆ TreeViewOrItem

The container class is the base for both the tree-view and the items. This alias gives it a clearer name for handles that accept both. Use whenever something wants to act on child-items, irrespective of if they are stored at root level or as children of some other item.

Definition at line 112 of file UI_tree_view.hh.

Enumeration Type Documentation

◆ ButProgressType

enum class blender::ui::ButProgressType : int8_t
strong
Enumerator
Bar 
Ring 

Definition at line 840 of file UI_interface_layout.hh.

◆ DropBehavior

enum class blender::ui::DropBehavior
strong

Some drop targets simply allow dropping onto/into them, others support dragging in-between them. Classes implementing the drop-target interface can use this type to control the behavior by letting it influence the result of #choose_drop_location().

Enumerator
Reorder 

Enable dropping before (#DropLocation::Before) and after (#DropLocation::After) the drop target. Typically used for reordering items.

Insert 

Only enable dropping onto/into the drop target (#DropLocation::Into).

ReorderAndInsert 

Enable dropping onto/into (#DropLocation::Into), before (#DropLocation::Before) and after (#DropLocation::After) the drop target. Typically used for reordering items with nesting support.

Definition at line 109 of file UI_interface.hh.

◆ DropLocation

enum class blender::ui::DropLocation
strong

Information on how dragged data should be inserted on drop, as determined through #DropTargetInterface::choose_drop_location(). Also see DropBehavior.

Enumerator
Into 
Before 
After 

Definition at line 128 of file UI_interface.hh.

◆ EmbossType

enum class blender::ui::EmbossType : uint8_t
strong

uiBlock.emboss and uiBut.emboss

Enumerator
Emboss 

Use widget style for drawing.

None 

Nothing, only icon and/or text

Pulldown 

Pull-down menu style

PieMenu 

Pie Menu

NoneOrStatus 

The same as #EmbossType::None, unless the button has a coloring status like an animation state or red alert.

Undefined 

For layout engine, use emboss from block.

Definition at line 127 of file UI_interface_c.hh.

◆ ItemInternalFlag

enum class blender::ui::ItemInternalFlag : uint8_t
strong
Enumerator
AutoFixedSize 
FixedSize 
BoxItem 
PropSep 
InsidePropSep 
PropDecorate 
PropDecorateNoPad 

Definition at line 125 of file interface_layout.cc.

◆ ItemType

enum class blender::ui::ItemType : int8_t
strong
Enumerator
Button 
LayoutRow 
LayoutPanelHeader 
LayoutPanelBody 
LayoutColumn 
LayoutColumnFlow 
LayoutRowFlow 
LayoutGridFlow 
LayoutBox 
LayoutAbsolute 
LayoutSplit 
LayoutOverlap 
LayoutRadial 
LayoutRoot 

Definition at line 98 of file interface_layout.cc.

◆ LayoutAlign

enum class blender::ui::LayoutAlign : int8_t
strong
Enumerator
Expand 
Left 
Center 
Right 

Definition at line 834 of file UI_interface_layout.hh.

◆ LayoutDirection

enum class blender::ui::LayoutDirection : int8_t
strong
Enumerator
Horizontal 
Vertical 

Definition at line 820 of file UI_interface_layout.hh.

◆ LayoutType

enum class blender::ui::LayoutType : int8_t
strong
Enumerator
Panel 
Header 
Menu 
Toolbar 
PieMenu 
VerticalBar 

Definition at line 825 of file UI_interface_layout.hh.

◆ SampleResult

enum class blender::ui::SampleResult
strong
Enumerator
UNKNOWN_FAILURE 
SUCCESS 
NO_BONE_3DVIEW 
NO_BONE_OUTLINER 
WRONG_AREA 
WRONG_ARMATURE 

Definition at line 40 of file eyedropper_bone.cc.

◆ ViewScrollDirection

Enumerator
UP 
DOWN 

Definition at line 50 of file UI_abstract_view.hh.

Function Documentation

◆ asset_shelf_popover_invoke()

◆ attribute_data_type_string()

StringRef blender::ui::attribute_data_type_string ( const eCustomDataType type)
static

◆ attribute_domain_string()

StringRef blender::ui::attribute_domain_string ( const bke::AttrDomain domain)
static

◆ attribute_search_add_items()

◆ attribute_search_item_add()

◆ block_layout()

uiLayout & blender::ui::block_layout ( uiBlock * block,
LayoutDirection direction,
LayoutType type,
int x,
int y,
int size,
int em,
int padding,
const uiStyle * style )

Definition at line 5460 of file interface_layout.cc.

References uiLayout::active_set(), BLI_addtail(), uiLayoutRoot::block, uiBlock::curlayout, ELEM, uiLayout::emboss_set(), uiLayoutRoot::emh, uiLayoutRoot::emw, uiLayout::enabled_set(), uiLayout::h_, Header, Horizontal, blender::wm::InvokeRegionWin, uiLayoutRoot::layout, uiBlock::layouts, MEM_callocN(), Menu, uiLayoutRoot::opcontext, padding(), uiLayoutRoot::padding, PieMenu, uiLayout::root(), size(), uiLayout::space_, uiLayoutRoot::style, uiStyle::templatespace, uiLayoutRoot::type, ui_layout_add_padding_button(), UI_UNIT_X, UI_UNIT_Y, Undefined, uiLayout::use_property_decorate_set(), VerticalBar, uiLayout::w_, x, uiLayout::x_, y, and uiLayout::y_.

Referenced by colorband_tools_fn(), component_menu(), blender::ed::space_node::draw_tree_path(), ed_panel_draw(), ED_region_header_layout(), ED_time_scrub_channel_search_draw(), menu_add_shortcut(), menu_change_shortcut(), menu_items_from_ui_create(), blender::ed::space_node::node_update_basis_buttons(), blender::ed::space_node::node_update_basis_from_declaration(), blender::ed::space_node::node_update_basis_socket(), panel_property_search(), blender::ed::asset::shelf::region_layout(), blender::ed::spreadsheet::spreadsheet_footer_region_draw(), UI_pie_menu_begin(), ui_popover_create_block(), ui_popup_menu_create_block(), uiItemsAlertBox(), wm_block_about_create(), wm_block_create_redo(), wm_block_dialog_create(), wm_block_insert_unicode_create(), wm_block_splash_create(), and wm_operator_ui_create().

◆ block_layout_free()

void blender::ui::block_layout_free ( uiBlock * block)

Used for property search when the layout process needs to be cancelled in order to avoid computing the locations for buttons, but the layout items created while adding the buttons must still be freed.

Definition at line 5661 of file interface_layout.cc.

References uiBlock::layouts, LISTBASE_FOREACH_MUTABLE, MEM_freeN(), and ui_layout_free().

Referenced by panel_property_search().

◆ block_layout_needs_resolving()

bool blender::ui::block_layout_needs_resolving ( const uiBlock * block)

Definition at line 5688 of file interface_layout.cc.

References BLI_listbase_is_empty(), and uiBlock::layouts.

Referenced by ui_textedit_begin().

◆ block_layout_resolve()

◆ block_layout_set_current()

void blender::ui::block_layout_set_current ( uiBlock * block,
uiLayout * layout )

Definition at line 5656 of file interface_layout.cc.

References uiBlock::curlayout.

Referenced by uiLayout::absolute(), blender::ui::TreeViewLayoutBuilder::build_from_tree(), blender::ui::GridViewLayoutBuilder::build_from_view(), blender::ui::GridViewBuilder::build_grid_view(), blender::ed::asset::shelf::AssetCatalogSelectorTree::Item::build_row(), blender::ui::TreeViewLayoutBuilder::build_row(), blender::ui::TreeViewBuilder::build_tree_view(), colorband_tools_fn(), uiLayout::column(), uiLayout::column_flow(), uiLayout::decorator(), ED_time_scrub_channel_search_draw(), blender::ed::asset_browser::file_create_asset_catalog_tree_view_in_layout(), uiLayout::grid_flow(), knot_modes_menu(), uiLayout::menu_pie(), uiLayout::op_enum_items(), uiLayout::overlap(), uiLayout::panel_prop(), uiLayout::progress_indicator(), uiLayout::prop(), uiLayout::prop_tabs_enum(), uiLayout::row(), uiLayout::separator(), uiLayout::separator_spacer(), uiLayout::split(), blender::ed::spreadsheet::spreadsheet_data_set_panel_draw(), ui_def_but_rna__menu(), ui_imageuser_layer_menu(), ui_imageuser_pass_menu(), ui_imageuser_view_menu_multiview(), ui_imageuser_view_menu_rr(), ui_item_array(), ui_item_disabled(), ui_item_enum_expand_exec(), ui_item_menu(), ui_item_with_label(), ui_layout_box(), blender::ed::space_node::ui_node_menu_column(), blender::ed::space_node::ui_template_node_link_menu(), uiItem_simple(), uiItemFullO_ptr_ex(), uiItemL_respect_property_split(), uiLayoutListItemAddPadding(), uiTemplateMenuSearch(), uiTemplateNodeLink(), uiTemplateOperatorSearch(), and uiTemplateRunningJobs().

◆ bonedropper_cancel()

void blender::ui::bonedropper_cancel ( bContext * C,
wmOperator * op )
static

Definition at line 149 of file eyedropper_bone.cc.

References bonedropper_exit(), and C.

Referenced by bonedropper_modal(), and UI_OT_eyedropper_bone().

◆ bonedropper_exec()

wmOperatorStatus blender::ui::bonedropper_exec ( bContext * C,
wmOperator * op )
static

◆ bonedropper_exit()

◆ bonedropper_init()

◆ bonedropper_invoke()

◆ bonedropper_modal()

◆ bonedropper_poll()

◆ bonedropper_sample()

◆ bonedropper_sample_pt()

◆ bonedropper_set_draw_callback_region()

◆ but_pointer_bit_max_index()

char blender::ui::but_pointer_bit_max_index ( ButPointerType pointer_type)
inline

Definition at line 469 of file UI_interface_c.hh.

References Char, Int, and Short.

Referenced by uiButTypeWithPointerType::uiButTypeWithPointerType().

◆ context_path_add_generic()

◆ count_visible_items()

◆ datadropper_draw_cb()

void blender::ui::datadropper_draw_cb ( const bContext * ,
ARegion * ,
void * arg )
static

◆ drop_target_apply_drop()

bool blender::ui::drop_target_apply_drop ( bContext & C,
const ARegion & region,
const wmEvent & event,
const DropTargetInterface & drop_target,
const ListBase & drags )

Let a drop target handle a drop event.

Returns
True if the dropping was successful.

Definition at line 26 of file interface_drop.cc.

References C, blender::ui::DropTargetInterface::can_drop(), blender::ui::DropTargetInterface::choose_drop_location(), LISTBASE_FOREACH, and blender::ui::DropTargetInterface::on_drop().

Referenced by ui_view_drop_invoke().

◆ drop_target_tooltip()

std::string blender::ui::drop_target_tooltip ( const ARegion & region,
const DropTargetInterface & drop_target,
const wmDrag & drag,
const wmEvent & event )

Call #DropTargetInterface::drop_tooltip() and return the result as newly allocated C string (unless the result is empty, returns null then). Needs freeing with MEM_freeN().

Definition at line 51 of file interface_drop.cc.

References blender::ui::DropTargetInterface::can_drop(), blender::ui::DropTargetInterface::choose_drop_location(), and blender::ui::DropTargetInterface::drop_tooltip().

Referenced by ui_view_drop_tooltip().

◆ ENUM_OPERATORS()

◆ eyedropper_colorband_apply()

◆ eyedropper_colorband_cancel()

◆ eyedropper_colorband_exec()

wmOperatorStatus blender::ui::eyedropper_colorband_exec ( bContext * C,
wmOperator * op )
static

◆ eyedropper_colorband_exit()

◆ eyedropper_colorband_init()

◆ eyedropper_colorband_invoke()

◆ eyedropper_colorband_modal()

◆ eyedropper_colorband_point_modal()

◆ eyedropper_colorband_poll()

bool blender::ui::eyedropper_colorband_poll ( bContext * C)
static

◆ eyedropper_colorband_sample_callback()

bool blender::ui::eyedropper_colorband_sample_callback ( int mx,
int my,
void * userdata )
static

◆ eyedropper_colorband_sample_point()

◆ eyedropper_colorband_sample_segment()

void blender::ui::eyedropper_colorband_sample_segment ( bContext * C,
EyedropperColorband * eye,
const int m_xy[2] )
static

◆ find_filtered_item_index()

std::optional< int > blender::ui::find_filtered_item_index ( const AbstractGridViewItem & item)
static

◆ find_first_view_item_but()

uiButViewItem * blender::ui::find_first_view_item_but ( const uiBlock & block,
const AbstractTreeView & view )
static

◆ find_item_from_rename_button()

◆ generate_sample_warning()

void blender::ui::generate_sample_warning ( SampleResult result,
wmOperator * op )
static

◆ grease_pencil_layer_search_add_items() [1/2]

void blender::ui::grease_pencil_layer_search_add_items ( const StringRef str,
const Span< const std::string * > layer_names,
uiSearchItems & seach_items,
const bool is_first )

◆ grease_pencil_layer_search_add_items() [2/2]

void blender::ui::grease_pencil_layer_search_add_items ( StringRef str,
Span< const std::string * > layer_names,
uiSearchItems & items,
bool is_first )

◆ is_bone_dropper_valid()

◆ padded_item_height()

◆ region_views_find_drop_target_at()

std::unique_ptr< DropTargetInterface > blender::ui::region_views_find_drop_target_at ( const ARegion * region,
const int xy[2] )

Try to find a view item with a drop target under the mouse cursor, or if not found, a view with a drop target.

Parameters
xyCoordinate to find a drop target at, in window space.

Definition at line 268 of file interface_view.cc.

References uiStyle::buttonspacex, blender::ui::AbstractTreeViewItem::create_item_drop_target(), blender::ui::AbstractViewItem::is_interactive(), UI_region_view_find_at(), UI_region_views_find_item_at(), UI_style_get_dpi(), view, and xy.

Referenced by ui_view_drop_invoke(), ui_view_drop_poll(), ui_view_drop_poll(), and ui_view_drop_tooltip().

◆ rename_button_fn()

void blender::ui::rename_button_fn ( bContext * C,
void * arg,
char *  )
static

◆ sample_data_from_3d_view()

◆ sample_data_from_outliner()

◆ template_asset_shelf_popover()

◆ template_breadcrumbs()

◆ UI_OT_eyedropper_bone()

◆ UI_OT_eyedropper_colorramp()

◆ UI_OT_eyedropper_colorramp_point()

◆ unpadded_item_height()

int blender::ui::unpadded_item_height ( )
static

Definition at line 39 of file tree_view.cc.

References UI_UNIT_Y.

Referenced by blender::ui::TreeViewLayoutBuilder::build_row(), and padded_item_height().