63#define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect))
147 cp[0] = int((1.0f - fac) * cp[0] + fac * cpstate[0]);
148 cp[1] = int((1.0f - fac) * cp[1] + fac * cpstate[1]);
149 cp[2] = int((1.0f - fac) * cp[2] + fac * cpstate[2]);
159 const int facm = 255 - faci;
161 r_col[0] = (faci * col1[0] + facm * col2[0]) / 256;
162 r_col[1] = (faci * col1[1] + facm * col2[1]) / 256;
163 r_col[2] = (faci * col1[2] + facm * col2[2]) / 256;
164 r_col[3] = (faci * col1[3] + facm * col2[3]) / 256;
172 const int delta = item_value - inner_value;
174 if (contrast > delta) {
179 if (contrast > -delta) {
187 float rgb[3], hsl[3];
230#define WIDGET_CURVE_RESOLU 9
231#define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU * 4)
299 {0.468813, -0.481430},
300 {-0.155755, -0.352820},
301 {0.219306, -0.238501},
302 {-0.393286, -0.110949},
303 {-0.024699, 0.013908},
304 {0.343805, 0.147431},
305 {-0.272855, 0.269918},
306 {0.095909, 0.388710},
308#define WIDGET_AA_JITTER UI_PIXEL_AA_JITTER
309#define jit ui_pixel_jitter
312 {-0.352077, 0.532607},
313 {-0.352077, -0.549313},
314 {0.330000, -0.008353},
321 {0.382684, 0.923879},
322 {0.000001, 1.000000},
323 {-0.382683, 0.923880},
324 {-0.707107, 0.707107},
325 {-0.923879, 0.382684},
326 {-1.000000, 0.000000},
327 {-0.923880, -0.382684},
328 {-0.707107, -0.707107},
329 {-0.382683, -0.923880},
330 {0.000000, -1.000000},
331 {0.382684, -0.923880},
332 {0.707107, -0.707107},
333 {0.923880, -0.382684},
334 {1.000000, -0.000000},
335 {0.923880, 0.382683},
336 {0.707107, 0.707107},
366 {-0.578579, 0.253369},
367 {-0.392773, 0.412794},
368 {-0.004241, -0.328551},
369 {-0.003001, 0.034320},
370 {1.055313, 0.864744},
371 {0.866408, 1.026895},
384 {-0.5 +
SC, 1.0 +
OY},
386 {0.5, 0.0 +
OY +
SC},
417 format,
"vflag", blender::gpu::VertAttrType::UINT_32);
443 *
data |= corner_v << 2;
445 *
data |= color << 12;
446 *
data |= (inner) ? (1 << 10) : 0;
447 *
data |= (emboss) ? (1 << 11) : 0;
487 for (
int c = 0; c < 4; c++) {
500 for (
int c1 = 0, c2 = 3; c1 < 2; c1++, c2--) {
525 float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
const float color[4])
527 const float tri_arr[3][2] = {{x1, y1}, {x2, y2}, {x3, y3}};
559 const float f3 = 0.05 *
U.widget_unit;
560 const float f5 = 0.15 *
U.widget_unit;
561 const float f7 = 0.25 *
U.widget_unit;
566 else if (dir ==
't') {
614 uiWidgetBase *wt,
int roundboxalign,
const rcti *rect,
float rad,
float radi)
617 const float minx = rect->
xmin, miny = rect->
ymin, maxx = rect->
xmax, maxy = rect->
ymax;
618 const float minxi = minx +
U.pixelsize;
619 const float maxxi = maxx -
U.pixelsize;
620 const float minyi = miny +
U.pixelsize;
621 const float maxyi = maxy -
U.pixelsize;
623 const float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f;
624 const float facyi = (maxyi != minyi) ? 1.0f / (maxyi - minyi) : 0.0f;
641 if (2.0f * rad > minsize) {
642 rad = 0.5f * minsize;
645 if (2.0f * (radi + 1.0f) > minsize) {
646 radi = 0.5f * minsize -
U.pixelsize;
671 wt->
inner_v[tot][0] = minxi + veci[a][1];
672 wt->
inner_v[tot][1] = minyi + radi - veci[a][0];
674 wt->
outer_v[tot][0] = minx + vec[a][1];
675 wt->
outer_v[tot][1] = miny + rad - vec[a][0];
697 wt->
inner_v[tot][0] = maxxi - radi + veci[a][0];
698 wt->
inner_v[tot][1] = minyi + veci[a][1];
700 wt->
outer_v[tot][0] = maxx - rad + vec[a][0];
701 wt->
outer_v[tot][1] = miny + vec[a][1];
725 wt->
inner_v[tot][0] = maxxi - veci[a][1];
726 wt->
inner_v[tot][1] = maxyi - radi + veci[a][0];
728 wt->
outer_v[tot][0] = maxx - vec[a][1];
729 wt->
outer_v[tot][1] = maxy - rad + vec[a][0];
751 wt->
inner_v[tot][0] = minxi + radi - veci[a][0];
752 wt->
inner_v[tot][1] = maxyi - veci[a][1];
754 wt->
outer_v[tot][0] = minx + rad - vec[a][0];
755 wt->
outer_v[tot][1] = maxy - vec[a][1];
796 const float verts[][2],
798 const uint tris[][3],
807 float centx =
float(rect->
xmin) + 0.4f * minsize;
808 float centy =
float(rect->
ymin) + 0.5f * minsize;
809 tria->
size = sizex = sizey = -0.5f * triasize * minsize;
812 centx =
float(rect->
xmax) - 0.4f * minsize;
815 else if (where ==
't') {
816 centx =
float(rect->
xmin) + 0.5f * minsize;
817 centy =
float(rect->
ymax) - 0.5f * minsize;
822 else if (where ==
'b') {
823 centx =
float(rect->
xmin) + 0.5f * minsize;
829 for (
int a = 0; a < verts_tot; a++) {
830 tria->
vec[a][0] = sizex *
verts[a][i1] + centx;
831 tria->
vec[a][1] = sizey *
verts[a][i2] + centy;
837 tria->
tot = tris_tot;
902 for (
int i = 0;
i < totvert;
i++) {
915 if ((width / height) < 0.5f) {
919 float centx, centy,
size;
928 if (width > height * 1.1f) {
930 tria->
center[0] = centx = rect->
xmax - 0.32f * height;
933 for (
int a = 0; a < 6; a++) {
944 float centx, centy,
size;
953 for (
int a = 0; a < 6; a++) {
980 const uchar *color,
short shadetop,
short shadedown,
uchar r_coltop[4],
uchar r_coldown[4])
982 r_coltop[0] = std::clamp(color[0] + shadetop, 0, 255);
983 r_coltop[1] = std::clamp(color[1] + shadetop, 0, 255);
984 r_coltop[2] = std::clamp(color[2] + shadetop, 0, 255);
985 r_coltop[3] = color[3];
987 r_coldown[0] = std::clamp(color[0] + shadedown, 0, 255);
988 r_coldown[1] = std::clamp(color[1] + shadedown, 0, 255);
989 r_coldown[2] = std::clamp(color[2] + shadedown, 0, 255);
990 r_coldown[3] = color[3];
998 for (a = 0; a < totvert; a++) {
1016 const bool alpha_check,
1017 const float discard_factor)
1042 const uchar *outline,
1043 const uchar *emboss,
1062#define MAX_WIDGET_BASE_BATCH 6
1063#define MAX_WIDGET_PARAMETERS 12
1073 const float checker_params[3] = {
1138 const float checker_params[3] = {
1152 uchar inner_col1[4] = {0};
1153 uchar inner_col2[4] = {0};
1154 uchar emboss_col[4] = {0};
1155 uchar outline_col[4] = {0};
1156 uchar tria_col[4] = {0};
1162 inner_col1[0] = inner_col2[0] = wcol->
inner[0];
1163 inner_col1[1] = inner_col2[1] = wcol->
inner[1];
1164 inner_col1[2] = inner_col2[2] = wcol->
inner[2];
1165 inner_col1[3] = inner_col2[3] = wcol->
inner[3];
1174 outline_col[0] = wcol->
outline[0];
1175 outline_col[1] = wcol->
outline[1];
1176 outline_col[2] = wcol->
outline[2];
1177 outline_col[3] = wcol->
outline[3];
1186 tria_col[0] = wcol->
item[0];
1187 tria_col[1] = wcol->
item[1];
1188 tria_col[2] = wcol->
item[2];
1189 tria_col[3] = wcol->
item[3];
1193 if (inner_col1[3] || inner_col2[3] || outline_col[3] || emboss_col[3] || tria_col[3]) {
1195 wtb, inner_col1, inner_col2, outline_col, emboss_col, tria_col);
1207 bool show_alpha_checkers)
1209 const uchar unused_col[4] = {0};
1210 uchar emboss_col[4] = {0};
1211 uchar outline_col[4] = {0};
1214 outline_col[0] = wcol->
outline[0];
1215 outline_col[1] = wcol->
outline[1];
1216 outline_col[2] = wcol->
outline[2];
1217 outline_col[3] = wcol->
outline[3];
1228 wtb, unused_col, unused_col, outline_col, emboss_col, unused_col);
1243#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
1245#define PREVIEW_PAD (0.15f * UI_UNIT_X)
1267 const uchar mono_color[4])
1269 if (icon == ICON_NONE) {
1281 uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]};
1298 const bool add_padding,
1300 const uchar mono_color[4])
1302 if (icon == ICON_NONE) {
1317 const int y = rect->
ymin + h / 2 -
size / 2;
1378 if (height > (rect->
xmax - rect->
xmin)) {
1379 alpha *= std::max(
float(rect->
xmax - rect->
xmin) / height, 0.0f);
1384 if (icon && icon != ICON_BLANK1) {
1385 const float ofs = 1.0f / aspect;
1393 xs = rect->
xmin + 2.0f * ofs;
1396 xs = rect->
xmin + 2.0f * ofs;
1399 xs = rect->
xmin + 4.0f * ofs;
1403 xs = (rect->
xmin + rect->
xmax - height) / 2.0f;
1405 ys = (rect->
ymin + rect->
ymax - height) / 2.0f;
1408 if (aspect > 0.95f && aspect < 1.05f) {
1414 uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]};
1445 xs, ys, icon, aspect, alpha, desaturate, color, outline, &but->
icon_overlay_text);
1459 const int xs = rect->
xmax - tria_width;
1460 const int ys = (rect->
ymin + rect->
ymax - tria_height) / 2.0f;
1467 BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height);
1479 const int bytes =
str + but->
ofs - prev_utf8;
1487 const int bytes = next_utf8 - (
str + but->
ofs);
1499 const size_t max_len,
1500 const float okwidth,
1503 const float sep_strwidth,
1504 size_t *r_final_len)
1510 fstyle->
uifont_id,
str, max_len, okwidth - sep_strwidth,
nullptr);
1514 memcpy(
str + l_end, sep, sep_len + 1);
1516 *r_final_len = size_t(l_end) + sep_len;
1524 *r_final_len = size_t(l_end);
1532 const float minwidth,
1533 const size_t max_len,
1534 const char rpart_sep,
1535 const bool clip_right_if_tight)
1544 if ((okwidth > 0.0f) && (strwidth > okwidth)) {
1546 const int sep_len =
sizeof(sep) - 1;
1550 float rpart_width = 0.0f;
1551 size_t rpart_len = 0;
1552 size_t final_lpart_len;
1555 rpart = strrchr(
str, rpart_sep);
1558 rpart_len = strlen(rpart);
1560 okwidth -= rpart_width;
1561 strwidth -= rpart_width;
1563 if (okwidth < 0.0f) {
1566 memmove(
str, rpart, rpart_len + 1);
1568 okwidth += rpart_width;
1569 strwidth = rpart_width;
1574 const float parts_strwidth = (okwidth - sep_strwidth) / 2.0f;
1583 fstyle->
uifont_id,
str, max_len, parts_strwidth,
nullptr);
1584 if (clip_right_if_tight &&
1585 (l_end < 10 ||
min_ff(parts_strwidth, strwidth - okwidth) < minwidth))
1591 fstyle,
str, max_len, okwidth, sep, sep_len, sep_strwidth, &final_lpart_len);
1594 size_t r_offset, r_len;
1597 r_len = strlen(
str + r_offset) + 1;
1599 if (l_end + sep_len + r_len + rpart_len > max_len) {
1607 fstyle,
str, max_len, okwidth, sep, sep_len, sep_strwidth, &final_lpart_len);
1610 memmove(
str + l_end + sep_len,
str + r_offset, r_len);
1611 memcpy(
str + l_end, sep, sep_len);
1613 final_lpart_len = size_t(l_end + sep_len + r_len - 1);
1624 char *c =
str + l_end + sep_len;
1625 memmove(c, c + 1, r_len);
1633 memcpy(
str + final_lpart_len, rpart, rpart_len + 1);
1634 okwidth += rpart_width;
1646 BLI_assert((strwidth <= (okwidth + 2)) || (okwidth <= 0.0f) ||
1669 const size_t max_len =
sizeof(new_drawstr);
1695 const size_t max_len =
sizeof(new_drawstr);
1703 char *clipped_str_buf,
1704 const size_t clipped_str_buf_maxncpy,
1705 const float max_line_width,
1706 const int max_lines)
1717 if (lines.
size() <= max_lines) {
1722 clipped_lines.
reserve(max_lines);
1724 if (max_lines == 1) {
1728 fstyle, clipped_str_buf, max_line_width,
UI_ICON_SIZE, clipped_str_buf_maxncpy,
'\0');
1729 clipped_lines.
append(clipped_str_buf);
1730 return clipped_lines;
1732 if (max_lines == 2) {
1733 clipped_lines.
append(lines[0]);
1739 clipped_str_buf_maxncpy,
1742 clipped_lines.
append(clipped_str_buf);
1743 return clipped_lines;
1748 const int middle_index = max_lines / 2;
1751 for (
int i = 0;
i < middle_index;
i++) {
1752 clipped_lines.
append(lines[
i]);
1757 BLI_strncpy(clipped_str_buf, lines[middle_index].
data(), clipped_str_buf_maxncpy);
1762 clipped_str_buf_maxncpy,
1765 clipped_lines.
append(clipped_str_buf);
1770 if ((middle_index + 1) < max_lines) {
1771 const char *remaining = lines[middle_index + 1].
data();
1772 size_t remaining_len = strlen(remaining);
1773 std::list<StringRef> last_lines;
1774 for (
int i = 0;
i < max_lines - (middle_index + 1) && remaining_len;
i++) {
1776 fstyle->
uifont_id, remaining, remaining_len, max_line_width,
nullptr);
1777 size_t line_len = remaining_len - offset;
1778 last_lines.emplace_front(remaining + offset,
int64_t(line_len));
1779 remaining_len = offset;
1783 clipped_lines.
append(line);
1787 return clipped_lines;
1804 but->
ofs = std::min(but->
ofs, but->
pos);
1813 const int editstr_len = strlen(but->
editstr);
1814 int len = editstr_len;
1823 if (width > okwidth - 20) {
1828 if (width < 20 && but->ofs > 0) {
1854 int drawstr_len = but->
drawstr.size();
1858 const char *cpend = new_drawstr + drawstr_len;
1871 const int sep_len =
sizeof(sep) - 1;
1886 char *cpoin = strrchr(new_drawstr,
':');
1888 if (cpoin && (cpoin < cpend - 2)) {
1892 while (but->
strwidth > okwidth && cp2 > new_drawstr) {
1894 const int bytes = cp2 - prev_utf8;
1898 memmove(cp2 - bytes, cp2, drawstr_len + 1);
1901 drawstr_len -= bytes;
1904 new_drawstr + but->
ofs,
1905 sizeof(new_drawstr) - but->
ofs) +
1907 if (but->
strwidth < sep_strwidth) {
1913 while ((but->
strwidth > okwidth) && (but->
ofs < 2)) {
1916 fstyle->
uifont_id, new_drawstr + but->
ofs,
sizeof(new_drawstr) - but->
ofs);
1928 new_drawstr + but->
ofs,
1929 drawstr_len - but->
ofs,
1934 new_drawstr[drawstr_len] = 0;
1937 cpoin = strrchr(new_drawstr,
':');
1938 if (cpoin && (cpoin - new_drawstr > 0) && (drawstr_len < (
sizeof(new_drawstr) - sep_len))) {
1940 memmove(cpoin + sep_len, cpoin, cpend - cpoin);
1941 memcpy(cpoin, sep, sep_len);
1943 fstyle->
uifont_id, new_drawstr + but->
ofs,
sizeof(new_drawstr) - but->
ofs);
1949#ifdef WITH_INPUT_IME
1950static void widget_draw_text_ime_underline(
const uiFontStyle *fstyle,
1954 const wmIMEData *ime_data,
1955 const char *drawstr)
1959 int sel_start = ime_data->sel_start, sel_end = ime_data->sel_end;
1962 if (drawstr[0] != 0) {
1963 if (but->
pos >= but->
ofs) {
1971 fstyle->
uifont_id, drawstr + but->
ofs, ime_data->composite.size() + but->
pos - but->
ofs);
1975 rect->
ymin + 6 *
U.pixelsize,
1976 min_ii(width, rect_x - 2) - ofs_x,
1981 if (sel_start != -1 && sel_end != -1) {
1982 sel_end -= sel_start;
1983 sel_start += but->
pos;
1985 if (sel_start >= but->
ofs) {
1995 rect->
ymin + 6 *
U.pixelsize,
1996 min_ii(width, rect_x - 2) - ofs_x,
2010 const char *drawstr = but->
drawstr.c_str();
2011 const char *drawstr_right =
nullptr;
2012 bool use_right_only =
false;
2015#ifdef WITH_INPUT_IME
2016 const wmIMEData *ime_data;
2045 drawstr_left_len = INT_MAX;
2047#ifdef WITH_INPUT_IME
2049 ime_data = ui_but_ime_data_get(but);
2051 if (ime_data && ime_data->composite.size()) {
2054 STRNCPY(tmp_drawstr, drawstr);
2056 sizeof(tmp_drawstr),
2060 ime_data->composite.c_str(),
2063 drawstr = but->
drawstr.c_str();
2082 drawstr = indeterminate_str;
2083 drawstr_left_len = strlen(drawstr);
2091#ifdef WITH_INPUT_IME
2092 bool ime_reposition_window =
false;
2093 int ime_win_x, ime_win_y;
2097 if ((but->
selend - but->
selsta) != 0 && drawstr[0] != 0) {
2108 strlen(drawstr + but->
ofs),
2111 for (
auto bounds : boxes) {
2114 rect->
ymin +
U.pixelsize,
2116 rect->
ymax -
U.pixelsize);
2121#ifdef WITH_INPUT_IME
2123 if (!ime_reposition_window && boxes.size() > 0) {
2124 ime_reposition_window =
true;
2125 ime_win_x = rect->
xmin + boxes[0].min;
2126 ime_win_y = rect->
ymin +
U.pixelsize;
2132 but_pos_ofs = but->
pos;
2134#ifdef WITH_INPUT_IME
2136 if (ime_data && ime_data->composite.size() && ime_data->cursor_pos != -1) {
2137 but_pos_ofs += ime_data->cursor_pos;
2142 if (but->
pos >= but->
ofs) {
2147 but_pos_ofs - but->
ofs,
2148 max_ii(1,
int(
U.pixelsize * 2)));
2164 rect->
ymin +
U.pixelsize,
2165 rect->
xmin + t +
int(2.0f *
U.pixelsize),
2166 rect->
ymax -
U.pixelsize);
2170#ifdef WITH_INPUT_IME
2172 if (!ime_reposition_window) {
2173 ime_reposition_window =
true;
2174 ime_win_x = rect->
xmin + t + 5;
2175 ime_win_y = rect->
ymin + 3;
2180#ifdef WITH_INPUT_IME
2182 if (ime_reposition_window) {
2183 ui_but_ime_reposition(but, ime_win_x, ime_win_y,
false);
2185 if (ime_data && ime_data->composite.size()) {
2187 widget_draw_text_ime_underline(fstyle, wcol, but, rect, ime_data, drawstr);
2193 ui_rasterpos_safe(
x,
y, but->aspect);
2194 transopts = ui_translate_buttons();
2197 bool use_drawstr_right_as_hint =
false;
2202 if (drawstr_right) {
2203 use_drawstr_right_as_hint =
true;
2204 drawstr_left_len = (drawstr_right - drawstr);
2209#ifdef USE_NUMBUTS_LR_ALIGN
2215 drawstr_right = strrchr(drawstr + but->
ofs,
':');
2216 if (drawstr_right) {
2218 drawstr_left_len = (drawstr_right - drawstr - 1);
2220 while (*drawstr_right ==
' ') {
2226 drawstr_right = drawstr + but->
ofs;
2227 use_right_only =
true;
2232 if (!use_right_only) {
2234 int font_xofs, font_yofs;
2236 int drawlen = (drawstr_left_len == INT_MAX) ? strlen(drawstr + but->
ofs) :
2237 (drawstr_left_len - but->
ofs);
2253 const char *drawstr_ofs = drawstr + but->
ofs;
2258 const char *drawstr_end = drawstr_ofs + drawlen;
2261 const char *drawstr_menu = strchr(drawstr_ofs, keys[
i]);
2262 if (drawstr_menu !=
nullptr && drawstr_menu < drawstr_end) {
2263 ul_index = int(drawstr_menu - drawstr_ofs);
2269 if (ul_index != -1) {
2275 int pos_x = rect->
xmin + font_xofs +
bounds.xmin +
2277 int pos_y = rect->
ymin + font_yofs +
bounds.ymin -
U.pixelsize;
2291 if (placeholder && placeholder[0]) {
2300 &style, rect, placeholder, strlen(placeholder),
col, &
params,
nullptr,
nullptr,
nullptr);
2305 if (drawstr_right) {
2308 if (use_drawstr_right_as_hint) {
2330 rect->
xmax -= 0.2 * icon_size;
2336 float alpha_this = alpha;
2340 if (op_icon->disabled) {
2343 else if (!op_icon->highlighted) {
2344 alpha_this *= 0.75f;
2348 const int old_drawflags = but->
drawflag;
2353 rect->
xmax -= icon_size;
2389 const float alpha =
float(wcol->
text[3]) / 255.0f;
2404 no_text_padding =
true;
2429 icon_size -= text_size;
2433 rect->
ymin += text_size;
2444 rect->
ymin -= text_size;
2445 rect->
ymax -= icon_size;
2456#ifdef USE_UI_TOOLBAR_HACK
2468#ifdef USE_UI_TOOLBAR_HACK
2483 rect->
xmin += 0.3f *
U.widget_unit;
2488 rect->
xmin += 0.2f *
U.widget_unit;
2494 if (show_menu_icon) {
2499#ifdef USE_UI_TOOLBAR_HACK
2506 if (!no_text_padding) {
2510 rect->
xmin += text_padding;
2515 rect->
xmin += text_padding;
2519 rect->
xmin += text_padding;
2522 rect->
xmax -= text_padding;
2530 rect->
xmin +=
U.pixelsize;
2533 rect->
xmax -=
U.pixelsize;
2551 else if (but->
drawstr[0] ==
'\0') {
2576#undef UI_TEXT_CLIP_MARGIN
2595 wcol_theme_s.
outline[3] *= factor;
2597 wcol_theme_s.
inner[3] *= factor;
2599 wcol_theme_s.
item[3] *= factor;
2600 wcol_theme_s.
text[3] *= factor;
2601 wcol_theme_s.
text_sel[3] *= factor;
2667 if (color_blend !=
nullptr) {
2681 if (color_blend !=
nullptr) {
2715 const uchar blue[4] = {86, 128, 194};
2733 return wcol->
roundness *
U.widget_unit * zoom;
2784 if (color_blend !=
nullptr) {
2935 const float outline =
U.pixelsize;
2951 const int block_flag,
2952 const int direction,
2997 const bool is_active)
3000 const float radius = zoom * (((is_active ? 20.0f : 12.0f) *
UI_SCALE_FAC) +
U.pixelsize);
3011 const float fg = std::min(1.0f - hsv[2] + 0.2f, 0.8f);
3012 const float bg = hsv[2] / 2.0f;
3032 const rcti *rect,
const float mx,
const float my,
float *r_val_rad,
float *r_val_dist)
3038 const float m_delta[2] = {mx - centx, my - centy};
3041 *r_val_dist = (dist_sq < (radius * radius)) ?
sqrtf(dist_sq) / radius : 1.0f;
3046 const ColorPicker *cpicker,
const rcti *rect,
const float *hsv,
float *r_xpos,
float *r_ypos)
3057 radius_t = (1.0f -
pow3f(1.0f - hsv[1]));
3063 const float rad =
clamp_f(radius_t, 0.0f, 1.0f) * radius;
3064 *r_xpos = centx +
cosf(-ang) * rad;
3065 *r_ypos = centy +
sinf(-ang) * rad;
3079 float rgb[3], hsv[3], rgb_center[3], rgb_perceptual[3];
3091 if (!is_color_gamma) {
3095 CLAMP(hsv[2], 0.0f, 1.0f);
3109 const float hsv_center[3] = {0.0f, 0.0f, hsv[2]};
3113 if (!is_color_gamma) {
3120 format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32);
3129 for (
int a = 0; a <= tot; a++, ang += radstep) {
3130 const float si =
sinf(ang);
3131 const float co =
cosf(ang);
3136 rect, centx + co * radius, centy + si * radius, hsv_ang, hsv_ang + 1);
3137 hsv_ang[2] = hsv[2];
3142 if (!is_color_gamma) {
3203 const int steps = 48;
3204 const float color_step = 1.0f / steps;
3206 const float h = hsv[0], s = hsv[1],
v = hsv[2];
3207 float dx, dy, sx1, sx2, sy;
3262 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
3264 format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32_32);
3270 for (dx = 0.0f; dx < 0.999f; dx += color_step) {
3271 const float dx_next = dx + color_step;
3329 for (a = 0; a < 3; a++, sy += dy) {
3330 immAttr4f(
col, col0[a][0], col0[a][1], col0[a][2], alpha);
3333 immAttr4f(
col, col1[a][0], col1[a][1], col1[a][2], alpha);
3336 immAttr4f(
col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
3339 immAttr4f(
col, col0[a][0], col0[a][1], col0[a][2], alpha);
3342 immAttr4f(
col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
3345 immAttr4f(
col, col0[a + 1][0], col0[a + 1][1], col0[a + 1][2], alpha);
3355 const uiButHSVCube *hsv_but,
const rcti *rect,
const float *hsv,
float *r_xp,
float *r_yp)
3357 float x = 0.0f,
y = 0.0f;
3406 float rgb[3], rgb_perceptual[3];
3407 float x = 0.0f,
y = 0.0f;
3457 const float cursor_width = std::max(
BLI_rctf_size_y(&rectf) * 0.35f, 1.0f);
3458 rectf.
xmin =
x - cursor_width;
3459 rectf.
xmax =
x + cursor_width;
3463 rectf.
xmin -=
U.pixelsize;
3464 rectf.
xmax +=
U.pixelsize;
3465 rectf.
ymin -=
U.pixelsize;
3466 rectf.
ymax +=
U.pixelsize;
3469 const float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3474 const float inner[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3475 const float col2[4] = {0.0f, 0.0f, 0.0f, 0.0f};
3484 float rgb[3], hsv[3],
v;
3506 const float inner1[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3507 const float inner2[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3508 const float outline[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3510 const float outline_width = (
BLI_rctf_size_x(&rectf) < 4.0f) ? 0.0f : 1.0f;
3516 const float cursor_height = std::max(
BLI_rctf_size_x(&rectf) * 0.35f, 1.0f);
3517 rectf.
ymin =
y - cursor_height;
3518 rectf.
ymax =
y + cursor_height;
3519 float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3523 rectf.
xmin -=
U.pixelsize;
3524 rectf.
xmax +=
U.pixelsize;
3525 rectf.
ymin -=
U.pixelsize;
3526 rectf.
ymax +=
U.pixelsize;
3533 const float col2[4] = {
v,
v,
v, 1.0f};
3582#define NUM_BUT_PADDING_FACTOR 0.425f
3612 !
state->is_text_input)
3617 int roundboxalign_zone;
3627 wcol_zone.
item[3] = 180;
3634 rect_zone.
xmax = rect->
xmin + handle_width +
U.pixelsize;
3650 wcol_zone.
item[3] = 180;
3657 rect_zone.
xmin = rect->
xmax - handle_width -
U.pixelsize;
3678 rect_zone.
xmin = rect->
xmin + handle_width -
U.pixelsize;
3679 rect_zone.
xmax = rect->
xmax - handle_width +
U.pixelsize;
3694 if (!
state->is_text_input) {
3697 rect->
xmin += text_padding;
3698 rect->
xmax -= text_padding;
3827 if (lightness > 70) {
3831 wcol->
item[3] = 128;
3834 wcol->
item[0] = 255;
3835 wcol->
item[1] = 255;
3836 wcol->
item[2] = 255;
3837 wcol->
item[3] = 128;
3841 rcti slider_inset = *slider;
3842 slider_inset.
xmin += 0.05 *
U.widget_unit;
3843 slider_inset.
xmax -= 0.05 *
U.widget_unit;
3921 rcti rect_prog = *rect, rect_bar = *rect;
3933 w = std::max(
w, ofs);
3935 rect_bar.xmax = rect_bar.xmin +
w;
3955 const float ring_width = 0.6;
3956 const float outer_rad = (rect->
ymax - rect->
ymin) / 2.0f;
3957 const float inner_rad = outer_rad * ring_width;
3958 const float x = rect->
xmin + outer_rad;
3959 const float y = rect->
ymin + outer_rad;
3960 const float start = 0.0f;
3964 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
3981 if (but_progress->
drawstr[0]) {
4018 outline_color.
a = 1.0f;
4025 socket_rect.
xmin = cent_x - socket_radius;
4026 socket_rect.
xmax = cent_x + socket_radius;
4027 socket_rect.
ymin = cent_y - socket_radius;
4028 socket_rect.
ymax = cent_y + socket_radius;
4062 int roundboxalign_slider = roundboxalign;
4074 float factor, factor_ui;
4075 float factor_discard = 1.0f;
4077 const float softmin = but->
softmin;
4078 const float softmax = but->
softmax;
4079 const float softrange = softmax - softmin;
4082 switch (scale_type) {
4085 factor = value / softmax;
4088 factor = (value - softmin) / softrange;
4093 const float logmin =
fmaxf(softmin, 0.5e-8f);
4094 const float base = softmax / logmin;
4095 factor =
logf(value / logmin) /
logf(base);
4099 const float cubicmin =
cube_f(softmin);
4100 const float cubicmax =
cube_f(softmax);
4101 const float cubicrange = cubicmax - cubicmin;
4102 const float f = (value - softmin) * cubicrange / softrange + cubicmin;
4103 factor = (cbrtf(f) - softmin) / softrange;
4109 factor_ui = factor * width;
4112 const float min_width = 2.0f * rad;
4114 if (factor_ui > width - rad) {
4116 factor_discard = factor;
4118 else if (factor_ui > min_width) {
4121 rect1.
xmax = rect1.
xmin + factor_ui;
4126 rect1.
xmax = rect1.
xmin + min_width;
4127 factor_discard = factor_ui / min_width;
4149 if (!
state->is_text_input) {
4151 rect->
xmax -= text_padding;
4152 rect->
xmin += text_padding;
4157#define SWATCH_KEYED_BORDER 3
4212 const bool show_alpha_checkers =
col[3] < 1.0f;
4224 const float width = rect->
xmax - rect->
xmin;
4225 const float height = rect->
ymax - rect->
ymin;
4229 bw += (bw < 0.5f) ? 0.5f : -0.5f;
4345 wcol->
inner[3] *= 1.0f - back[3];
4368 const float padding = zoom * 0.125f *
U.widget_unit;
4417 wcol->
inner[3] *= fac;
4419 wcol->
item[3] *= fac;
4420 wcol->
text[3] *= fac;
4434 rcti draw_rect = *rect;
4462 wcol->
inner[3] = is_selected ? 255 : 20;
4498 rcti recttemp = *rect;
4504 if (text_before_widget) {
4537 const float offset = delta * 0.9;
4538 if (text_before_widget) {
4539 rect->
xmax = recttemp.
xmin - offset;
4542 rect->
xmin = recttemp.
xmax + offset;
4606 if (but !=
nullptr && but->
col[3]) {
4645 const float rad = wcol->
roundness *
U.widget_unit;
4666 if (
state->has_hold_action) {
4693 uchar theme_col_tab_highlight[3];
4695#ifdef USE_TAB_SHADED_HIGHLIGHT
4712#ifdef USE_TAB_SHADED_HIGHLIGHT
4723#ifdef USE_TAB_SHADED_HIGHLIGHT
4728#ifndef USE_TAB_SHADED_HIGHLIGHT
4737 const float rad = wcol->
roundness *
U.widget_unit;
4971 rect->
ymax +=
U.pixelsize;
4974 rect->
xmin -=
U.pixelsize;
5061 switch (but->
type) {
5084 switch (but->
type) {
5096 if (but->
icon == 0) {
5117 switch (but->
type) {
5142#ifdef USE_UI_TOOLBAR_HACK
5333 if (wt ==
nullptr) {
5354 state.is_text_input =
true;
5358 state.has_hold_action =
true;
5361 bool use_alpha_blend =
false;
5364 use_alpha_blend =
true;
5369#ifdef USE_UI_POPOVER_ONCE
5389 else if (wt->
draw) {
5394 if (use_alpha_blend) {
5404 wt->
text(fstyle, &wt->
wcol, but, rect);
5405 if (use_alpha_blend) {
5414 float draw_color[4];
5420 draw_color[3] = 1.0f;
5457 const float radius = (bg_radius > (line_width * 2.0f)) ? 0.0f : bg_radius;
5458 const float padding = (bg_radius > (line_width * 2.0f)) ? bg_radius : 0.0f;
5461 line_rect.
ymin = line_rect.
ymax - line_width;
5473 const float zoom = 1.0f / block->
aspect;
5498 const float unit_size,
5499 const float mval_origin[2])
5502 const float unit_half = unit_size / 2;
5503 const float cent_x = mval_origin ? std::clamp(mval_origin[0],
5504 rect->
xmin + unit_size,
5505 rect->
xmax - unit_size) :
5530 const int sign = is_down ? 1 : -1;
5531 float y = is_down ? rect->
ymax : rect->
ymin;
5582 const uchar col1[4],
5583 const uchar col2[4],
5586 const float radius_ext_scale = (0.5f / radius_ext);
5591 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
5602 for (
int i = 0;
i < subd;
i++) {
5603 const float a = start + ((
i) /
float(subd - 1)) *
angle;
5604 const float s =
sinf(a);
5605 const float c =
cosf(a);
5606 const float y1 = s * radius_int;
5607 const float y2 = s * radius_ext;
5611 const float fac = (y1 + radius_ext) * radius_ext_scale;
5621 const float fac = (y2 + radius_ext) * radius_ext_scale;
5642 const float pie_radius_internal =
UI_SCALE_FAC *
U.pie_menu_threshold;
5643 const float pie_radius_external =
UI_SCALE_FAC * (
U.pie_menu_threshold + 7.0f);
5645 const int subd = 40;
5647 const float angle =
atan2f(pie_dir[1], pie_dir[0]);
5651 const float range = (has_aligned && has_diagonal) ?
M_PI_4 :
M_PI_2;
5658 uchar col1[4], col2[4];
5665 0.0f,
float(
M_PI * 2.0), pie_radius_internal, pie_radius_external, subd, col1, col2,
true);
5670 pie_radius_internal,
5671 pie_radius_external,
5680 uchar col1[4], col2[4];
5688 pie_radius_internal,
5689 pie_radius_external,
5698 pie_radius_internal,
5699 pie_radius_external,
5709 format,
"pos", blender::gpu::VertAttrType::SFLOAT_32_32);
5718 if (
U.pie_menu_confirm > 0 &&
5721 const float pie_confirm_radius =
UI_SCALE_FAC * (pie_radius_internal +
U.pie_menu_confirm);
5723 (pie_radius_internal +
U.pie_menu_confirm + 7.0f);
5729 pie_confirm_external,
5752 const float color[4])
5768 else if (wt->
draw) {
5798 const bool use_unpadded,
5806 const rcti _rect = *rect;
5808 int max_hint_width = INT_MAX;
5809 int padding = 0.25f * row_height;
5810 char *cpoin =
nullptr;
5813 state.but_flag = but_flag;
5826 rect->
xmin += row_height;
5850 if ((name_width + hint_width) > available_width) {
5852 max_hint_width = available_width * 0.40f;
5854 rect->
xmax = (hint_width < max_hint_width) ?
5855 (rect->
xmax - hint_width) :
5856 (rect->
xmin + (available_width - max_hint_width));
5868 const size_t max_len =
sizeof(drawstr);
5876 int xofs = 0, yofs = 0;
5881 fstyle, rect, drawstr,
sizeof(drawstr), wt->
wcol.
text, &
params, &xofs, &yofs, &info);
5882 if (r_xmax !=
nullptr) {
5883 *r_xmax = xofs + info.
width;
5894 const float aspect =
U.inv_scale_factor / zoom;
5914 const size_t max_len =
sizeof(hint_drawstr);
5918 if (hint_drawstr[0] && (max_hint_width < INT_MAX)) {
5936 const uchar text_col[4],
5938 const bool add_padding)
5942 const bool has_text = !
name.is_empty();
5948 rect->
ymin += text_size;
5959 trect.
ymax = trect.
ymin + text_size;
5969 const size_t max_len =
sizeof(drawstr);
5972 memcpy(drawstr,
name.data(),
name.size());
5973 drawstr[
name.size()] =
'\0';
5977 params.align = text_align;
5993 state.but_flag = but_flag;
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::StringRef > BLF_string_wrap(int fontid, blender::StringRef str, const int max_pixel_width, BLFWrapMode mode=BLFWrapMode::Minimal)
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_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_disable(int fontid, FontFlags flag)
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 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 void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[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)
MINLINE void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
MINLINE void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3])
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE unsigned char srgb_to_grayscale_byte(const unsigned char rgb[3])
void rgb_to_hsl_v(const float rgb[3], float r_hsl[3])
MINLINE float srgb_to_grayscale(const float rgb[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)
char * STRNCPY(char(&dst)[N], const char *src)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
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
ptrdiff_t BLI_str_utf8_invalid_byte(const char *str, size_t str_len) 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 STRNCPY_UTF8(dst, src)
#define BLI_STR_UTF8_HORIZONTAL_ELLIPSIS
#define UNUSED_VARS_NDEBUG(...)
void rect_copy(int dst[2][2], int src[2][2])
@ SOCK_DISPLAY_SHAPE_CIRCLE
@ USER_ALWAYS_SHOW_NUMBER_ARROWS
void GPU_batch_draw_instance_range(blender::gpu::Batch *batch, int instance_first, int instance_count)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, GPUBuiltinShader shader_id)
#define GPU_batch_uniform_4fv_array(batch, name, len, val)
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
#define GPU_batch_uniform_3fv(batch, name, val)
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_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_blend(GPUBlend blend)
void GPU_vertbuf_attr_get_raw_data(blender::gpu::VertBuf *, uint a_idx, GPUVertBufRaw *access)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
static blender::gpu::VertBuf * GPU_vertbuf_create_with_format(const GPUVertFormat &format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
void IMB_colormanagement_color_picking_to_scene_linear_v3(float scene_linear[3], const float color_picking[3])
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], const ColorManagedDisplay *display, const ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
#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_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
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)
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)
@ UI_BLOCK_THEME_STYLE_POPUP
@ UI_BUT_NO_PREVIEW_PADDING
@ UI_BUT_ALIGN_STITCH_TOP
@ UI_BUT_ANIMATED_CHANGED
@ UI_BUT_ALIGN_STITCH_LEFT
bool UI_but_is_tool(const uiBut *but)
#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
blender::ocio::Display ColorManagedDisplay
void UI_GetThemeColor3ubv(int colorid, unsigned char col[3])
void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
int UI_ThemeMenuShadowWidth()
BMesh const char void * data
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.
void append(const T &value)
void reserve(const int64_t min_capacity)
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
const ColorManagedDisplay * ui_block_cm_display_get(uiBlock *block)
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_IMAGE(ARegion *, uiBut *but, const uiWidgetColors *, const rcti *rect)
void ui_draw_but_WAVEFORM(ARegion *region, 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_HISTOGRAM(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_TRACKPREVIEW(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
void ui_draw_but_UNITVEC(uiBut *but, const uiWidgetColors *wcol, const rcti *rect, const float radius)
void ui_draw_but_VECTORSCOPE(ARegion *region, uiBut *but, const uiWidgetColors *, const rcti *recti)
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)
const float ui_pixel_jitter[UI_PIXEL_AA_JITTER][2]
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
@ ROUNDBOX_TRIA_HOLD_ACTION_ARROW
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
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
ccl_device_inline float2 fabs(const float2 a)
void node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[4], float scale)
void node_draw_nodesocket(const rctf *rect, const float color_inner[4], const float color_outline[4], float outline_thickness, int shape, float aspect)
ColorTheme4< float > ColorTheme4f
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_curve
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
uiBlockAlertLevel alert_level
uiBut * next_but(const uiBut *but) const
eButGradientType gradient_type
blender::ui::ButProgressType progress_type
blender::ui::AbstractViewItem * view_item
IconTextOverlay icon_overlay_text
blender::ui::EmbossType emboss
uiHandleButtonData * active
uiButHandleHoldFunc hold_func