Blender V4.3
interface.cc File Reference
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstring>
#include <fmt/format.h>
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_vector.hh"
#include "BLI_utildefines.h"
#include "BKE_animsys.h"
#include "BKE_context.hh"
#include "BKE_idprop.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_screen.hh"
#include "BKE_unit.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "BLF_api.hh"
#include "BLT_translation.hh"
#include "UI_abstract_view.hh"
#include "UI_interface.hh"
#include "UI_interface_icons.hh"
#include "UI_string_search.hh"
#include "UI_view2d.hh"
#include "IMB_imbuf.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_types.hh"
#include "RNA_access.hh"
#include "RNA_enum_types.hh"
#include "ED_numinput.hh"
#include "ED_screen.hh"
#include "IMB_colormanagement.hh"
#include "interface_intern.hh"

Go to the source code of this file.

Classes

struct  AutoComplete
 

Macros

#define UI_BUT_VALUE_UNSET   DBL_MAX
 
#define UI_GET_BUT_VALUE_INIT(_but, _value)
 
#define B_NOP   -1
 
#define UI_NUMBER_EVAL_ERROR_PREFIX   RPT_("Error evaluating number, see Info editor for details")
 
#define PREVIEW_TILE_PAD   (0.225f * UI_UNIT_X)
 

Functions

static void ui_def_but_rna__menu (bContext *C, uiLayout *layout, void *but_p)
 
static void ui_def_but_rna__panel_type (bContext *, uiLayout *layout, void *arg)
 
static void ui_def_but_rna__menu_type (bContext *, uiLayout *layout, void *but_p)
 
static void ui_but_free (const bContext *C, uiBut *but)
 
static bool ui_but_is_unit_radians_ex (const UnitSettings *unit, const int unit_type)
 
static bool ui_but_is_unit_radians (const uiBut *but)
 
void ui_block_to_region_fl (const ARegion *region, const uiBlock *block, float *x, float *y)
 
void ui_block_to_window_fl (const ARegion *region, const uiBlock *block, float *x, float *y)
 
void ui_block_to_window (const ARegion *region, const uiBlock *block, int *x, int *y)
 
