Blender V4.5
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
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  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)
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])
void template_asset_shelf_popover (uiLayout &layout, const bContext &C, StringRefNull asset_shelf_id, StringRef name, int icon)
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

◆ DropBehavior

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 106 of file UI_interface.hh.

◆ DropLocation

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 125 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 124 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 97 of file interface_layout.cc.

◆ SampleResult

Enumerator
UNKNOWN_FAILURE 
SUCCESS 
NO_BONE_3DVIEW 
NO_BONE_OUTLINER 
WRONG_AREA 
WRONG_ARMATURE 

Definition at line 41 of file eyedropper_bone.cc.

◆ ViewScrollDirection

Enumerator
UP 
DOWN 

Definition at line 49 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()

◆ bonedropper_cancel()

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

Definition at line 150 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()

◆ 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 270 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 37 of file tree_view.cc.

References UI_UNIT_Y.

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