Blender V5.3
interface_intern.hh File Reference
#include <functional>
#include <optional>
#include <ranges>
#include "BLI_compiler_attrs.hh"
#include "BLI_enum_flags.hh"
#include "BLI_math_vector_types.hh"
#include "BLI_string_ref.hh"
#include "BLI_vector.hh"
#include "BKE_fcurve.hh"
#include "DNA_listBase.h"
#include "RNA_types.hh"
#include "UI_interface.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "buttons/interface_label_markdown.hh"

Go to the source code of this file.

Classes

struct  blender::ui::Button
struct  blender::ui::TextWrapCache
struct  blender::ui::ButtonText
struct  blender::ui::ButtonTextBox
struct  blender::ui::ButtonPush
struct  blender::ui::ButtonNumber
struct  blender::ui::ButtonNumberSlider
struct  blender::ui::ButtonColor
struct  blender::ui::ButtonTab
struct  blender::ui::ButtonSearch
struct  blender::ui::ButtonDecorator
struct  blender::ui::ButtonProgress
struct  blender::ui::ButtonSeparatorLine
struct  blender::ui::ButtonLabel
struct  blender::ui::ButtonImage
struct  blender::ui::ButtonScrollBar
struct  blender::ui::ButtonViewItem
struct  blender::ui::ButtonHSVCube
struct  blender::ui::ButtonColorBand
struct  blender::ui::ButtonCurveProfile
struct  blender::ui::ButtonCurveMapping
struct  blender::ui::ButtonHotkeyEvent
struct  blender::ui::ButtonMenu
struct  blender::ui::ButtonExtraOpIcon
struct  blender::ui::ColorPicker
struct  blender::ui::ColorPickerData
struct  blender::ui::PieMenuData
struct  blender::ui::ButtonGroup
struct  blender::ui::BlockDynamicListener
struct  blender::ui::Block
struct  blender::ui::SafetyRect
struct  blender::ui::KeyNavLock
struct  blender::ui::PopupBlockCreate
struct  blender::ui::PopupBlockHandle
struct  blender::ui::WidgetBaseParameters
struct  blender::ui::RNACollectionSearch

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::gpu
namespace  blender::ui
namespace  blender::ui::internal

Macros

#define RNA_ENUM_VALUE   -2
#define UI_MENU_PADDING   int(0.2f * UI_UNIT_Y)
#define UI_MENU_WIDTH_MIN   (UI_UNIT_Y * 9)
#define UI_MENU_SUBMENU_PADDING   (6 * UI_SCALE_FAC)
#define UI_MENU_SCROLL_ARROW   (12 * UI_SCALE_FAC)
#define UI_MENU_SCROLL_MOUSE   (UI_MENU_SCROLL_ARROW + 2 * UI_SCALE_FAC)
#define UI_MENU_SCROLL_PAD   (4 * UI_SCALE_FAC)
#define UI_POPOVER_WIDTH_UNITS   10
#define UI_RADIAL_DIRECTION_NEXT(dir)
#define UI_RADIAL_DIRECTION_PREV(dir)
#define UI_RADIAL_MASK_ALL_DIAGONAL
#define UI_RADIAL_MASK_ALL_AXIS_ALIGNED
#define PNL_HEADER   (UI_UNIT_Y * 1.25)
#define UI_BITBUT_TEST(a, b)
#define UI_BITBUT_VALUE_TOGGLED(a, b)
#define UI_BITBUT_VALUE_ENABLED(a, b)
#define UI_BITBUT_VALUE_DISABLED(a, b)
#define UI_BITBUT_ROW(min, max)
#define USE_NUMBUTS_LR_ALIGN
#define PIE_CLICK_THRESHOLD_SQ   50.0f
#define PIE_MAX_ITEMS   8
#define UI_TEXT_MARGIN_X   0.4f
#define UI_POPUP_MARGIN   (UI_SCALE_FAC * 12)
#define UI_POPUP_MENU_TOP   int(10 * UI_SCALE_FAC)
#define UI_PIXEL_AA_JITTER   8

Typedefs

using blender::ui::BlockHandleCreateFunc = Block *(*)(bContext * C, PopupBlockHandle *handle, void *arg1)
using blender::ui::ButtonFindPollFn = bool (*)(const Button *but, const void *customdata)

Enumerations

