Blender  V2.93
Classes | Macros | Functions | Variables
interface.c File Reference
#include <ctype.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stddef.h>
#include <string.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 "DNA_workspace_types.h"
#include "BLI_alloca.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_string_search.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
#include "BLO_readfile.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_idprop.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_unit.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "BLF_api.h"
#include "BLT_translation.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_view2d.h"
#include "IMB_imbuf.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "ED_numinput.h"
#include "ED_screen.h"
#include "IMB_colormanagement.h"
#include "DEG_depsgraph_query.h"
#include "interface_intern.h"

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   IFACE_("Error evaluating number, see Info editor for details")
 

Functions

static void ui_but_to_pixelrect (struct rcti *rect, const struct ARegion *region, struct uiBlock *block, struct uiBut *but)
 
static void ui_def_but_rna__menu (bContext *UNUSED(C), uiLayout *layout, void *but_p)
 
static void ui_def_but_rna__panel_type (bContext *UNUSED(C), uiLayout *layout, void *but_p)
 
static void ui_def_but_rna__menu_type (bContext *UNUSED(C), uiLayout *layout, void *but_p)
 
static void ui_but_free (const bContext *C, uiBut *but)
 
static bool ui_but_is_unit_radians_ex (UnitSettings *unit, const int unit_type)
 
static bool ui_but_is_unit_radians (const uiBut *but)
 
void ui_block_to_window_fl (const ARegion *region, uiBlock *block, float *r_x, float *r_y)
 
void ui_block_to_window (const ARegion *region, uiBlock *block, int *r_x, int *r_y)
 
void ui_block_to_window_rctf (const ARegion *region, uiBlock *block, rctf *rct_dst, const rctf *rct_src)
 
float ui_block_to_window_scale (const ARegion *region, uiBlock *block)
 
void ui_window_to_block_fl (const ARegion *region, uiBlock *block, float *r_x, float *r_y)
 
void ui_window_to_block_rctf (const struct ARegion *region, uiBlock *block, rctf *rct_dst, const rctf *rct_src)
 
void ui_window_to_block (const ARegion *region, uiBlock *block, int *r_x, int *r_y)
 
void ui_window_to_region (const ARegion *region, int *r_x, int *r_y)
 
void ui_window_to_region_rcti (const ARegion *region, rcti *rect_dst, const rcti *rct_src)
 
void ui_region_to_window (const ARegion *region, int *r_x, int *r_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 struct ARegion *region, struct rcti *r_rect)
 
void UI_block_translate (uiBlock *block, int x, int 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 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_but_pie_direction_string (uiBut *but, char *buf, int size)
 
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 (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 (short *points, float aspect)
 
static void ui_but_to_pixelrect (rcti *rect, const ARegion *region, uiBlock *block, uiBut *but)
 
void UI_block_draw (const bContext *C, uiBlock *block)
 
static void ui_block_message_subscribe (ARegion *region, struct wmMsgBus *mbus, uiBlock *block)
 
void UI_region_message_subscribe (ARegion *region, struct 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])
 
bool ui_but_is_float (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_max_length (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 maxlen)
 
static void ui_get_but_string_unit (uiBut *but, char *str, int len_max, 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 maxlen, 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 maxlen)
 
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)
 
static void ui_but_string_set_internal (uiBut *but, const char *str, size_t str_len)
 
static void ui_but_string_free_internal (uiBut *but)
 
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)
 
void UI_block_free (const bContext *C, uiBlock *block)
 
void UI_blocklist_update_window_matrix (const bContext *C, const ListBase *lb)
 
void UI_blocklist_draw (const bContext *C, const ListBase *lb)
 
void UI_blocklist_free (const bContext *C, ListBase *lb)
 
void UI_blocklist_free_inactive (const bContext *C, ListBase *lb)
 
void UI_block_region_set (uiBlock *block, ARegion *region)
 
uiBlockUI_block_begin (const bContext *C, ARegion *region, const char *name, eUIEmbossType emboss)
 
char 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)
 
struct ColorManagedDisplayui_block_cm_display_get (uiBlock *block)
 
void ui_block_cm_to_display_space_v3 (uiBlock *block, float pixel[3])
 
static void ui_but_alloc_info (const eButType type, size_t *r_alloc_size, const char **r_alloc_str, bool *r_has_custom_type)
 
static uiButui_but_alloc (const eButType type)
 
uiButui_but_change_type (uiBut *but, eButType new_type)
 
static uiButui_def_but (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
 ui_def_but is the function that draws many button types More...
 
void ui_def_but_icon (uiBut *but, const int icon, const int flag)
 
void ui_def_but_icon_clear (uiBut *but)
 
static void ui_def_but_rna__panel_type (bContext *C, uiLayout *layout, void *but_p)
 
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)
 
static void ui_def_but_rna__menu_type (bContext *C, uiLayout *layout, void *but_p)
 
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, float a1, float a2, 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, float a1, float a2, const char *tip)
 
