17#include <fmt/format.h>
85#define UI_BUT_VALUE_UNSET DBL_MAX
86#define UI_GET_BUT_VALUE_INIT(_but, _value) \
87 if (_value == DBL_MAX) { \
88 (_value) = ui_but_value_get(_but); \
131 *
x = float(getsizex) *
132 (0.5f + 0.5f * (gx * block->
winmat[0][0] + gy * block->
winmat[1][0] + block->
winmat[3][0]));
133 *
y = float(getsizey) *
134 (0.5f + 0.5f * (gx * block->
winmat[0][1] + gy * block->
winmat[1][1] + block->
winmat[3][1]));
151 *
x = int(lround(fx));
152 *
y = int(lround(fy));
178 float min_y = 0, max_y = 1;
179 float dummy_x = 0.0f;
183 return max_y - min_y;
193 const float a = 0.5f * float(getsizex) * block->
winmat[0][0];
194 const float b = 0.5f * float(getsizex) * block->
winmat[1][0];
195 const float c = 0.5f * float(getsizex) * (1.0f + block->
winmat[3][0]);
197 const float d = 0.5f * float(getsizey) * block->
winmat[0][1];
198 const float e = 0.5f * float(getsizey) * block->
winmat[1][1];
199 const float f = 0.5f * float(getsizey) * (1.0f + block->
winmat[3][1]);
201 const float px = *
x - sx;
202 const float py = *
y - sy;
204 *
y = (a * (py - f) + d * (c - px)) / (a *
e - d *
b);
205 *
x = (px -
b * (*y) - c) / a;
230 *
x = int(lround(fx));
231 *
y = int(lround(fy));
265 auto index = std::distance(
267 std::find_if(
buttons.begin(),
buttons.end(), [but](
const std::unique_ptr<uiBut> &test) {
268 return test.get() == but;
276 const int idx = this->
but_index(but) + 1;
277 return idx < this->
buttons.size() ? this->
buttons[idx].get() :
nullptr;
282 const int idx = this->
but_index(but) - 1;
283 return idx >= 0 ? this->
buttons[idx].get() :
nullptr;
289 this->
buttons.remove(target_index);
294 return !this->
buttons.is_empty() ? this->
buttons.first().get() :
nullptr;
299 return !this->
buttons.is_empty() ? this->
buttons.last().get() :
nullptr;
304 int sepr_flex_len = 0;
305 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
311 if (sepr_flex_len == 0) {
318 const float region_width = float(region->
winx);
320 if (region_width <= buttons_width) {
326 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
334 const float segment_width = region_width / float(sepr_flex_len);
335 float offset = 0, remaining_space = region_width - buttons_width;
337 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
341 int overlap = ((
i == sepr_flex_len - 1) ? buttons_width - spacers_pos[
i] :
342 (spacers_pos[
i + 1] - spacers_pos[
i]) / 2);
343 const int segment_end = segment_width * (
i + 1);
344 const int spacer_end = segment_end - overlap;
345 const int spacer_sta = spacers_pos[
i] + offset;
346 if (spacer_end > spacer_sta) {
347 const float step =
min_ff(remaining_space, spacer_end - spacer_sta);
348 remaining_space -=
step;
360 if (region && region->
runtime->visible) {
369 const rcti winrct = {0, win_size[0] - 1, 0, win_size[1] - 1};
392 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
401 const bool is_same_align_group = (
left->alignnr && (
left->alignnr == right->
alignnr));
402 return is_same_align_group && (
left->rect.xmin < right->
rect.
xmin);
411 std::unique_ptr<uiBut> *col_bt;
412 int i = 0, j, x1addval = offset;
415 std::unique_ptr<uiBut> *end = block->
buttons.
end();
417 std::unique_ptr<uiBut> *init_col_bt = block->
buttons.
begin();
418 for (std::unique_ptr<uiBut> *bt = init_col_bt; bt < end; bt++) {
430 const int alignnr = (*bt)->alignnr;
431 for (col_bt = bt; col_bt < end && (*col_bt)->alignnr == alignnr; col_bt++) {
433 (*col_bt)->rect.xmin += x1addval;
434 (*col_bt)->rect.xmax += x1addval;
436 i = std::max(width,
i);
439 bt = col_bt != end ? col_bt-- :
nullptr;
442 if (bt < end && (bt + 1 < end) && (*bt)->rect.xmin < bt[1]->rect.xmin) {
444 for (col_bt = init_col_bt; (col_bt - 1) != bt; col_bt++) {
445 (*col_bt)->rect.xmin = x1addval;
446 (*col_bt)->rect.xmax = x1addval +
i + block->
bounds;
454 init_col_bt = col_bt;
459 for (col_bt = init_col_bt; col_bt < end; col_bt++) {
462 const int alignnr = (*col_bt)->alignnr;
463 for (; col_bt < end && (*col_bt)->alignnr == alignnr; col_bt++) {
471 (*col_bt)->rect.xmin = x1addval;
492 for (
const std::unique_ptr<uiBut> &bt : block->
buttons) {
527 const int startx = (win_size[0] * 0.5f) - (width * 0.5f);
528 const int starty = (win_size[1] * 0.5f) - (height * 0.5f);
561 const int oldbounds = block->
bounds;
581 block->
bounds = oldbounds;
589 oldwidth = oldwidth > 0 ? oldwidth : std::max(1, width);
590 oldheight = oldheight > 0 ? oldheight : std::max(1, height);
604 rect_bounds.
xmin = margin;
605 rect_bounds.
ymin = margin;
606 rect_bounds.
xmax = win_size[0] - margin;
627 if (block ==
nullptr) {
645 if (bounds_offset !=
nullptr) {
659 if (bounds_offset !=
nullptr) {
709 if (
floor(value) == value) {
742 else if (prec == -1) {
743 prec = (but->
hardmax < 10.001f) ? 3 : 2;
850 const uiBut *but_new,
853 for (
const std::unique_ptr<uiBut> &but : block_old->
buttons) {
868 const uiBut *but_new,
872 for (
const std::unique_ptr<uiBut> &but : block_old->
buttons) {
873 if (!ignore_old_buttons.contains(but.get()) &&
ui_but_equals_old(but_new, but.get())) {
883 for (
const std::unique_ptr<uiBut> &but : block_new->
buttons) {
895 (new_extra_icon->
icon == old_extra_icon->
icon);
899 const uiBut *old_but)
917 if (old_extra_icon) {
918 new_extra_icon->highlighted = old_extra_icon->
highlighted;
952 if (oldbut->
poin != (
char *)oldbut) {
967 oldbut->
flag = (oldbut->
flag & ~flag_copy) | (but->
flag & flag_copy);
976 std::swap(search_oldbut->
arg_free_fn, search_but->arg_free_fn);
977 std::swap(search_oldbut->
arg, search_but->arg);
986 switch (oldbut->
type) {
1025 std::swap(but->
str, oldbut->
str);
1031 std::swap(but->
imb, oldbut->
imb);
1062 std::unique_ptr<uiBut> *but_uptr,
1063 std::optional<int64_t> *but_old_idx)
1066 uiBut *but = but_uptr->get();
1076 std::unique_ptr<uiBut> *oldbut_uptr;
1077 if (
LIKELY(but_old_idx->has_value() &&
1079 !matched_old_buttons.
contains(oldblock->
buttons[**but_old_idx].get()) &&
1082 oldbut_uptr = &oldblock->
buttons[**but_old_idx];
1087 oldbut_uptr = but_old_idx->has_value() ? &oldblock->
buttons[**but_old_idx] :
nullptr;
1090 *but_old_idx = (but_old_idx->has_value() &&
1091 (but_old_idx->value() + 1 < oldblock->
buttons.
size())) ?
1092 std::optional{but_old_idx->value() + 1} :
1096 bool found_active =
false;
1101 uiBut *oldbut = oldbut_uptr->get();
1107 oldbut_uptr->swap(*but_uptr);
1111 matched_old_buttons.
add(but);
1115 oldbut->
block = block;
1123 found_active =
true;
1126 matched_old_buttons.
add(oldbut);
1135 but->
flag = (but->
flag & ~flag_copy) | (oldbut->
flag & flag_copy);
1138 return found_active;
1144 bool activate =
false, found =
false, isactive =
false;
1160 if ((
activate ==
true) || (found ==
false)) {
1169 else if ((found ==
true) && (isactive ==
false)) {
1170 if (remove_on_failure) {
1195 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1210 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1230 if (but->
rnaprop ==
nullptr) {
1247 uint menu_key_mask = 0;
1248 int tot_missing = 0;
1255 for (
int pass = 0; pass < 2; pass++) {
1259 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1260 if (!
ELEM(but->type,
1283 if (but->menu_key !=
'\0') {
1287 if (but->str.empty()) {
1291 const char *str_pt = but->str.c_str();
1294 menu_key = tolower(*str_pt);
1295 if ((menu_key >=
'a' && menu_key <=
'z') && !(menu_key_mask & 1 << (menu_key -
'a'))) {
1296 menu_key_mask |= 1 << (menu_key -
'a');
1302 while (isalpha(*str_pt)) {
1317 but->menu_key = menu_key;
1325 if (menu_key_mask == (1 << 26) - 1) {
1341 if (sep_index != std::string::npos) {
1342 but->
str = but->
str.substr(0, sep_index);
1348 if (shortcut_str ==
nullptr) {
1408 for (
int i = 0;
i < 2;
i++) {
1418 return std::nullopt;
1423 if (but->
optype !=
nullptr) {
1437 return std::nullopt;
1445 if (extra_icon_optype) {
1449 return std::nullopt;
1460 const char *ctx_toggle_opnames[] = {
1461 "WM_OT_context_toggle",
1462 "WM_OT_context_toggle_enum",
1463 "WM_OT_context_cycle_int",
1464 "WM_OT_context_cycle_enum",
1465 "WM_OT_context_cycle_array",
1466 "WM_OT_context_menu_enum",
1470 const char *ctx_enum_opnames[] = {
1471 "WM_OT_context_set_enum",
1475 const char *ctx_enum_opnames_for_Area_ui_type[] = {
1476 "SCREEN_OT_space_type_set_or_cycle",
1480 const char **opnames = ctx_toggle_opnames;
1481 int opnames_len =
ARRAY_SIZE(ctx_toggle_opnames);
1483 int prop_enum_value = -1;
1484 bool prop_enum_value_ok =
false;
1485 bool prop_enum_value_is_int =
false;
1486 const char *prop_enum_value_id =
"value";
1492 if ((but_parent && but_parent->
rnaprop) &&
1499 prop_enum_value = int(but->
hardmin);
1502 prop_enum_value_ok =
true;
1504 opnames = ctx_enum_opnames;
1511 if (prop ==
nullptr) {
1512 return std::nullopt;
1519 if (
ptr->owner_id) {
1520 ID *
id =
ptr->owner_id;
1527 if (
STREQ(prop_id,
"ui_type")) {
1529 prop_enum_value >>= 16;
1533 if (prop_enum_value == -1) {
1536 prop_enum_value_ok = (prop_enum_value != -1);
1539 opnames = ctx_enum_opnames_for_Area_ui_type;
1540 opnames_len =
ARRAY_SIZE(ctx_enum_opnames_for_Area_ui_type);
1541 prop_enum_value_id =
"space_type";
1542 prop_enum_value_is_int =
true;
1555 C,
ptr, prop, prop_index);
1558 data_path_variations.
append(data_path.value_or(
""));
1560 if (data_path.has_value()) {
1562 if (data_path_ref.
startswith(
"scene.tool_settings.")) {
1569 for (
int data_path_index = 0; data_path_index < data_path_variations.
size(); data_path_index++) {
1570 const StringRefNull data_path = data_path_variations[data_path_index];
1571 if (!data_path.
is_empty() || (prop_enum_value_ok && prop_enum_value_id)) {
1578 if (prop_enum_value_ok) {
1585 if (prop_enum_value_is_int) {
1586 const int value = item[index].
value;
1604 for (
int i = 0; (
i < opnames_len) && (opnames[
i]);
i++) {
1614 return std::nullopt;
1677 if (block->
name ==
"splash") {
1682 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1690 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1693 if (but->drawstr[0] ==
'\0') {
1757 extra_op_icon->
icon = icon;
1821 return ((but->
editstr ==
nullptr) && (but->
drawstr[0] !=
'\0') &&
1829 if (but->
rnaprop ==
nullptr) {
1844 if (but->
editstr !=
nullptr) {
1856 return type == &RNA_Bone || type == &RNA_EditBone;
1861 switch (but->
type) {
1899 switch (extra_icon) {
1902 if (!id_eyedropper_ot) {
1907 optype = id_eyedropper_ot;
1908 icon = ICON_EYEDROPPER;
1914 if (!id_eyedropper_ot) {
1919 optype = id_eyedropper_ot;
1920 icon = ICON_EYEDROPPER;
1931 icon = ICON_PANEL_CLOSE;
1941 if ((op_icon->optype_params->optype == optype) && (op_icon->icon == icon)) {
1967 for (std::unique_ptr<uiBut> &but : block->
buttons) {
1972 if (but->tip_func) {
2013 int old_but_flag = 0;
2017 old_but_flag = but->
flag;
2033 "Operator polls shouldn't change button flags");
2035 const_cast<uiBut *
>(but)->
flag = old_but_flag;
2050 params.opcontext = opcontext;
2067 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2077 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2089 op_icon->disabled =
true;
2152 if (!block->
panel) {
2207 rcti rect_winspace = *rect;
2256 else if (block->
panel) {
2268 float subpanel_backcolor[4]{0.2f, 0.3f, 0.33f, 0.05f};
2279 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2309 uiBut *but_prev =
nullptr;
2311 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2312 if (but->rnapoin.type && but->rnaprop) {
2314 if ((but_prev && (but_prev->
rnaprop == but->rnaprop) &&
2321 value.
owner = region;
2325 but_prev = but.get();
2352 lvalue = int(*value);
2361 switch (but->
type) {
2374 if (*value !=
double(but->
hardmin)) {
2382 if (*value == 0.0) {
2407 if (
int(*value) &
int(but->
hardmax)) {
2412 if (*value ==
double(but->
hardmax)) {
2433 is_push = !bool(is_push);
2467 block->
lock =
false;
2492 const char *cp = but->
poin;
2493 vec[0] = float(cp[0]) / 255.0f;
2494 vec[1] = float(cp[1]) / 255.0f;
2495 vec[2] = float(cp[2]) / 255.0f;
2498 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2502 if (but->
editvec ==
nullptr) {
2503 fprintf(stderr,
"%s: can't get color, should never happen\n", __func__);
2528 char *cp = but->
poin;
2529 cp[0] = char(lround(vec[0] * 255.0f));
2530 cp[1] = char(lround(vec[1] * 255.0f));
2531 cp[2] = char(lround(vec[2] * 255.0f));
2534 float *fp =
reinterpret_cast<float *
>(but->
poin);
2556 const char *cp = but->
poin;
2557 vec[0] = float(cp[0]) / 255.0f;
2558 vec[1] = float(cp[1]) / 255.0f;
2559 vec[2] = float(cp[2]) / 255.0f;
2560 vec[3] = float(cp[3]) / 255.0f;
2563 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2567 if (but->
editvec ==
nullptr) {
2568 fprintf(stderr,
"%s: can't get color, should never happen\n", __func__);
2589 char *cp = but->
poin;
2590 cp[0] = char(lround(vec[0] * 255.0f));
2591 cp[1] = char(lround(vec[1] * 255.0f));
2592 cp[2] = char(lround(vec[2] * 255.0f));
2593 cp[3] = char(lround(vec[3] * 255.0f));
2596 float *fp =
reinterpret_cast<float *
>(but->
poin);
2773 value = *(
char *)but->
poin;
2776 value = *(
short *)but->
poin;
2779 value = *(
int *)but->
poin;
2782 value = *(
float *)but->
poin;
2822 int ivalue = int(value);
2855 float fval = float(value);
2856 if (fval >= -0.00001f && fval <= 0.00001f) {
2865 value = *but->
editval = value;
2868 value = *((
char *)but->
poin) = char(value);
2871 value = *((
short *)but->
poin) = short(value);
2874 value = *((
int *)but->
poin) = int(value);
2877 value = *((
float *)but->
poin) = float(value);
2894 uiBut *return_but =
nullptr;
2898 for (
const std::unique_ptr<uiBut> &but_iter : but->
block->
buttons) {
2899 if (but_iter->editstr) {
2900 return_but = but_iter.get();
2943 uiBut *but,
char *
str,
int str_maxncpy,
double value,
bool pad,
int float_precision)
2952 if (float_precision == -1) {
2958 else if (precision == -1) {
2963 precision = float_precision;
2985 if (
step == -1.0f) {
2986 return step_default;
2998 if (
step == step_unit) {
3005 step_final *= step_orig;
3008 return float(step_final);
3013 const size_t str_maxncpy,
3014 const int float_precision,
3015 const bool use_exp_float,
3016 bool *r_use_exp_float)
3018 if (r_use_exp_float) {
3019 *r_use_exp_float =
false;
3026 const char *buf =
nullptr;
3062 if (buf ==
nullptr) {
3065 else if (buf !=
str) {
3095 int prec = float_precision;
3097 if (float_precision == -1) {
3112 BLI_snprintf(
str, str_maxncpy,
"%.*f", std::max(0, prec - 2), value * 100);
3117 if (use_exp_float) {
3118 if (int_digits_num < -6 || int_digits_num > 12) {
3120 if (r_use_exp_float) {
3121 *r_use_exp_float =
true;
3125 prec -= int_digits_num;
3131 prec -= int_digits_num;
3149 char *
str =
nullptr;
3163 const char *value_id;
3173 *r_str_size = strlen(value_id) + 1;
3204#define UI_NUMBER_EVAL_ERROR_PREFIX RPT_("Error evaluating number, see Info editor for details")
3209 char *
error =
nullptr;
3239 *r_value = atof(
str);
3247 const int len = strlen(
str);
3266 const int len = strlen(
str);
3278 if (
str[0] ==
'\0') {
3322 if (
str[0] ==
'\0') {
3344 else if (search_but && search_but->
item_active !=
nullptr) {
3409 else if (
str[0] ==
'#') {
3423 value =
floor(value + 0.5);
3427 if (value <
double(but->
hardmin)) {
3430 if (value >
double(but->
hardmax)) {
3445 const double newmax = (value != 0.0) ?
pow(10.0,
ceil(
log(value) /
M_LN10)) : 0.0;
3447 if (newmax * 0.2 >=
max && newmax * 0.2 >= value) {
3448 return newmax * 0.2;
3450 if (newmax * 0.5 >=
max && newmax * 0.5 >= value) {
3451 return newmax * 0.5;
3460 const double newmax = (value != 0.0) ?
pow(10.0,
floor(
log(value) /
M_LN10)) : 0.0;
3462 if (newmax * 5.0 <=
max && newmax * 5.0 <= value) {
3463 return newmax * 5.0;
3465 if (newmax * 2.0 <=
max && newmax * 2.0 <= value) {
3466 return newmax * 2.0;
3473 if (but->
rnaprop ==
nullptr) {
3504 double softmin, softmax;
3513 int imin, imax, istep;
3516 softmin = std::max(imin, INT_MIN);
3517 softmax = std::min(imax, INT_MAX);
3524 value_min = double(value_range[0]);
3525 value_max = double(value_range[1]);
3533 float fmin, fmax, fstep, fprecision;
3536 softmin = (fmin == -
FLT_MAX) ?
float(-1e4) : fmin;
3537 softmax = (fmax ==
FLT_MAX) ?
float(1e4) : fmax;
3543 float value_range[2];
3545 value_min = double(value_range[0]);
3546 value_max = double(value_range[1]);
3557 if (value_min + 1
e-10 < softmin) {
3558 if (value_min < 0.0) {
3565 softmin = std::max(softmin,
double(but->
hardmin));
3567 if (value_max - 1
e-10 > softmax) {
3568 if (value_max < 0.0) {
3575 if (softmax >
double(but->
hardmax)) {
3585 if (isfinite(value)) {
3602 switch (but->
type) {
3609 search_but->
arg =
nullptr;
3627 MEM_delete(but->
opptr);
3707 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
3737 listener->listener_func(listener_params);
3749 if (block->active) {
3758 if (block->active) {
3767 if (block->active) {
3779 region->
runtime->block_name_map.clear();
3787 if (!block->handle) {
3788 if (block->active) {
3789 block->active =
false;
3792 if (region->
runtime->block_name_map.lookup_default(block->name,
nullptr) == block) {
3793 region->
runtime->block_name_map.remove_as(block->name);
3810 oldblock = region->
runtime->block_name_map.lookup_default(block->
name,
nullptr);
3813 oldblock->
active =
false;
3814 oldblock->
panel =
nullptr;
3815 oldblock->
handle =
nullptr;
3820 region->
runtime->block_name_map.add_overwrite_as(block->
name, block);
3833 uiBlock *block = MEM_new<uiBlock>(__func__);
3848 memcpy(unit, &scene->
unit,
sizeof(scene->
unit));
3855 block->
name = std::move(name);
3870 if (!(region && region->
runtime->visible)) {
3938 but->
drawstr = fmt::format(
"{}{:.{}f}%", but->
str, value, prec);
3942 but->
drawstr = fmt::format(
"{}{:.{}f} px", but->
str, value, prec);
3948 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, precision);
3951 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value * 100, std::max(0, precision - 2));
3961 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
3972 but->
drawstr = but->
str + std::to_string(value);
4002 switch (but->
type) {
4008 if (value <
double(but->
hardmin)) {
4011 else if (value >
double(but->
hardmax)) {
4037 switch (but->
type) {
4080 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
4195 std::unique_ptr<uiBut> but{};
4199 but = std::make_unique<uiButNumber>();
4202 but = std::make_unique<uiButNumberSlider>();
4205 but = std::make_unique<uiButColor>();
4208 but = std::make_unique<uiButDecorator>();
4211 but = std::make_unique<uiButTab>();
4214 but = std::make_unique<uiButSearch>();
4217 but = std::make_unique<uiButProgress>();
4220 but = std::make_unique<uiButSeparatorLine>();
4223 but = std::make_unique<uiButHSVCube>();
4226 but = std::make_unique<uiButColorBand>();
4229 but = std::make_unique<uiButCurveMapping>();
4232 but = std::make_unique<uiButCurveProfile>();
4235 but = std::make_unique<uiButHotkeyEvent>();
4238 but = std::make_unique<uiButViewItem>();
4241 but = std::make_unique<uiButLabel>();
4244 but = std::make_unique<uiButScrollBar>();
4247 but = std::make_unique<uiBut>();
4257 if (but->
type == new_type) {
4265 std::unique_ptr<uiBut> old_but_ptr = std::move(but->
block->
buttons[but_index]);
4268 const bool has_poin_ptr_to_self = but->
poin == (
char *)but;
4273 *but = *old_but_ptr;
4275 but->
type = new_type;
4276 if (has_poin_ptr_to_self) {
4277 but->
poin = (
char *)but;
4310 const std::optional<StringRef> tip)
4316 if (poin ==
nullptr) {
4327 but->
bitnr = type & 31;
4338 but->
poin = (
char *)poin;
4341 but->
tip = tip.value_or(
"");
4367 if (but->
str[but->
str.size() - 1] !=
' ') {
4375 if (!but->
str.empty()) {
4392#ifdef USE_NUMBUTS_LR_ALIGN
4394 if (!but->
str.empty()) {
4402 if (block->
lock ==
true) {
4457 if (!but->
str.empty()) {
4464 but->
icon = ICON_NONE;
4494 bool has_item_with_icon =
false;
4503 const int max_rows = std::max(
int(vertical_space / row_height) - 1, 1);
4505 float text_width = 0.0f;
4508 float col_width = 0.0f;
4512 if (col_rows > 1 && (col_rows > max_rows || (!item->identifier[0] && item->name))) {
4514 text_width += col_width;
4518 if (!item->identifier[0] && item->name) {
4524 has_item_with_icon =
true;
4526 if (item->name && item->name[0]) {
4528 col_width = std::max(col_width, item_width + (100.0f *
UI_SCALE_FAC));
4530 rows = std::max(rows, col_rows);
4532 text_width += col_width;
4535 if (categories == 0) {
4539 columns = std::max((totitems + 20) / 20, 1);
4541 columns = (totitems + 25) / 25;
4545 if ((totitems / columns) > max_rows) {
4546 columns = std::max((totitems + col_rows) / max_rows, 1);
4548 rows = std::max(totitems / columns, 1);
4549 while (rows * columns < totitems) {
4579 const bool use_enum_copy_description =
free &&
4583 if (title && title[0] && (categories == 0) && (!but->
str[0] || !prior_label)) {
4586 block,
UI_BTYPE_LABEL, 0, title, 0, 0,
UI_UNIT_X * 5,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
4599 for (
int a = 0; a < totitems; a++) {
4600 new_column = (a == column_end);
4604 column_end = totitems;
4606 for (
int b = a + 1;
b < totitems;
b++) {
4610 if (((
b - a) % rows == 0) || (columns > 1 && !item->
identifier[0] && item->
name)) {
4616 column = &
split->column(
false);
4621 if (new_column && (categories > 0) && (columns > 1) && item->
identifier[0]) {
4622 column->
label(
"", ICON_NONE);
4627 if (item->
name || columns > 1) {
4631 else if (item->
name) {
4651 int icon = item->
icon;
4652 std::optional<StringRef> description_static;
4653 if (!use_enum_copy_description) {
4659 if (icon == ICON_NONE && has_item_with_icon) {
4677 description_static);
4691 description_static);
4693 if (item->
value == current_value) {
4697 if (use_enum_copy_description) {
4703 return static_cast<const char *
>(argN);
4726 layout->
label(
RPT_(
"Missing Panel"), ICON_NONE);
4749 const char *menu_type =
static_cast<const char *
>(but->
func_argN);
4757 layout->
label(msg, ICON_NONE);
4793 std::optional<StringRef>
str,
4803 std::optional<StringRef> tip)
4834#ifdef WITH_INTERNATIONAL
4839 icon = item[
i].
icon;
4872 float precision = -1.0f;
4874 int hardmin, hardmax, softmin, softmax, int_step;
4887 float hardmin, hardmax, softmin, softmax;
4904 uiBut *but =
ui_def_but(block, type, retval, *
str,
x,
y, width, height,
nullptr,
min,
max, tip);
4975 but->
poin = (
char *)but;
4984 std::optional<StringRef>
str,
4994 const std::optional<StringRef> tip)
5001 block, type, retval,
str,
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5004 but =
ui_def_but(block, type, retval, propname,
x,
y, width, height,
nullptr,
min,
max, tip);
5021 std::optional<StringRef> tip)
5023 if ((!tip || tip->is_empty()) &&
ot &&
ot->srna && !
ot->get_description) {
5027 uiBut *but =
ui_def_but(block, type, -1,
str,
x,
y, width, height,
nullptr, 0, 0, tip);
5053 const std::optional<StringRef> tip)
5055 uiBut *but =
ui_def_but(block, type, retval,
str,
x,
y, width, height, poin,
min,
max, tip);
5065 uiBut *but =
ui_def_but(block,
UI_BTYPE_IMAGE, 0,
"",
x,
y, width, height,
imbuf, 0, 0,
"");
5105 if (
x & 0xFFFF0000) {
5151 char *truncate = autocpl->
truncate;
5152 const char *startname = autocpl->
startname;
5153 int match_index = 0;
5154 for (
int a = 0; a < autocpl->
maxncpy - 1; a++) {
5155 if (startname[a] == 0 || startname[a] != name[a]) {
5162 if (startname[match_index] == 0) {
5165 if (truncate[0] == 0) {
5170 for (
int a = 0; a < std::min<size_t>(name.
size(), autocpl->
maxncpy) - 1; a++) {
5175 if (truncate[a] != name[a]) {
5206#define PREVIEW_TILE_PAD (0.225f * UI_UNIT_X)
5229#undef PREVIEW_TILE_PAD
5252 const std::optional<StringRef> tip)
5282 const std::optional<StringRef> tip)
5308 const std::optional<StringRef> tip)
5335 const std::optional<StringRef> tip)
5362 const std::optional<StringRef> tip)
5389 const std::optional<StringRef> tip)
5416 const std::optional<StringRef> tip)
5443 const std::optional<StringRef> tip)
5462 const std::optional<StringRef>
str,
5472 const std::optional<StringRef> tip)
5475 block, type, retval,
str,
x,
y, width, height,
ptr, propname, index,
min,
max, tip);
5482 const std::optional<StringRef>
str,
5492 const std::optional<StringRef> tip)
5495 block, type, retval,
str,
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5509 const std::optional<StringRef> tip)
5519 std::optional<StringRef>
str,
5524 const std::optional<StringRef> tip)
5527 if (!
str &&
ot ==
nullptr) {
5544 const std::optional<StringRef> tip)
5546 uiBut *but =
ui_def_but(block, type, retval,
"",
x,
y, width, height, poin,
min,
max, tip);
5561 const std::optional<StringRef> tip)
5563 uiBut *but =
ui_def_but(block, type, retval,
"",
x,
y, width, height, poin,
min,
max, tip);
5587 const std::optional<StringRef> tip)
5618 const std::optional<StringRef> tip)
5645 const std::optional<StringRef> tip)
5672 const std::optional<StringRef> tip)
5699 const std::optional<StringRef> tip)
5727 const std::optional<StringRef> tip)
5756 const std::optional<StringRef> tip)
5759 block, type, retval,
"",
x,
y, width, height,
ptr, propname, index,
min,
max, tip);
5776 const std::optional<StringRef> tip)
5779 block, type, retval,
"",
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5793 const std::optional<StringRef> tip)
5808 const std::optional<StringRef> tip)
5826 const std::optional<StringRef> tip)
5828 uiBut *but =
ui_def_but(block, type, retval,
str,
x,
y, width, height, poin,
min,
max, tip);
5845 const std::optional<StringRef> tip)
5873 const std::optional<StringRef> tip)
5894 const std::optional<StringRefNull>
str,
5904 const std::optional<StringRef> tip)
5907 block, type, retval,
str,
x,
y, width, height,
ptr, propname, index,
min,
max, tip);
5916 const std::optional<blender::StringRef>
str,
5926 const std::optional<StringRef> tip)
5929 block, type, retval,
str,
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5944 const std::optional<StringRef> tip)
5961 const std::optional<StringRef> tip)
5964 if (
str.is_empty()) {
5967 return uiDefIconTextButO_ptr(block, type,
ot, opcontext, icon,
str,
x,
y, width, height, tip);
5980 MEM_delete(but->
opptr);
5981 but->
opptr =
nullptr;
5984 but->
opptr = MEM_new<PointerRNA>(__func__, *opptr);
6097 if (!placeholder && but->
rnaprop) {
6133 but->
opptr = MEM_new<PointerRNA>(__func__);
6193 const int ownUnit = int(but->
unit_type);
6199 if ((ownUnit != 0) || (but->
rnaprop ==
nullptr)) {
6200 return ownUnit << 16;
6229 block->
funcN = funcN;
6243 std::function<
void(std::string &new_name)> rename_full_func)
6343 const std::optional<StringRef> tip)
6345 uiBut *but =
ui_def_but(block,
UI_BTYPE_BLOCK, 0,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6359 const std::optional<StringRef> tip,
6364 block,
UI_BTYPE_BLOCK, 0,
str,
x,
y, width, height,
nullptr, 0.0, 0.0, tip);
6384 const std::optional<StringRef> tip)
6387 block,
UI_BTYPE_PULLDOWN, 0,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6402 const std::optional<StringRef> tip)
6405 block,
UI_BTYPE_PULLDOWN, 0,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6426 const std::optional<StringRef> tip)
6429 block,
UI_BTYPE_PULLDOWN, 0,
"",
x,
y, width, height, arg, 0.0, 0.0, tip);
6449 const std::optional<StringRef> tip)
6452 block,
UI_BTYPE_BLOCK, retval,
"",
x,
y, width, height, arg, 0.0, 0.0, tip);
6473 const std::optional<StringRef> tip)
6476 block,
UI_BTYPE_SEARCH_MENU, retval,
"",
x,
y, width, height, arg, 0.0, maxncpy, tip);
6491 const bool free_arg,
6502 if (search_create_fn ==
nullptr) {
6508 search_but->
arg =
nullptr;
6515 search_but->
arg = arg;
6518 if (search_exec_fn) {
6522 printf(
"%s: warning, overwriting button callback with search function callback!\n",
6591 if (prop ==
nullptr) {
6592 printf(
"%s: %s has no enum property set\n", __func__,
ot->idname);
6595 printf(
"%s: %s \"%s\" is not an enum property\n",
6611 search.
add(item->name, item);
6645 printf(
"%s: op->prop for '%s' is nullptr\n", __func__,
ot->idname);
6661 const std::optional<StringRef> tip)
6766 const std::optional<int> draw_width,
6767 const std::optional<int> draw_height)
6771 but_view_item->
draw_width = draw_width.value_or(0);
6772 but_view_item->
draw_height = draw_height.value_or(0);
6783 event.customdata = but;
6784 event.customdata_free =
false;
6825 if (!
ptr || !prop) {
6826 return std::nullopt;
6831 return std::nullopt;
6868 if (!but.
str.empty()) {
6869 size_t str_len = but.
str.size();
6872 if (sep_index != std::string::npos) {
6873 str_len = sep_index;
6876 return but.
str.substr(0, str_len);
6886 if (view_item_but.
view_item ==
nullptr) {
6914 return CTX_TIP_(mt->translation_context, mt->label);
6922 return CTX_TIP_(pt->translation_context, pt->label);
6974 if (mt->rna_ext.srna) {
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
std::optional< blender::StringRefNull > CTX_store_string_lookup(const bContextStore *store, blender::StringRef name)
ReportList * CTX_wm_reports(const bContext *C)
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)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
std::optional< int64_t > CTX_store_int_lookup(const bContextStore *store, blender::StringRef name)
const PointerRNA * CTX_store_ptr_lookup(const bContextStore *store, blender::StringRef name, const StructRNA *type=nullptr)
Scene * CTX_data_scene(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)
wmWindowManager * CTX_wm_manager(const bContext *C)
void IDP_FreeProperty(IDProperty *prop)
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
IDProperty * IDP_NewStringMaxSize(const char *st, size_t st_maxncpy, blender::StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
float BKE_scene_frame_get(const Scene *scene)
void BKE_unit_name_to_alt(char *str, int str_maxncpy, const char *orig_str, int system, int type)
size_t BKE_unit_value_as_string(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad)
double BKE_unit_value_scale(const UnitSettings &settings, int unit_type, double value)
double BKE_unit_closest_scalar(double value, int system, int type)
void BLF_size(int fontid, float size)
int BLF_default_weight(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_batch_draw_begin()
#define BLF_DRAW_STR_DUMMY_MAX
void BLF_batch_draw_end()
blender::ocio::Display ColorManagedDisplay
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
bool BLF_has_variable_weight(int fontid) ATTR_WARN_UNUSED_RESULT
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
void BLI_kdtree_nd_ free(KDTree *tree)
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
#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 void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
MINLINE int integer_digits_f(float f)
MINLINE int round_fl_to_int(float a)
MINLINE short round_db_to_short_clamp(double a)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE int round_db_to_int_clamp(double a)
MINLINE int is_power_of_2_i(int n)
MINLINE unsigned char round_db_to_uchar_clamp(double a)
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v4(float r[4])
MINLINE void zero_v3(float r[3])
MINLINE float normalize_v3(float n[3])
#define BLI_SCOPED_DEFER(function_to_defer)
void BLI_rctf_translate(struct rctf *rect, float x, float y)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
void BLI_rcti_rctf_copy_round(struct rcti *dst, const struct rctf *src)
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src)
void BLI_rcti_translate(struct rcti *rect, int x, int y)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
bool BLI_rcti_clamp(struct rcti *rect, const struct rcti *rect_bounds, int r_xy[2])
void BLI_rctf_init_minmax(struct rctf *rect)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
int bool bool bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t str_len) ATTR_NONNULL(1
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define SNPRINTF(dst, format,...)
char * STRNCPY(char(&dst)[N], const char *src)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define POINTER_FROM_INT(i)
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
#define BLT_I18NCONTEXT_ID_WINDOWMANAGER
#define BLT_I18NCONTEXT_ID_ID
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
#define CTX_TIP_(context, msgid)
bool BPY_run_string_as_number(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, double *r_value) ATTR_NONNULL(1
Object is a sort of wrapper for general info.
#define OB_DATA_SUPPORT_ID(_id_type)
@ RGN_FLAG_SEARCH_FILTER_ACTIVE
@ USER_FACTOR_AS_PERCENTAGE
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
static void split(const char *text, const char *seps, char ***str, int *count)
void GPU_matrix_identity_set()
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
#define GPU_matrix_projection_get(x)
void GPU_blend(eGPUBlend blend)
const ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
const char * IMB_colormanagement_display_get_default_name()
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], const ColorManagedDisplay *display)
void IMB_freeImBuf(ImBuf *ibuf)
Read Guarded memory(de)allocation.
@ RNA_OVERRIDE_STATUS_OVERRIDDEN
short RNA_type_to_ID_code(const StructRNA *type)
#define RNA_SUBTYPE_UNIT_VALUE(subtype)
@ PROP_UNIT_TIME_ABSOLUTE
#define RNA_SUBTYPE_UNIT(subtype)
#define AUTOCOMPLETE_FULL_MATCH
void(*)(bContext *C, void *arg, char *origstr) uiButHandleRenameFunc
MenuType * UI_but_menutype_get(const uiBut *but)
bool UI_but_is_utf8(const uiBut *but)
const uiStyle * UI_style_get_dpi()
#define UI_BUT_POIN_TYPES
#define AUTOCOMPLETE_PARTIAL_MATCH
bool UI_panel_category_is_visible(const ARegion *region)
bool UI_editsource_enable_check()
#define AUTOCOMPLETE_NO_MATCH
void UI_widgetbase_draw_cache_end()
void UI_butstore_update(uiBlock *block)
#define UI_PRECISION_FLOAT_MAX
#define UI_PRECISION_FLOAT_SCALE
void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but)
void *(*)(const void *argN) uiButArgNCopy
void(*)(void *argN) uiButArgNFree
bool UI_butstore_register_update(uiBlock *block, uiBut *but_dst, const uiBut *but_src)
void(*)(bContext *C, void *arg, int event) uiBlockHandleFunc
bool UI_search_item_add(uiSearchItems *items, blender::StringRef name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
void UI_editsource_active_but_test(uiBut *but)
const uiStyle * UI_style_get()
bool UI_panel_should_show_background(const ARegion *region, const PanelType *panel_type)
void UI_fontstyle_set(const uiFontStyle *fs)
@ UI_BLOCK_BOUNDS_PIE_CENTER
@ UI_BLOCK_BOUNDS_POPUP_MOUSE
@ UI_BLOCK_BOUNDS_POPUP_CENTER
@ UI_BLOCK_BOUNDS_POPUP_MENU
int(*)(bContext *C, char *str, void *arg) uiButCompleteFunc
bool UI_view_item_matches(const blender::ui::AbstractViewItem &a, const blender::ui::AbstractViewItem &b)
bool(*)(bContext *C, void *arg, void *active, const wmEvent *event) uiButSearchContextMenuFn
bool UI_butstore_is_registered(uiBlock *block, uiBut *but)
PanelType * UI_but_paneltype_get(const uiBut *but)
@ UI_BUT_HAS_QUICK_TOOLTIP
@ UI_BUT_NO_PREVIEW_PADDING
void UI_butstore_clear(uiBlock *block)
void(*)(bContext *C, ARegion *butregion, uiBut *but) uiButHandleHoldFunc
#define UI_FLOAT_VALUE_DISPLAY_MAX
void(*)(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first) uiButSearchUpdateFn
void(*)(bContext *C, void *argN, void *arg2) uiButHandleNFunc
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) uiButSearchTooltipFn
void UI_but_tooltip_refresh(bContext *C, uiBut *but)
void(*)(bContext *C, void *arg1, void *arg2) uiButHandleFunc
ARegion *(*)(bContext *C, ARegion *butregion, uiButSearch *search_but) uiButSearchCreateFn
uiBlock *(*)(bContext *C, ARegion *region, void *arg1) uiBlockCreateFunc
@ UI_BUT_ACTIVATE_ON_INIT
int UI_calc_float_precision(int prec, double value)
@ UI_BLOCK_MOVEMOUSE_QUIT
@ UI_BLOCK_NO_ACCELERATOR_KEYS
@ UI_BLOCK_SHOW_SHORTCUT_ALWAYS
bool UI_but_is_tool(const uiBut *but)
void UI_widgetbase_draw_cache_begin()
#define UI_FLOAT_VALUE_DISPLAY_MIN
void(*)(bContext &C, uiTooltipData &data, void *argN) uiButToolTipCustomFunc
void(*)(const wmRegionListenerParams *params, void *arg) uiButSearchListenFn
wmOperatorType * UI_but_operatortype_get_from_enum_menu(uiBut *but, PropertyRNA **r_prop)
#define UI_but_is_decorator(but)
void UI_icon_text_overlay_init_from_count(IconTextOverlay *text_overlay, const int icon_indicator_number)
ImBuf * UI_icon_alert_imbuf_get(eAlertIcon icon, float size)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
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
bool(*)(bContext *C, int direction, void *arg1) uiMenuStepFunc
float UI_view2d_scale_get_x(const View2D *v2d)
@ WM_OP_INVOKE_REGION_WIN
int pad[32 - sizeof(int)]
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
BPy_StructRNA * depsgraph
void activate(bool forceActivation=false) const
void append(const T &value)
const T & last(const int64_t n=0) const
IndexRange index_range() const
void reserve(const int64_t min_capacity)
constexpr bool contains(int64_t value) const
void reserve(const int64_t n)
bool contains(const Key &key) const
constexpr bool is_empty() const
constexpr bool startswith(StringRef prefix) 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
constexpr StringRef drop_known_prefix(StringRef prefix) const
void append(const T &value)
void add(const StringRef str, T *user_data, const int weight=0)
Vector< T * > query(const StringRef query) const
AbstractView & get_view() const
std::string get_context_menu_title() const
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
#define ID_CHECK_UNDO(id)
void ui_but_v4_get(uiBut *but, float vec[4])
void UI_block_update_from_old(const bContext *C, uiBlock *block)
const ColorManagedDisplay * ui_block_cm_display_get(uiBlock *block)
uiBut * uiDefButBitS(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const std::optional< StringRef > tip)
void UI_but_flag_disable(uiBut *but, int flag)
void UI_but_disable(uiBut *but, const char *disabled_hint)
uiBut * ui_but_drag_multi_edit_get(uiBut *but)
void ui_but_v4_set(uiBut *but, const float vec[4])
static void ui_but_predefined_extra_operator_icons_add(uiBut *but)
void UI_blocklist_update_window_matrix(const bContext *C, const ListBase *lb)
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, const std::optional< StringRef > tip)
bool ui_but_is_unit(const uiBut *but)
static PredefinedExtraOpIconType ui_but_icon_extra_get(uiBut *but)
void ui_but_range_set_hard(uiBut *but)
void ui_but_extra_operator_icons_free(uiBut *but)
static float ui_but_get_float_precision(uiBut *but)
PointerRNA * UI_but_extra_operator_icon_add(uiBut *but, const StringRefNull opname, wmOperatorCallContext opcontext, int icon)
uiBut * uiDefIconButO(uiBlock *block, int type, const StringRefNull opname, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, const std::optional< StringRef > tip)
uiBut * uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
uiBut * ui_but_find_new(uiBlock *block_new, const uiBut *but_old)
uiBut * uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, const std::optional< StringRef > tip)
static void ui_but_free_type_specific(uiBut *but)
bool UI_but_active_only_ex(const bContext *C, ARegion *region, uiBlock *block, uiBut *but, const bool remove_on_failure)
bool ui_but_is_compatible(const uiBut *but_a, const uiBut *but_b)
void UI_block_emboss_set(uiBlock *block, blender::ui::EmbossType emboss)
static double soft_range_round_down(double value, double max)
void ui_window_to_block(const ARegion *region, const uiBlock *block, int *x, int *y)
const short ui_radial_dir_to_angle[8]
void UI_block_theme_style_set(uiBlock *block, char theme_style)
void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but)
static bool ui_number_from_string_units_with_but(bContext *C, const char *str, const uiBut *but, double *r_value)
int UI_preview_tile_size_y_no_label(const int size_px)
void UI_but_func_drawextra_set(uiBlock *block, std::function< void(const bContext *C, rcti *rect)> func)
void UI_but_func_tooltip_custom_set(uiBut *but, uiButToolTipCustomFunc func, void *arg, uiFreeArgFunc free_arg)
std::string UI_but_string_get_property_keymap(bContext &C, uiBut &but)
static void ui_but_update_old_active_from_new(uiBut *oldbut, uiBut *but)
static void ui_block_bounds_calc_popup(wmWindow *window, uiBlock *block, eBlockBoundsCalc bounds_calc, const int xy[2], int r_xy[2])
static bool ui_but_is_unit_radians(const uiBut *but)
void ui_but_string_get_ex(uiBut *but, char *str, const size_t str_maxncpy, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
void UI_but_icon_indicator_number_set(uiBut *but, const int indicator_number)
void ui_but_range_set_soft(uiBut *but)
void ui_but_update(uiBut *but)
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, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
void UI_blocklist_free(const bContext *C, ARegion *region)
uiBut * uiDefBut(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
uiBut * uiDefIconButS(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const std::optional< StringRef > tip)
uiBut * uiDefButAlert(uiBlock *block, int icon, int x, int y, short width, short)
static std::optional< std::string > ui_but_event_operator_string_from_panel(const bContext *C, uiBut *but)
void UI_but_color_set(uiBut *but, const uchar color[4])
uiBut * uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const std::optional< StringRef > tip)
std::string UI_but_string_get_rna_label_context(const uiBut &but)
static uiBut * uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
void UI_block_lock_clear(uiBlock *block)
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
static bool ui_but_is_row_alignment_group(const uiBut *left, const uiBut *right)
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
void UI_interface_tag_script_reload()
static uiBut * ui_but_find_old(uiBlock *block_old, const uiBut *but_new, const blender::Set< const uiBut * > &ignore_old_buttons)
static std::optional< int64_t > ui_but_find_old_idx(uiBlock *block_old, const uiBut *but_new, const blender::Set< const uiBut * > &ignore_old_buttons={})
int UI_but_unit_type_get(const uiBut *but)
uiBut * uiDefButR(uiBlock *block, int type, int retval, const std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, const StringRefNull propname, int index, float min, float max, const std::optional< StringRef > tip)
static uiBut * ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, const StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, const bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
void ui_def_but_icon_clear(uiBut *but)
void UI_but_menu_disable_hover_open(uiBut *but)
void UI_block_bounds_set_normal(uiBlock *block, int addval)
static bool ui_number_from_string_percentage(bContext *C, const char *str, double *r_value)
uiBut * uiDefIconTextButR_prop(uiBlock *block, int type, int retval, int icon, const std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const std::optional< StringRef > tip)
int ui_but_is_pushed(uiBut *but)
bool ui_but_is_float(const uiBut *but)
bool ui_but_context_poll_operator_ex(bContext *C, const uiBut *but, const wmOperatorCallParams *optype_params)
uiBut * uiDefIconTextButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
void ui_block_add_dynamic_listener(uiBlock *block, void(*listener_func)(const wmRegionListenerParams *params))
uiBut * uiDefIconPreviewBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
static int ui_but_calc_float_precision(uiBut *but, double value)
void UI_but_view_item_draw_size_set(uiBut *but, const std::optional< int > draw_width, const std::optional< int > draw_height)
void UI_blocklist_update_view_for_buttons(const bContext *C, const ListBase *lb)
void UI_but_label_alpha_factor_set(uiBut *but, const float alpha_factor)
PropertyScaleType ui_but_scale_type(const uiBut *but)
void ui_block_to_region_rctf(const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
uiBut * uiDefButO(uiBlock *block, int type, const StringRefNull opname, wmOperatorCallContext opcontext, std::optional< StringRef > str, int x, int y, short width, short height, const std::optional< StringRef > tip)
void UI_but_func_menu_step_set(uiBut *but, uiMenuStepFunc func)
const char * ui_but_placeholder_get(uiBut *but)
static void ui_but_extra_operator_icon_free(uiButExtraOpIcon *extra_icon)
static int findBitIndex(uint x)
static void ui_update_window_matrix(const wmWindow *window, const ARegion *region, uiBlock *block)
void ui_block_bounds_calc(uiBlock *block)
void UI_block_listen(const uiBlock *block, const wmRegionListenerParams *listener_params)
void UI_block_translate(uiBlock *block, float x, float y)
static void ui_but_update_and_icon_set(uiBut *but, int icon)
void UI_block_flag_disable(uiBlock *block, int flag)
uiBut * uiDefButI(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const std::optional< StringRef > tip)
std::optional< EnumPropertyItem > UI_but_rna_enum_item_get(bContext &C, uiBut &but)
void ui_but_override_flag(Main *bmain, uiBut *but)
static void ui_block_message_subscribe(ARegion *region, wmMsgBus *mbus, uiBlock *block)
std::string UI_but_context_menu_title_from_button(uiBut &but)
void UI_but_drawflag_enable(uiBut *but, int flag)
void UI_but_context_ptr_set(uiBlock *block, uiBut *but, const StringRef name, const PointerRNA *ptr)
static void ui_but_validate(const uiBut *but)
static void ui_block_bounds_calc_centered(wmWindow *window, uiBlock *block)
int UI_but_return_value_get(uiBut *but)
void UI_but_func_search_set_tooltip(uiBut *but, uiButSearchTooltipFn tooltip_fn)
static void ui_block_free_active_operator(uiBlock *block)
PointerRNA * UI_but_extra_operator_icon_opptr_get(const uiButExtraOpIcon *extra_icon)
uiBut * uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
void UI_but_flag2_enable(uiBut *but, int flag)
void UI_but_context_int_set(uiBlock *block, uiBut *but, const StringRef name, const int64_t value)
double ui_but_value_get(uiBut *but)
uiBut * uiDefButBitI(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const std::optional< StringRef > tip)
rcti ui_to_pixelrect(const ARegion *region, const uiBlock *block, const rctf *src_rect)
float ui_block_to_window_scale(const ARegion *region, const uiBlock *block)
void UI_but_number_step_size_set(uiBut *but, float step_size)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
uiBut * uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const std::optional< StringRef > tip)
void ui_def_but_icon(uiBut *but, const int icon, const int flag)
std::string UI_but_string_get_operator_keymap(bContext &C, uiBut &but)
std::string UI_but_string_get_rna_tooltip(bContext &C, uiBut &but)
void ui_window_to_region_rcti(const ARegion *region, rcti *rect_dst, const rcti *rct_src)
uiBut * uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x, int y, short width, short height, const std::optional< StringRef > tip)
uiBut * uiDefSearchButO_ptr(uiBlock *block, wmOperatorType *ot, IDProperty *properties, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, const std::optional< StringRef > tip)
bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block)
std::string UI_but_string_get_label(uiBut &but)
std::string UI_but_string_get_rna_label(uiBut &but)
int ui_but_is_pushed_ex(uiBut *but, double *value)
uiBlock * UI_block_begin(const bContext *C, Scene *scene, wmWindow *window, ARegion *region, std::string name, blender::ui::EmbossType emboss)
static std::optional< std::string > ui_but_event_operator_string_from_operator(const bContext *C, wmOperatorCallParams *op_call_params)
static void ui_but_extra_icons_update_from_old_but(const uiBut *new_but, const uiBut *old_but)
void ui_but_string_get(uiBut *but, char *str, const size_t str_maxncpy)
void UI_but_execute(const bContext *C, ARegion *region, uiBut *but)
const char ui_radial_dir_to_numpad[8]
void ui_region_to_window(const ARegion *region, int *x, int *y)
static void ui_menu_block_set_keyaccels(uiBlock *block)
void UI_update_text_styles()
void UI_region_message_subscribe(ARegion *region, wmMsgBus *mbus)
void ui_window_to_region(const ARegion *region, int *x, int *y)
void ui_window_to_block_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
static bool ui_but_pixelrect_in_view(const ARegion *region, const rcti *rect)
int UI_preview_tile_size_x(const int size_px)
static void operator_enum_search_update_fn(const bContext *C, void *but, const char *str, uiSearchItems *items, const bool)
void UI_but_number_slider_precision_set(uiBut *but, float precision)
int UI_autocomplete_end(AutoComplete *autocpl, char *autoname)
static std::optional< std::string > ui_but_event_property_operator_string(const bContext *C, uiBut *but)
bool ui_but_rna_equals(const uiBut *a, const uiBut *b)
void ui_block_cm_to_display_space_v3(uiBlock *block, float pixel[3])
#define UI_BUT_VALUE_UNSET
bool ui_but_is_rna_valid(uiBut *but)
void UI_but_dragflag_enable(uiBut *but, int flag)
uiBut * uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
static void ui_block_bounds_calc_text(uiBlock *block, float offset)
bool UI_block_is_search_only(const uiBlock *block)
uiBut * uiDefButF(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, float *poin, float min, float max, const std::optional< StringRef > tip)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
static uiBut * ui_def_but_rna_propname(uiBlock *block, int type, int retval, std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, const StringRefNull propname, int index, float min, float max, const std::optional< StringRef > tip)
bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
static bool ui_but_icon_extra_is_visible_bone_eyedropper(uiBut *but)
bool ui_but_menu_draw_as_popover(const uiBut *but)
void ui_but_value_set(uiBut *but, double value)
static void ui_but_update_ex(uiBut *but, const bool validate)
bool ui_but_rna_equals_ex(const uiBut *but, const PointerRNA *ptr, const PropertyRNA *prop, int index)
PointerRNA * UI_but_operator_ptr_ensure(uiBut *but)
static uiButExtraOpIcon * ui_but_extra_icon_find_old(const uiButExtraOpIcon *new_extra_icon, const uiBut *old_but)
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2)
#define UI_GET_BUT_VALUE_INIT(_but, _value)
void UI_but_func_search_set_context_menu(uiBut *but, uiButSearchContextMenuFn context_menu_fn)
static float ui_but_get_float_step_size(uiBut *but)
static bool ui_but_hide_fraction(uiBut *but, double value)
static bool ui_number_from_string_units(bContext *C, const char *str, const int unit_type, const UnitSettings *unit, double *r_value)
void UI_but_number_slider_step_size_set(uiBut *but, float step_size)
static std::unique_ptr< uiBut > ui_but_new(const eButType type)
void UI_block_bounds_set_menu(uiBlock *block, int addval, const int bounds_offset[2])
void UI_but_func_rename_set(uiBut *but, uiButHandleRenameFunc func, void *arg1)
std::string UI_but_string_get_rna_property_identifier(const uiBut &but)
void UI_but_unit_type_set(uiBut *but, const int unit_type)
uiBut * uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, const std::optional< StringRef > tip)
void UI_but_drawflag_disable(uiBut *but, int flag)
void ui_block_to_region_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
void UI_block_draw(const bContext *C, uiBlock *block)
static void ui_def_but_rna__menu_type(bContext *, uiLayout *layout, void *but_p)
void UI_but_dragflag_disable(uiBut *but, int flag)
static uiBut * ui_def_but(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
std::string UI_but_extra_icon_string_get_tooltip(bContext &C, const uiButExtraOpIcon &extra_icon)
static bool ui_but_icon_extra_is_visible_text_clear(const uiBut *but)
void UI_block_bounds_set_text(uiBlock *block, int addval)
static bool ui_but_is_rna_undo(const uiBut *but)
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
static bool ui_number_from_string(bContext *C, const char *str, double *r_value)
void UI_block_align_begin(uiBlock *block)
void ui_but_to_pixelrect(rcti *rect, const ARegion *region, const uiBlock *block, const uiBut *but)
static PointerRNA * ui_but_extra_operator_icon_add_ptr(uiBut *but, wmOperatorType *optype, wmOperatorCallContext opcontext, int icon)
void ui_but_rna_menu_convert_to_panel_type(uiBut *but, const char *panel_type)
uiBut * uiDefButR_prop(uiBlock *block, int type, int retval, const std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const std::optional< StringRef > tip)
PredefinedExtraOpIconType
@ PREDEFINED_EXTRA_OP_ICON_CLEAR
@ PREDEFINED_EXTRA_OP_ICON_EYEDROPPER
@ PREDEFINED_EXTRA_OP_ICON_BONE_EYEDROPPER
@ PREDEFINED_EXTRA_OP_ICON_NONE
char * ui_but_string_get_dynamic(uiBut *but, int *r_str_size)
void UI_blocklist_free_inactive(const bContext *C, ARegion *region)
uiBut * uiDefButBitC(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, char *poin, float min, float max, const std::optional< StringRef > tip)
void ui_window_to_region_rctf(const ARegion *region, rctf *rect_dst, const rctf *rct_src)
void ui_window_to_block_rctf(const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
void ui_block_to_window_rctf(const ARegion *region, const uiBlock *block, rctf *rct_dst, const rctf *rct_src)
void ui_but_update_edited(uiBut *but)
static void ui_but_build_drawstr_float(uiBut *but, double value)
static void ui_def_but_rna__menu(bContext *C, uiLayout *layout, void *but_p)
uiBut * uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const std::optional< StringRef > tip)
void ui_but_v3_set(uiBut *but, const float vec[3])
static bool ui_but_update_from_old_block(uiBlock *block, blender::Set< const uiBut * > &matched_old_buttons, std::unique_ptr< uiBut > *but_uptr, std::optional< int64_t > *but_old_idx)
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
void UI_but_icon_indicator_set(uiBut *but, const char *string)
void ui_but_v3_get(uiBut *but, float vec[3])
static double ui_get_but_scale_unit(uiBut *but, double value)
void UI_block_end_ex(const bContext *C, Main *bmain, wmWindow *window, Scene *scene, ARegion *region, Depsgraph *depsgraph, uiBlock *block, const int xy[2], int r_xy[2])
void UI_but_func_search_set_results_are_suggestions(uiBut *but, const bool value)
#define UI_NUMBER_EVAL_ERROR_PREFIX
void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string)
void UI_but_hint_drawstr_set(uiBut *but, const char *string)
uiBut * ui_but_change_type(uiBut *but, eButType new_type)
static uiBut * ui_def_but_rna(uiBlock *block, int type, int retval, std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< StringRef > tip)
wmOperatorType * UI_but_extra_operator_icon_optype_get(const uiButExtraOpIcon *extra_icon)
void UI_but_operator_set_never_call(uiBut *but)
static void ui_but_build_drawstr_int(uiBut *but, int value)
blender::ui::EmbossType UI_block_emboss_get(uiBlock *block)
int ui_but_string_get_maxncpy(uiBut *but)
void UI_blocklist_draw(const bContext *C, const ListBase *lb)
int UI_blocklist_min_y_get(ListBase *lb)
uiBut * uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const std::optional< StringRef > tip)
static void ui_def_but_rna__panel_type(bContext *, uiLayout *layout, void *arg)
uiBut * uiDefButImage(uiBlock *block, void *imbuf, int x, int y, short width, short height, const uchar color[4])
void UI_but_number_precision_set(uiBut *but, float precision)
void UI_block_bounds_set_centered(uiBlock *block, int addval)
uiBut * uiDefIconButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, const std::optional< StringRef > tip)
bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but)
bool ui_but_string_eval_number(bContext *C, const uiBut *but, const char *str, double *r_value)
void ui_fontscale(float *points, float aspect)
void UI_but_func_pushed_state_set(uiBut *but, std::function< bool(const uiBut &)> func)
static void ui_get_but_string_unit(uiBut *but, char *str, int str_maxncpy, double value, bool pad, int float_precision)
void ui_block_to_window(const ARegion *region, const uiBlock *block, int *x, int *y)
void ui_block_to_window_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
static bool ui_but_icon_extra_is_visible_search_eyedropper(uiBut *but)
uiBut * uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const std::optional< StringRef > tip)
std::string UI_but_extra_icon_string_get_label(const uiButExtraOpIcon &extra_icon)
void UI_block_free(const bContext *C, uiBlock *block)
static std::optional< std::string > ui_but_event_operator_string(const bContext *C, uiBut *but)
static uiBut * uiDefButBit(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
void UI_but_placeholder_set(uiBut *but, const StringRef placeholder_text)
void ui_but_convert_to_unit_alt_name(uiBut *but, char *str, size_t str_maxncpy)
void UI_block_region_set(uiBlock *block, ARegion *region)
uiBut * uiDefIconTextButO(uiBlock *block, int type, const StringRefNull opname, wmOperatorCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
void UI_block_direction_set(uiBlock *block, char direction)
static void ui_update_flexible_spacing(const ARegion *region, uiBlock *block)
void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN)
int UI_preview_tile_size_y(const int size_px)
static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
static void ui_block_bounds_calc_centered_pie(uiBlock *block)
void UI_but_operator_set(uiBut *but, wmOperatorType *optype, wmOperatorCallContext opcontext, const PointerRNA *opptr)
void UI_block_set_active_operator(uiBlock *block, wmOperator *op, const bool free)
void UI_but_icon_indicator_color_set(uiBut *but, const uchar color[4])
void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg)
uiBut * uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const std::optional< StringRefNull > str, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, float min, float max, const std::optional< StringRef > tip)
uiBut * uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
std::optional< int64_t > UI_but_context_int_get(const uiBut *but, const StringRef name)
void UI_autocomplete_update_name(AutoComplete *autocpl, const StringRef name)
void UI_but_func_search_set_listen(uiBut *but, uiButSearchListenFn listen_fn)
static void operator_enum_search_exec_fn(bContext *, void *but, void *arg2)
void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_strip)
std::string UI_but_string_get_tooltip_label(const uiBut &but)
std::string UI_but_string_get_tooltip(bContext &C, uiBut &but)
static bool ui_number_from_string_factor(bContext *C, const char *str, double *r_value)
void UI_block_flag_enable(uiBlock *block, int flag)
std::string UI_but_string_get_rna_struct_identifier(const uiBut &but)
const bContextStore * UI_but_context_get(const uiBut *but)
void ui_but_rna_menu_convert_to_menu_type(uiBut *but, const char *menu_type)
static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut)
const PointerRNA * UI_but_context_ptr_get(const uiBut *but, const StringRef name, const StructRNA *type)
static void ui_block_bounds_calc_post_centered(uiBlock *block)
static void ui_but_update_select_flag(uiBut *but, double *value)
static bool ui_but_icon_extra_is_visible_search_unlink(const uiBut *but)
const char ui_radial_dir_order[8]
static bool ui_but_is_unit_radians_ex(const UnitSettings *unit, const int unit_type)
static std::optional< std::string > ui_but_event_operator_string_from_menu(const bContext *C, uiBut *but)
std::string UI_but_extra_icon_string_get_operator_keymap(const bContext &C, const uiButExtraOpIcon &extra_icon)
uiBut * uiDefButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
static void ui_but_free(const bContext *C, uiBut *but)
std::optional< blender::StringRefNull > UI_but_context_string_get(const uiBut *but, const StringRef name)
static std::optional< std::string > ui_but_extra_icon_event_operator_string(const bContext *C, const uiButExtraOpIcon *extra_icon)
uiBut * uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const std::optional< StringRef > tip)
static void ui_but_submenu_enable(uiBlock *block, uiBut *but)
void UI_block_end(const bContext *C, uiBlock *block)
uiBut * uiDefButC(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, char *poin, float min, float max, const std::optional< StringRef > tip)
void UI_but_search_preview_grid_size_set(uiBut *but, int rows, int cols)
void UI_block_set_search_only(uiBlock *block, bool search_only)
void UI_but_node_link_set(uiBut *but, bNodeSocket *socket, const float draw_color[4])
void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr)
AutoComplete * UI_autocomplete_begin(const char *startname, size_t maxncpy)
void UI_but_func_quick_tooltip_set(uiBut *but, std::function< std::string(const uiBut *but)> func)
static float ui_get_but_step_unit(uiBut *but, float step_default)
void UI_but_flag_enable(uiBut *but, int flag)
void ui_region_winrct_get_no_margin(const ARegion *region, rcti *r_rect)
bool ui_but_context_poll_operator(bContext *C, wmOperatorType *ot, const uiBut *but)
static bool ui_but_extra_icons_equals_old(const uiButExtraOpIcon *new_extra_icon, const uiButExtraOpIcon *old_extra_icon)
bool ui_but_supports_cycling(const uiBut *but)
static double soft_range_round_up(double value, double max)
uiBut * uiDefIconButR(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, const StringRefNull propname, int index, float min, float max, const std::optional< StringRef > tip)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
uiBut * uiDefButS(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const std::optional< StringRef > tip)
bool UI_but_flag_is_set(uiBut *but, int flag)
bool ui_but_is_bool(const uiBut *but)
static std::string ui_but_pie_direction_string(const uiBut *but)
void UI_block_bounds_set_explicit(uiBlock *block, int minx, int miny, int maxx, int maxy)
void UI_block_align_end(uiBlock *block)
bool ui_but_can_align(const uiBut *but)
void ui_block_align_calc(uiBlock *block, const ARegion *region)
bool ui_but_anim_expression_create(uiBut *but, const char *str)
void ui_but_anim_decorate_update_from_flag(uiButDecorator *but)
void ui_but_anim_flag(uiBut *but, const AnimationEvalContext *anim_eval_context)
bool ui_but_anim_expression_get(uiBut *but, char *str, size_t str_maxncpy)
bool ui_but_anim_expression_set(uiBut *but, const char *str)
void ui_but_drag_free(uiBut *but)
bool ui_but_is_editing(const uiBut *but)
void ui_but_execute_end(bContext *C, ARegion *, uiBut *but, void *active_back)
void ui_but_active_free(const bContext *C, uiBut *but)
void ui_but_handle_data_free(uiHandleButtonData **data)
void ui_but_execute_begin(bContext *, ARegion *region, uiBut *but, void **active_back)
void ui_but_clipboard_free()
void ui_but_activate_event(bContext *C, ARegion *region, uiBut *but)
void ui_but_update_view_for_active(const bContext *C, const uiBlock *block)
void ui_but_semi_modal_state_free(const bContext *C, uiBut *but)
void ui_icon_ensure_deferred(const bContext *C, const int icon_id, const bool big)
#define UI_POPUP_MENU_TOP
void ui_view_item_swap_button_pointers(blender::ui::AbstractViewItem &a, blender::ui::AbstractViewItem &b)
#define UI_BITBUT_TEST(a, b)
void ui_block_views_end(ARegion *region, const uiBlock *block)
bool ui_but_menu_step_poll(const uiBut *but)
void ui_block_views_draw_overlays(const ARegion *region, const uiBlock *block)
bool ui_block_is_popover(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
void ui_but_search_refresh(uiButSearch *but)
void ui_draw_layout_panels_backdrop(const ARegion *region, const Panel *panel, const float radius, float subpanel_backcolor[4])
bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but)
void ui_interface_tag_script_reload_queries()
ARegion * ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiButSearch *search_but)
void ui_draw_menu_back(uiStyle *style, uiBlock *block, const rcti *rect)
void ui_block_free_views(uiBlock *block)
void ui_item_paneltype_func(bContext *C, uiLayout *layout, void *arg_pt)
void ui_draw_aligned_panel(const ARegion *region, const uiStyle *style, const uiBlock *block, const rcti *rect, bool show_pin, bool show_background, bool region_search_filter_active)
void ui_draw_but(const bContext *C, ARegion *region, uiStyle *style, uiBut *but, rcti *rect)
void ui_block_views_listen(const uiBlock *block, const wmRegionListenerParams *listener_params)
bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT
void ui_draw_popover_back(ARegion *region, uiStyle *style, uiBlock *block, const rcti *rect)
@ UI_BLOCK_CONTAINS_SUBMENU_BUT
uiBut * ui_region_find_active_but(ARegion *region) ATTR_WARN_UNUSED_RESULT
void ui_layout_remove_but(uiLayout *layout, const uiBut *but)
void ui_layout_add_but(uiLayout *layout, uiBut *but)
void ui_draw_pie_center(uiBlock *block)
void * MEM_mallocN(size_t len, const char *str)
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)
MINLINE void zero_v2_int(int r[2])
static void error(const char *str)
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRef prop_name, int32_t value, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_INT, set its name and value.
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
VecBase< int32_t, 2 > int2
const EnumPropertyItem rna_enum_id_type_items[]
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value)
void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
const char * RNA_property_ui_description(const PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
PropertyScaleType RNA_property_ui_scale(PropertyRNA *prop)
bool RNA_struct_is_ID(const StructRNA *type)
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
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)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
char * RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
PropertyType RNA_property_type(PropertyRNA *prop)
const PointerRNA PointerRNA_NULL
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_array_at_most(PointerRNA *ptr, PropertyRNA *prop, float *values, int values_num)
bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2])
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_translation_context(const PropertyRNA *prop)
void RNA_property_float_set_array_at_most(PointerRNA *ptr, PropertyRNA *prop, const float *values, int values_num)
void * RNA_property_py_data_get(PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
const char * RNA_struct_ui_description(const StructRNA *type)
bool RNA_property_enum_item_from_value_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
const char * RNA_struct_ui_name(const StructRNA *type)
bool RNA_struct_undo_check(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)
bool RNA_property_is_idprop(const PropertyRNA *prop)
int RNA_property_string_maxlength(PropertyRNA *prop)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_name)
bool RNA_property_editable_info(const PointerRNA *ptr, PropertyRNA *prop, const char **r_info)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
bool RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr)
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_struct_translation_context(const StructRNA *type)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
eRNAOverrideStatus RNA_property_override_library_status(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const int index)
ARegionRuntimeHandle * runtime
const char * report_prefix
char idname[BKE_ST_MAXNAME]
struct Panel_Runtime * runtime
ColorManagedDisplaySettings display_settings
uiWidgetColors wcol_menu_back
void(* listener_func)(const wmRegionListenerParams *params)
blender::Vector< std::unique_ptr< uiBut > > buttons
ListBase dynamic_listeners
void remove_but(const uiBut *but)
ColorPickerData color_pickers
uiPopupBlockHandle * handle
uiButArgNFree func_argN_free_fn
uiButArgNCopy func_argN_copy_fn
uiBlockHandleFunc handle_func
uiBut * first_but() const
blender::Vector< std::unique_ptr< bContextStore > > contexts
int but_index(const uiBut *but) const
blender::ui::EmbossType emboss
std::function< void(const bContext *, rcti *)> drawextra
eBlockBoundsCalc bounds_type
const UnitSettings * unit
uiBut * next_but(const uiBut *but) const
uiBut * prev_but(const uiBut *but) const
wmEventModifierFlag modifier_key
uiButSearchUpdateFn items_update_fn
bool results_are_suggestions
PropertyRNA * rnasearchprop
uiButSearchListenFn listen_fn
const char * item_sep_string
uiButSearchCreateFn popup_create_fn
uiFreeArgFunc arg_free_fn
uiButSearchTooltipFn item_tooltip_fn
uiButSearchContextMenuFn item_context_menu_fn
blender::ui::AbstractViewItem * view_item
wmOperatorCallContext opcontext
uiButCompleteFunc autocomplete_func
uiButIdentityCompareFunc identity_cmp_func
std::function< void(bContext &)> apply_func
IconTextOverlay icon_overlay_text
blender::ui::EmbossType emboss
std::function< std::string(const uiBut *)> tip_quick_func
uiHandleButtonData * active
const char * disabled_info
uiMenuCreateFunc menu_create_func
std::function< void(std::string &new_name)> rename_full_func
std::string rename_full_new
const bContextStore * context
uiButToolTipFunc tip_func
uiButArgNFree func_argN_free_fn
std::function< bool(const uiBut &)> pushed_state_func
uiButHandleHoldFunc hold_func
uiButHandleRenameFunc rename_func
uiBlockCreateFunc block_create_func
uiButArgNCopy func_argN_copy_fn
uiFreeArgFunc tip_arg_free
eWM_DragDataType dragtype
uiMenuStepFunc menu_step_func
uiHandleButtonData * semi_modal_state
uiButToolTipCustomFunc tip_custom_func
void label(blender::StringRef name, int icon)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
uiLayout & split(float percentage, bool align)
uiPopupBlockCreate popup_create_vars
wmOperatorCallContext opcontext
struct wmEvent * eventstate
bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context)
wmEvent * WM_event_add(wmWindow *win, const wmEvent *event_to_add)
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
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)
const char * WM_key_event_string(const short type, const bool compact)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
std::string WM_operatortype_description(bContext *C, wmOperatorType *ot, PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
std::optional< std::string > WM_context_path_resolve_property_full(const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
void wmGetProjectionMatrix(float mat[4][4], const rcti *winrct)
void wmOrtho2_region_pixelspace(const ARegion *region)
blender::int2 WM_window_native_pixel_size(const wmWindow *win)
int WM_window_native_pixel_y(const wmWindow *win)
int WM_window_native_pixel_x(const wmWindow *win)