enum  blender::ui::ButtonFlagInternal {
  blender::ui::UI_SELECT = (1 << 0) , blender::ui::UI_SCROLLED = (1 << 1) , blender::ui::UI_HOVER = (1 << 2) , blender::ui::UI_HAS_ICON = (1 << 3) ,
  blender::ui::UI_HIDDEN = (1 << 4) , blender::ui::UI_SELECT_DRAW = (1 << 5) , blender::ui::UI_SEARCH_FILTER_NO_MATCH = (1 << 6) , blender::ui::BUT_ACTIVE_OVERRIDE = (1 << 7)
}
enum  blender::ui::RadialDirection : int8_t {
  blender::ui::UI_RADIAL_NONE = -1 , blender::ui::UI_RADIAL_N = 0 , blender::ui::UI_RADIAL_NE = 1 , blender::ui::UI_RADIAL_E = 2 ,
  blender::ui::UI_RADIAL_SE = 3 , blender::ui::UI_RADIAL_S = 4 , blender::ui::UI_RADIAL_SW = 5 , blender::ui::UI_RADIAL_W = 6 ,
  blender::ui::UI_RADIAL_NW = 7
}
enum  {
  blender::ui::PIE_INITIAL_DIRECTION = (1 << 1) , blender::ui::PIE_DRAG_STYLE = (1 << 2) , blender::ui::PIE_INVALID_DIR = (1 << 3) , blender::ui::PIE_CLICK_STYLE = (1 << 4) ,
  blender::ui::PIE_ANIMATION_FINISHED = (1 << 5) , blender::ui::PIE_GESTURE_END_WAIT = (1 << 6)
}
enum class  blender::ui::TextDirection : int8_t { blender::ui::Default , blender::ui::Down , blender::ui::Up }
enum class  blender::ui::ButtonLabelType { blender::ui::Standard , blender::ui::Multiline , blender::ui::Markdown }
enum  blender::ui::eBlockContentHints { blender::ui::BLOCK_CONTAINS_SUBMENU_BUT = (1 << 0) }
enum  blender::ui::ButtonGroupFlag { blender::ui::UI_BUTTON_GROUP_LOCK = (1 << 0) , blender::ui::UI_BUTTON_GROUP_PANEL_HEADER = (1 << 1) }
enum class  blender::ui::BlockAlertLevel : int8_t {
  blender::ui::None , blender::ui::Info , blender::ui::Success , blender::ui::Warning ,
  blender::ui::Error
}
enum  {
  blender::ui::ROUNDBOX_TRIA_NONE = 0 , blender::ui::ROUNDBOX_TRIA_ARROWS , blender::ui::ROUNDBOX_TRIA_SCROLL , blender::ui::ROUNDBOX_TRIA_MENU ,
  blender::ui::ROUNDBOX_TRIA_CHECK , blender::ui::ROUNDBOX_TRIA_HOLD_ACTION_ARROW , blender::ui::ROUNDBOX_TRIA_DASH , blender::ui::ROUNDBOX_TRIA_MAX
}
enum  blender::ui::MenuItemSeparatorType { blender::ui::UI_MENU_ITEM_SEPARATOR_NONE , blender::ui::UI_MENU_ITEM_SEPARATOR_SHORTCUT , blender::ui::UI_MENU_ITEM_SEPARATOR_HINT }

Functions

int64_t blender::ui::operator| (const ButtonFlag a, const ButtonFlagInternal b)
int64_t blender::ui::operator| (const ButtonFlagInternal b, const ButtonFlag a)
 blender::ui::ENUM_OPERATORS (ButtonGroupFlag)
