Blender V4.3
interface_icons_event.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
14#include "BLI_rect.h"
15#include "BLI_string.h"
16
17#include "BLF_api.hh"
18
19#include "BLT_translation.hh"
20
21#include "UI_interface.hh"
22
23#include "interface_intern.hh"
24
25static int inverted_icon(int icon_id)
26{
27 switch (icon_id) {
28 case ICON_KEY_BACKSPACE:
29 return ICON_KEY_BACKSPACE_FILLED;
30 case ICON_KEY_COMMAND:
31 return ICON_KEY_COMMAND_FILLED;
32 case ICON_KEY_CONTROL:
33 return ICON_KEY_CONTROL_FILLED;
34 case ICON_KEY_EMPTY1:
35 return ICON_KEY_EMPTY1_FILLED;
36 case ICON_KEY_EMPTY2:
37 return ICON_KEY_EMPTY2_FILLED;
38 case ICON_KEY_EMPTY3:
39 return ICON_KEY_EMPTY3_FILLED;
40 case ICON_KEY_MENU:
41 return ICON_KEY_MENU_FILLED;
42 case ICON_KEY_OPTION:
43 return ICON_KEY_OPTION_FILLED;
44 case ICON_KEY_RETURN:
45 return ICON_KEY_RETURN_FILLED;
46 case ICON_KEY_RING:
47 return ICON_KEY_RING_FILLED;
48 case ICON_KEY_SHIFT:
49 return ICON_KEY_SHIFT_FILLED;
50 case ICON_KEY_TAB:
51 return ICON_KEY_TAB_FILLED;
52 case ICON_KEY_WINDOWS:
53 return ICON_KEY_WINDOWS_FILLED;
54 default:
55 return icon_id;
56 }
57}
58
59static void icon_draw_icon(const rctf *rect,
60 const int icon_id,
61 const float aspect,
62 const float alpha,
63 const bool inverted)
64{
65 float color[4];
67 if (alpha < 1.0f) {
68 color[3] *= alpha;
69 }
70
71 BLF_draw_svg_icon(uint(inverted ? inverted_icon(icon_id) : icon_id),
72 rect->xmin,
73 rect->ymin,
74 float(ICON_DEFAULT_HEIGHT) / aspect,
75 color,
76 0.0f);
77}
78
79static void icon_draw_rect_input_text(const rctf *rect,
80 const char *str,
81 const float aspect,
82 const float alpha,
83 const bool inverted,
84 const int icon_bg = ICON_KEY_EMPTY1)
85{
86 icon_draw_icon(rect, icon_bg, aspect, alpha, inverted);
87
88 const float available_width = BLI_rctf_size_x(rect) - (2.0f * UI_SCALE_FAC);
89 const int font_id = BLF_default();
90 float color[4];
92 if (alpha < 1.0f) {
93 color[3] *= alpha;
94 }
95 BLF_color4fv(font_id, color);
96
97 const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
98 float font_size = std::min(15.0f, fstyle->points) * UI_SCALE_FAC;
99 BLF_size(font_id, font_size);
100
101 rcti str_bounds;
102 BLF_boundbox(font_id, str, BLF_DRAW_STR_DUMMY_MAX, &str_bounds);
103 float width = float(BLI_rcti_size_x(&str_bounds));
104 float height = float(BLI_rcti_size_y(&str_bounds));
105 if (width > (available_width - (2.0f * UI_SCALE_FAC))) {
106 font_size *= (available_width - (2.0f * UI_SCALE_FAC)) / width;
107 BLF_size(font_id, font_size);
108 BLF_boundbox(font_id, str, BLF_DRAW_STR_DUMMY_MAX, &str_bounds);
109 width = float(BLI_rcti_size_x(&str_bounds));
110 height = float(BLI_rcti_size_y(&str_bounds));
111 }
112
113 const float x = rect->xmin + UI_SCALE_FAC + ((available_width - width) / 2.0f);
114 const float v_offset = (BLI_rctf_size_y(rect) - height) * 0.5f - str_bounds.ymin;
115 BLF_position(font_id, x, rect->ymin + v_offset, 0.0f);
117}
118
119float ui_event_icon_offset(const int icon_id)
120{
121 const enum {
122 UNIX,
123 MACOS,
124 MSWIN,
125 } platform =
126
127#if defined(__APPLE__)
128 MACOS
129#elif defined(_WIN32)
130 MSWIN
131#else
132 UNIX
133#endif
134 ;
135
136 if (ELEM(icon_id,
137 ICON_EVENT_ESC,
138 ICON_EVENT_DEL,
139 ICON_EVENT_HOME,
140 ICON_EVENT_END,
141 ICON_EVENT_BACKSPACE,
142 ICON_EVENT_PAUSE,
143 ICON_EVENT_INSERT,
144 ICON_EVENT_APP))
145 {
146 return 1.5f;
147 }
148 if (icon_id >= ICON_EVENT_PAD0 && icon_id <= ICON_EVENT_PADPERIOD) {
149 return 1.5f;
150 }
151 if (icon_id >= ICON_EVENT_F10 && icon_id <= ICON_EVENT_F24) {
152 return 1.5f;
153 }
154 if (platform != MACOS && ELEM(icon_id, ICON_EVENT_CTRL, ICON_EVENT_ALT, ICON_EVENT_OS)) {
155 return 1.5f;
156 }
157 if (icon_id == ICON_EVENT_OS && platform != MACOS && platform != MSWIN) {
158 return 1.5f;
159 }
160 if (icon_id == ICON_EVENT_SPACEKEY) {
161 return 3.0f;
162 }
163 return 0.0f;
164}
165
166void icon_draw_rect_input(const float x,
167 const float y,
168 const int w,
169 const int h,
170 const int icon_id,
171 const float aspect,
172 const float alpha,
173 const bool inverted)
174{
175 rctf rect{};
176 rect.xmin = int(x);
177 rect.xmax = int(x + w);
178 rect.ymin = int(y);
179 rect.ymax = int(y + h);
180
181 const enum {
182 UNIX,
183 MACOS,
184 MSWIN,
185 } platform =
186
187#if defined(__APPLE__)
188 MACOS
189#elif defined(_WIN32)
190 MSWIN
191#else
192 UNIX
193#endif
194 ;
195
196 const float offset = ui_event_icon_offset(icon_id);
197 if (offset >= 3.0f) {
198 rect.xmax = rect.xmin + BLI_rctf_size_x(&rect) * 2.0f;
199 }
200 else if (offset >= 1.5f) {
201 rect.xmax = rect.xmin + BLI_rctf_size_x(&rect) * 1.5f;
202 }
203
204 if ((icon_id >= ICON_EVENT_A) && (icon_id <= ICON_EVENT_Z)) {
205 const char str[2] = {char('A' + (icon_id - ICON_EVENT_A)), '\0'};
206 icon_draw_rect_input_text(&rect, str, aspect, alpha, inverted);
207 }
208 else if ((icon_id >= ICON_EVENT_ZEROKEY) && (icon_id <= ICON_EVENT_NINEKEY)) {
209 const char str[2] = {char('0' + (icon_id - ICON_EVENT_ZEROKEY)), '\0'};
210 icon_draw_rect_input_text(&rect, str, aspect, alpha, inverted);
211 }
212 else if ((icon_id >= ICON_EVENT_F1) && (icon_id <= ICON_EVENT_F24)) {
213 char str[4];
214 SNPRINTF(str, "F%d", 1 + (icon_id - ICON_EVENT_F1));
216 str,
217 aspect,
218 alpha,
219 inverted,
220 (icon_id >= ICON_EVENT_F10) ? ICON_KEY_EMPTY2 : ICON_KEY_EMPTY1);
221 }
222 if (icon_id == ICON_EVENT_SHIFT) {
223 icon_draw_icon(&rect, ICON_KEY_SHIFT, aspect, alpha, inverted);
224 }
225 else if (icon_id == ICON_EVENT_CTRL) {
226 if (platform == MACOS) {
227 icon_draw_icon(&rect, ICON_KEY_CONTROL, aspect, alpha, inverted);
228 }
229 else {
230 icon_draw_rect_input_text(&rect, IFACE_("Ctrl"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
231 }
232 }
233 else if (icon_id == ICON_EVENT_ALT) {
234 if (platform == MACOS) {
235 icon_draw_icon(&rect, ICON_KEY_OPTION, aspect, alpha, inverted);
236 }
237 else {
238 icon_draw_rect_input_text(&rect, IFACE_("Alt"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
239 }
240 }
241 else if (icon_id == ICON_EVENT_OS) {
242 if (platform == MACOS) {
243 icon_draw_icon(&rect, ICON_KEY_COMMAND, aspect, alpha, inverted);
244 }
245 else if (platform == MSWIN) {
246 icon_draw_icon(&rect, ICON_KEY_WINDOWS, aspect, alpha, inverted);
247 }
248 else {
249 icon_draw_rect_input_text(&rect, IFACE_("OS"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
250 }
251 }
252 else if (icon_id == ICON_EVENT_DEL) {
253 icon_draw_rect_input_text(&rect, IFACE_("Del"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
254 }
255 else if (icon_id == ICON_EVENT_TAB) {
256 icon_draw_icon(&rect, ICON_KEY_TAB, aspect, alpha, inverted);
257 }
258 else if (icon_id == ICON_EVENT_HOME) {
259 icon_draw_rect_input_text(&rect, IFACE_("Home"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
260 }
261 else if (icon_id == ICON_EVENT_END) {
262 icon_draw_rect_input_text(&rect, IFACE_("End"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
263 }
264 else if (icon_id == ICON_EVENT_RETURN) {
265 icon_draw_icon(&rect, ICON_KEY_RETURN, aspect, alpha, inverted);
266 }
267 else if (icon_id == ICON_EVENT_ESC) {
268 icon_draw_rect_input_text(&rect, IFACE_("Esc"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
269 }
270 else if (icon_id == ICON_EVENT_PAGEUP) {
271 icon_draw_rect_input_text(&rect, "P" BLI_STR_UTF8_UPWARDS_ARROW, aspect, alpha, inverted);
272 }
273 else if (icon_id == ICON_EVENT_PAGEDOWN) {
274 icon_draw_rect_input_text(&rect, "P" BLI_STR_UTF8_DOWNWARDS_ARROW, aspect, alpha, inverted);
275 }
276 else if (icon_id == ICON_EVENT_LEFT_ARROW) {
277 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_LEFTWARDS_ARROW, aspect, alpha, inverted);
278 }
279 else if (icon_id == ICON_EVENT_UP_ARROW) {
280 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_UPWARDS_ARROW, aspect, alpha, inverted);
281 }
282 else if (icon_id == ICON_EVENT_RIGHT_ARROW) {
283 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_RIGHTWARDS_ARROW, aspect, alpha, inverted);
284 }
285 else if (icon_id == ICON_EVENT_DOWN_ARROW) {
286 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_DOWNWARDS_ARROW, aspect, alpha, inverted);
287 }
288 else if (icon_id == ICON_EVENT_SPACEKEY) {
289 icon_draw_rect_input_text(&rect, IFACE_("Space"), aspect, alpha, inverted, ICON_KEY_EMPTY3);
290 }
291 else if (icon_id == ICON_EVENT_MOUSE_4) {
293 &rect, BLI_STR_UTF8_BLACK_VERTICAL_ELLIPSE "4", aspect, alpha, inverted);
294 }
295 else if (icon_id == ICON_EVENT_MOUSE_5) {
297 &rect, BLI_STR_UTF8_BLACK_VERTICAL_ELLIPSE "5", aspect, alpha, inverted);
298 }
299 else if (icon_id == ICON_EVENT_MOUSE_6) {
301 &rect, BLI_STR_UTF8_BLACK_VERTICAL_ELLIPSE "6", aspect, alpha, inverted);
302 }
303 else if (icon_id == ICON_EVENT_MOUSE_7) {
305 &rect, BLI_STR_UTF8_BLACK_VERTICAL_ELLIPSE "7", aspect, alpha, inverted);
306 }
307 else if (icon_id == ICON_EVENT_TABLET_STYLUS) {
308 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_LOWER_RIGHT_PENCIL, aspect, alpha, inverted);
309 }
310 else if (icon_id == ICON_EVENT_TABLET_ERASER) {
311 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_UPPER_RIGHT_PENCIL, aspect, alpha, inverted);
312 }
313 else if ((icon_id >= ICON_EVENT_PAD0) && (icon_id <= ICON_EVENT_PAD9)) {
314 char str[5];
315 SNPRINTF(
316 str, "%s%i", BLI_STR_UTF8_SQUARE_WITH_ORTHOGONAL_CROSSHATCH, icon_id - ICON_EVENT_PAD0);
317 icon_draw_rect_input_text(&rect, str, aspect, alpha, inverted, ICON_KEY_EMPTY2);
318 }
319 else if (icon_id == ICON_EVENT_PADASTER) {
322 aspect,
323 alpha,
324 inverted,
325 ICON_KEY_EMPTY2);
326 }
327 else if (icon_id == ICON_EVENT_PADSLASH) {
330 aspect,
331 alpha,
332 inverted,
333 ICON_KEY_EMPTY2);
334 }
335 else if (icon_id == ICON_EVENT_PADMINUS) {
338 aspect,
339 alpha,
340 inverted,
341 ICON_KEY_EMPTY2);
342 }
343 else if (icon_id == ICON_EVENT_PADENTER) {
345 &rect,
347 aspect,
348 alpha,
349 inverted,
350 ICON_KEY_EMPTY2);
351 }
352 else if (icon_id == ICON_EVENT_PADPLUS) {
355 aspect,
356 alpha,
357 inverted,
358 ICON_KEY_EMPTY2);
359 }
360 else if (icon_id == ICON_EVENT_PADPERIOD) {
363 aspect,
364 alpha,
365 inverted,
366 ICON_KEY_EMPTY2);
367 }
368 else if (icon_id == ICON_EVENT_PAUSE) {
369 icon_draw_rect_input_text(&rect, IFACE_("Pause"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
370 }
371 else if (icon_id == ICON_EVENT_INSERT) {
372 icon_draw_rect_input_text(&rect, IFACE_("Insert"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
373 }
374 else if (icon_id == ICON_EVENT_UNKNOWN) {
375 icon_draw_rect_input_text(&rect, " ", aspect, alpha, inverted);
376 }
377 else if (icon_id == ICON_EVENT_GRLESS) {
379 &rect, BLI_STR_UTF8_GREATER_THAN_OR_LESS_THAN, aspect, alpha, inverted);
380 }
381 else if (icon_id == ICON_EVENT_MEDIAPLAY) {
384 aspect,
385 alpha,
386 inverted);
387 }
388 else if (icon_id == ICON_EVENT_MEDIASTOP) {
389 icon_draw_rect_input_text(&rect, BLI_STR_UTF8_BLACK_SQUARE_FOR_STOP, aspect, alpha, inverted);
390 }
391 else if (icon_id == ICON_EVENT_MEDIAFIRST) {
394 aspect,
395 alpha,
396 inverted);
397 }
398 else if (icon_id == ICON_EVENT_MEDIALAST) {
401 aspect,
402 alpha,
403 inverted);
404 }
405 else if (icon_id == ICON_EVENT_APP) {
406 icon_draw_rect_input_text(&rect, IFACE_("App"), aspect, alpha, inverted, ICON_KEY_EMPTY2);
407 }
408 else if (icon_id == ICON_EVENT_CAPSLOCK) {
410 &rect, BLI_STR_UTF8_UPWARDS_UP_ARROW_FROM_BAR, aspect, alpha, inverted);
411 }
412 else if (icon_id == ICON_EVENT_BACKSPACE) {
413 icon_draw_icon(&rect, ICON_KEY_BACKSPACE, aspect, alpha, inverted);
414 }
415 else if (icon_id == ICON_EVENT_SEMICOLON) {
416 icon_draw_rect_input_text(&rect, ";", aspect, alpha, inverted);
417 }
418 else if (icon_id == ICON_EVENT_PERIOD) {
419 icon_draw_rect_input_text(&rect, ".", aspect, alpha, inverted);
420 }
421 else if (icon_id == ICON_EVENT_COMMA) {
422 icon_draw_rect_input_text(&rect, ",", aspect, alpha, inverted);
423 }
424 else if (icon_id == ICON_EVENT_QUOTE) {
425 icon_draw_rect_input_text(&rect, "'", aspect, alpha, inverted);
426 }
427 else if (icon_id == ICON_EVENT_ACCENTGRAVE) {
428 icon_draw_rect_input_text(&rect, "`", aspect, alpha, inverted);
429 }
430 else if (icon_id == ICON_EVENT_MINUS) {
431 icon_draw_rect_input_text(&rect, "-", aspect, alpha, inverted);
432 }
433 else if (icon_id == ICON_EVENT_PLUS) {
434 icon_draw_rect_input_text(&rect, "+", aspect, alpha, inverted);
435 }
436 else if (icon_id == ICON_EVENT_SLASH) {
437 icon_draw_rect_input_text(&rect, "/", aspect, alpha, inverted);
438 }
439 else if (icon_id == ICON_EVENT_BACKSLASH) {
440 icon_draw_rect_input_text(&rect, "\\", aspect, alpha, inverted);
441 }
442 else if (icon_id == ICON_EVENT_EQUAL) {
443 icon_draw_rect_input_text(&rect, "=", aspect, alpha, inverted);
444 }
445 else if (icon_id == ICON_EVENT_LEFTBRACKET) {
446 icon_draw_rect_input_text(&rect, "[", aspect, alpha, inverted);
447 }
448 else if (icon_id == ICON_EVENT_RIGHTBRACKET) {
449 icon_draw_rect_input_text(&rect, "]", aspect, alpha, inverted);
450 }
451 else if (icon_id >= ICON_EVENT_NDOF_BUTTON_V1 && icon_id <= ICON_EVENT_NDOF_BUTTON_MINUS) {
452 if (/* `(icon_id >= ICON_EVENT_NDOF_BUTTON_V1) &&` */ (icon_id <= ICON_EVENT_NDOF_BUTTON_V3)) {
453 char str[7];
454 SNPRINTF(str, "v%i", (icon_id + 1) - ICON_EVENT_NDOF_BUTTON_V1);
455 icon_draw_rect_input_text(&rect, str, aspect, alpha, inverted, ICON_KEY_RING);
456 }
457 if ((icon_id >= ICON_EVENT_NDOF_BUTTON_SAVE_V1) && (icon_id <= ICON_EVENT_NDOF_BUTTON_SAVE_V3))
458 {
459 char str[7];
460 SNPRINTF(str, "s%i", (icon_id + 1) - ICON_EVENT_NDOF_BUTTON_SAVE_V1);
461 icon_draw_rect_input_text(&rect, str, aspect, alpha, inverted, ICON_KEY_RING);
462 }
463 else if ((icon_id >= ICON_EVENT_NDOF_BUTTON_1) && (icon_id <= ICON_EVENT_NDOF_BUTTON_12)) {
464 char str[7];
465 SNPRINTF(str, "%i", (1 + icon_id) - ICON_EVENT_NDOF_BUTTON_1);
466 icon_draw_rect_input_text(&rect, str, aspect, alpha, inverted, ICON_KEY_RING);
467 }
468 else if (icon_id == ICON_EVENT_NDOF_BUTTON_MENU) {
469 icon_draw_rect_input_text(&rect, "Me", aspect, alpha, inverted, ICON_KEY_RING);
470 }
471 else if (icon_id == ICON_EVENT_NDOF_BUTTON_FIT) {
472 icon_draw_rect_input_text(&rect, "Ft", aspect, alpha, inverted, ICON_KEY_RING);
473 }
474 else if (icon_id == ICON_EVENT_NDOF_BUTTON_TOP) {
475 icon_draw_rect_input_text(&rect, "Tp", aspect, alpha, inverted, ICON_KEY_RING);
476 }
477 else if (icon_id == ICON_EVENT_NDOF_BUTTON_BOTTOM) {
478 icon_draw_rect_input_text(&rect, "Bt", aspect, alpha, inverted, ICON_KEY_RING);
479 }
480 else if (icon_id == ICON_EVENT_NDOF_BUTTON_LEFT) {
481 icon_draw_rect_input_text(&rect, "Le", aspect, alpha, inverted, ICON_KEY_RING);
482 }
483 else if (icon_id == ICON_EVENT_NDOF_BUTTON_RIGHT) {
484 icon_draw_rect_input_text(&rect, "Ri", aspect, alpha, inverted, ICON_KEY_RING);
485 }
486 else if (icon_id == ICON_EVENT_NDOF_BUTTON_FRONT) {
487 icon_draw_rect_input_text(&rect, "Fr", aspect, alpha, inverted, ICON_KEY_RING);
488 }
489 else if (icon_id == ICON_EVENT_NDOF_BUTTON_BACK) {
490 icon_draw_rect_input_text(&rect, "Bk", aspect, alpha, inverted, ICON_KEY_RING);
491 }
492 else if (icon_id == ICON_EVENT_NDOF_BUTTON_ISO1) {
493 icon_draw_rect_input_text(&rect, "I1", aspect, alpha, inverted, ICON_KEY_RING);
494 }
495 else if (icon_id == ICON_EVENT_NDOF_BUTTON_ISO2) {
496 icon_draw_rect_input_text(&rect, "I2", aspect, alpha, inverted, ICON_KEY_RING);
497 }
498 else if (icon_id == ICON_EVENT_NDOF_BUTTON_ROLL_CW) {
499 icon_draw_rect_input_text(&rect, "Rl", aspect, alpha, inverted, ICON_KEY_RING);
500 }
501 else if (icon_id == ICON_EVENT_NDOF_BUTTON_ROLL_CCW) {
502 icon_draw_rect_input_text(&rect, "Rc", aspect, alpha, inverted, ICON_KEY_RING);
503 }
504 else if (icon_id == ICON_EVENT_NDOF_BUTTON_SPIN_CW) {
505 icon_draw_rect_input_text(&rect, "Sp", aspect, alpha, inverted, ICON_KEY_RING);
506 }
507 else if (icon_id == ICON_EVENT_NDOF_BUTTON_SPIN_CCW) {
508 icon_draw_rect_input_text(&rect, "Sc", aspect, alpha, inverted, ICON_KEY_RING);
509 }
510 else if (icon_id == ICON_EVENT_NDOF_BUTTON_TILT_CW) {
511 icon_draw_rect_input_text(&rect, "Ti", aspect, alpha, inverted, ICON_KEY_RING);
512 }
513 else if (icon_id == ICON_EVENT_NDOF_BUTTON_TILT_CCW) {
514 icon_draw_rect_input_text(&rect, "Tc", aspect, alpha, inverted, ICON_KEY_RING);
515 }
516 else if (icon_id == ICON_EVENT_NDOF_BUTTON_ROTATE) {
517 icon_draw_rect_input_text(&rect, "Ro", aspect, alpha, inverted, ICON_KEY_RING);
518 }
519 else if (icon_id == ICON_EVENT_NDOF_BUTTON_PANZOOM) {
520 icon_draw_rect_input_text(&rect, "PZ", aspect, alpha, inverted, ICON_KEY_RING);
521 }
522 else if (icon_id == ICON_EVENT_NDOF_BUTTON_DOMINANT) {
523 icon_draw_rect_input_text(&rect, "Dm", aspect, alpha, inverted, ICON_KEY_RING);
524 }
525 else if (icon_id == ICON_EVENT_NDOF_BUTTON_PLUS) {
526 icon_draw_rect_input_text(&rect, "+", aspect, alpha, inverted, ICON_KEY_RING);
527 }
528 else if (icon_id == ICON_EVENT_NDOF_BUTTON_MINUS) {
529 icon_draw_rect_input_text(&rect, "-", aspect, alpha, inverted, ICON_KEY_RING);
530 }
531 }
532}
void BLF_draw_svg_icon(uint icon_id, float x, float y, float size, const float color[4]=nullptr, float outline_alpha=1.0f, bool multicolor=false, blender::FunctionRef< void(std::string &)> edit_source_cb=nullptr)
Definition blf.cc:612
void BLF_size(int fontid, float size)
Definition blf.cc:426
void BLF_color4fv(int fontid, const float rgba[4])
Definition blf.cc:488
void BLF_boundbox(int fontid, const char *str, size_t str_len, rcti *r_box, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:761
#define BLF_DRAW_STR_DUMMY_MAX
Definition BLF_api.hh:393
int BLF_default()
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
Definition blf.cc:568
void BLF_position(int fontid, float x, float y, float z)
Definition blf.cc:371
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition BLI_rect.h:193
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition BLI_rect.h:189
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:197
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:201
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
#define BLI_STR_UTF8_LOWER_RIGHT_PENCIL
#define BLI_STR_UTF8_GREATER_THAN_OR_LESS_THAN
#define BLI_STR_UTF8_LEFTWARDS_ARROW
#define BLI_STR_UTF8_UPWARDS_ARROW
#define BLI_STR_UTF8_DOWNWARDS_ARROW
#define BLI_STR_UTF8_UPWARDS_UP_ARROW_FROM_BAR
#define BLI_STR_UTF8_BLACK_RIGHT_POINTING_DOUBLE_TRIANGLE_WITH_VERTICAL_BAR
#define BLI_STR_UTF8_BLACK_SQUARE_FOR_STOP
#define BLI_STR_UTF8_UPPER_RIGHT_PENCIL
#define BLI_STR_UTF8_SQUARE_WITH_ORTHOGONAL_CROSSHATCH
#define BLI_STR_UTF8_RIGHTWARDS_ARROW
#define BLI_STR_UTF8_RETURN_SYMBOL
#define BLI_STR_UTF8_BLACK_VERTICAL_ELLIPSE
#define BLI_STR_UTF8_BLACK_LEFT_POINTING_DOUBLE_TRIANGLE_WITH_VERTICAL_BAR
#define BLI_STR_UTF8_BLACK_RIGHT_POINTING_TRIANGLE_WITH_DOUBLE_VERTICAL_BAR
unsigned int uint
#define ELEM(...)
#define IFACE_(msgid)
#define UI_SCALE_FAC
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 color
#define UI_FSTYLE_WIDGET
#define ICON_DEFAULT_HEIGHT
@ TH_BACK
@ TH_TEXT
void UI_GetThemeColor4fv(int colorid, float col[4])
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
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
#define str(s)
static int inverted_icon(int icon_id)
static void icon_draw_rect_input_text(const rctf *rect, const char *str, const float aspect, const float alpha, const bool inverted, const int icon_bg=ICON_KEY_EMPTY1)
static void icon_draw_icon(const rctf *rect, const int icon_id, const float aspect, const float alpha, const bool inverted)
void icon_draw_rect_input(const float x, const float y, const int w, const int h, const int icon_id, const float aspect, const float alpha, const bool inverted)
float ui_event_icon_offset(const int icon_id)
float xmin
float ymin
int ymin