void ui_block_to_region_rctf (const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
 
void ui_block_to_window_rctf (const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
 
float ui_block_to_window_scale (const ARegion *region, const uiBlock *block)
 
void ui_window_to_block_fl (const ARegion *region, const uiBlock *block, float *x, float *y)
 
void ui_window_to_block_rctf (const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
 
void ui_window_to_block (const ARegion *region, const uiBlock *block, int *x, int *y)
 
void ui_window_to_region (const ARegion *region, int *x, int *y)
 
void ui_window_to_region_rcti (const ARegion *region, rcti *rect_dst, const rcti *rct_src)
 
void ui_window_to_region_rctf (const ARegion *region, rctf *rect_dst, const rctf *rct_src)
 
void ui_region_to_window (const ARegion *region, int *x, int *y)
 
static void ui_update_flexible_spacing (const ARegion *region, uiBlock *block)
 
static void ui_update_window_matrix (const wmWindow *window, const ARegion *region, uiBlock *block)
 
void ui_region_winrct_get_no_margin (const ARegion *region, rcti *r_rect)
 
void UI_block_translate (uiBlock *block, float x, float y)
 
static bool ui_but_is_row_alignment_group (const uiBut *left, const uiBut *right)
 
static void ui_block_bounds_calc_text (uiBlock *block, float offset)
 
void ui_block_bounds_calc (uiBlock *block)
 
static void ui_block_bounds_calc_centered (wmWindow *window, uiBlock *block)
 
static void ui_block_bounds_calc_centered_pie (uiBlock *block)
 
static void ui_block_bounds_calc_popup (wmWindow *window, uiBlock *block, eBlockBoundsCalc bounds_calc, const int xy[2], int r_xy[2])
 
void UI_block_bounds_set_normal (uiBlock *block, int addval)
 
void UI_block_bounds_set_text (uiBlock *block, int addval)
 
void UI_block_bounds_set_popup (uiBlock *block, int addval, const int bounds_offset[2])
 
void UI_block_bounds_set_menu (uiBlock *block, int addval, const int bounds_offset[2])
 
void UI_block_bounds_set_centered (uiBlock *block, int addval)
 
void UI_block_bounds_set_explicit (uiBlock *block, int minx, int miny, int maxx, int maxy)
 
static float ui_but_get_float_precision (uiBut *but)
 
static float ui_but_get_float_step_size (uiBut *but)
 
static bool ui_but_hide_fraction (uiBut *but, double value)
 
static int ui_but_calc_float_precision (uiBut *but, double value)
 
bool ui_but_rna_equals (const uiBut *a, const uiBut *b)
 
bool ui_but_rna_equals_ex (const uiBut *but, const PointerRNA *ptr, const PropertyRNA *prop, int index)
 
static bool ui_but_equals_old (const uiBut *but, const uiBut *oldbut)
 
uiButui_but_find_old (uiBlock *block_old, const uiBut *but_new)
 
uiButui_but_find_new (uiBlock *block_new, const uiBut *but_old)
 
static bool ui_but_extra_icons_equals_old (const uiButExtraOpIcon *new_extra_icon, const uiButExtraOpIcon *old_extra_icon)
 
static uiButExtraOpIconui_but_extra_icon_find_old (const uiButExtraOpIcon *new_extra_icon, const uiBut *old_but)
 
static void ui_but_extra_icons_update_from_old_but (const uiBut *new_but, const uiBut *old_but)
 
static void ui_but_update_old_active_from_new (uiBut *oldbut, uiBut *but)
 
static bool ui_but_update_from_old_block (const bContext *C, uiBlock *block, uiBut **but_p, uiBut **but_old_p)
 
bool UI_but_active_only_ex (const bContext *C, ARegion *region, uiBlock *block, uiBut *but, const bool remove_on_failure)
 
bool UI_but_active_only (const bContext *C, ARegion *region, uiBlock *block, uiBut *but)
 
bool UI_block_active_only_flagged_buttons (const bContext *C, ARegion *region, uiBlock *block)
 
void UI_but_execute (const bContext *C, ARegion *region, uiBut *but)
 
static bool ui_but_is_rna_undo (const uiBut *but)
 
static void ui_menu_block_set_keyaccels (uiBlock *block)
 
void ui_but_add_shortcut (uiBut *but, const char *shortcut_str, const bool do_strip)
 
static void ui_menu_block_set_keymaps (const bContext *C, uiBlock *block)
 
void ui_but_override_flag (Main *bmain, uiBut *but)
 
void UI_block_update_from_old (const bContext *C, uiBlock *block)
 
static void ui_but_validate (const uiBut *but)
 
bool ui_but_context_poll_operator_ex (bContext *C, const uiBut *but, const wmOperatorCallParams *optype_params)
 
bool ui_but_context_poll_operator (bContext *C, wmOperatorType *ot, const uiBut *but)
 
void UI_block_end_ex (const bContext *C, uiBlock *block, const int xy[2], int r_xy[2])
 
void UI_block_end (const bContext *C, uiBlock *block)
 
void ui_fontscale (float *points, float aspect)
 
void ui_but_to_pixelrect (rcti *rect, const ARegion *region, const uiBlock *block, const uiBut *but)
 
rcti ui_to_pixelrect (const ARegion *region, const uiBlock *block, const rctf *src_rect)
 
static bool ui_but_pixelrect_in_view (const ARegion *region, const rcti *rect)
 
void UI_block_draw (const bContext *C, uiBlock *block)
 
static void ui_block_message_subscribe (ARegion *region, wmMsgBus *mbus, uiBlock *block)
 
void UI_region_message_subscribe (ARegion *region, wmMsgBus *mbus)
 
int ui_but_is_pushed_ex (uiBut *but, double *value)
 
int ui_but_is_pushed (uiBut *but)
 
static void ui_but_update_select_flag (uiBut *but, double *value)
 
void UI_block_lock_set (uiBlock *block, bool val, const char *lockstr)
 
void UI_block_lock_clear (uiBlock *block)
 
void ui_but_v3_get (uiBut *but, float vec[3])
 
void ui_but_v3_set (uiBut *but, const float vec[3])
 
void ui_but_v4_get (uiBut *but, float vec[4])
 
void ui_but_v4_set (uiBut *but, const float vec[4])
 
bool ui_but_is_float (const uiBut *but)
 
PropertyScaleType ui_but_scale_type (const uiBut *but)
 
bool ui_but_is_bool (const uiBut *but)
 
bool ui_but_is_unit (const uiBut *but)
 
bool ui_but_is_compatible (const uiBut *but_a, const uiBut *but_b)
 
bool ui_but_is_rna_valid (uiBut *but)
 
bool ui_but_supports_cycling (const uiBut *but)
 
double ui_but_value_get (uiBut *but)
 
void ui_but_value_set (uiBut *but, double value)
 
int ui_but_string_get_maxncpy (uiBut *but)
 
uiButui_but_drag_multi_edit_get (uiBut *but)
 
static double ui_get_but_scale_unit (uiBut *but, double value)
 
void ui_but_convert_to_unit_alt_name (uiBut *but, char *str, size_t str_maxncpy)
 
static void ui_get_but_string_unit (uiBut *but, char *str, int str_maxncpy, double value, bool pad, int float_precision)
 
static float ui_get_but_step_unit (uiBut *but, float step_default)
 
void ui_but_string_get_ex (uiBut *but, char *str, const size_t str_maxncpy, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
 
void ui_but_string_get (uiBut *but, char *str, const size_t str_maxncpy)
 
char * ui_but_string_get_dynamic (uiBut *but, int *r_str_size)
 
static bool ui_number_from_string_units (bContext *C, const char *str, const int unit_type, const UnitSettings *unit, double *r_value)
 
static bool ui_number_from_string_units_with_but (bContext *C, const char *str, const uiBut *but, double *r_value)
 
static bool ui_number_from_string (bContext *C, const char *str, double *r_value)
 
static bool ui_number_from_string_factor (bContext *C, const char *str, double *r_value)
 
static bool ui_number_from_string_percentage (bContext *C, const char *str, double *r_value)
 
bool ui_but_string_eval_number (bContext *C, const uiBut *but, const char *str, double *r_value)
 
bool ui_but_string_set (bContext *C, uiBut *but, const char *str)
 
static double soft_range_round_up (double value, double max)
 
static double soft_range_round_down (double value, double max)
 
void ui_but_range_set_hard (uiBut *but)
 
void ui_but_range_set_soft (uiBut *but)
 
static void ui_but_free_type_specific (uiBut *but)
 
static void ui_but_mem_delete (const uiBut *but)
 
static void ui_block_free_active_operator (uiBlock *block)
 
void UI_block_set_active_operator (uiBlock *block, wmOperator *op, const bool free)
 
void UI_block_free (const bContext *C, uiBlock *block)
 
void UI_block_listen (const uiBlock *block, const wmRegionListenerParams *listener_params)
 
void UI_blocklist_update_window_matrix (const bContext *C, const ListBase *lb)
 
void UI_blocklist_update_view_for_buttons (const bContext *C, const ListBase *lb)
 
void UI_blocklist_draw (const bContext *C, const ListBase *lb)
 
void UI_blocklist_free (const bContext *C, ARegion *region)
 
void UI_blocklist_free_inactive (const bContext *C, ARegion *region)
 
void UI_block_region_set (uiBlock *block, ARegion *region)
 
uiBlockUI_block_begin (const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
 
void ui_block_add_dynamic_listener (uiBlock *block, void(*listener_func)(const wmRegionListenerParams *params))
 
eUIEmbossType UI_block_emboss_get (uiBlock *block)
 
void UI_block_emboss_set (uiBlock *block, eUIEmbossType emboss)
 
void UI_block_theme_style_set (uiBlock *block, char theme_style)
 
bool UI_block_is_search_only (const uiBlock *block)
 
void UI_block_set_search_only (uiBlock *block, bool search_only)
 
static void ui_but_build_drawstr_float (uiBut *but, double value)
 
static void ui_but_build_drawstr_int (uiBut *but, int value)
 
static void ui_but_update_ex (uiBut *but, const bool validate)
 
void ui_but_update (uiBut *but)
 
void ui_but_update_edited (uiBut *but)
 
void UI_block_align_begin (uiBlock *block)
 
void UI_block_align_end (uiBlock *block)
 
ColorManagedDisplayui_block_cm_display_get (uiBlock *block)
 
void ui_block_cm_to_display_space_v3 (uiBlock *block, float pixel[3])
 
static uiButui_but_new (const eButType type)
 
uiButui_but_change_type (uiBut *but, eButType new_type)
 
static uiButui_def_but (uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
 
void ui_def_but_icon (uiBut *but, const int icon, const int flag)
 
void ui_def_but_icon_clear (uiBut *but)
 
void ui_but_rna_menu_convert_to_panel_type (uiBut *but, const char *panel_type)
 
bool ui_but_menu_draw_as_popover (const uiBut *but)
 
void ui_but_rna_menu_convert_to_menu_type (uiBut *but, const char *menu_type)
 
static void ui_but_submenu_enable (uiBlock *block, uiBut *but)
 
static uiButui_def_but_rna (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
 
static uiButui_def_but_rna_propname (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
 
static uiButui_def_but_operator_ptr (uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, const StringRef str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefBut (uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
 
uiButuiDefButImage (uiBlock *block, void *imbuf, int x, int y, short width, short height, const uchar color[4])
 
uiButuiDefButAlert (uiBlock *block, int icon, int x, int y, short width, short)
 
static int findBitIndex (uint x)
 
AutoCompleteUI_autocomplete_begin (const char *startname, size_t maxncpy)
 
void UI_autocomplete_update_name (AutoComplete *autocpl, const char *name)
 
int UI_autocomplete_end (AutoComplete *autocpl, char *autoname)
 
int UI_preview_tile_size_x (const int size_px)
 
int UI_preview_tile_size_y (const int size_px)
 
int UI_preview_tile_size_y_no_label (const int size_px)
 
static void ui_but_update_and_icon_set (uiBut *but, int icon)
 
static uiButuiDefButBit (uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
 
uiButuiDefButF (uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, float *poin, float min, float max, const char *tip)
 
uiButuiDefButI (uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
 
uiButuiDefButBitI (uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
 
uiButuiDefButS (uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
 
uiButuiDefButBitS (uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
 
uiButuiDefButC (uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, char *poin, float min, float max, const char *tip)
 
uiButuiDefButBitC (uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, char *poin, float min, float max, const char *tip)
 
uiButuiDefButR (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
 
uiButuiDefButR_prop (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
 
uiButuiDefButO_ptr (uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, const StringRef str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefButO (uiBlock *block, int type, const char *opname, wmOperatorCallContext opcontext, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconBut (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
 
static uiButuiDefIconButBit (uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
 
uiButuiDefIconButI (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
 
uiButuiDefIconButBitI (uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
 
uiButuiDefIconButS (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
 
uiButuiDefIconButBitS (uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
 
uiButuiDefIconButBitC (uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, const char *tip)
 
uiButuiDefIconButR (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
 
uiButuiDefIconButR_prop (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
 
uiButuiDefIconButO_ptr (uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconButO (uiBlock *block, int type, const char *opname, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconTextBut (uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
 
uiButuiDefIconTextButI (uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
 
uiButuiDefIconTextButR (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
 
uiButuiDefIconTextButR_prop (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
 
uiButuiDefIconTextButO_ptr (uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconTextButO (uiBlock *block, int type, const char *opname, wmOperatorCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const char *tip)
 
void UI_but_operator_set (uiBut *but, wmOperatorType *optype, wmOperatorCallContext opcontext, const PointerRNA *opptr)
 
void UI_but_operator_set_never_call (uiBut *but)
 
int UI_blocklist_min_y_get (ListBase *lb)
 
void UI_block_direction_set (uiBlock *block, char direction)
 
void UI_block_flag_enable (uiBlock *block, int flag)
 
void UI_block_flag_disable (uiBlock *block, int flag)
 
void UI_but_flag_enable (uiBut *but, int flag)
 
void UI_but_flag2_enable (uiBut *but, int flag)
 
void UI_but_flag_disable (uiBut *but, int flag)
 
bool UI_but_flag_is_set (uiBut *but, int flag)
 
void UI_but_drawflag_enable (uiBut *but, int flag)
 
void UI_but_drawflag_disable (uiBut *but, int flag)
 
void UI_but_dragflag_enable (uiBut *but, int flag)
 
void UI_but_dragflag_disable (uiBut *but, int flag)
 
void UI_but_disable (uiBut *but, const char *disabled_hint)
 
void UI_but_color_set (uiBut *but, const uchar color[4])
 
void UI_but_placeholder_set (uiBut *but, const char *placeholder_text)
 
const char * ui_but_placeholder_get (uiBut *but)
 
void UI_but_type_set_menu_from_pulldown (uiBut *but)
 
int UI_but_return_value_get (uiBut *but)
 
PointerRNAUI_but_operator_ptr_ensure (uiBut *but)
 
void UI_but_context_ptr_set (uiBlock *block, uiBut *but, const char *name, const PointerRNA *ptr)
 
const PointerRNAUI_but_context_ptr_get (const uiBut *but, const char *name, const StructRNA *type)
 
std::optional< blender::StringRefNullUI_but_context_string_get (const uiBut *but, const char *name)
 
const bContextStoreUI_but_context_get (const uiBut *but)
 
void UI_but_unit_type_set (uiBut *but, const int unit_type)
 
int UI_but_unit_type_get (const uiBut *but)
 
void UI_block_func_handle_set (uiBlock *block, uiBlockHandleFunc func, void *arg)
 
void UI_block_func_set (uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2)
 
void UI_block_funcN_set (uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
 
void UI_but_func_rename_set (uiBut *but, uiButHandleRenameFunc func, void *arg1)
 
void UI_but_func_rename_full_set (uiBut *but, std::function< void(std::string &new_name)> rename_full_func)
 
void UI_but_func_drawextra_set (uiBlock *block, std::function< void(const bContext *C, rcti *rect)> func)
 
void UI_but_func_set (uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
 
void UI_but_func_set (uiBut *but, std::function< void(bContext &)> func)
 
void UI_but_funcN_set (uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
 
void UI_but_func_complete_set (uiBut *but, uiButCompleteFunc func, void *arg)
 
void UI_but_func_menu_step_set (uiBut *but, uiMenuStepFunc func)
 
void UI_but_func_tooltip_label_set (uiBut *but, std::function< std::string(const uiBut *but)> func)
 
void UI_but_func_tooltip_set (uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
 
void UI_but_func_tooltip_custom_set (uiBut *but, uiButToolTipCustomFunc func, void *arg, uiFreeArgFunc free_arg)
 
void UI_but_func_pushed_state_set (uiBut *but, std::function< bool(const uiBut &)> func)
 
uiButuiDefBlockBut (uiBlock *block, uiBlockCreateFunc func, void *arg, const StringRef str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefBlockButN (uiBlock *block, uiBlockCreateFunc func, void *argN, const StringRef str, int x, int y, short width, short height, const char *tip, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
 
uiButuiDefMenuBut (uiBlock *block, uiMenuCreateFunc func, void *arg, const StringRef str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconTextMenuBut (uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const StringRef str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconMenuBut (uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconBlockBut (uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x, int y, short width, short height, const char *tip)
 
uiButuiDefSearchBut (uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, const char *tip)
 
void UI_but_func_search_set (uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, const bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
 
void UI_but_func_search_set_context_menu (uiBut *but, uiButSearchContextMenuFn context_menu_fn)
 
void UI_but_func_search_set_sep_string (uiBut *but, const char *search_sep_string)
 
void UI_but_func_search_set_tooltip (uiBut *but, uiButSearchTooltipFn tooltip_fn)
 
void UI_but_func_search_set_listen (uiBut *but, uiButSearchListenFn listen_fn)
 
void UI_but_func_search_set_results_are_suggestions (uiBut *but, const bool value)
 
static void operator_enum_search_update_fn (const bContext *C, void *but, const char *str, uiSearchItems *items, const bool)
 
static void operator_enum_search_exec_fn (bContext *, void *but, void *arg2)
 
uiButuiDefSearchButO_ptr (uiBlock *block, wmOperatorType *ot, IDProperty *properties, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, const char *tip)
 
void UI_but_hint_drawstr_set (uiBut *but, const char *string)
 
void UI_but_icon_indicator_number_set (uiBut *but, const int indicator_number)
 
void UI_but_icon_indicator_set (uiBut *but, const char *string)
 
void UI_but_icon_indicator_color_set (uiBut *but, const uchar color[4])
 
void UI_but_node_link_set (uiBut *but, bNodeSocket *socket, const float draw_color[4])
 
void UI_but_number_step_size_set (uiBut *but, float step_size)
 
void UI_but_number_precision_set (uiBut *but, float precision)
 
void UI_but_number_slider_step_size_set (uiBut *but, float step_size)
 
void UI_but_number_slider_precision_set (uiBut *but, float precision)
 
void UI_but_label_alpha_factor_set (uiBut *but, const float alpha_factor)
 
void UI_but_search_preview_grid_size_set (uiBut *but, int rows, int cols)
 
void UI_but_view_item_draw_size_set (uiBut *but, const std::optional< int > draw_width, const std::optional< int > draw_height)
 
void UI_but_focus_on_enter_event (wmWindow *win, uiBut *but)
 
void UI_but_func_hold_set (uiBut *but, uiButHandleHoldFunc func, void *argN)
 
std::optional< EnumPropertyItemUI_but_rna_enum_item_get (bContext &C, uiBut &but)
 
std::string UI_but_string_get_rna_property_identifier (const uiBut &but)
 
std::string UI_but_string_get_rna_struct_identifier (const uiBut &but)
 
std::string UI_but_string_get_label (uiBut &but)
 
std::string UI_but_context_menu_title_from_button (uiBut &but)
 
std::string UI_but_string_get_tooltip_label (const uiBut &but)
 
std::string UI_but_string_get_rna_label (uiBut &but)
 
std::string UI_but_string_get_rna_label_context (const uiBut &but)
 
std::string UI_but_string_get_tooltip (bContext &C, uiBut &but)
 
std::string UI_but_string_get_rna_tooltip (bContext &C, uiBut &but)
 
std::string UI_but_string_get_operator_keymap (bContext &C, uiBut &but)
 
std::string UI_but_string_get_property_keymap (bContext &C, uiBut &but)
 
std::string UI_but_extra_icon_string_get_label (const uiButExtraOpIcon &extra_icon)
 
std::string UI_but_extra_icon_string_get_tooltip (bContext &C, const uiButExtraOpIcon &extra_icon)
 
std::string UI_but_extra_icon_string_get_operator_keymap (const bContext &C, const uiButExtraOpIcon &extra_icon)
 
void UI_init ()
 
void UI_init_userdef ()
 
void UI_reinit_font ()
 
void UI_update_text_styles ()
 
void UI_exit ()
 
void UI_interface_tag_script_reload ()
 
Find Key Shortcut for Button
static std::optional< std::string > ui_but_event_operator_string_from_operator (const bContext *C, wmOperatorCallParams *op_call_params)
 
static std::optional< std::string > ui_but_event_operator_string_from_menu (const bContext *C, uiBut *but)
 
static std::optional< std::string > ui_but_event_operator_string_from_panel (const bContext *C, uiBut *but)
 
static std::optional< std::string > ui_but_event_operator_string (const bContext *C, uiBut *but)
 
static std::optional< std::string > ui_but_extra_icon_event_operator_string (const bContext *C, const uiButExtraOpIcon *extra_icon)
 
static std::optional< std::string > ui_but_event_property_operator_string (const bContext *C, uiBut *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).

enum  PredefinedExtraOpIconType { PREDEFINED_EXTRA_OP_ICON_NONE = 1 , PREDEFINED_EXTRA_OP_ICON_CLEAR , PREDEFINED_EXTRA_OP_ICON_EYEDROPPER , PREDEFINED_EXTRA_OP_ICON_BONE_EYEDROPPER }
 
static PointerRNAui_but_extra_operator_icon_add_ptr (uiBut *but, wmOperatorType *optype, wmOperatorCallContext opcontext, int icon)
 
static void ui_but_extra_operator_icon_free (uiButExtraOpIcon *extra_icon)
 
void ui_but_extra_operator_icons_free (uiBut *but)
 
PointerRNAUI_but_extra_operator_icon_add (uiBut *but, const char *opname, wmOperatorCallContext opcontext, int icon)
 
wmOperatorTypeUI_but_extra_operator_icon_optype_get (const uiButExtraOpIcon *extra_icon)
 
PointerRNAUI_but_extra_operator_icon_opptr_get (const uiButExtraOpIcon *extra_icon)
 
static bool ui_but_icon_extra_is_visible_text_clear (const uiBut *but)
 
static bool ui_but_icon_extra_is_visible_search_unlink (const uiBut *but)
 
static bool ui_but_icon_extra_is_visible_search_eyedropper (uiBut *but)
 
static bool ui_but_icon_extra_is_visible_bone_eyedropper (uiBut *but)
 
static PredefinedExtraOpIconType ui_but_icon_extra_get (uiBut *but)
 
static void ui_but_predefined_extra_operator_icons_add (uiBut *but)
 

Pie Menu Direction

This goes in a seemingly weird pattern:

    4
 5     6
1       2
 7     8
    3

but it's actually quite logical. It's designed to be 'upwards compatible' for muscle memory so that the menu item locations are fixed and don't move as new items are added to the menu later on. It also optimizes efficiency - a radial menu is best kept symmetrical, with as large an angle between items as possible, so that the gestural mouse movements can be fast and inexact.

It starts off with two opposite sides for the first two items then joined by the one below for the third (this way, even with three items, the menu seems to still be 'in order' reading left to right). Then the fourth is added to complete the compass directions. From here, it's just a matter of subdividing the rest of the angles for the last 4 items.

–Matt 07/2006

const char ui_radial_dir_order [8]
 
const char ui_radial_dir_to_numpad [8] = {8, 9, 6, 3, 2, 1, 4, 7}
 
const short ui_radial_dir_to_angle [8] = {90, 45, 0, 315, 270, 225, 180, 135}
 
static std::string ui_but_pie_direction_string (const uiBut *but)
 

Macro Definition Documentation

◆ B_NOP

#define B_NOP   -1

Definition at line 90 of file interface.cc.

Referenced by ui_def_but_rna__menu().

◆ PREVIEW_TILE_PAD

#define PREVIEW_TILE_PAD   (0.225f * UI_UNIT_X)

◆ UI_BUT_VALUE_UNSET

#define UI_BUT_VALUE_UNSET   DBL_MAX

Definition at line 83 of file interface.cc.

Referenced by ui_but_is_pushed(), ui_but_update_ex(), and ui_but_value_set().

◆ UI_GET_BUT_VALUE_INIT

#define UI_GET_BUT_VALUE_INIT ( _but,
_value )
Value:
if (_value == DBL_MAX) { \
(_value) = ui_but_value_get(_but); \
} \
((void)0)
double ui_but_value_get(uiBut *but)

Definition at line 84 of file interface.cc.

Referenced by ui_but_is_pushed_ex(), and ui_but_update_ex().

◆ UI_NUMBER_EVAL_ERROR_PREFIX

#define UI_NUMBER_EVAL_ERROR_PREFIX   RPT_("Error evaluating number, see Info editor for details")

Report a generic error prefix when evaluating a string with BPY_run_string_as_number as the Python error on its own doesn't provide enough context.

Definition at line 3093 of file interface.cc.

Referenced by ui_number_from_string(), and ui_number_from_string_units().

Enumeration Type Documentation

◆ PredefinedExtraOpIconType

Predefined types for generic extra operator icons (uiButExtraOpIcon).

Enumerator
PREDEFINED_EXTRA_OP_ICON_NONE 
PREDEFINED_EXTRA_OP_ICON_CLEAR 
PREDEFINED_EXTRA_OP_ICON_EYEDROPPER 
PREDEFINED_EXTRA_OP_ICON_BONE_EYEDROPPER 

Definition at line 1618 of file interface.cc.

Function Documentation

◆ findBitIndex()

static int findBitIndex ( uint x)
static

if _x_ is a power of two (only one bit) return the power, otherwise return -1.

for powers of two:

((1 << findBitIndex(x)) == x);
static int findBitIndex(uint x)

Definition at line 5032 of file interface.cc.

References is_power_of_2_i().

Referenced by uiDefButBit(), and uiDefIconButBit().

◆ operator_enum_search_exec_fn()

static void operator_enum_search_exec_fn ( bContext * ,
void * but,
void * arg2 )
static

◆ operator_enum_search_update_fn()

◆ soft_range_round_down()

static double soft_range_round_down ( double value,
double max )
static

Definition at line 3343 of file interface.cc.

References floor(), log(), M_LN10, and pow().

Referenced by ui_but_range_set_soft().

◆ soft_range_round_up()

static double soft_range_round_up ( double value,
double max )
static

Definition at line 3328 of file interface.cc.

References ceil(), log(), M_LN10, and pow().

Referenced by ui_but_range_set_soft().

◆ UI_autocomplete_begin()

AutoComplete * UI_autocomplete_begin ( const char * startname,
size_t maxncpy )

◆ UI_autocomplete_end()

◆ UI_autocomplete_update_name()

void UI_autocomplete_update_name ( AutoComplete * autocpl,
const char * name )

◆ UI_block_active_only_flagged_buttons()

bool UI_block_active_only_flagged_buttons ( const bContext * C,
ARegion * region,
uiBlock * block )
Warning
This must run after other handlers have been added, otherwise the handler won't be removed, see: #71112.

Definition at line 1079 of file interface.cc.

References BLI_assert, uiBlock::buttons, uiBlock::endblock, LISTBASE_FOREACH, UI_BUT_ACTIVATE_ON_INIT, UI_but_active_only_ex(), and ui_but_is_editable().

Referenced by UI_popover_panel_invoke(), UI_popup_block_ex(), and UI_popup_block_invoke_ex().

◆ ui_block_add_dynamic_listener()

void ui_block_add_dynamic_listener ( uiBlock * block,
void(* listener_func )(const wmRegionListenerParams *params) )

Register a listener callback to this block to tag the area/region for redraw.

Definition at line 3834 of file interface.cc.

References BLI_addtail(), uiBlock::dynamic_listeners, uiBlockDynamicListener::listener_func, and MEM_mallocN.

Referenced by UI_menutype_draw(), and ui_paneltype_draw_impl().

◆ UI_block_align_begin()

◆ UI_block_align_end()

◆ UI_block_begin()

uiBlock * UI_block_begin ( const bContext * C,
ARegion * region,
std::string name,
eUIEmbossType emboss )

Definition at line 3789 of file interface.cc.

References uiBlock::active, uiBlock::auto_open, CTX_data_scene(), CTX_wm_window(), uiBlock::display_device, uiBlock::emboss, uiBlock::evil_C, uiBlock::flag, IMB_colormanagement_display_get_default_name(), uiBlock::name, STRNCPY, UI_BLOCK_LOOP, UI_block_region_set(), ui_update_window_matrix(), and uiBlock::unit.

Referenced by block_create__close_file_dialog(), block_create_autorun_warning(), block_create_gpu_backend_fallback(), block_create_opengl_usage_warning(), block_create_save_file_overwrite_dialog(), clip_draw_dopesheet_channels(), colorband_tools_fn(), component_menu(), blender::ed::space_node::create_search_popup_block(), curve_profile_presets_fn(), curve_profile_tools_fn(), curvemap_clipping_func(), curvemap_tools_func(), blender::ed::spreadsheet::draw_cell_contents(), draw_channel_headers(), draw_channel_names(), blender::ed::spreadsheet::draw_left_column_content(), draw_nla_track_list(), blender::ed::outliner::draw_outliner(), blender::ed::spreadsheet::draw_top_row_content(), blender::ed::space_node::draw_tree_path(), ed_panel_draw(), ED_region_header_layout(), ED_time_scrub_channel_search_draw(), file_draw_invalid_asset_library_hint(), file_draw_list(), graph_draw_channel_names(), menu_add_shortcut(), menu_change_shortcut(), menu_items_from_ui_create(), blender::ed::outliner::merged_element_search_menu(), blender::ed::space_node::node_find_menu(), blender::ed::space_node::node_uiblocks_init(), panel_property_search(), blender::ed::asset::shelf::region_layout(), blender::ed::spreadsheet::spreadsheet_footer_region_draw(), template_common_search_menu(), ui_block_func_COLOR(), ui_icon_view_menu_cb(), UI_pie_menu_begin(), ui_popover_create_block(), ui_popup_menu_create_block(), wm_block_about_create(), wm_block_create_redo(), wm_block_dialog_create(), wm_block_insert_unicode_create(), wm_block_search_menu(), wm_block_splash_create(), wm_enum_search_menu(), and wm_operator_ui_create().

◆ ui_block_bounds_calc()

◆ ui_block_bounds_calc_centered()

static void ui_block_bounds_calc_centered ( wmWindow * window,
uiBlock * block )
static

◆ ui_block_bounds_calc_centered_pie()

static void ui_block_bounds_calc_centered_pie ( uiBlock * block)
static

◆ ui_block_bounds_calc_popup()

◆ ui_block_bounds_calc_text()

◆ UI_block_bounds_set_centered()

◆ UI_block_bounds_set_explicit()

void UI_block_bounds_set_explicit ( uiBlock * block,
int minx,
int miny,
int maxx,
int maxy )

◆ UI_block_bounds_set_menu()

void UI_block_bounds_set_menu ( uiBlock * block,
int addval,
const int bounds_offset[2] )

◆ UI_block_bounds_set_normal()

◆ UI_block_bounds_set_popup()

◆ UI_block_bounds_set_text()

void UI_block_bounds_set_text ( uiBlock * block,
int addval )

◆ ui_block_cm_display_get()

◆ ui_block_cm_to_display_space_v3()

void ui_block_cm_to_display_space_v3 ( uiBlock * block,
float pixel[3] )

◆ UI_block_direction_set()

◆ UI_block_draw()

void UI_block_draw ( const bContext * C,
uiBlock * block )

Uses local copy of style, to scale things down, and allow widgets to change stuff.

Definition at line 2064 of file interface.cc.

References uiBlock::aspect, BLF_batch_draw_begin(), BLF_batch_draw_end(), Panel_Runtime::block, uiBlock::buttons, CTX_wm_region(), CTX_wm_region_popup(), ELEM, uiBlock::endblock, uiBlock::flag, GPU_blend(), GPU_BLEND_ALPHA, GPU_matrix_identity_set(), GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_matrix_push(), GPU_matrix_push_projection(), uiStyle::grouplabel, LISTBASE_FOREACH, uiBlock::panel, ThemeUI::panel_roundness, uiStyle::paneltitle, uiFontStyle::points, RGN_FLAG_SEARCH_FILTER_ACTIVE, RGN_TYPE_HUD, RGN_TYPE_TEMPORARY, Panel::runtime, uiStyle::tooltip, bTheme::tui, Panel::type, UI_block_end(), UI_BLOCK_LOOP, UI_BLOCK_PIE_MENU, UI_BLOCK_POPOVER, ui_block_views_draw_overlays(), ui_but_pixelrect_in_view(), ui_but_to_pixelrect(), ui_draw_aligned_panel(), ui_draw_but(), ui_draw_layout_panels_backdrop(), ui_draw_menu_back(), ui_draw_pie_center(), ui_draw_popover_back(), ui_fontscale(), UI_GetTheme(), UI_HIDDEN, UI_panel_category_is_visible(), UI_panel_should_show_background(), UI_SCROLLED, UI_style_get_dpi(), UI_widgetbase_draw_cache_begin(), UI_widgetbase_draw_cache_end(), uiStyle::widget, wmOrtho2_region_pixelspace(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.

Referenced by clip_draw_dopesheet_channels(), blender::ed::spreadsheet::draw_cell_contents(), draw_channel_headers(), draw_channel_names(), blender::ed::spreadsheet::draw_left_column_content(), draw_nla_track_list(), blender::ed::outliner::draw_outliner(), blender::ed::spreadsheet::draw_top_row_content(), blender::ed::space_node::draw_tree_path(), ED_time_scrub_channel_search_draw(), file_draw_invalid_asset_library_hint(), file_draw_list(), blender::ed::space_node::frame_node_draw_overlay(), graph_draw_channel_names(), blender::ed::space_node::node_draw_basis(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::reroute_node_draw(), blender::ed::spreadsheet::spreadsheet_footer_region_draw(), ui_block_region_draw(), UI_blocklist_draw(), and UI_panels_draw().

◆ UI_block_emboss_get()

◆ UI_block_emboss_set()

void UI_block_emboss_set ( uiBlock * block,
eUIEmbossType emboss )

Definition at line 3848 of file interface.cc.

References uiBlock::emboss.

Referenced by ANIM_channel_draw_widgets(), blender::ed::asset::shelf::asset_shelf_header_draw(), block_create_autorun_warning(), block_create_gpu_backend_fallback(), block_create_opengl_usage_warning(), blender::ui::TreeViewLayoutBuilder::build_row(), clip_draw_dopesheet_channels(), colorband_buttons_layout(), curvemap_buttons_layout(), CurveProfile_buttons_layout(), draw_channel_labels(), draw_channel_widget_lock(), draw_channel_widget_mute(), draw_constraint_header(), draw_grease_pencil_layer_widgets(), blender::ed::outliner::draw_outliner(), graph_draw_driver_settings_panel(), nla_panel_stripname(), blender::ed::space_node::node_add_error_message_button(), blender::ed::space_node::node_add_unsupported_compositor_operation_error_message_button(), blender::ed::space_node::node_draw_basis(), blender::ed::space_node::node_draw_extra_info_row(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::node_draw_panels(), blender::ed::space_node::node_draw_panels_background(), blender::ed::space_node::node_file_output_socket_draw(), blender::ed::space_node::node_socket_tooltip_set(), blender::ed::outliner::outliner_draw_mode_column_toggle(), blender::ed::outliner::outliner_draw_warning_tree_element(), template_keymap_item_properties(), blender::ed::space_node::ui_node_draw_input(), blender::ed::space_node::ui_node_draw_panel(), ui_template_list_layout_draw(), uiTemplateReportsBanner(), uiTemplateStatusInfo(), and wm_block_splash_add_label().

◆ UI_block_end()

◆ UI_block_end_ex()

void UI_block_end_ex ( const bContext * C,
uiBlock * block,
const int xy[2],
int r_xy[2] )

◆ UI_block_flag_disable()

void UI_block_flag_disable ( uiBlock * block,
int flag )

◆ UI_block_flag_enable()

◆ UI_block_free()

◆ ui_block_free_active_operator()

static void ui_block_free_active_operator ( uiBlock * block)
static

◆ UI_block_func_handle_set()

◆ UI_block_func_set()

◆ UI_block_funcN_set()

void UI_block_funcN_set ( uiBlock * block,
uiButHandleNFunc funcN,
void * argN,
void * arg2,
uiButArgNFree func_argN_free_fn,
uiButArgNCopy func_argN_copy_fn )

◆ UI_block_is_search_only()

bool UI_block_is_search_only ( const uiBlock * block)

Definition at line 3858 of file interface.cc.

References uiBlock::flag, and UI_BLOCK_SEARCH_ONLY.

Referenced by UI_panels_draw().

◆ UI_block_listen()

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

Definition at line 3680 of file interface.cc.

References uiBlock::dynamic_listeners, LISTBASE_FOREACH, and ui_block_views_listen().

Referenced by ED_region_do_listen().

◆ UI_block_lock_clear()

◆ UI_block_lock_set()

◆ ui_block_message_subscribe()

◆ UI_block_region_set()

◆ UI_block_set_active_operator()

void UI_block_set_active_operator ( uiBlock * block,
wmOperator * op,
const bool free )

◆ UI_block_set_search_only()

void UI_block_set_search_only ( uiBlock * block,
bool search_only )

Use when a block must be searched to give accurate results for the whole region but shouldn't be displayed.

Definition at line 3863 of file interface.cc.

References uiBlock::flag, SET_FLAG_FROM_TEST, and UI_BLOCK_SEARCH_ONLY.

Referenced by panel_property_search(), and panel_remove_invisible_layouts_recursive().

◆ UI_block_theme_style_set()

◆ ui_block_to_region_fl()

void ui_block_to_region_fl ( const ARegion * region,
const uiBlock * block,
float * x,
float * y )

◆ ui_block_to_region_rctf()

void ui_block_to_region_rctf ( const ARegion * region,
const uiBlock * block,
rctf * rct_dst,
const rctf * rct_src )

Definition at line 153 of file interface.cc.

References ui_block_to_region_fl(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ui_but_rect_to_view().

◆ ui_block_to_window()

void ui_block_to_window ( const ARegion * region,
const uiBlock * block,
int * x,
int * y )

Definition at line 142 of file interface.cc.

References int, ui_block_to_window_fl(), x, and y.

◆ ui_block_to_window_fl()

◆ ui_block_to_window_rctf()

◆ ui_block_to_window_scale()

float ui_block_to_window_scale ( const ARegion * region,
const uiBlock * block )

Definition at line 173 of file interface.cc.

References ui_block_to_window_fl().

Referenced by ui_but_drag_init().

◆ UI_block_translate()

◆ UI_block_update_from_old()

◆ UI_blocklist_draw()

void UI_blocklist_draw ( const bContext * C,
const ListBase * lb )

◆ UI_blocklist_free()

void UI_blocklist_free ( const bContext * C,
ARegion * region )

◆ UI_blocklist_free_inactive()

void UI_blocklist_free_inactive ( const bContext * C,
ARegion * region )

◆ UI_blocklist_min_y_get()

int UI_blocklist_min_y_get ( ListBase * lb)

Definition at line 5877 of file interface.cc.

References ListBase::first, LISTBASE_FOREACH, min, uiBlock::rect, and rctf::ymin.

◆ UI_blocklist_update_view_for_buttons()

void UI_blocklist_update_view_for_buttons ( const bContext * C,
const ListBase * lb )

Definition at line 3704 of file interface.cc.

References LISTBASE_FOREACH, and ui_but_update_view_for_active().

Referenced by ED_region_panels_layout_ex().

◆ UI_blocklist_update_window_matrix()

◆ UI_but_active_only()

◆ UI_but_active_only_ex()

bool UI_but_active_only_ex ( const bContext * C,
ARegion * region,
uiBlock * block,
uiBut * but,
bool remove_on_failure )

Special button case, only draw it when used actively, for outliner etc.

Needed for temporarily rename buttons, such as in outliner or file-select, they should keep calling uiDefBut to keep them alive.

Returns
false when button removed.

Definition at line 1032 of file interface.cc.

References activate(), uiBut::active, BLI_remlink(), uiBlock::buttons, uiBut::layout, uiBlock::oldblock, ui_but_activate_event(), ui_but_active_free(), ui_but_find_old(), ui_but_free(), ui_layout_remove_but(), and ui_region_find_active_but().

Referenced by UI_block_active_only_flagged_buttons(), and UI_but_active_only().

◆ ui_but_add_shortcut()

void ui_but_add_shortcut ( uiBut * but,
const char * shortcut_str,
const bool do_strip )

◆ ui_but_build_drawstr_float()

◆ ui_but_build_drawstr_int()

static void ui_but_build_drawstr_int ( uiBut * but,
int value )
static

◆ ui_but_calc_float_precision()

◆ ui_but_change_type()

uiBut * ui_but_change_type ( uiBut * but,
eButType new_type )

Reallocate the button (new address is returned) for a new button type. This should generally be avoided and instead the correct type be created right away.

Note
Only the uiBut data can be kept. If the old button used a derived type (e.g. uiButTab), the data that is not inside uiBut will be lost.

Definition at line 4204 of file interface.cc.

References BLI_assert, BLI_insertlinkafter(), BLI_remlink(), uiBut::block, uiBlock::buttons, uiBut::layout, uiBut::poin, uiBut::prev, uiBut::type, ui_but_mem_delete(), ui_but_new(), ui_button_group_replace_but_ptr(), UI_editsource_but_replace(), UI_editsource_enable_check(), ui_layout_replace_but_ptr(), uiLayoutGetBlock(), and UNUSED_VARS_NDEBUG.

Referenced by ui_but_add_search(), ui_item_array(), and uiItemFullR().

◆ UI_but_color_set()

void UI_but_color_set ( uiBut * but,
const uchar color[4] )

Sets the button's color, normally only used to recolor the icon. In the special case of UI_BTYPE_LABEL without icon this is used as text color.

Definition at line 5957 of file interface.cc.

References uiBut::col, and copy_v4_v4_uchar().

Referenced by wm_block_splash_add_label().

◆ UI_but_context_get()

const bContextStore * UI_but_context_get ( const uiBut * but)

Definition at line 6035 of file interface.cc.

References uiBut::context.

Referenced by blender::ed::asset::shelf::context(), and wm_drop_ui_context_create().

◆ UI_but_context_menu_title_from_button()

◆ ui_but_context_poll_operator()

bool ui_but_context_poll_operator ( bContext * C,
wmOperatorType * ot,
const uiBut * but )

◆ ui_but_context_poll_operator_ex()

bool ui_but_context_poll_operator_ex ( bContext * C,
const uiBut * but,
const wmOperatorCallParams * optype_params )

Check if the operator ot poll is successful with the context given by but (optionally).

Parameters
butThe button that might store context. Can be NULL for convenience (e.g. if there is no button to take context from, but we still want to poll the operator).

Definition at line 1877 of file interface.cc.

References BLI_assert_msg, uiBut::context, CTX_store_set(), flag, uiBut::flag, wmOperatorCallParams::opcontext, wmOperatorCallParams::optype, result, UI_BUT_ACTIVE_OVERRIDE, and WM_operator_poll_context().

Referenced by UI_block_end_ex(), ui_but_context_poll_operator(), and ui_tooltip_data_from_button_or_extra_icon().

◆ UI_but_context_ptr_get()

const PointerRNA * UI_but_context_ptr_get ( const uiBut * but,
const char * name,
const StructRNA * type )

◆ UI_but_context_ptr_set()

void UI_but_context_ptr_set ( uiBlock * block,
uiBut * but,
const char * name,
const PointerRNA * ptr )

◆ UI_but_context_string_get()

std::optional< blender::StringRefNull > UI_but_context_string_get ( const uiBut * but,
const char * name )

Definition at line 6027 of file interface.cc.

References uiBut::context, and CTX_store_string_lookup().

Referenced by UI_asset_shelf_idname_from_button_context().

◆ ui_but_convert_to_unit_alt_name()

void ui_but_convert_to_unit_alt_name ( uiBut * but,
char * str,
size_t str_maxncpy )
Parameters
strwill be overwritten.

Definition at line 2811 of file interface.cc.

References BKE_unit_name_to_alt(), BLI_strdup(), uiBut::block, MEM_freeN(), RNA_SUBTYPE_UNIT_VALUE, str, ui_but_is_unit(), UI_but_unit_type_get(), and uiBlock::unit.

Referenced by ui_textedit_begin().

◆ UI_but_disable()

◆ ui_but_drag_multi_edit_get()

uiBut * ui_but_drag_multi_edit_get ( uiBut * but)

◆ UI_but_dragflag_disable()

void UI_but_dragflag_disable ( uiBut * but,
int flag )

Definition at line 5940 of file interface.cc.

References uiBut::dragflag.

◆ UI_but_dragflag_enable()

void UI_but_dragflag_enable ( uiBut * but,
int flag )

Definition at line 5935 of file interface.cc.

References uiBut::dragflag, and flag.

Referenced by asset_view_item_but_drag_set(), file_draw_list(), and UI_but_drag_attach_image().

◆ UI_but_drawflag_disable()

◆ UI_but_drawflag_enable()

◆ ui_but_equals_old()

◆ ui_but_event_operator_string()

◆ ui_but_event_operator_string_from_menu()

static std::optional< std::string > ui_but_event_operator_string_from_menu ( const bContext * C,
uiBut * but )
static

◆ ui_but_event_operator_string_from_operator()

static std::optional< std::string > ui_but_event_operator_string_from_operator ( const bContext * C,
wmOperatorCallParams * op_call_params )
static

◆ ui_but_event_operator_string_from_panel()

◆ ui_but_event_property_operator_string()

◆ UI_but_execute()

◆ ui_but_extra_icon_event_operator_string()

static std::optional< std::string > ui_but_extra_icon_event_operator_string ( const bContext * C,
const uiButExtraOpIcon * extra_icon )
static

◆ ui_but_extra_icon_find_old()

static uiButExtraOpIcon * ui_but_extra_icon_find_old ( const uiButExtraOpIcon * new_extra_icon,
const uiBut * old_but )
static

◆ UI_but_extra_icon_string_get_label()

std::string UI_but_extra_icon_string_get_label ( const uiButExtraOpIcon & extra_icon)

◆ UI_but_extra_icon_string_get_operator_keymap()

std::string UI_but_extra_icon_string_get_operator_keymap ( const bContext & C,
const uiButExtraOpIcon & extra_icon )

◆ UI_but_extra_icon_string_get_tooltip()

std::string UI_but_extra_icon_string_get_tooltip ( bContext & C,
const uiButExtraOpIcon & extra_icon )

◆ ui_but_extra_icons_equals_old()

static bool ui_but_extra_icons_equals_old ( const uiButExtraOpIcon * new_extra_icon,
const uiButExtraOpIcon * old_extra_icon )
static

◆ ui_but_extra_icons_update_from_old_but()

static void ui_but_extra_icons_update_from_old_but ( const uiBut * new_but,
const uiBut * old_but )
static

◆ UI_but_extra_operator_icon_add()

◆ ui_but_extra_operator_icon_add_ptr()

◆ ui_but_extra_operator_icon_free()

static void ui_but_extra_operator_icon_free ( uiButExtraOpIcon * extra_icon)
static

◆ UI_but_extra_operator_icon_opptr_get()

◆ UI_but_extra_operator_icon_optype_get()

◆ ui_but_extra_operator_icons_free()

void ui_but_extra_operator_icons_free ( uiBut * but)

◆ ui_but_find_new()

uiBut * ui_but_find_new ( uiBlock * block_new,
const uiBut * but_old )

Definition at line 804 of file interface.cc.

References uiBlock::buttons, LISTBASE_FOREACH, and ui_but_equals_old().

Referenced by UI_butstore_update().

◆ ui_but_find_old()

uiBut * ui_but_find_old ( uiBlock * block_old,
const uiBut * but_new )

◆ UI_but_flag2_enable()

void UI_but_flag2_enable ( uiBut * but,
int flag )

Definition at line 5910 of file interface.cc.

References flag, and uiBut::flag2.

Referenced by uiItemFullR(), and wm_block_search_menu().

◆ UI_but_flag_disable()

◆ UI_but_flag_enable()

void UI_but_flag_enable ( uiBut * but,
int flag )

Definition at line 5905 of file interface.cc.

References flag, and uiBut::flag.

Referenced by blender::add_attribute_search_button(), block_create_autorun_warning(), blender::ui::bonecollections::BoneCollectionItem::build_row(), blender::ed::space_node::create_search_popup_block(), curvemap_buttons_layout(), CurveProfile_buttons_layout(), draw_setting_widget(), ED_file_path_button(), file_draw_list(), file_panel_execution_buttons_draw(), blender::ed::outliner::merged_element_search_menu(), blender::ed::space_node::node_draw_basis(), blender::ed::space_node::node_draw_extra_info_row(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::node_draw_panels(), blender::ed::space_node::node_find_menu(), blender::ed::space_node::node_socket_tooltip_set(), blender::ed::outliner::outliner_draw_mode_column_toggle(), blender::ed::outliner::outliner_draw_overrides_restrictbuts(), blender::ed::outliner::outliner_draw_overrides_rna_buts(), blender::ed::outliner::outliner_draw_restrictbuts(), blender::ed::outliner::outliner_draw_rnabuts(), blender::ed::outliner::outliner_draw_userbuts(), blender::ed::space_node::reroute_node_draw_label(), save_file_overwrite_confirm_button(), save_file_overwrite_saveas_button(), template_add_button_search_menu(), template_ID(), template_id_def_new_but(), UI_but_disable(), ui_but_search_refresh(), ui_item_with_label(), ui_layout_list_set_labels_active(), UI_popup_block_template_confirm(), ui_popup_context_menu_for_button(), ui_template_list_layout_draw(), uiDefAutoButR(), uiItemFullO_ptr_ex(), uiItemFullR(), uiItemL_(), uiItemL_ex(), uiTemplateKeymapItemProperties(), view3d_panel_vgroup(), wm_block_dialog_create(), wm_block_file_close_save_button(), wm_block_insert_unicode_create(), and wm_block_search_menu().

◆ UI_but_flag_is_set()

◆ UI_but_focus_on_enter_event()

void UI_but_focus_on_enter_event ( wmWindow * win,
uiBut * but )

push a new event onto event queue to activate the given button (usually a text-field) upon entering a popup

Definition at line 6624 of file interface.cc.

References EVT_BUT_OPEN, KM_PRESS, wm_event_add(), and wm_event_init_from_window().

Referenced by template_common_search_menu(), template_operator_property_buts_draw_single(), and wm_enum_search_menu().

◆ ui_but_free()

◆ ui_but_free_type_specific()

static void ui_but_free_type_specific ( uiBut * but)
static

Free data specific to a certain button type. For now just do in a switch-case, we could instead have a callback stored in uiBut and set that in #ui_but_alloc_info().

Definition at line 3489 of file interface.cc.

References uiButSearch::arg, uiButSearch::arg_free_fn, uiButSearch::item_active_str, MEM_SAFE_FREE, uiBut::type, and UI_BTYPE_SEARCH_MENU.

Referenced by ui_but_free().

◆ UI_but_func_complete_set()

void UI_but_func_complete_set ( uiBut * but,
uiButCompleteFunc func,
void * arg )

◆ UI_but_func_drawextra_set()

void UI_but_func_drawextra_set ( uiBlock * block,
std::function< void(const bContext *C, rcti *rect)> func )

Definition at line 6102 of file interface.cc.

References uiBlock::drawextra.

Referenced by uiTemplatePreview().

◆ UI_but_func_hold_set()

void UI_but_func_hold_set ( uiBut * but,
uiButHandleHoldFunc func,
void * argN )

Definition at line 6638 of file interface.cc.

References uiBut::hold_argN, and uiBut::hold_func.

Referenced by uiItemFullOMenuHold_ptr().

◆ UI_but_func_menu_step_set()

void UI_but_func_menu_step_set ( uiBut * but,
uiMenuStepFunc func )

Definition at line 6144 of file interface.cc.

References uiBut::menu_step_func.

Referenced by uiblock_layer_pass_buttons().

◆ UI_but_func_pushed_state_set()

void UI_but_func_pushed_state_set ( uiBut * but,
std::function< bool(const uiBut &)> func )

◆ UI_but_func_rename_full_set()

void UI_but_func_rename_full_set ( uiBut * but,
std::function< void(std::string &new_name)> rename_full_func )

Definition at line 6096 of file interface.cc.

References uiBut::rename_full_func.

Referenced by template_ID(), and uiItemFullR().

◆ UI_but_func_rename_set()

void UI_but_func_rename_set ( uiBut * but,
uiButHandleRenameFunc func,
void * arg1 )

◆ UI_but_func_search_set()

void UI_but_func_search_set ( uiBut * but,
uiButSearchCreateFn search_create_fn,
uiButSearchUpdateFn search_update_fn,
void * arg,
bool free_arg,
uiFreeArgFunc search_arg_free_fn,
uiButHandleFunc search_exec_fn,
void * active )
Note
The item-pointer (referred to below) is a per search item user pointer passed to UI_search_item_add (stored in uiSearchItems.pointers).
Parameters
search_create_fnFunction to create the menu.
search_update_fnFunction to refresh search content after the search text has changed.
arguser value.
free_argSet to true if the argument is newly allocated memory for every redraw and should be freed when the button is destroyed.
search_arg_free_fnWhen non-null, use this function to free arg.
search_exec_fnFunction that executes the action, gets arg as the first argument. The second argument as the active item-pointer
activeWhen non-null, this item-pointer item will be visible and selected, otherwise the first item will be selected.

Definition at line 6336 of file interface.cc.

References uiButSearch::arg, uiButSearch::arg_free_fn, BLI_assert, uiBut::block, uiBut::drawstr, uiBlock::flag, uiBut::func, uiButSearch::item_active, uiButSearch::items_update_fn, uiButSearch::popup_create_fn, printf, uiButSearch::results_are_suggestions, uiBut::type, UI_BLOCK_LOOP, UI_BTYPE_SEARCH_MENU, UI_but_func_set(), UI_but_funcN_set(), ui_but_search_refresh(), and ui_searchbox_create_generic().

Referenced by blender::add_attribute_search_button(), blender::ed::space_node::create_search_popup_block(), blender::ed::outliner::merged_element_search_menu(), blender::ed::space_node::node_find_menu(), blender::ed::space_node::node_geometry_add_attribute_search_button(), template_common_search_menu(), ui_but_add_search(), UI_but_func_menu_search(), UI_but_func_operator_search(), and uiDefSearchButO_ptr().

◆ UI_but_func_search_set_context_menu()

void UI_but_func_search_set_context_menu ( uiBut * but,
uiButSearchContextMenuFn context_menu_fn )

◆ UI_but_func_search_set_listen()

void UI_but_func_search_set_listen ( uiBut * but,
uiButSearchListenFn listen_fn )

◆ UI_but_func_search_set_results_are_suggestions()

void UI_but_func_search_set_results_are_suggestions ( uiBut * but,
const bool value )

◆ UI_but_func_search_set_sep_string()

void UI_but_func_search_set_sep_string ( uiBut * but,
const char * search_sep_string )
Parameters
search_sep_stringwhen not NULL, this string is used as a separator, showing the icon and highlighted text after the last instance of this string.

Definition at line 6402 of file interface.cc.

References BLI_assert, uiButSearch::item_sep_string, uiBut::type, and UI_BTYPE_SEARCH_MENU.

Referenced by blender::add_attribute_search_button(), blender::ed::space_node::create_search_popup_block(), blender::ed::space_node::node_geometry_add_attribute_search_button(), and UI_but_func_menu_search().

◆ UI_but_func_search_set_tooltip()

void UI_but_func_search_set_tooltip ( uiBut * but,
uiButSearchTooltipFn tooltip_fn )

◆ UI_but_func_set() [1/2]

void UI_but_func_set ( uiBut * but,
std::function< void(bContext &)> func )

Definition at line 6115 of file interface.cc.

References uiBut::apply_func.

Referenced by blender::ed::asset::shelf::add_catalog_tabs(), ANIM_channel_draw_widgets(), block_create__close_file_dialog(), block_create_autorun_warning(), blender::ed::asset::shelf::AssetCatalogSelectorTree::Item::build_row(), colorband_buttons_layout(), colorband_tools_fn(), curve_profile_presets_fn(), curve_profile_tools_fn(), curvemap_buttons_layout(), curvemap_clipping_func(), curvemap_tools_func(), CurveProfile_buttons_layout(), draw_setting_widget(), envelope_panel_draw(), graph_draw_driver_settings_panel(), graph_panel_key_properties(), blender::ed::space_node::node_draw_basis(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::node_draw_panels(), blender::ed::outliner::outliner_draw_mode_column_toggle(), blender::ed::outliner::outliner_draw_restrictbuts(), blender::ed::outliner::outliner_draw_userbuts(), save_file_overwrite_cancel_button(), save_file_overwrite_confirm_button(), save_file_overwrite_saveas_button(), template_operator_property_buts_draw_single(), ui_block_colorpicker(), ui_colorpicker_circle(), ui_colorpicker_square(), ui_item_array(), ui_item_enum_expand_elem_exec(), ui_item_with_label(), blender::ed::space_node::ui_node_draw_panel(), UI_popup_block_template_confirm(), ui_popup_context_menu_for_button(), ui_template_list_layout_draw(), uiItemDecoratorR_prop(), uiTemplateKeymapItemProperties(), uiTemplateLayers(), uiTemplateTextureShow(), view3d_panel_vgroup(), wm_block_dialog_create(), wm_block_file_close_cancel_button(), wm_block_file_close_discard_button(), wm_block_file_close_save_button(), wm_block_insert_unicode_create(), and wm_block_splash_create().

◆ UI_but_func_set() [2/2]

void UI_but_func_set ( uiBut * but,
uiButHandleFunc func,
void * arg1,
void * arg2 )

Definition at line 6108 of file interface.cc.

References uiBut::func, uiBut::func_arg1, and uiBut::func_arg2.

Referenced by UI_but_func_search_set().

◆ UI_but_func_tooltip_custom_set()

void UI_but_func_tooltip_custom_set ( uiBut * but,
uiButToolTipCustomFunc func,
void * arg,
uiFreeArgFunc free_arg )

◆ UI_but_func_tooltip_label_set()

void UI_but_func_tooltip_label_set ( uiBut * but,
std::function< std::string(const uiBut *but)> func )

Enable a custom quick tooltip label. That is, a short tooltip that appears faster than the full one and only shows the label string returned by func. After a short delay the full tooltip is shown, including the same label.

Definition at line 6149 of file interface.cc.

References uiBut::tip_label_func, UI_but_drawflag_enable(), and UI_BUT_HAS_TOOLTIP_LABEL.

Referenced by blender::ui::PreviewGridItem::build_grid_tile_button().

◆ UI_but_func_tooltip_set()

◆ UI_but_funcN_set()

◆ ui_but_get_float_precision()

static float ui_but_get_float_precision ( uiBut * but)
static

◆ ui_but_get_float_step_size()

static float ui_but_get_float_step_size ( uiBut * but)
static

Definition at line 643 of file interface.cc.

References BLI_assert_unreachable, uiBut::type, UI_BTYPE_NUM, and UI_BTYPE_NUM_SLIDER.

Referenced by ui_but_hide_fraction().

◆ ui_but_hide_fraction()

static bool ui_but_hide_fraction ( uiBut * but,
double value )
static

◆ UI_but_hint_drawstr_set()

void UI_but_hint_drawstr_set ( uiBut * but,
const char * string )

Adds a hint to the button which draws right aligned, grayed out and never clipped.

Definition at line 6534 of file interface.cc.

References ui_but_add_shortcut().

Referenced by blender::ed::spreadsheet::draw_row_suffix().

◆ ui_but_icon_extra_get()

◆ ui_but_icon_extra_is_visible_bone_eyedropper()

◆ ui_but_icon_extra_is_visible_search_eyedropper()

static bool ui_but_icon_extra_is_visible_search_eyedropper ( uiBut * but)
static

◆ ui_but_icon_extra_is_visible_search_unlink()

static bool ui_but_icon_extra_is_visible_search_unlink ( const uiBut * but)
static

◆ ui_but_icon_extra_is_visible_text_clear()

static bool ui_but_icon_extra_is_visible_text_clear ( const uiBut * but)
static

◆ UI_but_icon_indicator_color_set()

void UI_but_icon_indicator_color_set ( uiBut * but,
const uchar color[4] )

◆ UI_but_icon_indicator_number_set()

void UI_but_icon_indicator_number_set ( uiBut * but,
const int indicator_number )

◆ UI_but_icon_indicator_set()

void UI_but_icon_indicator_set ( uiBut * but,
const char * string )

◆ ui_but_is_bool()

◆ ui_but_is_compatible()

bool ui_but_is_compatible ( const uiBut * but_a,
const uiBut * but_b )

Check if this button is similar enough to be grouped with another.

Definition at line 2570 of file interface.cc.

References uiBut::pointype, RNA_property_subtype(), RNA_property_type(), uiBut::rnapoin, uiBut::rnaprop, PointerRNA::type, and uiBut::type.

Referenced by ui_multibut_states_tag().

◆ ui_but_is_float()

◆ ui_but_is_pushed()

int ui_but_is_pushed ( uiBut * but)

Definition at line 2289 of file interface.cc.

References ui_but_is_pushed_ex(), and UI_BUT_VALUE_UNSET.

Referenced by ui_drag_toggle_but_pushed_state().

◆ ui_but_is_pushed_ex()

◆ ui_but_is_rna_undo()

static bool ui_but_is_rna_undo ( const uiBut * but)
static

◆ ui_but_is_rna_valid()

bool ui_but_is_rna_valid ( uiBut * but)

◆ ui_but_is_row_alignment_group()

static bool ui_but_is_row_alignment_group ( const uiBut * left,
const uiBut * right )
static

Definition at line 357 of file interface.cc.

Referenced by ui_block_bounds_calc_text().

◆ ui_but_is_unit()

◆ ui_but_is_unit_radians()

static bool ui_but_is_unit_radians ( const uiBut * but)
static

◆ ui_but_is_unit_radians_ex()

static bool ui_but_is_unit_radians_ex ( const UnitSettings * unit,
const int unit_type )
static

Definition at line 101 of file interface.cc.

References PROP_UNIT_ROTATION, and USER_UNIT_ROT_RADIANS.

Referenced by ui_but_is_unit(), and ui_but_is_unit_radians().

◆ UI_but_label_alpha_factor_set()

void UI_but_label_alpha_factor_set ( uiBut * but,
const float alpha_factor )

◆ ui_but_mem_delete()

static void ui_but_mem_delete ( const uiBut * but)
static

◆ ui_but_menu_draw_as_popover()

bool ui_but_menu_draw_as_popover ( const uiBut * but)

◆ ui_but_new()

◆ UI_but_node_link_set()

void UI_but_node_link_set ( uiBut * but,
bNodeSocket * socket,
const float draw_color[4] )

◆ UI_but_number_precision_set()

◆ UI_but_number_slider_precision_set()

void UI_but_number_slider_precision_set ( uiBut * but,
float precision )

◆ UI_but_number_slider_step_size_set()

void UI_but_number_slider_step_size_set ( uiBut * but,
float step_size )

◆ UI_but_number_step_size_set()

◆ UI_but_operator_ptr_ensure()

◆ UI_but_operator_set()

void UI_but_operator_set ( uiBut * but,
wmOperatorType * optype,
wmOperatorCallContext opcontext,
const PointerRNA * opptr )

◆ UI_but_operator_set_never_call()

void UI_but_operator_set_never_call ( uiBut * but)

Disable calling operators from but in button handling. Useful to attach an operator to a button for tooltips, "Assign Shortcut", etc. without actually making the button execute the operator.

Definition at line 5868 of file interface.cc.

References uiBut::operator_never_call.

Referenced by blender::ed::asset::shelf::AssetViewItem::build_grid_tile().

◆ ui_but_override_flag()

◆ ui_but_pie_direction_string()

static std::string ui_but_pie_direction_string ( const uiBut * but)
static

Definition at line 1536 of file interface.cc.

References ARRAY_SIZE, BLI_assert, uiBut::pie_dir, and ui_radial_dir_to_numpad.

Referenced by ui_menu_block_set_keymaps().

◆ ui_but_pixelrect_in_view()

static bool ui_but_pixelrect_in_view ( const ARegion * region,
const rcti * rect )
static

Definition at line 2057 of file interface.cc.

References BLI_rcti_isect(), BLI_rcti_translate(), and rcti::xmin.

Referenced by UI_block_draw().

◆ ui_but_placeholder_get()

◆ UI_but_placeholder_set()

void UI_but_placeholder_set ( uiBut * but,
const char * placeholder_text )

Set at hint that describes the expected value when empty.

Definition at line 5962 of file interface.cc.

References BLI_strdup_null(), MEM_SAFE_FREE, and uiBut::placeholder.

Referenced by blender::ed::space_node::node_geometry_add_attribute_search_button(), and uiItemFullR().

◆ ui_but_predefined_extra_operator_icons_add()

static void ui_but_predefined_extra_operator_icons_add ( uiBut * but)
static

While some extra operator icons have to be set explicitly upon button creating, this code adds some generic ones based on button data. Currently these are mutually exclusive, so there's only ever one predefined extra icon.

Definition at line 1768 of file interface.cc.

References BLI_assert, uiBut::extra_op_icons, LISTBASE_FOREACH, PREDEFINED_EXTRA_OP_ICON_BONE_EYEDROPPER, PREDEFINED_EXTRA_OP_ICON_CLEAR, PREDEFINED_EXTRA_OP_ICON_EYEDROPPER, ui_but_extra_operator_icon_add_ptr(), ui_but_icon_extra_get(), WM_OP_INVOKE_DEFAULT, and WM_operatortype_find().

Referenced by UI_block_end_ex().

◆ ui_but_range_set_hard()

◆ ui_but_range_set_soft()

◆ UI_but_return_value_get()

int UI_but_return_value_get ( uiBut * but)

Definition at line 6000 of file interface.cc.

References uiBut::retval.

◆ UI_but_rna_enum_item_get()

◆ ui_but_rna_equals()

bool ui_but_rna_equals ( const uiBut * a,
const uiBut * b )

Definition at line 703 of file interface.cc.

References b, and ui_but_rna_equals_ex().

Referenced by ui_but_equals_old(), and ui_list_contains_row().

◆ ui_but_rna_equals_ex()

bool ui_but_rna_equals_ex ( const uiBut * but,
const PointerRNA * ptr,
const PropertyRNA * prop,
int index )

◆ ui_but_rna_menu_convert_to_menu_type()

◆ ui_but_rna_menu_convert_to_panel_type()

void ui_but_rna_menu_convert_to_panel_type ( uiBut * but,
const char * panel_type )

◆ ui_but_scale_type()

◆ UI_but_search_preview_grid_size_set()

void UI_but_search_preview_grid_size_set ( uiBut * but,
int rows,
int cols )

◆ ui_but_string_eval_number()

◆ ui_but_string_get()

void ui_but_string_get ( uiBut * but,
char * str,
const size_t str_maxncpy )

◆ ui_but_string_get_dynamic()

char * ui_but_string_get_dynamic ( uiBut * but,
int * r_str_size )

◆ ui_but_string_get_ex()

◆ UI_but_string_get_label()

std::string UI_but_string_get_label ( uiBut & but)

◆ ui_but_string_get_maxncpy()

int ui_but_string_get_maxncpy ( uiBut * but)

◆ UI_but_string_get_operator_keymap()

std::string UI_but_string_get_operator_keymap ( bContext & C,
uiBut & but )

Buttons assigned to an operator (common case).

Definition at line 6839 of file interface.cc.

References ui_but_event_operator_string().

Referenced by ui_tooltip_data_from_button_or_extra_icon(), and ui_tooltip_data_from_tool().

◆ UI_but_string_get_property_keymap()

std::string UI_but_string_get_property_keymap ( bContext & C,
uiBut & but )

Use for properties that are bound to one of the context cycle, etc. keys.

Definition at line 6844 of file interface.cc.

References ui_but_event_property_operator_string().

Referenced by ui_tooltip_data_from_button_or_extra_icon().

◆ UI_but_string_get_rna_label()

◆ UI_but_string_get_rna_label_context()

std::string UI_but_string_get_rna_label_context ( const uiBut & but)

◆ UI_but_string_get_rna_property_identifier()

std::string UI_but_string_get_rna_property_identifier ( const uiBut & but)

Definition at line 6686 of file interface.cc.

References RNA_property_identifier(), and uiBut::rnaprop.

Referenced by ui_tooltip_data_from_button_or_extra_icon().

◆ UI_but_string_get_rna_struct_identifier()

◆ UI_but_string_get_rna_tooltip()

◆ UI_but_string_get_tooltip()

std::string UI_but_string_get_tooltip ( bContext & C,
uiBut & but )

◆ UI_but_string_get_tooltip_label()

std::string UI_but_string_get_tooltip_label ( const uiBut & but)

Query the result of uiBut::tip_label_func(). Meant to allow overriding the label to be displayed in the tool-tip.

Definition at line 6744 of file interface.cc.

References uiBut::tip_label_func.

Referenced by ui_tooltip_data_from_button_or_extra_icon().

◆ ui_but_string_set()

◆ ui_but_submenu_enable()

static void ui_but_submenu_enable ( uiBlock * block,
uiBut * but )
static

◆ ui_but_supports_cycling()

bool ui_but_supports_cycling ( const uiBut * but)

Checks if the button supports cycling next/previous menu items (ctrl+mouse-wheel).

Definition at line 2605 of file interface.cc.

References ELEM, uiBut::menu_step_func, uiBut::type, UI_BTYPE_COLOR, UI_BTYPE_LISTBOX, UI_BTYPE_MENU, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_ROW, and ui_but_menu_step_poll().

Referenced by ui_do_but_BLOCK(), and ui_handle_panel_category_cycling().

◆ ui_but_to_pixelrect()

void ui_but_to_pixelrect ( rcti * rect,
const ARegion * region,
const uiBlock * block,
const uiBut * but )

Project button or block (but==nullptr) to pixels in region-space.

Definition at line 2042 of file interface.cc.

References uiBlock::rect, uiBut::rect, and ui_to_pixelrect().

Referenced by button_section_bounds_calc(), UI_block_draw(), and ui_update_flexible_spacing().

◆ UI_but_type_set_menu_from_pulldown()

◆ UI_but_unit_type_get()

◆ UI_but_unit_type_set()

void UI_but_unit_type_set ( uiBut * but,
const int unit_type )

◆ ui_but_update()

◆ ui_but_update_and_icon_set()

static void ui_but_update_and_icon_set ( uiBut * but,
int icon )
static

◆ ui_but_update_edited()

◆ ui_but_update_ex()

static void ui_but_update_ex ( uiBut * but,
const bool validate )
static
Parameters
butButton to update.
validateWhen set, this function may change the button value. Otherwise treat the button value as read-only.

Definition at line 3935 of file interface.cc.

References wmKeyMapItem::alt, BLI_assert, BLI_rctf_size_x(), uiBut::block, wmKeyMapItem::ctrl, uiBut::drawflag, uiBut::drawstr, uiBut::editstr, uiBlock::evil_C, uiBlock::flag, uiBut::flag, uiBut::hardmax, uiBut::hardmin, EnumPropertyItem::icon, uiBut::icon, uiBut::iconadd, IFACE_, KM_ALT, KM_CTRL, KM_NOTHING, KM_OSKEY, KM_PRESS, KM_SHIFT, uiButHotkeyEvent::modifier_key, EnumPropertyItem::name, wmKeyMapItem::oskey, uiBut::poin, uiBut::pointype, PROP_ENUM, PROP_ICONS_CONSECUTIVE, PROP_ICONS_REVERSE, uiBut::rect, RNA_property_enum_get(), RNA_property_enum_item_from_value_gettexted(), RNA_property_flag(), RNA_property_type(), uiBut::rnapoin, uiBut::rnaprop, wmKeyMapItem::shift, uiBut::softmax, uiBut::softmin, str, uiBut::str, uiBut::type, UI_BLOCK_LOOP, UI_BTYPE_HOTKEY_EVENT, UI_BTYPE_HSVCIRCLE, UI_BTYPE_HSVCUBE, UI_BTYPE_ICON_TOGGLE, UI_BTYPE_ICON_TOGGLE_N, UI_BTYPE_KEY_EVENT, UI_BTYPE_LABEL, UI_BTYPE_MENU, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_SCROLL, UI_BTYPE_SEARCH_MENU, UI_BTYPE_TEXT, ui_but_build_drawstr_float(), ui_but_build_drawstr_int(), ui_but_calc_float_precision(), UI_BUT_ICON_REVERSE, ui_but_is_editing(), ui_but_is_float(), UI_BUT_POIN_TYPES, ui_but_range_set_soft(), ui_but_string_get(), ui_but_update_select_flag(), ui_but_value_set(), UI_BUT_VALUE_UNSET, UI_GET_BUT_VALUE_INIT, UI_MAX_DRAW_STR, UI_SELECT, UI_UNIT_X, WM_key_event_string(), and WM_keymap_item_to_string().

Referenced by ui_but_update(), and ui_but_update_edited().

◆ ui_but_update_from_old_block()

◆ ui_but_update_old_active_from_new()

static void ui_but_update_old_active_from_new ( uiBut * oldbut,
uiBut * but )
static

Update pointers and other information in the old active button based on new information in the corresponding new button from the current layout pass.

Parameters
oldbutThe button from the last layout pass that will be moved to the new block.
butThe newly added button with much of the up to date information, to be feed later.
Note
uiBut has ownership of many of its pointers. When the button is freed all these pointers are freed as well, so ownership has to be moved out of but in order to free it.

Definition at line 856 of file interface.cc.

References uiBut::active, uiBut::alignnr, uiButLabel::alpha_factor, uiButSearch::arg, uiButSearch::arg_free_fn, BLI_assert, uiBut::context, uiBut::dragpoin, uiBut::drawflag, ELEM, uiBut::extra_op_icons, uiBut::flag, uiBut::func_argN, uiBut::hardmax, uiBut::icon, uiBut::iconadd, uiBut::imb, uiButSeparatorLine::is_vertical, uiBut::poin, uiButProgress::progress_factor, uiBut::rect, uiBut::semi_modal_state, uiBut::str, uiBut::tip_arg, uiBut::tip_arg_free, uiBut::tip_func, uiBut::tip_label_func, uiBut::type, UI_BTYPE_LABEL, UI_BTYPE_LISTROW, UI_BTYPE_PROGRESS, UI_BTYPE_ROW, UI_BTYPE_SCROLL, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEPR_LINE, UI_BTYPE_VIEW_ITEM, ui_but_extra_icons_update_from_old_but(), UI_BUT_HAS_TOOLTIP_LABEL, UI_BUT_REDALERT, UI_HAS_ICON, UI_SELECT_DRAW, ui_view_item_swap_button_pointers(), uiButViewItem::view_item, and uiButScrollBar::visual_height.

Referenced by ui_but_update_from_old_block().

◆ ui_but_update_select_flag()

static void ui_but_update_select_flag ( uiBut * but,
double * value )
static

Definition at line 2295 of file interface.cc.

References uiBut::flag, ui_but_is_pushed_ex(), and UI_SELECT.

Referenced by ui_but_update_ex(), and ui_but_value_set().

◆ ui_but_v3_get()

◆ ui_but_v3_set()

◆ ui_but_v4_get()

◆ ui_but_v4_set()

◆ ui_but_validate()

static void ui_but_validate ( const uiBut * but)
static

Extra sanity checks for invariants (debug builds only).

Definition at line 1863 of file interface.cc.

References BLI_assert, ELEM, uiBut::pointype, uiButNumber::step_size, uiBut::type, UI_BTYPE_NUM, UI_BUT_POIN_CHAR, UI_BUT_POIN_INT, and UI_BUT_POIN_SHORT.

Referenced by UI_block_end_ex().

◆ ui_but_value_get()

◆ ui_but_value_set()

◆ UI_but_view_item_draw_size_set()

void UI_but_view_item_draw_size_set ( uiBut * but,
const std::optional< int > draw_width,
const std::optional< int > draw_height )

◆ ui_def_but()

static uiBut * ui_def_but ( uiBlock * block,
int type,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
void * poin,
float min,
float max,
const char * tip )
static
Parameters
x,yThe lower left hand corner of the button (X axis)
width,heightThe size of the button.

Definition at line 4252 of file interface.cc.

References uiBlock::alignnr, uiBut::alignnr, uiBut::bit, uiBut::bitnr, BLI_addtail(), BLI_assert, uiBut::block, uiBlock::buttons, BUTTYPE, uiBlock::curlayout, uiBut::disabled_info, uiBut::dragflag, uiBut::drawflag, ELEM, uiBlock::emboss, uiBut::emboss, uiBlock::flag, uiBut::flag, uiBlock::func, uiBut::func, uiBlock::func_arg1, uiBut::func_arg1, uiBlock::func_arg2, uiBut::func_arg2, uiBlock::func_argN, uiBut::func_argN, uiBlock::func_argN_copy_fn, uiBut::func_argN_copy_fn, uiBlock::func_argN_free_fn, uiBut::func_argN_free_fn, uiBlock::funcN, uiBut::funcN, uiBut::hardmax, uiBut::hardmin, uiBlock::lock, uiBlock::lockstr, max, min, uiBut::poin, uiBut::pointype, uiBut::pos, uiBut::rect, uiBut::retval, uiBut::softmax, uiBut::softmin, str, uiBut::str, uiBut::tip, uiBut::type, ui_block_is_popover(), UI_BLOCK_LOOP, UI_BLOCK_PIE_MENU, UI_BLOCK_QUICK_SETUP, UI_BTYPE_BLOCK, UI_BTYPE_BUT, UI_BTYPE_BUT_MENU, UI_BTYPE_COLOR, UI_BTYPE_DECORATOR, UI_BTYPE_GRIP, UI_BTYPE_LABEL, UI_BTYPE_LISTBOX, UI_BTYPE_MENU, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_POPOVER, UI_BTYPE_PULLDOWN, UI_BTYPE_ROUNDBOX, UI_BTYPE_SCROLL, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_SEPR_SPACER, UI_BTYPE_TEXT, UI_BUT_ALIGN, ui_but_can_align(), UI_BUT_DISABLED, UI_BUT_DRAG_FULL_BUT, UI_BUT_ICON_LEFT, ui_but_new(), UI_BUT_POIN_BIT, UI_BUT_POIN_TYPES, UI_BUT_TEXT_LEFT, UI_BUT_UNDO, UI_editsource_active_but_test(), UI_editsource_enable_check(), ui_layout_add_but(), UI_MAX_NAME_STR, x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.

Referenced by ui_def_but_operator_ptr(), ui_def_but_rna(), ui_def_but_rna_propname(), uiDefBlockBut(), uiDefBlockButN(), uiDefBut(), uiDefButImage(), uiDefIconBlockBut(), uiDefIconBut(), uiDefIconMenuBut(), uiDefIconTextBut(), uiDefIconTextMenuBut(), uiDefMenuBut(), and uiDefSearchBut().

◆ ui_def_but_icon()

◆ ui_def_but_icon_clear()

void ui_def_but_icon_clear ( uiBut * but)

Avoid using this where possible since it's better not to ask for an icon in the first place.

Definition at line 4416 of file interface.cc.

References uiBut::drawflag, uiBut::flag, and uiBut::icon.

Referenced by uiItemFullR().

◆ ui_def_but_operator_ptr()

static uiBut * ui_def_but_operator_ptr ( uiBlock * block,
int type,
wmOperatorType * ot,
wmOperatorCallContext opcontext,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )
static

◆ ui_def_but_rna()

static uiBut * ui_def_but_rna ( uiBlock * block,
int type,
int retval,
const char * str,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
PropertyRNA * prop,
int index,
float min,
float max,
const char * tip )
static

ui_def_but_rna_propname and ui_def_but_rna both take the same args except for propname vs prop, this is done so we can avoid an extra lookup on 'prop' when its already available.

When this kind of change won't disrupt branches, best look into making more of our UI functions take prop rather than propname.

Definition at line 4724 of file interface.cc.

References BLI_assert, uiBut::context, uiBlock::contexts, CTX_IFACE_, CTX_store_add(), PointerRNA::data, ELEM, uiBut::emboss, uiBlock::evil_C, uiBut::flag, free(), EnumPropertyItem::icon, int, MEM_freeN(), uiBut::menu_create_func, min, EnumPropertyItem::name, uiBut::poin, PROP_ENUM, PROP_FLOAT, PROP_INT, PROP_POINTER, PROP_STRING, ptr, RNA_enum_from_value(), RNA_property_array_check(), RNA_property_editable_info(), RNA_property_enum_get(), RNA_property_enum_items(), RNA_property_float_range(), RNA_property_float_ui_range(), RNA_property_int_range(), RNA_property_int_ui_range(), RNA_property_pointer_get(), RNA_property_string_maxlength(), RNA_property_translation_context(), RNA_property_type(), RNA_property_ui_description(), RNA_property_ui_icon(), RNA_property_ui_name(), RNA_struct_is_ID(), uiBut::rnaindex, uiBut::rnapoin, uiBut::rnaprop, uiButNumber::step_size, uiButNumberSlider::step_size, str, PointerRNA::type, uiBut::type, UI_BTYPE_COLOR, UI_BTYPE_HSVCIRCLE, UI_BTYPE_HSVCUBE, UI_BTYPE_LISTROW, UI_BTYPE_MENU, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER, UI_BTYPE_ROW, UI_BTYPE_SEARCH_MENU, UI_but_disable(), ui_but_is_rna_undo(), ui_but_is_unit(), UI_but_number_precision_set(), UI_but_number_slider_precision_set(), UI_but_number_slider_step_size_set(), UI_but_number_step_size_set(), ui_but_submenu_enable(), UI_BUT_UNDO, ui_def_but(), ui_def_but_icon(), ui_def_but_rna__menu(), UI_EMBOSS_PULLDOWN, ui_get_but_step_unit(), and UI_HAS_ICON.

Referenced by ui_def_but_rna_propname(), uiDefButR_prop(), uiDefIconButR_prop(), and uiDefIconTextButR_prop().

◆ ui_def_but_rna__menu()

◆ ui_def_but_rna__menu_type()

static void ui_def_but_rna__menu_type ( bContext * C,
uiLayout * layout,
void * but_p )
static

◆ ui_def_but_rna__panel_type()

static void ui_def_but_rna__panel_type ( bContext * C,
uiLayout * layout,
void * arg )
static

◆ ui_def_but_rna_propname()

static uiBut * ui_def_but_rna_propname ( uiBlock * block,
int type,
int retval,
const char * str,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
const char * propname,
int index,
float min,
float max,
const char * tip )
static

◆ UI_exit()

void UI_exit ( )

Definition at line 6901 of file interface.cc.

References ui_but_clipboard_free(), and ui_resources_free().

Referenced by WM_exit_ex().

◆ ui_fontscale()

void ui_fontscale ( float * points,
float aspect )

◆ ui_get_but_scale_unit()

◆ ui_get_but_step_unit()

◆ ui_get_but_string_unit()

static void ui_get_but_string_unit ( uiBut * but,
char * str,
int str_maxncpy,
double value,
bool pad,
int float_precision )
static

◆ UI_init()

void UI_init ( )

Definition at line 6871 of file interface.cc.

References ui_resources_init().

Referenced by WM_init().

◆ UI_init_userdef()

void UI_init_userdef ( )

Definition at line 6876 of file interface.cc.

References uiStyleInit().

Referenced by wm_init_userdef().

◆ UI_interface_tag_script_reload()

void UI_interface_tag_script_reload ( )

Definition at line 6907 of file interface.cc.

References ui_interface_tag_script_reload_queries().

Referenced by WM_script_tag_reload().

◆ ui_menu_block_set_keyaccels()

static void ui_menu_block_set_keyaccels ( uiBlock * block)
static

◆ ui_menu_block_set_keymaps()

◆ ui_number_from_string()

◆ ui_number_from_string_factor()

static bool ui_number_from_string_factor ( bContext * C,
const char * str,
double * r_value )
static

◆ ui_number_from_string_percentage()

static bool ui_number_from_string_percentage ( bContext * C,
const char * str,
double * r_value )
static

◆ ui_number_from_string_units()

static bool ui_number_from_string_units ( bContext * C,
const char * str,
const int unit_type,
const UnitSettings * unit,
double * r_value )
static

◆ ui_number_from_string_units_with_but()

static bool ui_number_from_string_units_with_but ( bContext * C,
const char * str,
const uiBut * but,
double * r_value )
static

◆ UI_preview_tile_size_x()

int UI_preview_tile_size_x ( const int size_px = 96)

Get the scaled size for a preview button (typically #UI_BTyPE_PREVIEW_TILE) based on size_px plus padding.

Definition at line 5142 of file interface.cc.

References pad, PREVIEW_TILE_PAD, round_fl_to_int(), and UI_UNIT_X.

Referenced by blender::ed::asset::shelf::asset_shelf_default_tile_height(), asset_view_draw_item(), blender::ed::asset::shelf::tile_width(), and ui_template_list_layout_draw().

◆ UI_preview_tile_size_y()

◆ UI_preview_tile_size_y_no_label()

int UI_preview_tile_size_y_no_label ( const int size_px)

◆ UI_region_message_subscribe()

void UI_region_message_subscribe ( ARegion * region,
wmMsgBus * mbus )

Definition at line 2183 of file interface.cc.

References LISTBASE_FOREACH, and ui_block_message_subscribe().

Referenced by ED_region_message_subscribe().

◆ ui_region_to_window()

void ui_region_to_window ( const ARegion * region,
int * x,
int * y )

Definition at line 254 of file interface.cc.

◆ ui_region_winrct_get_no_margin()

void ui_region_winrct_get_no_margin ( const ARegion * region,
rcti * r_rect )

Popups will add a margin to ARegion.winrct for shadow, for interactivity (point-inside tests for eg), we want the winrct without the margin added.

Definition at line 334 of file interface.cc.

References BLI_rcti_rctf_copy_floor(), BLI_rcti_translate(), uiBlock::flag, uiBlock::rect, UI_BLOCK_LOOP, UI_BLOCK_PIE_MENU, and rcti::xmin.

Referenced by ui_region_contains_point_px(), ui_region_contains_rect_px(), and ui_screen_region_find_mouse_over_ex().

◆ UI_reinit_font()

void UI_reinit_font ( )

Definition at line 6882 of file interface.cc.

References uiStyleInit().

Referenced by reloadtranslation_exec().

◆ ui_to_pixelrect()

rcti ui_to_pixelrect ( const ARegion * region,
const uiBlock * block,
const rctf * src_rect )

◆ ui_update_flexible_spacing()

◆ UI_update_text_styles()

◆ ui_update_window_matrix()

static void ui_update_window_matrix ( const wmWindow * window,
const ARegion * region,
uiBlock * block )
static

◆ ui_window_to_block()

◆ ui_window_to_block_fl()

◆ ui_window_to_block_rctf()

void ui_window_to_block_rctf ( const ARegion * region,
const uiBlock * block,
rctf * rct_dst,
const rctf * rct_src )

Definition at line 211 of file interface.cc.

References ui_window_to_block_fl(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ui_but_find_rect_over().

◆ ui_window_to_region()

void ui_window_to_region ( const ARegion * region,
int * x,
int * y )

Definition at line 232 of file interface.cc.

Referenced by ui_region_contains_point_px().

◆ ui_window_to_region_rctf()

void ui_window_to_region_rctf ( const ARegion * region,
rctf * rect_dst,
const rctf * rct_src )

Definition at line 246 of file interface.cc.

References rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

◆ ui_window_to_region_rcti()

void ui_window_to_region_rcti ( const ARegion * region,
rcti * rect_dst,
const rcti * rct_src )

Definition at line 238 of file interface.cc.

References rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.

Referenced by ui_region_contains_rect_px().

◆ uiDefBlockBut()

uiBut * uiDefBlockBut ( uiBlock * block,
uiBlockCreateFunc func,
void * arg,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefBlockButN()

uiBut * uiDefBlockButN ( uiBlock * block,
uiBlockCreateFunc func,
void * argN,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip,
uiButArgNFree func_argN_free_fn,
uiButArgNCopy func_argN_copy_fn )

◆ uiDefBut()

uiBut * uiDefBut ( uiBlock * block,
int type,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
void * poin,
float min,
float max,
const char * tip )

Definition at line 4976 of file interface.cc.

References min, str, ui_but_update(), and ui_def_but().

Referenced by blender::ui::AbstractViewItem::add_rename_button(), blender::ed::asset::shelf::add_tab_button(), blender::ui::PreviewGridItem::build_grid_tile_button(), blender::ui::TreeViewLayoutBuilder::build_row(), colorband_buttons_layout(), blender::ed::space_node::create_search_popup_block(), create_title_button(), curvemap_buttons_layout(), CurveProfile_buttons_layout(), draw_channel_labels(), envelope_panel_draw(), file_add_preview_drag_but(), file_draw_list(), blender::ed::outliner::merged_element_search_menu(), blender::ed::space_node::node_draw_basis(), blender::ed::space_node::node_draw_extra_info_row(), blender::ed::space_node::node_draw_hidden(), blender::ed::space_node::node_draw_panels(), blender::ed::space_node::node_find_menu(), blender::ed::outliner::outliner_buttons(), blender::ed::outliner::outliner_draw_overrides_rna_buts(), blender::ed::outliner::outliner_draw_userbuts(), blender::ed::space_node::reroute_node_draw_label(), template_common_search_menu(), template_ID(), ui_block_colorpicker(), ui_def_but_rna__menu(), ui_imageuser_layer_menu(), ui_imageuser_pass_menu(), ui_imageuser_slot_menu(), ui_imageuser_view_menu_multiview(), ui_imageuser_view_menu_rr(), ui_item_array(), ui_item_disabled(), ui_item_with_label(), ui_layout_add_padding_button(), ui_layout_box(), blender::ed::space_node::ui_node_menu_column(), UI_pie_menu_begin(), ui_template_list_layout_draw(), blender::ed::space_node::ui_template_node_link_menu(), uiDefAutoButR(), uiDefButBit(), uiDefButC(), uiDefButF(), uiDefButI(), uiDefButS(), uiItemFullR(), uiItemL_(), uiItemProgressIndicator(), uiItemS_ex(), uiItemsFullEnumO_items(), uiItemSpacer(), uiLayoutListItemAddPadding(), uiTemplateHistogram(), uiTemplateMarker(), uiTemplateMovieClip(), uiTemplateNodeSocket(), uiTemplatePreview(), uiTemplateReportsBanner(), uiTemplateStatusInfo(), uiTemplateTrack(), uiTemplateVectorscope(), uiTemplateWaveform(), v3d_editvertex_buts(), v3d_object_dimension_buts(), wm_block_dialog_create(), wm_block_insert_unicode_create(), wm_block_search_menu(), wm_block_splash_add_label(), and wm_enum_search_menu().

◆ uiDefButAlert()

uiBut * uiDefButAlert ( uiBlock * block,
int icon,
int x,
int y,
short width,
short height )

◆ uiDefButBit()

static uiBut * uiDefButBit ( uiBlock * block,
int type,
int bit,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
void * poin,
float min,
float max,
const char * tip )
static

Definition at line 5174 of file interface.cc.

References findBitIndex(), min, str, UI_BUT_POIN_BIT, and uiDefBut().

Referenced by uiDefButBitC(), uiDefButBitI(), and uiDefButBitS().

◆ uiDefButBitC()

uiBut * uiDefButBitC ( uiBlock * block,
int type,
int bit,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
char * poin,
float min,
float max,
const char * tip )

Definition at line 5365 of file interface.cc.

References min, str, UI_BUT_POIN_CHAR, and uiDefButBit().

Referenced by block_create__close_file_dialog().

◆ uiDefButBitI()

uiBut * uiDefButBitI ( uiBlock * block,
int type,
int bit,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
int * poin,
float min,
float max,
const char * tip )

Definition at line 5257 of file interface.cc.

References min, str, UI_BUT_POIN_INT, and uiDefButBit().

Referenced by curvemap_clipping_func(), and uiTemplateMarker().

◆ uiDefButBitS()

uiBut * uiDefButBitS ( uiBlock * block,
int type,
int bit,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
short * poin,
float min,
float max,
const char * tip )

Definition at line 5311 of file interface.cc.

References min, str, UI_BUT_POIN_SHORT, and uiDefButBit().

Referenced by v3d_editvertex_buts().

◆ uiDefButC()

uiBut * uiDefButC ( uiBlock * block,
int type,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
char * poin,
float min,
float max,
const char * tip )

◆ uiDefButF()

uiBut * uiDefButF ( uiBlock * block,
int type,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
float * poin,
float min,
float max,
const char * tip )

◆ uiDefButI()

uiBut * uiDefButI ( uiBlock * block,
int type,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
int * poin,
float min,
float max,
const char * tip )

◆ uiDefButImage()

uiBut * uiDefButImage ( uiBlock * block,
void * imbuf,
int x,
int y,
short width,
short height,
const uchar color[4] )

◆ uiDefButO()

uiBut * uiDefButO ( uiBlock * block,
int type,
const char * opname,
wmOperatorCallContext opcontext,
const char * str,
int x,
int y,
short width,
short height,
const char * tip )

Definition at line 5449 of file interface.cc.

References ot, str, uiDefButO_ptr(), and WM_operatortype_find().

Referenced by uiTemplateReportsBanner().

◆ uiDefButO_ptr()

uiBut * uiDefButO_ptr ( uiBlock * block,
int type,
wmOperatorType * ot,
wmOperatorCallContext opcontext,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )

Definition at line 5434 of file interface.cc.

References ot, str, ui_but_update(), and ui_def_but_operator_ptr().

Referenced by uiDefButO(), uiItemFullO_ptr_ex(), and view3d_panel_vgroup().

◆ uiDefButR()

uiBut * uiDefButR ( uiBlock * block,
int type,
int retval,
const char * str,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
const char * propname,
int index,
float min,
float max,
const char * tip )

◆ uiDefButR_prop()

uiBut * uiDefButR_prop ( uiBlock * block,
int type,
int retval,
const char * str,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
PropertyRNA * prop,
int index,
float min,
float max,
const char * tip )

◆ uiDefButS()

uiBut * uiDefButS ( uiBlock * block,
int type,
int retval,
const StringRef str,
int x,
int y,
short width,
short height,
short * poin,
float min,
float max,
const char * tip )

◆ uiDefIconBlockBut()

uiBut * uiDefIconBlockBut ( uiBlock * block,
uiBlockCreateFunc func,
void * arg,
int retval,
int icon,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefIconBut()

◆ uiDefIconButBit()

static uiBut * uiDefIconButBit ( uiBlock * block,
int type,
int bit,
int retval,
int icon,
int x,
int y,
short width,
short height,
void * poin,
float min,
float max,
const char * tip )
static

Definition at line 5484 of file interface.cc.

References findBitIndex(), min, UI_BUT_POIN_BIT, and uiDefIconBut().

Referenced by uiDefIconButBitC(), uiDefIconButBitI(), and uiDefIconButBitS().

◆ uiDefIconButBitC()

uiBut * uiDefIconButBitC ( uiBlock * block,
int type,
int bit,
int retval,
int icon,
int x,
int y,
short width,
short height,
char * poin,
float min,
float max,
const char * tip )

Definition at line 5624 of file interface.cc.

References min, UI_BUT_POIN_CHAR, and uiDefIconButBit().

Referenced by draw_setting_widget().

◆ uiDefIconButBitI()

uiBut * uiDefIconButBitI ( uiBlock * block,
int type,
int bit,
int retval,
int icon,
int x,
int y,
short width,
short height,
int * poin,
float min,
float max,
const char * tip )

◆ uiDefIconButBitS()

uiBut * uiDefIconButBitS ( uiBlock * block,
int type,
int bit,
int retval,
int icon,
int x,
int y,
short width,
short height,
short * poin,
float min,
float max,
const char * tip )

◆ uiDefIconButI()

uiBut * uiDefIconButI ( uiBlock * block,
int type,
int retval,
int icon,
int x,
int y,
short width,
short height,
int * poin,
float min,
float max,
const char * tip )

◆ uiDefIconButO()

◆ uiDefIconButO_ptr()

uiBut * uiDefIconButO_ptr ( uiBlock * block,
int type,
wmOperatorType * ot,
wmOperatorCallContext opcontext,
int icon,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefIconButR()

uiBut * uiDefIconButR ( uiBlock * block,
int type,
int retval,
int icon,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
const char * propname,
int index,
float min,
float max,
const char * tip )

Definition at line 5652 of file interface.cc.

References min, ptr, ui_but_update_and_icon_set(), and ui_def_but_rna_propname().

Referenced by template_ID().

◆ uiDefIconButR_prop()

uiBut * uiDefIconButR_prop ( uiBlock * block,
int type,
int retval,
int icon,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
PropertyRNA * prop,
int index,
float min,
float max,
const char * tip )

◆ uiDefIconButS()

uiBut * uiDefIconButS ( uiBlock * block,
int type,
int retval,
int icon,
int x,
int y,
short width,
short height,
short * poin,
float min,
float max,
const char * tip )

Definition at line 5570 of file interface.cc.

References min, UI_BUT_POIN_SHORT, and uiDefIconBut().

Referenced by uiTemplatePreview().

◆ uiDefIconMenuBut()

uiBut * uiDefIconMenuBut ( uiBlock * block,
uiMenuCreateFunc func,
void * arg,
int icon,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefIconTextBut()

uiBut * uiDefIconTextBut ( uiBlock * block,
int type,
int retval,
int icon,
blender::StringRef str,
int x,
int y,
short width,
short height,
void * poin,
float min,
float max,
const char * tip )

Button containing both string label and icon.

Definition at line 5723 of file interface.cc.

References uiBut::drawflag, min, str, UI_BUT_ICON_LEFT, ui_but_update_and_icon_set(), and ui_def_but().

Referenced by asset_view_draw_item(), block_create_autorun_warning(), colorband_buttons_layout(), colorband_tools_fn(), create_title_button(), curve_profile_presets_fn(), curve_profile_tools_fn(), curvemap_tools_func(), CurveProfile_buttons_layout(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_byte_color(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_content_cell(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_float4x4(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_float_vector(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_int_vector(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_left_column_cell(), blender::ed::spreadsheet::SpreadsheetLayoutDrawer::draw_top_row_cell(), graph_draw_driver_settings_panel(), save_file_overwrite_cancel_button(), save_file_overwrite_confirm_button(), save_file_overwrite_saveas_button(), template_ID(), template_id_def_new_but(), template_operator_property_buts_draw_single(), template_texture_user_menu(), blender::ed::space_node::ui_node_draw_panel(), blender::ed::space_node::ui_node_menu_column(), UI_pie_menu_begin(), ui_pie_menu_level_create(), UI_popup_block_template_confirm_op(), ui_popup_context_menu_for_button(), uiDefIconTextButI(), uiItemL_(), uiLayoutPanelProp(), uiTemplateRunningJobs(), wm_block_file_close_cancel_button(), wm_block_file_close_discard_button(), wm_block_file_close_save_button(), and wm_block_insert_unicode_create().

◆ uiDefIconTextButI()

uiBut * uiDefIconTextButI ( uiBlock * block,
int type,
int retval,
int icon,
const StringRef str,
int x,
int y,
short width,
short height,
int * poin,
float min,
float max,
const char * tip )

Definition at line 5742 of file interface.cc.

References min, str, UI_BUT_POIN_INT, and uiDefIconTextBut().

Referenced by ui_def_but_rna__menu().

◆ uiDefIconTextButO()

uiBut * uiDefIconTextButO ( uiBlock * block,
int type,
const char * opname,
wmOperatorCallContext opcontext,
int icon,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefIconTextButO_ptr()

uiBut * uiDefIconTextButO_ptr ( uiBlock * block,
int type,
wmOperatorType * ot,
wmOperatorCallContext opcontext,
int icon,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefIconTextButR()

uiBut * uiDefIconTextButR ( uiBlock * block,
int type,
int retval,
int icon,
const char * str,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
const char * propname,
int index,
float min,
float max,
const char * tip )

◆ uiDefIconTextButR_prop()

uiBut * uiDefIconTextButR_prop ( uiBlock * block,
int type,
int retval,
int icon,
const char * str,
int x,
int y,
short width,
short height,
PointerRNA * ptr,
PropertyRNA * prop,
int index,
float min,
float max,
const char * tip )

◆ uiDefIconTextMenuBut()

uiBut * uiDefIconTextMenuBut ( uiBlock * block,
uiMenuCreateFunc func,
void * arg,
int icon,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefMenuBut()

uiBut * uiDefMenuBut ( uiBlock * block,
uiMenuCreateFunc func,
void * arg,
const StringRef str,
int x,
int y,
short width,
short height,
const char * tip )

◆ uiDefSearchBut()

◆ uiDefSearchButO_ptr()

uiBut * uiDefSearchButO_ptr ( uiBlock * block,
wmOperatorType * ot,
IDProperty * properties,
void * arg,
int retval,
int icon,
int maxncpy,
int x,
int y,
short width,
short height,
const char * tip )

Same parameters as for uiDefSearchBut, with additional operator type and properties, used by callback to call again the right op with the right options (properties values).

Definition at line 6499 of file interface.cc.

References PointerRNA::data, IDP_CopyProperty(), uiBut::opcontext, operator_enum_search_exec_fn(), operator_enum_search_update_fn(), uiBut::optype, ot, ptr, UI_but_func_search_set(), UI_but_operator_ptr_ensure(), ui_searchbox_create_generic(), uiDefSearchBut(), and WM_OP_EXEC_DEFAULT.

Referenced by wm_enum_search_menu().

Variable Documentation

◆ ui_radial_dir_order

const char ui_radial_dir_order[8]
Initial value:

Definition at line 1522 of file interface.cc.

Referenced by ui_get_radialbut_vec().

◆ ui_radial_dir_to_angle

const short ui_radial_dir_to_angle[8] = {90, 45, 0, 315, 270, 225, 180, 135}

Definition at line 1534 of file interface.cc.

Referenced by ui_but_pie_dir().

◆ ui_radial_dir_to_numpad

const char ui_radial_dir_to_numpad[8] = {8, 9, 6, 3, 2, 1, 4, 7}

Definition at line 1533 of file interface.cc.

Referenced by ui_but_pie_direction_string().