17#include <fmt/format.h>
90#define BUT_VALUE_UNSET DBL_MAX
91#define UI_GET_BUT_VALUE_INIT(_but, _value) \
92 if (_value == DBL_MAX) { \
93 (_value) = button_value_get(_but); \
106static void but_free(
const bContext *
C, Button *but);
139 (0.5f + 0.5f * (gx * block->
winmat[0][0] + gy * block->
winmat[1][0] + block->
winmat[3][0]));
141 (0.5f + 0.5f * (gx * block->
winmat[0][1] + gy * block->
winmat[1][1] + block->
winmat[3][1]));
158 *
x = int(lround(fx));
159 *
y = int(lround(fy));
185 float min_y = 0, max_y = 1;
186 float dummy_x = 0.0f;
190 return max_y - min_y;
200 const float a = 0.5f *
float(getsizex) * block->
winmat[0][0];
201 const float b = 0.5f *
float(getsizex) * block->
winmat[1][0];
202 const float c = 0.5f *
float(getsizex) * (1.0f + block->
winmat[3][0]);
204 const float d = 0.5f *
float(getsizey) * block->
winmat[0][1];
205 const float e = 0.5f *
float(getsizey) * block->
winmat[1][1];
206 const float f = 0.5f *
float(getsizey) * (1.0f + block->
winmat[3][1]);
208 const float px = *
x - sx;
209 const float py = *
y - sy;
211 *
y = (a * (py - f) + d * (c - px)) / (a *
e - d *
b);
212 *
x = (px -
b * (*y) - c) / a;
237 *
x = int(lround(fx));
238 *
y = int(lround(fy));
270 const ARegion *region,
int region_x,
int region_y,
int *r_window_x,
int *r_window_y)
279 auto index = std::distance(
281 std::ranges::find_if(this->buttons_ptrs, [but](
const std::unique_ptr<Button> &test) {
282 return test.get() == but;
290 const int idx = this->
but_index(but) + 1;
296 const int idx = this->
but_index(but) - 1;
297 return idx >= 0 ? this->
buttons_ptrs[idx].get() :
nullptr;
318 int sepr_flex_len = 0;
325 if (sepr_flex_len == 0) {
331 const float buttons_width = std::ceil(
float(rect.
xmax) + 8.0f *
UI_SCALE_FAC);
332 const float region_width =
float(region->
winx);
334 if (region_width <= buttons_width) {
348 const float segment_width = region_width /
float(sepr_flex_len);
349 float offset = 0, remaining_space = region_width - buttons_width;
355 int overlap = ((i == sepr_flex_len - 1) ? buttons_width - spacers_pos[i] :
356 (spacers_pos[i + 1] - spacers_pos[i]) / 2);
357 const int segment_end = segment_width * (i + 1);
358 const int spacer_end = segment_end - overlap;
359 const int spacer_sta = spacers_pos[i] + offset;
360 if (spacer_end > spacer_sta) {
361 const float step =
min_ff(remaining_space, spacer_end - spacer_sta);
362 remaining_space -=
step;
383 const rcti winrct = {0, win_size[0] - 1, 0, win_size[1] - 1};
429 std::unique_ptr<Button> *col_bt;
430 int i = 0, j, x1addval = offset;
433 std::unique_ptr<Button> *end = block->
buttons_ptrs.end();
435 std::unique_ptr<Button> *init_col_bt = block->
buttons_ptrs.begin();
436 for (std::unique_ptr<Button> *bt = init_col_bt; bt < end; bt++) {
448 const int alignnr = (*bt)->alignnr;
449 for (col_bt = bt; col_bt < end && (*col_bt)->alignnr == alignnr; col_bt++) {
451 (*col_bt)->rect.xmin += x1addval;
452 (*col_bt)->rect.xmax += x1addval;
454 i = std::max(width, i);
457 bt = col_bt != end ? col_bt-- :
nullptr;
460 if (bt < end && (bt + 1 < end) && (*bt)->rect.xmin < bt[1]->rect.xmin) {
462 for (col_bt = init_col_bt; (col_bt - 1) != bt; col_bt++) {
463 (*col_bt)->rect.xmin = x1addval;
464 (*col_bt)->rect.xmax = x1addval + i + block->
bounds;
470 x1addval += i + block->
bounds;
472 init_col_bt = col_bt;
477 for (col_bt = init_col_bt; col_bt < end; col_bt++) {
480 const int alignnr = (*col_bt)->alignnr;
481 for (; col_bt < end && (*col_bt)->alignnr == alignnr; col_bt++) {
489 (*col_bt)->rect.xmin = x1addval;
545 const int startx = (win_size[0] * 0.5f) - (width * 0.5f);
546 const int starty = (win_size[1] * 0.5f) - (height * 0.5f);
566 int(block->
pie_data->pie_center_spawned[0]),
567 int(block->
pie_data->pie_center_spawned[1]),
579 const int oldbounds = block->
bounds;
607 block->
bounds = oldbounds;
615 oldwidth = oldwidth > 0 ? oldwidth : std::max(1, width);
616 oldheight = oldheight > 0 ? oldheight : std::max(1, height);
621 const int raw_x = rect.
xmin = xy[0] + block->
rect.
xmin +
630 rect_bounds.
xmin = margin;
631 rect_bounds.
ymin = margin;
632 rect_bounds.
xmax = win_size[0] - margin;
646 r_xy[0] = xy[0] + block->
rect.
xmin - raw_x;
647 r_xy[1] = xy[1] + block->
rect.
ymin - raw_y;
653 if (block ==
nullptr) {
671 if (bounds_offset !=
nullptr) {
685 if (bounds_offset !=
nullptr) {
741 if (
floor(value) == value) {
774 else if (prec == -1) {
775 prec = (but->
hardmax < 10.001f) ? 3 : 2;
884 return static_cast<const ButtonLabel *
>(but)->label_type ==
913 for (
const Button &but : block_old->
buttons()) {
936 (new_extra_icon->
icon == old_extra_icon->
icon);
958 if (old_extra_icon) {
996 if (oldbut->
poin !=
reinterpret_cast<char *
>(oldbut)) {
1012 oldbut->
flag = (oldbut->
flag & ~flag_copy) | (but->
flag & flag_copy);
1024 std::swap(search_oldbut->
arg, search_but->arg);
1027 auto *label_oldbut =
static_cast<ButtonLabel *
>(oldbut);
1028 auto *label_but =
static_cast<ButtonLabel *
>(but);
1029 std::swap(label_oldbut->wrap_cache, label_but->wrap_cache);
1030 std::swap(label_oldbut->markdown_cache, label_but->markdown_cache);
1031 std::swap(label_oldbut->max_lines, label_but->max_lines);
1040 switch (oldbut->
type) {
1068 std::swap(image_oldbut->
key, image_but->
key);
1091 std::swap(but->
str, oldbut->
str);
1097 std::swap(but->
imb, oldbut->
imb);
1128 std::unique_ptr<Button> *but_uptr,
1129 std::optional<int64_t> *but_old_idx)
1132 Button *but = but_uptr->get();
1140 oldblock->
buttons_ptrs.index_range().contains(**but_old_idx));
1143 std::unique_ptr<Button> *oldbut_uptr;
1144 if (but_old_idx->has_value() &&
1154 oldbut_uptr = but_old_idx->has_value() ? &oldblock->
buttons_ptrs[**but_old_idx] :
nullptr;
1157 *but_old_idx = (but_old_idx->has_value() &&
1158 (but_old_idx->value() + 1 < oldblock->
buttons_ptrs.size())) ?
1159 std::optional{but_old_idx->value() + 1} :
1163 bool found_active =
false;
1168 Button *oldbut = oldbut_uptr->get();
1185 oldbut_uptr->swap(*but_uptr);
1189 matched_old_buttons.
add(but);
1193 oldbut->
block = block;
1201 found_active =
true;
1204 matched_old_buttons.
add(oldbut);
1213 but->
flag = (but->
flag & ~flag_copy) | (oldbut->
flag & flag_copy);
1216 return found_active;
1228 bool activate =
false, found =
false, isactive =
false;
1244 if ((
activate ==
true) || (found ==
false)) {
1253 else if ((found ==
true) && (isactive ==
false)) {
1254 if (remove_on_failure) {
1314 if (but->
rnaprop ==
nullptr) {
1338 uint menu_key_mask = 0;
1339 int tot_missing = 0;
1346 for (
int pass = 0; pass < 2; pass++) {
1374 if (but.menu_key !=
'\0') {
1378 if (but.str.empty()) {
1382 const char *str_pt = but.str.c_str();
1385 menu_key = tolower(*str_pt);
1386 if ((menu_key >=
'a' && menu_key <=
'z') && !(menu_key_mask & 1 << (menu_key -
'a'))) {
1387 menu_key_mask |= 1 << (menu_key -
'a');
1393 while (isalpha(*str_pt)) {
1408 but.menu_key = menu_key;
1416 if (menu_key_mask == (1 << 26) - 1) {
1432 if (sep_index != std::string::npos) {
1433 but->
str = but->
str.substr(0, sep_index);
1439 if (shortcut_str ==
nullptr) {
1500 for (
int i = 0; i < 2; i++) {
1510 return std::nullopt;
1515 if (but->
optype !=
nullptr) {
1529 return std::nullopt;
1537 if (extra_icon_optype) {
1541 return std::nullopt;
1551 const char *ctx_toggle_opnames[] = {
1552 "WM_OT_context_toggle",
1553 "WM_OT_context_toggle_enum",
1554 "WM_OT_context_cycle_int",
1555 "WM_OT_context_cycle_enum",
1556 "WM_OT_context_cycle_array",
1557 "WM_OT_context_menu_enum",
1561 const char *ctx_enum_opnames[] = {
1562 "WM_OT_context_set_enum",
1566 const char *ctx_enum_opnames_for_Area_ui_type[] = {
1567 "SCREEN_OT_space_type_set_or_cycle",
1571 const char **opnames = ctx_toggle_opnames;
1572 int opnames_len =
ARRAY_SIZE(ctx_toggle_opnames);
1574 int prop_enum_value = -1;
1575 bool prop_enum_value_ok =
false;
1576 bool prop_enum_value_is_int =
false;
1577 const char *prop_enum_value_id =
"value";
1583 if ((but_parent && but_parent->
rnaprop) &&
1590 prop_enum_value = but->
retval;
1593 prop_enum_value_ok =
true;
1595 opnames = ctx_enum_opnames;
1602 if (prop ==
nullptr) {
1603 return std::nullopt;
1618 if (
STREQ(prop_id,
"ui_type")) {
1620 prop_enum_value >>= 16;
1624 if (prop_enum_value == -1) {
1627 prop_enum_value_ok = (prop_enum_value != -1);
1630 opnames = ctx_enum_opnames_for_Area_ui_type;
1631 opnames_len =
ARRAY_SIZE(ctx_enum_opnames_for_Area_ui_type);
1632 prop_enum_value_id =
"space_type";
1633 prop_enum_value_is_int =
true;
1646 C, ptr, prop, prop_index);
1649 data_path_variations.
append(data_path.value_or(
""));
1651 if (data_path.has_value()) {
1653 if (data_path_ref.
startswith(
"scene.tool_settings.")) {
1660 for (
int data_path_index = 0; data_path_index < data_path_variations.
size(); data_path_index++) {
1661 const StringRefNull data_path = data_path_variations[data_path_index];
1662 if (!data_path.
is_empty() || (prop_enum_value_ok && prop_enum_value_id)) {
1669 if (prop_enum_value_ok) {
1676 if (prop_enum_value_is_int) {
1695 for (
int i = 0; (i < opnames_len) && (opnames[i]); i++) {
1705 return std::nullopt;
1772 if (block->
name ==
"splash") {
1788 if (but.drawstr[0] ==
'\0') {
1859 extra_op_icon->icon = icon;
1861 extra_op_icon->optype_params->optype = optype;
1862 extra_op_icon->optype_params->opptr = MEM_new<PointerRNA>(
1864 extra_op_icon->optype_params->opcontext = opcontext;
1865 extra_op_icon->highlighted =
false;
1866 extra_op_icon->disabled =
false;
1870 return extra_op_icon->optype_params->opptr;
1878 MEM_delete(extra_icon);
1929 if (but->
rnaprop ==
nullptr) {
1944 if (but->
editstr !=
nullptr) {
1956 return type == RNA_Bone || type == RNA_EditBone || type == RNA_PoseBone;
1961 switch (but->
type) {
1999 switch (extra_icon) {
2002 if (!id_eyedropper_ot) {
2007 optype = id_eyedropper_ot;
2008 icon = ICON_EYEDROPPER;
2014 if (!id_eyedropper_ot) {
2019 optype = id_eyedropper_ot;
2020 icon = ICON_EYEDROPPER;
2031 icon = ICON_PANEL_CLOSE;
2071 for (std::unique_ptr<Button> &but : block->
buttons_ptrs) {
2076 if (but->tip_func) {
2121 old_but_flag = but->
flag;
2136 "Operator polls shouldn't change button flags");
2138 const_cast<Button *
>(but)->flag = old_but_flag;
2165 callback(*
C, *block);
2176 Depsgraph *depsgraph,
2180 bool postpone_callbacks)
2271 if (!block->
panel) {
2285 if (!postpone_callbacks) {
2310 postpone_callbacks);
2341 rcti rect_winspace = *rect;
2393 else if (block->
panel) {
2405 float subpanel_backcolor[4]{0.2f, 0.3f, 0.33f, 0.05f};
2454 GPU_scissor(scissor[0], scissor[1], scissor[2], scissor[3]);
2469 Button *but_prev =
nullptr;
2472 if (but.rnapoin.type && but.rnaprop) {
2474 if ((but_prev && (but_prev->
rnaprop == but.rnaprop) &&
2481 value.
owner = region;
2516 lvalue = int(*value);
2525 switch (but->
type) {
2538 if (*value !=
double(but->
hardmin)) {
2546 if (*value == 0.0) {
2571 if (
int(*value) &
int(but->
hardmax)) {
2576 if (*value ==
double(but->
hardmax)) {
2582 const auto *view_item_but =
static_cast<const ButtonViewItem *
>(but);
2585 if (view_item_but->view_item) {
2586 is_push = view_item_but->view_item->is_active();
2597 is_push = !bool(is_push);
2635 block->
lock =
false;
2665 const char *cp = but->
poin;
2666 vec[0] =
float(cp[0]) / 255.0f;
2667 vec[1] =
float(cp[1]) / 255.0f;
2668 vec[2] =
float(cp[2]) / 255.0f;
2671 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2675 if (but->
editvec ==
nullptr) {
2676 CLOG_WARN(&
LOG,
"%s: cannot get color, should never happen", __func__);
2701 char *cp = but->
poin;
2702 cp[0] = char(lround(vec[0] * 255.0f));
2703 cp[1] = char(lround(vec[1] * 255.0f));
2704 cp[2] = char(lround(vec[2] * 255.0f));
2707 float *fp =
reinterpret_cast<float *
>(but->
poin);
2729 const char *cp = but->
poin;
2730 vec[0] =
float(cp[0]) / 255.0f;
2731 vec[1] =
float(cp[1]) / 255.0f;
2732 vec[2] =
float(cp[2]) / 255.0f;
2733 vec[3] =
float(cp[3]) / 255.0f;
2736 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2740 if (but->
editvec ==
nullptr) {
2741 CLOG_WARN(&
LOG,
"%s: can't get color, should never happen", __func__);
2762 char *cp = but->
poin;
2763 cp[0] = char(lround(vec[0] * 255.0f));
2764 cp[1] = char(lround(vec[1] * 255.0f));
2765 cp[2] = char(lround(vec[2] * 255.0f));
2766 cp[3] = char(lround(vec[3] * 255.0f));
2769 float *fp =
reinterpret_cast<float *
>(but->
poin);
2946 value = *
static_cast<char *
>(but->
poin);
2949 value = *
reinterpret_cast<short *
>(but->
poin);
2952 value = *
reinterpret_cast<int *
>(but->
poin);
2955 value = *
reinterpret_cast<float *
>(but->
poin);
2995 int ivalue = int(value);
3028 float fval =
float(value);
3029 if (fval >= -0.00001f && fval <= 0.00001f) {
3038 value = *but->
editval = value;
3041 value = *(
static_cast<char *
>(but->
poin)) =
char(value);
3044 value = *(
reinterpret_cast<short *
>(but->
poin)) =
short(value);
3047 value = *(
reinterpret_cast<int *
>(but->
poin)) =
int(value);
3050 value = *(
reinterpret_cast<float *
>(but->
poin)) =
float(value);
3067 Button *return_but =
nullptr;
3072 if (but_iter.editstr) {
3073 return_but = &but_iter;
3109 MEM_delete(orig_str);
3120 int float_precision,
3130 if (float_precision == -1) {
3136 else if (precision == -1) {
3141 precision = float_precision;
3164 if (
step == -1.0f) {
3165 return step_default;
3177 if (
step == step_unit) {
3184 step_final *= step_orig;
3187 return float(step_final);
3221 const size_t str_maxncpy,
3222 const int float_precision,
3223 const bool use_exp_float,
3224 bool *r_use_exp_float)
3226 if (r_use_exp_float) {
3227 *r_use_exp_float =
false;
3234 const char *buf =
nullptr;
3270 if (buf ==
nullptr) {
3273 else if (buf !=
str) {
3313 int prec = float_precision;
3315 if (float_precision == -1) {
3336 if (use_exp_float) {
3337 if (int_digits_num < -6 || int_digits_num > 12) {
3339 if (r_use_exp_float) {
3340 *r_use_exp_float =
true;
3344 prec -= int_digits_num;
3350 prec -= int_digits_num;
3368 char *
str =
nullptr;
3382 const char *value_id;
3392 *r_str_size = strlen(value_id) + 1;
3414 if (
str ==
nullptr) [[unlikely]] {
3428#define UI_NUMBER_EVAL_ERROR_PREFIX RPT_("Error evaluating number, see Info editor for details")
3433 char *error =
nullptr;
3463 *r_value = atof(
str);
3471 const int len = strlen(
str);
3475 MEM_delete(str_new);
3490 const int len = strlen(
str);
3494 MEM_delete(str_new);
3502 if (
str[0] ==
'\0') {
3550 if (
str[0] ==
'\0') {
3573 else if (search_but && search_but->
item_active !=
nullptr) {
3643 else if (
str[0] ==
'#') {
3657 value =
floor(value + 0.5);
3661 if (value <
double(but->
hardmin)) {
3664 if (value >
double(but->
hardmax)) {
3679 const double newmax = (value != 0.0) ?
pow(10.0,
ceil(
log(value) /
M_LN10)) : 0.0;
3681 if (newmax * 0.2 >=
max && newmax * 0.2 >= value) {
3682 return newmax * 0.2;
3684 if (newmax * 0.5 >=
max && newmax * 0.5 >= value) {
3685 return newmax * 0.5;
3694 const double newmax = (value != 0.0) ?
pow(10.0,
floor(
log(value) /
M_LN10)) : 0.0;
3696 if (newmax * 5.0 <=
max && newmax * 5.0 <= value) {
3697 return newmax * 5.0;
3699 if (newmax * 2.0 <=
max && newmax * 2.0 <= value) {
3700 return newmax * 2.0;
3707 if (but->
rnaprop ==
nullptr) {
3738 double softmin, softmax;
3747 int imin, imax, istep;
3750 softmin = std::max(imin, INT_MIN);
3751 softmax = std::min(imax,
INT_MAX);
3758 value_min = double(value_range[0]);
3759 value_max = double(value_range[1]);
3767 float fmin, fmax, fstep, fprecision;
3770 softmin = (fmin == -
FLT_MAX) ?
float(-1e4) : fmin;
3771 softmax = (fmax ==
FLT_MAX) ?
float(1e4) : fmax;
3777 float value_range[2];
3779 value_min = double(value_range[0]);
3780 value_max = double(value_range[1]);
3791 if (value_min + 1
e-10 < softmin) {
3792 if (value_min < 0.0) {
3799 softmin = std::max(softmin,
double(but->
hardmin));
3801 if (value_max - 1
e-10 > softmax) {
3802 if (value_max < 0.0) {
3809 if (softmax >
double(but->
hardmax)) {
3819 if (isfinite(value)) {
3840 switch (but->
type) {
3861 MEM_delete(but->
opptr);
3949 MEM_delete(block->
unit);
3958 block->
saferct.free_no_destruct();
3990 for (
Block &block : *lb) {
3999 for (
Block &block : *lb) {
4008 for (
Block &block : *lb) {
4028 for (
Block &block : lb->items_mutable()) {
4029 if (!block.handle) {
4031 block.active =
false;
4053 Block *oldblock =
nullptr;
4061 oldblock->
active =
false;
4062 oldblock->
panel =
nullptr;
4063 oldblock->
handle =
nullptr;
4081 Block *block = MEM_new<Block>(__func__);
4096 memcpy(unit, &scene->
unit,
sizeof(scene->
unit));
4103 block->
name = std::move(name);
4188 but->
drawstr = fmt::format(
"{}{:.{}f}%", but->
str, value, prec);
4192 but->
drawstr = fmt::format(
"{}{:.{}f} px", but->
str, value, prec);
4198 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, precision);
4201 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value * 100, std::max(0, precision - 2));
4211 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
4222 but->
drawstr = but->
str + std::to_string(value);
4252 switch (but->
type) {
4258 if (value <
double(but->
hardmin)) {
4261 else if (value >
double(but->
hardmax)) {
4287 switch (but->
type) {
4330 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
4456 std::unique_ptr<Button> but{};
4460 but = std::make_unique<ButtonTextBox>();
4463 but = std::make_unique<ButtonText>();
4466 but = std::make_unique<ButtonNumber>();
4469 but = std::make_unique<ButtonNumberSlider>();
4472 but = std::make_unique<ButtonColor>();
4475 but = std::make_unique<ButtonDecorator>();
4478 but = std::make_unique<ButtonTab>();
4481 but = std::make_unique<ButtonSearch>();
4484 but = std::make_unique<ButtonProgress>();
4487 but = std::make_unique<ButtonSeparatorLine>();
4490 but = std::make_unique<ButtonHSVCube>();
4493 but = std::make_unique<ButtonColorBand>();
4496 but = std::make_unique<ButtonCurveMapping>();
4499 but = std::make_unique<ButtonCurveProfile>();
4502 but = std::make_unique<ButtonHotkeyEvent>();
4505 but = std::make_unique<ButtonViewItem>();
4508 but = std::make_unique<ButtonLabel>();
4511 but = std::make_unique<ButtonScrollBar>();
4514 but = std::make_unique<ButtonImage>();
4523 but = std::make_unique<ButtonMenu>();
4526 but = std::make_unique<ButtonPush>();
4529 but = std::make_unique<Button>();
4551 const std::optional<StringRef> tip)
4558 if (poin ==
nullptr) {
4580 but->
poin =
static_cast<char *
>(poin);
4583 but->
tip = tip.value_or(
"");
4609 if (but->
str[but->
str.size() - 1] !=
' ') {
4617 if (!but->
str.empty()) {
4635#ifdef USE_NUMBUTS_LR_ALIGN
4637 if (!but->
str.empty()) {
4645 if (block->
lock ==
true) {
4699 if (!but->
str.empty()) {
4706 but->
icon = ICON_NONE;
4736 bool has_item_with_icon =
false;
4745 const int max_rows = std::max(
int(vertical_space / row_height) - 1, 1);
4747 float text_width = 0.0f;
4750 float col_width = 0.0f;
4754 if (col_rows > 1 && (col_rows > max_rows || (!item->identifier[0] && item->name))) {
4756 text_width += col_width;
4760 if (!item->identifier[0] && item->name) {
4766 has_item_with_icon =
true;
4768 if (item->name && item->name[0]) {
4770 col_width = std::max(col_width, item_width + (100.0f *
UI_SCALE_FAC));
4772 rows = std::max(rows, col_rows);
4774 text_width += col_width;
4777 if (categories == 0) {
4781 columns = std::max((totitems + 20) / 20, 1);
4783 columns = (totitems + 25) / 25;
4787 if ((totitems / columns) > max_rows) {
4788 columns = std::max((totitems + col_rows) / max_rows, 1);
4790 rows = std::max(totitems / columns, 1);
4791 while (rows * columns < totitems) {
4821 const bool use_enum_copy_description =
free &&
4825 if (title && title[0] && (categories == 0) && (!but->
str[0] || !prior_label)) {
4828 block,
ButtonType::Label, title, 0, 0,
UI_UNIT_X * 5,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
4840 Layout *column =
nullptr;
4841 for (
int a = 0; a < totitems; a++) {
4842 new_column = (a == column_end);
4846 column_end = totitems;
4848 for (
int b = a + 1;
b < totitems;
b++) {
4852 if (((
b - a) % rows == 0) || (columns > 1 && !item->
identifier[0] && item->
name)) {
4858 column = &
split.column(
false);
4863 if (new_column && (categories > 0) && (columns > 1) && item->
identifier[0]) {
4864 column->
label(
"", ICON_NONE);
4869 if (item->
name || columns > 1) {
4873 else if (item->
name) {
4892 int icon = item->
icon;
4893 std::optional<StringRef> description_static;
4894 if (!use_enum_copy_description) {
4900 if (icon == ICON_NONE && has_item_with_icon) {
4915 description_static);
4928 description_static);
4930 if (item->
value == current_value) {
4936 if (use_enum_copy_description) {
4942 return static_cast<const char *
>(argN);
4954 MEM_delete(item_array);
4965 layout->
label(
RPT_(
"Missing Panel"), ICON_NONE);
4979 but->
funcN =
nullptr;
4995 const char *menu_type =
static_cast<const char *
>(but->
func_argN);
5003 layout->
label(msg, ICON_NONE);
5017 but->
funcN =
nullptr;
5041 std::optional<StringRef>
str,
5051 std::optional<StringRef> tip)
5084#ifdef WITH_INTERNATIONAL
5089 icon = item[i].
icon;
5122 float precision = -1.0f;
5124 int hardmin, hardmax, softmin, softmax, int_step;
5137 float hardmin, hardmax, softmin, softmax;
5154 Button *but =
def_but(block, type, *
str,
x,
y, width, height,
nullptr,
min,
max, tip);
5225 but->
poin =
reinterpret_cast<char *
>(but);
5233 std::optional<StringRef>
str,
5243 const std::optional<StringRef> tip)
5249 but =
def_but_rna(block, type,
str,
x,
y, width, height, ptr, prop,
index,
min,
max, tip);
5252 but =
def_but(block, type, propname,
x,
y, width, height,
nullptr,
min,
max, tip);
5269 std::optional<StringRef> tip)
5275 Button *but =
def_but(block, type,
str,
x,
y, width, height,
nullptr, 0, 0, tip);
5306 const std::optional<StringRef> tip)
5308 Button *but =
def_but(block, but_and_ptr_type,
str,
x,
y, width, height, poin,
min,
max, tip);
5318 Button *but =
def_but(block,
ButtonType::Image,
"",
x,
y, width, height,
imbuf, 0, 0,
"");
5385 char *truncate = autocpl->
truncate;
5386 const char *startname = autocpl->
startname;
5387 const int len_max = int(autocpl->
maxncpy) - 1;
5388 int match_index = 0;
5389 for (
int a = 0; a < len_max; a++) {
5391 const char c = (a < name.
size()) ? name[a] :
'\0';
5392 if (startname[a] == 0 || startname[a] != c) {
5399 if (startname[match_index] == 0) {
5402 if (truncate[0] == 0) {
5407 for (
int a = 0; a < len_max; a++) {
5408 if (a == name.
size()) {
5412 if (truncate[a] != name[a]) {
5439 MEM_delete(autocpl);
5449#define PREVIEW_TILE_PAD (0.225f * UI_UNIT_X)
5472#undef PREVIEW_TILE_PAD
5491 const std::optional<StringRef>
str,
5501 const std::optional<StringRef> tip)
5504 block, type,
str,
x,
y, width, height, ptr, propname,
index,
min,
max, tip);
5510 const std::optional<StringRef>
str,
5520 const std::optional<StringRef> tip)
5523 block, type,
str,
x,
y, width, height, ptr, prop,
index,
min,
max, tip);
5537 const std::optional<StringRef> tip)
5547 std::optional<StringRef>
str,
5552 const std::optional<StringRef> tip)
5555 if (!
str && ot ==
nullptr) {
5571 const std::optional<StringRef> tip)
5573 Button *but =
def_but(block, but_and_ptr_type,
"",
x,
y, width, height, poin,
min,
max, tip);
5587 const std::optional<StringRef> tip)
5589 Button *but =
def_but(block, type,
"",
x,
y, width, height, poin,
min,
max, tip);
5613 const std::optional<StringRef> tip)
5616 block, type,
"",
x,
y, width, height, ptr, propname,
index,
min,
max, tip);
5632 const std::optional<StringRef> tip)
5634 Button *but =
def_but_rna(block, type,
"",
x,
y, width, height, ptr, prop,
index,
min,
max, tip);
5648 const std::optional<StringRef> tip)
5663 const std::optional<StringRef> tip)
5678 const std::optional<StringRef> tip)
5680 Button *but =
def_but(block, but_and_ptr_type,
str,
x,
y, width, height, poin, 0.0f, 0.0f, tip);
5688 const std::optional<StringRefNull>
str,
5696 const std::optional<StringRef> tip)
5699 block, type,
str,
x,
y, width, height, ptr, propname,
index, 0.0f, 0.0f, tip);
5707 const std::optional<StringRef>
str,
5717 const std::optional<StringRef> tip)
5720 block, type,
str,
x,
y, width, height, ptr, prop,
index,
min,
max, tip);
5735 const std::optional<StringRef> tip)
5752 const std::optional<StringRef> tip)
5755 if (
str.is_empty()) {
5758 return uiDefIconTextButO_ptr(block, type, ot, opcontext, icon,
str,
x,
y, width, height, tip);
5771 MEM_delete(but->
opptr);
5772 but->
opptr =
nullptr;
5775 but->
opptr = MEM_new<PointerRNA>(__func__, *opptr);
5794 for (
Block &block : *lb) {
5795 if (&block == lb->first_ || block.
rect.
ymin <
min) {
5810 block->
flag |= flag;
5815 block->
flag &= ~flag;
5830 return (but->
flag & flag) != 0;
5895 if (!placeholder && but->
rnaprop) {
5992 const int ownUnit = int(but->
unit_type);
5998 if ((ownUnit != 0) || (but->
rnaprop ==
nullptr)) {
5999 return ownUnit << 16;
6028 block->
funcN = funcN;
6047 but->
poin =
reinterpret_cast<char *
>(poin);
6060 auto *text_button =
static_cast<ButtonText *
>(but);
6061 text_button->
rename_func = std::move(rename_func);
6065 std::function<
void(
StringRefNull new_name)> rename_full_fun)
6068 auto *text_button =
static_cast<ButtonText *
>(but);
6173 const std::optional<StringRef> tip)
6175 Button *but =
def_but(block,
ButtonType::Block,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6189 const std::optional<StringRef> tip,
6194 block,
ButtonType::Block,
str,
x,
y, width, height,
nullptr, 0.0, 0.0, tip);
6214 const std::optional<StringRef> tip)
6216 Button *but =
def_but(block,
ButtonType::Pulldown,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6231 const std::optional<StringRef> tip)
6233 Button *but =
def_but(block,
ButtonType::Pulldown,
str,
x,
y, width, height, arg, 0.0, 0.0, tip);
6254 const std::optional<StringRef> tip)
6256 Button *but =
def_but(block,
ButtonType::Pulldown,
"",
x,
y, width, height, arg, 0.0, 0.0, tip);
6275 const std::optional<StringRef> tip)
6277 Button *but =
def_but(block,
ButtonType::Block,
"",
x,
y, width, height, arg, 0.0, 0.0, tip);
6303 const std::optional<StringRef> tip)
6306 block,
ButtonType::SearchMenu,
"",
x,
y, width, height, arg, 0.0, maxncpy, tip);
6321 const bool free_arg,
6332 if (search_create_fn ==
nullptr) {
6340 if (free_arg && !search_arg_free_fn) {
6343 search_but->
arg = std::shared_ptr<void>(
6345 search_arg_free_fn ?
6346 search_arg_free_fn :
6349 if (search_exec_fn) {
6353 printf(
"%s: warning, overwriting button callback with search function callback!\n",
6427 if (prop ==
nullptr) {
6428 printf(
"%s: %s has no enum property set\n", __func__, ot->
idname);
6431 printf(
"%s: %s \"%s\" is not an enum property\n",
6443 const_cast<bContext *
>(
C), ptr, prop, &all_items,
nullptr, &do_free);
6448 search.
add(item->name, item);
6461 MEM_delete(all_items);
6481 printf(
"%s: op->prop for '%s' is nullptr\n", __func__, ot->
idname);
6496 const std::optional<StringRef> tip)
6627 const std::optional<int> draw_width,
6628 const std::optional<int> draw_height)
6632 but_view_item->
draw_width = draw_width.value_or(0);
6633 but_view_item->
draw_height = draw_height.value_or(0);
6644 event.customdata = but;
6645 event.customdata_free =
false;
6692 if (!ptr || !prop) {
6693 return std::nullopt;
6698 return std::nullopt;
6735 if (!but.
str.empty()) {
6736 size_t str_len = but.
str.size();
6739 if (sep_index != std::string::npos) {
6740 str_len = sep_index;
6743 return but.
str.substr(0, str_len);
6752 const auto &view_item_but =
static_cast<const ButtonViewItem &
>(but);
6753 if (view_item_but.view_item ==
nullptr) {
6756 const AbstractView &tree_view = view_item_but.view_item->get_view();
6781 return CTX_TIP_(mt->translation_context, mt->label);
6789 return CTX_TIP_(pt->translation_context, pt->label);
6841 if (mt->rna_ext.srna) {
6915 uiStyle *style =
U.uistyles.first();
6952 const char *expr_imports[] = {
"bpy",
nullptr};
6964 expr,
"bpy.types.WM_OT_url_open_preset.lookup_url_from_type('%s')", item.
identifier);
6965 char *expr_result =
nullptr;
6969 MEM_delete(expr_result);
#define BLF_DRAW_STR_DUMMY_MAX
#define BLI_SCOPED_DEFER(function_to_defer)
#define SNPRINTF_UTF8(dst, format,...)
#define STRNCPY_UTF8(dst, src)
#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)
#define CLOG_WARN(clg_ref,...)
#define ID_CHECK_UNDO(id)
These structs are the foundation for all linked lists in the library system.
Object is a sort of wrapper for general info.
#define OB_DATA_SUPPORT_ID(_id_type)
Read Blender memory allocation and freeing.
#define RNA_SUBTYPE_UNIT_VALUE(subtype)
#define RNA_SUBTYPE_UNIT(subtype)
#define AUTOCOMPLETE_FULL_MATCH
#define AUTOCOMPLETE_PARTIAL_MATCH
#define AUTOCOMPLETE_NO_MATCH
#define UI_PANEL_MARGIN_X
#define UI_PRECISION_FLOAT_MAX
#define UI_PRECISION_FLOAT_SCALE
#define UI_FLOAT_VALUE_DISPLAY_MAX
#define button_is_decorator(but)
#define UI_FLOAT_VALUE_DISPLAY_MIN
int pad[32 - sizeof(int)]
#define BLI_assert_unreachable()
#define POINTER_FROM_INT(i)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
#define BLI_assert_msg(a, msg)
void activate(bool forceActivation=false) const
void reserve(const int64_t n)
bool contains(const Key &key) const
constexpr const char * c_str() const
constexpr StringRef drop_known_prefix(StringRef prefix) const
constexpr bool startswith(StringRef prefix) const
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr const char * data() const
void copy_utf8_truncated(char *dst, int64_t dst_size) 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
std::string get_context_menu_title() const
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
float3x3 scale(float3x3 mat, float2 scale)
#define UI_GET_BUT_VALUE_INIT(_but, _value)
#define UI_NUMBER_EVAL_ERROR_PREFIX
#define UI_POPUP_MENU_TOP
#define UI_BITBUT_TEST(a, b)
#define UI_MENU_SCROLL_MOUSE
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
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.
void free(Subdiv *subdiv)
std::string ptr_type(const ResourceString &str)
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
void get_color_4ubv(int colorid, unsigned char col[4])
const bTheme * theme_get()
void button_execute_begin(bContext *, ARegion *region, Button *but, void **active_back)
void interface_tag_script_reload()
static std::optional< std::string > but_event_operator_string(const bContext *C, Button *but)
void butstore_clear(Block *block)
bool button_context_poll_operator_ex(bContext *C, const Button *but, const wmOperatorCallParams *optype_params)
void button_search_preview_grid_size_set(Button *but, int rows, int cols)
Button * uiDefIconTextBut(Block *block, ButtonTypeWithPointerType but_and_ptr_type, int icon, StringRef str, int x, int y, short width, short height, void *poin, std::optional< StringRef > tip)
void icon_text_overlay_init_from_count(IconTextOverlay *text_overlay, const int icon_indicator_number)
void block_lock_set(Block *block, bool val, const char *lockstr)
void item_menutype_func(bContext *C, Layout *layout, void *arg_mt)
static bool but_icon_extra_is_visible_search_eyedropper(Button *but)
static double soft_range_round_up(double value, double max)
Button * uiDefSearchButO_ptr(Block *block, wmOperatorType *ot, IDProperty *properties, void *arg, int icon, int maxncpy, int x, int y, short width, short height, std::optional< StringRef > tip)
std::string button_extra_icon_string_get_tooltip(bContext &C, const ButtonExtraOpIcon &extra_icon)
void button_anim_decorate_update_from_flag(ButtonDecorator *but)
static std::optional< std::string > but_event_operator_string_from_panel(const bContext *C, Button *but)
void block_direction_set(Block *block, char direction)
void butstore_update(Block *block)
void button_update_view_for_active(const bContext *C, const Block *block)
void blocklist_free(const bContext *C, ARegion *region)
std::string button_string_get_tooltip(bContext &C, Button &but)
int button_unit_type_get(const Button *but)
void button_search_refresh(ButtonSearch *but)
int button_string_get_maxncpy(Button *but)
ImBuf * icon_alert_imbuf_get(AlertIcon icon, float size)
static int but_calc_float_precision(Button *but, double value)
static float but_get_float_step_size(Button *but)
void button_execute_end(bContext *C, ARegion *, Button *but, void *active_back)
void(*)(bContext *C, Layout *layout, void *arg1) MenuCreateFunc
Button * uiDefButR(Block *block, ButtonType type, std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, StringRefNull propname, int index, float min, float max, std::optional< StringRef > tip)
static void operator_enum_search_update_fn(const bContext *C, void *but, const char *str, SearchItems *items, const bool)
Button * uiDefIconButR(Block *block, ButtonType type, int icon, int x, int y, short width, short height, PointerRNA *ptr, StringRefNull propname, int index, float min, float max, std::optional< StringRef > tip)
static void but_predefined_extra_operator_icons_add(Button *but)
Button * uiDefIconTextButR(Block *block, ButtonType type, int icon, std::optional< StringRefNull > str, int x, int y, short width, short height, PointerRNA *ptr, StringRefNull propname, int index, std::optional< StringRef > tip)
void button_menu_disable_hover_open(Button *but)
void button_func_search_set_results_are_suggestions(Button *but, bool value)
void button_extra_operator_icons_free(Button *but)
bool button_supports_cycling(const Button *but)
static void but_submenu_enable(Block *block, Button *but)
void button_active_free(const bContext *C, Button *but)
void button_v4_set(Button *but, const float vec[4])
void button_anim_flag(Button *but, const AnimationEvalContext *anim_eval_context)
wmOperatorType * button_extra_operator_icon_optype_get(const ButtonExtraOpIcon *extra_icon)
void button_group_replace_but_ptr(Block *block, const Button *old_but_ptr, Button *new_but)
static bool number_from_string_factor(bContext *C, const char *str, double *r_value)
static void but_update_ex(Button *but, const bool validate)
void block_to_region_rctf(const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
void button_string_get(Button *but, char *str, const size_t str_maxncpy)
void(*)(bContext *C, void *argN, void *arg2) ButtonHandleNFunc
void button_dragflag_disable(Button *but, int flag)
void button_label_draw_icon_border_set(Button *but, bool use_icon_border)
void(*)(bContext *C, void *arg1, void *arg2) ButtonHandleFunc
void block_set_search_only(Block *block, bool search_only)
bool button_menu_draw_as_popover(const Button *but)
void def_but_icon_clear(Button *but)
void block_to_window(const ARegion *region, const Block *block, int *x, int *y)
bool button_rna_equals(const Button *a, const Button *b)
void button_func_menu_step_set(Button *but, MenuStepFunc func)
void button_func_set(Button *but, std::function< void(bContext &)> func)
void button_v4_get(Button *but, float vec[4])
static void def_but_rna__menu_type(bContext *, Layout *layout, void *but_p)
void widgetbase_draw_cache_begin()
int button_is_pushed_ex(Button *but, double *value)
void window_to_block_rctf(const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
void block_views_listen(const Block *block, const wmRegionListenerParams *listener_params)
const ColorManagedDisplay * block_cm_display_get(Block *block)
bool panel_should_show_background(const ARegion *region, const PanelType *panel_type)
bool button_menu_step_poll(const Button *but)
const char * button_placeholder_get(Button *but)
void button_value_set(Button *but, double value)
void button_range_set_hard(Button *but)
void blocklist_update_window_matrix(const bContext *C, const ListBaseT< ui::Block > *lb)
int calc_float_precision(int prec, double value)
void button_func_search_set_sep_string(Button *but, const char *search_sep_string)
const uiStyle * style_get()
static std::string textbox_string_get(ButtonTextBox *textbox)
void block_translate(Block *block, float x, float y)
void block_bounds_set_normal(Block *block, int addval)
const char radial_dir_to_numpad[8]
int blocklist_min_y_get(ListBaseT< ui::Block > *lb)
static bool button_edit_string_include_unit_suffix(const Button *button)
std::string button_string_get_rna_label(Button &but)
void button_retval_set(Button *but, int retval)
void button_unit_type_set(Button *but, int unit_type)
Button * uiDefIconTextButO_ptr(Block *block, ButtonType type, wmOperatorType *ot, wm::OpCallContext opcontext, int icon, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
std::string button_context_menu_title_from_button(Button &but)
void draw_aligned_panel(const ARegion *region, const uiStyle *style, const Block *block, const rcti *rect, bool show_pin, bool show_background, bool region_search_filter_active)
static void but_build_drawstr_float(Button *but, double value)
void button_context_ptr_set(Block *block, Button *but, StringRef name, const PointerRNA *ptr)
void button_semi_modal_state_free(const bContext *C, Button *but)
void block_lock_clear(Block *block)
std::string button_string_get_rna_label_context(const Button &but)
static bool but_icon_extra_is_visible_bone_eyedropper(Button *but)
void update_text_styles()
void button_update_edited(Button *but)
bool button_is_float(const Button *but)
void button_icon_indicator_color_set(Button *but, const uchar color[4])
void button_activate_event(bContext *C, ARegion *region, Button *but)
static void but_free_type_specific(Button *but)
static float get_but_step_unit(Button *but, float step_default)
void layout_remove_but(Layout *layout, const Button *but)
static std::optional< std::string > but_event_property_operator_string(const bContext *C, Button *but)
void text_button_func_rename_full_set(Button *but, std::function< void(StringRefNull new_name)> rename_full_func)
Button * button_find_old(Block *block_old, const Button *but_new)
void layout_add_but(Layout *layout, Button *but)
static void block_message_subscribe(ARegion *region, wmMsgBus *mbus, Block *block)
int preview_tile_size_y_no_label(const int size_px=96)
void block_update_from_old(const bContext *C, Block *block)
void block_cm_to_display_space_v3(Block *block, float pixel[3])
static bool but_icon_extra_is_visible_text_clear(const Button *but)
void button_poin_menu_argN_set(Button *but, void *poin, void *argN, ButtonArgNFree func_argN_free_fn, ButtonArgNCopy func_argN_copy_fn)
void window_to_block(const ARegion *region, const Block *block, int *x, int *y)
std::string button_string_get_rna_property_identifier(const Button &but)
void button_operator_set_never_call(Button *but)
void block_views_draw_overlays(const ARegion *region, const Block *block)
PointerRNA * button_operator_ptr_ensure(Button *but)
void block_align_begin(Block *block)
PredefinedExtraOpIconType
@ PREDEFINED_EXTRA_OP_ICON_CLEAR
@ PREDEFINED_EXTRA_OP_ICON_EYEDROPPER
@ PREDEFINED_EXTRA_OP_ICON_BONE_EYEDROPPER
@ PREDEFINED_EXTRA_OP_ICON_NONE
static void block_bounds_calc_popup(wmWindow *window, Block *block, BlockBoundsCalc bounds_calc, const int xy[2], int r_xy[2])
void(*)(void *arg) FreeArgFunc
void block_to_region_fl(const ARegion *region, const Block *block, float *x, float *y)
bool button_is_compatible(const Button *but_a, const Button *but_b)
void button_number_step_size_set(Button *but, float step_size)
bool button_anim_expression_create(Button *but, const char *str)
void window_to_region_rctf(const ARegion *region, rctf *rect_dst, const rctf *rct_src)
float block_to_window_scale(const ARegion *region, const Block *block)
void text_button_func_rename_set(Button *but, std::function< void(bContext &C, StringRefNull oldname)> rename_func)
void block_free(const bContext *C, Block *block)
void block_post_layout_callbacks_exec(const bContext *C, ARegion *region, Block *block)
void block_to_window_fl(const ARegion *region, const Block *block, float *x, float *y)
void fontstyle_set(const uiFontStyle *fs)
void autocomplete_update_name(AutoComplete *autocpl, StringRef name)
wmOperatorType * button_operatortype_get_from_enum_menu(Button *but, PropertyRNA **r_prop)
void button_func_pushed_state_set(Button *but, std::function< bool(const Button &)> func)
bool butstore_register_update(Block *block, Button *but_dst, const Button *but_src)
@ BLOCK_CONTAINS_SUBMENU_BUT
void button_color_set(Button *but, const uchar color[4])
static PredefinedExtraOpIconType but_icon_extra_get(Button *but)
void block_views_end(ARegion *region, const Block *block)
void draw_popover_back(ARegion *region, uiStyle *style, Block *block, const rcti *rect)
static PointerRNA * but_extra_operator_icon_add_ptr(Button *but, wmOperatorType *optype, wm::OpCallContext opcontext, int icon)
Button * uiDefIconPreviewBut(Block *block, ButtonType type, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< StringRef > tip)
std::optional< EnumPropertyItem > button_rna_enum_item_get(bContext &C, Button &but)
void block_end_ex(const bContext *C, Main *bmain, wmWindow *window, Scene *scene, ARegion *region, Depsgraph *depsgraph, Block *block, const int xy[2]=nullptr, int r_xy[2]=nullptr, bool postpone_callbacks=false)
static void get_but_string_unit(Button *but, char *str, int str_maxncpy, double value, bool pad, int float_precision, bool do_suffix)
Button * region_find_active_but(ARegion *region) ATTR_WARN_UNUSED_RESULT
void button_icon_scale_set(Button *but, float scale)
void block_flag_enable(Block *block, int flag)
static void def_but_rna__menu(bContext *C, Layout *layout, void *but_p)
void button_enum_prop_value_set(Button *but, int retval)
static void menu_block_set_keymaps(const bContext *C, Block *block)
PropertyScaleType button_scale_type(const Button *but)
static Button * def_but_rna_propname(Block *block, ButtonType type, 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 block_listen(const Block *block, const wmRegionListenerParams *listener_params)
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) ButtonSearchTooltipFn
void blocklist_draw(const bContext *C, const ListBaseT< ui::Block > *lb)
std::string button_string_get_tooltip_label(const Button &but)
const ColorManagedDisplay * button_cm_display_get(Button &but)
static void but_update_old_active_from_new(Button *oldbut, Button *but)
static void block_bounds_calc_centered_pie(Block *block)
static void button_validate(const Button *but)
void fontscale(float *points, float aspect)
void(*)(bContext *C, ARegion *butregion, Button *but) ButtonHandleHoldFunc
static Button * def_but(Block *block, ButtonTypeWithPointerType but_and_ptr_type, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const std::optional< StringRef > tip)
static bool but_icon_extra_is_visible_search_unlink(const Button *but)
rcti rect_to_pixelrect(const ARegion *region, const Block *block, const rctf *src_rect)
static void but_extra_operator_icon_free(ButtonExtraOpIcon *extra_icon)
void button_focus_on_enter_event(wmWindow *win, Button *but)
Button * uiDefIconButO(Block *block, ButtonType type, StringRefNull opname, wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< StringRef > tip)
Button * uiDefBlockBut(Block *block, BlockCreateFunc func, void *arg, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
const uiStyle * style_get_dpi()
PanelType * button_paneltype_get(const Button *but)
bool(*)(bContext *C, int direction, void *arg1) MenuStepFunc
static std::optional< std::string > but_extra_icon_event_operator_string(const bContext *C, const ButtonExtraOpIcon *extra_icon)
void widgetbase_draw_cache_end()
void button_label_alpha_factor_set(Button *but, float alpha_factor)
Button * button_drag_multi_edit_get(Button *but)
Button * uiDefIconButR_prop(Block *block, ButtonType type, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< StringRef > tip)
void interface_tag_script_reload_queries()
void button_range_set_soft(Button *but)
void button_func_quick_tooltip_set(Button *but, std::function< std::string(const Button *but)> func)
static double soft_range_round_down(double value, double max)
void block_bounds_set_explicit(Block *block, int minx, int miny, int maxx, int maxy)
@ BLOCK_NO_ACCELERATOR_KEYS
@ BLOCK_SHOW_SHORTCUT_ALWAYS
bool but_is_utf8(const Button *but)
static void block_bounds_calc_text(Block *block, float offset)
void button_func_tooltip_custom_set(Button *but, ButtonToolTipCustomFunc func, void *arg, FreeArgFunc free_arg)
void draw_menu_back(uiStyle *style, Block *block, const rcti *rect)
bool button_anim_expression_set(Button *but, const char *str)
void button_drawflag_enable(Button *but, int flag)
EmbossType block_emboss_get(Block *block)
bool view_item_matches(const AbstractViewItem &a, const AbstractViewItem &b)
bool button_is_bool(const Button *but)
void block_bounds_set_text(Block *block, int addval)
bool block_active_only_flagged_buttons(const bContext *C, ARegion *region, Block *block)
void region_to_window(const ARegion *region, int *x, int *y)
bool button_anim_expression_get(Button *but, char *str, size_t str_maxncpy)
bool butstore_is_registered(Block *block, Button *but)
void block_align_calc(Block *block, const ARegion *region)
Button * uiDefIconTextMenuBut(Block *block, MenuCreateFunc func, void *arg, int icon, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
static void but_update_select_flag(Button *but, double *value)
void button_number_precision_set(Button *but, float precision)
void view_item_swap_button_pointers(AbstractViewItem &a, AbstractViewItem &b)
static void update_flexible_spacing(const ARegion *region, Block *block)
void button_hint_drawstr_set(Button *but, const char *string)
std::optional< StringRefNull > button_context_string_get(const Button *but, StringRef name)
static bool but_equals_old(const Button *but, const Button *oldbut)
std::string button_string_get_label(Button &but)
void button_disable(Button *but, const char *disabled_hint)
void button_func_tooltip_set(Button *but, ButtonToolTipFunc func, void *arg, FreeArgFunc free_arg)
bool button_flag_is_set(Button *but, int64_t flag)
void button_flag_enable(Button *but, int64_t flag)
static Button * def_but_operator_ptr(Block *block, ButtonType type, wmOperatorType *ot, wm::OpCallContext opcontext, const StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
void button_string_get_ex(Button *but, char *str, const size_t str_maxncpy, const int float_precision, const bool use_exp_float, bool *r_use_exp_float)
static std::unique_ptr< Button > but_new(const ButtonType type)
Block * block_begin(const bContext *C, ARegion *region, std::string name, EmbossType emboss)
void(*)(bContext *C, void *arg, int event) BlockHandleFunc
void button_rna_menu_convert_to_menu_type(Button *but, const char *menu_type)
Button * uiDefBut(Block *block, ButtonTypeWithPointerType but_and_ptr_type, StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< StringRef > tip)
Button * uiDefButO(Block *block, ButtonType type, StringRefNull opname, wm::OpCallContext opcontext, const std::optional< StringRef > str, int x, int y, short width, short height, std::optional< StringRef > tip)
int(*)(bContext *C, char *str, void *arg) ButtonCompleteFunc
bool button_string_eval_number(bContext *C, const Button *but, const char *str, double *r_value)
static void update_window_matrix(const wmWindow *window, const ARegion *region, Block *block)
ARegion *(*)(bContext *C, ARegion *butregion, ButtonSearch *search_but) ButtonSearchCreateFn
static void operator_enum_search_exec_fn(bContext *, void *but, void *arg2)
bool editsource_enable_check()
void button_v3_get(Button *but, float vec[3])
void block_to_window_rctf(const ARegion *region, const Block *block, rctf *rct_dst, const rctf *rct_src)
Block *(*)(bContext *C, ARegion *region, void *arg1) BlockCreateFunc
std::optional< int64_t > button_context_int_get(const Button *but, StringRef name)
void *(*)(const void *argN) ButtonArgNCopy
bool block_is_popover(const Block *block) ATTR_WARN_UNUSED_RESULT
std::string button_string_get_rna_struct_identifier(const Button &but)
Button * uiDefSearchBut(Block *block, void *arg, int icon, int maxncpy, int x, int y, short width, short height, std::optional< StringRef > tip)
static bool but_is_row_alignment_group(const Button *left, const Button *right)
void button_placeholder_set(Button *but, StringRef placeholder_text)
static bool but_is_unit_radians_ex(const UnitSettings *unit, const int unit_type)
Button * uiDefButR_prop(Block *block, ButtonType type, 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 window_to_region(const ARegion *region, int *x, int *y)
void button_number_slider_precision_set(Button *but, float precision)
bool panel_category_tabs_is_visible(const ARegion *region)
void block_theme_style_set(Block *block, char theme_style)
void blocklist_free_inactive(const bContext *C, ARegion *region)
void button_to_pixelrect(rcti *rect, const ARegion *region, const Block *block, const Button *but)
void button_context_int_set(Block *block, Button *but, StringRef name, int64_t value)
bool button_active_only_ex(const bContext *C, ARegion *region, Block *block, Button *but, bool remove_on_failure)
void button_node_link_set(Button *but, bNodeSocket *socket, const float draw_color[4])
bool block_is_search_only(const Block *block)
std::string button_string_get_operator_keymap(bContext &C, Button &but)
void block_align_end(Block *block)
static std::optional< std::string > but_event_operator_string_from_operator(const bContext *C, wmOperatorCallParams *op_call_params)
bool button_rna_equals_ex(const Button *but, const PointerRNA *ptr, const PropertyRNA *prop, int index)
Button * uiDefButAlert(Block *block, AlertIcon icon, int x, int y, short width, short height)
bool button_active_only(const bContext *C, ARegion *region, Block *block, Button *but)
Button * uiDefMenuBut(Block *block, MenuCreateFunc func, void *arg, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
void button_funcN_set(Button *but, ButtonHandleNFunc funcN, void *argN, void *arg2, ButtonArgNFree func_argN_free_fn=MEM_delete_void, ButtonArgNCopy func_argN_copy_fn=MEM_dupalloc_void)
Button * button_find_new(Block *block_new, const Button *but_old)
static bool number_from_string_units_with_but(bContext *C, const char *str, const Button *but, double *r_value)
void button_tooltip_refresh(bContext *C, Button *but)
Button * uiDefIconTextButO(Block *block, ButtonType type, StringRefNull, wm::OpCallContext opcontext, int icon, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
double button_value_get(Button *but)
bool search_item_add(SearchItems *items, StringRef name, void *poin, int iconid, int64_t but_flag, uint8_t name_prefix_offset)
PointerRNA * button_extra_operator_icon_opptr_get(const ButtonExtraOpIcon *extra_icon)
float view2d_scale_get_x(const View2D *v2d)
static void but_build_drawstr_int(Button *but, int value)
static void block_free_active_operator(Block *block)
void block_emboss_set(Block *block, EmbossType emboss)
static std::optional< std::string > but_event_operator_string_from_menu(const bContext *C, Button *but)
void block_func_set(Block *block, ButtonHandleFunc func, void *arg1, void *arg2)
static bool number_from_string(bContext *C, const char *str, double *r_value)
void region_winrct_get_no_margin(const ARegion *region, rcti *r_rect)
void draw_pie_center(Block *block)
std::string button_extra_icon_string_get_label(const ButtonExtraOpIcon &extra_icon)
bool button_string_set(bContext *C, Button *but, const char *str)
Button * uiDefIconTextButR_prop(Block *block, ButtonType type, int icon, 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 item_paneltype_func(bContext *C, Layout *layout, void *arg_pt)
bool button_is_editable(const Button *but) ATTR_WARN_UNUSED_RESULT
void block_flag_disable(Block *block, int flag)
Button * uiDefIconMenuBut(Block *block, MenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, std::optional< StringRef > tip)
void block_draw(const bContext *C, Block *block)
std::string button_string_get_rna_tooltip(bContext &C, Button &but)
void button_flag_disable(Button *but, int64_t flag)
static void block_bounds_calc_centered(wmWindow *window, Block *block)
static void but_update_and_icon_set(Button *but, int icon)
void block_end(const bContext *C, Block *block, bool postpone_callbacks=false)
void window_to_region_rcti(const ARegion *region, rcti *rect_dst, const rcti *rct_src)
int2 block_layout_resolve(Block *block)
Button * uiDefButO_ptr(Block *block, ButtonType type, wmOperatorType *ot, wm::OpCallContext opcontext, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip)
void button_icon_indicator_number_set(Button *but, const int indicator_number)
void editsource_active_but_test(Button *but)
static void def_but_rna__panel_type(bContext *, Layout *layout, void *arg)
void button_convert_to_unit_alt_name(Button *but, char *str, size_t str_maxncpy)
std::string button_extra_icon_string_get_operator_keymap(const bContext &C, const ButtonExtraOpIcon &extra_icon)
void block_func_handle_set(Block *block, BlockHandleFunc func, void *arg)
const char radial_dir_order[8]
void def_but_icon(Button *but, const int icon, const int64_t flag)
char * button_string_get_dynamic(Button *but, int *r_str_size)
static bool but_is_unit_radians(const Button *but)
void block_bounds_set_popup(Block *block, int addval, const int bounds_offset[2])
bool button_opens_link(const Button *button)
void button_operator_set(Button *but, wmOperatorType *optype, wm::OpCallContext opcontext, const PointerRNA *opptr=nullptr)
void block_set_active_operator(Block *block, wmOperator *op, const bool free)
void button_drawflag_disable(Button *but, int flag)
ARegion * searchbox_create_generic(bContext *C, ARegion *butregion, ButtonSearch *search_but)
static bool but_is_rna_undo(const Button *but)
bool button_is_color_gamma(Button &but)
std::string button_string_get_property_keymap(bContext &C, Button &but)
Button * uiDefIconBut(Block *block, ButtonTypeWithPointerType but_and_ptr_type, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< StringRef > tip)
static std::optional< int64_t > but_find_old_idx(Block *block_old, const Button *but_new, const Set< const Button * > &ignore_old_buttons={})
void block_region_set(Block *block, ARegion *region)
const bContextStore * button_context_get(const Button *but)
void button_icon_indicator_set(Button *but, const char *string)
void block_bounds_set_menu(Block *block, int addval, const int bounds_offset[2])
int button_text_padding(const Button *button)
void button_number_slider_step_size_set(Button *but, float step_size)
void button_override_flag(Main *bmain, Button *but)
void * button_func_argN_get(const Button *but)
static bool but_update_from_old_block(Block *block, Set< const Button * > &matched_old_buttons, std::unique_ptr< Button > *but_uptr, std::optional< int64_t > *but_old_idx)
static void menu_block_set_keyaccels(Block *block)
static ButtonExtraOpIcon * but_extra_icon_find_old(const ButtonExtraOpIcon *new_extra_icon, const Button *old_but)
void but_handle_data_free(HandleButtonData **data)
void button_v3_set(Button *but, const float vec[3])
static void block_bounds_calc_post_centered(Block *block)
int preview_tile_size_y(const int size_px=96)
PointerRNA * button_extra_operator_icon_add(Button *but, StringRefNull opname, wm::OpCallContext opcontext, int icon)
void(*)(bContext &C, TooltipData &data, Button *but, void *argN) ButtonToolTipCustomFunc
MenuType * button_menutype_get(const Button *but)
void window_to_block_fl(const ARegion *region, const Block *block, float *x, float *y)
static bool but_hide_fraction(Button *but, double value)
void region_message_subscribe(ARegion *region, wmMsgBus *mbus)
bool button_can_align(const Button *but)
@ BLOCK_BOUNDS_PIE_CENTER
@ BLOCK_BOUNDS_POPUP_MOUSE
@ BLOCK_BOUNDS_POPUP_CENTER
@ BLOCK_BOUNDS_POPUP_MENU
static bool number_from_string_percentage(bContext *C, const char *str, double *r_value)
void(*)(const bContext *C, void *arg, const char *str, SearchItems *items, bool is_first) ButtonSearchUpdateFn
void draw_layout_panels_backdrop(const ARegion *region, const Panel *panel, const float radius, float subpanel_backcolor[4])
Button * uiDefBlockButN(Block *block, BlockCreateFunc func, void *argN, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip, ButtonArgNFree func_argN_free_fn=MEM_delete_void, ButtonArgNCopy func_argN_copy_fn=MEM_dupalloc_void)
bool button_context_poll_operator(bContext *C, wmOperatorType *ot, const Button *but)
int button_is_pushed(Button *but)
Button * uiDefButV(Block *block, ButtonType type, StringRef str, int x, int y, short width, short height, T *poin, float min, float max, std::optional< StringRef > tip)
void button_func_complete_set(Button *but, ButtonCompleteFunc func, void *arg)
static void but_extra_icons_update_from_old_but(const Button *new_but, const Button *old_but)
std::string(*)(bContext *C, void *argN, StringRef tip) ButtonToolTipFunc
void block_add_dynamic_listener(Block *block, void(*listener_func)(const wmRegionListenerParams *params))
int button_return_value_get(Button *but)
Button * uiDefIconBlockBut(Block *block, BlockCreateFunc func, void *arg, int icon, int x, int y, short width, short height, std::optional< StringRef > tip)
void button_dragflag_enable(Button *but, int flag)
void block_layout_set_current(Block *block, Layout *layout)
void button_clipboard_free()
void button_func_hold_set(Button *but, ButtonHandleHoldFunc func, void *argN)
AutoComplete * autocomplete_begin(const char *startname, size_t maxncpy)
bool button_is_editing(const Button *but)
std::string button_get_link(const Button *button, bContext *C)
void block_bounds_calc(Block *block)
const short radial_dir_to_angle[8]
static std::string but_pie_direction_string(const Button *but)
void blocklist_update_view_for_buttons(const bContext *C, const ListBaseT< ui::Block > *lb)
void(*)(void *argN) ButtonArgNFree
const PointerRNA * button_context_ptr_get(const Button *but, StringRef name, const StructRNA *type=nullptr)
void button_rna_menu_convert_to_panel_type(Button *but, const char *panel_type)
Button * uiDefIconButO_ptr(Block *block, ButtonType type, wmOperatorType *ot, wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< StringRef > tip)
void block_bounds_set_centered(Block *block, int addval)
void icon_ensure_deferred(const bContext *C, int icon_id, bool big)
static double get_but_scale_unit(Button *but, double value)
void button_update(Button *but)
void button_func_search_set_context_menu(Button *but, ButtonSearchContextMenuFn context_menu_fn)
static bool number_from_string_units(bContext *C, const char *str, const int unit_type, const UnitSettings *unit, double *r_value)
bool(*)(bContext *C, void *arg, void *active, const wmEvent *event) ButtonSearchContextMenuFn
void button_view_item_draw_size_set(Button *but, const std::optional< int > draw_width=std::nullopt, const std::optional< int > draw_height=std::nullopt)
void button_func_search_set(Button *but, ButtonSearchCreateFn search_create_fn, ButtonSearchUpdateFn search_update_fn, void *arg, bool free_arg, FreeArgFunc search_arg_free_fn, ButtonHandleFunc search_exec_fn, void *active)
void button_func_search_set_tooltip(Button *but, ButtonSearchTooltipFn tooltip_fn)
void button_add_shortcut(Button *but, const char *shortcut_str, const bool do_strip)
const Button * block_active_default_button_find(const Block *block)
void block_funcN_set(Block *block, ButtonHandleNFunc funcN, void *argN, void *arg2, ButtonArgNFree func_argN_free_fn=MEM_delete_void, ButtonArgNCopy func_argN_copy_fn=MEM_dupalloc_void)
static bool but_pixelrect_in_view(const ARegion *region, const rcti *rect)
void button_drag_free(Button *but)
static bool but_extra_icons_equals_old(const ButtonExtraOpIcon *new_extra_icon, const ButtonExtraOpIcon *old_extra_icon)
static Button * def_but_rna(Block *block, ButtonType type, 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 block_free_views(Block *block)
bool but_is_tool(const Button *but)
void(*)(const wmRegionListenerParams *params, void *arg) ButtonSearchListenFn
static void but_free(const bContext *C, Button *but)
bool button_is_rna_valid(Button *but)
void button_pushbutton_draw_as_overlay_set(Button *but, bool value)
void button_func_search_set_listen(Button *but, ButtonSearchListenFn listen_fn)
void button_execute(const bContext *C, ARegion *region, Button *but)
static float but_get_float_precision(Button *but)
int autocomplete_end(AutoComplete *autocpl, char *autoname)
int preview_tile_size_x(const int size_px=96)
Button * uiDefButImage(Block *block, void *imbuf, int x, int y, short width, short height, const uchar color[4])
void button_type_set_menu_from_pulldown(Button *but)
void button_func_drawextra_set(Block *block, std::function< void(const bContext *C, rcti *rect)> func)
static Button * but_find_old(Block *block_old, const Button *but_new, const Set< const Button * > &ignore_old_buttons)
void draw_button(const bContext *C, ARegion *region, uiStyle *style, Button *but, rcti *rect)
bool button_is_unit(const Button *but)
MINLINE float min_ff(float a, float b)
MINLINE unsigned char round_db_to_uchar_clamp(double a)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void wmOrtho2_region_pixelspace(const ARegion *region)
double BKE_unit_value_scale(const UnitSettings &settings, int unit_type, double value)
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
std::optional< std::string > WM_context_path_resolve_property_full(const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2])
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
const EnumPropertyItem rna_enum_id_type_items[]
void RNA_property_float_get_array_at_most(PointerRNA *ptr, PropertyRNA *prop, float *values, int values_num)
const PointerRNA * CTX_store_ptr_lookup(const bContextStore *store, StringRef name, const StructRNA *type=nullptr)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
MINLINE void copy_v3_v3(float r[3], const float a[3])
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bool BPY_run_string_as_number(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, double *r_value) ATTR_NONNULL(1
MINLINE int round_fl_to_int(float a)
void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
int WM_window_native_pixel_y(const wmWindow *win)
void WM_operator_properties_free(PointerRNA *ptr)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void GPU_matrix_identity_set()
const char * RNA_property_identifier(const PropertyRNA *prop)
MINLINE int round_db_to_int_clamp(double a)
bool RNA_property_editable_info(const PointerRNA *ptr, PropertyRNA *prop, const char **r_info)
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_name)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void BLF_batch_draw_begin()
@ PROP_UNIT_TIME_ABSOLUTE
MenuType * WM_menutype_find(const StringRef idname, bool quiet)
bContextStore * CTX_store_add(Vector< std::unique_ptr< bContextStore > > &contexts, StringRef name, const PointerRNA *ptr)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
PointerRNA WM_operator_properties_create_ptr(wmOperatorType *ot)
short RNA_type_to_ID_code(const StructRNA *type)
int bool bool bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t str_len) ATTR_NONNULL(1
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value)
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
wmWindow * CTX_wm_window(const bContext *C)
char * RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
const char * RNA_property_translation_context(const PropertyRNA *prop)
std::optional< std::string > WM_key_event_operator_string(const bContext *C, const char *opname, wm::OpCallContext opcontext, IDProperty *properties, const bool is_strict)
const char * RNA_struct_ui_name(const StructRNA *type)
int WM_window_native_pixel_x(const wmWindow *win)
void BLI_rcti_rctf_copy_round(struct rcti *dst, const struct rctf *src)
PropertyScaleType RNA_property_ui_scale(PropertyRNA *prop)
bool BLI_rcti_clamp(struct rcti *rect, const struct rcti *rect_bounds, int r_xy[2])
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
void MEM_delete_void(void *vmemh)
AnimationEvalContext BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
const char * WM_key_event_string(const short type, const bool compact)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
const bContextStore * CTX_store_get(const bContext *C)
MINLINE void zero_v4(float r[4])
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
MINLINE int integer_digits_f(float f)
PropertyType RNA_property_type(PropertyRNA *prop)
bool RNA_property_undo_check(const PropertyRNA *prop, const StructRNA *type)
void BLF_size(int fontid, float size)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void * MEM_dupalloc_void(const void *vmemh) ATTR_WARN_UNUSED_RESULT
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
bool user_string_to_number(bContext *C, const char *str, const UnitSettings &unit, int type, double *r_value, double *r_value_no_units, bool use_single_line_error, char **r_error)
std::optional< int64_t > CTX_store_int_lookup(const bContextStore *store, StringRef name)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
float BKE_scene_frame_get(const Scene *scene)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
void GPU_scissor_get(int coords[4])
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
wmWindowManager * CTX_wm_manager(const bContext *C)
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
int BLF_default_weight(int fontid) ATTR_WARN_UNUSED_RESULT
void BLI_rcti_translate(struct rcti *rect, int x, int y)
int RNA_property_flag(PropertyRNA *prop)
bool RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void BLI_rctf_init_minmax(struct rctf *rect)
@ USER_FACTOR_AS_PERCENTAGE
bool RNA_property_is_idprop(const PropertyRNA *prop)
bool RNA_property_enum_item_from_value_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, wm::OpCallContext context)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
void RNA_property_float_set_array_at_most(PointerRNA *ptr, PropertyRNA *prop, const float *values, int values_num)
eRNAOverrideStatus RNA_property_override_library_status(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const int index)
size_t BKE_unit_value_as_string(char *str, int str_maxncpy, double value, int prec, int type, const UnitSettings &settings, bool pad, bool do_unit_suffix)
bool BLF_has_variable_weight(int fontid) ATTR_WARN_UNUSED_RESULT
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void zero_v3(float r[3])
void BLF_batch_draw_end()
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
double BKE_unit_closest_scalar(double value, int system, int type)
bool RNA_property_enum_item_from_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
bool RNA_struct_is_ID(const StructRNA *type)
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
std::optional< std::string > WM_keymap_item_to_string(const wmKeyMapItem *kmi, const bool compact)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
wmEvent * WM_event_add(wmWindow *win, const wmEvent *event_to_add)
MINLINE float normalize_v3(float n[3])
PropertySubType RNA_property_subtype(PropertyRNA *prop)
const char * RNA_struct_ui_description(const StructRNA *type)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void GPU_scissor(int x, int y, int width, int height)
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], const ColorManagedDisplay *display, ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
MINLINE void zero_v2_int(int r[2])
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Main * CTX_data_main(const bContext *C)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void GPU_matrix_pop_projection()
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void IDP_FreeProperty(IDProperty *prop)
int2 WM_window_native_pixel_size(const wmWindow *win)
const char * RNA_property_ui_description(const PropertyRNA *prop, const PointerRNA *ptr)
MINLINE float max_ff(float a, float b)
const char * IMB_colormanagement_display_get_default_name()
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
ID_Type GS(const char *name)
ARegion * CTX_wm_region_popup(const bContext *C)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
std::optional< StringRefNull > CTX_store_string_lookup(const bContextStore *store, StringRef name)
void BLI_rctf_translate(struct rctf *rect, float x, float y)
void BKE_unit_name_to_alt(char *str, int str_maxncpy, const char *orig_str, int system, int type)
void wmGetProjectionMatrix(float mat[4][4], const rcti *winrct)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
Scene * CTX_data_scene(const bContext *C)
const ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
IDProperty * IDP_NewStringMaxSize(const char *st, size_t st_maxncpy, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
int RNA_property_ui_icon(const PropertyRNA *prop)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE short round_db_to_short_clamp(double a)
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
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)
void GPU_blend(GPUBlend blend)
@ RGN_FLAG_SEARCH_FILTER_ACTIVE
std::string RNA_string_get(PointerRNA *ptr, const char *name)
void ED_region_do_msg_notify_tag_redraw(bContext *C, wmMsgSubscribeKey *msg_key, wmMsgSubscribeValue *msg_val)
std::string WM_operatortype_description(bContext *C, wmOperatorType *ot, PointerRNA *properties)
const float(* GPU_matrix_projection_get(float m[4][4]))[4]
void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value)
void CTX_store_set(bContext *C, const bContextStore *store)
ReportList * CTX_wm_reports(const bContext *C)
int RNA_property_string_maxlength(PropertyRNA *prop)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
void GPU_matrix_push_projection()
bool BKE_unit_is_adaptive(const UnitSettings &settings, int type)
ARegion * CTX_wm_region(const bContext *C)
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
const char * RNA_property_ui_name(const PropertyRNA *prop, const PointerRNA *ptr)
MINLINE void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
const char * RNA_struct_translation_context(const StructRNA *type)
ocio::Display ColorManagedDisplay
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
bool bool bool bool BPY_run_string_as_string(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value) ATTR_NONNULL(1
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src)
void * RNA_property_py_data_get(PropertyRNA *prop)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
uiWidgetColors wcol_menu_back
bke::ARegionRuntime * runtime
const char * report_prefix
char idname[BKE_ST_MAXNAME]
struct Panel_Runtime * runtime
bool has_owner_id() const
ColorManagedDisplaySettings display_settings
Vector< std::function< void(const bContext &C, ui::Block &Block)> > post_block_layout_fns
ListBaseT< ui::Block > uiblocks
Map< std::string, ui::Block * > block_name_map
void(*) listener_func(const wmRegionListenerParams *params)
std::function< void(const bContext *, rcti *)> drawextra
Button * last_but() const
bool post_block_layout_fns_pending
int but_index(const Button *but) const
ListBaseT< LayoutRoot > layouts
Vector< std::unique_ptr< bContextStore > > contexts
ListBaseT< SafetyRect > saferct
ListBaseT< ButStore > butstore
Vector< std::unique_ptr< Button > > buttons_ptrs
BlockBoundsCalc bounds_type
Button * first_but() const
Button * prev_but(const Button *but) const
std::ranges::transform_view< std::ranges::ref_view< const Vector< std::unique_ptr< Button > > >, Button &(*)(const std::unique_ptr< Button > &)> buttons() const
BlockHandleFunc handle_func
const UnitSettings * unit
Button * next_but(const Button *but) const
ListBaseT< BlockDynamicListener > dynamic_listeners
std::unique_ptr< PieMenuData > pie_data
ButtonArgNFree func_argN_free_fn
PopupBlockHandle * handle
void remove_but(const Button *but)
ButtonArgNCopy func_argN_copy_fn
ColorPickerData color_pickers
std::unique_ptr< TextWrapCache > placeholder_wrap_cache
std::unique_ptr< TextWrapCache > wrap_cache
std::function< void(StringRefNull new_name)> rename_full_func
std::string rename_full_new
std::function< void(bContext &, StringRefNull)> rename_func
ListBaseT< ColorPicker > list
void label(StringRef name, int icon)
Layout & split(float percentage, bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
PopupBlockCreate popup_create_vars
wm::OpCallContext opcontext
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
bke::WindowRuntime * runtime