17#include <fmt/format.h>
90#define UI_BUT_VALUE_UNSET DBL_MAX
91#define UI_GET_BUT_VALUE_INIT(_but, _value) \
92 if (_value == DBL_MAX) { \
93 (_value) = ui_but_value_get(_but); \
137 (0.5f + 0.5f * (gx * block->
winmat[0][0] + gy * block->
winmat[1][0] + block->
winmat[3][0]));
139 (0.5f + 0.5f * (gx * block->
winmat[0][1] + gy * block->
winmat[1][1] + block->
winmat[3][1]));
156 *
x = int(lround(fx));
157 *
y = int(lround(fy));
183 float min_y = 0, max_y = 1;
184 float dummy_x = 0.0f;
188 return max_y - min_y;
198 const float a = 0.5f *
float(getsizex) * block->
winmat[0][0];
199 const float b = 0.5f *
float(getsizex) * block->
winmat[1][0];
200 const float c = 0.5f *
float(getsizex) * (1.0f + block->
winmat[3][0]);
202 const float d = 0.5f *
float(getsizey) * block->
winmat[0][1];
203 const float e = 0.5f *
float(getsizey) * block->
winmat[1][1];
204 const float f = 0.5f *
float(getsizey) * (1.0f + block->
winmat[3][1]);
206 const float px = *
x - sx;
207 const float py = *
y - sy;
209 *
y = (a * (py - f) + d * (c - px)) / (a *
e - d *
b);
210 *
x = (px -
b * (*y) - c) / a;
235 *
x = int(lround(fx));
236 *
y = int(lround(fy));
268 const ARegion *region,
int region_x,
int region_y,
int *r_window_x,
int *r_window_y)
277 auto index = std::distance(
279 std::find_if(
buttons.begin(),
buttons.end(), [but](
const std::unique_ptr<uiBut> &test) {
280 return test.get() == but;
288 const int idx = this->
but_index(but) + 1;
289 return idx < this->
buttons.size() ? this->
buttons[idx].get() :
nullptr;
294 const int idx = this->
but_index(but) - 1;
295 return idx >= 0 ? this->
buttons[idx].get() :
nullptr;
301 this->
buttons.remove(target_index);
306 return !this->
buttons.is_empty() ? this->
buttons.first().get() :
nullptr;
311 return !this->
buttons.is_empty() ? this->
buttons.last().get() :
nullptr;
316 int sepr_flex_len = 0;
317 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
323 if (sepr_flex_len == 0) {
329 const float buttons_width = std::ceil(
float(rect.
xmax) + 8.0f *
UI_SCALE_FAC);
330 const float region_width =
float(region->
winx);
332 if (region_width <= buttons_width) {
338 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
346 const float segment_width = region_width /
float(sepr_flex_len);
347 float offset = 0, remaining_space = region_width - buttons_width;
349 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
353 int overlap = ((
i == sepr_flex_len - 1) ? buttons_width - spacers_pos[
i] :
354 (spacers_pos[
i + 1] - spacers_pos[
i]) / 2);
355 const int segment_end = segment_width * (
i + 1);
356 const int spacer_end = segment_end - overlap;
357 const int spacer_sta = spacers_pos[
i] + offset;
358 if (spacer_end > spacer_sta) {
359 const float step =
min_ff(remaining_space, spacer_end - spacer_sta);
360 remaining_space -=
step;
372 if (region && region->
runtime->visible) {
381 const rcti winrct = {0, win_size[0] - 1, 0, win_size[1] - 1};
404 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
413 const bool is_same_align_group = (
left->alignnr && (
left->alignnr == right->
alignnr));
414 return is_same_align_group && (
left->rect.xmin < right->
rect.
xmin);
423 std::unique_ptr<uiBut> *col_bt;
424 int i = 0, j, x1addval = offset;
427 std::unique_ptr<uiBut> *end = block->
buttons.
end();
429 std::unique_ptr<uiBut> *init_col_bt = block->
buttons.
begin();
430 for (std::unique_ptr<uiBut> *bt = init_col_bt; bt < end; bt++) {
442 const int alignnr = (*bt)->alignnr;
443 for (col_bt = bt; col_bt < end && (*col_bt)->alignnr == alignnr; col_bt++) {
445 (*col_bt)->rect.xmin += x1addval;
446 (*col_bt)->rect.xmax += x1addval;
448 i = std::max(width,
i);
451 bt = col_bt != end ? col_bt-- :
nullptr;
454 if (bt < end && (bt + 1 < end) && (*bt)->rect.xmin < bt[1]->rect.xmin) {
456 for (col_bt = init_col_bt; (col_bt - 1) != bt; col_bt++) {
457 (*col_bt)->rect.xmin = x1addval;
458 (*col_bt)->rect.xmax = x1addval +
i + block->
bounds;
466 init_col_bt = col_bt;
471 for (col_bt = init_col_bt; col_bt < end; col_bt++) {
474 const int alignnr = (*col_bt)->alignnr;
475 for (; col_bt < end && (*col_bt)->alignnr == alignnr; col_bt++) {
483 (*col_bt)->rect.xmin = x1addval;
504 for (
const std::unique_ptr<uiBut> &bt : block->
buttons) {
539 const int startx = (win_size[0] * 0.5f) - (width * 0.5f);
540 const int starty = (win_size[1] * 0.5f) - (height * 0.5f);
573 const int oldbounds = block->
bounds;
593 block->
bounds = oldbounds;
601 oldwidth = oldwidth > 0 ? oldwidth : std::max(1, width);
602 oldheight = oldheight > 0 ? oldheight : std::max(1, height);
616 rect_bounds.
xmin = margin;
617 rect_bounds.
ymin = margin;
618 rect_bounds.
xmax = win_size[0] - margin;
639 if (block ==
nullptr) {
657 if (bounds_offset !=
nullptr) {
671 if (bounds_offset !=
nullptr) {
721 if (
floor(value) == value) {
754 else if (prec == -1) {
755 prec = (but->
hardmax < 10.001f) ? 3 : 2;
862 const uiBut *but_new,
865 for (
const std::unique_ptr<uiBut> &but : block_old->
buttons) {
880 const uiBut *but_new,
884 for (
const std::unique_ptr<uiBut> &but : block_old->
buttons) {
885 if (!ignore_old_buttons.contains(but.get()) &&
ui_but_equals_old(but_new, but.get())) {
895 for (
const std::unique_ptr<uiBut> &but : block_new->
buttons) {
907 (new_extra_icon->
icon == old_extra_icon->
icon);
911 const uiBut *old_but)
929 if (old_extra_icon) {
930 new_extra_icon->highlighted = old_extra_icon->
highlighted;
964 if (oldbut->
poin != (
char *)oldbut) {
979 oldbut->
flag = (oldbut->
flag & ~flag_copy) | (but->
flag & flag_copy);
988 std::swap(search_oldbut->
arg_free_fn, search_but->arg_free_fn);
989 std::swap(search_oldbut->
arg, search_but->arg);
998 switch (oldbut->
type) {
1037 std::swap(but->
str, oldbut->
str);
1043 std::swap(but->
imb, oldbut->
imb);
1074 std::unique_ptr<uiBut> *but_uptr,
1075 std::optional<int64_t> *but_old_idx)
1078 uiBut *but = but_uptr->get();
1088 std::unique_ptr<uiBut> *oldbut_uptr;
1089 if (
LIKELY(but_old_idx->has_value() &&
1091 !matched_old_buttons.
contains(oldblock->
buttons[**but_old_idx].get()) &&
1094 oldbut_uptr = &oldblock->
buttons[**but_old_idx];
1099 oldbut_uptr = but_old_idx->has_value() ? &oldblock->
buttons[**but_old_idx] :
nullptr;
1102 *but_old_idx = (but_old_idx->has_value() &&
1103 (but_old_idx->value() + 1 < oldblock->
buttons.
size())) ?
1104 std::optional{but_old_idx->value() + 1} :
1108 bool found_active =
false;
1113 uiBut *oldbut = oldbut_uptr->get();
1119 oldbut_uptr->swap(*but_uptr);
1123 matched_old_buttons.
add(but);
1127 oldbut->
block = block;
1135 found_active =
true;
1138 matched_old_buttons.
add(oldbut);
1147 but->
flag = (but->
flag & ~flag_copy) | (oldbut->
flag & flag_copy);
1150 return found_active;
1156 bool activate =
false, found =
false, isactive =
false;
1172 if ((
activate ==
true) || (found ==
false)) {
1181 else if ((found ==
true) && (isactive ==
false)) {
1182 if (remove_on_failure) {
1207 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1222 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1242 if (but->
rnaprop ==
nullptr) {
1259 uint menu_key_mask = 0;
1260 int tot_missing = 0;
1267 for (
int pass = 0; pass < 2; pass++) {
1271 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1272 if (!
ELEM(but->type,
1295 if (but->menu_key !=
'\0') {
1299 if (but->str.empty()) {
1303 const char *str_pt = but->str.c_str();
1306 menu_key = tolower(*str_pt);
1307 if ((menu_key >=
'a' && menu_key <=
'z') && !(menu_key_mask & 1 << (menu_key -
'a'))) {
1308 menu_key_mask |= 1 << (menu_key -
'a');
1314 while (isalpha(*str_pt)) {
1329 but->menu_key = menu_key;
1337 if (menu_key_mask == (1 << 26) - 1) {
1353 if (sep_index != std::string::npos) {
1354 but->
str = but->
str.substr(0, sep_index);
1360 if (shortcut_str ==
nullptr) {
1420 for (
int i = 0;
i < 2;
i++) {
1430 return std::nullopt;
1435 if (but->
optype !=
nullptr) {
1449 return std::nullopt;
1457 if (extra_icon_optype) {
1461 return std::nullopt;
1472 const char *ctx_toggle_opnames[] = {
1473 "WM_OT_context_toggle",
1474 "WM_OT_context_toggle_enum",
1475 "WM_OT_context_cycle_int",
1476 "WM_OT_context_cycle_enum",
1477 "WM_OT_context_cycle_array",
1478 "WM_OT_context_menu_enum",
1482 const char *ctx_enum_opnames[] = {
1483 "WM_OT_context_set_enum",
1487 const char *ctx_enum_opnames_for_Area_ui_type[] = {
1488 "SCREEN_OT_space_type_set_or_cycle",
1492 const char **opnames = ctx_toggle_opnames;
1493 int opnames_len =
ARRAY_SIZE(ctx_toggle_opnames);
1495 int prop_enum_value = -1;
1496 bool prop_enum_value_ok =
false;
1497 bool prop_enum_value_is_int =
false;
1498 const char *prop_enum_value_id =
"value";
1504 if ((but_parent && but_parent->
rnaprop) &&
1511 prop_enum_value = int(but->
hardmin);
1514 prop_enum_value_ok =
true;
1516 opnames = ctx_enum_opnames;
1523 if (prop ==
nullptr) {
1524 return std::nullopt;
1531 if (
ptr->owner_id) {
1532 ID *
id =
ptr->owner_id;
1539 if (
STREQ(prop_id,
"ui_type")) {
1541 prop_enum_value >>= 16;
1545 if (prop_enum_value == -1) {
1548 prop_enum_value_ok = (prop_enum_value != -1);
1551 opnames = ctx_enum_opnames_for_Area_ui_type;
1552 opnames_len =
ARRAY_SIZE(ctx_enum_opnames_for_Area_ui_type);
1553 prop_enum_value_id =
"space_type";
1554 prop_enum_value_is_int =
true;
1567 C,
ptr, prop, prop_index);
1570 data_path_variations.
append(data_path.value_or(
""));
1572 if (data_path.has_value()) {
1574 if (data_path_ref.
startswith(
"scene.tool_settings.")) {
1581 for (
int data_path_index = 0; data_path_index < data_path_variations.
size(); data_path_index++) {
1582 const StringRefNull data_path = data_path_variations[data_path_index];
1583 if (!data_path.
is_empty() || (prop_enum_value_ok && prop_enum_value_id)) {
1590 if (prop_enum_value_ok) {
1597 if (prop_enum_value_is_int) {
1598 const int value = item[index].
value;
1616 for (
int i = 0; (
i < opnames_len) && (opnames[
i]);
i++) {
1626 return std::nullopt;
1689 if (block->
name ==
"splash") {
1694 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1702 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
1705 if (but->drawstr[0] ==
'\0') {
1769 extra_op_icon->
icon = icon;
1833 return ((but->
editstr ==
nullptr) && (but->
drawstr[0] !=
'\0') &&
1841 if (but->
rnaprop ==
nullptr) {
1856 if (but->
editstr !=
nullptr) {
1868 return type == &RNA_Bone || type == &RNA_EditBone;
1873 switch (but->
type) {
1911 switch (extra_icon) {
1914 if (!id_eyedropper_ot) {
1919 optype = id_eyedropper_ot;
1920 icon = ICON_EYEDROPPER;
1926 if (!id_eyedropper_ot) {
1931 optype = id_eyedropper_ot;
1932 icon = ICON_EYEDROPPER;
1943 icon = ICON_PANEL_CLOSE;
1953 if ((op_icon->optype_params->optype == optype) && (op_icon->icon == icon)) {
1980 for (std::unique_ptr<uiBut> &but : block->
buttons) {
1985 if (but->tip_func) {
2026 int old_but_flag = 0;
2030 old_but_flag = but->
flag;
2046 "Operator polls shouldn't change button flags");
2048 const_cast<uiBut *
>(but)->
flag = old_but_flag;
2064 params.opcontext = opcontext;
2081 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2091 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2103 op_icon->disabled =
true;
2166 if (!block->
panel) {
2221 rcti rect_winspace = *rect;
2270 else if (block->
panel) {
2282 float subpanel_backcolor[4]{0.2f, 0.3f, 0.33f, 0.05f};
2293 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2323 uiBut *but_prev =
nullptr;
2325 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
2326 if (but->rnapoin.type && but->rnaprop) {
2328 if ((but_prev && (but_prev->
rnaprop == but->rnaprop) &&
2335 value.
owner = region;
2339 but_prev = but.get();
2366 lvalue = int(*value);
2375 switch (but->
type) {
2388 if (*value !=
double(but->
hardmin)) {
2396 if (*value == 0.0) {
2421 if (
int(*value) &
int(but->
hardmax)) {
2426 if (*value ==
double(but->
hardmax)) {
2447 is_push = !bool(is_push);
2481 block->
lock =
false;
2506 const char *cp = but->
poin;
2507 vec[0] =
float(cp[0]) / 255.0f;
2508 vec[1] =
float(cp[1]) / 255.0f;
2509 vec[2] =
float(cp[2]) / 255.0f;
2512 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2516 if (but->
editvec ==
nullptr) {
2517 CLOG_WARN(&
LOG,
"%s: cannot get color, should never happen", __func__);
2542 char *cp = but->
poin;
2543 cp[0] = char(lround(vec[0] * 255.0f));
2544 cp[1] = char(lround(vec[1] * 255.0f));
2545 cp[2] = char(lround(vec[2] * 255.0f));
2548 float *fp =
reinterpret_cast<float *
>(but->
poin);
2570 const char *cp = but->
poin;
2571 vec[0] =
float(cp[0]) / 255.0f;
2572 vec[1] =
float(cp[1]) / 255.0f;
2573 vec[2] =
float(cp[2]) / 255.0f;
2574 vec[3] =
float(cp[3]) / 255.0f;
2577 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2581 if (but->
editvec ==
nullptr) {
2582 CLOG_WARN(&
LOG,
"%s: can't get color, should never happen", __func__);
2603 char *cp = but->
poin;
2604 cp[0] = char(lround(vec[0] * 255.0f));
2605 cp[1] = char(lround(vec[1] * 255.0f));
2606 cp[2] = char(lround(vec[2] * 255.0f));
2607 cp[3] = char(lround(vec[3] * 255.0f));
2610 float *fp =
reinterpret_cast<float *
>(but->
poin);
2787 value = *(
char *)but->
poin;
2790 value = *(
short *)but->
poin;
2793 value = *(
int *)but->
poin;
2796 value = *(
float *)but->
poin;
2836 int ivalue = int(value);
2869 float fval =
float(value);
2870 if (fval >= -0.00001f && fval <= 0.00001f) {
2879 value = *but->
editval = value;
2882 value = *((
char *)but->
poin) = char(value);
2885 value = *((
short *)but->
poin) = short(value);
2888 value = *((
int *)but->
poin) = int(value);
2891 value = *((
float *)but->
poin) =
float(value);
2908 uiBut *return_but =
nullptr;
2912 for (
const std::unique_ptr<uiBut> &but_iter : but->
block->
buttons) {
2913 if (but_iter->editstr) {
2914 return_but = but_iter.get();
2957 uiBut *but,
char *
str,
int str_maxncpy,
double value,
bool pad,
int float_precision)
2966 if (float_precision == -1) {
2972 else if (precision == -1) {
2977 precision = float_precision;
2999 if (
step == -1.0f) {
3000 return step_default;
3012 if (
step == step_unit) {
3019 step_final *= step_orig;
3022 return float(step_final);
3027 const size_t str_maxncpy,
3028 const int float_precision,
3029 const bool use_exp_float,
3030 bool *r_use_exp_float)
3032 if (r_use_exp_float) {
3033 *r_use_exp_float =
false;
3040 const char *buf =
nullptr;
3076 if (buf ==
nullptr) {
3079 else if (buf !=
str) {
3114 int prec = float_precision;
3116 if (float_precision == -1) {
3136 if (use_exp_float) {
3137 if (int_digits_num < -6 || int_digits_num > 12) {
3139 if (r_use_exp_float) {
3140 *r_use_exp_float =
true;
3144 prec -= int_digits_num;
3150 prec -= int_digits_num;
3168 char *
str =
nullptr;
3182 const char *value_id;
3192 *r_str_size = strlen(value_id) + 1;
3223#define UI_NUMBER_EVAL_ERROR_PREFIX RPT_("Error evaluating number, see Info editor for details")
3228 char *
error =
nullptr;
3258 *r_value = atof(
str);
3266 const int len = strlen(
str);
3285 const int len = strlen(
str);
3297 if (
str[0] ==
'\0') {
3341 if (
str[0] ==
'\0') {
3363 else if (search_but && search_but->
item_active !=
nullptr) {
3433 else if (
str[0] ==
'#') {
3447 value =
floor(value + 0.5);
3451 if (value <
double(but->
hardmin)) {
3454 if (value >
double(but->
hardmax)) {
3469 const double newmax = (value != 0.0) ?
pow(10.0,
ceil(
log(value) /
M_LN10)) : 0.0;
3471 if (newmax * 0.2 >=
max && newmax * 0.2 >= value) {
3472 return newmax * 0.2;
3474 if (newmax * 0.5 >=
max && newmax * 0.5 >= value) {
3475 return newmax * 0.5;
3484 const double newmax = (value != 0.0) ?
pow(10.0,
floor(
log(value) /
M_LN10)) : 0.0;
3486 if (newmax * 5.0 <=
max && newmax * 5.0 <= value) {
3487 return newmax * 5.0;
3489 if (newmax * 2.0 <=
max && newmax * 2.0 <= value) {
3490 return newmax * 2.0;
3497 if (but->
rnaprop ==
nullptr) {
3528 double softmin, softmax;
3537 int imin, imax, istep;
3540 softmin = std::max(imin, INT_MIN);
3541 softmax = std::min(imax, INT_MAX);
3548 value_min = double(value_range[0]);
3549 value_max = double(value_range[1]);
3557 float fmin, fmax, fstep, fprecision;
3560 softmin = (fmin == -
FLT_MAX) ?
float(-1e4) : fmin;
3561 softmax = (fmax ==
FLT_MAX) ?
float(1e4) : fmax;
3567 float value_range[2];
3569 value_min = double(value_range[0]);
3570 value_max = double(value_range[1]);
3581 if (value_min + 1
e-10 < softmin) {
3582 if (value_min < 0.0) {
3589 softmin = std::max(softmin,
double(but->
hardmin));
3591 if (value_max - 1
e-10 > softmax) {
3592 if (value_max < 0.0) {
3599 if (softmax >
double(but->
hardmax)) {
3609 if (isfinite(value)) {
3626 switch (but->
type) {
3633 search_but->
arg =
nullptr;
3651 MEM_delete(but->
opptr);
3731 for (
const std::unique_ptr<uiBut> &but : block->
buttons) {
3761 listener->listener_func(listener_params);
3773 if (block->active) {
3782 if (block->active) {
3791 if (block->active) {
3803 region->
runtime->block_name_map.clear();
3811 if (!block->handle) {
3812 if (block->active) {
3813 block->active =
false;
3816 if (region->
runtime->block_name_map.lookup_default(block->name,
nullptr) == block) {
3817 region->
runtime->block_name_map.remove_as(block->name);
3834 oldblock = region->
runtime->block_name_map.lookup_default(block->
name,
nullptr);
3837 oldblock->
active =
false;
3838 oldblock->
panel =
nullptr;
3839 oldblock->
handle =
nullptr;
3844 region->
runtime->block_name_map.add_overwrite_as(block->
name, block);
3857 uiBlock *block = MEM_new<uiBlock>(__func__);
3872 memcpy(unit, &scene->
unit,
sizeof(scene->
unit));
3894 if (!(region && region->
runtime->visible)) {
3962 but->
drawstr = fmt::format(
"{}{:.{}f}%", but->
str, value, prec);
3966 but->
drawstr = fmt::format(
"{}{:.{}f} px", but->
str, value, prec);
3972 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, precision);
3975 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value * 100, std::max(0, precision - 2));
3985 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
3996 but->
drawstr = but->
str + std::to_string(value);
4026 switch (but->
type) {
4032 if (value <
double(but->
hardmin)) {
4035 else if (value >
double(but->
hardmax)) {
4061 switch (but->
type) {
4104 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
4219 std::unique_ptr<uiBut> but{};
4223 but = std::make_unique<uiButNumber>();
4226 but = std::make_unique<uiButNumberSlider>();
4229 but = std::make_unique<uiButColor>();
4232 but = std::make_unique<uiButDecorator>();
4235 but = std::make_unique<uiButTab>();
4238 but = std::make_unique<uiButSearch>();
4241 but = std::make_unique<uiButProgress>();
4244 but = std::make_unique<uiButSeparatorLine>();
4247 but = std::make_unique<uiButHSVCube>();
4250 but = std::make_unique<uiButColorBand>();
4253 but = std::make_unique<uiButCurveMapping>();
4256 but = std::make_unique<uiButCurveProfile>();
4259 but = std::make_unique<uiButHotkeyEvent>();
4262 but = std::make_unique<uiButViewItem>();
4265 but = std::make_unique<uiButLabel>();
4268 but = std::make_unique<uiButScrollBar>();
4271 but = std::make_unique<uiBut>();
4281 if (but->
type == new_type) {
4289 std::unique_ptr<uiBut> old_but_ptr = std::move(but->
block->
buttons[but_index]);
4292 const bool has_poin_ptr_to_self = but->
poin == (
char *)but;
4297 *but = *old_but_ptr;
4299 but->
type = new_type;
4300 if (has_poin_ptr_to_self) {
4301 but->
poin = (
char *)but;
4334 const std::optional<StringRef> tip)
4341 if (poin ==
nullptr) {
4363 but->
poin = (
char *)poin;
4366 but->
tip = tip.value_or(
"");
4392 if (but->
str[but->
str.size() - 1] !=
' ') {
4400 if (!but->
str.empty()) {
4417#ifdef USE_NUMBUTS_LR_ALIGN
4419 if (!but->
str.empty()) {
4427 if (block->
lock ==
true) {
4482 if (!but->
str.empty()) {
4489 but->
icon = ICON_NONE;
4519 bool has_item_with_icon =
false;
4528 const int max_rows = std::max(
int(vertical_space / row_height) - 1, 1);
4530 float text_width = 0.0f;
4533 float col_width = 0.0f;
4537 if (col_rows > 1 && (col_rows > max_rows || (!item->identifier[0] && item->name))) {
4539 text_width += col_width;
4543 if (!item->identifier[0] && item->name) {
4549 has_item_with_icon =
true;
4551 if (item->name && item->name[0]) {
4553 col_width = std::max(col_width, item_width + (100.0f *
UI_SCALE_FAC));
4555 rows = std::max(rows, col_rows);
4557 text_width += col_width;
4560 if (categories == 0) {
4564 columns = std::max((totitems + 20) / 20, 1);
4566 columns = (totitems + 25) / 25;
4570 if ((totitems / columns) > max_rows) {
4571 columns = std::max((totitems + col_rows) / max_rows, 1);
4573 rows = std::max(totitems / columns, 1);
4574 while (rows * columns < totitems) {
4605 const bool use_enum_copy_description =
free &&
4609 if (title && title[0] && (categories == 0) && (!but->
str[0] || !prior_label)) {
4612 block,
ButType::Label, 0, title, 0, 0,
UI_UNIT_X * 5,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
4625 for (
int a = 0; a < totitems; a++) {
4626 new_column = (a == column_end);
4630 column_end = totitems;
4632 for (
int b = a + 1;
b < totitems;
b++) {
4636 if (((
b - a) % rows == 0) || (columns > 1 && !item->
identifier[0] && item->
name)) {
4642 column = &
split->column(
false);
4647 if (new_column && (categories > 0) && (columns > 1) && item->
identifier[0]) {
4648 column->
label(
"", ICON_NONE);
4653 if (item->
name || columns > 1) {
4657 else if (item->
name) {
4677 int icon = item->
icon;
4678 std::optional<StringRef> description_static;
4679 if (!use_enum_copy_description) {
4685 if (icon == ICON_NONE && has_item_with_icon) {
4701 description_static);
4715 description_static);
4717 if (item->
value == current_value) {
4724 if (use_enum_copy_description) {
4730 return static_cast<const char *
>(argN);
4753 layout->
label(
RPT_(
"Missing Panel"), ICON_NONE);
4776 const char *menu_type =
static_cast<const char *
>(but->
func_argN);
4784 layout->
label(msg, ICON_NONE);
4820 std::optional<StringRef>
str,
4830 std::optional<StringRef> tip)
4861#ifdef WITH_INTERNATIONAL
4866 icon = item[
i].
icon;
4899 float precision = -1.0f;
4901 int hardmin, hardmax, softmin, softmax, int_step;
4914 float hardmin, hardmax, softmin, softmax;
4931 uiBut *but =
ui_def_but(block, type, retval, *
str,
x,
y, width, height,
nullptr,
min,
max, tip);
5002 but->
poin = (
char *)but;
5011 std::optional<StringRef>
str,
5021 const std::optional<StringRef> tip)
5028 block, type, retval,
str,
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5031 but =
ui_def_but(block, type, retval, propname,
x,
y, width, height,
nullptr,
min,
max, tip);
5048 std::optional<StringRef> tip)
5050 if ((!tip || tip->is_empty()) &&
ot &&
ot->srna && !
ot->get_description) {
5054 uiBut *but =
ui_def_but(block, type, -1,
str,
x,
y, width, height,
nullptr, 0, 0, tip);
5080 const std::optional<StringRef> tip)
5083 block, but_and_ptr_type, retval,
str,
x,
y, width, height, poin,
min,
max, tip);
5093 uiBut *but =
ui_def_but(block,
ButType::Image, 0,
"",
x,
y, width, height,
imbuf, 0, 0,
"");
5138 if (
x & 0xFFFF0000) {
5184 char *truncate = autocpl->
truncate;
5185 const char *startname = autocpl->
startname;
5186 int match_index = 0;
5187 for (
int a = 0; a < autocpl->
maxncpy - 1; a++) {
5188 if (startname[a] == 0 || startname[a] !=
name[a]) {
5195 if (startname[match_index] == 0) {
5198 if (truncate[0] == 0) {
5199 name.copy_utf8_truncated(truncate, autocpl->
maxncpy);
5203 for (
int a = 0; a < std::min<size_t>(
name.size(), autocpl->
maxncpy) - 1; a++) {
5208 if (truncate[a] !=
name[a]) {
5239#define PREVIEW_TILE_PAD (0.225f * UI_UNIT_X)
5262#undef PREVIEW_TILE_PAD
5285 const std::optional<StringRef> tip)
5316 const std::optional<StringRef> tip)
5342 const std::optional<StringRef> tip)
5369 const std::optional<StringRef> tip)
5396 const std::optional<StringRef> tip)
5423 const std::optional<StringRef> tip)
5450 const std::optional<StringRef> tip)
5477 const std::optional<StringRef> tip)
5496 const std::optional<StringRef>
str,
5506 const std::optional<StringRef> tip)
5509 block, type, retval,
str,
x,
y, width, height,
ptr, propname, index,
min,
max, tip);
5516 const std::optional<StringRef>
str,
5526 const std::optional<StringRef> tip)
5529 block, type, retval,
str,
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5543 const std::optional<StringRef> tip)
5553 std::optional<StringRef>
str,
5558 const std::optional<StringRef> tip)
5561 if (!
str &&
ot ==
nullptr) {
5578 const std::optional<StringRef> tip)
5581 block, but_and_ptr_type, retval,
"",
x,
y, width, height, poin,
min,
max, tip);
5596 const std::optional<StringRef> tip)
5598 uiBut *but =
ui_def_but(block, type, retval,
"",
x,
y, width, height, poin,
min,
max, tip);
5622 const std::optional<StringRef> tip)
5654 const std::optional<StringRef> tip)
5681 const std::optional<StringRef> tip)
5708 const std::optional<StringRef> tip)
5735 const std::optional<StringRef> tip)
5763 const std::optional<StringRef> tip)
5792 const std::optional<StringRef> tip)
5795 block, type, retval,
"",
x,
y, width, height,
ptr, propname, index,
min,
max, tip);
5812 const std::optional<StringRef> tip)
5815 block, type, retval,
"",
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5829 const std::optional<StringRef> tip)
5844 const std::optional<StringRef> tip)
5860 const std::optional<StringRef> tip)
5863 block, but_and_ptr_type, retval,
str,
x,
y, width, height, poin, 0.0f, 0.0f, tip);
5878 const std::optional<StringRef> tip)
5902 const std::optional<StringRef> tip)
5921 const std::optional<StringRefNull>
str,
5929 const std::optional<StringRef> tip)
5932 block, type, retval,
str,
x,
y, width, height,
ptr, propname, index, 0.0f, 0.0f, tip);
5941 const std::optional<blender::StringRef>
str,
5951 const std::optional<StringRef> tip)
5954 block, type, retval,
str,
x,
y, width, height,
ptr, prop, index,
min,
max, tip);
5969 const std::optional<StringRef> tip)
5986 const std::optional<StringRef> tip)
5989 if (
str.is_empty()) {
5992 return uiDefIconTextButO_ptr(block, type,
ot, opcontext, icon,
str,
x,
y, width, height, tip);
6005 MEM_delete(but->
opptr);
6006 but->
opptr =
nullptr;
6009 but->
opptr = MEM_new<PointerRNA>(__func__, *opptr);
6132 if (!placeholder && but->
rnaprop) {
6168 but->
opptr = MEM_new<PointerRNA>(__func__);
6228 const int ownUnit = int(but->
unit_type);
6234 if ((ownUnit != 0) || (but->
rnaprop ==
nullptr)) {
6235 return ownUnit << 16;
6264 block->
funcN = funcN;
6278 std::function<
void(std::string &new_name)> rename_full_func)
6378 const std::optional<StringRef> tip)
6380 uiBut *but =
ui_def_but(block,
ButType::Block, 0,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6394 const std::optional<StringRef> tip,
6399 block,
ButType::Block, 0,
str,
x,
y, width, height,
nullptr, 0.0, 0.0, tip);
6419 const std::optional<StringRef> tip)
6422 block,
ButType::Pulldown, 0,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6437 const std::optional<StringRef> tip)
6440 block,
ButType::Pulldown, 0,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6461 const std::optional<StringRef> tip)
6464 block,
ButType::Pulldown, 0,
"",
x,
y, width, height, arg, 0.0, 0.0, tip);
6484 const std::optional<StringRef> tip)
6487 block,
ButType::Block, retval,
"",
x,
y, width, height, arg, 0.0, 0.0, tip);
6508 const std::optional<StringRef> tip)
6511 block,
ButType::SearchMenu, retval,
"",
x,
y, width, height, arg, 0.0, maxncpy, tip);
6526 const bool free_arg,
6537 if (search_create_fn ==
nullptr) {
6543 search_but->
arg =
nullptr;
6550 search_but->
arg = arg;
6553 if (search_exec_fn) {
6557 printf(
"%s: warning, overwriting button callback with search function callback!\n",
6626 if (prop ==
nullptr) {
6627 printf(
"%s: %s has no enum property set\n", __func__,
ot->idname);
6630 printf(
"%s: %s \"%s\" is not an enum property\n",
6646 search.
add(item->name, item);
6680 printf(
"%s: op->prop for '%s' is nullptr\n", __func__,
ot->idname);
6696 const std::optional<StringRef> tip)
6801 const std::optional<int> draw_width,
6802 const std::optional<int> draw_height)
6806 but_view_item->
draw_width = draw_width.value_or(0);
6807 but_view_item->
draw_height = draw_height.value_or(0);
6818 event.customdata = but;
6819 event.customdata_free =
false;
6860 if (!
ptr || !prop) {
6861 return std::nullopt;
6866 return std::nullopt;
6903 if (!but.
str.empty()) {
6904 size_t str_len = but.
str.size();
6907 if (sep_index != std::string::npos) {
6908 str_len = sep_index;
6911 return but.
str.substr(0, str_len);
6921 if (view_item_but.
view_item ==
nullptr) {
6949 return CTX_TIP_(mt->translation_context, mt->label);
6957 return CTX_TIP_(pt->translation_context, pt->label);
7009 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()
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)
MINLINE 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)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define SNPRINTF_UTF8(dst, format,...)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#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
#define CLOG_WARN(clg_ref,...)
#define ID_CHECK_UNDO(id)
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(GPUBlend blend)
const ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], const ColorManagedDisplay *display, const ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
const char * IMB_colormanagement_display_get_default_name()
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
@ UI_BLOCK_MOVEMOUSE_QUIT
@ UI_BLOCK_NO_ACCELERATOR_KEYS
@ UI_BLOCK_SHOW_SHORTCUT_ALWAYS
@ UI_BUT_ACTIVATE_ON_INIT
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)
ARegion *(*)(bContext *C, ARegion *butregion, uiButSearch *search_but) uiButSearchCreateFn
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
uiBlock *(*)(bContext *C, ARegion *region, void *arg1) uiBlockCreateFunc
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) uiButSearchTooltipFn
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)
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
void UI_but_tooltip_refresh(bContext *C, uiBut *but)
void(*)(bContext *C, void *arg1, void *arg2) uiButHandleFunc
@ UI_BUT_HAS_QUICK_TOOLTIP
@ UI_BUT_NO_PREVIEW_PADDING
int UI_calc_float_precision(int prec, double value)
bool UI_but_is_tool(const uiBut *but)
void UI_widgetbase_draw_cache_begin()
#define UI_FLOAT_VALUE_DISPLAY_MIN
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)
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, uiTooltipData &data, uiBut *but, void *argN) uiButToolTipCustomFunc
blender::ocio::Display ColorManagedDisplay
bool(*)(bContext *C, int direction, void *arg1) uiMenuStepFunc
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
float UI_view2d_scale_get_x(const View2D *v2d)
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
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
void ui_but_v4_get(uiBut *but, float vec[4])
void UI_block_update_from_old(const bContext *C, uiBlock *block)
uiBut * uiDefButO_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
const ColorManagedDisplay * ui_block_cm_display_get(uiBlock *block)
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)
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)
uiBut * uiDefIconButS(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const std::optional< StringRef > tip)
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)
PointerRNA * UI_but_extra_operator_icon_add(uiBut *but, const StringRefNull opname, blender::wm::OpCallContext opcontext, int icon)
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 * 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)
uiBut * uiDefButR(uiBlock *block, ButType 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)
void UI_but_color_set(uiBut *but, const uchar color[4])
std::string UI_but_string_get_rna_label_context(const uiBut &but)
void UI_block_lock_clear(uiBlock *block)
uiBut * uiDefIconButR_prop(uiBlock *block, ButType 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_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)
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)
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 * uiDefButF(uiBlock *block, ButType 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_block_add_dynamic_listener(uiBlock *block, void(*listener_func)(const wmRegionListenerParams *params))
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 * uiDefIconTextBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, const StringRef str, int x, int y, short width, short height, void *poin, const std::optional< StringRef > tip)
void UI_but_func_menu_step_set(uiBut *but, uiMenuStepFunc func)
uiBut * uiDefButBitS(uiBlock *block, ButType 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)
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)
uiBut * uiDefButBitI(uiBlock *block, ButType 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)
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)
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)
static uiBut * ui_def_but_rna(uiBlock *block, ButType 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)
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)
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)
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)
uiBut * uiDefButBitC(uiBlock *block, ButType 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)
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()
static PointerRNA * ui_but_extra_operator_icon_add_ptr(uiBut *but, wmOperatorType *optype, blender::wm::OpCallContext opcontext, int icon)
uiBut * ui_but_change_type(uiBut *but, ButType new_type)
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)
uiBut * uiDefIconTextButR_prop(uiBlock *block, ButType 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)
void UI_but_operator_set(uiBut *but, wmOperatorType *optype, blender::wm::OpCallContext opcontext, const PointerRNA *opptr)
static void operator_enum_search_update_fn(const bContext *C, void *but, const char *str, uiSearchItems *items, const bool)
uiBut * uiDefIconTextButS(uiBlock *block, ButType type, int retval, int icon, const StringRef str, int x, int y, short width, short height, short *poin, const std::optional< StringRef > tip)
uiBut * uiDefIconPreviewBut(uiBlock *block, ButType type, 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_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
uiBut * uiDefButC(uiBlock *block, ButType 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)
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)
uiBut * uiDefIconBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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 void ui_block_bounds_calc_text(uiBlock *block, float offset)
bool UI_block_is_search_only(const uiBlock *block)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
static uiBut * ui_def_but_operator_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, const StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
uiBut * uiDefButS(uiBlock *block, ButType 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)
uiBut * uiDefButI(uiBlock *block, ButType 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)
bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
uiBut * uiDefIconTextButI(uiBlock *block, ButType type, int retval, int icon, const StringRef str, int x, int y, short width, short height, int *poin, const std::optional< StringRef > tip)
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)
uiBut * uiDefIconButBitC(uiBlock *block, ButType 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_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)
uiBut * uiDefIconButR(uiBlock *block, ButType 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)
static uiBut * uiDefIconButBit(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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_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)
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)
uiBut * uiDefButO(uiBlock *block, ButType type, const StringRefNull opname, blender::wm::OpCallContext opcontext, std::optional< StringRef > str, int x, int y, short width, short height, 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)
void ui_but_rna_menu_convert_to_panel_type(uiBut *but, const char *panel_type)
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)
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)
static uiBut * uiDefButBit(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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_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)
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)
uiBut * uiDefButR_prop(uiBlock *block, ButType 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)
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)
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)
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)
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)
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)
void UI_but_placeholder_set(uiBut *but, const StringRef placeholder_text)
uiBut * uiDefIconButI(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const std::optional< StringRef > tip)
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)
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 uiBut * ui_def_but_rna_propname(uiBlock *block, ButType 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)
static void ui_block_bounds_calc_centered_pie(uiBlock *block)
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, ButType 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, 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)
uiBut * uiDefIconTextButO(uiBlock *block, ButType type, const StringRefNull opname, blender::wm::OpCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
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 std::unique_ptr< uiBut > ui_but_new(const ButType type)
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)
const ColorManagedDisplay * UI_but_cm_display_get(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 uiBut * ui_def_but(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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)
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)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_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)
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)
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)
bool UI_but_is_color_gamma(uiBut &but)
static std::optional< std::string > ui_but_extra_icon_event_operator_string(const bContext *C, const uiButExtraOpIcon *extra_icon)
static void ui_but_submenu_enable(uiBlock *block, uiBut *but)
void UI_block_end(const bContext *C, uiBlock *block)
uiBut * uiDefIconButBitI(uiBlock *block, ButType 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)
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)
uiBut * uiDefIconButO_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, const std::optional< StringRef > tip)
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)
bool UI_but_flag_is_set(uiBut *but, int flag)
bool ui_but_is_bool(const uiBut *but)
uiBut * uiDefIconButO(uiBlock *block, ButType type, const StringRefNull opname, blender::wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, const std::optional< StringRef > tip)
uiBut * uiDefIconTextButO_ptr(uiBlock *block, ButType type, wmOperatorType *ot, blender::wm::OpCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const std::optional< StringRef > tip)
static std::string ui_but_pie_direction_string(const uiBut *but)
uiBut * uiDefIconButBitS(uiBlock *block, ButType 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)
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
bool ui_but_is_color_gamma(uiBut *but)
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.
int2 block_layout_resolve(uiBlock *block)
void block_layout_set_current(uiBlock *block, uiLayout *layout)
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)
const char * RNA_property_ui_name(const PropertyRNA *prop, const PointerRNA *ptr)
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)
bool RNA_pointer_is_null(const PointerRNA *ptr)
int RNA_property_array_length(PointerRNA *ptr, 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
ButPointerType pointer_type
blender::ui::AbstractViewItem * view_item
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
blender::wm::OpCallContext opcontext
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
blender::wm::OpCallContext opcontext
struct wmEvent * eventstate
wmEvent * WM_event_add(wmWindow *win, const wmEvent *event_to_add)
bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, blender::wm::OpCallContext context)
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, blender::wm::OpCallContext 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)