void blender::ui::draw_rounded_corners_inverted (const rcti &rect, const float rad, const float4 color)
void blender::ui::draw_but_TAB_outline (const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
void blender::ui::draw_but_HISTOGRAM (ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void blender::ui::draw_but_WAVEFORM (const bContext *C, ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void blender::ui::draw_but_VECTORSCOPE (const bContext *C, ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void blender::ui::draw_but_COLORBAND (Button *but, const uiWidgetColors *wcol, const rcti *rect)
void blender::ui::draw_but_UNITVEC (Button *but, const uiWidgetColors *wcol, const rcti *rect, const float radius)
void blender::ui::draw_but_CURVE (ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect)
void blender::ui::draw_but_CURVEPROFILE (ARegion *region, Button *but, const uiWidgetColors *wcol, const rcti *rect)
void blender::ui::draw_but_IMAGE (ARegion *, Button *but, const uiWidgetColors *, const rcti *rect)
void blender::ui::draw_but_TRACKPREVIEW (ARegion *region, Button *but, const uiWidgetColors *, const rcti *recti)
void blender::ui::style_init ()
bool blender::ui::icon_is_preview_deferred_loading (const int icon_id, const bool big)
int blender::ui::id_icon_get (const bContext *C, ID *id, const bool big)
float blender::ui::event_icon_offset (const int icon_id)
void blender::ui::icon_draw_rect_input (const float x, const float y, const int w, const int h, const int icon_id, const float aspect, const float alpha, const bool inverted)
void blender::ui::button_drag_free (Button *but)
bool blender::ui::button_drag_is_draggable (const Button *but)
void blender::ui::button_drag_start (bContext *C, Button *but)
bool blender::ui::button_can_align (const Button *but)
int blender::ui::button_align_opposite_to_area_align_get (const ARegion *region)
void blender::ui::block_align_calc (Block *block, const ARegion *region)
void blender::ui::button_anim_flag (Button *but, const AnimationEvalContext *anim_eval_context)
void blender::ui::button_anim_copy_driver (bContext *C)
void blender::ui::button_anim_paste_driver (bContext *C)
bool blender::ui::button_anim_expression_get (Button *but, char *str, size_t str_maxncpy)
bool blender::ui::button_anim_expression_set (Button *but, const char *str)
bool blender::ui::button_anim_expression_create (Button *but, const char *str)
void blender::ui::button_anim_autokey (bContext *C, Button *but, Scene *scene, float cfra)
void blender::ui::button_anim_decorate_cb (bContext *C, void *arg_but, void *)
void blender::ui::button_anim_decorate_update_from_flag (ButtonDecorator *but)
bool blender::ui::button_anim_decorate_pushed_state (ButtonDecorator *but)
bool blender::ui::button_opens_link (const Button *button)
void blender::ui::UI_OT_eyedropper_color (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_colorramp (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_colorramp_point (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_bone (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_id (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_depth (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_driver (wmOperatorType *ot)
void blender::ui::UI_OT_eyedropper_grease_pencil_color (wmOperatorType *ot)
std::optional< StringRefNull > blender::ui::asset_shelf_idname_from_button_context (const Button *but)
void blender::ui::block_free_views (Block *block)
void blender::ui::block_views_end (ARegion *region, const Block *block)
void blender::ui::block_view_persistent_state_restore (const ARegion &region, const Block &block, AbstractView &view)
void blender::ui::block_views_listen (const Block *block, const wmRegionListenerParams *listener_params)
void blender::ui::block_views_draw_overlays (const ARegion *region, const Block *block)
AbstractView * blender::ui::block_view_find_matching_in_old_block (const Block &new_block, const AbstractView &new_view)
ButtonViewItem * blender::ui::block_view_find_matching_view_item_but_in_old_block (const Block &new_block, const AbstractViewItem &new_item)
uiListType * blender::ui::UI_UL_cache_file_layers ()
ID * blender::ui::template_id_liboverride_hierarchy_make (bContext *C, Main *bmain, ID *owner_id, ID *id, const char **r_undo_push_label)
Vector< FCurve * > blender::ui::internal::get_property_drivers (PointerRNA *ptr, PropertyRNA *prop, bool get_all, int index, bool *r_is_array_prop)
int blender::ui::internal::paste_property_drivers (Span< FCurve * > src_drivers, bool is_array_prop, PointerRNA *dst_ptr, PropertyRNA *dst_prop)
Block Drawing
void blender::ui::fontscale (float *points, float aspect)
void blender::ui::button_to_pixelrect (rcti *rect, const ARegion *region, const Block *block, const Button *but)
rcti blender::ui::rect_to_pixelrect (const ARegion *region, const Block *block, const rctf *src_rect)
Window Matrix
void blender::ui::block_to_region_fl (const ARegion *region, const Block *block, float *x, float *y)
void blender::ui::block_to_window_fl (const ARegion *region, const Block *block, float *x, float *y)
void blender::ui::block_to_window (const ARegion *region, const Block *block, int *x, int *y)
void blender::ui::block_to_region_rctf (const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
void blender::ui::block_to_window_rctf (const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
float blender::ui::block_to_window_scale (const ARegion *region, const Block *block)
void blender::ui::window_to_block_fl (const ARegion *region, const Block *block, float *x, float *y)
void blender::ui::window_to_block (const ARegion *region, const Block *block, int *x, int *y)
void blender::ui::window_to_block_rctf (const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
void blender::ui::window_to_region (const ARegion *region, int *x, int *y)
void blender::ui::window_to_region_rcti (const ARegion *region, rcti *rect_dst, const rcti *rct_src)
void blender::ui::window_to_region_rctf (const ARegion *region, rctf *rect_dst, const rctf *rct_src)
void blender::ui::region_to_window (const ARegion *region, int *x, int *y)
void blender::ui::region_to_window (const ARegion *region, int region_x, int region_y, int *r_window_x, int *r_window_y)
void blender::ui::region_winrct_get_no_margin (const ARegion *region, rcti *r_rect)
Block Begin
void blender::ui::block_add_dynamic_listener (Block *block, void(*listener_func)(const wmRegionListenerParams *params))
Data Get/Set

This either works with the pointed to data, or can work with an edit override pointer while dragging for example.

double blender::ui::button_value_get (Button *but)
void blender::ui::button_value_set (Button *but, double value)
void blender::ui::button_v3_get (Button *but, float vec[3])
void blender::ui::button_v3_set (Button *but, const float vec[3])
void blender::ui::button_v4_get (Button *but, float vec[4])
void blender::ui::button_v4_set (Button *but, const float vec[4])
void blender::ui::button_string_get_ex (Button *but, char *str, const size_t str_maxncpy, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
void blender::ui::button_string_get (Button *but, char *str, const size_t str_maxncpy)
char * blender::ui::button_string_get_dynamic (Button *but, int *r_str_size)
void blender::ui::button_convert_to_unit_alt_name (Button *but, char *str, size_t str_maxncpy)
bool blender::ui::button_string_set (bContext *C, Button *but, const char *str)
bool blender::ui::button_string_eval_number (bContext *C, const Button *but, const char *str, double *r_value)
int blender::ui::button_string_get_maxncpy (Button *but)
Button * blender::ui::button_drag_multi_edit_get (Button *but)
void blender::ui::button_range_set_hard (Button *but)
void blender::ui::button_range_set_soft (Button *but)
PropertyScaleType blender::ui::button_scale_type (const Button *but)
bool blender::ui::button_is_float (const Button *but)
bool blender::ui::button_is_bool (const Button *but)
bool blender::ui::button_is_unit (const Button *but)
bool blender::ui::button_is_compatible (const Button *but_a, const Button *but_b)
bool blender::ui::button_is_rna_valid (Button *but)
bool blender::ui::button_supports_cycling (const Button *but)
Color Picker
void blender::ui::button_hsv_set (Button *but)
Draw Menu Backdrop
void blender::ui::hsvcircle_vals_from_pos (const rcti *rect, float mx, float my, float *r_val_rad, float *r_val_dist)
void blender::ui::hsvcircle_pos_from_vals (const ColorPicker *cpicker, const rcti *rect, const float *hsv, float *r_xpos, float *r_ypos)
Draw Custom Buttons
void blender::ui::hsvcube_pos_from_vals (const ButtonHSVCube *hsv_but, const rcti *rect, const float *hsv, float *r_xp, float *r_yp)
void blender::ui::draw_gradient (const rcti *rect, const float hsv[3], eButGradientType type, float alpha, const ColorManagedDisplay *display)
Button Text Selection/Editing
void blender::ui::button_active_string_clear_and_exit (bContext *C, Button *but)
void blender::ui::button_set_string_interactive (bContext *C, Button *but, const char *value)
std::optional< StringRef > blender::ui::button_edit_unit_hint_get (const Button &but)
Block & Button Flags
const char * blender::ui::button_placeholder_get (Button *but)
Button Definition
void blender::ui::def_but_icon (Button *but, const int icon, const int64_t flag)
void blender::ui::def_but_icon_clear (Button *but)
void blender::ui::button_rna_menu_convert_to_panel_type (Button *but, const char *panel_type)
void blender::ui::button_rna_menu_convert_to_menu_type (Button *but, const char *menu_type)
bool blender::ui::button_menu_draw_as_popover (const Button *but)
Button Extra Operator Icons

Extra icons are shown on the right hand side of buttons. They can be clicked to invoke custom operators. There are some predefined here, which get added to buttons automatically based on button data (type, flags, state, etc).

void blender::ui::button_extra_operator_icons_free (Button *but)
Block Ending
bool blender::ui::button_context_poll_operator (bContext *C, wmOperatorType *ot, const Button *but)
bool blender::ui::button_context_poll_operator_ex (bContext *C, const Button *but, const wmOperatorCallParams *optype_params)
Button Update
void blender::ui::button_update (Button *but)
void blender::ui::button_update_edited (Button *but)
const ColorManagedDisplay * blender::ui::block_cm_display_get (Block *block)
void blender::ui::block_cm_to_display_space_v3 (Block *block, float pixel[3])
Button Pushed State
int blender::ui::button_is_pushed_ex (Button *but, double *value)
int blender::ui::button_is_pushed (Button *but)
Button Library Override Flag
void blender::ui::button_override_flag (Main *bmain, Button *but)
Block Calculation
void blender::ui::block_bounds_calc (Block *block)
Region Level Panel Interaction
int blender::ui::handler_panel_region (bContext *C, const wmEvent *event, ARegion *region, const Button *active_but)
void blender::ui::panel_drag_collapse_handler_add (const bContext *C, const bool was_open)
bool blender::ui::layout_panel_toggle_open (const bContext *C, LayoutPanelHeader *header)
LayoutPanelHeader * blender::ui::layout_panel_header_under_mouse (const Panel &panel, const int my)
void blender::ui::panel_region_width_set (ARegion *region, const float aspect, int unscaled_size)
Drawing
void blender::ui::draw_aligned_panel (const ARegion *region, const uiStyle *style, const Block *block, const rcti *rect, bool show_pin, bool show_background, bool region_search_filter_active)
void blender::ui::draw_layout_panels_backdrop (const ARegion *region, const Panel *panel, const float radius, float subpanel_backcolor[4])
Panels
void blender::ui::panel_tag_search_filter_match (Panel *panel)
Menu Block Creation
void blender::ui::layout_panel_popup_scroll_apply (Panel *panel, const float dy)
Text Field Undo Stack
UndoStack_Text * blender::ui::textedit_undo_stack_create ()
void blender::ui::textedit_undo_stack_destroy (UndoStack_Text *stack)
void blender::ui::textedit_undo_push (UndoStack_Text *stack, const char *text, int cursor_index)
const char * blender::ui::textedit_undo (UndoStack_Text *stack, int direction, int *r_cursor_index)
Struct allocation & freeing
void blender::ui::but_handle_data_free (HandleButtonData **data)
Button Apply/Revert
void blender::ui::handle_afterfunc_add_operator (wmOperatorType *ot, wm::OpCallContext opcontext)
UI Queries
void blender::ui::pan_to_scroll (const wmEvent *event, int *type, int *val)
Button * blender::ui::button_find_select_in_enum (Button *but, int direction)
bool blender::ui::button_is_editing (const Button *but)
Button Activation Handling
void blender::ui::button_activate_event (bContext *C, ARegion *region, Button *but)
void blender::ui::button_activate_over (bContext *C, ARegion *region, Button *but)
void blender::ui::button_execute_begin (bContext *, ARegion *region, Button *but, void **active_back)
void blender::ui::button_execute_end (bContext *C, ARegion *, Button *but, void *active_back)
Button State Handling
void blender::ui::button_active_free (const bContext *C, Button *but)
void blender::ui::button_semi_modal_state_free (const bContext *C, Button *but)
void blender::ui::button_update_view_for_active (const bContext *C, const Block *block)
Menu/Popup Begin/End (various popup types)
int blender::ui::button_menu_direction (Button *but)
Button Text Password

Functions to convert password strings that should not be displayed to asterisk representation (e.g. mysecretpasswd -> *************)

It converts every UTF8 character to an asterisk, and also remaps the cursor position and selection start/end.

Note
remapping is used, because password could contain UTF8 characters.
void blender::ui::button_text_password_hide (std::string &password_str, Button *but, const bool restore)
Menu Event Handling
float blender::ui::block_calc_pie_segment (Block *block, const float event_xy[2])
Menu Key Accelerators
void blender::ui::button_add_shortcut (Button *but, const char *shortcut_str, const bool do_strip)
Button Copy & Paste
void blender::ui::button_clipboard_free ()
Button Matching from Old Block
bool blender::ui::button_rna_equals (const Button *a, const Button *b)
bool blender::ui::button_rna_equals_ex (const Button *but, const PointerRNA *ptr, const PropertyRNA *prop, int index)
Button * blender::ui::button_find_old (Block *block_old, const Button *but_new)
Button * blender::ui::button_find_new (Block *block_new, const Button *but_old)
Button Utilities
int blender::ui::button_text_padding (const Button *button)
std::string blender::ui::button_get_link (const Button *button, bContext *C)
#gpu::Batch Creation

In order to speed up UI drawing we create some batches that are then modified by specialized shaders to draw certain elements really fast. TODO: find a better place. Maybe its own file?

gpu::Batch * blender::ui::batch_roundbox_widget_get ()
gpu::Batch * blender::ui::batch_roundbox_shadow_get ()
Public API
void blender::ui::draw_menu_back (uiStyle *style, Block *block, const rcti *rect)
void blender::ui::draw_popover_back (ARegion *region, uiStyle *style, Block *block, const rcti *rect)
void blender::ui::draw_pie_center (Block *block)
const uiWidgetColors * blender::ui::tooltip_get_theme ()
void blender::ui::draw_widget_menu_back_color (const rcti *rect, bool use_shadow, const float color[4])
void blender::ui::draw_widget_menu_back (const rcti *rect, bool use_shadow)
void blender::ui::draw_tooltip_background (const uiStyle *style, Block *block, const rcti *rect)
void blender::ui::draw_button (const bContext *C, ARegion *region, uiStyle *style, Button *but, rcti *rect)
void blender::ui::draw_menu_item (const uiFontStyle *fstyle, rcti *rect, rcti *back_rect, float zoom, bool use_unpadded, const char *name, int iconid, int64_t but_flag, MenuItemSeparatorType separator_type, int *r_xmax)
void blender::ui::draw_preview_item (const uiFontStyle *fstyle, rcti *rect, float zoom, const char *name, int iconid, int64_t but_flag, FontStyleAlign text_align)
void blender::ui::draw_preview_item_stateless (const uiFontStyle *fstyle, rcti *rect, StringRef name, int iconid, const uchar text_col[4], FontStyleAlign text_align, const bool add_padding)
Init/Exit
void blender::ui::resources_init ()
void blender::ui::resources_free ()
Layout
void blender::ui::layout_add_but (Layout *layout, Button *but)
void blender::ui::layout_remove_but (Layout *layout, const Button *but)
bool blender::ui::layout_replace_but_ptr (Layout *layout, const void *old_but_ptr, Button *new_but)
Button Items
void blender::ui::button_configure_search (Button *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, PropertyRNA *item_searchprop, bool results_are_suggestions)
void blender::ui::item_menutype_func (bContext *C, Layout *layout, void *arg_mt)
void blender::ui::item_paneltype_func (bContext *C, Layout *layout, void *arg_pt)
Layout Items
void blender::ui::layout_list_set_labels_active (Layout *layout)
Button Groups
void blender::ui::block_new_button_group (Block *block, ButtonGroupFlag flag)
void blender::ui::button_group_add_but (Block *block, Button *but)
void blender::ui::button_group_replace_but_ptr (Block *block, const Button *old_but_ptr, Button *new_but)
Button (#Button) State
bool blender::ui::button_is_editable (const Button *but) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_is_editable_as_text (const Button *but) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_is_toggle (const Button *but) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_is_interactive_ex (const Button *but, const bool labeledit, const bool for_tooltip)
bool blender::ui::button_is_interactive (const Button *but, bool labeledit) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_is_popover_once_compat (const Button *but) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_has_array_value (const Button *but) ATTR_WARN_UNUSED_RESULT
int blender::ui::button_icon (const Button *but)
Button (#Button) Spatial
void blender::ui::button_pie_dir (RadialDirection dir, float vec[2])
bool blender::ui::button_contains_pt (const Button *but, float mx, float my) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_contains_rect (const Button *but, const rctf *rect)
bool blender::ui::but_contains_point_px_icon (const Button *but, ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
bool blender::ui::button_contains_point_px (const Button *but, const ARegion *region, const int xy[2]) ATTR_NONNULL(1
Button * blender::ui::listbox_find_mouse_over (const ARegion *region, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::listrow_find_mouse_over (const ARegion *region, const int xy[2]) ATTR_NONNULL(1
Button * blender::ui::listrow_find_index (const ARegion *region, int index, Button *listbox) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::view_item_find_mouse_over (const ARegion *region, const int xy[2]) ATTR_NONNULL(1
Button Button * blender::ui::view_item_find_active (const ARegion *region, const AbstractView *view=nullptr)
Button * blender::ui::view_item_find_search_highlight (const ARegion *region)
Button * blender::ui::button_find_mouse_over_ex (const ARegion *region, const int xy[2], bool labeledit, bool for_tooltip, const ButtonFindPollFn find_poll, const void *find_custom_data) ATTR_NONNULL(1
Button * blender::ui::button_find_rect_over (const ARegion *region, const rcti *rect_px) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::listbox_find_mouse_over_ex (const ARegion *region, const int xy[2]) ATTR_NONNULL(1
Button (#Button) Relations
bool blender::ui::button_is_cursor_warp (const Button *but) ATTR_WARN_UNUSED_RESULT
bool blender::ui::but_contains_password (const Button *but) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::button_prev (Button *but) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::button_next (Button *but) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::button_first (Block *block) ATTR_WARN_UNUSED_RESULT
Button * blender::ui::button_last (Block *block) ATTR_WARN_UNUSED_RESULT
Button (#Button) Text
StringRef blender::ui::button_drawstr_without_sep_char (const Button *but) ATTR_NONNULL()
size_t blender::ui::button_drawstr_len_without_sep_char (const Button *but)
size_t blender::ui::button_tip_len_only_first_line (const Button *but)
Text/Icon Drawing
bool blender::ui::button_draw_as_link (const Button *button)
Block (#Block) State
Button * blender::ui::block_active_but_get (const Block *block)
bool blender::ui::block_is_menu (const Block *block) ATTR_WARN_UNUSED_RESULT
bool blender::ui::block_is_popover (const Block *block) ATTR_WARN_UNUSED_RESULT
bool blender::ui::block_is_pie_menu (const Block *block) ATTR_WARN_UNUSED_RESULT
bool blender::ui::block_is_popup_any (const Block *block) ATTR_WARN_UNUSED_RESULT
Block (#Block) Spatial
Block * blender::ui::block_find_mouse_over_ex (const ARegion *region, const int xy[2], bool only_clip) ATTR_NONNULL(1
Block Block * blender::ui::block_find_mouse_over (const ARegion *region, const wmEvent *event, bool only_clip)
Region (#ARegion) State
Button * blender::ui::region_find_first_but_test_flag (ARegion *region, int64_t flag_include, int64_t flag_exclude)
Button * blender::ui::region_find_active_but (ARegion *region) ATTR_WARN_UNUSED_RESULT
Region (#ARegion) Spatial
bool blender::ui::region_contains_point_px (const ARegion *region, const int xy[2]) ATTR_NONNULL(1
bool blender::ui::region_contains_rect_px (const ARegion *region, const rcti *rect_px)
Screen (#bScreen) Spatial
ARegion * blender::ui::screen_region_find_mouse_over_ex (bScreen *screen, const int xy[2]) ATTR_NONNULL(1
ARegion ARegion * blender::ui::screen_region_find_mouse_over (bScreen *screen, const wmEvent *event)
Button Context Menu
bool blender::ui::popup_context_menu_for_button (bContext *C, Button *but, const wmEvent *event)
Panel Context Menu
int blender::ui::popup_context_menu_for_panel (bContext *C, ARegion *region, Panel *panel)
Modal Keymap
wmKeyMap * blender::ui::eyedropper_modal_keymap (wmKeyConfig *keyconf)
wmKeyMap * blender::ui::eyedropper_colorband_modal_keymap (wmKeyConfig *keyconf)
Color Space Menu
MenuType * blender::ui::UI_MT_color_space_select ()
RNA Collection Search Menu
void blender::ui::rna_collection_search_update_fn (const bContext *C, void *arg, const char *str, SearchItems *items, bool is_first)
Jump to Target Operator
bool blender::ui::jump_to_target_button_poll (bContext *C)
Manage Internal State
void blender::ui::interface_tag_script_reload_queries ()
C-API
void blender::ui::view_item_swap_button_pointers (AbstractViewItem &a, AbstractViewItem &b)
Window Level Modal Panel Interaction
void blender::ui::region_panels_sort_for_search_filter_visibility_change (bContext *C, const ARegion *region)

Variables

bool blender::ui::ATTR_WARN_UNUSED_RESULT
Shape Preset Data
const float blender::ui::ui_pixel_jitter [UI_PIXEL_AA_JITTER][2]

Interface Region Functions

interface_region_*.cc sources.

using blender::ui::PopoverCreateFunc = std::function<void(bContext *, Layout *, PanelType *)>
void blender::ui::color_picker_rgb_to_hsv_compat (const float rgb[3], float r_cp[3])
void blender::ui::color_picker_rgb_to_hsv (const float rgb[3], float r_cp[3])
void blender::ui::color_picker_hsv_to_rgb (const float r_cp[3], float rgb[3])
bool blender::ui::button_is_color_gamma (Button *but)
bool blender::ui::button_color_has_alpha (Button *but)
void blender::ui::scene_linear_to_perceptual_space (Button *but, float rgb[3])
void blender::ui::perceptual_to_scene_linear_space (Button *but, float rgb[3])
Block * blender::ui::block_func_COLOR (bContext *C, PopupBlockHandle *handle, void *arg_but)
ColorPicker * blender::ui::block_colorpicker_create (Block *block)
ARegion * blender::ui::searchbox_create_generic (bContext *C, ARegion *butregion, ButtonSearch *search_but)
ARegion * blender::ui::searchbox_create_operator (bContext *C, ARegion *butregion, ButtonSearch *search_but)
ARegion * blender::ui::searchbox_create_menu (bContext *C, ARegion *butregion, ButtonSearch *search_but)
bool blender::ui::searchbox_inside (ARegion *region, const int xy[2]) ATTR_NONNULL(1
bool int blender::ui::searchbox_find_index (ARegion *region, const char *name)
void blender::ui::searchbox_update (bContext *C, ARegion *region, Button *but, bool reset)
int blender::ui::searchbox_autocomplete (bContext *C, ARegion *region, Button *but, char *str)
bool blender::ui::searchbox_event (bContext *C, ARegion *region, Button *but, ARegion *butregion, const wmEvent *event)
bool blender::ui::searchbox_apply (Button *but, ARegion *region)
void blender::ui::searchbox_free (bContext *C, ARegion *region)
void blender::ui::button_search_refresh (ButtonSearch *but)
int blender::ui::button_menu_step (Button *but, int direction)
bool blender::ui::button_menu_step_poll (const Button *but)
Button * blender::ui::popup_menu_memory_get (Block *block)
void blender::ui::popup_menu_memory_set (Block *block, Button *but)
Block * blender::ui::popup_block_refresh (bContext *C, PopupBlockHandle *handle, ARegion *butregion, Button *but)
PopupBlockHandle * blender::ui::popup_block_create (bContext *C, ARegion *butregion, Button *but, BlockCreateFunc create_func, BlockHandleCreateFunc handle_create_func, void *arg, FreeArgFunc arg_free, bool can_refresh)
PopupBlockHandle * blender::ui::popup_menu_create (bContext *C, ARegion *butregion, Button *but, MenuCreateFunc menu_func, void *arg, bool can_refresh)
PopupBlockHandle * blender::ui::popover_panel_create (bContext *C, ARegion *butregion, Button *but, PopoverCreateFunc popover_func, const PanelType *panel_type)
void blender::ui::pie_menu_level_create (Block *block, wmOperatorType *ot, StringRefNull propname, IDProperty *properties, const EnumPropertyItem *items, int totitem, wm::OpCallContext context, eUI_Item_Flag flag)
void blender::ui::popup_translate (ARegion *region, const int mdiff[2])
void blender::ui::popup_block_free (bContext *C, PopupBlockHandle *handle)
void blender::ui::popup_block_scrolltest (Block *block)

Macro Definition Documentation

◆ PIE_CLICK_THRESHOLD_SQ

#define PIE_CLICK_THRESHOLD_SQ   50.0f

Definition at line 187 of file interface_intern.hh.

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

◆ PIE_MAX_ITEMS

#define PIE_MAX_ITEMS   8

The maximum number of items a radial menu (pie menu) can contain.

Definition at line 190 of file interface_intern.hh.

Referenced by blender::ui::get_radialbut_vec(), blender::ui::Layout::op_enum_items(), and blender::ui::pie_menu_level_create().

◆ PNL_HEADER

◆ RNA_ENUM_VALUE

◆ UI_BITBUT_ROW

#define UI_BITBUT_ROW ( min,
max )
Value:
(((max) >= 31 ? 0xFFFFFFFF : (1 << ((max) + 1)) - 1) - ((min) ? ((1 << (min)) - 1) : 0))
btScalar max
#define min(a, b)
Definition sort.cc:38

Definition at line 165 of file interface_intern.hh.

◆ UI_BITBUT_TEST

#define UI_BITBUT_TEST ( a,
b )
Value:
(((a) & (1 << (b))) != 0)

Definition at line 159 of file interface_intern.hh.

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

◆ UI_BITBUT_VALUE_DISABLED

#define UI_BITBUT_VALUE_DISABLED ( a,
b )
Value:
((a) & ~(1 << (b)))

Definition at line 162 of file interface_intern.hh.

◆ UI_BITBUT_VALUE_ENABLED

#define UI_BITBUT_VALUE_ENABLED ( a,
b )
Value:
((a) | (1 << (b)))

Definition at line 161 of file interface_intern.hh.

◆ UI_BITBUT_VALUE_TOGGLED

#define UI_BITBUT_VALUE_TOGGLED ( a,
b )
Value:
((a) ^ (1 << (b)))

Definition at line 160 of file interface_intern.hh.

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

◆ UI_MENU_PADDING

◆ UI_MENU_SCROLL_ARROW

#define UI_MENU_SCROLL_ARROW   (12 * UI_SCALE_FAC)

Definition at line 77 of file interface_intern.hh.

◆ UI_MENU_SCROLL_MOUSE

◆ UI_MENU_SCROLL_PAD

#define UI_MENU_SCROLL_PAD   (4 * UI_SCALE_FAC)

Definition at line 79 of file interface_intern.hh.

◆ UI_MENU_SUBMENU_PADDING

#define UI_MENU_SUBMENU_PADDING   (6 * UI_SCALE_FAC)

Some extra padding added to menus containing sub-menu icons.

Definition at line 74 of file interface_intern.hh.

Referenced by blender::ui::popup_block_position(), and blender::ui::widget_draw_text_icon().

◆ UI_MENU_WIDTH_MIN

◆ UI_PIXEL_AA_JITTER

#define UI_PIXEL_AA_JITTER   8

Definition at line 1548 of file interface_intern.hh.

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

◆ UI_POPOVER_WIDTH_UNITS

#define UI_POPOVER_WIDTH_UNITS   10

Popover width (multiplied by #U.widget_unit)

Definition at line 82 of file interface_intern.hh.

Referenced by blender::ui::popover_begin(), and blender::ui::popover_panel_create().

◆ UI_POPUP_MARGIN

◆ UI_POPUP_MENU_TOP

#define UI_POPUP_MENU_TOP   int(10 * UI_SCALE_FAC)

Margin at top of screen for popups. Note this value must be sufficient to draw a popover arrow to avoid cropping it.

Definition at line 1546 of file interface_intern.hh.

Referenced by blender::ui::block_bounds_calc_popup(), blender::ui::popup_block_clip(), blender::ui::popup_block_position(), blender::ui::popup_block_refresh(), and blender::ui::searchbox_region_layout_fn().

◆ UI_RADIAL_DIRECTION_NEXT

#define UI_RADIAL_DIRECTION_NEXT ( dir)
Value:
RadialDirection((int(dir) + 1) % (int(UI_RADIAL_NW) + 1))

Next direction (clockwise).

Definition at line 137 of file interface_intern.hh.

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

◆ UI_RADIAL_DIRECTION_PREV

#define UI_RADIAL_DIRECTION_PREV ( dir)
Value:
RadialDirection(((int(dir) + int(UI_RADIAL_NW))) % (int(UI_RADIAL_NW) + 1))

Previous direction (counter-clockwise).

Definition at line 139 of file interface_intern.hh.

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

◆ UI_RADIAL_MASK_ALL_AXIS_ALIGNED

#define UI_RADIAL_MASK_ALL_AXIS_ALIGNED
Value:
((1 << int(UI_RADIAL_N)) | (1 << int(UI_RADIAL_S)) | (1 << int(UI_RADIAL_E)) | \
(1 << int(UI_RADIAL_W)))

Definition at line 146 of file interface_intern.hh.

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

◆ UI_RADIAL_MASK_ALL_DIAGONAL

#define UI_RADIAL_MASK_ALL_DIAGONAL
Value:
((1 << int(UI_RADIAL_NE)) | (1 << int(UI_RADIAL_SE)) | (1 << int(UI_RADIAL_SW)) | \
(1 << int(UI_RADIAL_NW)))

Store a mask for diagonal directions.

Definition at line 143 of file interface_intern.hh.

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

◆ UI_TEXT_MARGIN_X

◆ USE_NUMBUTS_LR_ALIGN

#define USE_NUMBUTS_LR_ALIGN

Split number-buttons by ':' and align left/right.

Definition at line 169 of file interface_intern.hh.