57#define ICON_SIZE_FROM_BUTRECT(rect) (0.8f * BLI_rcti_size_y(rect))
139 cp[0] = int((1.0f - fac) * cp[0] + fac * cpstate[0]);
140 cp[1] = int((1.0f - fac) * cp[1] + fac * cpstate[1]);
141 cp[2] = int((1.0f - fac) * cp[2] + fac * cpstate[2]);
151 const int facm = 255 - faci;
153 r_col[0] = (faci * col1[0] + facm * col2[0]) / 256;
154 r_col[1] = (faci * col1[1] + facm * col2[1]) / 256;
155 r_col[2] = (faci * col1[2] + facm * col2[2]) / 256;
156 r_col[3] = (faci * col1[3] + facm * col2[3]) / 256;
164 const int delta = item_value - inner_value;
166 if (contrast > delta) {
171 if (contrast > -delta) {
179 float rgb[3], hsl[3];
222#define WIDGET_CURVE_RESOLU 9
223#define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU * 4)
291 {0.468813, -0.481430},
292 {-0.155755, -0.352820},
293 {0.219306, -0.238501},
294 {-0.393286, -0.110949},
295 {-0.024699, 0.013908},
296 {0.343805, 0.147431},
297 {-0.272855, 0.269918},
298 {0.095909, 0.388710},
300#define WIDGET_AA_JITTER UI_PIXEL_AA_JITTER
301#define jit ui_pixel_jitter
304 {-0.352077, 0.532607},
305 {-0.352077, -0.549313},
306 {0.330000, -0.008353},
313 {0.382684, 0.923879},
314 {0.000001, 1.000000},
315 {-0.382683, 0.923880},
316 {-0.707107, 0.707107},
317 {-0.923879, 0.382684},
318 {-1.000000, 0.000000},
319 {-0.923880, -0.382684},
320 {-0.707107, -0.707107},
321 {-0.382683, -0.923880},
322 {0.000000, -1.000000},
323 {0.382684, -0.923880},
324 {0.707107, -0.707107},
325 {0.923880, -0.382684},
326 {1.000000, -0.000000},
327 {0.923880, 0.382683},
328 {0.707107, 0.707107},
358 {-0.578579, 0.253369},
359 {-0.392773, 0.412794},
360 {-0.004241, -0.328551},
361 {-0.003001, 0.034320},
362 {1.055313, 0.864744},
363 {0.866408, 1.026895},
376 {-0.5 +
SC, 1.0 +
OY},
378 {0.5, 0.0 +
OY +
SC},
435 *
data |= corner_v << 2;
437 *
data |= color << 12;
438 *
data |= (inner) ? (1 << 10) : 0;
439 *
data |= (emboss) ? (1 << 11) : 0;
479 for (
int c = 0; c < 4; c++) {
492 for (
int c1 = 0, c2 = 3; c1 < 2; c1++, c2--) {
517 float x1,
float y1,
float x2,
float y2,
float x3,
float y3,
const float color[4])
519 const float tri_arr[3][2] = {{x1, y1}, {x2, y2}, {x3, y3}};
551 const float f3 = 0.05 *
U.widget_unit;
552 const float f5 = 0.15 *
U.widget_unit;
553 const float f7 = 0.25 *
U.widget_unit;
558 else if (dir ==
't') {
606 uiWidgetBase *wt,
int roundboxalign,
const rcti *rect,
float rad,
float radi)
609 const float minx = rect->
xmin, miny = rect->
ymin, maxx = rect->
xmax, maxy = rect->
ymax;
610 const float minxi = minx +
U.pixelsize;
611 const float maxxi = maxx -
U.pixelsize;
612 const float minyi = miny +
U.pixelsize;
613 const float maxyi = maxy -
U.pixelsize;
615 const float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f;
616 const float facyi = (maxyi != minyi) ? 1.0f / (maxyi - minyi) : 0.0f;
633 if (2.0f * rad > minsize) {
634 rad = 0.5f * minsize;
637 if (2.0f * (radi + 1.0f) > minsize) {
638 radi = 0.5f * minsize -
U.pixelsize;
663 wt->
inner_v[tot][0] = minxi + veci[a][1];
664 wt->
inner_v[tot][1] = minyi + radi - veci[a][0];
666 wt->
outer_v[tot][0] = minx + vec[a][1];
667 wt->
outer_v[tot][1] = miny + rad - vec[a][0];
689 wt->
inner_v[tot][0] = maxxi - radi + veci[a][0];
690 wt->
inner_v[tot][1] = minyi + veci[a][1];
692 wt->
outer_v[tot][0] = maxx - rad + vec[a][0];
693 wt->
outer_v[tot][1] = miny + vec[a][1];
717 wt->
inner_v[tot][0] = maxxi - veci[a][1];
718 wt->
inner_v[tot][1] = maxyi - radi + veci[a][0];
720 wt->
outer_v[tot][0] = maxx - vec[a][1];
721 wt->
outer_v[tot][1] = maxy - rad + vec[a][0];
743 wt->
inner_v[tot][0] = minxi + radi - veci[a][0];
744 wt->
inner_v[tot][1] = maxyi - veci[a][1];
746 wt->
outer_v[tot][0] = minx + rad - vec[a][0];
747 wt->
outer_v[tot][1] = maxy - vec[a][1];
788 const float verts[][2],
790 const uint tris[][3],
799 float centx = float(rect->
xmin) + 0.4f * minsize;
800 float centy = float(rect->
ymin) + 0.5f * minsize;
801 tria->
size = sizex = sizey = -0.5f * triasize * minsize;
804 centx = float(rect->
xmax) - 0.4f * minsize;
807 else if (where ==
't') {
808 centx = float(rect->
xmin) + 0.5f * minsize;
809 centy = float(rect->
ymax) - 0.5f * minsize;
814 else if (where ==
'b') {
815 centx = float(rect->
xmin) + 0.5f * minsize;
821 for (
int a = 0; a < verts_tot; a++) {
822 tria->
vec[a][0] = sizex *
verts[a][i1] + centx;
823 tria->
vec[a][1] = sizey *
verts[a][i2] + centy;
829 tria->
tot = tris_tot;
894 for (
int i = 0;
i < totvert;
i++) {
907 float centx, centy,
size;
916 if (width > height * 1.1f) {
918 tria->
center[0] = centx = rect->
xmax - 0.32f * height;
921 for (
int a = 0; a < 6; a++) {
932 float centx, centy,
size;
941 for (
int a = 0; a < 6; a++) {
968 const uchar *color,
short shadetop,
short shadedown,
uchar r_coltop[4],
uchar r_coldown[4])
970 r_coltop[0] = std::clamp(color[0] + shadetop, 0, 255);
971 r_coltop[1] = std::clamp(color[1] + shadetop, 0, 255);
972 r_coltop[2] = std::clamp(color[2] + shadetop, 0, 255);
973 r_coltop[3] = color[3];
975 r_coldown[0] = std::clamp(color[0] + shadedown, 0, 255);
976 r_coldown[1] = std::clamp(color[1] + shadedown, 0, 255);
977 r_coldown[2] = std::clamp(color[2] + shadedown, 0, 255);
978 r_coldown[3] = color[3];
986 for (a = 0; a < totvert; a++) {
1004 const bool alpha_check,
1005 const float discard_factor)
1030 const uchar *outline,
1031 const uchar *emboss,
1033 const bool alpha_check)
1052#define MAX_WIDGET_BASE_BATCH 6
1053#define MAX_WIDGET_PARAMETERS 12
1063 const float checker_params[3] = {
1126 const float checker_params[3] = {
1140 bool show_alpha_checkers)
1142 uchar inner_col1[4] = {0};
1143 uchar inner_col2[4] = {0};
1144 uchar emboss_col[4] = {0};
1145 uchar outline_col[4] = {0};
1146 uchar tria_col[4] = {0};
1149 show_alpha_checkers =
false;
1156 inner_col1[0] = inner_col2[0] = wcol->
inner[0];
1157 inner_col1[1] = inner_col2[1] = wcol->
inner[1];
1158 inner_col1[2] = inner_col2[2] = wcol->
inner[2];
1159 inner_col1[3] = inner_col2[3] = wcol->
inner[3];
1168 outline_col[0] = wcol->
outline[0];
1169 outline_col[1] = wcol->
outline[1];
1170 outline_col[2] = wcol->
outline[2];
1171 outline_col[3] = wcol->
outline[3];
1180 tria_col[0] = wcol->
item[0];
1181 tria_col[1] = wcol->
item[1];
1182 tria_col[2] = wcol->
item[2];
1183 tria_col[3] = wcol->
item[3];
1187 if (inner_col1[3] || inner_col2[3] || outline_col[3] || emboss_col[3] || tria_col[3] ||
1188 show_alpha_checkers)
1191 wtb, inner_col1, inner_col2, outline_col, emboss_col, tria_col, show_alpha_checkers);
1210#define UI_TEXT_CLIP_MARGIN (0.25f * U.widget_unit / but->block->aspect)
1212#define PREVIEW_PAD (0.15f * UI_UNIT_X)
1234 const uchar mono_color[4])
1236 if (icon == ICON_NONE) {
1248 uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]};
1265 const bool add_padding,
1267 const uchar mono_color[4])
1269 if (icon == ICON_NONE) {
1284 const int y = rect->
ymin + h / 2 -
size / 2;
1346 if (icon && icon != ICON_BLANK1) {
1347 const float ofs = 1.0f / aspect;
1355 xs = rect->
xmin + 2.0f * ofs;
1358 xs = rect->
xmin + 2.0f * ofs;
1361 xs = rect->
xmin + 4.0f * ofs;
1365 xs = (rect->
xmin + rect->
xmax - height) / 2.0f;
1367 ys = (rect->
ymin + rect->
ymax - height) / 2.0f;
1370 if (aspect > 0.95f && aspect < 1.05f) {
1376 uchar color[4] = {mono_color[0], mono_color[1], mono_color[2], mono_color[3]};
1407 xs, ys, icon, aspect, alpha, desaturate, color, outline, &but->
icon_overlay_text);
1421 const int xs = rect->
xmax - tria_width;
1422 const int ys = (rect->
ymin + rect->
ymax - tria_height) / 2.0f;
1429 BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height);
1441 const int bytes =
str + but->
ofs - prev_utf8;
1449 const int bytes = next_utf8 - (
str + but->
ofs);
1461 const size_t max_len,
1462 const float okwidth,
1465 const float sep_strwidth,
1466 size_t *r_final_len)
1472 fstyle->
uifont_id,
str, max_len, okwidth - sep_strwidth,
nullptr);
1476 memcpy(
str + l_end, sep, sep_len + 1);
1478 *r_final_len = size_t(l_end) + sep_len;
1486 *r_final_len = size_t(l_end);
1494 const float minwidth,
1495 const size_t max_len,
1496 const char rpart_sep,
1497 const bool clip_right_if_tight)
1506 if ((okwidth > 0.0f) && (strwidth > okwidth)) {
1508 const int sep_len =
sizeof(sep) - 1;
1512 float rpart_width = 0.0f;
1513 size_t rpart_len = 0;
1514 size_t final_lpart_len;
1517 rpart = strrchr(
str, rpart_sep);
1520 rpart_len = strlen(rpart);
1522 okwidth -= rpart_width;
1523 strwidth -= rpart_width;
1525 if (okwidth < 0.0f) {
1528 memmove(
str, rpart, rpart_len + 1);
1530 okwidth += rpart_width;
1531 strwidth = rpart_width;
1536 const float parts_strwidth = (okwidth - sep_strwidth) / 2.0f;
1545 fstyle->
uifont_id,
str, max_len, parts_strwidth,
nullptr);
1546 if (clip_right_if_tight &&
1547 (l_end < 10 ||
min_ff(parts_strwidth, strwidth - okwidth) < minwidth))
1553 fstyle,
str, max_len, okwidth, sep, sep_len, sep_strwidth, &final_lpart_len);
1556 size_t r_offset, r_len;
1559 r_len = strlen(
str + r_offset) + 1;
1561 if (l_end + sep_len + r_len + rpart_len > max_len) {
1569 fstyle,
str, max_len, okwidth, sep, sep_len, sep_strwidth, &final_lpart_len);
1572 memmove(
str + l_end + sep_len,
str + r_offset, r_len);
1573 memcpy(
str + l_end, sep, sep_len);
1575 final_lpart_len = size_t(l_end + sep_len + r_len - 1);
1586 char *c =
str + l_end + sep_len;
1587 memmove(c, c + 1, r_len);
1595 memcpy(
str + final_lpart_len, rpart, rpart_len + 1);
1596 okwidth += rpart_width;
1608 BLI_assert((strwidth <= (okwidth + 2)) || (okwidth <= 0.0f) ||
1631 const size_t max_len =
sizeof(new_drawstr);
1657 const size_t max_len =
sizeof(new_drawstr);
1665 char *clipped_str_buf,
1666 const size_t max_len_clipped_str_buf,
1667 const float max_line_width,
1668 const int max_lines)
1679 if (lines.
size() <= max_lines) {
1684 clipped_lines.
reserve(max_lines);
1686 if (max_lines == 1) {
1690 fstyle, clipped_str_buf, max_line_width,
UI_ICON_SIZE, max_len_clipped_str_buf,
'\0');
1691 clipped_lines.
append(clipped_str_buf);
1692 return clipped_lines;
1694 if (max_lines == 2) {
1695 clipped_lines.
append(lines[0]);
1701 max_len_clipped_str_buf,
1704 clipped_lines.
append(clipped_str_buf);
1705 return clipped_lines;
1710 const int middle_index = max_lines / 2;
1713 for (
int i = 0;
i < middle_index;
i++) {
1714 clipped_lines.
append(lines[
i]);
1719 BLI_strncpy(clipped_str_buf, lines[middle_index].
data(), max_len_clipped_str_buf);
1724 max_len_clipped_str_buf,
1727 clipped_lines.
append(clipped_str_buf);
1732 if ((middle_index + 1) < max_lines) {
1733 const char *remaining = lines[middle_index + 1].
data();
1734 size_t remaining_len = strlen(remaining);
1735 std::list<StringRef> last_lines;
1736 for (
int i = 0;
i < max_lines - (middle_index + 1) && remaining_len;
i++) {
1738 fstyle->
uifont_id, remaining, remaining_len, max_line_width,
nullptr);
1739 size_t line_len = remaining_len - offset;
1740 last_lines.emplace_front(remaining + offset,
int64_t(line_len));
1741 remaining_len = offset;
1745 clipped_lines.
append(line);
1749 return clipped_lines;
1766 but->
ofs = std::min(but->
ofs, but->
pos);
1775 const int editstr_len = strlen(but->
editstr);
1776 int len = editstr_len;
1785 if (width > okwidth - 20) {
1790 if (width < 20 && but->ofs > 0) {
1816 int drawstr_len = but->
drawstr.size();
1820 const char *cpend = new_drawstr + drawstr_len;
1833 const int sep_len =
sizeof(sep) - 1;
1848 char *cpoin = strrchr(new_drawstr,
':');
1850 if (cpoin && (cpoin < cpend - 2)) {
1854 while (but->
strwidth > okwidth && cp2 > new_drawstr) {
1856 const int bytes = cp2 - prev_utf8;
1860 memmove(cp2 - bytes, cp2, drawstr_len + 1);
1863 drawstr_len -= bytes;
1866 new_drawstr + but->
ofs,
1867 sizeof(new_drawstr) - but->
ofs) +
1869 if (but->
strwidth < sep_strwidth) {
1875 while ((but->
strwidth > okwidth) && (but->
ofs < 2)) {
1878 fstyle->
uifont_id, new_drawstr + but->
ofs,
sizeof(new_drawstr) - but->
ofs);
1890 new_drawstr + but->
ofs,
1891 drawstr_len - but->
ofs,
1896 new_drawstr[drawstr_len] = 0;
1899 cpoin = strrchr(new_drawstr,
':');
1900 if (cpoin && (cpoin - new_drawstr > 0) && (drawstr_len < (
sizeof(new_drawstr) - sep_len))) {
1902 memmove(cpoin + sep_len, cpoin, cpend - cpoin);
1903 memcpy(cpoin, sep, sep_len);
1905 fstyle->
uifont_id, new_drawstr + but->
ofs,
sizeof(new_drawstr) - but->
ofs);
1911#ifdef WITH_INPUT_IME
1912static void widget_draw_text_ime_underline(
const uiFontStyle *fstyle,
1916 const wmIMEData *ime_data,
1917 const char *drawstr)
1921 int sel_start = ime_data->sel_start, sel_end = ime_data->sel_end;
1924 if (drawstr[0] != 0) {
1925 if (but->
pos >= but->
ofs) {
1933 fstyle->
uifont_id, drawstr + but->
ofs, ime_data->composite.size() + but->
pos - but->
ofs);
1937 rect->
ymin + 6 *
U.pixelsize,
1938 min_ii(width, rect_x - 2) - ofs_x,
1943 if (sel_start != -1 && sel_end != -1) {
1944 sel_end -= sel_start;
1945 sel_start += but->
pos;
1947 if (sel_start >= but->
ofs) {
1957 rect->
ymin + 6 *
U.pixelsize,
1958 min_ii(width, rect_x - 2) - ofs_x,
1972 const char *drawstr = but->
drawstr.c_str();
1973 const char *drawstr_right =
nullptr;
1974 bool use_right_only =
false;
1977#ifdef WITH_INPUT_IME
1978 const wmIMEData *ime_data;
2007 drawstr_left_len = INT_MAX;
2009#ifdef WITH_INPUT_IME
2011 ime_data = ui_but_ime_data_get(but);
2013 if (ime_data && ime_data->composite.size()) {
2016 STRNCPY(tmp_drawstr, drawstr);
2018 sizeof(tmp_drawstr),
2022 ime_data->composite.c_str(),
2025 drawstr = but->
drawstr.c_str();
2044 drawstr = indeterminate_str;
2045 drawstr_left_len = strlen(drawstr);
2053#ifdef WITH_INPUT_IME
2054 bool ime_reposition_window =
false;
2055 int ime_win_x, ime_win_y;
2059 if ((but->
selend - but->
selsta) != 0 && drawstr[0] != 0) {
2070 strlen(drawstr + but->
ofs),
2073 for (
auto bounds : boxes) {
2076 rect->
ymin +
U.pixelsize,
2078 rect->
ymax -
U.pixelsize);
2083#ifdef WITH_INPUT_IME
2085 if (!ime_reposition_window && boxes.size() > 0) {
2086 ime_reposition_window =
true;
2087 ime_win_x = rect->
xmin + boxes[0].min;
2088 ime_win_y = rect->
ymin +
U.pixelsize;
2094 but_pos_ofs = but->
pos;
2096#ifdef WITH_INPUT_IME
2098 if (ime_data && ime_data->composite.size() && ime_data->cursor_pos != -1) {
2099 but_pos_ofs += ime_data->cursor_pos;
2104 if (but->
pos >= but->
ofs) {
2109 but_pos_ofs - but->
ofs,
2110 max_ii(1,
int(
U.pixelsize * 2)));
2126 rect->
ymin +
U.pixelsize,
2127 rect->
xmin + t +
int(2.0f *
U.pixelsize),
2128 rect->
ymax -
U.pixelsize);
2132#ifdef WITH_INPUT_IME
2134 if (!ime_reposition_window) {
2135 ime_reposition_window =
true;
2136 ime_win_x = rect->
xmin + t + 5;
2137 ime_win_y = rect->
ymin + 3;
2142#ifdef WITH_INPUT_IME
2144 if (ime_reposition_window) {
2145 ui_but_ime_reposition(but, ime_win_x, ime_win_y,
false);
2147 if (ime_data && ime_data->composite.size()) {
2149 widget_draw_text_ime_underline(fstyle, wcol, but, rect, ime_data, drawstr);
2155 ui_rasterpos_safe(
x,
y, but->aspect);
2156 transopts = ui_translate_buttons();
2159 bool use_drawstr_right_as_hint =
false;
2164 if (drawstr_right) {
2165 use_drawstr_right_as_hint =
true;
2166 drawstr_left_len = (drawstr_right - drawstr);
2171#ifdef USE_NUMBUTS_LR_ALIGN
2177 drawstr_right = strrchr(drawstr + but->
ofs,
':');
2178 if (drawstr_right) {
2180 drawstr_left_len = (drawstr_right - drawstr - 1);
2182 while (*drawstr_right ==
' ') {
2188 drawstr_right = drawstr + but->
ofs;
2189 use_right_only =
true;
2194 if (!use_right_only) {
2196 int font_xofs, font_yofs;
2198 int drawlen = (drawstr_left_len == INT_MAX) ? strlen(drawstr + but->
ofs) :
2199 (drawstr_left_len - but->
ofs);
2215 const char *drawstr_ofs = drawstr + but->
ofs;
2220 const char *drawstr_end = drawstr_ofs + drawlen;
2223 const char *drawstr_menu = strchr(drawstr_ofs, keys[
i]);
2224 if (drawstr_menu !=
nullptr && drawstr_menu < drawstr_end) {
2225 ul_index = int(drawstr_menu - drawstr_ofs);
2231 if (ul_index != -1) {
2237 int pos_x = rect->
xmin + font_xofs +
bounds.xmin +
2239 int pos_y = rect->
ymin + font_yofs +
bounds.ymin -
U.pixelsize;
2253 if (placeholder && placeholder[0]) {
2262 &style, rect, placeholder, strlen(placeholder),
col, &
params,
nullptr,
nullptr,
nullptr);
2267 if (drawstr_right) {
2270 if (use_drawstr_right_as_hint) {
2292 rect->
xmax -= 0.2 * icon_size;
2298 float alpha_this = alpha;
2302 if (op_icon->disabled) {
2305 else if (!op_icon->highlighted) {
2306 alpha_this *= 0.75f;
2310 const int old_drawflags = but->
drawflag;
2315 rect->
xmax -= icon_size;
2351 const float alpha = float(wcol->
text[3]) / 255.0f;
2366 no_text_padding =
true;
2391 icon_size -= text_size;
2395 rect->
ymin += text_size;
2406 rect->
ymin -= text_size;
2407 rect->
ymax -= icon_size;
2418#ifdef USE_UI_TOOLBAR_HACK
2430#ifdef USE_UI_TOOLBAR_HACK
2445 rect->
xmin += 0.3f *
U.widget_unit;
2450 rect->
xmin += 0.2f *
U.widget_unit;
2456 if (show_menu_icon) {
2461#ifdef USE_UI_TOOLBAR_HACK
2468 if (!no_text_padding) {
2472 rect->
xmin += text_padding;
2477 rect->
xmin += text_padding;
2481 rect->
xmin += text_padding;
2484 rect->
xmax -= text_padding;
2492 rect->
xmin +=
U.pixelsize;
2495 rect->
xmax -=
U.pixelsize;
2513 else if (but->
drawstr[0] ==
'\0') {
2538#undef UI_TEXT_CLIP_MARGIN
2557 wcol_theme_s.
outline[3] *= factor;
2558 wcol_theme_s.
inner[3] *= factor;
2560 wcol_theme_s.
item[3] *= factor;
2561 wcol_theme_s.
text[3] *= factor;
2562 wcol_theme_s.
text_sel[3] *= factor;
2626 if (color_blend !=
nullptr) {
2639 if (color_blend !=
nullptr) {
2672 const uchar blue[4] = {86, 128, 194};
2690 return wcol->
roundness *
U.widget_unit * zoom;
2741 if (color_blend !=
nullptr) {
2885 const float outline =
U.pixelsize;
2901 const int block_flag,
2902 const int direction,
2947 const bool is_active)
2950 const float radius = zoom * (((is_active ? 20.0f : 12.0f) *
UI_SCALE_FAC) +
U.pixelsize);
2961 const float fg = std::min(1.0f - hsv[2] + 0.2f, 0.8f);
2962 const float bg = hsv[2] / 2.0f;
2982 const rcti *rect,
const float mx,
const float my,
float *r_val_rad,
float *r_val_dist)
2988 const float m_delta[2] = {mx - centx, my - centy};
2991 *r_val_dist = (dist_sq < (radius * radius)) ?
sqrtf(dist_sq) / radius : 1.0f;
2996 const ColorPicker *cpicker,
const rcti *rect,
const float *hsv,
float *r_xpos,
float *r_ypos)
3003 const float ang = 2.0f * float(
M_PI) * hsv[0] + float(
M_PI_2);
3007 radius_t = (1.0f -
pow3f(1.0f - hsv[1]));
3013 const float rad =
clamp_f(radius_t, 0.0f, 1.0f) * radius;
3014 *r_xpos = centx +
cosf(-ang) * rad;
3015 *r_ypos = centy +
sinf(-ang) * rad;
3023 const float radstep = 2.0f * float(
M_PI) / float(tot);
3029 float rgb[3], hsv[3], rgb_center[3];
3040 CLAMP(hsv[2], 0.0f, 1.0f);
3054 const float hsv_center[3] = {0.0f, 0.0f, hsv[2]};
3058 if (!is_color_gamma) {
3073 for (
int a = 0; a <= tot; a++, ang += radstep) {
3074 const float si =
sinf(ang);
3075 const float co =
cosf(ang);
3080 rect, centx + co * radius, centy + si * radius, hsv_ang, hsv_ang + 1);
3081 hsv_ang[2] = hsv[2];
3086 if (!is_color_gamma) {
3137 const int steps = 48;
3138 const float color_step = 1.0f /
steps;
3140 const float h = hsv[0], s = hsv[1],
v = hsv[2];
3141 float dx, dy, sx1, sx2, sy;
3149 hsv_to_rgb(h, 0.0, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3150 hsv_to_rgb(h, 0.0, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3151 hsv_to_rgb(h, 0.0, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3152 hsv_to_rgb(h, 0.0, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3155 hsv_to_rgb(0.0, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3156 hsv_to_rgb(0.0, s, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3157 hsv_to_rgb(0.0, s, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3158 hsv_to_rgb(0.0, s, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3161 hsv_to_rgb(0.0, 0.0,
v, &col1[0][0], &col1[0][1], &col1[0][2]);
3162 hsv_to_rgb(0.0, 0.333,
v, &col1[1][0], &col1[1][1], &col1[1][2]);
3163 hsv_to_rgb(0.0, 0.666,
v, &col1[2][0], &col1[2][1], &col1[2][2]);
3164 hsv_to_rgb(0.0, 1.0,
v, &col1[3][0], &col1[3][1], &col1[3][2]);
3167 hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3173 hsv_to_rgb(1.0, 0.0, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]);
3179 hsv_to_rgb(1.0, 1.0, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]);
3186 hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]);
3202 for (dx = 0.0f; dx < 0.999f; dx += color_step) {
3203 const float dx_next = dx + color_step;
3214 hsv_to_rgb(h, dx, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3215 hsv_to_rgb(h, dx, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3216 hsv_to_rgb(h, dx, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3217 hsv_to_rgb(h, dx, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3220 hsv_to_rgb(dx_next, s, 0.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3221 hsv_to_rgb(dx_next, s, 0.333, &col1[1][0], &col1[1][1], &col1[1][2]);
3222 hsv_to_rgb(dx_next, s, 0.666, &col1[2][0], &col1[2][1], &col1[2][2]);
3223 hsv_to_rgb(dx_next, s, 1.0, &col1[3][0], &col1[3][1], &col1[3][2]);
3226 hsv_to_rgb(dx_next, 0.0,
v, &col1[0][0], &col1[0][1], &col1[0][2]);
3227 hsv_to_rgb(dx_next, 0.333,
v, &col1[1][0], &col1[1][1], &col1[1][2]);
3228 hsv_to_rgb(dx_next, 0.666,
v, &col1[2][0], &col1[2][1], &col1[2][2]);
3229 hsv_to_rgb(dx_next, 1.0,
v, &col1[3][0], &col1[3][1], &col1[3][2]);
3234 hsv_to_rgb(dx_next, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]);
3240 hsv_to_rgb(h, dx, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]);
3246 hsv_to_rgb(h, 1.0, dx, &col1[2][0], &col1[2][1], &col1[2][2]);
3261 for (a = 0; a < 3; a++, sy += dy) {
3262 immAttr4f(
col, col0[a][0], col0[a][1], col0[a][2], alpha);
3265 immAttr4f(
col, col1[a][0], col1[a][1], col1[a][2], alpha);
3268 immAttr4f(
col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
3271 immAttr4f(
col, col0[a][0], col0[a][1], col0[a][2], alpha);
3274 immAttr4f(
col, col1[a + 1][0], col1[a + 1][1], col1[a + 1][2], alpha);
3277 immAttr4f(
col, col0[a + 1][0], col0[a + 1][1], col0[a + 1][2], alpha);
3287 const uiButHSVCube *hsv_but,
const rcti *rect,
const float *hsv,
float *r_xp,
float *r_yp)
3289 float x = 0.0f,
y = 0.0f;
3339 float x = 0.0f,
y = 0.0f;
3383 const float cursor_width = std::max(
BLI_rctf_size_y(&rectf) * 0.35f, 1.0f);
3384 rectf.
xmin =
x - cursor_width;
3385 rectf.
xmax =
x + cursor_width;
3389 rectf.
xmin -=
U.pixelsize;
3390 rectf.
xmax +=
U.pixelsize;
3391 rectf.
ymin -=
U.pixelsize;
3392 rectf.
ymax +=
U.pixelsize;
3395 const float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3400 const float inner[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3401 const float col2[4] = {0.0f, 0.0f, 0.0f, 0.0f};
3410 float rgb[3], hsv[3],
v;
3432 const float inner1[4] = {1.0f, 1.0f, 1.0f, 1.0f};
3433 const float inner2[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3434 const float outline[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3436 const float outline_width = (
BLI_rctf_size_x(&rectf) < 4.0f) ? 0.0f : 1.0f;
3442 const float cursor_height = std::max(
BLI_rctf_size_x(&rectf) * 0.35f, 1.0f);
3443 rectf.
ymin =
y - cursor_height;
3444 rectf.
ymax =
y + cursor_height;
3445 float col[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3449 rectf.
xmin -=
U.pixelsize;
3450 rectf.
xmax +=
U.pixelsize;
3451 rectf.
ymin -=
U.pixelsize;
3452 rectf.
ymax +=
U.pixelsize;
3459 const float col2[4] = {
v,
v,
v, 1.0f};
3508#define NUM_BUT_PADDING_FACTOR 0.425f
3541 int roundboxalign_zone;
3555 rect_zone.
xmax = rect->
xmin + handle_width +
U.pixelsize;
3575 rect_zone.
xmin = rect->
xmax - handle_width -
U.pixelsize;
3594 rect_zone.
xmin = rect->
xmin + handle_width -
U.pixelsize;
3595 rect_zone.
xmax = rect->
xmax - handle_width +
U.pixelsize;
3610 if (!
state->is_text_input) {
3613 rect->
xmin += text_padding;
3614 rect->
xmax -= text_padding;
3737 if (lightness > 70) {
3741 wcol->
item[3] = 128;
3744 wcol->
item[0] = 255;
3745 wcol->
item[1] = 255;
3746 wcol->
item[2] = 255;
3747 wcol->
item[3] = 128;
3751 rcti slider_inset = *slider;
3752 slider_inset.
xmin += 0.05 *
U.widget_unit;
3753 slider_inset.
xmax -= 0.05 *
U.widget_unit;
3831 rcti rect_prog = *rect, rect_bar = *rect;
3843 w = std::max(
w, ofs);
3845 rect_bar.xmax = rect_bar.xmin +
w;
3865 const float ring_width = 0.6;
3866 const float outer_rad = (rect->
ymax - rect->
ymin) / 2.0f;
3867 const float inner_rad = outer_rad * ring_width;
3868 const float x = rect->
xmin + outer_rad;
3869 const float y = rect->
ymin + outer_rad;
3870 const float start = 0.0f;
3890 if (but_progress->
drawstr[0]) {
3927 uchar old_inner[3], old_outline[3];
3941 rect->
xmin = cent_x - radi;
3942 rect->
xmax = cent_x + radi;
3943 rect->
ymin = cent_y - radi;
3944 rect->
ymax = cent_y + radi;
3974 int roundboxalign_slider = roundboxalign;
3986 float factor, factor_ui;
3987 float factor_discard = 1.0f;
3989 const float softmin = but->
softmin;
3990 const float softmax = but->
softmax;
3991 const float softrange = softmax - softmin;
3994 switch (scale_type) {
3997 factor = value / softmax;
4000 factor = (value - softmin) / softrange;
4005 const float logmin =
fmaxf(softmin, 0.5e-8f);
4006 const float base = softmax / logmin;
4007 factor =
logf(value / logmin) /
logf(base);
4011 const float cubicmin =
cube_f(softmin);
4012 const float cubicmax =
cube_f(softmax);
4013 const float cubicrange = cubicmax - cubicmin;
4014 const float f = (value - softmin) * cubicrange / softrange + cubicmin;
4015 factor = (cbrtf(f) - softmin) / softrange;
4021 factor_ui = factor * width;
4024 const float min_width = 2.0f * rad;
4026 if (factor_ui > width - rad) {
4028 factor_discard = factor;
4030 else if (factor_ui > min_width) {
4033 rect1.
xmax = rect1.
xmin + factor_ui;
4038 rect1.
xmax = rect1.
xmin + min_width;
4039 factor_discard = factor_ui / min_width;
4061 if (!
state->is_text_input) {
4063 rect->
xmax -= text_padding;
4064 rect->
xmin += text_padding;
4069#define SWATCH_KEYED_BORDER 3
4125 const bool show_alpha_checkers = (wcol->
inner[3] < 255);
4139 const float width = rect->
xmax - rect->
xmin;
4140 const float height = rect->
ymax - rect->
ymin;
4144 bw += (bw < 0.5f) ? 0.5f : -0.5f;
4260 wcol->
inner[3] *= 1.0f - back[3];
4283 const float padding = zoom * 0.125f *
U.widget_unit;
4335 wcol->
inner[3] *= fac;
4337 wcol->
item[3] *= fac;
4338 wcol->
text[3] *= fac;
4352 rcti draw_rect = *rect;
4410 rcti recttemp = *rect;
4416 if (text_before_widget) {
4449 const float offset = delta * 0.9;
4450 if (text_before_widget) {
4451 rect->
xmax = recttemp.
xmin - offset;
4454 rect->
xmin = recttemp.
xmax + offset;
4518 if (but !=
nullptr && but->
col[3]) {
4557 const float rad = wcol->
roundness *
U.widget_unit;
4578 if (
state->has_hold_action) {
4605 uchar theme_col_tab_highlight[3];
4607#ifdef USE_TAB_SHADED_HIGHLIGHT
4624#ifdef USE_TAB_SHADED_HIGHLIGHT
4635#ifdef USE_TAB_SHADED_HIGHLIGHT
4640#ifndef USE_TAB_SHADED_HIGHLIGHT
4649 const float rad = wcol->
roundness *
U.widget_unit;
4883 rect->
ymax +=
U.pixelsize;
4886 rect->
xmin -=
U.pixelsize;
4957 switch (but->
type) {
4980 switch (but->
type) {
5002 switch (but->
type) {
5027#ifdef USE_UI_TOOLBAR_HACK
5108 if ((but->
str.empty() && but->
icon &&
5231 if (wt ==
nullptr) {
5251 state.is_text_input =
true;
5255 state.has_hold_action =
true;
5258 bool use_alpha_blend =
false;
5261 use_alpha_blend =
true;
5266#ifdef USE_UI_POPOVER_ONCE
5286 else if (wt->
draw) {
5291 if (use_alpha_blend) {
5301 wt->
text(fstyle, &wt->
wcol, but, rect);
5302 if (use_alpha_blend) {
5311 float draw_color[4];
5314 draw_color[0] = float(
color[0]) / 255.0f;
5315 draw_color[1] = float(
color[1]) / 255.0f;
5316 draw_color[2] = float(
color[2]) / 255.0f;
5317 draw_color[3] = 1.0f;
5336 const float zoom = 1.0f / block->
aspect;
5353 const float unit_size,
5354 const float mval_origin[2])
5357 const float unit_half = unit_size / 2;
5358 const float cent_x = mval_origin ? std::clamp(mval_origin[0],
5359 rect->
xmin + unit_size,
5360 rect->
xmax - unit_size) :
5385 const int sign = is_down ? 1 : -1;
5386 float y = is_down ? rect->
ymax : rect->
ymin;
5437 const uchar col1[4],
5438 const uchar col2[4],
5441 const float radius_ext_scale = (0.5f / radius_ext);
5456 for (
int i = 0;
i < subd;
i++) {
5457 const float a = start + ((
i) / float(subd - 1)) *
angle;
5458 const float s =
sinf(a);
5459 const float c =
cosf(a);
5460 const float y1 = s * radius_int;
5461 const float y2 = s * radius_ext;
5465 const float fac = (y1 + radius_ext) * radius_ext_scale;
5475 const float fac = (y2 + radius_ext) * radius_ext_scale;
5496 const float pie_radius_internal =
UI_SCALE_FAC *
U.pie_menu_threshold;
5497 const float pie_radius_external =
UI_SCALE_FAC * (
U.pie_menu_threshold + 7.0f);
5499 const int subd = 40;
5501 const float angle =
atan2f(pie_dir[1], pie_dir[0]);
5505 const float range = (has_aligned && has_diagonal) ?
M_PI_4 :
M_PI_2;
5512 uchar col1[4], col2[4];
5519 0.0f,
float(
M_PI * 2.0), pie_radius_internal, pie_radius_external, subd, col1, col2,
true);
5524 pie_radius_internal,
5525 pie_radius_external,
5534 uchar col1[4], col2[4];
5542 pie_radius_internal,
5543 pie_radius_external,
5552 pie_radius_internal,
5553 pie_radius_external,
5571 if (
U.pie_menu_confirm > 0 &&
5574 const float pie_confirm_radius =
UI_SCALE_FAC * (pie_radius_internal +
U.pie_menu_confirm);
5576 (pie_radius_internal +
U.pie_menu_confirm + 7.0f);
5582 pie_confirm_external,
5605 const float color[4])
5621 else if (wt->
draw) {
5651 const bool use_unpadded,
5659 const rcti _rect = *rect;
5661 int max_hint_width = INT_MAX;
5662 int padding = 0.25f * row_height;
5663 char *cpoin =
nullptr;
5666 state.but_flag = but_flag;
5679 rect->
xmin += row_height;
5684 cpoin =
const_cast<char *
>(strrchr(name,
UI_SEP_CHAR));
5703 if ((name_width + hint_width) > available_width) {
5705 max_hint_width = available_width * 0.40f;
5707 rect->
xmax = (hint_width < max_hint_width) ?
5708 (rect->
xmax - hint_width) :
5709 (rect->
xmin + (available_width - max_hint_width));
5721 const size_t max_len =
sizeof(drawstr);
5729 int xofs = 0, yofs = 0;
5734 fstyle, rect, drawstr,
sizeof(drawstr), wt->
wcol.
text, &
params, &xofs, &yofs, &info);
5735 if (r_xmax !=
nullptr) {
5736 *r_xmax = xofs + info.
width;
5747 const float aspect =
U.inv_scale_factor / zoom;
5767 const size_t max_len =
sizeof(hint_drawstr);
5770 STRNCPY(hint_drawstr, cpoin + 1);
5771 if (hint_drawstr[0] && (max_hint_width < INT_MAX)) {
5789 const uchar text_col[4],
5791 const bool add_padding)
5795 const bool has_text = !name.
is_empty();
5801 rect->
ymin += text_size;
5812 trect.
ymax = trect.
ymin + text_size;
5822 const size_t max_len =
sizeof(drawstr);
5825 memcpy(drawstr, name.
data(), name.
size());
5826 drawstr[name.
size()] =
'\0';
5830 params.align = text_align;
5846 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_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 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])
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])
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])
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 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 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)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
#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)
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)
@ UI_BLOCK_THEME_STYLE_POPUP
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_BUT_NO_PREVIEW_PADDING
@ UI_BUT_ALIGN_STITCH_TOP
@ UI_BUT_ANIMATED_CHANGED
@ UI_BUT_ALIGN_STITCH_LEFT
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_NO_DRAW_OVERRIDDEN_STATE
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
@ UI_BUT_PROGRESS_TYPE_BAR
@ UI_BUT_PROGRESS_TYPE_RING
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()
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)
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr const char * data() const
struct @242053044010324116347033273112253060004051364061::@051143074301336237271216303350234260141112266062 batch
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])
@ ROUNDBOX_TRIA_HOLD_ACTION_ARROW
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
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)
@ UI_SEARCH_FILTER_NO_MATCH
#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)
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
uiBut * next_but(const uiBut *but) const
eButGradientType gradient_type
eButProgressType progress_type
IconTextOverlay icon_overlay_text
blender::ui::EmbossType emboss
uiHandleButtonData * active
uiButHandleHoldFunc hold_func