39#include "RNA_prototypes.hh"
48#include "fmt/format.h"
56#define UI_PROP_DECORATE
59#define UI_PROP_SEP_ICON_WIDTH_EXCEPTION
65#define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement) \
66 if (ot == nullptr) { \
67 ui_item_disabled(layout, _opname); \
68 RNA_warning("'%s' unknown operator", _opname); \
73#define UI_ITEM_PROP_SEP_DIVIDE 0.4f
197 memcpy(namestr, name.
data(),
len);
199 namestr[
len + 1] =
'\0';
211 memcpy(namestr, name.
data(),
len);
213 namestr[
len + 1] =
'\0';
233 if (
all > available) {
236 return available -
pos;
239 const float width = *extra_pixel + (item * available) /
float(
all);
240 *extra_pixel = width - int(width);
247 return available -
pos;
250 const float width = *extra_pixel + (item * available) /
float(
all);
251 *extra_pixel = width - int(width);
258#define UI_ITEM_VARY_X 1
259#define UI_ITEM_VARY_Y 2
317 return unit_x * (1.0f + pad_factor.
icon_only);
322 return unit_x * (1.0f + pad_factor.
icon_only);
326 layout->
flag_ |= uiItemInternalFlag::FixedSize;
329 float margin = pad_factor.
text;
331 margin += pad_factor.
icon;
336 int(
ceilf(unit_x * margin));
352 if (item->
type_ == uiItemType::Button) {
376 if (item->
type_ == uiItemType::Button) {
398 if (item->
type_ == uiItemType::Button) {
420 if (item->
type_ == uiItemType::Button) {
431 if (delta_xmin > 0) {
432 litem->
x_ += delta_xmin;
435 litem->
w_ += delta_xmax;
448 switch (layout->
type_) {
449 case uiItemType::LayoutRow:
450 case uiItemType::LayoutRoot:
451 case uiItemType::LayoutOverlap:
452 case uiItemType::LayoutPanelHeader:
453 case uiItemType::LayoutGridFlow:
455 case uiItemType::LayoutColumn:
456 case uiItemType::LayoutColumnFlow:
457 case uiItemType::LayoutSplit:
458 case uiItemType::LayoutAbsolute:
459 case uiItemType::LayoutBox:
460 case uiItemType::LayoutPanelBody:
470 sub = &layout->
row(align);
473 sub = &layout->
column(align);
493 value_array.
fill(
false);
494 value_array[index] =
true;
500 for (
const std::unique_ptr<uiBut> &cbut : but->
block->
buttons) {
521 const bool icon_only,
523 const bool show_text)
535 if (!name.
is_empty() && show_text) {
536 uiDefBut(block,
UI_BTYPE_LABEL, 0, name, 0, 0,
w,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
542 const int cols = (
len >= 20) ? 2 : 1;
543 const int colbuts =
len / (2 * cols);
545 uint layer_active = 0;
552 for (
int b = 0;
b < cols;
b++) {
555 for (
int a = 0; a < colbuts; a++) {
556 const int layer_num = a +
b * colbuts;
557 const uint layer_flag = (1u << layer_num);
559 if (layer_used & layer_flag) {
560 if (layer_active & layer_flag) {
561 icon = ICON_LAYER_ACTIVE;
564 icon = ICON_LAYER_USED;
572 block,
ptr, prop, layer_num,
"", icon,
x + butw * a,
y + buth, butw, buth);
577 for (
int a = 0; a < colbuts; a++) {
578 const int layer_num = a +
len / 2 +
b * colbuts;
579 const uint layer_flag = (1u << layer_num);
581 if (layer_used & layer_flag) {
582 if (layer_active & layer_flag) {
583 icon = ICON_LAYER_ACTIVE;
586 icon = ICON_LAYER_USED;
594 block,
ptr, prop, layer_num,
"", icon,
x + butw * a,
y, butw, buth);
605 int totdim, dim_size[ 3];
619 for (
int a = 0; a <
len; a++) {
620 col = a % dim_size[0];
621 row = a / dim_size[0];
635 const float step_size = number_but->
step_size;
636 const float precision = number_but->
precision;
672 char str[3] = {
'\0'};
674 if (!icon_only && show_text) {
681 bool *boolarr =
nullptr;
690 const char *str_buf = show_text ?
str :
"";
691 for (
int a = 0; a <
len; a++) {
692 if (!icon_only && show_text) {
696 icon = boolarr[a] ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
699 const int width_item = ((compact && type ==
PROP_BOOLEAN) ?
704 block,
ptr, prop, a, str_buf, icon, 0, 0, width_item,
UI_UNIT_Y);
707 const float step_size = number_but->
step_size;
708 const float precision = number_but->
precision;
740 if (!(current_value & enum_value)) {
741 current_value = enum_value;
744 current_value &= enum_value;
757 const std::optional<StringRef> uiname,
760 const bool icon_only,
764 const char *name = (!uiname || !uiname->is_empty()) ? item->
name :
"";
765 const int icon = item->
icon;
766 const int value = item->
value;
770 if (icon && name[0] && !icon_only) {
772 block, but_type, 0, icon, name, 0, 0, itemw, h,
ptr, prop, -1, 0, value, std::nullopt);
775 const int w = (is_first) ? itemw :
ceilf(itemw -
U.pixelsize);
777 block, but_type, 0, icon, 0, 0,
w, h,
ptr, prop, -1, 0, value, std::nullopt);
781 block, but_type, 0, name, 0, 0, itemw, h,
ptr, prop, -1, 0, value, std::nullopt);
806 const std::optional<StringRef> uiname,
809 const bool icon_only)
842 layout_radial = &layout->
menu_pie();
846 if (layout->
type_ == uiItemType::LayoutRadial) {
847 layout_radial = layout;
852 else if (
ELEM(layout->
type_, uiItemType::LayoutGridFlow, uiItemType::LayoutColumnFlow) ||
862 const bool is_first = item == item_array;
864 if (!item->identifier[0]) {
877 else if (radial && layout_radial) {
888 layout, block,
ptr, prop, uiname, h, but_type, icon_only, item, is_first);
901 const std::optional<StringRef> uiname,
903 const bool icon_only)
914 const std::optional<StringRef> uiname,
916 const bool icon_only)
936 const bool use_custom_highlight = (prop_highlight !=
nullptr);
938 if (use_custom_highlight) {
942 const int end = std::min<int>(start_size + highlight_array_len, block->
buttons.
size());
943 for (
int i = start_size;
i < end;
i++) {
989 int prop_but_width = w_hint;
990#ifdef UI_PROP_DECORATE
991 uiLayout *layout_prop_decorate =
nullptr;
992 const bool use_prop_sep = bool(layout->
flag_ & uiItemInternalFlag::PropSep);
993 const bool use_prop_decorate = use_prop_sep &&
994 bool(layout->
flag_ & uiItemInternalFlag::PropDecorate) &&
995 !bool(layout->
flag_ & uiItemInternalFlag::PropDecorateNoPad);
1000 RNA_warning(
"Data is not a keymap item struct: %s. Ignoring 'full_event' option.",
1009 || use_prop_decorate
1021#ifdef UI_PROP_DECORATE
1037 w_label = w_hint / 3;
1039 uiDefBut(block,
UI_BTYPE_LABEL, 0, name,
x,
y, w_label, h,
nullptr, 0.0, 0.0,
"");
1051 if (but !=
nullptr) {
1064 subtype ==
PROP_DIRPATH ?
"BUTTONS_OT_directory_browse" :
1065 "BUTTONS_OT_file_browse",
1091 std::string kmi_str =
1113 std::make_optional<StringRefNull>(
"");
1126 const std::optional<blender::bke::path_templates::VariableMap> variables =
1143#ifdef UI_PROP_DECORATE
1145 if (use_prop_decorate) {
1146 (layout_prop_decorate ? layout_prop_decorate : sub)->label(
nullptr, ICON_BLANK1);
1161 uiBut *prevbut =
nullptr;
1166 *r_is_userdef =
false;
1173 for (
const std::unique_ptr<uiBut> &but : block->buttons) {
1174 if (but && but->rnapoin.data) {
1176 prevbut = but.get();
1202 if (but->
tip ==
nullptr || but->
tip[0] ==
'\0') {
1224 uiBut *but =
uiDefBut(block,
UI_BTYPE_LABEL, 0, name, 0, 0,
w,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
1235 std::optional<StringRef> name,
1244 std::string operator_name;
1248 name = operator_name.c_str();
1272 if (!name->is_empty()) {
1274 block,
UI_BTYPE_BUT,
ot, context, icon, *name, 0, 0,
w,
UI_UNIT_Y, std::nullopt);
1288 layout->
emboss_ = prev_emboss;
1345 const char *menu_id =
static_cast<const char *
>(but->
hold_argN);
1352 layout->
label(
RPT_(
"Menu Missing:"), ICON_NONE);
1353 layout->
label(menu_id, ICON_NONE);
1359 std::optional<StringRef> name,
1371 std::optional<StringRef> name,
1375 const char *menu_id,
1383 const std::optional<StringRef> name,
1391 return this->
op(ot, name, icon, context,
flag);
1421 std::optional<StringRef> name,
1430 if (prop ==
nullptr) {
1441 const std::optional<StringRef> name,
1459 return (layout->
type_ == uiItemType::LayoutRadial) ||
1510 bool last_iter =
false;
1512 for (
int i = 1; item->
identifier && !last_iter;
i++, item++) {
1520 for (tmp = item + 1; tmp->
identifier; tmp++) {
1528 block,
ot, propname, properties, item_array, totitem, context,
flag);
1557 if (item != item_array && !radial &&
split !=
nullptr) {
1562 if (item->
icon || radial) {
1611 if (!
ot || !
ot->srna) {
1613 RNA_warning(
"%s '%s'",
ot ?
"operator missing srna" :
"unknown operator", opname.
c_str());
1656 layout,
ot,
ptr, prop, properties, context,
flag, item_array, totitem,
active);
1692 if (prop ==
nullptr) {
1705 const char *value_str)
1714 if (prop ==
nullptr) {
1773 bool is_checkbox_only =
false;
1774 if (name.
is_empty() && !icon_only) {
1776 name =
"non-empty text";
1779 if (icon == ICON_NONE) {
1781 is_checkbox_only =
true;
1797 if (item->identifier[0]) {
1824 if (name.
is_empty() && icon == ICON_NONE) {
1827 if (
bool(layout->
flag_ & uiItemInternalFlag::PropSep)) {
1846 else if (is_checkbox_only) {
1849 else if (type ==
PROP_ENUM && !icon_only) {
1879 for (
uiLayout *parent = cur_layout; parent; parent = parent->
parent_) {
1880 if (parent->heading_[0]) {
1891 bool respect_prop_split)
1893 const int prev_alignment = layout->
alignment_;
1899 if (respect_prop_split) {
1907 heading_layout->
heading_[0] =
'\0';
1921 layout_parent->
flag_ |= uiItemInternalFlag::InsidePropSep;
1923 if (layout_parent->
type_ == uiItemType::LayoutRow) {
1930 return layout_split;
1938 const std::optional<StringRef> name_opt,
1940 const std::optional<StringRef> placeholder)
1945 const bool use_prop_sep = bool(
flag_ & uiItemInternalFlag::PropSep);
1946 const bool inside_prop_sep = bool(
flag_ & uiItemInternalFlag::InsidePropSep);
1956 bool use_prop_sep_split_label = use_prop_sep;
1959#ifdef UI_PROP_DECORATE
1960 struct DecorateInfo {
1961 bool use_prop_decorate;
1966 DecorateInfo ui_decorate{};
1967 ui_decorate.use_prop_decorate = (bool(
flag_ & uiItemInternalFlag::PropDecorate) && use_prop_sep);
1978 const bool is_id_name_prop = (
ptr->owner_id ==
ptr->data && type ==
PROP_STRING &&
1985 const bool no_icon = (toggle == 0);
1998 if (use_prop_sep ==
false) {
2003 if (use_prop_sep ==
false) {
2012 if (use_prop_sep ==
false) {
2018 if (no_icon ==
false) {
2019 if (icon == ICON_NONE) {
2032 icon = ICON_CHECKBOX_DEHLT;
2034 else if (is_array) {
2036 ICON_CHECKBOX_DEHLT;
2047 icon = ICON_CHECKBOX_DEHLT;
2050 icon = (enum_value & value) ? ICON_CHECKBOX_HLT : ICON_CHECKBOX_DEHLT;
2054 icon = (enum_value == value) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
2061#ifdef UI_PROP_SEP_ICON_WIDTH_EXCEPTION
2063 if (type ==
PROP_BOOLEAN && (icon == ICON_NONE) && !icon_only) {
2064 use_prop_sep_split_label =
false;
2067 use_split_empty_name =
true;
2090 uiBut *but =
nullptr;
2097#ifdef UI_PROP_DECORATE
2098 if (ui_decorate.use_prop_decorate) {
2099 layout_row = &layout->
row(
true);
2105 if (name.
is_empty() && !use_split_empty_name) {
2107 layout = &(layout_row ? layout_row : layout)->
column(
true);
2109 if (heading_layout) {
2116 bool label_added =
false;
2120 if (!use_prop_sep_split_label) {
2124 fmt::memory_buffer name_with_suffix;
2125 char str[2] = {
'\0'};
2126 for (
int a = 0; a <
len; a++) {
2128 const bool use_prefix = (a == 0 && !name.
is_empty());
2130 fmt::format_to(fmt::appender(name_with_suffix),
"{} {}", name,
str[0]);
2135 use_prefix ?
StringRef(name_with_suffix.data(), name_with_suffix.size()) :
2152 but =
uiDefBut(block,
UI_BTYPE_LABEL, 0, name, 0, 0,
w,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
2159 if (!label_added && heading_layout) {
2172 layout = &layout_split->
row(
true);
2175 layout = &layout_split->
column(
true);
2179 if (use_prop_sep_split_label) {
2182 layout = &layout_split->
column(
true);
2187#ifdef UI_PROP_DECORATE
2188 if (ui_decorate.use_prop_decorate) {
2189 ui_decorate.layout = &layout_row->
column(
true);
2190 ui_decorate.layout->space_ = 0;
2192 ui_decorate.but = block->
last_but();
2195 layout->
flag_ |= uiItemInternalFlag::PropDecorateNoPad;
2200 else if (heading_layout) {
2208 if (inside_prop_sep) {
2211 layout = &layout->
column(
true);
2230 !use_prop_sep_split_label);
2234 if (icon && !name.
is_empty() && !icon_only) {
2236 block,
UI_BTYPE_ROW, 0, icon, name, 0, 0,
w, h,
ptr,
prop, -1, 0, value, std::nullopt);
2240 block,
UI_BTYPE_ROW, 0, icon, 0, 0,
w, h,
ptr,
prop, -1, 0, value, std::nullopt);
2244 block,
UI_BTYPE_ROW, 0, name, 0, 0,
w, h,
ptr,
prop, -1, 0, value, std::nullopt);
2253 but =
ui_item_with_label(layout, block, name, icon,
ptr,
prop, index, 0, 0,
w, h,
flag);
2255 if (is_id_name_prop) {
2257 ID *
id =
ptr->owner_id;
2259 but, [bmain,
id](
const std::string &new_name) {
ED_id_rename(*bmain, *
id, new_name); });
2262 bool results_are_suggestions =
false;
2266 results_are_suggestions =
true;
2285 const float step_size = number_but->
step_size;
2286 const float precision = number_but->
precision;
2323 if (but && no_icon) {
2324 if ((icon == ICON_NONE) && (but->
icon != ICON_NONE)) {
2345#ifdef UI_PROP_DECORATE
2346 if (ui_decorate.use_prop_decorate) {
2352 while (but_decorate && but_decorate != block->
buttons.
last().get()) {
2356 uiLayout *layout_col = &ui_decorate.layout->column(
false);
2361 for (
i = 0;
i < ui_decorate.len && but_decorate;
i++) {
2374 but_decorate =
nullptr;
2387 layout->
emboss_ = prev_emboss;
2391 if (but && icon_only) {
2399 const std::optional<StringRef> name,
2419 const std::optional<StringRefNull> name,
2421 const char *panel_type)
2425 layout->
prop(
ptr, prop, index, value,
flag, name, icon);
2436 RNA_warning(
"property could not use a popover: %s.%s (%s)",
2449 const std::optional<StringRefNull> name,
2451 const char *menu_type)
2455 layout->
prop(
ptr, prop, index, value,
flag, name, icon);
2467 RNA_warning(
"property could not use a menu: %s.%s (%s)",
2475 const std::optional<StringRefNull> name,
2495 const std::optional<StringRefNull> name,
2517 RNA_warning(
"enum property value not found: %s", value);
2522 if (item[a].identifier[0] ==
'\0') {
2526 if (item[a].value == ivalue) {
2545 const std::optional<StringRefNull> name,
2585 for (
int i = 0;
i < totitem;
i++) {
2586 if (item[
i].identifier[0]) {
2593 column = &
split->column(
false);
2596 column->
label(item[
i].name, ICON_NONE);
2628 if (ptype == srna) {
2641 MEM_delete(coll_search);
2649 const bool results_are_suggestions)
2652 bool has_search_fn =
false;
2667 if (has_search_fn || searchprop) {
2738 const std::optional<StringRefNull> name_opt,
2740 bool results_are_suggestions)
2742 const bool use_prop_sep = bool(layout->
flag_ & uiItemInternalFlag::PropSep);
2748 RNA_warning(
"Property %s.%s must be a pointer, string or enum",
2754 RNA_warning(
"search collection property is not a collection type: %s.%s",
2761 if (icon == ICON_NONE) {
2775 if (use_prop_sep ==
false) {
2785 uiBut *but =
ui_item_with_label(layout, block, name, icon,
ptr, prop, 0, 0, 0,
w, h, 0);
2795 const std::optional<StringRefNull> name,
2806 RNA_warning(
"search collection property not found: %s.%s",
2808 searchpropname.
c_str());
2833 const std::optional<StringRef> tip,
2850 if (icon == ICON_NONE && force_menu) {
2853 else if (force_menu) {
2854 pad_factor.
text = 1.85;
2858 pad_factor.
text = 0.75f;
2865 if (heading_layout) {
2875 if (force_menu && !name.
is_empty()) {
2880 but =
uiDefMenuBut(block, func, arg, name, 0, 0,
w, h, tip);
2886 but->
poin = (
char *)but;
2930 if (mt ==
nullptr) {
2931 RNA_warning(
"not found %s", std::string(menuname).c_str());
2934 this->
menu(mt, name, icon);
2940 if (mt ==
nullptr) {
2941 RNA_warning(
"not found %s", std::string(menuname).c_str());
2996 TIP_(
"Animate property"));
3011 const std::optional<StringRefNull> propname,
3016 if (
ptr && propname) {
3034 const std::optional<StringRef> name_opt,
3047 const bool ok = (pt->
poll ==
nullptr) || pt->
poll(
C, pt);
3049 layout = &layout->
row(
true);
3052 panel.
runtime = &panel_runtime;
3072 std::optional<blender::StringRef> name_opt,
3076 if (pt ==
nullptr) {
3077 RNA_warning(
"Panel type not found '%s'", std::string(panel_type).c_str());
3087 const char *context,
3088 const char *category)
3091 if (st ==
nullptr) {
3096 if (art ==
nullptr) {
3097 RNA_warning(
"region type not found %d", region_id);
3103 if (pt->parent_id[0] ==
'\0') {
3104 if (
STREQ(pt->context, context)) {
3105 if ((*category ==
'\0') ||
STREQ(pt->category, category)) {
3106 if (pt->poll ==
nullptr || pt->poll(
C, pt)) {
3131 block,
UI_BTYPE_LABEL, 0, icon, name, 0, 0,
w,
UI_UNIT_Y,
nullptr, 0.0, 0.0, std::nullopt);
3135 block,
UI_BTYPE_LABEL, 0, icon, 0, 0,
w,
UI_UNIT_Y,
nullptr, 0.0, 0.0, std::nullopt);
3139 block,
UI_BTYPE_LABEL, 0, name, 0, 0,
w,
UI_UNIT_Y,
nullptr, 0.0, 0.0, std::nullopt);
3163 uiLayout *layout,
const StringRef name,
int icon,
const bool highlight,
const bool redalert)
3195 &layout_row->
column(
true) :
3198 return split_wrapper;
3203 if (
bool(layout->
flag_ & uiItemInternalFlag::PropSep)) {
3242 const int space = (is_menu) ?
int(7.0f *
UI_SCALE_FAC * factor) :
3285 const bool has_text = text && text[0];
3292 else if (has_text) {
3329 printf(
"Error: separator_spacer() not supported in popups.\n");
3334 printf(
"Error: separator_spacer() only supported in horizontal blocks.\n");
3359 ui_item_menu(
this, name, icon, func, arg,
nullptr,
"",
false);
3372 ui_item_menu(
this, name, icon, func, argN, argN,
"",
false);
3436 std::optional<StringRefNull> name,
3443 std::string operator_name;
3446 name = operator_name.c_str();
3453 MenuItemLevel *lvl = MEM_new<MenuItemLevel>(
"MenuItemLevel");
3471 but->
opptr = MEM_new<PointerRNA>(
"uiButOpPtr");
3475 *r_opptr = *but->
opptr;
3530 const std::optional<StringRefNull> name,
3537 MenuItemLevel *lvl = MEM_new<MenuItemLevel>(
"MenuItemLevel");
3587 bool min_size_flag =
true;
3598 const bool is_item_last = (item == item_last);
3601 min_size_flag = min_size_flag && bool(item->
flag_ & uiItemInternalFlag::FixedSize);
3604 litem->
h_ = std::max(itemh, litem->
h_);
3606 if (!is_item_last) {
3611 if (min_size_flag) {
3612 litem->
flag_ |= uiItemInternalFlag::FixedSize;
3627 int last_free_item_idx = -1;
3628 int x, neww, newtotw, itemw, minw, itemh, offset;
3629 int freew, fixedx, freex,
flag = 0, lastw = 0;
3633 const int y = litem->
y_;
3649 w -= (tot - 1) * litem->
space_;
3664 if (
bool(item->
flag_ & uiItemInternalFlag::AutoFixedSize)) {
3667 const bool is_item_last = (item == item_last);
3672 if (
w - lastw > 0) {
3674 itemw,
x, totw,
w - lastw, is_item_last, litem->
alignment_, &extra_pixel);
3682 bool min_flag = bool(item->
flag_ & uiItemInternalFlag::FixedSize);
3684 if (item->
type_ != uiItemType::Button &&
3689 bool(litem->
flag_ & uiItemInternalFlag::FixedSize))
3694 if ((neww < minw || min_flag) &&
w != 0) {
3696 item->
flag_ |= uiItemInternalFlag::AutoFixedSize;
3697 if (item->
type_ != uiItemType::Button &&
bool(item->
flag_ & uiItemInternalFlag::FixedSize))
3724 const bool is_item_last = (item == item_last);
3728 if (
bool(item->
flag_ & uiItemInternalFlag::AutoFixedSize)) {
3730 if (item->
type_ != uiItemType::Button &&
bool(item->
flag_ & uiItemInternalFlag::FixedSize)) {
3734 minw, fixedx, fixedw,
min_ii(
w, fixedw), is_item_last, litem->
alignment_, &extra_pixel);
3740 itemw, freex, freew,
w - fixedw, is_item_last, litem->
alignment_, &extra_pixel);
3742 last_free_item_idx = item_idx;
3748 if (freew + fixedw > 0 && freew + fixedw <
w) {
3749 offset =
w - (fixedw + freew);
3753 if (freew + fixedw > 0 && freew + fixedw <
w) {
3754 offset = (
w - (fixedw + freew)) / 2;
3762 if (!is_item_last) {
3768 int extra_pixel_move = litem->
w_ - (
x - litem->
x_);
3770 last_free_item_idx >= 0 && item_last &&
3771 bool(item_last->
flag_ & uiItemInternalFlag::AutoFixedSize))
3776 for (
uiItem *item : items_after_last_free) {
3777 ui_item_move(item, extra_pixel_move, extra_pixel_move);
3781 litem->
w_ =
x - litem->
x_;
3782 litem->
h_ = litem->
y_ -
y;
3792 if (next_item ==
nullptr) {
3795 if (item->
type_ == uiItemType::LayoutPanelHeader &&
3796 next_item->
type_ == uiItemType::LayoutPanelHeader)
3801 if (item->
type_ == uiItemType::LayoutPanelBody &&
3802 !
ELEM(next_item->
type_, uiItemType::LayoutPanelHeader, uiItemType::LayoutPanelBody))
3820 bool min_size_flag =
true;
3829 min_size_flag = min_size_flag && bool(item->
flag_ & uiItemInternalFlag::FixedSize);
3831 litem->
w_ = std::max(litem->
w_, itemw);
3836 litem->
h_ += spaces_num * litem->
space_;
3839 if (min_size_flag) {
3840 litem->
flag_ |= uiItemInternalFlag::FixedSize;
3846 const int x = litem->
x_;
3859 y -= spaces_num * litem->
space_;
3862 item->
flag_ |= uiItemInternalFlag::BoxItem;
3866 litem->
h_ = litem->
y_ -
y;
3877 printf(
"Warning: Pie menus with more than %i items are currently unsupported\n",
3890 if ((item->
type_ == uiItemType::Button) &&
3920 const int x = litem->
x_;
3921 const int y = litem->
y_;
3923 int minx =
x, miny =
y, maxx =
x, maxy =
y;
3935 const float factor[2] = {
3936 (vec[0] > 0.01f) ? 0.0f : ((vec[0] < -0.01f) ? -1.0f : -0.5f),
3937 (vec[1] > 0.99f) ? 0.0f : ((vec[1] < -0.99f) ? -1.0f : -0.5f),
3942 bool use_dir =
true;
3944 if (item->
type_ == uiItemType::Button) {
3970 x + (vec[0] * pie_radius) + (factor[0] * itemw),
3971 y + (vec[1] * pie_radius) + (factor[1] * itemh),
3975 minx =
min_ii(minx,
x + (vec[0] * pie_radius) - (itemw / 2));
3976 maxx =
max_ii(maxx,
x + (vec[0] * pie_radius) + (itemw / 2));
3977 miny =
min_ii(miny,
y + (vec[1] * pie_radius) - (itemh / 2));
3978 maxy =
max_ii(maxy,
y + (vec[1] * pie_radius) + (itemh / 2));
3983 litem->
w_ = maxx - minx;
3984 litem->
h_ = maxy - miny;
3998 if (item->
type_ == uiItemType::Button) {
3999 int itemh, itemw,
x,
y;
4006 item,
x - itemw / 2,
y +
UI_SCALE_FAC * (
U.pie_menu_threshold + 9.0f), itemw, itemh);
4052 float(litem->
y_ + litem->
h_) - offset,
4069 float(litem->
y_ - litem->
space_) - offset,
4070 float(litem->
y_ + litem->
h_ + litem->
space_) - offset,
4085 litem->
w_ += 2 * boxspace;
4086 litem->
h_ += 2 * boxspace;
4099 const int w = litem->
w_;
4100 const int h = litem->
h_;
4102 litem->
x_ += boxspace;
4103 litem->
y_ -= boxspace;
4106 litem->
w_ -= 2 * boxspace;
4109 litem->
h_ -= 2 * boxspace;
4114 litem->
x_ -= boxspace;
4115 litem->
y_ -= boxspace;
4118 litem->
w_ += 2 * boxspace;
4121 litem->
h_ += 2 * boxspace;
4137 int itemw, itemh, maxw = 0;
4144 maxw = std::max(maxw, itemw);
4170 const int emh = toth / flow->
totcol;
4180 maxw =
max_ii(itemw, maxw);
4193 litem->
h_ = litem->
y_ - miny;
4200 int col, emh, itemw, itemh;
4215 emh = toth / flow->
totcol;
4238 const int remaining_width = litem->
w_ - (
x - litem->
x_);
4240 const int remaining_columns = flow->
totcol -
col;
4241 w = (remaining_width - remaining_width_between_columns) / remaining_columns;
4245 litem->
h_ = litem->
y_ - miny;
4286 float tot_w = 0.0f, tot_h = 0.0f;
4287 float global_avg_w = 0.0f, global_totweight_w = 0.0f;
4288 int global_max_h = 0;
4292 results->
tot_w ==
nullptr));
4295 results->
tot_h ==
nullptr));
4316 for (
const uiItem *item : items) {
4320 global_avg_w += float(item_w * item_w);
4321 global_totweight_w += float(item_w);
4322 global_max_h =
max_ii(global_max_h, item_h);
4330 avg_w[index_col] += float(item_w * item_w);
4331 totweight_w[index_col] += float(item_w);
4333 max_h[index_row] =
max_ii(max_h[index_row], item_h);
4343 global_avg_w /= global_totweight_w;
4346 avg_w[
i] /= totweight_w[
i];
4366 const float wfac = float(parameters->
litem_w -
4392 for (
int row = 0; row < parameters->
tot_rows; row++) {
4411 if (results->
tot_w) {
4414 if (results->
tot_h) {
4439 input.space_x = space_x;
4440 input.space_y = space_y;
4443 output.global_avg_w = &avg_w;
4444 output.global_max_h = &max_h;
4448 litem->
w_ = litem->
h_ = 0;
4461 if (avg_w == 0.0f) {
4476 const int step = modulo ? modulo : 1;
4494 if (modulo && gflow->
tot_rows % modulo != 0) {
4529 input.space_x = space_x;
4530 input.space_y = space_y;
4549 litem->
w_ = litem->
h_ = 0;
4572 input.space_x = space_x;
4573 input.space_y = space_y;
4590 const int w = widths[
col];
4591 const int h = heights[row];
4602 litem->
y_ = litem->
y_ - litem->
h_;
4614 int itemx, itemy, itemw, itemh;
4618 minx =
min_ii(minx, itemx);
4619 miny =
min_ii(miny, itemy);
4621 litem->
w_ = std::max(litem->
w_, itemx + itemw);
4622 litem->
h_ = std::max(litem->
h_, itemy + itemh);
4631 float scalex = 1.0f, scaley = 1.0f;
4632 int x,
y, newx, newy, itemx, itemy, itemh, itemw;
4643 minx =
min_ii(minx, itemx);
4644 miny =
min_ii(miny, itemy);
4646 totw =
max_ii(totw, itemx + itemw);
4647 toth =
max_ii(toth, itemy + itemh);
4653 if (litem->
w_ && totw > 0) {
4654 scalex = float(litem->
w_) / float(totw);
4656 if (litem->
h_ && toth > 0) {
4657 scaley = float(litem->
h_) / float(toth);
4661 y = litem->
y_ - scaley * toth;
4667 if (scalex != 1.0f) {
4668 newx = (itemx - minx) * scalex;
4669 itemw = (itemx - minx + itemw) * scalex - newx;
4670 itemx = minx + newx;
4673 if (scaley != 1.0f) {
4674 newy = (itemy - miny) * scaley;
4675 itemh = (itemy - miny + itemh) * scaley - newy;
4676 itemy = miny + newy;
4682 litem->
w_ = scalex * totw;
4683 litem->
h_ = litem->
y_ -
y;
4684 litem->
x_ =
x + litem->
w_;
4698 float extra_pixel = 0.0f;
4706 const int y = litem->
y_;
4708 const float percentage = (
split->percentage == 0.0f) ? 1.0f /
float(tot) :
split->percentage;
4710 const int w = (litem->
w_ - (tot - 1) * litem->
space_);
4711 int colw =
w * percentage;
4712 colw = std::max(colw, 0);
4716 const bool is_item_last = (item == item_last);
4723 if (!is_item_last) {
4724 const float width = extra_pixel + (
w - int(
w * percentage)) / (
float(tot) - 1);
4725 extra_pixel = width - int(width);
4727 colw = std::max(colw, 0);
4733 litem->
w_ =
x - litem->
x_;
4734 litem->
h_ = litem->
y_ -
y;
4749 litem->
w_ = std::max(itemw, litem->
w_);
4750 litem->
h_ = std::max(itemh, litem->
h_);
4757 const int x = litem->
x_;
4758 const int y = litem->
y_;
4765 litem->
h_ = std::max(litem->
h_, itemh);
4769 litem->
y_ =
y - litem->
h_;
4782 litem->
w_ = layout->
w_;
4784 litem->
flag_ = (layout->
flag_ & (uiItemInternalFlag::PropSep | uiItemInternalFlag::PropDecorate |
4785 uiItemInternalFlag::InsidePropSep));
4804 uiLayout *litem = MEM_new<uiLayout>(__func__);
4807 litem->
type_ = uiItemType::LayoutRow;
4808 litem->
space_ = (align) ? 0 :
root_->style->buttonspacex;
4823 const bool is_open = is_real_open || search_filter_active;
4829 header_litem->
type_ = uiItemType::LayoutPanelHeader;
4838 const int icon = is_open ? ICON_DOWNARROW_HLT : ICON_RIGHTARROW;
4841 block,
UI_BTYPE_LABEL, 0, icon,
"", 0, 0, width,
UI_UNIT_Y,
nullptr, 0.0f, 0.0f,
"");
4847 return panel_layout;
4851 body_litem->
type_ = uiItemType::LayoutPanelBody;
4855 panel_layout.
body = body_litem;
4857 return panel_layout;
4865 const std::optional<StringRefNull>
label)
4870 panel_header->
flag_ &= ~(uiItemInternalFlag::PropSep | uiItemInternalFlag::PropDecorate |
4871 uiItemInternalFlag::InsidePropSep);
4874 return panel_layout;
4885 return panel_layout.
body;
4894 root_panel, idname, default_closed);
4897 return this->
panel_prop(C, &state_ptr,
"is_open");
4902 const bool default_closed,
4908 return panel_layout.
body;
4917 return item->
type_ == uiItemType::LayoutPanelHeader;
4929 uiLayout *litem = MEM_new<uiLayout>(__func__);
4932 litem->
type_ = uiItemType::LayoutColumn;
4933 litem->
space_ = (align) ? 0 :
root_->style->buttonspacey;
4952 flow->
type_ = uiItemType::LayoutColumnFlow;
4962 bool row_major,
int columns_len,
bool even_columns,
bool even_rows,
bool align)
4965 flow->
type_ = uiItemType::LayoutGridFlow;
4984 box->
type_ = uiItemType::LayoutBox;
4989 box->
roundbox =
uiDefBut(layout->
root_->
block, type, 0,
"", 0, 0, 0, 0,
nullptr, 0.0, 0.0,
"");
5003 if (item->
type_ == uiItemType::LayoutRadial) {
5010 uiLayout *litem = MEM_new<uiLayout>(__func__);
5013 litem->
type_ = uiItemType::LayoutRadial;
5028 if (item->
type_ != uiItemType::Button) {
5060 uiLayout *litem = MEM_new<uiLayout>(__func__);
5063 litem->
type_ = uiItemType::LayoutAbsolute;
5080 uiLayout *litem = MEM_new<uiLayout>(__func__);
5083 litem->
type_ = uiItemType::LayoutOverlap;
5095 split->type_ = uiItemType::LayoutSplit;
5097 split->percentage = percentage;
5141 layout->
scale_[0] = scale;
5146 layout->
scale_[1] = scale;
5151 layout->
units_[0] = unit;
5156 layout->
units_[1] = unit;
5166 return bool(layout->
flag_ & uiItemInternalFlag::PropSep);
5176 return bool(layout->
flag_ & uiItemInternalFlag::PropDecorate);
5241 return layout->
scale_[0];
5246 return layout->
scale_[1];
5251 return layout->
units_[0];
5256 return layout->
units_[1];
5279 block,
UI_BTYPE_SEPR, 0,
"", 0, 0,
uiLayoutListItemPaddingWidth(), 0,
nullptr, 0.0, 0.0,
"");
5296 if ((block->
panel !=
nullptr) && (block->
panel->
type !=
nullptr)) {
5314 if (but->
optype !=
nullptr) {
5320 if (but->
rnaprop !=
nullptr) {
5324#ifdef PROPERTY_SEARCH_USE_TOOLTIPS
5340 if (items_array ==
nullptr) {
5345 for (
int i = 0;
i < items_len;
i++) {
5347 if (items_array[
i].name ==
nullptr) {
5392 bool has_result =
false;
5408 if (search_filter ==
nullptr || search_filter[0] ==
'\0') {
5414 if (panel !=
nullptr) {
5424 const bool has_result = (panel_label_matches) ?
5428 if (panel !=
nullptr) {
5449 if (item->
type_ != uiItemType::Button) {
5457 if (scale[0] != 0.0f) {
5462 if (scale[1] != 0.0f) {
5473 if (item->
type_ != uiItemType::Button) {
5486 if (litem->
scale_[0] != 0.0f || litem->
scale_[1] != 0.0f) {
5490 switch (litem->
type_) {
5491 case uiItemType::LayoutColumn:
5494 case uiItemType::LayoutColumnFlow:
5497 case uiItemType::LayoutGridFlow:
5500 case uiItemType::LayoutRow:
5503 case uiItemType::LayoutPanelHeader:
5506 case uiItemType::LayoutPanelBody:
5509 case uiItemType::LayoutBox:
5512 case uiItemType::LayoutRoot:
5515 case uiItemType::LayoutAbsolute:
5518 case uiItemType::LayoutSplit:
5521 case uiItemType::LayoutOverlap:
5529 if (litem->
units_[0] > 0) {
5532 if (litem->
units_[1] > 0) {
5542 if (item->
type_ == uiItemType::Button) {
5544#ifndef USE_UIBUT_SPATIAL_ALIGN
5553 else if (item->
type_ == uiItemType::LayoutAbsolute) {
5556 else if (item->
type_ == uiItemType::LayoutOverlap) {
5559 else if (item->
type_ == uiItemType::LayoutBox) {
5578 if (item->
type_ == uiItemType::Button) {
5590 if (item->
type_ != uiItemType::Button) {
5607 switch (litem->
type_) {
5608 case uiItemType::LayoutColumn:
5611 case uiItemType::LayoutColumnFlow:
5614 case uiItemType::LayoutGridFlow:
5617 case uiItemType::LayoutRow:
5620 case uiItemType::LayoutPanelHeader:
5623 case uiItemType::LayoutPanelBody:
5626 case uiItemType::LayoutBox:
5629 case uiItemType::LayoutRoot:
5632 case uiItemType::LayoutAbsolute:
5635 case uiItemType::LayoutSplit:
5638 case uiItemType::LayoutOverlap:
5641 case uiItemType::LayoutRadial:
5649 if (
bool(item->
flag_ & uiItemInternalFlag::BoxItem)) {
5650 subitem->
flag_ |= uiItemInternalFlag::BoxItem;
5656 if (
bool(item->
flag_ & uiItemInternalFlag::BoxItem)) {
5683 if (item->
type_ == uiItemType::Button) {
5707 block,
UI_BTYPE_SEPR, 0,
"", 0, 0, root->
padding, root->
padding,
nullptr, 0.0, 0.0,
"");
5724 root->
style = style;
5725 root->
block = block;
5729 uiLayout *layout = MEM_new<uiLayout>(__func__);
5733 layout->
flag_ = uiItemInternalFlag::PropDecorate;
5737 layout->
root_ = root;
5784 bitem->
type_ = uiItemType::Button;
5792 bitem->
flag_ |= uiItemInternalFlag::FixedSize;
5822 for (
uiItem *item : child_list) {
5823 if (item->type_ == uiItemType::Button) {
5826 if (bitem->
but == but) {
5847 if (item->type_ == uiItemType::Button) {
5849 return (bitem->
but == but);
5861 static_cast<const uiBut *
>(old_but_ptr));
5866 bitem->
but = new_but;
5873 layout->
flag_ |= uiItemInternalFlag::FixedSize;
5882 return bool(layout->
flag_ & uiItemInternalFlag::FixedSize);
5969 bool arg_used =
false;
5974 if (copy_arg !=
nullptr && arg_used) {
5975 arg = copy_arg(arg);
5978 if (item->
type_ == uiItemType::Button) {
5992 if (free_arg !=
nullptr && !arg_used) {
6014 if (r_prop !=
nullptr) {
6021 if ((
ot !=
nullptr) && (r_prop !=
nullptr)) {
6057 printf(
"%s: opening menu \"%s\"\n", __func__, mt->
idname);
6074 if (previous_context_store) {
6087 if (subitem->
type_ == uiItemType::Button) {
6153 if (child_pt->
poll ==
nullptr || child_pt->
poll(
C, child_pt)) {
6223 "'rna':'%s.%s[%d]', ",
6234 for (
const uiItem *item : items) {
6238#define CASE_ITEM(type, name) \
6240 BLI_dynstr_append(ds, "'type': '"); \
6241 BLI_dynstr_append(ds, name); \
6242 BLI_dynstr_append(ds, "', "); \
6247 switch (item->type_) {
6248 CASE_ITEM(uiItemType::Button,
"BUTTON");
6249 CASE_ITEM(uiItemType::LayoutRow,
"LAYOUT_ROW");
6250 CASE_ITEM(uiItemType::LayoutPanelHeader,
"LAYOUT_PANEL_HEADER");
6251 CASE_ITEM(uiItemType::LayoutPanelBody,
"LAYOUT_PANEL_BODY");
6252 CASE_ITEM(uiItemType::LayoutColumn,
"LAYOUT_COLUMN");
6253 CASE_ITEM(uiItemType::LayoutColumnFlow,
"LAYOUT_COLUMN_FLOW");
6254 CASE_ITEM(uiItemType::LayoutRowFlow,
"LAYOUT_ROW_FLOW");
6255 CASE_ITEM(uiItemType::LayoutBox,
"LAYOUT_BOX");
6256 CASE_ITEM(uiItemType::LayoutAbsolute,
"LAYOUT_ABSOLUTE");
6257 CASE_ITEM(uiItemType::LayoutSplit,
"LAYOUT_SPLIT");
6258 CASE_ITEM(uiItemType::LayoutOverlap,
"LAYOUT_OVERLAP");
6259 CASE_ITEM(uiItemType::LayoutRoot,
"LAYOUT_ROOT");
6260 CASE_ITEM(uiItemType::LayoutGridFlow,
"LAYOUT_GRID_FLOW");
6261 CASE_ITEM(uiItemType::LayoutRadial,
"LAYOUT_RADIAL");
6266 switch (item->type_) {
6267 case uiItemType::Button:
6278 if (item != items.
last()) {
6306 const int dialog_width,
6308 const int icon_size)
6315 const float split_factor = (float(icon_size) + icon_padding) /
6322 uiLayout *split_block = &block_layout->
split(split_factor,
false);
6331 layout = &split_block->
column(
false);
bContextStore * CTX_store_add_all(blender::Vector< std::unique_ptr< bContextStore > > &contexts, const bContextStore *context)
ARegion * CTX_wm_region_popup(const bContext *C)
bContextStore * CTX_store_add(blender::Vector< std::unique_ptr< bContextStore > > &contexts, blender::StringRef name, const PointerRNA *ptr)
wmWindow * CTX_wm_window(const bContext *C)
Main * CTX_data_main(const bContext *C)
const bContextStore * CTX_store_get(const bContext *C)
void CTX_store_set(bContext *C, const bContextStore *store)
ARegion * CTX_wm_region(const bContext *C)
void IDP_CopyPropertyContent(IDProperty *dst, const IDProperty *src) ATTR_NONNULL()
Functions and classes for applying templates with variable expressions to filepaths.
std::optional< blender::bke::path_templates::VariableMap > BKE_build_template_variables_for_prop(const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
blender::Vector< blender::bke::path_templates::Error > BKE_path_validate_template(blender::StringRef path, const blender::bke::path_templates::VariableMap &template_variables)
bool BKE_path_contains_template_syntax(blender::StringRef path)
SpaceType * BKE_spacetype_from_id(int spaceid)
ARegionType * BKE_regiontype_from_id(const SpaceType *st, int regionid)
void BKE_panel_free(Panel *panel)
Panel * BKE_panel_new(PanelType *panel_type)
LayoutPanelState * BKE_panel_layout_panel_state_ensure(Panel *panel, blender::StringRef idname, bool default_closed)
A dynamically sized string ADT.
char * BLI_dynstr_get_cstring(const DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
void BLI_dynstr_append(DynStr *__restrict ds, const char *cstr) ATTR_NONNULL()
void BLI_kdtree_nd_ free(KDTree *tree)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * STRNCPY(char(&dst)[N], const char *src)
int char * BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define ENUM_OPERATORS(_type, _max)
#define POINTER_FROM_INT(i)
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
#define CTX_IFACE_(context, msgid)
#define RGN_ALIGN_ENUM_FROM_MASK(align)
@ RGN_FLAG_SEARCH_FILTER_ACTIVE
static void split(const char *text, const char *seps, char ***str, int *count)
Read Guarded memory(de)allocation.
#define RNA_STRUCT_BEGIN(sptr, prop)
#define RNA_warning(format,...)
eStringPropertySearchFlag
@ PROP_STRING_SEARCH_SUGGESTION
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
@ PROP_PATH_SUPPORTS_TEMPLATES
void UI_but_func_set(uiBut *but, std::function< void(bContext &)> func)
void * but_func_argN_copy(const void *argN)
void but_func_argN_free(void *argN)
void UI_but_disable(uiBut *but, const char *disabled_hint)
uiBut * uiDefIconTextButR_prop(uiBlock *block, int type, int retval, int icon, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_placeholder_set(uiBut *but, blender::StringRef placeholder_text)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
uiBut * uiDefButR_prop(uiBlock *block, int type, int retval, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_popup_menu_but_set(uiPopupMenu *pup, ARegion *butregion, uiBut *but)
bool UI_block_can_add_separator(const uiBlock *block)
void UI_but_func_rename_full_set(uiBut *but, std::function< void(std::string &new_name)> rename_full_func)
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_but_func_search_set_results_are_suggestions(uiBut *but, bool value)
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
void UI_popup_dummy_panel_set(ARegion *region, uiBlock *block)
uiBut * uiDefIconButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * uiDefBut(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
bool UI_but_is_userdef(const uiBut *but)
const uiStyle * UI_style_get_dpi()
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
void UI_but_drawflag_enable(uiBut *but, int flag)
void UI_but_flag2_enable(uiBut *but, int flag)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
@ UI_BUT2_FORCE_SEMI_MODAL_ACTIVE
void *(*)(const void *argN) uiButArgNCopy
void(*)(void *argN) uiButArgNFree
uiBut * uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, std::optional< blender::StringRef > name, int icon, int x, int y, int width, int height)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
void UI_but_type_set_menu_from_pulldown(uiBut *but)
uiBut * uiDefIconButO(uiBlock *block, int type, blender::StringRefNull opname, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiBut * uiDefButAlert(uiBlock *block, int icon, int x, int y, short width, short height)
PointerRNA * UI_but_operator_ptr_ensure(uiBut *but)
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void UI_but_drawflag_disable(uiBut *but, int flag)
uiBut * uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_align_begin(uiBlock *block)
void UI_butstore_register(uiButStore *bs_handle, uiBut **but_p)
@ UI_BUT_HAS_QUICK_TOOLTIP
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, std::optional< blender::StringRef > tip)
uiBut * uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
int int UI_fontstyle_string_width_with_block_aspect(const uiFontStyle *fs, blender::StringRef str, float aspect) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
uiBut * uiDefIconTextButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
uiButStore * UI_butstore_create(uiBlock *block)
uiBut * uiDefButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
void UI_block_direction_set(uiBlock *block, char direction)
void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN)
void UI_butstore_free(uiBlock *block, uiButStore *bs_handle)
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_but_drag_set_id(uiBut *but, ID *id)
@ UI_BUT_ACTIVATE_ON_INIT
@ UI_BLOCK_NO_ACCELERATOR_KEYS
void UI_but_unit_type_set(uiBut *but, int unit_type)
void UI_but_flag_enable(uiBut *but, int flag)
void UI_block_align_end(uiBlock *block)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
@ UI_ITEM_R_TEXT_BUT_FORCE_SEMI_MODAL_ACTIVE
@ UI_ITEM_R_FORCE_BLANK_DECORATE
@ UI_ITEM_R_CHECKBOX_INVERT
Panel * uiLayoutGetRootPanel(uiLayout *layout)
void uiLayoutSetUnitsY(uiLayout *layout, float unit)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
@ UI_BUT_PROGRESS_TYPE_BAR
@ UI_BUT_PROGRESS_TYPE_RING
void uiItemDecoratorR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index)
int uiLayoutGetLocalDir(const uiLayout *layout)
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout)
void(*)(void *arg) uiFreeArgFunc
void(*)(bContext *C, uiLayout *layout, void *arg1) uiMenuCreateFunc
std::string(*)(bContext *C, void *argN, blender::StringRef tip) uiButToolTipFunc
void(*)(bContext *C, void *arg, int event) uiMenuHandleFunc
void *(*)(const void *arg) uiCopyArgFunc
@ WM_OP_INVOKE_REGION_WIN
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
btMatrix3x3 absolute() const
Return the matrix with all values non negative.
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
std::reverse_iterator< T * > rbegin()
void append(const T &value)
const T & last(const int64_t n=0) const
MutableSpan< T > as_mutable_span()
std::reverse_iterator< T * > rend()
void extend(Span< T > array)
void fill(const T &value) const
constexpr const T & last(const int64_t n=0) const
constexpr bool is_empty() const
constexpr bool is_empty() const
constexpr int64_t size() const
void copy_utf8_truncated(char *dst, int64_t dst_size) const
constexpr const char * data() const
constexpr const char * c_str() const
int64_t remove_if(Predicate &&predicate)
void append(const T &value)
void reserve(const int64_t min_capacity)
bool ED_id_rename(Main &bmain, ID &id, blender::StringRefNull name)
bool all(VecOp< bool, D >) RET
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
void ui_but_update(uiBut *but)
void ui_def_but_icon_clear(uiBut *but)
void ui_block_add_dynamic_listener(uiBlock *block, void(*listener_func)(const wmRegionListenerParams *params))
void ui_but_rna_menu_convert_to_panel_type(uiBut *but, const char *panel_type)
uiBut * ui_but_change_type(uiBut *but, eButType new_type)
void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_strip)
void ui_but_rna_menu_convert_to_menu_type(uiBut *but, const char *menu_type)
const char ui_radial_dir_order[8]
bool ui_but_can_align(const uiBut *but)
int ui_but_align_opposite_to_area_align_get(const ARegion *region)
void ui_but_anim_decorate_cb(bContext *C, void *arg_but, void *)
bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
void ui_pie_menu_level_create(uiBlock *block, wmOperatorType *ot, blender::StringRefNull propname, IDProperty *properties, const EnumPropertyItem *items, int totitem, wmOperatorCallContext context, eUI_Item_Flag flag)
uiBut * ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, bool results_are_suggestions)
bool ui_block_is_popup_any(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
ARegion * ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiButSearch *search_but)
void ui_item_paneltype_func(bContext *C, uiLayout *layout, void *arg_pt)
void ui_panel_tag_search_filter_match(Panel *panel)
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
std::optional< blender::StringRefNull > UI_asset_shelf_idname_from_button_context(const uiBut *but)
void ui_but_pie_dir(RadialDirection dir, float vec[2])
void ui_rna_collection_search_update_fn(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first)
@ UI_SEARCH_FILTER_NO_MATCH
static void ui_litem_estimate_column(uiLayout *litem, bool is_box)
void uiItemsEnumO(uiLayout *layout, const StringRefNull opname, const StringRefNull propname)
static uiBut * ui_item_menu(uiLayout *layout, const StringRef name, int icon, uiMenuCreateFunc func, void *arg, void *argN, const std::optional< StringRef > tip, bool force_menu, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
static int ui_litem_min_width(int itemw)
static void ui_litem_layout_column_flow(uiLayout *litem)
bool uiLayoutGetActivateInit(uiLayout *layout)
void uiItemEnumO_string(uiLayout *layout, const StringRef name, int icon, const StringRefNull opname, const StringRefNull propname, const char *value_str)
Panel * uiLayoutGetRootPanel(uiLayout *layout)
#define CASE_ITEM(type, name)
void uiItemEnumO_ptr(uiLayout *layout, wmOperatorType *ot, std::optional< StringRef > name, int icon, const StringRefNull propname, int value)
void uiLayoutSetActive(uiLayout *layout, bool active)
static void ui_litem_init_from_parent(uiLayout *litem, uiLayout *layout, int align)
static StringRef ui_menu_enumpropname(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int retval)
static void ui_item_flag(uiLayout *litem, int flag)
bool uiLayoutGetPropDecorate(uiLayout *layout)
int uiLayoutGetAlignment(uiLayout *layout)
static void ui_item_array(uiLayout *layout, uiBlock *block, const StringRef name, int icon, PointerRNA *ptr, PropertyRNA *prop, const int len, int x, const int y, int w, const int, const bool expand, const bool slider, const int toggle, const bool icon_only, const bool compact, const bool show_text)
blender::ui::EmbossType uiLayoutGetEmboss(uiLayout *layout)
void uiLayoutSetUnitsY(uiLayout *layout, float unit)
static void ui_litem_layout_column(uiLayout *litem, bool is_box, bool is_menu)
void uiLayoutSetEnabled(uiLayout *layout, bool enabled)
static void ui_item_estimate(uiItem *item)
static void ui_litem_layout_overlap(uiLayout *litem)
blender::ui::ItemInternalFlag uiItemInternalFlag
static bool button_matches_search_filter(uiBut *but, const char *search_filter)
void uiItemEnumR_prop(uiLayout *layout, const std::optional< StringRefNull > name, int icon, PointerRNA *ptr, PropertyRNA *prop, int value)
bool UI_block_apply_search_filter(uiBlock *block, const char *search_filter)
uiLayout * uiItemsAlertBox(uiBlock *block, const uiStyle *style, const int dialog_width, const eAlertIcon icon, const int icon_size)
static bool button_group_has_search_match(const uiButtonGroup &group, const char *search_filter)
void uiLayoutSetFixedSize(uiLayout *layout, bool fixed_size)
void uiItemMContents(uiLayout *layout, const StringRef menuname)
static void ui_litem_estimate_column_flow(uiLayout *litem)
void uiItemPopoverPanel_ptr(uiLayout *layout, const bContext *C, PanelType *pt, const std::optional< StringRef > name_opt, int icon)
float uiLayoutGetUnitsY(uiLayout *layout)
uiPropertySplitWrapper uiItemPropertySplitWrapperCreate(uiLayout *parent_layout)
void uiLayoutSetScaleY(uiLayout *layout, float scale)
void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
static void ui_litem_estimate_split(uiLayout *litem)
static void ui_litem_estimate_overlap(uiLayout *litem)
static void ui_item_disabled(uiLayout *layout, const char *name)
static int spaces_after_column_item(const uiLayout *litem, const uiItem *item, const uiItem *next_item, const bool is_box)
void uiLayoutSetActiveDefault(uiLayout *layout, bool active_default)
static int menu_item_enum_opname_menu_active(bContext *C, uiBut *but, MenuItemLevel *lvl)
void uiLayoutSetRedAlert(uiLayout *layout, bool redalert)
static void ui_item_enum_expand_elem_exec(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, const std::optional< StringRef > uiname, const int h, const eButType but_type, const bool icon_only, const EnumPropertyItem *item, const bool is_first)
void uiItemEnumO_value(uiLayout *layout, const StringRefNull name, int icon, const StringRefNull opname, const StringRefNull propname, int value)
static void ui_item_offset(const uiItem *item, int *r_x, int *r_y)
void uiItemsFullEnumO(uiLayout *layout, const StringRefNull opname, const StringRefNull propname, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, const int active)
static bool ui_item_rna_is_expand(PropertyRNA *prop, int index, const eUI_Item_Flag item_flag)
MenuType * UI_but_menutype_get(const uiBut *but)
#define UI_ITEM_PROP_SEP_DIVIDE
uiBut * uiItemL_ex(uiLayout *layout, const StringRef name, int icon, const bool highlight, const bool redalert)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
uiBut * ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, const bool results_are_suggestions)
uiLayout * UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, const uiStyle *style)
void uiLayoutSetScaleX(uiLayout *layout, float scale)
void uiItemDecoratorR(uiLayout *layout, PointerRNA *ptr, const std::optional< StringRefNull > propname, int index)
static void ui_item_layout(uiItem *item)
static void ui_litem_layout_absolute(uiLayout *litem)
static uiLayout * ui_item_prop_split_layout_hack(uiLayout *layout_parent, uiLayout *layout_split)
static bool ui_item_is_radial_displayable(uiItem *item)
float uiLayoutGetUnitsX(uiLayout *layout)
bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but)
static int ui_text_icon_width_ex(uiLayout *layout, const StringRef name, int icon, const uiTextIconPadFactor &pad_factor, const uiFontStyle *fstyle)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
bool uiLayoutGetEnabled(uiLayout *layout)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
static uiLayoutItemBx * ui_layout_box(uiLayout *layout, int type)
static void ui_litem_layout_panel_header(uiLayout *litem)
void uiLayoutSetContextInt(uiLayout *layout, StringRef name, int64_t value)
int uiLayoutListItemPaddingWidth()
static void ui_layout_heading_set(uiLayout *layout, const StringRef heading)
static void ui_litem_layout_panel_body(uiLayout *litem)
float uiLayoutGetScaleY(uiLayout *layout)
void uiItemMenuEnumFullO_ptr(uiLayout *layout, const bContext *C, wmOperatorType *ot, const StringRefNull propname, std::optional< StringRefNull > name, int icon, PointerRNA *r_opptr)
wmOperatorCallContext uiLayoutGetOperatorContext(uiLayout *layout)
void uiItemDecoratorR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index)
static bool block_search_filter_tag_buttons(uiBlock *block, const char *search_filter)
void uiItemPopoverPanelFromGroup(uiLayout *layout, bContext *C, int space_id, int region_id, const char *context, const char *category)
bool uiLayoutGetActive(uiLayout *layout)
static void ui_layout_heading_label_add(uiLayout *layout, uiLayout *heading_layout, bool right_align, bool respect_prop_split)
static void ui_litem_layout_row(uiLayout *litem)
static RadialDirection ui_get_radialbut_vec(float vec[2], short itemnum)
void uiItemFullR_with_menu(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, const eUI_Item_Flag flag, const std::optional< StringRefNull > name, int icon, const char *menu_type)
void uiItemEnumR_string(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname, const char *value, const std::optional< StringRefNull > name, int icon)
static uiBut * ui_item_with_label(uiLayout *layout, uiBlock *block, const StringRef name, const int icon, PointerRNA *ptr, PropertyRNA *prop, const int index, const int x, const int y, const int w_hint, const int h, const int flag)
BLI_INLINE bool ui_layout_is_radial(const uiLayout *layout)
float uiLayoutGetSearchWeight(uiLayout *layout)
bool uiLayoutGetKeepAspect(uiLayout *layout)
static void ui_layout_add_padding_button(uiLayoutRoot *root)
void uiItemPointerR(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname, PointerRNA *searchptr, const StringRefNull searchpropname, const std::optional< StringRefNull > name, int icon)
bool uiLayoutGetPropSep(uiLayout *layout)
static void ui_layout_introspect_button(DynStr *ds, const uiButtonItem *bitem)
void ui_item_paneltype_func(bContext *C, uiLayout *layout, void *arg_pt)
static int ui_layout_vary_direction(uiLayout *layout)
static void menu_item_enum_rna_menu(bContext *, uiLayout *layout, void *arg)
void UI_paneltype_draw(bContext *C, PanelType *pt, uiLayout *layout)
void uiLayoutSetUnitsX(uiLayout *layout, float unit)
static void ui_litem_estimate_row(uiLayout *litem)
static void ui_layout_end(uiBlock *block, uiLayout *layout, int *r_x, int *r_y)
constexpr uiTextIconPadFactor ui_text_pad_default
void uiLayoutSetTooltipFunc(uiLayout *layout, uiButToolTipFunc func, void *arg, uiCopyArgFunc copy_arg, uiFreeArgFunc free_arg)
static bool block_search_panel_label_matches(const uiBlock *block, const char *search_string)
int uiLayoutGetLocalDir(const uiLayout *layout)
void uiItemMenuEnumR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, const std::optional< StringRefNull > name, int icon)
void uiItemsEnumR(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname)
void uiItemSpacer(uiLayout *layout)
static void ui_litem_grid_flow_compute(blender::Span< uiItem * > items, const UILayoutGridFlowInput *parameters, UILayoutGridFlowOutput *results)
void ui_layout_list_set_labels_active(uiLayout *layout)
void UI_menutype_draw(bContext *C, MenuType *mt, uiLayout *layout)
void uiLayoutSetKeepAspect(uiLayout *layout, bool keepaspect)
bool uiLayoutGetFixedSize(uiLayout *layout)
static void ui_litem_estimate_box(uiLayout *litem)
static void ui_rna_collection_search_arg_free_fn(void *ptr)
static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, const std::optional< StringRef > uiname, const int h, const bool icon_only)
void UI_context_active_but_prop_get_filebrowser(const bContext *C, PointerRNA *r_ptr, PropertyRNA **r_prop, bool *r_is_undo, bool *r_is_userdef)
static bool ui_layout_has_panel_label(const uiLayout *layout, const PanelType *pt)
static void ui_layout_introspect_items(DynStr *ds, blender::Span< uiItem * > items)
static void ui_litem_estimate_panel_header(uiLayout *litem)
static void ui_keymap_but_cb(bContext *, void *but_v, void *)
bool uiLayoutGetActiveDefault(uiLayout *layout)
static void ui_item_rna_size(uiLayout *layout, StringRef name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, bool icon_only, bool compact, int *r_w, int *r_h)
static uiLayout * ui_layout_heading_find(uiLayout *cur_layout)
static void ui_litem_estimate_grid_flow(uiLayout *litem)
constexpr uiTextIconPadFactor ui_text_pad_compact
PanelType * UI_but_paneltype_get(const uiBut *but)
void uiLayoutSetContextPointer(uiLayout *layout, StringRef name, PointerRNA *ptr)
static uiButtonItem * ui_layout_find_button_item(const uiLayout *layout, const uiBut *but)
void uiLayoutSetContextString(uiLayout *layout, StringRef name, blender::StringRef value)
static void ui_litem_estimate_root(uiLayout *)
static void menu_item_enum_opname_menu(bContext *C, uiLayout *layout, void *arg)
static uiBut * uiItemL_(uiLayout *layout, const StringRef name, int icon)
void uiLayoutSetSearchWeight(uiLayout *layout, const float weight)
static void ui_item_scale(uiLayout *litem, const float scale[2])
int uiLayoutGetWidth(uiLayout *layout)
static void search_id_collection(StructRNA *ptype, PointerRNA *r_ptr, PropertyRNA **r_prop)
void uiItemFullOMenuHold_ptr(uiLayout *layout, wmOperatorType *ot, std::optional< StringRef > name, int icon, const wmOperatorCallContext context, const eUI_Item_Flag flag, const char *menu_id, PointerRNA *r_opptr)
static void ui_litem_layout_split(uiLayout *litem)
const char * UI_layout_introspect(uiLayout *layout)
void uiItemMenuEnumFullO(uiLayout *layout, const bContext *C, const StringRefNull opname, const StringRefNull propname, StringRefNull name, int icon, PointerRNA *r_opptr)
float uiLayoutGetScaleX(uiLayout *layout)
bool UI_block_layout_needs_resolving(const uiBlock *block)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
void uiLayoutListItemAddPadding(uiLayout *layout)
void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but)
static void ui_but_tip_from_enum_item(uiBut *but, const EnumPropertyItem *item)
uiLayout * uiItemL_respect_property_split(uiLayout *layout, StringRef text, int icon)
static StringRef ui_item_name_add_colon(StringRef name, char namestr[UI_MAX_NAME_STR])
void uiItemFullR_with_popover(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index, int value, const eUI_Item_Flag flag, const std::optional< StringRefNull > name, int icon, const char *panel_type)
void UI_block_layout_free(uiBlock *block)
static void ui_litem_layout_radial(uiLayout *litem)
#define UI_OPERATOR_ERROR_RET(_ot, _opname, return_statement)
void uiLayoutSetEmboss(uiLayout *layout, blender::ui::EmbossType emboss)
static void ui_litem_estimate_absolute(uiLayout *litem)
static void ui_item_enum_expand_handle(bContext *C, void *arg1, void *arg2)
static int ui_item_fit(const int item, const int pos, const int all, const int available, const bool is_last, const int alignment, float *extra_pixel)
static void ui_item_menu_hold(bContext *C, ARegion *butregion, uiBut *but)
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
static void ui_item_enum_expand_tabs(uiLayout *layout, bContext *C, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *ptr_highlight, PropertyRNA *prop_highlight, const std::optional< StringRef > uiname, const int h, const bool icon_only)
static bool ui_layout_variable_size(uiLayout *layout)
void uiLayoutSetActivateInit(uiLayout *layout, bool activate_init)
static void ui_layout_free(uiLayout *layout)
static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
static int ui_text_icon_width(uiLayout *layout, const StringRef name, const int icon, const bool compact)
void uiItemPopoverPanel(uiLayout *layout, const bContext *C, const StringRef panel_type, std::optional< blender::StringRef > name_opt, int icon)
blender::ui::ItemType uiItemType
void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, StringRef name, int icon)
static void ui_litem_layout_box(uiLayout *litem)
void uiItemProgressIndicator(uiLayout *layout, const char *text, const float factor, const eButProgressType progress_type)
static void ui_paneltype_draw_impl(bContext *C, PanelType *pt, uiLayout *layout, bool show_header)
void uiItemsFullEnumO_items(uiLayout *layout, wmOperatorType *ot, const PointerRNA &ptr, PropertyRNA *prop, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, const EnumPropertyItem *item_array, int totitem, int active)
static void ui_item_size(const uiItem *item, int *r_w, int *r_h)
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout)
void uiItemPointerR_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *searchptr, PropertyRNA *searchprop, const std::optional< StringRefNull > name_opt, int icon, bool results_are_suggestions)
static void ui_item_align(uiLayout *litem, short nr)
static void ui_litem_layout_grid_flow(uiLayout *litem)
static void ui_item_position(uiItem *item, const int x, const int y, const int w, const int h)
void ui_layout_remove_but(uiLayout *layout, const uiBut *but)
void uiLayoutSetOperatorContext(uiLayout *layout, wmOperatorCallContext opcontext)
bContextStore * uiLayoutGetContextStore(uiLayout *layout)
static uiLayout * ui_item_local_sublayout(uiLayout *test, uiLayout *layout, bool align)
bool uiLayoutGetRedAlert(uiLayout *layout)
constexpr uiTextIconPadFactor ui_text_pad_none
void uiItemEnumO(uiLayout *layout, const StringRefNull opname, const std::optional< StringRef > name, int icon, const StringRefNull propname, int value)
void ui_layout_add_but(uiLayout *layout, uiBut *but)
static void ui_litem_layout_root(uiLayout *litem)
void uiLayoutContextCopy(uiLayout *layout, const bContextStore *context)
static void ui_item_enum_expand_exec(uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, const std::optional< StringRef > uiname, const int h, const eButType but_type, const bool icon_only)
static uiBut * uiItemFullO_ptr_ex(uiLayout *layout, wmOperatorType *ot, std::optional< StringRef > name, int icon, const wmOperatorCallContext context, const eUI_Item_Flag flag, PointerRNA *r_opptr)
void uiItemMenuEnumO(uiLayout *layout, const bContext *C, const StringRefNull opname, const StringRefNull propname, StringRefNull name, int icon)
void uiItemTabsEnumR_prop(uiLayout *layout, bContext *C, PointerRNA *ptr, PropertyRNA *prop, PointerRNA *ptr_highlight, PropertyRNA *prop_highlight, bool icon_only)
static void ui_item_move(uiItem *item, const int delta_xmin, const int delta_xmax)
static void ui_litem_layout_root_radial(uiLayout *litem)
static bool ui_item_is_radial_drawable(uiButtonItem *bitem)
std::optional< blender::StringRefNull > UI_but_asset_shelf_type_idname_get(const uiBut *but)
static void ui_litem_estimate_panel_body(uiLayout *litem)
wmOperatorType * UI_but_operatortype_get_from_enum_menu(uiBut *but, PropertyRNA **r_prop)
void uiItemEnumR_string_prop(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, const char *value, const std::optional< StringRefNull > name, int icon)
void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv)
bool uiLayoutEndsWithPanelHeader(const uiLayout &layout)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
static void progress_bar(int, const char *)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
bool RNA_property_array_check(PropertyRNA *prop)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
bool RNA_property_is_unlink(PropertyRNA *prop)
int RNA_enum_from_name(const EnumPropertyItem *item, const char *name)
bool RNA_struct_is_ID(const StructRNA *type)
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
eStringPropertySearchFlag RNA_property_string_search_flag(PropertyRNA *prop)
int RNA_property_ui_icon(const PropertyRNA *prop)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
const char * RNA_property_description(PropertyRNA *prop)
bool RNA_property_animateable(const PointerRNA *ptr, PropertyRNA *prop_orig)
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
PropertyType RNA_property_type(PropertyRNA *prop)
const PointerRNA PointerRNA_NULL
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
char RNA_property_array_item_char(PropertyRNA *prop, int index)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
const char * RNA_property_translation_context(const PropertyRNA *prop)
int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[])
int RNA_property_flag(PropertyRNA *prop)
int RNA_struct_ui_icon(const StructRNA *type)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_ui_name(const PropertyRNA *prop)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
void RNA_property_enum_items_gettexted_all(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
PointerRNA RNA_main_pointer_create(Main *main)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
ARegionRuntimeHandle * runtime
blender::Vector< LayoutPanelBody > bodies
blender::Vector< LayoutPanelHeader > headers
void(* draw)(const bContext *C, Panel *panel)
bool(* poll)(const bContext *C, PanelType *pt)
void(* listener)(const wmRegionListenerParams *params)
char translation_context[BKE_ST_MAXNAME]
char label[BKE_ST_MAXNAME]
void(* draw_header)(const bContext *C, Panel *panel)
PointerRNA * custom_data_ptr
LayoutPanels layout_panels
struct Panel_Runtime * runtime
blender::Vector< bContextStoreEntry > entries
blender::Vector< std::unique_ptr< uiBut > > buttons
uiPopupBlockHandle * handle
uiBut * first_but() const
blender::Vector< std::unique_ptr< bContextStore > > contexts
blender::ui::EmbossType emboss
blender::Vector< uiButtonGroup > button_groups
uiBut * next_but(const uiBut *but) const
PointerRNA decorated_rnapoin
PropertyRNA * decorated_rnaprop
wmEventModifierFlag modifier_key
PropertyRNA * rnasearchprop
blender::ui::EmbossType emboss
uiMenuCreateFunc menu_create_func
const bContextStore * context
uiButArgNFree func_argN_free_fn
uiButArgNCopy func_argN_copy_fn
blender::ui::ItemType type_
blender::ui::ItemInternalFlag flag_
wmOperatorCallContext opcontext
uiMenuHandleFunc handlefunc
char heading_[UI_MAX_NAME_STR]
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, wmOperatorCallContext context, eUI_Item_Flag flag)
PanelLayout panel(const bContext *C, blender::StringRef idname, bool default_closed)
PanelLayout panel_prop_with_bool_header(const bContext *C, PointerRNA *open_prop_owner, blender::StringRefNull open_prop_name, PointerRNA *bool_prop_owner, blender::StringRefNull bool_prop_name, std::optional< blender::StringRefNull > label)
void menu_fn_argN_free(blender::StringRefNull name, int icon, uiMenuCreateFunc func, void *argN)
uiLayout * child_items_layout_
uiBlock * absolute_block()
uiLayout & column_flow(int number, bool align)
PanelLayout panel_prop(const bContext *C, PointerRNA *open_prop_owner, blender::StringRefNull open_prop_name)
blender::Vector< uiItem * > items_
blender::ui::EmbossType emboss_
void label(blender::StringRef name, int icon)
uiLayout & column(bool align)
uiLayout & grid_flow(bool row_major, int columns_len, bool even_columns, bool even_rows, bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void menu_fn(blender::StringRefNull name, int icon, uiMenuCreateFunc func, void *arg)
uiLayout & row(bool align)
uiLayout & split(float percentage, bool align)
uiLayout & absolute(bool align)
uiLayout & list_box(uiList *ui_list, PointerRNA *actptr, PropertyRNA *actprop)
void menu(MenuType *mt, std::optional< blender::StringRef > name, int icon)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
uiLayout * decorate_column
PropertyRNA * target_prop
PropertyRNA * search_prop
wmEventModifierFlag modifier
std::string(* get_description)(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
struct wmEvent * eventstate
std::optional< std::string > WM_key_event_operator_string(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const bool is_strict)
std::optional< std::string > WM_keymap_item_to_string(const wmKeyMapItem *kmi, const bool compact)
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
std::string WM_operator_pystring_ex(bContext *C, wmOperator *op, const bool all_args, const bool macro_args, wmOperatorType *ot, PointerRNA *opptr)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
PanelType * WM_paneltype_find(const StringRef idname, bool quiet)