56#define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect))
138 cp[0] =
int((1.0f - fac) * cp[0] + fac * cpstate[0]);
139 cp[1] =
int((1.0f - fac) * cp[1] + fac * cpstate[1]);
140 cp[2] =
int((1.0f - fac) * cp[2] + fac * cpstate[2]);
150 const int facm = 255 - faci;
152 r_col[0] = (faci * col1[0] + facm * col2[0]) / 256;
153 r_col[1] = (faci * col1[1] + facm * col2[1]) / 256;
154 r_col[2] = (faci * col1[2] + facm * col2[2]) / 256;
155 r_col[3] = (faci * col1[3] + facm * col2[3]) / 256;
163 const int delta = item_value - inner_value;
165 if (contrast > delta) {
170 if (contrast > -delta) {
178 float rgb[3], hsl[3];
221#define WIDGET_CURVE_RESOLU 9
222#define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU * 4)
290 {0.468813, -0.481430},
291 {-0.155755, -0.352820},
292 {0.219306, -0.238501},
293 {-0.393286, -0.110949},
294 {-0.024699, 0.013908},
295 {0.343805, 0.147431},
296 {-0.272855, 0.269918},
297 {0.095909, 0.388710},
299#define WIDGET_AA_JITTER UI_PIXEL_AA_JITTER
300#define jit ui_pixel_jitter
303 {-0.352077, 0.532607},
304 {-0.352077, -0.549313},
305 {0.330000, -0.008353},
312 {0.382684, 0.923879},
313 {0.000001, 1.000000},
314 {-0.382683, 0.923880},
315 {-0.707107, 0.707107},
316 {-0.923879, 0.382684},
317 {-1.000000, 0.000000},
318 {-0.923880, -0.382684},
319 {-0.707107, -0.707107},
320 {-0.382683, -0.923880},
321 {0.000000, -1.000000},
322 {0.382684, -0.923880},
323 {0.707107, -0.707107},
324 {0.923880, -0.382684},
325 {1.000000, -0.000000},
326 {0.923880, 0.382683},
327 {0.707107, 0.707107},
357 {-0.578579, 0.253369},
358 {-0.392773, 0.412794},
359 {-0.004241, -0.328551},
360 {-0.003001, 0.034320},
361 {1.055313, 0.864744},
362 {0.866408, 1.026895},
375 {-0.5 +
SC, 1.0 +
OY},
377 {0.5, 0.0 +
OY +
SC},
434 *data |= corner_v << 2;
436 *data |= color << 12;
437 *data |= (inner) ? (1 << 10) : 0;
438 *data |= (emboss) ? (1 << 11) : 0;
478 for (
int c = 0; c < 4; c++) {
491 for (
int c1 = 0, c2 = 3; c1 < 2; c1++, c2--) {
516 float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
const float color[4])
518 const float tri_arr[3][2] = {{x1, y1}, {x2, y2}, {x3, y3}};
550 const float f3 = 0.05 *
U.widget_unit;
551 const float f5 = 0.15 *
U.widget_unit;
552 const float f7 = 0.25 *
U.widget_unit;
557 else if (dir ==
't') {
605 uiWidgetBase *wt,
int roundboxalign,
const rcti *rect,
float rad,
float radi)
608 const float minx = rect->
xmin, miny = rect->
ymin, maxx = rect->
xmax, maxy = rect->
ymax;
609 const float minxi = minx +
U.pixelsize;
610 const float maxxi = maxx -
U.pixelsize;
611 const float minyi = miny +
U.pixelsize;
612 const float maxyi = maxy -
U.pixelsize;
614 const float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f;
615 const float facyi = (maxyi != minyi) ? 1.0f / (maxyi - minyi) : 0.0f;
632 if (2.0f * rad > minsize) {
633 rad = 0.5f * minsize;
636 if (2.0f * (radi + 1.0f) > minsize) {
637 radi = 0.5f * minsize -
U.pixelsize;
662 wt->
inner_v[tot][0] = minxi + veci[a][1];
663 wt->
inner_v[tot][1] = minyi + radi - veci[a][0];
665 wt->
outer_v[tot][0] = minx + vec[a][1];
666 wt->
outer_v[tot][1] = miny + rad - vec[a][0];
688 wt->
inner_v[tot][0] = maxxi - radi + veci[a][0];
689 wt->
inner_v[tot][1] = minyi + veci[a][1];
691 wt->
outer_v[tot][0] = maxx - rad + vec[a][0];
692 wt->
outer_v[tot][1] = miny + vec[a][1];
716 wt->
inner_v[tot][0] = maxxi - veci[a][1];
717 wt->
inner_v[tot][1] = maxyi - radi + veci[a][0];
719 wt->
outer_v[tot][0] = maxx - vec[a][1];
720 wt->
outer_v[tot][1] = maxy - rad + vec[a][0];
742 wt->
inner_v[tot][0] = minxi + radi - veci[a][0];
743 wt->
inner_v[tot][1] = maxyi - veci[a][1];
745 wt->
outer_v[tot][0] = minx + rad - vec[a][0];
746 wt->
outer_v[tot][1] = maxy - vec[a][1];
787 const float verts[][2],
789 const uint tris[][3],
798 float centx =
float(rect->
xmin) + 0.4f * minsize;
799 float centy =
float(rect->
ymin) + 0.5f * minsize;
800 tria->
size = sizex = sizey = -0.5f * triasize * minsize;
803 centx =
float(rect->
xmax) - 0.4f * minsize;
806 else if (where ==
't') {
807 centx =
float(rect->
xmin) + 0.5f * minsize;
808 centy =
float(rect->
ymax) - 0.5f * minsize;
813 else if (where ==
'b') {
814 centx =
float(rect->
xmin) + 0.5f * minsize;
820 for (
int a = 0; a < verts_tot; a++) {
821 tria->
vec[a][0] = sizex *
verts[a][i1] + centx;
822 tria->
vec[a][1] = sizey *
verts[a][i2] + centy;
828 tria->
tot = tris_tot;
893 for (
int i = 0; i < totvert; i++) {
906 float centx, centy,
size;
913 tria->
size = size = 0.4f * height;
915 if (width > height * 1.1f) {
917 tria->
center[0] = centx = rect->
xmax - 0.32f * height;
920 for (
int a = 0; a < 6; a++) {
931 float centx, centy,
size;
940 for (
int a = 0; a < 6; a++) {
967 const uchar *color,
short shadetop,
short shadedown,
uchar r_coltop[4],
uchar r_coldown[4])
969 r_coltop[0] = std::clamp(color[0] + shadetop, 0, 255);
970 r_coltop[1] = std::clamp(color[1] + shadetop, 0, 255);
971 r_coltop[2] = std::clamp(color[2] + shadetop, 0, 255);
972 r_coltop[3] = color[3];
974 r_coldown[0] = std::clamp(color[0] + shadedown, 0, 255);
975 r_coldown[1] = std::clamp(color[1] + shadedown, 0, 255);
976 r_coldown[2] = std::clamp(color[2] + shadedown, 0, 255);
977 r_coldown[3] = color[3];
985 for (a = 0; a < totvert; a++) {
1003 const bool alpha_check,
1004 const float discard_factor)
1029 const uchar *outline,
1030 const uchar *emboss,
1032 const bool alpha_check)
1051#define MAX_WIDGET_BASE_BATCH 6
1052#define MAX_WIDGET_PARAMETERS 12
1062 const float checker_params[3] = {
1125 const float checker_params[3] = {
1139 bool show_alpha_checkers)
1141 uchar inner_col1[4] = {0};
1142 uchar inner_col2[4] = {0};
1143 uchar emboss_col[4] = {0};
1144 uchar outline_col[4] = {0};
1145 uchar tria_col[4] = {0};
1148 show_alpha_checkers =
false;
1155 inner_col1[0] = inner_col2[0] = wcol->
inner[0];
1156 inner_col1[1] = inner_col2[1] = wcol->
inner[1];
1157 inner_col1[2] = inner_col2[2] = wcol->
inner[2];
1158 inner_col1[3] = inner_col2[3] = wcol->
inner[3];
1167 outline_col[0] = wcol->
outline[0];
1168 outline_col[1] = wcol->
outline[1];
1169 outline_col[2] = wcol->
outline[2];
1170 outline_col[3] = wcol->
outline[3];
1179 tria_col[0] = wcol->
item[0];
1180 tria_col[1] = wcol->
item[1];
1181 tria_col[2] = wcol->
item[2];
1182 tria_col[3] = wcol->
item[3];
1186 if (inner_col1[3] || inner_col2[3] || outline_col[3] || emboss_col[3] || tria_col[3] ||
1187 show_alpha_checkers)
1190 wtb, inner_col1, inner_col2, outline_col, emboss_col, tria_col, show_alpha_checkers);
1209#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
1211#define PREVIEW_PAD (0.15f * UI_UNIT_X)
1231 if (icon == ICON_NONE) {
1240 const int x = rect->
xmin +
w / 2 - size / 2;
1241 const int y = rect->
ymin + h / 2 - size / 2;
1251 const uchar mono_color[4])
1253 if (icon == ICON_NONE) {
1265 uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]};
1270 x, y, icon, aspect *
UI_INV_SCALE_FAC, alpha, desaturate, color, outline,
nullptr);
1325 if (icon && icon != ICON_BLANK1) {
1326 const float ofs = 1.0f / aspect;
1334 xs = rect->
xmin + 2.0f * ofs;
1337 xs = rect->
xmin + 2.0f * ofs;
1340 xs = rect->
xmin + 4.0f * ofs;
1344 xs = (rect->
xmin + rect->
xmax - height) / 2.0f;
1346 ys = (rect->
ymin + rect->
ymax - height) / 2.0f;
1349 if (aspect > 0.95f && aspect < 1.05f) {
1355 uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]};
1385 xs, ys, icon, aspect, alpha, desaturate, color, outline, &but->
icon_overlay_text);
1399 const int xs = rect->
xmax - tria_width;
1400 const int ys = (rect->
ymin + rect->
ymax - tria_height) / 2.0f;
1407 BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height);
1419 const int bytes =
str + but->
ofs - prev_utf8;
1427 const int bytes = next_utf8 - (
str + but->
ofs);
1439 const size_t max_len,
1440 const float okwidth,
1443 const float sep_strwidth,
1444 size_t *r_final_len)
1450 fstyle->
uifont_id,
str, max_len, okwidth - sep_strwidth,
nullptr);
1454 memcpy(
str + l_end, sep, sep_len + 1);
1456 *r_final_len = size_t(l_end) + sep_len;
1464 *r_final_len = size_t(l_end);
1472 const float minwidth,
1473 const size_t max_len,
1474 const char rpart_sep)
1483 if ((okwidth > 0.0f) && (strwidth > okwidth)) {
1485 const int sep_len =
sizeof(sep) - 1;
1489 float rpart_width = 0.0f;
1490 size_t rpart_len = 0;
1491 size_t final_lpart_len;
1494 rpart = strrchr(
str, rpart_sep);
1497 rpart_len = strlen(rpart);
1499 okwidth -= rpart_width;
1500 strwidth -= rpart_width;
1502 if (okwidth < 0.0f) {
1505 memmove(
str, rpart, rpart_len + 1);
1507 okwidth += rpart_width;
1508 strwidth = rpart_width;
1513 const float parts_strwidth = (okwidth - sep_strwidth) / 2.0f;
1522 fstyle->
uifont_id,
str, max_len, parts_strwidth,
nullptr);
1523 if (l_end < 10 ||
min_ff(parts_strwidth, strwidth - okwidth) < minwidth) {
1528 fstyle,
str, max_len, okwidth, sep, sep_len, sep_strwidth, &final_lpart_len);
1531 size_t r_offset, r_len;
1534 r_len = strlen(
str + r_offset) + 1;
1536 if (l_end + sep_len + r_len + rpart_len > max_len) {
1544 fstyle,
str, max_len, okwidth, sep, sep_len, sep_strwidth, &final_lpart_len);
1547 memmove(
str + l_end + sep_len,
str + r_offset, r_len);
1548 memcpy(
str + l_end, sep, sep_len);
1550 final_lpart_len = size_t(l_end + sep_len + r_len - 1);
1558 char *c =
str + l_end + sep_len;
1559 memmove(c, c + 1, r_len);
1566 memcpy(
str + final_lpart_len, rpart, rpart_len + 1);
1567 okwidth += rpart_width;
1579 BLI_assert((strwidth <= (okwidth + 2)) || (okwidth <= 0.0f));
1600 const size_t max_len =
sizeof(new_drawstr);
1626 const size_t max_len =
sizeof(new_drawstr);
1645 if (but->
ofs > but->
pos) {
1656 const int editstr_len = strlen(but->
editstr);
1657 int len = editstr_len;
1666 if (width > okwidth - 20) {
1671 if (width < 20 && but->ofs > 0) {
1697 int drawstr_len = but->
drawstr.size();
1701 const char *cpend = new_drawstr + drawstr_len;
1714 const int sep_len =
sizeof(sep) - 1;
1729 char *cpoin = strrchr(new_drawstr,
':');
1731 if (cpoin && (cpoin < cpend - 2)) {
1735 while (but->
strwidth > okwidth && cp2 > new_drawstr) {
1737 const int bytes = cp2 - prev_utf8;
1741 memmove(cp2 - bytes, cp2, drawstr_len + 1);
1744 drawstr_len -= bytes;
1747 new_drawstr + but->
ofs,
1748 sizeof(new_drawstr) - but->
ofs) +
1750 if (but->
strwidth < sep_strwidth) {
1756 while ((but->
strwidth > okwidth) && (but->
ofs < 2)) {
1759 fstyle->
uifont_id, new_drawstr + but->
ofs,
sizeof(new_drawstr) - but->
ofs);
1771 new_drawstr + but->
ofs,
1772 drawstr_len - but->
ofs,
1777 new_drawstr[drawstr_len] = 0;
1780 cpoin = strrchr(new_drawstr,
':');
1781 if (cpoin && (cpoin - new_drawstr > 0) && (drawstr_len < (
sizeof(new_drawstr) - sep_len))) {
1783 memmove(cpoin + sep_len, cpoin, cpend - cpoin);
1784 memcpy(cpoin, sep, sep_len);
1786 fstyle->
uifont_id, new_drawstr + but->
ofs,
sizeof(new_drawstr) - but->
ofs);
1792#ifdef WITH_INPUT_IME
1793static void widget_draw_text_ime_underline(
const uiFontStyle *fstyle,
1797 const wmIMEData *ime_data,
1798 const char *drawstr)
1802 int sel_start = ime_data->sel_start, sel_end = ime_data->sel_end;
1805 if (drawstr[0] != 0) {
1806 if (but->
pos >= but->
ofs) {
1814 fstyle->
uifont_id, drawstr + but->
ofs, ime_data->composite_len + but->
pos - but->
ofs);
1818 rect->
ymin + 6 *
U.pixelsize,
1819 min_ii(width, rect_x - 2) - ofs_x,
1824 if (sel_start != -1 && sel_end != -1) {
1825 sel_end -= sel_start;
1826 sel_start += but->
pos;
1828 if (sel_start >= but->
ofs) {
1838 rect->
ymin + 6 *
U.pixelsize,
1839 min_ii(width, rect_x - 2) - ofs_x,
1853 const char *drawstr = but->
drawstr.c_str();
1854 const char *drawstr_right =
nullptr;
1855 bool use_right_only =
false;
1858#ifdef WITH_INPUT_IME
1859 const wmIMEData *ime_data;
1888 drawstr_left_len = INT_MAX;
1890#ifdef WITH_INPUT_IME
1892 ime_data = ui_but_ime_data_get(but);
1894 if (ime_data && ime_data->composite_len) {
1897 STRNCPY(tmp_drawstr, drawstr);
1899 sizeof(tmp_drawstr),
1903 ime_data->str_composite,
1906 drawstr = but->
drawstr.c_str();
1925 drawstr = indeterminate_str;
1926 drawstr_left_len = strlen(drawstr);
1934#ifdef WITH_INPUT_IME
1935 bool ime_reposition_window =
false;
1936 int ime_win_x, ime_win_y;
1940 if ((but->
selend - but->
selsta) != 0 && drawstr[0] != 0) {
1951 strlen(drawstr + but->
ofs),
1954 for (
auto bounds : boxes) {
1957 rect->
ymin +
U.pixelsize,
1959 rect->
ymax -
U.pixelsize);
1964#ifdef WITH_INPUT_IME
1966 if (!ime_reposition_window && boxes.size() > 0) {
1967 ime_reposition_window =
true;
1968 ime_win_x = rect->
xmin + boxes[0].min;
1969 ime_win_y = rect->
ymin +
U.pixelsize;
1975 but_pos_ofs = but->
pos;
1977#ifdef WITH_INPUT_IME
1979 if (ime_data && ime_data->composite_len && ime_data->cursor_pos != -1) {
1980 but_pos_ofs += ime_data->cursor_pos;
1985 if (but->
pos >= but->
ofs) {
1990 but_pos_ofs - but->
ofs,
1991 max_ii(1,
int(
U.pixelsize * 2)));
2007 rect->
ymin +
U.pixelsize,
2008 rect->
xmin + t +
int(2.0f *
U.pixelsize),
2009 rect->
ymax -
U.pixelsize);
2013#ifdef WITH_INPUT_IME
2015 if (!ime_reposition_window) {
2016 ime_reposition_window =
true;
2017 ime_win_x = rect->
xmin + t + 5;
2018 ime_win_y = rect->
ymin + 3;
2023#ifdef WITH_INPUT_IME
2025 if (ime_reposition_window) {
2026 ui_but_ime_reposition(but, ime_win_x, ime_win_y,
false);
2028 if (ime_data && ime_data->composite_len) {
2030 widget_draw_text_ime_underline(fstyle, wcol, but, rect, ime_data, drawstr);
2036 ui_rasterpos_safe(x, y, but->aspect);
2037 transopts = ui_translate_buttons();
2040 bool use_drawstr_right_as_hint =
false;
2045 if (drawstr_right) {
2046 use_drawstr_right_as_hint =
true;
2047 drawstr_left_len = (drawstr_right - drawstr);
2052#ifdef USE_NUMBUTS_LR_ALIGN
2058 drawstr_right = strrchr(drawstr + but->
ofs,
':');
2059 if (drawstr_right) {
2061 drawstr_left_len = (drawstr_right - drawstr - 1);
2063 while (*drawstr_right ==
' ') {
2069 drawstr_right = drawstr + but->
ofs;
2070 use_right_only =
true;
2075 if (!use_right_only) {
2077 int font_xofs, font_yofs;
2079 int drawlen = (drawstr_left_len == INT_MAX) ? strlen(drawstr + but->
ofs) :
2080 (drawstr_left_len - but->
ofs);
2096 const char *drawstr_ofs = drawstr + but->
ofs;
2101 const char *drawstr_end = drawstr_ofs + drawlen;
2104 const char *drawstr_menu = strchr(drawstr_ofs, keys[i]);
2105 if (drawstr_menu !=
nullptr && drawstr_menu < drawstr_end) {
2106 ul_index =
int(drawstr_menu - drawstr_ofs);
2112 if (ul_index != -1) {
2118 int pos_x = rect->
xmin + font_xofs +
bounds.xmin +
2120 int pos_y = rect->
ymin + font_yofs +
bounds.ymin -
U.pixelsize;
2134 if (placeholder && placeholder[0]) {
2143 &style, rect, placeholder, strlen(placeholder),
col, &
params,
nullptr,
nullptr,
nullptr);
2148 if (drawstr_right) {
2151 if (use_drawstr_right_as_hint) {
2173 rect->
xmax -= 0.2 * icon_size;
2179 float alpha_this = alpha;
2183 if (op_icon->disabled) {
2186 else if (!op_icon->highlighted) {
2187 alpha_this *= 0.75f;
2191 const int old_drawflags = but->
drawflag;
2196 rect->
xmax -= icon_size;
2232 const float alpha =
float(wcol->
text[3]) / 255.0f;
2247 no_text_padding =
true;
2270 icon_size -= text_size;
2274 rect->
ymin += text_size;
2280 rect->
ymin -= text_size;
2281 rect->
ymax -= icon_size;
2292#ifdef USE_UI_TOOLBAR_HACK
2304#ifdef USE_UI_TOOLBAR_HACK
2319 rect->
xmin += 0.3f *
U.widget_unit;
2324 rect->
xmin += 0.2f *
U.widget_unit;
2330 if (show_menu_icon) {
2335#ifdef USE_UI_TOOLBAR_HACK
2342 if (!no_text_padding) {
2346 rect->
xmin += text_padding;
2351 rect->
xmin += text_padding;
2355 rect->
xmin += text_padding;
2358 rect->
xmax -= text_padding;
2366 rect->
xmin +=
U.pixelsize;
2369 rect->
xmax -=
U.pixelsize;
2387 else if (but->
drawstr[0] ==
'\0') {
2412#undef UI_TEXT_CLIP_MARGIN
2431 wcol_theme_s.
outline[3] *= factor;
2432 wcol_theme_s.
inner[3] *= factor;
2434 wcol_theme_s.
item[3] *= factor;
2435 wcol_theme_s.
text[3] *= factor;
2436 wcol_theme_s.
text_sel[3] *= factor;
2497 if (color_blend !=
nullptr) {
2510 if (color_blend !=
nullptr) {
2541 const uchar blue[4] = {86, 128, 194};
2559 return wcol->
roundness *
U.widget_unit * zoom;
2610 if (color_blend !=
nullptr) {
2748 const float outline =
U.pixelsize;
2764 const int block_flag,
2765 const int direction,
2810 const bool is_active)
2813 const float radius = zoom * (((is_active ? 20.0f : 12.0f) *
UI_SCALE_FAC) +
U.pixelsize);
2824 const float fg = std::min(1.0f - hsv[2] + 0.2f, 0.8f);
2825 const float bg = hsv[2] / 2.0f;
2845 const rcti *rect,
const float mx,
const float my,
float *r_val_rad,
float *r_val_dist)
2851 const float m_delta[2] = {mx - centx, my - centy};
2854 *r_val_dist = (dist_sq < (radius * radius)) ?
sqrtf(dist_sq) / radius : 1.0f;
2859 const ColorPicker *cpicker,
const rcti *rect,
const float *hsv,
float *r_xpos,
float *r_ypos)
2870 radius_t = (1.0f -
pow3f(1.0f - hsv[1]));
2876 const float rad =
clamp_f(radius_t, 0.0f, 1.0f) * radius;
2877 *r_xpos = centx +
cosf(-ang) * rad;
2878 *r_ypos = centy +
sinf(-ang) * rad;
2892 float rgb[3], hsv[3], rgb_center[3];
2903 CLAMP(hsv[2], 0.0f, 1.0f);
2917 const float hsv_center[3] = {0.0f, 0.0f, hsv[2]};
2921 if (!is_color_gamma) {
2936 for (
int a = 0; a <= tot; a++, ang += radstep) {
2937 const float si =
sinf(ang);
2938 const float co =
cosf(ang);
2943 rect, centx + co * radius, centy + si * radius, hsv_ang, hsv_ang + 1);
2944 hsv_ang[2] = hsv[2];
2949 if (!is_color_gamma) {
3000 const int steps = 48;
3001 const float color_step = 1.0f /
steps;
3003 const float h = hsv[0], s = hsv[1],
v = hsv[2];
3004 float dx, dy, sx1, sx2, sy;
3012 hsv_to_rgb(h, 0.0, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3013 hsv_to_rgb(h, 0.0, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3014 hsv_to_rgb(h, 0.0, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3015 hsv_to_rgb(h, 0.0, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3018 hsv_to_rgb(0.0, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3019 hsv_to_rgb(0.0, s, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3020 hsv_to_rgb(0.0, s, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3021 hsv_to_rgb(0.0, s, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3024 hsv_to_rgb(0.0, 0.0,
v, &col1[0][0], &col1[0][1], &col1[0][2]);
3025 hsv_to_rgb(0.0, 0.333,
v, &col1[1][0], &col1[1][1], &col1[1][2]);
3026 hsv_to_rgb(0.0, 0.666,
v, &col1[2][0], &col1[2][1], &col1[2][2]);
3027 hsv_to_rgb(0.0, 1.0,
v, &col1[3][0], &col1[3][1], &col1[3][2]);
3030 hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3036 hsv_to_rgb(1.0, 0.0, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]);
3042 hsv_to_rgb(1.0, 1.0, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]);
3049 hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]);
3065 for (dx = 0.0f; dx < 0.999f; dx += color_step) {
3066 const float dx_next = dx + color_step;
3077 hsv_to_rgb(h, dx, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3078 hsv_to_rgb(h, dx, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3079 hsv_to_rgb(h, dx, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3080 hsv_to_rgb(h, dx, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3083 hsv_to_rgb(dx_next, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3084 hsv_to_rgb(dx_next, s, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3085 hsv_to_rgb(dx_next, s, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3086 hsv_to_rgb(dx_next, s, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3089 hsv_to_rgb(dx_next, 0.0,
v, &col1[0][0], &col1[0][1], &col1[0][2]);
3090 hsv_to_rgb(dx_next, 0.333,
v, &col1[1][0], &col1[1][1], &col1[1][2]);
3091 hsv_to_rgb(dx_next, 0.666,
v, &col1[2][0], &col1[2][1], &col1[2][2]);
3092 hsv_to_rgb(dx_next, 1.0,
v, &col1[3][0], &col1[3][1], &col1[3][2]);
3097 hsv_to_rgb(dx_next, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3103 hsv_to_rgb(h, dx, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]);
3109 hsv_to_rgb(h, 1.0, dx, &col1[2][0], &col1[2][1], &col1[2][2]);
3124 for (a = 0; a < 3; a++, sy += dy) {
3125 immAttr4f(
col, col0[a][0], col0[a][1], col0[a][2], alpha);
3128 immAttr4f(
col, col1[a][0], col1[a][1], col1[a][2], alpha);
3131 immAttr4f(
col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
3134 immAttr4f(
col, col0[a][0], col0[a][1], col0[a][2], alpha);
3137 immAttr4f(
col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
3140 immAttr4f(
col, col0[a + 1][0], col0[a + 1][1], col0[a + 1][2], alpha);
3150 const uiButHSVCube *hsv_but,
const rcti *rect,
const float *hsv,
float *r_xp,
float *r_yp)
3152 float x = 0.0f, y = 0.0f;
3202 float x = 0.0f, y = 0.0f;
3251 rectf.
xmin -=
U.pixelsize;
3252 rectf.
xmax +=
U.pixelsize;
3253 rectf.
ymin -=
U.pixelsize;
3254 rectf.
ymax +=
U.pixelsize;
3257 const float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3262 const float inner[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3263 const float col2[4] = {0.0f, 0.0f, 0.0f, 0.0f};
3272 float rgb[3], hsv[3],
v;
3294 const float inner1[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3295 const float inner2[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3296 const float outline[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3304 float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3308 rectf.
xmin -=
U.pixelsize;
3309 rectf.
xmax +=
U.pixelsize;
3310 rectf.
ymin -=
U.pixelsize;
3311 rectf.
ymax +=
U.pixelsize;
3318 const float col2[4] = {
v,
v,
v, 1.0f};
3367#define NUM_BUT_PADDING_FACTOR 0.425f
3400 int roundboxalign_zone;
3414 rect_zone.
xmax = rect->
xmin + handle_width +
U.pixelsize;
3434 rect_zone.
xmin = rect->
xmax - handle_width -
U.pixelsize;
3453 rect_zone.
xmin = rect->
xmin + handle_width -
U.pixelsize;
3454 rect_zone.
xmax = rect->
xmax - handle_width +
U.pixelsize;
3469 if (!
state->is_text_input) {
3472 rect->
xmin += text_padding;
3473 rect->
xmax -= text_padding;
3595 if (wcol->
item[0] > 48) {
3596 wcol->
item[0] -= 48;
3598 if (wcol->
item[1] > 48) {
3599 wcol->
item[1] -= 48;
3601 if (wcol->
item[2] > 48) {
3602 wcol->
item[2] -= 48;
3604 wcol->
item[3] = 255;
3607 rcti slider_inset = *slider;
3608 slider_inset.
xmin += 0.05 *
U.widget_unit;
3609 slider_inset.
xmax -= 0.05 *
U.widget_unit;
3687 rcti rect_prog = *rect, rect_bar = *rect;
3699 w = std::max(
w, ofs);
3701 rect_bar.xmax = rect_bar.xmin +
w;
3721 const float ring_width = 0.6;
3722 const float outer_rad = (rect->
ymax - rect->
ymin) / 2.0f;
3723 const float inner_rad = outer_rad * ring_width;
3724 const float x = rect->
xmin + outer_rad;
3725 const float y = rect->
ymin + outer_rad;
3726 const float start = 0.0f;
3746 if (but_progress->
drawstr[0]) {
3783 uchar old_inner[3], old_outline[3];
3797 rect->
xmin = cent_x - radi;
3798 rect->
xmax = cent_x + radi;
3799 rect->
ymin = cent_y - radi;
3800 rect->
ymax = cent_y + radi;
3830 int roundboxalign_slider = roundboxalign;
3842 float factor, factor_ui;
3843 float factor_discard = 1.0f;
3845 const float softmin = but->
softmin;
3846 const float softmax = but->
softmax;
3847 const float softrange = softmax - softmin;
3850 switch (scale_type) {
3853 factor = value / softmax;
3856 factor = (value - softmin) / softrange;
3861 const float logmin =
fmaxf(softmin, 0.5e-8f);
3862 const float base = softmax / logmin;
3863 factor =
logf(value / logmin) /
logf(base);
3867 const float cubicmin =
cube_f(softmin);
3868 const float cubicmax =
cube_f(softmax);
3869 const float cubicrange = cubicmax - cubicmin;
3870 const float f = (value - softmin) * cubicrange / softrange + cubicmin;
3871 factor = (cbrtf(f) - softmin) / softrange;
3877 factor_ui = factor * width;
3880 const float min_width = 2.0f * rad;
3882 if (factor_ui > width - rad) {
3884 factor_discard = factor;
3886 else if (factor_ui > min_width) {
3889 rect1.
xmax = rect1.
xmin + factor_ui;
3894 rect1.
xmax = rect1.
xmin + min_width;
3895 factor_discard = factor_ui / min_width;
3917 if (!
state->is_text_input) {
3919 rect->
xmax -= text_padding;
3920 rect->
xmin += text_padding;
3925#define SWATCH_KEYED_BORDER 3
3981 const bool show_alpha_checkers = (wcol->
inner[3] < 255);
3995 const float width = rect->
xmax - rect->
xmin;
3996 const float height = rect->
ymax - rect->
ymin;
4000 bw += (bw < 0.5f) ? 0.5f : -0.5f;
4117 wcol->
inner[3] *= 1.0f - back[3];
4140 const float padding = zoom * 0.125f *
U.widget_unit;
4192 wcol->
inner[3] *= fac;
4194 wcol->
item[3] *= fac;
4195 wcol->
text[3] *= fac;
4209 rcti draw_rect = *rect;
4231 wcol->
inner[3] = 20;
4270 rcti recttemp = *rect;
4276 if (text_before_widget) {
4309 const float offset = delta * 0.9;
4310 if (text_before_widget) {
4311 rect->
xmax = recttemp.
xmin - offset;
4314 rect->
xmin = recttemp.
xmax + offset;
4376 if (but !=
nullptr && but->
col[3]) {
4410 const float rad = wcol->
roundness *
U.widget_unit;
4431 if (
state->has_hold_action) {
4458 uchar theme_col_tab_highlight[3];
4460#ifdef USE_TAB_SHADED_HIGHLIGHT
4477#ifdef USE_TAB_SHADED_HIGHLIGHT
4488#ifdef USE_TAB_SHADED_HIGHLIGHT
4493#ifndef USE_TAB_SHADED_HIGHLIGHT
4502 const float rad = wcol->
roundness *
U.widget_unit;
4736 rect->
ymax +=
U.pixelsize;
4739 rect->
xmin -=
U.pixelsize;
4810 switch (but->
type) {
4832 switch (but->
type) {
4854 switch (but->
type) {
4879#ifdef USE_UI_TOOLBAR_HACK
4960 if ((but->
str.empty() && but->
icon &&
5083 if (wt ==
nullptr) {
5103 state.is_text_input =
true;
5107 state.has_hold_action =
true;
5110 bool use_alpha_blend =
false;
5113 use_alpha_blend =
true;
5118#ifdef USE_UI_POPOVER_ONCE
5126 state.but_flag &= ~UI_BUT_OVERRIDDEN;
5130 state.but_flag &= ~UI_SELECT;
5138 else if (wt->
draw) {
5143 if (use_alpha_blend) {
5153 wt->
text(fstyle, &wt->
wcol, but, rect);
5154 if (use_alpha_blend) {
5163 float draw_color[4];
5166 draw_color[0] =
float(color[0]) / 255.0f;
5167 draw_color[1] =
float(color[1]) / 255.0f;
5168 draw_color[2] =
float(color[2]) / 255.0f;
5169 draw_color[3] = 1.0f;
5188 const float zoom = 1.0f / block->
aspect;
5205 const float unit_size,
5206 const float mval_origin[2])
5209 const float unit_half = unit_size / 2;
5210 const float cent_x = mval_origin ? std::clamp(mval_origin[0],
5211 rect->
xmin + unit_size,
5212 rect->
xmax - unit_size) :
5237 const int sign = is_down ? 1 : -1;
5238 float y = is_down ? rect->
ymax : rect->
ymin;
5248 y = y - sign * round(
U.pixelsize * 1.41);
5289 const uchar col1[4],
5290 const uchar col2[4],
5293 const float radius_ext_scale = (0.5f / radius_ext);
5308 for (
int i = 0; i < subd; i++) {
5309 const float a = start + ((i) /
float(subd - 1)) * angle;
5310 const float s =
sinf(a);
5311 const float c =
cosf(a);
5312 const float y1 = s * radius_int;
5313 const float y2 = s * radius_ext;
5317 const float fac = (y1 + radius_ext) * radius_ext_scale;
5325 const float fac = (y2 + radius_ext) * radius_ext_scale;
5344 const float pie_radius_internal =
UI_SCALE_FAC *
U.pie_menu_threshold;
5345 const float pie_radius_external =
UI_SCALE_FAC * (
U.pie_menu_threshold + 7.0f);
5347 const int subd = 40;
5349 const float angle =
atan2f(pie_dir[1], pie_dir[0]);
5353 const float range = (has_aligned && has_diagonal) ?
M_PI_4 :
M_PI_2;
5360 uchar col1[4], col2[4];
5367 0.0f,
float(
M_PI * 2.0), pie_radius_internal, pie_radius_external, subd, col1, col2,
true);
5372 pie_radius_internal,
5373 pie_radius_external,
5382 uchar col1[4], col2[4];
5390 pie_radius_internal,
5391 pie_radius_external,
5400 pie_radius_internal,
5401 pie_radius_external,
5419 if (
U.pie_menu_confirm > 0 &&
5422 const float pie_confirm_radius =
UI_SCALE_FAC * (pie_radius_internal +
U.pie_menu_confirm);
5424 (pie_radius_internal +
U.pie_menu_confirm + 7.0f);
5430 pie_confirm_external,
5453 const float color[4])
5469 else if (wt->
draw) {
5504 const rcti _rect = *rect;
5506 int max_hint_width = INT_MAX;
5507 int padding = 0.25f * row_height;
5508 char *cpoin =
nullptr;
5521 rect->
xmin += row_height;
5526 cpoin =
const_cast<char *
>(strrchr(name,
UI_SEP_CHAR));
5545 if ((name_width + hint_width) > available_width) {
5547 max_hint_width = available_width * 0.40f;
5549 rect->
xmax = (hint_width < max_hint_width) ?
5550 (rect->
xmax - hint_width) :
5551 (rect->
xmin + (available_width - max_hint_width));
5563 const size_t max_len =
sizeof(drawstr);
5571 int xofs = 0, yofs = 0;
5576 fstyle, rect, drawstr,
sizeof(drawstr), wt->
wcol.
text, &
params, &xofs, &yofs, &info);
5577 if (r_xmax !=
nullptr) {
5578 *r_xmax = xofs + info.
width;
5586 float height, aspect;
5612 const size_t max_len =
sizeof(hint_drawstr);
5615 STRNCPY(hint_drawstr, cpoin + 1);
5616 if (hint_drawstr[0] && (max_hint_width < INT_MAX)) {
5634 const uchar text_col[4],
5640 const bool has_text = !name.is_empty();
5647 const bool is_loading_icon = iconid == ICON_TEMP;
5648 if (is_loading_icon) {
5650 draw_as_icon =
true;
5656 rect->
ymin += text_size;
5672 trect.
ymax = trect.
ymin + text_size;
5680 const size_t max_len =
sizeof(drawstr);
5683 memcpy(drawstr, name.data(), name.size());
5684 drawstr[name.size()] =
'\0';
5688 params.align = text_align;
size_t BLF_width_to_strlen(int fontid, const char *str, size_t str_len, float width, float *r_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
blender::Vector< blender::Bounds< int > > BLF_str_selection_boxes(int fontid, const char *str, size_t str_len, size_t sel_start, size_t sel_length)
bool int BLF_str_offset_to_cursor(int fontid, const char *str, size_t str_len, size_t str_offset, int cursor_width)
bool BLF_str_offset_to_glyph_bounds(int fontid, const char *str, size_t str_offset, rcti *r_glyph_bounds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2
void BLF_disable(int fontid, int option)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
void BLF_position(int fontid, float x, float y, float z)
size_t BLF_width_to_rstrlen(int fontid, const char *str, size_t str_len, float width, float *r_width) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
#define ATTR_NONNULL(...)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE float cube_f(float a)
MINLINE float pow3f(float x)
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
#define rgba_float_args_set_ch(col, r, g, b, a)
void rgb_to_hsv_compat_v(const float rgb[3], float r_hsv[3])
MINLINE unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3])
MINLINE float rgb_to_grayscale(const float rgb[3])
void hsl_to_rgb_v(const float hsl[3], float r_rgb[3])
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
void rgb_to_hsl_v(const float rgb[3], float r_hsl[3])
void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3])
void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3_uchar(unsigned char target[3], const unsigned char a[3], const unsigned char b[3], float t)
MINLINE void add_v3_uchar_clamped(uchar r[3], int i)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct)
void BLI_rcti_pad(struct rcti *rect, int pad_x, int pad_y)
void BLI_rcti_translate(struct rcti *rect, int x, int y)
void BLI_rcti_resize_y(struct rcti *rect, int y)
void BLI_rctf_scale(rctf *rect, float scale)
void BLI_rcti_resize(struct rcti *rect, int x, int y)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rctf_pad(struct rctf *rect, float pad_x, float pad_y)
BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct)
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
void BLI_rcti_resize_x(struct rcti *rect, int x)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
bool BLI_rcti_is_empty(const struct rcti *rect)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct)
#define STRNCPY(dst, src)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
const char const char * BLI_str_find_next_char_utf8(const char *p, const char *str_end) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1
int BLI_str_utf8_size_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
const char * BLI_str_find_prev_char_utf8(const char *p, const char *str_start) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(1
#define BLI_STR_UTF8_HORIZONTAL_ELLIPSIS
#define UNUSED_VARS_NDEBUG(...)
void rect_copy(int dst[2][2], int src[2][2])
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
void GPU_batch_draw_instance_range(blender::gpu::Batch *batch, int instance_first, int instance_count)
#define GPU_batch_uniform_4fv_array(batch, name, len, val)
#define GPU_batch_uniform_3fv(batch, name, val)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, eGPUBuiltinShader shader_id)
void GPU_batch_draw(blender::gpu::Batch *batch)
void gpu_batch_presets_register(blender::gpu::Batch *preset_batch)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
blender::gpu::IndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
void GPU_indexbuf_add_tri_verts(GPUIndexBufBuilder *, uint v1, uint v2, uint v3)
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_2D_WIDGET_BASE_INST
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA
@ GPU_SHADER_2D_WIDGET_BASE
void GPU_program_point_size(bool enable)
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_vertbuf_attr_get_raw_data(blender::gpu::VertBuf *, uint a_idx, GPUVertBufRaw *access)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its red
#define UI_ALPHA_CHECKER_LIGHT
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void ui_draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha)
@ UI_EMBOSS_NONE_OR_STATUS
@ UI_BLOCK_NO_DRAW_OVERRIDDEN_STATE
void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const float color[4])
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
#define UI_ALPHA_CHECKER_DARK
@ UI_BUT_PROGRESS_TYPE_BAR
@ UI_BUT_PROGRESS_TYPE_RING
void UI_draw_roundbox_corner_set(int type)
void UI_fontstyle_draw_ex(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params, int *r_xofs, int *r_yofs, ResultBLF *r_info)
const uiStyle * UI_style_get()
void UI_fontstyle_set(const uiFontStyle *fs)
#define UI_VALUE_INDETERMINATE_CHAR
void UI_but_drawflag_disable(uiBut *but, int flag)
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, size_t str_len, const uchar col[4], const uiFontStyleDraw_Params *fs_params)
bool UI_but_is_tool(const uiBut *but)
@ UI_BUT_ALIGN_STITCH_TOP
@ UI_BUT_ANIMATED_CHANGED
@ UI_BUT_ALIGN_STITCH_LEFT
#define ICON_DEFAULT_HEIGHT
#define ICON_DEFAULT_HEIGHT_TOOLBAR
bool UI_icon_get_theme_color(int icon_id, unsigned char color[4])
#define UI_NO_ICON_OVERLAY_TEXT
void UI_icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border, const IconTextOverlay *text_overlay, const bool inverted=false)
void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
#define ICON_DEFAULT_WIDTH
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
int UI_ThemeMenuShadowWidth()
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
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
uiBut * ui_but_drag_multi_edit_get(uiBut *but)
PropertyScaleType ui_but_scale_type(const uiBut *but)
const char * ui_but_placeholder_get(uiBut *but)
double ui_but_value_get(uiBut *but)
void ui_window_to_block_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
void ui_block_cm_to_display_space_v3(uiBlock *block, float pixel[3])
bool ui_but_menu_draw_as_popover(const uiBut *but)
void ui_but_v3_get(uiBut *but, float vec[3])
bool ui_but_drag_is_draggable(const uiBut *but)
void ui_draw_but_HISTOGRAM(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_TRACKPREVIEW(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_IMAGE(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *rect)
void ui_draw_but_WAVEFORM(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_VECTORSCOPE(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_CURVE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rect, const float radius)
void ui_draw_but_CURVEPROFILE(ARegion *region, uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
void ui_draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
void ui_draw_but_COLORBAND(uiBut *but, const uiWidgetColors *wcol, const rcti *rect)
int ui_but_menu_direction(uiBut *but)
void ui_but_text_password_hide(char password_str[UI_MAX_PASSWORD_STR], uiBut *but, const bool restore)
void ui_perceptual_to_scene_linear_space(uiBut *but, float rgb[3])
void ui_color_picker_hsv_to_rgb(const float r_cp[3], float rgb[3])
#define UI_MENU_SUBMENU_PADDING
bool ui_block_is_pie_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
#define UI_RADIAL_MASK_ALL_DIAGONAL
#define UI_RADIAL_MASK_ALL_AXIS_ALIGNED
void ui_scene_linear_to_perceptual_space(uiBut *but, float rgb[3])
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
void ui_color_picker_rgb_to_hsv_compat(const float rgb[3], float r_cp[3])
@ UI_BLOCK_CONTAINS_SUBMENU_BUT
@ UI_SEARCH_FILTER_NO_MATCH
int ui_but_icon(const uiBut *but)
bool ui_but_is_popover_once_compat(const uiBut *but) ATTR_WARN_UNUSED_RESULT
bool ui_but_is_color_gamma(uiBut *but)
#define UI_PIXEL_AA_JITTER
@ UI_MENU_ITEM_SEPARATOR_NONE
@ UI_MENU_ITEM_SEPARATOR_HINT
@ UI_MENU_ITEM_SEPARATOR_SHORTCUT
@ ROUNDBOX_TRIA_HOLD_ACTION_ARROW
#define unit_float_to_uchar_clamp(val)
ccl_device_inline float2 fabs(const float2 a)
void node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[4], float scale)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
uiWidgetColors wcol_pulldown
uiWidgetColors wcol_numslider
uiWidgetColors wcol_list_item
uiWidgetColors wcol_progress
uiWidgetColors wcol_menu_back
float icon_border_intensity
uiWidgetColors wcol_menu_item
uiWidgetColors wcol_toggle
uiWidgetColors wcol_regular
uiWidgetColors wcol_tooltip
uiWidgetColors wcol_option
uiWidgetStateColors wcol_state
uiWidgetColors wcol_radio
uiWidgetColors wcol_scroll
uiWidgetColors wcol_pie_menu
uiWidgetColors wcol_toolbar_item
std::function< void(const bContext *, rcti *)> drawextra
eButGradientType gradient_type
eButProgressType progress_type
IconTextOverlay icon_overlay_text
uiHandleButtonData * active
uiButHandleHoldFunc hold_func