16#include <fmt/format.h>
83#define UI_BUT_VALUE_UNSET DBL_MAX
84#define UI_GET_BUT_VALUE_INIT(_but, _value) \
85 if (_value == DBL_MAX) { \
86 (_value) = ui_but_value_get(_but); \
129 *x =
float(getsizex) *
130 (0.5f + 0.5f * (gx * block->
winmat[0][0] + gy * block->
winmat[1][0] + block->
winmat[3][0]));
131 *y =
float(getsizey) *
132 (0.5f + 0.5f * (gx * block->
winmat[0][1] + gy * block->
winmat[1][1] + block->
winmat[3][1]));
138 *x += region->winrct.xmin;
139 *y += region->winrct.ymin;
149 *x =
int(lround(fx));
150 *y =
int(lround(fy));
176 float min_y = 0, max_y = 1;
177 float dummy_x = 0.0f;
181 return max_y - min_y;
188 const int sx = region->winrct.xmin;
189 const int sy = region->winrct.ymin;
191 const float a = 0.5f *
float(getsizex) * block->
winmat[0][0];
192 const float b = 0.5f *
float(getsizex) * block->
winmat[1][0];
193 const float c = 0.5f *
float(getsizex) * (1.0f + block->
winmat[3][0]);
195 const float d = 0.5f *
float(getsizey) * block->
winmat[0][1];
196 const float e = 0.5f *
float(getsizey) * block->
winmat[1][1];
197 const float f = 0.5f *
float(getsizey) * (1.0f + block->
winmat[3][1]);
199 const float px = *x - sx;
200 const float py = *y - sy;
202 *y = (a * (py - f) + d * (c - px)) / (a *
e - d *
b);
203 *x = (px -
b * (*y) - c) / a;
228 *x =
int(lround(fx));
229 *y =
int(lround(fy));
234 *x -= region->winrct.xmin;
235 *y -= region->winrct.ymin;
240 rect_dst->
xmin = rct_src->
xmin - region->winrct.xmin;
241 rect_dst->
xmax = rct_src->
xmax - region->winrct.xmin;
242 rect_dst->
ymin = rct_src->
ymin - region->winrct.ymin;
243 rect_dst->
ymax = rct_src->
ymax - region->winrct.ymin;
248 rect_dst->
xmin = rct_src->
xmin - region->winrct.xmin;
249 rect_dst->
xmax = rct_src->
xmax - region->winrct.xmin;
250 rect_dst->
ymin = rct_src->
ymin - region->winrct.ymin;
251 rect_dst->
ymax = rct_src->
ymax - region->winrct.ymin;
256 *x += region->winrct.xmin;
257 *y += region->winrct.ymin;
262 int sepr_flex_len = 0;
269 if (sepr_flex_len == 0) {
278 if (region_width <= buttons_width) {
292 const float segment_width = region_width /
float(sepr_flex_len);
293 float offset = 0, remaining_space = region_width - buttons_width;
299 int overlap = ((i == sepr_flex_len - 1) ? buttons_width - spacers_pos[i] :
300 (spacers_pos[i + 1] - spacers_pos[i]) / 2);
301 const int segment_end = segment_width * (i + 1);
302 const int spacer_end = segment_end - overlap;
303 const int spacer_sta = spacers_pos[i] + offset;
304 if (spacer_end > spacer_sta) {
305 const float step =
min_ff(remaining_space, spacer_end - spacer_sta);
306 remaining_space -= step;
318 if (region && region->visible) {
327 const rcti winrct = {0, win_size[0] - 1, 0, win_size[1] - 1};
342 *r_rect = region->winrct;
359 const bool is_same_align_group = (left->alignnr && (left->alignnr == right->alignnr));
360 return is_same_align_group && (left->rect.xmin < right->rect.xmin);
367 int i = 0, j, x1addval = offset;
386 const int alignnr = bt->alignnr;
387 for (col_bt = bt; col_bt && col_bt->
alignnr == alignnr; col_bt = col_bt->
next) {
397 bt = col_bt ? col_bt->
prev :
nullptr;
400 if (bt && bt->next && bt->rect.xmin < bt->next->rect.xmin) {
402 for (col_bt = init_col_bt; col_bt->
prev != bt; col_bt = col_bt->
next) {
410 x1addval += i + block->
bounds;
412 init_col_bt = col_bt;
417 for (col_bt = init_col_bt; col_bt; col_bt = col_bt->
next) {
420 const int alignnr = col_bt->
alignnr;
421 for (; col_bt && col_bt->
alignnr == alignnr; col_bt = col_bt->
next) {
485 const int startx = (win_size[0] * 0.5f) - (width * 0.5f);
486 const int starty = (win_size[1] * 0.5f) - (height * 0.5f);
510 const int oldbounds = block->
bounds;
530 block->
bounds = oldbounds;
538 oldwidth = oldwidth > 0 ? oldwidth : std::max(1, width);
539 oldheight = oldheight > 0 ? oldheight : std::max(1, height);
553 rect_bounds.
xmin = margin;
554 rect_bounds.
ymin = margin;
555 rect_bounds.
xmax = win_size[0] - margin;
576 if (block ==
nullptr) {
594 if (bounds_offset !=
nullptr) {
608 if (bounds_offset !=
nullptr) {
658 if (
floor(value) == value) {
661 if (
floorf(step) == step) {
691 else if (prec == -1) {
692 prec = (but->
hardmax < 10.001f) ? 3 : 2;
818 (new_extra_icon->
icon == old_extra_icon->
icon);
822 const uiBut *old_but)
840 if (old_extra_icon) {
841 new_extra_icon->highlighted = old_extra_icon->
highlighted;
875 if (oldbut->
poin != (
char *)oldbut) {
886 oldbut->
flag = (oldbut->
flag & ~flag_copy) | (but->
flag & flag_copy);
895 std::swap(search_oldbut->
arg_free_fn, search_but->arg_free_fn);
896 std::swap(search_oldbut->
arg, search_but->arg);
905 switch (oldbut->
type) {
944 std::swap(but->
str, oldbut->
str);
950 std::swap(but->
imb, oldbut->
imb);
983 (*but_old_p) = oldbut ? oldbut->
next :
nullptr;
986 bool found_active =
false;
998 oldbut->
block = block;
1010 found_active =
true;
1021 but->
flag = (but->
flag & ~flag_copy) | (oldbut->
flag & flag_copy);
1029 return found_active;
1035 bool activate =
false, found =
false, isactive =
false;
1051 if ((
activate ==
true) || (found ==
false)) {
1060 else if ((found ==
true) && (isactive ==
false)) {
1061 if (remove_on_failure) {
1088 but->flag &= ~UI_BUT_ACTIVATE_ON_INIT;
1102 but->flag &= ~UI_BUT_ACTIVATE_ON_INIT;
1121 if (but->
rnaprop ==
nullptr) {
1138 uint menu_key_mask = 0;
1139 int tot_missing = 0;
1146 for (
int pass = 0; pass < 2; pass++) {
1151 if (!
ELEM(but->type,
1164 if (but->menu_key !=
'\0') {
1168 if (but->str.empty()) {
1172 const char *str_pt = but->str.c_str();
1175 menu_key = tolower(*str_pt);
1176 if ((menu_key >=
'a' && menu_key <=
'z') && !(menu_key_mask & 1 << (menu_key -
'a'))) {
1177 menu_key_mask |= 1 << (menu_key -
'a');
1183 while (isalpha(*str_pt)) {
1198 but->menu_key = menu_key;
1206 if (menu_key_mask == (1 << 26) - 1) {
1222 if (sep_index != std::string::npos) {
1223 but->
str = but->
str.substr(0, sep_index);
1225 but->
flag &= ~UI_BUT_HAS_SEP_CHAR;
1229 if (shortcut_str ==
nullptr) {
1283 IDProperty *prop_panel = bke::idprop::create_group(__func__).release();
1289 for (
int i = 0; i < 2; i++) {
1299 return std::nullopt;
1304 if (but->
optype !=
nullptr) {
1318 return std::nullopt;
1326 if (extra_icon_optype) {
1330 return std::nullopt;
1341 const char *ctx_toggle_opnames[] = {
1342 "WM_OT_context_toggle",
1343 "WM_OT_context_toggle_enum",
1344 "WM_OT_context_cycle_int",
1345 "WM_OT_context_cycle_enum",
1346 "WM_OT_context_cycle_array",
1347 "WM_OT_context_menu_enum",
1351 const char *ctx_enum_opnames[] = {
1352 "WM_OT_context_set_enum",
1356 const char *ctx_enum_opnames_for_Area_ui_type[] = {
1357 "SCREEN_OT_space_type_set_or_cycle",
1361 const char **opnames = ctx_toggle_opnames;
1362 int opnames_len =
ARRAY_SIZE(ctx_toggle_opnames);
1364 int prop_enum_value = -1;
1365 bool prop_enum_value_ok =
false;
1366 bool prop_enum_value_is_int =
false;
1367 const char *prop_enum_value_id =
"value";
1373 if ((but_parent && but_parent->
rnaprop) &&
1383 prop_enum_value_ok =
true;
1385 opnames = ctx_enum_opnames;
1392 if (prop ==
nullptr) {
1393 return std::nullopt;
1408 if (
STREQ(prop_id,
"ui_type")) {
1410 prop_enum_value >>= 16;
1414 opnames = ctx_enum_opnames_for_Area_ui_type;
1415 opnames_len =
ARRAY_SIZE(ctx_enum_opnames_for_Area_ui_type);
1416 prop_enum_value_id =
"space_type";
1417 prop_enum_value_is_int =
true;
1430 C,
ptr, prop, prop_index);
1433 data_path_variations.
append(data_path.value_or(
""));
1435 if (data_path.has_value()) {
1437 if (data_path_ref.
startswith(
"scene.tool_settings.")) {
1444 for (
int data_path_index = 0; data_path_index < data_path_variations.
size(); data_path_index++) {
1445 const StringRefNull data_path = data_path_variations[data_path_index];
1446 if (!data_path.
is_empty() || (prop_enum_value_ok && prop_enum_value_id)) {
1451 IDP_AddToGroup(prop_path, bke::idprop::create(
"data_path", data_path).release());
1453 if (prop_enum_value_ok) {
1460 if (prop_enum_value_is_int) {
1461 const int value = item[index].
value;
1462 prop_value = bke::idprop::create(prop_enum_value_id, value).release();
1465 prop_value = bke::idprop::create(prop_enum_value_id, item[index].identifier).release();
1479 for (
int i = 0; (i < opnames_len) && (opnames[i]); i++) {
1489 return std::nullopt;
1552 if (block->
name ==
"splash") {
1568 if (but->drawstr[0] ==
'\0') {
1602 but->
flag &= ~UI_BUT_OVERRIDDEN;
1632 extra_op_icon->
icon = icon;
1633 extra_op_icon->
optype_params = MEM_cnew<wmOperatorCallParams>(__func__);
1696 return ((but->
editstr ==
nullptr) && (but->
drawstr[0] !=
'\0') &&
1704 if (but->
rnaprop ==
nullptr) {
1719 if (but->
editstr !=
nullptr) {
1731 return type == &RNA_Bone || type == &RNA_EditBone;
1736 switch (but->
type) {
1774 switch (extra_icon) {
1777 if (!id_eyedropper_ot) {
1782 optype = id_eyedropper_ot;
1783 icon = ICON_EYEDROPPER;
1789 if (!id_eyedropper_ot) {
1794 optype = id_eyedropper_ot;
1795 icon = ICON_EYEDROPPER;
1806 icon = ICON_PANEL_CLOSE;
1816 if ((op_icon->optype_params->optype == optype) && (op_icon->icon == icon)) {
1845 if (but->tip_func) {
1882 int old_but_flag = 0;
1885 old_but_flag = but->
flag;
1901 "Operator polls shouldn't change button flags");
1903 const_cast<uiBut *
>(but)->
flag = old_but_flag;
1918 params.opcontext = opcontext;
1954 op_icon->disabled =
true;
1959 depsgraph, (scene) ? scene->r.cfra : 0.0f);
2012 if (!block->
panel) {
2059 rcti rect_winspace = *rect;
2108 else if (block->
panel) {
2120 float subpanel_backcolor[4]{0.2f, 0.3f, 0.33f, 0.05f};
2161 uiBut *but_prev =
nullptr;
2164 if (but->rnapoin.type && but->rnaprop) {
2166 if ((but_prev && (but_prev->
rnaprop == but->rnaprop) &&
2173 value.
owner = region;
2174 value.user_data = region;
2204 lvalue =
int(*value);
2213 switch (but->
type) {
2226 if (*value !=
double(but->
hardmin)) {
2234 if (*value == 0.0) {
2259 if (
int(*value) &
int(but->
hardmax)) {
2264 if (*value ==
double(but->
hardmax)) {
2285 is_push = !bool(is_push);
2302 but->
flag &= ~UI_SELECT;
2319 block->
lock =
false;
2346 for (
int a = 0; a < tot; a++) {
2353 const char *cp = but->
poin;
2354 vec[0] =
float(cp[0]) / 255.0f;
2355 vec[1] =
float(cp[1]) / 255.0f;
2356 vec[2] =
float(cp[2]) / 255.0f;
2359 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2363 if (but->
editvec ==
nullptr) {
2364 fprintf(stderr,
"%s: can't get color, should never happen\n", __func__);
2392 for (
int a = 0; a < tot; a++) {
2399 char *cp = but->
poin;
2400 cp[0] = char(lround(vec[0] * 255.0f));
2401 cp[1] = char(lround(vec[1] * 255.0f));
2402 cp[2] = char(lround(vec[2] * 255.0f));
2405 float *fp =
reinterpret_cast<float *
>(but->
poin);
2429 for (
int a = 0; a < tot; a++) {
2436 const char *cp = but->
poin;
2437 vec[0] =
float(cp[0]) / 255.0f;
2438 vec[1] =
float(cp[1]) / 255.0f;
2439 vec[2] =
float(cp[2]) / 255.0f;
2440 vec[3] =
float(cp[3]) / 255.0f;
2443 const float *fp =
reinterpret_cast<float *
>(but->
poin);
2447 if (but->
editvec ==
nullptr) {
2448 fprintf(stderr,
"%s: can't get color, should never happen\n", __func__);
2472 for (
int a = 0; a < tot; a++) {
2479 char *cp = but->
poin;
2480 cp[0] = char(lround(vec[0] * 255.0f));
2481 cp[1] = char(lround(vec[1] * 255.0f));
2482 cp[2] = char(lround(vec[2] * 255.0f));
2483 cp[3] = char(lround(vec[3] * 255.0f));
2486 float *fp =
reinterpret_cast<float *
>(but->
poin);
2663 value = *(
char *)but->
poin;
2666 value = *(
short *)but->
poin;
2669 value = *(
int *)but->
poin;
2672 value = *(
float *)but->
poin;
2712 int ivalue =
int(value);
2745 float fval =
float(value);
2746 if (fval >= -0.00001f && fval <= 0.00001f) {
2755 value = *but->
editval = value;
2758 value = *((
char *)but->
poin) = char(value);
2761 value = *((
short *)but->
poin) = short(value);
2764 value = *((
int *)but->
poin) =
int(value);
2767 value = *((
float *)but->
poin) =
float(value);
2784 uiBut *return_but =
nullptr;
2789 if (but_iter->editstr) {
2790 return_but = but_iter;
2833 uiBut *but,
char *
str,
int str_maxncpy,
double value,
bool pad,
int float_precision)
2842 if (float_precision == -1) {
2848 else if (precision == -1) {
2853 precision = float_precision;
2875 if (step == -1.0f) {
2876 return step_default;
2888 if (step == step_unit) {
2895 step_final *= step_orig;
2898 return float(step_final);
2903 const size_t str_maxncpy,
2904 const int float_precision,
2905 const bool use_exp_float,
2906 bool *r_use_exp_float)
2908 if (r_use_exp_float) {
2909 *r_use_exp_float =
false;
2916 const char *buf =
nullptr;
2951 if (buf ==
nullptr) {
2954 else if (buf !=
str) {
2984 int prec = float_precision;
2986 if (float_precision == -1) {
3001 BLI_snprintf(
str, str_maxncpy,
"%.*f", std::max(0, prec - 2), value * 100);
3006 if (use_exp_float) {
3007 if (int_digits_num < -6 || int_digits_num > 12) {
3009 if (r_use_exp_float) {
3010 *r_use_exp_float =
true;
3014 prec -= int_digits_num;
3020 prec -= int_digits_num;
3038 char *
str =
nullptr;
3052 const char *value_id;
3062 *r_str_size = strlen(value_id) + 1;
3093#define UI_NUMBER_EVAL_ERROR_PREFIX RPT_("Error evaluating number, see Info editor for details")
3098 char *
error =
nullptr;
3128 *r_value = atof(
str);
3136 const int len = strlen(
str);
3155 const int len = strlen(
str);
3167 if (
str[0] ==
'\0') {
3211 if (
str[0] ==
'\0') {
3233 else if (search_but && search_but->
item_active !=
nullptr) {
3296 else if (
str[0] ==
'#') {
3310 value =
floor(value + 0.5);
3314 if (value <
double(but->
hardmin)) {
3317 if (value >
double(but->
hardmax)) {
3332 const double newmax = (value != 0.0) ?
pow(10.0,
ceil(
log(value) /
M_LN10)) : 0.0;
3334 if (newmax * 0.2 >= max && newmax * 0.2 >= value) {
3335 return newmax * 0.2;
3337 if (newmax * 0.5 >= max && newmax * 0.5 >= value) {
3338 return newmax * 0.5;
3347 const double newmax = (value != 0.0) ?
pow(10.0,
floor(
log(value) /
M_LN10)) : 0.0;
3349 if (newmax * 5.0 <= max && newmax * 5.0 <= value) {
3350 return newmax * 5.0;
3352 if (newmax * 2.0 <= max && newmax * 2.0 <= value) {
3353 return newmax * 2.0;
3360 if (but->
rnaprop ==
nullptr) {
3391 double softmin, softmax;
3400 int imin, imax, istep;
3403 softmin = (imin == INT_MIN) ? -1e4 : imin;
3404 softmax = (imin == INT_MAX) ? 1e4 : imax;
3411 value_min =
double(value_range[0]);
3412 value_max =
double(value_range[1]);
3420 float fmin, fmax, fstep, fprecision;
3423 softmin = (fmin == -
FLT_MAX) ?
float(-1e4) : fmin;
3424 softmax = (fmax ==
FLT_MAX) ?
float(1e4) : fmax;
3430 float value_range[2];
3432 value_min =
double(value_range[0]);
3433 value_max =
double(value_range[1]);
3444 if (value_min + 1
e-10 < softmin) {
3445 if (value_min < 0.0) {
3452 if (softmin <
double(but->
hardmin)) {
3456 if (value_max - 1
e-10 > softmax) {
3457 if (value_max < 0.0) {
3464 if (softmax >
double(but->
hardmax)) {
3474 if (isfinite(value)) {
3491 switch (but->
type) {
3498 search_but->
arg =
nullptr;
3513 switch (but->
type) {
3515 MEM_delete(
reinterpret_cast<const uiButNumber *
>(but));
3521 MEM_delete(
reinterpret_cast<const uiButColor *
>(but));
3527 MEM_delete(
reinterpret_cast<const uiButTab *
>(but));
3530 MEM_delete(
reinterpret_cast<const uiButSearch *
>(but));
3539 MEM_delete(
reinterpret_cast<const uiButHSVCube *
>(but));
3557 MEM_delete(
reinterpret_cast<const uiButLabel *
>(but));
3564 "Derived button type needs type specific deletion");
3575 MEM_delete(but->
opptr);
3686 listener->listener_func(listener_params);
3698 if (block->active) {
3707 if (block->active) {
3716 if (block->active) {
3728 if (region->runtime.block_name_map !=
nullptr) {
3729 BLI_ghash_free(region->runtime.block_name_map,
nullptr,
nullptr);
3730 region->runtime.block_name_map =
nullptr;
3739 if (!block->handle) {
3740 if (block->active) {
3741 block->active =
false;
3744 if (region->runtime.block_name_map !=
nullptr) {
3748 BLI_ghash_remove(region->runtime.block_name_map,
b->name.c_str(),
nullptr,
nullptr);
3766 if (region->runtime.block_name_map ==
nullptr) {
3772 oldblock->
active =
false;
3773 oldblock->
panel =
nullptr;
3774 oldblock->
handle =
nullptr;
3780 const_cast<char *
>(block->
name.c_str()),
3794 uiBlock *block = MEM_new<uiBlock>(__func__);
3797 block->
evil_C = (
void *)C;
3809 memcpy(unit, &scene->unit,
sizeof(scene->unit));
3816 block->
name = std::move(name);
3826 if (!(region && region->visible)) {
3878 if (value ==
double(
FLT_MAX)) {
3881 else if (value ==
double(-
FLT_MAX)) {
3886 but->
drawstr = fmt::format(
"{}{:.{}f}%", but->
str, value, prec);
3890 but->
drawstr = fmt::format(
"{}{:.{}f} px", but->
str, value, prec);
3896 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, precision);
3899 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value * 100, std::max(0, precision - 2));
3909 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
3920 but->
drawstr = but->
str + std::to_string(value);
3950 switch (but->
type) {
3956 if (value <
double(but->
hardmin)) {
3959 else if (value >
double(but->
hardmax)) {
3985 switch (but->
type) {
4028 but->
drawstr = fmt::format(
"{}{:.{}f}", but->
str, value, prec);
4122 block->
flag &= ~UI_BUT_ALIGN;
4144 uiBut *but =
nullptr;
4148 but = MEM_new<uiButNumber>(
"uiButNumber");
4151 but = MEM_new<uiButNumberSlider>(
"uiButNumber");
4154 but = MEM_new<uiButColor>(
"uiButColor");
4157 but = MEM_new<uiButDecorator>(
"uiButDecorator");
4160 but = MEM_new<uiButTab>(
"uiButTab");
4163 but = MEM_new<uiButSearch>(
"uiButSearch");
4166 but = MEM_new<uiButProgress>(
"uiButProgress");
4169 but = MEM_new<uiButSeparatorLine>(
"uiButSeparatorLine");
4172 but = MEM_new<uiButHSVCube>(
"uiButHSVCube");
4175 but = MEM_new<uiButColorBand>(
"uiButColorBand");
4178 but = MEM_new<uiButCurveMapping>(
"uiButCurveMapping");
4181 but = MEM_new<uiButCurveProfile>(
"uiButCurveProfile");
4184 but = MEM_new<uiButHotkeyEvent>(
"uiButHotkeyEvent");
4187 but = MEM_new<uiButViewItem>(
"uiButViewItem");
4190 but = MEM_new<uiButLabel>(
"uiButLabel");
4193 but = MEM_new<uiButScrollBar>(
"uiButScrollBar");
4196 but = MEM_new<uiBut>(
"uiBut");
4206 if (but->
type == new_type) {
4216 const uiBut *old_but_ptr = but;
4218 const bool has_poin_ptr_to_self = but->
poin == (
char *)but;
4222 *but = *old_but_ptr;
4224 but->
type = new_type;
4225 if (has_poin_ptr_to_self) {
4226 but->
poin = (
char *)but;
4269 if (poin ==
nullptr) {
4279 but->
bitnr = type & 31;
4290 but->
poin = (
char *)poin;
4319 if (but->
str[but->
str.size() - 1] !=
' ') {
4327 if (!but->
str.empty()) {
4344#ifdef USE_NUMBUTS_LR_ALIGN
4346 if (!but->
str.empty()) {
4354 if (block->
lock ==
true) {
4411 if (!but->
str.empty()) {
4418 but->
icon = ICON_NONE;
4419 but->
flag &= ~UI_HAS_ICON;
4420 but->
drawflag &= ~UI_BUT_ICON_LEFT;
4448 bool has_item_with_icon =
false;
4455 const int max_rows = (win->
sizey - (4 * row_height)) / row_height;
4456 float text_width = 0.0f;
4460 float col_width = 0.0f;
4464 if (col_rows > 1 && (col_rows > max_rows || (!item->identifier[0] && item->name))) {
4466 text_width += col_width;
4470 if (!item->identifier[0] && item->name) {
4476 has_item_with_icon =
true;
4478 if (item->name && item->name[0]) {
4480 col_width = std::max(col_width, item_width + (100.0f *
UI_SCALE_FAC));
4482 rows = std::max(rows, col_rows);
4484 text_width += col_width;
4488 if (categories == 0) {
4489 columns = std::max((totitems + 20) / 20, 1);
4491 columns = (totitems + 25) / 25;
4493 rows = std::max(totitems / columns, 1);
4494 while (rows * columns < totitems) {
4524 if (title && title[0] && (categories == 0) && (!but->
str[0] || !prior_label)) {
4527 block,
UI_BTYPE_LABEL, 0, title, 0, 0,
UI_UNIT_X * 5,
UI_UNIT_Y,
nullptr, 0.0, 0.0,
"");
4540 for (
int a = 0; a < totitems; a++) {
4541 new_column = (a == column_end);
4545 column_end = totitems;
4547 for (
int b = a + 1;
b < totitems;
b++) {
4551 if (((
b - a) % rows == 0) || (columns > 1 && !item->
identifier[0] && item->
name)) {
4562 if (new_column && (categories > 0) && (columns > 1) && item->
identifier[0]) {
4563 uiItemL(column,
"", ICON_NONE);
4568 if (item->
name || columns > 1) {
4572 else if (item->
name) {
4592 int icon = item->
icon;
4593 const char *description_static = use_enum_copy_description ? nullptr : item->
description;
4597 if (icon == ICON_NONE && has_item_with_icon) {
4615 description_static);
4629 description_static);
4631 if (item->
value == current_value) {
4635 if (use_enum_copy_description) {
4640 [](
bContext * ,
void *argN,
const char * ) -> std::string {
4641 return static_cast<const char *
>(argN);
4664 uiItemL(layout,
RPT_(
"Missing Panel"), ICON_NONE);
4687 const char *menu_type =
static_cast<const char *
>(but->
func_argN);
4695 uiItemL(layout, msg, ICON_NONE);
4768#ifdef WITH_INTERNATIONAL
4773 icon = item[i].
icon;
4806 float precision = -1.0f;
4808 int hardmin, hardmax, softmin, softmax, int_step;
4821 float hardmin, hardmax, softmin, softmax;
4838 uiBut *but =
ui_def_but(block, type, retval,
str, x, y, width, height,
nullptr,
min, max, tip);
4892 but->
flag &= ~UI_BUT_UNDO;
4909 but->
poin = (
char *)but;
4924 const char *propname,
4935 block, type, retval,
str, x, y, width, height,
ptr, prop, index,
min, max, tip);
4938 but =
ui_def_but(block, type, retval, propname, x, y, width, height,
nullptr,
min, max, tip);
4961 uiBut *but =
ui_def_but(block, type, -1,
str, x, y, width, height,
nullptr, 0, 0, tip);
4989 uiBut *but =
ui_def_but(block, type, retval,
str, x, y, width, height, poin,
min, max, tip);
4997 uiBlock *block,
void *imbuf,
int x,
int y,
short width,
short height,
const uchar color[4])
4999 uiBut *but =
ui_def_but(block,
UI_BTYPE_IMAGE, 0,
"", x, y, width, height, imbuf, 0, 0,
"");
5039 if (x & 0xFFFF0000) {
5074 autocpl = MEM_cnew<AutoComplete>(__func__);
5085 char *truncate = autocpl->
truncate;
5086 const char *startname = autocpl->
startname;
5087 int match_index = 0;
5088 for (
int a = 0; a < autocpl->
maxncpy - 1; a++) {
5089 if (startname[a] == 0 || startname[a] != name[a]) {
5096 if (startname[match_index] == 0) {
5099 if (truncate[0] == 0) {
5104 for (
int a = 0; a < autocpl->
maxncpy - 1; a++) {
5109 if (truncate[a] != name[a]) {
5140#define PREVIEW_TILE_PAD (0.225f * UI_UNIT_X)
5163#undef PREVIEW_TILE_PAD
5402 const char *propname,
5409 block, type, retval,
str, x, y, width, height,
ptr, propname, index,
min, max, tip);
5429 block, type, retval,
str, x, y, width, height,
ptr, prop, index,
min, max, tip);
5461 if (
str ==
nullptr &&
ot ==
nullptr) {
5480 uiBut *but =
ui_def_but(block, type, retval,
"", x, y, width, height, poin,
min, max, tip);
5661 const char *propname,
5668 block, type, retval,
"", x, y, width, height,
ptr, propname, index,
min, max, tip);
5688 block, type, retval,
"", x, y, width, height,
ptr, prop, index,
min, max, tip);
5737 uiBut *but =
ui_def_but(block, type, retval,
str, x, y, width, height, poin,
min, max, tip);
5780 const char *propname,
5787 block, type, retval,
str, x, y, width, height,
ptr, propname, index,
min, max, tip);
5809 block, type, retval,
str, x, y, width, height,
ptr, prop, index,
min, max, tip);
5844 if (
str.is_empty()) {
5847 return uiDefIconTextButO_ptr(block, type,
ot, opcontext, icon,
str, x, y, width, height, tip);
5857 but->
flag &= ~UI_BUT_UNDO;
5860 MEM_delete(but->
opptr);
5861 but->
opptr =
nullptr;
5864 but->
opptr = MEM_new<PointerRNA>(__func__, *opptr);
5902 block->
flag &= ~flag;
5972 if (!placeholder && but->
rnaprop) {
6008 but->
opptr = MEM_new<PointerRNA>(__func__);
6053 if ((ownUnit != 0) || (but->
rnaprop ==
nullptr)) {
6054 return ownUnit << 16;
6083 block->
funcN = funcN;
6097 std::function<
void(std::string &new_name)> rename_full_func)
6103 std::function<
void(
const bContext *C,
rcti *rect)> func)
6194 uiBut *but =
ui_def_but(block,
UI_BTYPE_BLOCK, 0,
str, x, y, width, height, arg, 0.0, 0.0, tip);
6213 block,
UI_BTYPE_BLOCK, 0,
str, x, y, width, height,
nullptr, 0.0, 0.0, tip);
6236 block,
UI_BTYPE_PULLDOWN, 0,
str, x, y, width, height, arg, 0.0, 0.0, tip);
6254 block,
UI_BTYPE_PULLDOWN, 0,
str, x, y, width, height, arg, 0.0, 0.0, tip);
6278 block,
UI_BTYPE_PULLDOWN, 0,
"", x, y, width, height, arg, 0.0, 0.0, tip);
6281 but->
drawflag &= ~UI_BUT_ICON_LEFT;
6301 block,
UI_BTYPE_BLOCK, retval,
"", x, y, width, height, arg, 0.0, 0.0, tip);
6325 block,
UI_BTYPE_SEARCH_MENU, retval,
"", x, y, width, height, arg, 0.0, maxncpy, tip);
6340 const bool free_arg,
6351 if (search_create_fn ==
nullptr) {
6357 search_but->
arg =
nullptr;
6364 search_but->
arg = arg;
6367 if (search_exec_fn) {
6371 printf(
"%s: warning, overwriting button callback with search function callback!\n",
6440 if (prop ==
nullptr) {
6441 printf(
"%s: %s has no enum property set\n", __func__,
ot->
idname);
6444 printf(
"%s: %s \"%s\" is not an enum property\n",
6460 search.
add(item->name, item);
6494 printf(
"%s: op->prop for '%s' is nullptr\n", __func__,
ot->
idname);
6615 const std::optional<int> draw_width,
6616 const std::optional<int> draw_height)
6620 but_view_item->
draw_width = draw_width.value_or(0);
6621 but_view_item->
draw_height = draw_height.value_or(0);
6632 event.customdata = but;
6633 event.customdata_free =
false;
6674 if (!
ptr || !prop) {
6675 return std::nullopt;
6680 return std::nullopt;
6717 if (!but.
str.empty()) {
6718 size_t str_len = but.
str.size();
6721 if (sep_index != std::string::npos) {
6722 str_len = sep_index;
6725 return but.
str.substr(0, str_len);
6735 if (view_item_but.
view_item ==
nullptr) {
6763 return CTX_TIP_(mt->translation_context, mt->label);
6771 return CTX_TIP_(pt->translation_context, pt->label);
6798 if (but.
tip && but.
tip[0]) {
6823 if (mt->rna_ext.srna) {
AnimationEvalContext BKE_animsys_eval_context_construct(struct Depsgraph *depsgraph, float eval_time) ATTR_WARN_UNUSED_RESULT
bContextStore * CTX_store_add(blender::Vector< std::unique_ptr< bContextStore > > &contexts, blender::StringRefNull name, const PointerRNA *ptr)
ReportList * CTX_wm_reports(const bContext *C)
ARegion * CTX_wm_region_popup(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
std::optional< blender::StringRefNull > CTX_store_string_lookup(const bContextStore *store, blender::StringRefNull name)
const bContextStore * CTX_store_get(const bContext *C)
const PointerRNA * CTX_store_ptr_lookup(const bContextStore *store, blender::StringRefNull name, const StructRNA *type=nullptr)
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, const char *name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(3)
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
double BKE_scene_unit_scale(const UnitSettings *unit, int unit_type, double value)
void BKE_unit_name_to_alt(char *str, int str_maxncpy, const char *orig_str, int system, int type)
double BKE_unit_closest_scalar(double value, 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)
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)
bool BLI_ghash_reinsert(GHash *gh, void *key, void *val, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
GHash * BLI_ghash_str_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_kdtree_nd_ free(KDTree *tree)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT 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 int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int round_db_to_int_clamp(double a)
MINLINE int is_power_of_2_i(int n)
MINLINE unsigned char round_db_to_uchar_clamp(double a)
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v4(float r[4])
MINLINE void zero_v3(float r[3])
MINLINE float normalize_v3(float n[3])
#define BLI_SCOPED_DEFER(function_to_defer)
void BLI_rctf_translate(struct rctf *rect, float x, float y)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
void BLI_rcti_rctf_copy_round(struct rcti *dst, const struct rctf *src)
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src)
void BLI_rcti_translate(struct rcti *rect, int x, int y)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
bool BLI_rcti_clamp(struct rcti *rect, const struct rcti *rect_bounds, int r_xy[2])
void BLI_rctf_init_minmax(struct rctf *rect)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
int bool bool bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t str_len) ATTR_NONNULL(1
#define STRNCPY(dst, src)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define SNPRINTF(dst, format,...)
char * BLI_strdup_null(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_MALLOC
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define POINTER_FROM_INT(i)
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define POINTER_AS_INT(i)
#define BLT_I18NCONTEXT_ID_WINDOWMANAGER
#define BLT_I18NCONTEXT_ID_ID
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
#define CTX_TIP_(context, msgid)
bool BPY_run_string_as_number(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, double *r_value) ATTR_NONNULL(1
typedef double(DMatrix)[4][4]
#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)
void GPU_matrix_identity_set()
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
#define GPU_matrix_projection_get(x)
void GPU_blend(eGPUBlend blend)
ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], ColorManagedDisplay *display)
const char * IMB_colormanagement_display_get_default_name()
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)
constexpr PointerRNA PointerRNA_NULL
void(*)(void *arg) uiFreeArgFunc
#define AUTOCOMPLETE_FULL_MATCH
std::string(*)(bContext *C, void *argN, const char *tip) uiButToolTipFunc
@ UI_BLOCK_MOVEMOUSE_QUIT
@ UI_BLOCK_NO_ACCELERATOR_KEYS
@ UI_BLOCK_SHOW_SHORTCUT_ALWAYS
void(*)(bContext *C, uiLayout *layout, void *arg1) uiMenuCreateFunc
void(*)(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first) uiButSearchUpdateFn
void(*)(bContext *C, void *arg, char *origstr) uiButHandleRenameFunc
void uiItemL(uiLayout *layout, const char *name, int icon)
bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
MenuType * UI_but_menutype_get(const uiBut *but)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
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)
void uiItemS(uiLayout *layout)
#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
void UI_editsource_active_but_test(uiBut *but)
const uiStyle * UI_style_get()
bool UI_panel_should_show_background(const ARegion *region, const PanelType *panel_type)
void UI_fontstyle_set(const uiFontStyle *fs)
@ UI_BLOCK_BOUNDS_PIE_CENTER
@ UI_BLOCK_BOUNDS_POPUP_MOUSE
@ UI_BLOCK_BOUNDS_POPUP_CENTER
@ UI_BLOCK_BOUNDS_POPUP_MENU
bool(*)(bContext *C, void *arg, void *active, const wmEvent *event) uiButSearchContextMenuFn
int(*)(bContext *C, char *str, void *arg) uiButCompleteFunc
bool UI_view_item_matches(const blender::ui::AbstractViewItem &a, const blender::ui::AbstractViewItem &b)
bool UI_butstore_is_registered(uiBlock *block, uiBut *but)
PanelType * UI_but_paneltype_get(const uiBut *but)
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) uiButSearchTooltipFn
void UI_butstore_clear(uiBlock *block)
void(*)(bContext *C, ARegion *butregion, uiBut *but) uiButHandleHoldFunc
void(*)(bContext *C, void *argN, void *arg2) uiButHandleNFunc
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiLayout * uiLayoutSplit(uiLayout *layout, float percentage, bool align)
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
void UI_but_tooltip_refresh(bContext *C, uiBut *but)
void(*)(bContext *C, void *arg1, void *arg2) uiButHandleFunc
ARegion *(*)(bContext *C, ARegion *butregion, uiButSearch *search_but) uiButSearchCreateFn
bool(*)(bContext *C, int direction, void *arg1) uiMenuStepFunc
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout)
uiBlock *(*)(bContext *C, ARegion *region, void *arg1) uiBlockCreateFunc
int UI_calc_float_precision(int prec, double value)
bool UI_but_is_tool(const uiBut *but)
void UI_widgetbase_draw_cache_begin()
void(*)(bContext &C, uiTooltipData &data, void *argN) uiButToolTipCustomFunc
void(*)(const wmRegionListenerParams *params, void *arg) uiButSearchListenFn
wmOperatorType * UI_but_operatortype_get_from_enum_menu(uiBut *but, PropertyRNA **r_prop)
#define UI_but_is_decorator(but)
@ UI_BUT_HAS_TOOLTIP_LABEL
@ UI_BUT_ACTIVATE_ON_INIT
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)
float UI_view2d_scale_get_x(const View2D *v2d)
@ WM_OP_INVOKE_REGION_WIN
int pad[32 - sizeof(int)]
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void activate(bool forceActivation=false) const
constexpr bool is_empty() const
constexpr bool startswith(StringRef prefix) 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
local_group_size(16, 16) .push_constant(Type b
pow(value.r - subtrahend, 2.0)") .do_static_compilation(true)
const Depsgraph * depsgraph
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void IMB_freeImBuf(ImBuf *)
void ui_but_v4_get(uiBut *but, float vec[4])
void UI_block_update_from_old(const bContext *C, 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)
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)
static uiBut * ui_def_but_operator_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, const StringRef str, int x, int y, short width, short height, const char *tip)
eUIEmbossType UI_block_emboss_get(uiBlock *block)
uiBut * ui_but_find_new(uiBlock *block_new, const uiBut *but_old)
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)
uiBut * uiDefIconButR(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
static double soft_range_round_down(double value, double max)
void ui_window_to_block(const ARegion *region, const uiBlock *block, int *x, int *y)
const short ui_radial_dir_to_angle[8]
uiBut * uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
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)
uiBut * uiDefButBitC(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, char *poin, float min, float max, const char *tip)
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)
uiBut * uiDefIconTextButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const char *tip)
void UI_but_func_rename_full_set(uiBut *but, std::function< void(std::string &new_name)> rename_full_func)
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)
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)
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)
uiBut * uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, int x, int y, short width, short height, const char *tip)
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
void UI_interface_tag_script_reload()
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)
uiBut * uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const StringRef str, int x, int y, short width, short height, const char *tip)
void ui_def_but_icon_clear(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)
static uiBut * uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
static void ui_but_mem_delete(const uiBut *but)
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)
uiBut * uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
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)
void UI_but_func_menu_step_set(uiBut *but, uiMenuStepFunc func)
static uiBut * ui_def_but(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
static uiBut * ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *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)
void UI_block_listen(const uiBlock *block, const wmRegionListenerParams *listener_params)
void UI_block_translate(uiBlock *block, float x, float y)
uiBut * uiDefButF(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, float *poin, float min, float max, const char *tip)
static void ui_but_update_and_icon_set(uiBut *but, int icon)
std::optional< blender::StringRefNull > UI_but_context_string_get(const uiBut *but, const char *name)
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)
uiBut * uiDefButO(uiBlock *block, int type, const char *opname, wmOperatorCallContext opcontext, const char *str, int x, int y, short width, short height, const char *tip)
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)
uiBut * uiDefIconBut(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
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)
void UI_but_flag2_enable(uiBut *but, int flag)
double ui_but_value_get(uiBut *but)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
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)
bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block)
static uiBut * ui_def_but_rna_propname(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
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)
static std::optional< std::string > ui_but_event_operator_string_from_operator(const bContext *C, wmOperatorCallParams *op_call_params)
const PointerRNA * UI_but_context_ptr_get(const uiBut *but, const char *name, const StructRNA *type)
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
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()
PointerRNA * UI_but_extra_operator_icon_add(uiBut *but, const char *opname, wmOperatorCallContext opcontext, int icon)
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)
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 char *tip)
int UI_preview_tile_size_x(const int size_px)
static uiBut * uiDefButBit(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
static void operator_enum_search_update_fn(const bContext *C, void *but, const char *str, uiSearchItems *items, const bool)
void UI_but_context_ptr_set(uiBlock *block, uiBut *but, const char *name, const PointerRNA *ptr)
static uiBut * ui_but_new(const eButType type)
void UI_but_number_slider_precision_set(uiBut *but, float precision)
int UI_autocomplete_end(AutoComplete *autocpl, char *autoname)
static std::optional< std::string > ui_but_event_property_operator_string(const bContext *C, uiBut *but)
bool ui_but_rna_equals(const uiBut *a, const uiBut *b)
void ui_block_cm_to_display_space_v3(uiBlock *block, float pixel[3])
#define UI_BUT_VALUE_UNSET
bool ui_but_is_rna_valid(uiBut *but)
void UI_but_dragflag_enable(uiBut *but, int flag)
static void ui_block_bounds_calc_text(uiBlock *block, float offset)
bool UI_block_is_search_only(const uiBlock *block)
uiBut * uiDefIconTextButO(uiBlock *block, int type, const char *opname, wmOperatorCallContext opcontext, int icon, const StringRef str, int x, int y, short width, short height, const char *tip)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
uiBut * uiDefIconButO(uiBlock *block, int type, const char *opname, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, const char *tip)
bool ui_but_string_set(bContext *C, uiBut *but, const char *str)
static bool ui_but_icon_extra_is_visible_bone_eyedropper(uiBut *but)
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss)
uiBut * uiDefBut(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
bool ui_but_menu_draw_as_popover(const uiBut *but)
void ui_but_value_set(uiBut *but, double value)
uiBut * uiDefButS(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
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)
uiBut * uiDefIconButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, int icon, int x, int y, short width, short height, const char *tip)
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)
uiBut * uiDefButBitS(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2)
uiBut * uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, char *poin, float min, float max, const char *tip)
#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)
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)
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_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_xy[2])
void UI_block_bounds_set_text(uiBlock *block, int addval)
static bool ui_but_is_rna_undo(const uiBut *but)
void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2)
static bool ui_number_from_string(bContext *C, const char *str, double *r_value)
void UI_block_align_begin(uiBlock *block)
void ui_but_to_pixelrect(rcti *rect, const ARegion *region, const uiBlock *block, const uiBut *but)
static PointerRNA * ui_but_extra_operator_icon_add_ptr(uiBut *but, wmOperatorType *optype, wmOperatorCallContext opcontext, int icon)
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, const char *tip)
void ui_but_rna_menu_convert_to_panel_type(uiBut *but, const char *panel_type)
uiBut * ui_but_find_old(uiBlock *block_old, const uiBut *but_new)
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)
void ui_but_update_edited(uiBut *but)
static void ui_but_build_drawstr_float(uiBut *but, double value)
uiBut * uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
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])
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
void UI_but_icon_indicator_set(uiBut *but, const char *string)
void ui_but_v3_get(uiBut *but, float vec[3])
static double ui_get_but_scale_unit(uiBut *but, double value)
uiBut * uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
void UI_but_func_search_set_results_are_suggestions(uiBut *but, const bool value)
#define UI_NUMBER_EVAL_ERROR_PREFIX
void UI_but_func_search_set_sep_string(uiBut *but, const char *search_sep_string)
void UI_but_hint_drawstr_set(uiBut *but, const char *string)
uiBut * ui_but_change_type(uiBut *but, eButType new_type)
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)
int ui_but_string_get_maxncpy(uiBut *but)
void UI_blocklist_draw(const bContext *C, const ListBase *lb)
int UI_blocklist_min_y_get(ListBase *lb)
uiBut * uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
static void ui_def_but_rna__panel_type(bContext *, uiLayout *layout, void *arg)
uiBut * uiDefButImage(uiBlock *block, void *imbuf, int x, int y, short width, short height, const uchar color[4])
void UI_but_number_precision_set(uiBut *but, float precision)
void UI_block_bounds_set_centered(uiBlock *block, int addval)
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)
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const StringRef str, int x, int y, short width, short height, const char *tip)
uiBut * uiDefIconTextButR_prop(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
void UI_but_placeholder_set(uiBut *but, const char *placeholder_text)
void UI_but_func_pushed_state_set(uiBut *but, std::function< bool(const uiBut &)> func)
ColorManagedDisplay * ui_block_cm_display_get(uiBlock *block)
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)
uiBut * uiDefButI(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
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)
void UI_but_func_tooltip_label_set(uiBut *but, std::function< std::string(const uiBut *but)> func)
std::string UI_but_extra_icon_string_get_label(const uiButExtraOpIcon &extra_icon)
void UI_block_free(const bContext *C, uiBlock *block)
uiBut * uiDefIconButS(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, short *poin, float min, float max, const char *tip)
static std::optional< std::string > ui_but_event_operator_string(const bContext *C, uiBut *but)
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)
uiBut * uiDefButBitI(uiBlock *block, int type, int bit, int retval, const StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
static void ui_block_bounds_calc_centered_pie(uiBlock *block)
void UI_but_operator_set(uiBut *but, wmOperatorType *optype, wmOperatorCallContext opcontext, const PointerRNA *opptr)
void UI_block_set_active_operator(uiBlock *block, wmOperator *op, const bool free)
void UI_but_icon_indicator_color_set(uiBut *but, const uchar color[4])
void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg)
uiBut * uiDefButR_prop(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
uiBut * uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const char *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 bool ui_number_from_string_factor(bContext *C, const char *str, double *r_value)
void UI_block_flag_enable(uiBlock *block, int flag)
std::string UI_but_string_get_rna_struct_identifier(const uiBut &but)
const bContextStore * UI_but_context_get(const uiBut *but)
void ui_but_rna_menu_convert_to_menu_type(uiBut *but, const char *menu_type)
static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut)
static void ui_but_update_select_flag(uiBut *but, double *value)
static bool ui_but_icon_extra_is_visible_search_unlink(const uiBut *but)
uiBut * uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, const char *tip)
const char ui_radial_dir_order[8]
static bool ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut **but_p, uiBut **but_old_p)
uiBut * uiDefButR(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
static bool ui_but_is_unit_radians_ex(const UnitSettings *unit, const int unit_type)
static std::optional< std::string > ui_but_event_operator_string_from_menu(const bContext *C, uiBut *but)
uiBut * uiDefButO_ptr(uiBlock *block, int type, wmOperatorType *ot, wmOperatorCallContext opcontext, const StringRef str, int x, int y, short width, short height, const char *tip)
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)
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)
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_autocomplete_update_name(AutoComplete *autocpl, const char *name)
static float ui_get_but_step_unit(uiBut *but, float step_default)
void UI_but_flag_enable(uiBut *but, int flag)
uiBut * uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const StringRef str, int x, int y, short width, short height, const char *tip, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
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 * uiDefButC(uiBlock *block, int type, int retval, const StringRef str, int x, int y, short width, short height, char *poin, float min, float max, const char *tip)
static std::string ui_but_pie_direction_string(const uiBut *but)
uiBut * uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const StringRef str, int x, int y, short width, short height, const char *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_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)
bool ui_but_menu_step_poll(const uiBut *but)
void ui_block_views_draw_overlays(const ARegion *region, const uiBlock *block)
bool ui_block_is_popover(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
void ui_but_search_refresh(uiButSearch *but)
void ui_draw_layout_panels_backdrop(const ARegion *region, const Panel *panel, const float radius, float subpanel_backcolor[4])
bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but)
void ui_interface_tag_script_reload_queries()
ARegion * ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiButSearch *search_but)
void ui_draw_menu_back(uiStyle *style, uiBlock *block, const rcti *rect)
void ui_block_free_views(uiBlock *block)
void ui_item_paneltype_func(bContext *C, uiLayout *layout, void *arg_pt)
void ui_draw_aligned_panel(const ARegion *region, const uiStyle *style, const uiBlock *block, const rcti *rect, bool show_pin, bool show_background, bool region_search_filter_active)
void ui_draw_but(const bContext *C, ARegion *region, uiStyle *style, uiBut *but, rcti *rect)
void ui_block_views_listen(const uiBlock *block, const wmRegionListenerParams *listener_params)
bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT
void ui_draw_popover_back(ARegion *region, uiStyle *style, uiBlock *block, const rcti *rect)
@ UI_BLOCK_CONTAINS_SUBMENU_BUT
uiBut * ui_region_find_active_but(ARegion *region) ATTR_WARN_UNUSED_RESULT
void ui_block_views_bounds_calc(const uiBlock *block)
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)
size_t(* MEM_allocN_len)(const void *vmemh)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
ccl_device_inline float2 floor(const float2 a)
ccl_device_inline float3 ceil(const float3 a)
ccl_device_inline float3 log(float3 v)
MINLINE void zero_v2_int(int r[2])
static void error(const char *str)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRefNull prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
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)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
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)
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)
bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2])
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_translation_context(const PropertyRNA *prop)
void * RNA_property_py_data_get(PropertyRNA *prop)
int RNA_property_flag(PropertyRNA *prop)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
const char * RNA_struct_ui_description(const StructRNA *type)
bool RNA_property_enum_item_from_value_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
const char * RNA_struct_ui_name(const StructRNA *type)
bool RNA_struct_undo_check(const StructRNA *type)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_ui_name(const PropertyRNA *prop)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
int RNA_property_string_maxlength(PropertyRNA *prop)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
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)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
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)
const char * report_prefix
char idname[BKE_ST_MAXNAME]
struct Panel_Runtime * runtime
uiWidgetColors wcol_menu_back
void(* listener_func)(const wmRegionListenerParams *params)
ListBase dynamic_listeners
ColorPickerData color_pickers
uiPopupBlockHandle * handle
uiButArgNFree func_argN_free_fn
uiButArgNCopy func_argN_copy_fn
uiBlockHandleFunc handle_func
blender::Vector< std::unique_ptr< bContextStore > > contexts
std::function< void(const bContext *, rcti *)> drawextra
eBlockBoundsCalc bounds_type
const UnitSettings * unit
uiButSearchUpdateFn items_update_fn
bool results_are_suggestions
PropertyRNA * rnasearchprop
uiButSearchListenFn listen_fn
const char * item_sep_string
uiButSearchCreateFn popup_create_fn
uiFreeArgFunc arg_free_fn
uiButSearchTooltipFn item_tooltip_fn
uiButSearchContextMenuFn item_context_menu_fn
blender::ui::AbstractViewItem * view_item
wmOperatorCallContext opcontext
uiButCompleteFunc autocomplete_func
uiButIdentityCompareFunc identity_cmp_func
std::function< void(bContext &)> apply_func
IconTextOverlay icon_overlay_text
uiHandleButtonData * active
const char * disabled_info
uiMenuCreateFunc menu_create_func
std::function< void(std::string &new_name)> rename_full_func
std::string rename_full_new
const bContextStore * context
uiButToolTipFunc tip_func
uiButArgNFree func_argN_free_fn
std::function< std::string(const uiBut *)> tip_label_func
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
uiPopupBlockCreate popup_create_vars
wmOperatorCallContext opcontext
std::string(* get_description)(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
struct wmEvent * eventstate
bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context)
wmEvent * wm_event_add(wmWindow *win, const wmEvent *event_to_add)
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
void wm_event_init_from_window(wmWindow *win, wmEvent *event)
std::optional< std::string > WM_key_event_operator_string(const bContext *C, const char *opname, wmOperatorCallContext opcontext, IDProperty *properties, const bool is_strict)
std::optional< std::string > WM_keymap_item_to_string(const wmKeyMapItem *kmi, const bool compact)
const char * WM_key_event_string(const short type, const bool compact)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
std::string WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties)
std::string WM_operatortype_description(bContext *C, wmOperatorType *ot, PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
std::optional< std::string > WM_context_path_resolve_property_full(const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index)
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
void WM_operator_properties_free(PointerRNA *ptr)
void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
void wmGetProjectionMatrix(float mat[4][4], const rcti *winrct)
void wmOrtho2_region_pixelspace(const ARegion *region)
blender::int2 WM_window_native_pixel_size(const wmWindow *win)
int WM_window_native_pixel_x(const wmWindow *win)