Blender  V2.93
interface_style.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2009 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include <limits.h>
25 #include <math.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 
30 #include "MEM_guardedalloc.h"
31 
32 #include "DNA_userdef_types.h"
33 
34 #include "BLI_listbase.h"
35 #include "BLI_rect.h"
36 #include "BLI_string.h"
37 #include "BLI_utildefines.h"
38 
39 #include "BKE_global.h"
40 
41 #include "BLF_api.h"
42 #ifdef WITH_INTERNATIONAL
43 # include "BLT_translation.h"
44 #endif
45 
46 #include "UI_interface.h"
47 
48 #include "ED_datafiles.h"
49 
50 #include "interface_intern.h"
51 
52 #ifdef WIN32
53 # include "BLI_math_base.h" /* M_PI */
54 #endif
55 
56 /* style + theme + layout-engine = UI */
57 
73 /* ********************************************** */
74 
75 static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id)
76 {
77  uiStyle *style = MEM_callocN(sizeof(uiStyle), "new style");
78 
79  BLI_addtail(styles, style);
80  BLI_strncpy(style->name, name, MAX_STYLE_NAME);
81 
82  style->panelzoom = 1.0; /* unused */
83 
84  style->paneltitle.uifont_id = uifont_id;
86  style->paneltitle.kerning = 1;
87  style->paneltitle.shadow = 3;
88  style->paneltitle.shadx = 0;
89  style->paneltitle.shady = -1;
90  style->paneltitle.shadowalpha = 0.5f;
91  style->paneltitle.shadowcolor = 0.0f;
92 
93  style->grouplabel.uifont_id = uifont_id;
95  style->grouplabel.kerning = 1;
96  style->grouplabel.shadow = 3;
97  style->grouplabel.shadx = 0;
98  style->grouplabel.shady = -1;
99  style->grouplabel.shadowalpha = 0.5f;
100  style->grouplabel.shadowcolor = 0.0f;
101 
102  style->widgetlabel.uifont_id = uifont_id;
104  style->widgetlabel.kerning = 1;
105  style->widgetlabel.shadow = 3;
106  style->widgetlabel.shadx = 0;
107  style->widgetlabel.shady = -1;
108  style->widgetlabel.shadowalpha = 0.5f;
109  style->widgetlabel.shadowcolor = 0.0f;
110 
111  style->widget.uifont_id = uifont_id;
113  style->widget.kerning = 1;
114  style->widget.shadow = 1;
115  style->widget.shady = -1;
116  style->widget.shadowalpha = 0.5f;
117  style->widget.shadowcolor = 0.0f;
118 
119  style->columnspace = 8;
120  style->templatespace = 5;
121  style->boxspace = 5;
122  style->buttonspacex = 8;
123  style->buttonspacey = 2;
124  style->panelspace = 8;
125  style->panelouter = 4;
126 
127  return style;
128 }
129 
130 static uiFont *uifont_to_blfont(int id)
131 {
132  uiFont *font = U.uifonts.first;
133 
134  for (; font; font = font->next) {
135  if (font->uifont_id == id) {
136  return font;
137  }
138  }
139  return U.uifonts.first;
140 }
141 
142 /* *************** draw ************************ */
143 
145  const rcti *rect,
146  const char *str,
147  const uchar col[4],
148  const struct uiFontStyleDraw_Params *fs_params,
149  size_t len,
150  int *r_xofs,
151  int *r_yofs,
152  struct ResultBLF *r_info)
153 {
154  int xofs = 0, yofs;
155  int font_flag = BLF_CLIPPING;
156 
157  UI_fontstyle_set(fs);
158 
159  /* set the flag */
160  if (fs->shadow) {
161  font_flag |= BLF_SHADOW;
162  const float shadow_color[4] = {
163  fs->shadowcolor, fs->shadowcolor, fs->shadowcolor, fs->shadowalpha};
164  BLF_shadow(fs->uifont_id, fs->shadow, shadow_color);
165  BLF_shadow_offset(fs->uifont_id, fs->shadx, fs->shady);
166  }
167  if (fs->kerning == 1) {
168  font_flag |= BLF_KERNING_DEFAULT;
169  }
170  if (fs_params->word_wrap == 1) {
171  font_flag |= BLF_WORD_WRAP;
172  }
173  if (fs->bold) {
174  font_flag |= BLF_BOLD;
175  }
176  if (fs->italic) {
177  font_flag |= BLF_ITALIC;
178  }
179 
180  BLF_enable(fs->uifont_id, font_flag);
181 
182  if (fs_params->word_wrap == 1) {
183  /* draw from boundbox top */
184  yofs = BLI_rcti_size_y(rect) - BLF_height_max(fs->uifont_id);
185  }
186  else {
187  /* draw from boundbox center */
188  const float height = BLF_ascender(fs->uifont_id) + BLF_descender(fs->uifont_id);
189  yofs = ceil(0.5f * (BLI_rcti_size_y(rect) - height));
190  }
191 
192  if (fs_params->align == UI_STYLE_TEXT_CENTER) {
193  xofs = floor(0.5f * (BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len)));
194  }
195  else if (fs_params->align == UI_STYLE_TEXT_RIGHT) {
196  xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str, len);
197  }
198 
199  yofs = MAX2(0, yofs);
200  xofs = MAX2(0, xofs);
201 
202  BLF_clipping(fs->uifont_id, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
203  BLF_position(fs->uifont_id, rect->xmin + xofs, rect->ymin + yofs, 0.0f);
205 
206  BLF_draw_ex(fs->uifont_id, str, len, r_info);
207 
208  BLF_disable(fs->uifont_id, font_flag);
209 
210  if (r_xofs) {
211  *r_xofs = xofs;
212  }
213  if (r_yofs) {
214  *r_yofs = yofs;
215  }
216 }
217 
219  const rcti *rect,
220  const char *str,
221  const uchar col[4],
222  const struct uiFontStyleDraw_Params *fs_params)
223 {
224  int xofs, yofs;
225 
226  UI_fontstyle_draw_ex(fs, rect, str, col, fs_params, BLF_DRAW_STR_DUMMY_MAX, &xofs, &yofs, NULL);
227 }
228 
229 /* drawn same as above, but at 90 degree angle */
231  const rcti *rect,
232  const char *str,
233  const uchar col[4])
234 {
235  float height;
236  int xofs, yofs;
237  float angle;
238  rcti txtrect;
239 
240  UI_fontstyle_set(fs);
241 
243  /* becomes x-offset when rotated */
244  xofs = ceil(0.5f * (BLI_rcti_size_y(rect) - height));
245 
246  /* ignore UI_STYLE, always aligned to top */
247 
248  /* rotate counter-clockwise for now (assumes left-to-right language)*/
249  xofs += height;
250  yofs = BLF_width(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX) + 5;
251  angle = M_PI_2;
252 
253  /* translate rect to vertical */
254  txtrect.xmin = rect->xmin - BLI_rcti_size_y(rect);
255  txtrect.ymin = rect->ymin - BLI_rcti_size_x(rect);
256  txtrect.xmax = rect->xmin;
257  txtrect.ymax = rect->ymin;
258 
259  /* clip is very strict, so we give it some space */
260  /* clipping is done without rotation, so make rect big enough to contain both positions */
262  txtrect.xmin - 1,
263  txtrect.ymin - yofs - xofs - 4,
264  rect->xmax + 1,
265  rect->ymax + 4);
267  BLF_position(fs->uifont_id, txtrect.xmin + xofs, txtrect.ymax - yofs, 0.0f);
268 
272 
273  if (fs->shadow) {
275  const float shadow_color[4] = {
276  fs->shadowcolor, fs->shadowcolor, fs->shadowcolor, fs->shadowalpha};
277  BLF_shadow(fs->uifont_id, fs->shadow, shadow_color);
278  BLF_shadow_offset(fs->uifont_id, fs->shadx, fs->shady);
279  }
280 
281  if (fs->kerning == 1) {
283  }
284 
288  if (fs->shadow) {
290  }
291  if (fs->kerning == 1) {
293  }
294 }
295 
303  const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
304 {
305  if (fs->kerning == 1) {
307  }
308 
309  UI_fontstyle_set(fs);
310  BLF_position(fs->uifont_id, x, y, 0.0f);
313 
314  if (fs->kerning == 1) {
316  }
317 }
318 
323  float x,
324  float y,
325  const char *str,
326  const float col_fg[4],
327  const float col_bg[4])
328 {
329  if (fs->kerning == 1) {
331  }
332 
333  UI_fontstyle_set(fs);
334 
335  {
336  const float width = BLF_width(fs->uifont_id, str, BLF_DRAW_STR_DUMMY_MAX);
337  const float height = BLF_height_max(fs->uifont_id);
338  const float decent = BLF_descender(fs->uifont_id);
339  const float margin = height / 4.0f;
340 
341  /* backdrop */
342  const float color[4] = {col_bg[0], col_bg[1], col_bg[2], 0.5f};
343 
346  &(const rctf){
347  .xmin = x - margin,
348  .xmax = x + width + margin,
349  .ymin = (y + decent) - margin,
350  .ymax = (y + decent) + height + margin,
351  },
352  true,
353  margin,
354  color);
355  }
356 
357  BLF_position(fs->uifont_id, x, y, 0.0f);
358  BLF_color4fv(fs->uifont_id, col_fg);
360 
361  if (fs->kerning == 1) {
363  }
364 }
365 
366 /* ************** helpers ************************ */
367 /* XXX: read a style configure */
368 const uiStyle *UI_style_get(void)
369 {
370 #if 0
371  uiStyle *style = NULL;
372  /* offset is two struct uiStyle pointers */
373  style = BLI_findstring(&U.uistyles, "Unifont Style", sizeof(style) * 2);
374  return (style != NULL) ? style : U.uistyles.first;
375 #else
376  return U.uistyles.first;
377 #endif
378 }
379 
380 /* for drawing, scaled with DPI setting */
382 {
383  const uiStyle *style = UI_style_get();
384  static uiStyle _style;
385 
386  _style = *style;
387 
388  _style.paneltitle.shadx = (short)(UI_DPI_FAC * _style.paneltitle.shadx);
389  _style.paneltitle.shady = (short)(UI_DPI_FAC * _style.paneltitle.shady);
390  _style.grouplabel.shadx = (short)(UI_DPI_FAC * _style.grouplabel.shadx);
391  _style.grouplabel.shady = (short)(UI_DPI_FAC * _style.grouplabel.shady);
392  _style.widgetlabel.shadx = (short)(UI_DPI_FAC * _style.widgetlabel.shadx);
393  _style.widgetlabel.shady = (short)(UI_DPI_FAC * _style.widgetlabel.shady);
394 
395  _style.columnspace = (short)(UI_DPI_FAC * _style.columnspace);
396  _style.templatespace = (short)(UI_DPI_FAC * _style.templatespace);
397  _style.boxspace = (short)(UI_DPI_FAC * _style.boxspace);
398  _style.buttonspacex = (short)(UI_DPI_FAC * _style.buttonspacex);
399  _style.buttonspacey = (short)(UI_DPI_FAC * _style.buttonspacey);
400  _style.panelspace = (short)(UI_DPI_FAC * _style.panelspace);
401  _style.panelouter = (short)(UI_DPI_FAC * _style.panelouter);
402 
403  return &_style;
404 }
405 
406 int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str)
407 {
408  int width;
409 
410  if (fs->kerning == 1) {
411  /* for BLF_width */
413  }
414 
415  UI_fontstyle_set(fs);
417 
418  if (fs->kerning == 1) {
420  }
421 
422  return width;
423 }
424 
426 {
427  UI_fontstyle_set(fs);
428  return BLF_height_max(fs->uifont_id);
429 }
430 
431 /* ************** init exit ************************ */
432 
433 /* called on each startup.blend read */
434 /* reading without uifont will create one */
435 void uiStyleInit(void)
436 {
437  uiStyle *style = U.uistyles.first;
438 
439  /* recover from uninitialized dpi */
440  if (U.dpi == 0) {
441  U.dpi = 72;
442  }
443  CLAMP(U.dpi, 48, 144);
444 
445  LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {
446  BLF_unload_id(font->blf_id);
447  }
448 
449  if (blf_mono_font != -1) {
451  blf_mono_font = -1;
452  }
453 
454  if (blf_mono_font_render != -1) {
457  }
458 
459  uiFont *font_first = U.uifonts.first;
460 
461  /* default builtin */
462  if (font_first == NULL) {
463  font_first = MEM_callocN(sizeof(uiFont), "ui font");
464  BLI_addtail(&U.uifonts, font_first);
465  }
466 
467  if (U.font_path_ui[0]) {
468  BLI_strncpy(font_first->filename, U.font_path_ui, sizeof(font_first->filename));
469  font_first->uifont_id = UIFONT_CUSTOM1;
470  }
471  else {
472  BLI_strncpy(font_first->filename, "default", sizeof(font_first->filename));
473  font_first->uifont_id = UIFONT_DEFAULT;
474  }
475 
476  LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {
477  const bool unique = false;
478 
479  if (font->uifont_id == UIFONT_DEFAULT) {
480  font->blf_id = BLF_load_default(unique);
481  }
482  else {
483  font->blf_id = BLF_load(font->filename);
484  if (font->blf_id == -1) {
485  font->blf_id = BLF_load_default(unique);
486  }
487  }
488 
489  BLF_default_set(font->blf_id);
490 
491  if (font->blf_id == -1) {
492  if (G.debug & G_DEBUG) {
493  printf("%s: error, no fonts available\n", __func__);
494  }
495  }
496  else {
497  /* ? just for speed to initialize?
498  * Yes, this build the glyph cache and create
499  * the texture.
500  */
501  BLF_size(font->blf_id, 11 * U.pixelsize, U.dpi);
502  BLF_size(font->blf_id, 12 * U.pixelsize, U.dpi);
503  BLF_size(font->blf_id, 14 * U.pixelsize, U.dpi);
504  }
505  }
506 
507  if (style == NULL) {
508  ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT);
509  }
510 
511  /* XXX, this should be moved into a style,
512  * but for now best only load the monospaced font once. */
513  BLI_assert(blf_mono_font == -1);
514  /* Use unique font loading to avoid thread safety issues with mono font
515  * used for render metadata stamp in threads. */
516  if (U.font_path_ui_mono[0]) {
517  blf_mono_font = BLF_load_unique(U.font_path_ui_mono);
518  }
519  if (blf_mono_font == -1) {
520  const bool unique = true;
522  }
523 
524  BLF_size(blf_mono_font, 12 * U.pixelsize, 72);
525 
526  /* Set default flags based on UI preferences (not render fonts) */
527  {
528  const int flag_disable = (BLF_MONOCHROME | BLF_HINTING_NONE | BLF_HINTING_SLIGHT |
530  int flag_enable = 0;
531 
532  if (U.text_render & USER_TEXT_HINTING_NONE) {
533  flag_enable |= BLF_HINTING_NONE;
534  }
535  else if (U.text_render & USER_TEXT_HINTING_SLIGHT) {
536  flag_enable |= BLF_HINTING_SLIGHT;
537  }
538  else if (U.text_render & USER_TEXT_HINTING_FULL) {
539  flag_enable |= BLF_HINTING_FULL;
540  }
541 
542  if (U.text_render & USER_TEXT_DISABLE_AA) {
543  flag_enable |= BLF_MONOCHROME;
544  }
545 
546  LISTBASE_FOREACH (uiFont *, font, &U.uifonts) {
547  if (font->blf_id != -1) {
548  BLF_disable(font->blf_id, flag_disable);
549  BLF_enable(font->blf_id, flag_enable);
550  }
551  }
552  if (blf_mono_font != -1) {
553  BLF_disable(blf_mono_font, flag_disable);
554  BLF_enable(blf_mono_font, flag_enable);
555  }
556  }
557 
564  if (blf_mono_font_render == -1) {
565  const bool unique = true;
567  }
568 
569  BLF_size(blf_mono_font_render, 12 * U.pixelsize, 72);
570 }
571 
573 {
574  uiFont *font = uifont_to_blfont(fs->uifont_id);
575 
576  BLF_size(font->blf_id, fs->points * U.pixelsize, U.dpi);
577 }
@ G_DEBUG
Definition: BKE_global.h:133
void BLF_default_set(int fontid)
Definition: blf_default.c:48
#define BLF_CLIPPING
Definition: BLF_api.h:270
#define BLF_KERNING_DEFAULT
Definition: BLF_api.h:272
float BLF_width(int fontid, const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: blf.c:723
void BLF_color4fv(int fontid, const float rgba[4])
Definition: blf.c:441
#define BLF_MONOCHROME
Definition: BLF_api.h:276
void BLF_shadow_offset(int fontid, int x, int y)
Definition: blf.c:841
int blf_mono_font_render
Definition: blf.c:71
void BLF_shadow(int fontid, int level, const float rgba[4]) ATTR_NONNULL(3)
Definition: blf.c:831
#define BLF_HINTING_NONE
Definition: BLF_api.h:277
#define BLF_BOLD
Definition: BLF_api.h:280
void BLF_draw(int fontid, const char *str, size_t len) ATTR_NONNULL(2)
Definition: blf.c:542
#define BLF_DRAW_STR_DUMMY_MAX
Definition: BLF_api.h:283
#define BLF_ITALIC
Definition: BLF_api.h:281
void BLF_disable(int fontid, int option)
Definition: blf.c:283
void BLF_rotation(int fontid, float angle)
Definition: blf.c:801
#define BLF_ROTATION
Definition: BLF_api.h:269
float BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT
Definition: blf.c:779
int BLF_load_unique(const char *name) ATTR_NONNULL()
Definition: blf.c:166
void BLF_unload_id(int fontid)
Definition: blf.c:260
#define BLF_HINTING_FULL
Definition: BLF_api.h:279
float BLF_ascender(int fontid) ATTR_WARN_UNUSED_RESULT
Definition: blf.c:790
int blf_mono_font
Definition: blf.c:70
void BLF_draw_ex(int fontid, const char *str, size_t len, struct ResultBLF *r_info) ATTR_NONNULL(2)
Definition: blf.c:525
int BLF_load_mono_default(const bool unique)
#define BLF_HINTING_SLIGHT
Definition: BLF_api.h:278
void BLF_size(int fontid, int size, int dpi)
Definition: blf.c:367
void BLF_enable(int fontid, int option)
Definition: blf.c:274
#define BLF_SHADOW
Definition: BLF_api.h:271
int BLF_load(const char *name) ATTR_NONNULL()
Definition: blf.c:153
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
Definition: blf.c:757
int BLF_load_default(const bool unique)
#define BLF_WORD_WRAP
Definition: BLF_api.h:275
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
Definition: blf.c:387
void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
Definition: blf.c:810
void BLF_position(int fontid, float x, float y, float z)
Definition: blf.c:312
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
#define M_PI_2
Definition: BLI_math_base.h:41
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:157
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
Definition: BLI_rect.h:153
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
unsigned char uchar
Definition: BLI_sys_types.h:86
#define MAX2(a, b)
#define MAX_STYLE_NAME
@ UIFONT_DEFAULT
@ UIFONT_CUSTOM1
@ USER_TEXT_HINTING_SLIGHT
@ USER_TEXT_HINTING_FULL
@ USER_TEXT_DISABLE_AA
@ USER_TEXT_HINTING_NONE
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
@ UI_CNR_ALL
void UI_draw_roundbox_corner_set(int type)
@ UI_STYLE_TEXT_CENTER
@ UI_STYLE_TEXT_RIGHT
#define UI_DPI_FAC
Definition: UI_interface.h:309
void UI_draw_roundbox_aa(const struct rctf *rect, bool filled, float rad, const float color[4])
#define UI_DEFAULT_TITLE_POINTS
Definition: UI_interface.h:241
#define UI_DEFAULT_TEXT_POINTS
Definition: UI_interface.h:238
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
#define str(s)
uint col
void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str)
const uiStyle * UI_style_get_dpi(void)
const uiStyle * UI_style_get(void)
void UI_fontstyle_draw_simple_backdrop(const uiFontStyle *fs, float x, float y, const char *str, const float col_fg[4], const float col_bg[4])
int UI_fontstyle_height_max(const uiFontStyle *fs)
void UI_fontstyle_draw_ex(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params, size_t len, int *r_xofs, int *r_yofs, struct ResultBLF *r_info)
void UI_fontstyle_draw_rotated(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4])
void UI_fontstyle_set(const uiFontStyle *fs)
static uiFont * uifont_to_blfont(int id)
void uiStyleInit(void)
static uiStyle * ui_style_new(ListBase *styles, const char *name, short uifont_id)
void UI_fontstyle_draw(const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params)
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
eFontStyle_Align align
short blf_id
struct uiFont * next
char filename[1024]
short uifont_id
short buttonspacey
uiFontStyle paneltitle
uiFontStyle grouplabel
short buttonspacex
short panelouter
short templatespace
short panelspace
uiFontStyle widget
short columnspace
char name[64]
uiFontStyle widgetlabel
ccl_device_inline float2 floor(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)
#define G(x, y, z)
uint len