Blender V4.3
blender::ui Namespace Reference

Namespaces

namespace  bonecollections
namespace  greasepencil
namespace  light_linking
namespace  nodes
namespace  string_search

Classes

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

Enumerations

enum class  ViewScrollDirection { UP , DOWN }
enum class  DropBehavior { Reorder , Insert , ReorderAndInsert }
enum class  DropLocation { Into , Before , After }
enum class  SampleResult {
  UNKNOWN_FAILURE , SUCCESS , NO_BONE_3DVIEW , NO_BONE_OUTLINER ,
  WRONG_AREA , WRONG_ARMATURE
}

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 (StringRefNull str, bool can_create_attribute, Span< const nodes::geo_eval_log::GeometryAttributeInfo * > infos, 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, StringRefNull 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 int bonedropper_modal (bContext *C, wmOperator *op, const wmEvent *event)
static int bonedropper_invoke (bContext *C, wmOperator *op, const wmEvent *)
static int 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 int eyedropper_colorband_modal (bContext *C, wmOperator *op, const wmEvent *event)
static int eyedropper_colorband_point_modal (bContext *C, wmOperator *op, const wmEvent *event)
static int eyedropper_colorband_invoke (bContext *C, wmOperator *op, const wmEvent *)
static int 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)
static std::optional< intfind_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 106 of file UI_tree_view.hh.

Enumeration Type Documentation

◆ 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 102 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 121 of file UI_interface.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 44 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 153 of file eyedropper_bone.cc.

References bonedropper_exit(), and C.

Referenced by bonedropper_modal(), and UI_OT_eyedropper_bone().

◆ bonedropper_exec()

int 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 24 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 49 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()

int 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

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

References uiStyle::buttonspacex, 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 34 of file tree_view.cc.

References UI_UNIT_Y.

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