static uiButui_def_but_operator_ptr (uiBlock *block, int type, wmOperatorType *ot, int opcontext, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefBut (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, 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 height)
 
static int findBitIndex (uint x)
 
AutoCompleteUI_autocomplete_begin (const char *startname, size_t maxlen)
 
void UI_autocomplete_update_name (AutoComplete *autocpl, const char *name)
 
int UI_autocomplete_end (AutoComplete *autocpl, char *autoname)
 
static void ui_but_update_and_icon_set (uiBut *but, int icon)
 
static uiButuiDefButBit (uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButF (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButBitF (uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButI (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButBitI (uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButS (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButBitS (uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButC (uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefButBitC (uiBlock *block, int type, int bit, int retval, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, const char *tip)
 
uiButuiDefButO_ptr (uiBlock *block, int type, wmOperatorType *ot, int opcontext, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefButO (uiBlock *block, int type, const char *opname, int 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, float a1, float a2, 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, float a1, float a2, const char *tip)
 
uiButuiDefIconButF (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconButBitF (uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, const char *tip)
 
uiButuiDefIconButC (uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, const char *tip)
 
uiButuiDefIconButO_ptr (uiBlock *block, int type, wmOperatorType *ot, int opcontext, int icon, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconButO (uiBlock *block, int type, const char *opname, int opcontext, int icon, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconTextBut (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
 
static uiButuiDefIconTextButBit (uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButF (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButBitF (uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, float *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButI (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButBitI (uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, int *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButS (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButBitS (uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, short *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButC (uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButBitC (uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x, int y, short width, short height, char *poin, float min, float max, float a1, float a2, 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, float a1, float a2, 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, float a1, float a2, const char *tip)
 
uiButuiDefIconTextButO_ptr (uiBlock *block, int type, wmOperatorType *ot, int opcontext, int icon, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconTextButO (uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, int x, int y, short width, short height, const char *tip)
 
int UI_blocklist_min_y_get (ListBase *lb)
 
void UI_block_direction_set (uiBlock *block, char direction)
 
void UI_block_order_flip (uiBlock *block)
 
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_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_disable (uiBut *but, const char *disabled_hint)
 
void UI_but_type_set_menu_from_pulldown (uiBut *but)
 
int UI_but_return_value_get (uiBut *but)
 
void UI_but_drag_set_id (uiBut *but, ID *id)
 
void UI_but_drag_set_asset (uiBut *but, const char *name, const char *path, int id_type, int icon, struct ImBuf *imb, float scale)
 
void UI_but_drag_set_rna (uiBut *but, PointerRNA *ptr)
 
void UI_but_drag_set_path (uiBut *but, const char *path, const bool use_free)
 
void UI_but_drag_set_name (uiBut *but, const char *name)
 
void UI_but_drag_set_value (uiBut *but)
 
void UI_but_drag_set_image (uiBut *but, const char *path, int icon, struct ImBuf *imb, float scale, const bool use_free)
 
PointerRNAUI_but_operator_ptr_get (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_butmenu_set (uiBlock *block, uiMenuHandleFunc 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)
 
void UI_but_func_rename_set (uiBut *but, uiButHandleRenameFunc func, void *arg1)
 
void UI_but_func_drawextra_set (uiBlock *block, void(*func)(const bContext *C, void *idv, void *arg1, void *arg2, rcti *rect), void *arg1, void *arg2)
 
void UI_but_func_set (uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
 
void UI_but_funcN_set (uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
 
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_set (uiBut *but, uiButToolTipFunc func, void *argN)
 
void UI_but_func_pushed_state_set (uiBut *but, uiButPushedStateFunc func, void *arg)
 
uiButuiDefBlockBut (uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefBlockButN (uiBlock *block, uiBlockCreateFunc func, void *argN, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefPulldownBut (uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefMenuBut (uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
 
uiButuiDefIconTextMenuBut (uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *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)
 
uiButuiDefIconTextBlockBut (uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, const char *str, 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)
 
uiButuiDefKeyevtButS (uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *spoin, const char *tip)
 
uiButuiDefHotKeyevtButS (uiBlock *block, int retval, const char *str, int x, int y, short width, short height, short *keypoin, const short *modkeypoin, const char *tip)
 
uiButuiDefSearchBut (uiBlock *block, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, 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, uiButSearchArgFreeFn 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_results_are_suggestions (uiBut *but, const bool value)
 
static void operator_enum_search_update_fn (const struct bContext *C, void *but, const char *str, uiSearchItems *items, const bool UNUSED(is_first))
 
static void operator_enum_search_exec_fn (struct bContext *UNUSED(C), void *but, void *arg2)
 
uiButuiDefSearchButO_ptr (uiBlock *block, wmOperatorType *ot, IDProperty *properties, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip)
 
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_focus_on_enter_event (wmWindow *win, uiBut *but)
 
void UI_but_func_hold_set (uiBut *but, uiButHandleHoldFunc func, void *argN)
 
void UI_but_string_info_get (bContext *C, uiBut *but,...)
 
void UI_init (void)
 
void UI_init_userdef (void)
 
void UI_reinit_font (void)
 
void UI_exit (void)
 
void UI_interface_tag_script_reload (void)
 
Find Key Shortcut for Button
static bool ui_but_event_operator_string_from_operator (const bContext *C, uiBut *but, char *buf, const size_t buf_len)
 
static bool ui_but_event_operator_string_from_menu (const bContext *C, uiBut *but, char *buf, const size_t buf_len)
 
static bool ui_but_event_operator_string_from_panel (const bContext *C, uiBut *but, char *buf, const size_t buf_len)
 
static bool ui_but_event_operator_string (const bContext *C, uiBut *but, char *buf, const size_t buf_len)
 
static bool ui_but_event_property_operator_string (const bContext *C, uiBut *but, char *buf, const size_t buf_len)
 

Variables

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}
 

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 }
 
typedef enum PredefinedExtraOpIconType PredefinedExtraOpIconType
 
static PointerRNAui_but_extra_operator_icon_add_ptr (uiBut *but, wmOperatorType *optype, short 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, short opcontext, int 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 PredefinedExtraOpIconType ui_but_icon_extra_get (uiBut *but)
 
static void ui_but_predefined_extra_operator_icons_add (uiBut *but)
 

Macro Definition Documentation

◆ B_NOP

#define B_NOP   -1

Definition at line 108 of file interface.c.

◆ UI_BUT_VALUE_UNSET

#define UI_BUT_VALUE_UNSET   DBL_MAX

Definition at line 101 of file interface.c.

◆ 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: interface.c:2431

Definition at line 102 of file interface.c.

◆ UI_NUMBER_EVAL_ERROR_PREFIX

#define UI_NUMBER_EVAL_ERROR_PREFIX   IFACE_("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 2911 of file interface.c.

Typedef Documentation

◆ PredefinedExtraOpIconType

Predefined types for generic extra operator icons (uiButExtraOpIcon).

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 

Definition at line 1605 of file interface.c.

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: interface.c:4744

Definition at line 4744 of file interface.c.

References is_power_of_2_i(), and x.

Referenced by uiDefButBit(), uiDefIconButBit(), and uiDefIconTextButBit().

◆ operator_enum_search_exec_fn()

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

◆ operator_enum_search_update_fn()

static void operator_enum_search_update_fn ( const struct bContext C,
void *  but,
const char *  str,
uiSearchItems items,
const bool   UNUSEDis_first 
)
static

◆ soft_range_round_down()

static double soft_range_round_down ( double  value,
double  max 
)
static

Definition at line 3179 of file interface.c.

References floor(), KDL::log(), M_LN10, max, and KDL::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 3164 of file interface.c.

References ceil(), KDL::log(), M_LN10, max, and KDL::pow().

Referenced by ui_but_range_set_soft().

◆ UI_autocomplete_begin()

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

◆ UI_autocomplete_end()

int UI_autocomplete_end ( AutoComplete autocpl,
char *  autoname 
)

◆ 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 wont be removed, see: T71112.

Definition at line 990 of file interface.c.

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

◆ UI_block_align_begin()

void UI_block_align_begin ( uiBlock block)

◆ UI_block_align_end()

void UI_block_align_end ( uiBlock block)

◆ UI_block_begin()

uiBlock* UI_block_begin ( const bContext C,
ARegion region,
const char *  name,
eUIEmbossType  emboss 
)

◆ ui_block_bounds_calc()

void ui_block_bounds_calc ( uiBlock block)

◆ 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()

static void ui_block_bounds_calc_popup ( wmWindow window,
uiBlock block,
eBlockBoundsCalc  bounds_calc,
const int  xy[2],
int  r_xy[2] 
)
static

◆ ui_block_bounds_calc_text()

static void ui_block_bounds_calc_text ( uiBlock block,
float  offset 
)
static

◆ UI_block_bounds_set_centered()

void UI_block_bounds_set_centered ( uiBlock block,
int  addval 
)

◆ 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()

void UI_block_bounds_set_normal ( uiBlock block,
int  addval 
)

◆ UI_block_bounds_set_popup()

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

◆ UI_block_bounds_set_text()

void UI_block_bounds_set_text ( uiBlock block,
int  addval 
)

◆ ui_block_cm_display_get()

struct ColorManagedDisplay* ui_block_cm_display_get ( uiBlock block)

◆ ui_block_cm_to_display_space_v3()

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

◆ UI_block_direction_set()

void UI_block_direction_set ( uiBlock block,
char  direction 
)

◆ UI_block_draw()

void UI_block_draw ( const bContext C,
uiBlock block 
)

◆ UI_block_emboss_get()

char UI_block_emboss_get ( uiBlock block)

Definition at line 3537 of file interface.c.

References uiBlock::emboss.

Referenced by uiTemplateReportsBanner().

◆ UI_block_emboss_set()

void UI_block_emboss_set ( uiBlock block,
eUIEmbossType  emboss 
)

◆ UI_block_end()

void UI_block_end ( const bContext C,
uiBlock block 
)

Definition at line 1934 of file interface.c.

References C, CTX_wm_window(), wmWindow::eventstate, NULL, UI_block_end_ex(), and wmEvent::x.

Referenced by UI_block_draw().

◆ 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()

void UI_block_flag_enable ( uiBlock block,
int  flag 
)

◆ UI_block_free()

void UI_block_free ( const bContext C,
uiBlock block 
)

◆ UI_block_func_butmenu_set()

void UI_block_func_butmenu_set ( uiBlock block,
uiMenuHandleFunc  func,
void *  arg 
)

◆ UI_block_func_handle_set()

void UI_block_func_handle_set ( uiBlock block,
uiBlockHandleFunc  func,
void *  arg 
)

◆ UI_block_func_set()

void UI_block_func_set ( uiBlock block,
uiButHandleFunc  func,
void *  arg1,
void *  arg2 
)

◆ UI_block_funcN_set()

void UI_block_funcN_set ( uiBlock block,
uiButHandleNFunc  funcN,
void *  argN,
void *  arg2 
)

◆ UI_block_is_search_only()

bool UI_block_is_search_only ( const uiBlock block)

Definition at line 3552 of file interface.c.

References uiBlock::flag, and UI_BLOCK_SEARCH_ONLY.

Referenced by UI_panels_draw().

◆ UI_block_lock_clear()

void UI_block_lock_clear ( uiBlock block)

◆ UI_block_lock_set()

void UI_block_lock_set ( uiBlock block,
bool  val,
const char *  lockstr 
)

◆ ui_block_message_subscribe()

static void ui_block_message_subscribe ( ARegion region,
struct wmMsgBus mbus,
uiBlock block 
)
static

◆ UI_block_order_flip()

void UI_block_order_flip ( uiBlock block)

◆ UI_block_region_set()

void UI_block_region_set ( uiBlock block,
ARegion region 
)

◆ 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 3561 of file interface.c.

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()

void UI_block_theme_style_set ( uiBlock block,
char  theme_style 
)

◆ ui_block_to_window()

void ui_block_to_window ( const ARegion region,
uiBlock block,
int *  r_x,
int *  r_y 
)

Definition at line 157 of file interface.c.

References ui_block_to_window_fl().

◆ ui_block_to_window_fl()

void ui_block_to_window_fl ( const ARegion region,
uiBlock block,
float r_x,
float r_y 
)

◆ ui_block_to_window_rctf()

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

◆ ui_block_to_window_scale()

float ui_block_to_window_scale ( const ARegion region,
uiBlock block 
)

Definition at line 178 of file interface.c.

References ui_block_to_window_fl().

Referenced by ui_but_drag_init().

◆ UI_block_translate()

void UI_block_translate ( uiBlock block,
int  x,
int  y 
)

◆ UI_block_update_from_old()

void UI_block_update_from_old ( const bContext C,
uiBlock block 
)

◆ UI_blocklist_draw()

void UI_blocklist_draw ( const bContext C,
const ListBase lb 
)

Definition at line 3435 of file interface.c.

References C, LISTBASE_FOREACH, and UI_block_draw().

◆ UI_blocklist_free()

void UI_blocklist_free ( const bContext C,
ListBase lb 
)

Definition at line 3445 of file interface.c.

References BLI_pophead(), C, and UI_block_free().

◆ UI_blocklist_free_inactive()

void UI_blocklist_free_inactive ( const bContext C,
ListBase lb 
)

Definition at line 3453 of file interface.c.

References BLI_remlink(), C, LISTBASE_FOREACH_MUTABLE, and UI_block_free().

◆ UI_blocklist_min_y_get()

int UI_blocklist_min_y_get ( ListBase lb)

Definition at line 6015 of file interface.c.

References ListBase::first, LISTBASE_FOREACH, and min.

◆ UI_blocklist_update_window_matrix()

void UI_blocklist_update_window_matrix ( const bContext C,
const ListBase lb 
)

◆ UI_but_active_only()

bool UI_but_active_only ( const bContext C,
ARegion region,
uiBlock block,
uiBut but 
)

Definition at line 981 of file interface.c.

References C, and UI_but_active_only_ex().

◆ UI_but_active_only_ex()

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

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 942 of file interface.c.

References activate(), uiBut::active, BLI_remlink(), uiBlock::buttons, C, uiBlock::oldblock, ui_but_activate_event(), ui_but_active_free(), ui_but_find_old(), ui_but_free(), 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_alloc()

static uiBut* ui_but_alloc ( const eButType  type)
static

Definition at line 3919 of file interface.c.

References MEM_callocN, NULL, type, and ui_but_alloc_info().

Referenced by ui_def_but().

◆ ui_but_alloc_info()

static void ui_but_alloc_info ( const eButType  type,
size_t *  r_alloc_size,
const char **  r_alloc_str,
bool *  r_has_custom_type 
)
static

◆ ui_but_build_drawstr_float()

static void ui_but_build_drawstr_float ( uiBut but,
double  value 
)
static

◆ ui_but_build_drawstr_int()

static void ui_but_build_drawstr_int ( uiBut but,
int  value 
)
static

◆ ui_but_calc_float_precision()

static int ui_but_calc_float_precision ( uiBut but,
double  value 
)
static

◆ 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 3935 of file interface.c.

References BLI_assert, BLI_insertlinkafter(), BLI_remlink(), uiBut::block, uiBlock::buttons, uiBut::layout, MEM_recallocN_id, NULL, uiBut::poin, uiBut::prev, uiBut::str, uiBut::strdata, uiBut::type, ui_but_alloc_info(), 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_context_poll_operator()

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

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 1824 of file interface.c.

References C, uiBut::context, CTX_store_set(), NULL, uiBut::opcontext, ot, result, WM_OP_INVOKE_DEFAULT, and WM_operator_poll_context().

Referenced by UI_block_end_ex().

◆ ui_but_convert_to_unit_alt_name()

void ui_but_convert_to_unit_alt_name ( uiBut but,
char *  str,
size_t  maxlen 
)

◆ UI_but_disable()

void UI_but_disable ( uiBut but,
const char *  disabled_hint 
)

◆ ui_but_drag_multi_edit_get()

uiBut* ui_but_drag_multi_edit_get ( uiBut but)

◆ UI_but_drag_set_asset()

void UI_but_drag_set_asset ( uiBut but,
const char *  name,
const char *  path,
int  id_type,
int  icon,
struct ImBuf imb,
float  scale 
)

◆ UI_but_drag_set_id()

void UI_but_drag_set_id ( uiBut but,
ID id 
)

◆ UI_but_drag_set_image()

void UI_but_drag_set_image ( uiBut but,
const char *  path,
int  icon,
struct ImBuf imb,
float  scale,
const bool  use_free 
)

◆ UI_but_drag_set_name()

void UI_but_drag_set_name ( uiBut but,
const char *  name 
)

◆ UI_but_drag_set_path()

void UI_but_drag_set_path ( uiBut but,
const char *  path,
const bool  use_free 
)

◆ UI_but_drag_set_rna()

void UI_but_drag_set_rna ( uiBut but,
PointerRNA ptr 
)

◆ UI_but_drag_set_value()

void UI_but_drag_set_value ( uiBut but)

Definition at line 6196 of file interface.c.

References uiBut::dragtype, and WM_DRAG_VALUE.

◆ UI_but_drawflag_disable()

void UI_but_drawflag_disable ( uiBut but,
int  flag 
)

◆ UI_but_drawflag_enable()

void UI_but_drawflag_enable ( uiBut but,
int  flag 
)

◆ ui_but_equals_old()

static bool ui_but_equals_old ( const uiBut but,
const uiBut oldbut 
)
static

◆ ui_but_event_operator_string()

static bool ui_but_event_operator_string ( const bContext C,
uiBut but,
char *  buf,
const size_t  buf_len 
)
static

◆ ui_but_event_operator_string_from_menu()

static bool ui_but_event_operator_string_from_menu ( const bContext C,
uiBut but,
char *  buf,
const size_t  buf_len 
)
static

◆ ui_but_event_operator_string_from_operator()

static bool ui_but_event_operator_string_from_operator ( const bContext C,
uiBut but,
char *  buf,
const size_t  buf_len 
)
static

◆ ui_but_event_operator_string_from_panel()

static bool ui_but_event_operator_string_from_panel ( const bContext C,
uiBut but,
char *  buf,
const size_t  buf_len 
)
static

◆ ui_but_event_property_operator_string()

static bool ui_but_event_property_operator_string ( const bContext C,
uiBut but,
char *  buf,
const size_t  buf_len 
)
static

◆ UI_but_execute()

void UI_but_execute ( const bContext C,
ARegion region,
uiBut but 
)

Definition at line 1021 of file interface.c.

References C, ui_but_execute_begin(), and ui_but_execute_end().

◆ 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_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()

PointerRNA* UI_but_extra_operator_icon_add ( uiBut but,
const char *  opname,
short  opcontext,
int  icon 
)

◆ ui_but_extra_operator_icon_add_ptr()

static PointerRNA* ui_but_extra_operator_icon_add_ptr ( uiBut but,
wmOperatorType optype,
short  opcontext,
int  icon 
)
static

◆ ui_but_extra_operator_icon_free()

static void ui_but_extra_operator_icon_free ( uiButExtraOpIcon extra_icon)
static

◆ 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 736 of file interface.c.

References uiBlock::buttons, LISTBASE_FOREACH, NULL, 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_flag_disable()

void UI_but_flag_disable ( uiBut but,
int  flag 
)

◆ UI_but_flag_enable()

void UI_but_flag_enable ( uiBut but,
int  flag 
)

◆ UI_but_flag_is_set()

bool UI_but_flag_is_set ( uiBut but,
int  flag 
)

◆ 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 6850 of file interface.c.

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()

static void ui_but_free ( const bContext C,
uiBut but 
)
static

◆ 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 3325 of file interface.c.

References uiButSearch::arg, uiButSearch::arg_free_fn, NULL, 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,
void(*)(const bContext *C, void *idv, void *arg1, void *arg2, rcti *rect)  func,
void *  arg1,
void *  arg2 
)

◆ UI_but_func_hold_set()

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

Definition at line 6864 of file interface.c.

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 6318 of file interface.c.

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,
uiButPushedStateFunc  func,
void *  arg 
)

Definition at line 6332 of file interface.c.

References uiBut::pushed_state_arg, and uiBut::pushed_state_func.

◆ UI_but_func_rename_set()

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

Definition at line 6277 of file interface.c.

References uiBut::rename_arg1, and uiBut::rename_func.

Referenced by file_draw_list(), and outliner_buttons().

◆ UI_but_func_search_set()

void UI_but_func_search_set ( uiBut but,
uiButSearchCreateFn  search_create_fn,
uiButSearchUpdateFn  search_update_fn,
void *  arg,
const bool  free_arg,
uiButSearchArgFreeFn  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 6613 of file interface.c.

References blender::compositor::active, uiButSearch::arg, uiButSearch::arg_free_fn, BLI_assert, uiBut::block, uiButSearch::but, uiBut::drawstr, uiBlock::flag, uiBut::func, uiButSearch::item_active, uiButSearch::items_update_fn, NULL, uiButSearch::popup_create_fn, 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 merged_element_search_menu(), node_find_menu(), 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_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 6683 of file interface.c.

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

Referenced by 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()

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

◆ UI_but_func_tooltip_set()

void UI_but_func_tooltip_set ( uiBut but,
uiButToolTipFunc  func,
void *  argN 
)

◆ UI_but_funcN_set()

void UI_but_funcN_set ( uiBut but,
uiButHandleNFunc  funcN,
void *  argN,
void *  arg2 
)

◆ ui_but_get_float_precision()

static float ui_but_get_float_precision ( uiBut but)
static

Definition at line 641 of file interface.c.

References uiBut::a2, uiBut::type, and UI_BTYPE_NUM.

Referenced by ui_but_calc_float_precision(), and ui_get_but_string_unit().

◆ ui_but_icon_extra_get()

static PredefinedExtraOpIconType ui_but_icon_extra_get ( uiBut but)
static

◆ 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_is_bool()

bool ui_but_is_bool ( const uiBut but)

◆ 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 2385 of file interface.c.

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

Referenced by ui_multibut_states_tag().

◆ ui_but_is_float()

bool ui_but_is_float ( const uiBut but)

◆ ui_but_is_pushed()

int ui_but_is_pushed ( uiBut but)

Definition at line 2191 of file interface.c.

References ui_but_is_pushed_ex(), and UI_BUT_VALUE_UNSET.

Referenced by ui_drag_toggle_but_pushed_state().

◆ ui_but_is_pushed_ex()

int ui_but_is_pushed_ex ( uiBut but,
double value 
)

◆ 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 362 of file interface.c.

References left, and right.

Referenced by ui_block_bounds_calc_text().

◆ ui_but_is_unit()

bool ui_but_is_unit ( const uiBut but)

◆ 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 ( UnitSettings unit,
const int  unit_type 
)
static

◆ ui_but_menu_draw_as_popover()

bool ui_but_menu_draw_as_popover ( const uiBut but)

◆ 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()

void UI_but_number_precision_set ( uiBut but,
float  precision 
)

◆ UI_but_number_step_size_set()

void UI_but_number_step_size_set ( uiBut but,
float  step_size 
)

◆ UI_but_operator_ptr_get()

PointerRNA* UI_but_operator_ptr_get ( uiBut but)

◆ ui_but_override_flag()

void ui_but_override_flag ( Main bmain,
uiBut but 
)

◆ ui_but_pie_direction_string()

static void ui_but_pie_direction_string ( uiBut but,
char *  buf,
int  size 
)
static

◆ 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 1721 of file interface.c.

References BLI_assert, uiBut::extra_op_icons, LISTBASE_FOREACH, NULL, 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()

void ui_but_range_set_hard ( uiBut but)

◆ ui_but_range_set_soft()

void ui_but_range_set_soft ( uiBut but)

◆ UI_but_return_value_get()

int UI_but_return_value_get ( uiBut but)

Definition at line 6122 of file interface.c.

References uiBut::retval.

◆ ui_but_rna_equals()

bool ui_but_rna_equals ( const uiBut a,
const uiBut b 
)

◆ 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()

void ui_but_rna_menu_convert_to_menu_type ( uiBut but,
const char *  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_string_eval_number()

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

◆ ui_but_string_free_internal()

static void ui_but_string_free_internal ( uiBut but)
static

Definition at line 3027 of file interface.c.

References MEM_freeN, NULL, uiBut::str, and uiBut::strdata.

Referenced by ui_but_update_ex().

◆ ui_but_string_get()

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

Definition at line 2847 of file interface.c.

References NULL, str, and ui_but_string_get_ex().

Referenced by ui_but_copy_text(), ui_but_update_ex(), and ui_tooltip_data_from_button().

◆ ui_but_string_get_dynamic()

char* ui_but_string_get_dynamic ( uiBut but,
int *  r_str_size 
)

◆ ui_but_string_get_ex()

void ui_but_string_get_ex ( uiBut but,
char *  str,
const size_t  maxlen,
const int  float_precision,
const bool  use_exp_float,
bool *  r_use_exp_float 
)

◆ ui_but_string_get_max_length()

int ui_but_string_get_max_length ( uiBut but)

◆ UI_but_string_info_get()

void UI_but_string_info_get ( bContext C,
uiBut but,
  ... 
)

Definition at line 6870 of file interface.c.

References BLI_strdup(), BLI_strdupn(), uiBut::block, BLT_I18NCONTEXT_DEFAULT, BLT_I18NCONTEXT_DEFAULT_BPYRNA, BLT_is_default_context(), BUT_GET_LABEL, BUT_GET_OP_KEYMAP, BUT_GET_PROP_KEYMAP, BUT_GET_RNA_LABEL, BUT_GET_RNA_LABEL_CONTEXT, BUT_GET_RNA_TIP, BUT_GET_RNAENUM_IDENTIFIER, BUT_GET_RNAENUM_LABEL, BUT_GET_RNAENUM_TIP, BUT_GET_RNAPROP_IDENTIFIER, BUT_GET_RNASTRUCT_IDENTIFIER, BUT_GET_TIP, C, PointerRNA::data, ELEM, uiBut::flag, uiBut::hardmax, PanelType::idname, MenuType::idname, wmOperatorType::idname, PanelType::label, MenuType::label, MEM_freeN, NULL, uiBut::opptr, uiBut::optype, ot, wmOperatorType::prop, PROP_ENUM, ptr, PanelType::rna_ext, MenuType::rna_ext, RNA_property_enum_get(), RNA_property_enum_items_gettexted(), RNA_property_identifier(), RNA_property_translation_context(), RNA_property_type(), RNA_property_ui_description(), RNA_property_ui_name(), RNA_struct_contains_property(), RNA_struct_identifier(), RNA_struct_translation_context(), RNA_struct_ui_description(), uiBut::rnapoin, uiBut::rnaprop, ExtensionRNA::srna, wmOperatorType::srna, uiBut::str, uiStringInfo::strinfo, t, uiBut::tip, uiBut::tip_argN, uiBut::tip_func, uiStringInfo::type, uiBut::type, type, PointerRNA::type, ui_block_is_menu(), UI_BTYPE_MENU, UI_BTYPE_POPOVER, UI_BTYPE_PULLDOWN, UI_BTYPE_ROW, UI_BTYPE_TAB, ui_but_event_operator_string(), ui_but_event_property_operator_string(), UI_BUT_HAS_SEP_CHAR, UI_but_menutype_get(), UI_but_operator_ptr_get(), UI_but_operatortype_get_from_enum_menu(), UI_but_paneltype_get(), ui_but_value_get(), UI_SEP_CHAR, WM_operator_properties_sanitize(), WM_operatortype_description(), and WM_operatortype_name().

Referenced by ui_popup_context_menu_for_button(), ui_tooltip_data_from_button(), and ui_tooltip_data_from_tool().

◆ ui_but_string_set()

bool ui_but_string_set ( bContext C,
uiBut but,
const char *  str 
)

◆ ui_but_string_set_internal()

static void ui_but_string_set_internal ( uiBut but,
const char *  str,
size_t  str_len 
)
static

Definition at line 3012 of file interface.c.

References BLI_assert, MEM_mallocN, NULL, str, uiBut::str, uiBut::strdata, and UI_MAX_NAME_STR.

Referenced by ui_but_update_ex(), and ui_def_but().

◆ 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 2423 of file interface.c.

References ELEM, uiBut::menu_step_func, NULL, 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() [1/2]

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

◆ ui_but_to_pixelrect() [2/2]

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

◆ UI_but_type_set_menu_from_pulldown()

void UI_but_type_set_menu_from_pulldown ( uiBut but)

◆ UI_but_unit_type_get()

int UI_but_unit_type_get ( const uiBut but)

◆ UI_but_unit_type_set()

void UI_but_unit_type_set ( uiBut but,
const int  unit_type 
)

◆ ui_but_update()

void ui_but_update ( uiBut but)

◆ ui_but_update_and_icon_set()

static void ui_but_update_and_icon_set ( uiBut but,
int  icon 
)
static

◆ ui_but_update_edited()

void ui_but_update_edited ( uiBut but)

◆ 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 3639 of file interface.c.

References BLI_assert, BLI_rctf_size_x(), BLI_snprintf(), BLI_strcpy_rlen(), BLI_strncpy(), uiBut::block, uiBut::drawflag, uiBut::drawstr, uiBut::editstr, uiBlock::evil_C, uiBut::flag, uiBlock::flag, uiBut::hardmax, uiBut::hardmin, uiBut::icon, EnumPropertyItem::icon, uiBut::iconadd, KM_ALT, KM_CTRL, KM_OSKEY, KM_SHIFT, uiBut::modifier_key, EnumPropertyItem::name, NULL, 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, 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_free_internal(), ui_but_string_get(), ui_but_string_set_internal(), 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, and WM_key_event_string().

Referenced by ui_but_update(), and ui_but_update_edited().

◆ ui_but_update_from_old_block()

static bool ui_but_update_from_old_block ( const bContext C,
uiBlock block,
uiBut **  but_p,
uiBut **  but_old_p 
)
static

◆ 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 788 of file interface.c.

References uiBut::active, uiBut::alignnr, uiButSearch::arg, uiButSearch::arg_free_fn, BLI_assert, BLI_strncpy(), uiBut::context, uiBut::dragflag, uiBut::dragpoin, uiBut::drawflag, ELEM, uiBut::extra_op_icons, uiBut::flag, uiBut::func_argN, uiBut::hardmax, uiBut::icon, uiBut::iconadd, MEM_freeN, uiBut::poin, uiButProgressbar::progress, uiBut::rect, uiBut::str, uiBut::strdata, SWAP, uiBut::tip_argN, uiBut::tip_func, uiBut::type, UI_BTYPE_LISTROW, UI_BTYPE_PROGRESS_BAR, UI_BTYPE_ROW, UI_BTYPE_SEARCH_MENU, UI_BUT_DRAGPOIN_FREE, ui_but_extra_icons_update_from_old_but(), UI_BUT_REDALERT, UI_HAS_ICON, and UI_SELECT_DRAW.

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 2197 of file interface.c.

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()

void ui_but_v3_get ( uiBut but,
float  vec[3] 
)

◆ ui_but_v3_set()

void ui_but_v3_set ( uiBut but,
const float  vec[3] 
)

◆ ui_but_validate()

static void ui_but_validate ( const uiBut but)
static

Extra sanity checks for invariants (debug builds only).

Definition at line 1805 of file interface.c.

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()

double ui_but_value_get ( uiBut but)

◆ ui_but_value_set()

void ui_but_value_set ( uiBut but,
double  value 
)

◆ ui_def_but()

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

ui_def_but is the function that draws many button types

Parameters
x,yThe lower left hand corner of the button (X axis)
width,heightThe size of the button.

for float buttons:

Parameters
a1Click Step (how much to change the value each click)
a2Number of decimal point values to display. 0 defaults to 3 (0.000) 1,2,3, and a maximum of 4, all greater values will be clamped to 4.

Definition at line 3995 of file interface.c.

References uiBut::a1, uiBut::a2, uiBut::alignnr, uiBlock::alignnr, uiBut::bit, uiBut::bitnr, BLI_addtail(), BLI_assert, uiBut::block, uiBlock::buttons, BUTTYPE, uiBlock::curlayout, uiBut::disabled_info, uiBut::drawflag, ELEM, uiBut::emboss, uiBlock::emboss, uiBut::flag, uiBlock::flag, uiBut::func, uiBlock::func, uiBut::func_arg1, uiBlock::func_arg1, uiBut::func_arg2, uiBlock::func_arg2, uiBut::func_argN, uiBlock::func_argN, uiBut::funcN, uiBlock::funcN, uiBut::hardmax, uiBut::hardmin, height, uiBut::icon, uiBut::iconadd, uiBlock::lock, uiBlock::lockstr, max, MEM_dupallocN, min, NULL, uiBut::pie_dir, uiBut::poin, uiBut::pointype, uiBut::pos, uiBut::rect, uiBut::retval, uiBut::softmax, uiBut::softmin, str, uiBut::str, uiBut::tip, uiBut::type, type, ui_block_is_popover(), UI_BLOCK_LOOP, UI_BLOCK_QUICK_SETUP, UI_BLOCK_RADIAL, UI_BTYPE_BLOCK, UI_BTYPE_BUT, UI_BTYPE_BUT_MENU, 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_PROGRESS_BAR, 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_alloc(), ui_but_can_align(), UI_BUT_DISABLED, UI_BUT_ICON_LEFT, UI_BUT_POIN_BIT, UI_BUT_POIN_TYPES, ui_but_string_set_internal(), UI_BUT_TEXT_LEFT, UI_BUT_UNDO, UI_editsource_active_but_test(), UI_editsource_enable_check(), ui_layout_add_but(), UI_MAX_NAME_STR, UI_RADIAL_NONE, width, 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(), uiDefHotKeyevtButS(), uiDefIconBlockBut(), uiDefIconBut(), uiDefIconMenuBut(), uiDefIconTextBlockBut(), uiDefIconTextBut(), uiDefIconTextMenuBut(), uiDefKeyevtButS(), uiDefMenuBut(), uiDefPulldownBut(), and uiDefSearchBut().

◆ ui_def_but_icon()

void ui_def_but_icon ( uiBut but,
const int  icon,
const int  flag 
)

◆ 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 4169 of file interface.c.

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

Referenced by uiItemFullR().

◆ ui_def_but_operator_ptr()

static uiBut* ui_def_but_operator_ptr ( uiBlock block,
int  type,
wmOperatorType ot,
int  opcontext,
const char *  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,
float  a1,
float  a2,
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 4419 of file interface.c.

References uiBut::a1, BLI_assert, uiBut::context, uiBlock::contexts, CTX_IFACE_, CTX_store_add(), PointerRNA::data, ELEM, uiBut::emboss, uiBlock::evil_C, uiBut::flag, free(), height, EnumPropertyItem::icon, ColorManagedDisplay::index, max, MEM_freeN, uiBut::menu_create_func, min, EnumPropertyItem::name, NULL, 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, str, uiBut::type, type, PointerRNA::type, UI_BTYPE_COLOR, UI_BTYPE_HSVCIRCLE, UI_BTYPE_HSVCUBE, UI_BTYPE_LISTROW, UI_BTYPE_MENU, UI_BTYPE_NUM, 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_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(), UI_HAS_ICON, width, x, and y.

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

◆ ui_def_but_rna__menu()

static void ui_def_but_rna__menu ( bContext UNUSEDC,
uiLayout layout,
void *  but_p 
)
static

◆ ui_def_but_rna__menu_type() [1/2]

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

◆ ui_def_but_rna__menu_type() [2/2]

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

◆ ui_def_but_rna__panel_type() [1/2]

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

◆ ui_def_but_rna__panel_type() [2/2]

static void ui_def_but_rna__panel_type ( bContext UNUSEDC,
uiLayout layout,
void *  but_p 
)
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,
float  a1,
float  a2,
const char *  tip 
)
static

◆ UI_exit()

void UI_exit ( void  )

Definition at line 7128 of file interface.c.

References ui_but_clipboard_free(), and ui_resources_free().

Referenced by WM_exit_ex().

◆ ui_fontscale()

void ui_fontscale ( short *  points,
float  aspect 
)

◆ ui_get_but_scale_unit()

static double ui_get_but_scale_unit ( uiBut but,
double  value 
)
static

◆ ui_get_but_step_unit()

static float ui_get_but_step_unit ( uiBut but,
float  step_default 
)
static

◆ ui_get_but_string_unit()

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

◆ UI_init()

void UI_init ( void  )

Definition at line 7111 of file interface.c.

References ui_resources_init().

Referenced by WM_init().

◆ UI_init_userdef()

void UI_init_userdef ( void  )

Definition at line 7117 of file interface.c.

References uiStyleInit().

Referenced by wm_init_userdef().

◆ UI_interface_tag_script_reload()

void UI_interface_tag_script_reload ( void  )

Definition at line 7134 of file interface.c.

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()

static void ui_menu_block_set_keymaps ( const bContext C,
uiBlock block 
)
static

◆ ui_number_from_string()

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

◆ 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

Definition at line 2972 of file interface.c.

References BLI_strdupn(), BLI_strn_endswith(), C, len, MEM_freeN, str, and ui_number_from_string().

Referenced by ui_but_string_eval_number().

◆ 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_region_message_subscribe()

void UI_region_message_subscribe ( ARegion region,
struct wmMsgBus mbus 
)

◆ ui_region_to_window()

void ui_region_to_window ( const ARegion region,
int *  r_x,
int *  r_y 
)

Definition at line 252 of file interface.c.

References ARegion::winrct, rcti::xmin, and rcti::ymin.

◆ ui_region_winrct_get_no_margin()

void ui_region_winrct_get_no_margin ( const struct ARegion region,
struct 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 339 of file interface.c.

References BLI_rcti_rctf_copy_floor(), BLI_rcti_translate(), ListBase::first, uiBlock::flag, uiBlock::rect, UI_BLOCK_LOOP, UI_BLOCK_RADIAL, ARegion::uiblocks, ARegion::winrct, rcti::xmin, and rcti::ymin.

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 ( void  )

Definition at line 7123 of file interface.c.

References uiStyleInit().

Referenced by reloadtranslation_exec().

◆ ui_update_flexible_spacing()

static void ui_update_flexible_spacing ( const ARegion region,
uiBlock block 
)
static

◆ ui_update_window_matrix()

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

◆ ui_window_to_block()

void ui_window_to_block ( const ARegion region,
uiBlock block,
int *  r_x,
int *  r_y 
)

◆ ui_window_to_block_fl()

void ui_window_to_block_fl ( const ARegion region,
uiBlock block,
float r_x,
float r_y 
)

◆ ui_window_to_block_rctf()

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

Definition at line 217 of file interface.c.

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 *  r_x,
int *  r_y 
)

Definition at line 238 of file interface.c.

References ARegion::winrct, rcti::xmin, and rcti::ymin.

Referenced by ui_region_contains_point_px().

◆ ui_window_to_region_rcti()

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

Definition at line 244 of file interface.c.

References ARegion::winrct, 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 char *  str,
int  x,
int  y,
short  width,
short  height,
const char *  tip 
)

◆ uiDefBlockButN()

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

◆ uiDefBut()

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

◆ 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 char *  str,
int  x,
int  y,
short  width,
short  height,
void *  poin,
float  min,
float  max,
float  a1,
float  a2,
const char *  tip 
)
static

Definition at line 4861 of file interface.c.

References findBitIndex(), height, max, min, NULL, str, type, UI_BUT_POIN_BIT, uiDefBut(), width, x, and y.

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

◆ uiDefButBitC()

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

Definition at line 5112 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_CHAR, uiDefButBit(), width, x, and y.

Referenced by block_create__close_file_dialog().

◆ uiDefButBitF()

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

Definition at line 4926 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_FLOAT, uiDefButBit(), width, x, and y.

◆ uiDefButBitI()

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

Definition at line 4988 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_INT, uiDefButBit(), width, x, and y.

Referenced by curvemap_clipping_func(), and uiTemplateMarker().

◆ uiDefButBitS()

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

Definition at line 5050 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_SHORT, uiDefButBit(), width, x, and y.

Referenced by v3d_editvertex_buts().

◆ uiDefButC()

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

Definition at line 5082 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_CHAR, uiDefBut(), width, x, and y.

Referenced by ui_block_colorpicker().

◆ uiDefButF()

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

◆ uiDefButI()

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

Definition at line 4958 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_INT, uiDefBut(), width, x, and y.

Referenced by curvemap_buttons_layout(), ui_def_but_rna__menu(), uiItemV(), and uiTemplateList().

◆ 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,
int  opcontext,
const char *  str,
int  x,
int  y,
short  width,
short  height,
const char *  tip 
)

Definition at line 5204 of file interface.c.

References height, NULL, ot, str, type, uiDefButO_ptr(), width, WM_operatortype_find(), x, and y.

Referenced by uiTemplateReportsBanner().

◆ uiDefButO_ptr()

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

Definition at line 5189 of file interface.c.

References height, ot, str, type, ui_but_update(), ui_def_but_operator_ptr(), width, x, and y.

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,
float  a1,
float  a2,
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,
float  a1,
float  a2,
const char *  tip 
)

◆ uiDefButS()

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

◆ uiDefHotKeyevtButS()

uiBut* uiDefHotKeyevtButS ( uiBlock block,
int  retval,
const char *  str,
int  x,
int  y,
short  width,
short  height,
short *  keypoin,
const short *  modkeypoin,
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()

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

◆ 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,
float  a1,
float  a2,
const char *  tip 
)
static

◆ 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,
float  a1,
float  a2,
const char *  tip 
)

Definition at line 5495 of file interface.c.

References height, max, min, type, UI_BUT_POIN_CHAR, uiDefIconButBit(), width, x, and y.

Referenced by draw_setting_widget().

◆ uiDefIconButBitF()

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

Definition at line 5309 of file interface.c.

References height, max, min, type, UI_BUT_POIN_FLOAT, uiDefIconButBit(), width, x, and y.

◆ 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,
float  a1,
float  a2,
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,
float  a1,
float  a2,
const char *  tip 
)

◆ uiDefIconButC()

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

Definition at line 5465 of file interface.c.

References height, max, min, type, UI_BUT_POIN_CHAR, uiDefIconBut(), width, x, and y.

◆ uiDefIconButF()

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

Definition at line 5279 of file interface.c.

References height, max, min, type, UI_BUT_POIN_FLOAT, uiDefIconBut(), width, x, and y.

◆ 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,
float  a1,
float  a2,
const char *  tip 
)

◆ uiDefIconButO()

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

◆ uiDefIconButO_ptr()

uiBut* uiDefIconButO_ptr ( uiBlock block,
int  type,
wmOperatorType ot,
int  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,
float  a1,
float  a2,
const char *  tip 
)

Definition at line 5527 of file interface.c.

References height, max, min, ptr, type, ui_but_update_and_icon_set(), ui_def_but_rna_propname(), width, x, and y.

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,
float  a1,
float  a2,
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,
float  a1,
float  a2,
const char *  tip 
)

Definition at line 5403 of file interface.c.

References height, max, min, type, UI_BUT_POIN_SHORT, uiDefIconBut(), width, x, and y.

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 
)

◆ uiDefIconTextBlockBut()

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

◆ uiDefIconTextBut()

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

◆ uiDefIconTextButBit()

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

◆ uiDefIconTextButBitC()

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

Definition at line 5893 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_CHAR, uiDefIconTextButBit(), width, x, and y.

◆ uiDefIconTextButBitF()

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

Definition at line 5695 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_FLOAT, uiDefIconTextButBit(), width, x, and y.

◆ uiDefIconTextButBitI()

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

Definition at line 5761 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_INT, uiDefIconTextButBit(), width, x, and y.

◆ uiDefIconTextButBitS()

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

Definition at line 5827 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_SHORT, uiDefIconTextButBit(), width, x, and y.

◆ uiDefIconTextButC()

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

Definition at line 5861 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_CHAR, uiDefIconTextBut(), width, x, and y.

◆ uiDefIconTextButF()

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

Definition at line 5663 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_FLOAT, uiDefIconTextBut(), width, x, and y.

◆ uiDefIconTextButI()

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

Definition at line 5729 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_INT, uiDefIconTextBut(), width, x, and y.

Referenced by ui_def_but_rna__menu(), and uiItemV().

◆ uiDefIconTextButO()

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

◆ uiDefIconTextButO_ptr()

uiBut* uiDefIconTextButO_ptr ( uiBlock block,
int  type,
wmOperatorType ot,
int  opcontext,
int  icon,
const char *  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,
float  a1,
float  a2,
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,
float  a1,
float  a2,
const char *  tip 
)

◆ uiDefIconTextButS()

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

Definition at line 5795 of file interface.c.

References height, max, min, str, type, UI_BUT_POIN_SHORT, uiDefIconTextBut(), width, x, and y.

◆ uiDefIconTextMenuBut()

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

◆ uiDefKeyevtButS()

uiBut* uiDefKeyevtButS ( uiBlock block,
int  retval,
const char *  str,
int  x,
int  y,
short  width,
short  height,
short *  spoin,
const char *  tip 
)

Definition at line 6511 of file interface.c.

References height, str, UI_BTYPE_KEY_EVENT, UI_BUT_POIN_SHORT, ui_but_update(), ui_def_but(), width, x, and y.

◆ uiDefMenuBut()

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

◆ uiDefPulldownBut()

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

◆ uiDefSearchBut()

uiBut* uiDefSearchBut ( uiBlock block,
void *  arg,
int  retval,
int  icon,
int  maxlen,
int  x,
int  y,
short  width,
short  height,
float  a1,
float  a2,
const char *  tip 
)

◆ uiDefSearchButO_ptr()

uiBut* uiDefSearchButO_ptr ( uiBlock block,
wmOperatorType ot,
IDProperty properties,
void *  arg,
int  retval,
int  icon,
int  maxlen,
int  x,
int  y,
short  width,
short  height,
float  a1,
float  a2,
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 6783 of file interface.c.

References PointerRNA::data, height, IDP_CopyProperty(), NULL, 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_get(), ui_searchbox_create_generic(), uiDefSearchBut(), width, WM_OP_EXEC_DEFAULT, x, and y.

Referenced by wm_enum_search_menu().

Variable Documentation

◆ ui_radial_dir_order

const char ui_radial_dir_order[8]
Initial value:

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

Definition at line 1511 of file interface.c.

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 1523 of file interface.c.

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 1522 of file interface.c.

Referenced by ui_but_pie_direction_string().