Blender  V3.3
Functions
interface_style.cc File Reference
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "BLI_listbase.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BLF_api.h"
#include "BLT_translation.h"
#include "UI_interface.h"
#include "ED_datafiles.h"
#include "interface_intern.h"

Go to the source code of this file.

Functions

static uiStyleui_style_new (ListBase *styles, const char *name, short uifont_id)
 
static uiFontuifont_to_blfont (int id)
 
void UI_fontstyle_draw_ex (const uiFontStyle *fs, const rcti *rect, const char *str, const size_t str_len, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params, int *r_xofs, int *r_yofs, struct ResultBLF *r_info)
 
void UI_fontstyle_draw (const uiFontStyle *fs, const rcti *rect, const char *str, const size_t str_len, const uchar col[4], const struct uiFontStyleDraw_Params *fs_params)
 
void UI_fontstyle_draw_rotated (const uiFontStyle *fs, const rcti *rect, const char *str, const uchar col[4])
 
void UI_fontstyle_draw_simple (const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
 
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])
 
const uiStyleUI_style_get (void)
 
const uiStyleUI_style_get_dpi (void)
 
int UI_fontstyle_string_width (const uiFontStyle *fs, const char *str)
 
int UI_fontstyle_string_width_with_block_aspect (const uiFontStyle *fs, const char *str, const float aspect)
 
int UI_fontstyle_height_max (const uiFontStyle *fs)
 
void uiStyleInit (void)
 
void UI_fontstyle_set (const uiFontStyle *fs)
 

Function Documentation

◆ UI_fontstyle_draw()

void UI_fontstyle_draw ( const uiFontStyle fs,
const rcti rect,
const char *  str,
const size_t  str_len,
const uchar  col[4],
const struct uiFontStyleDraw_Params fs_params 
)

Definition at line 194 of file interface_style.cc.

References col, str, and UI_fontstyle_draw_ex().

◆ UI_fontstyle_draw_ex()

void UI_fontstyle_draw_ex ( const uiFontStyle fs,
const rcti rect,
const char *  str,
const size_t  str_len,
const uchar  col[4],
const struct uiFontStyleDraw_Params fs_params,
int *  r_xofs,
int *  r_yofs,
struct ResultBLF r_info 
)

◆ UI_fontstyle_draw_rotated()

void UI_fontstyle_draw_rotated ( const uiFontStyle fs,
const rcti rect,
const char *  str,
const uchar  col[4] 
)

◆ UI_fontstyle_draw_simple()

void UI_fontstyle_draw_simple ( const uiFontStyle fs,
float  x,
float  y,
const char *  str,
const uchar  col[4] 
)

◆ UI_fontstyle_draw_simple_backdrop()

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] 
)

◆ UI_fontstyle_height_max()

int UI_fontstyle_height_max ( const uiFontStyle fs)

Definition at line 367 of file interface_style.cc.

References BLF_height_max(), UI_fontstyle_set(), and uiFontStyle::uifont_id.

◆ UI_fontstyle_set()

void UI_fontstyle_set ( const uiFontStyle fs)

◆ UI_fontstyle_string_width()

int UI_fontstyle_string_width ( const uiFontStyle fs,
const char *  str 
)

◆ UI_fontstyle_string_width_with_block_aspect()

int UI_fontstyle_string_width_with_block_aspect ( const uiFontStyle fs,
const char *  str,
const float  aspect 
)

◆ UI_style_get()

const uiStyle* UI_style_get ( void  )

◆ UI_style_get_dpi()

const uiStyle* UI_style_get_dpi ( void  )

◆ ui_style_new()

static uiStyle* ui_style_new ( ListBase styles,
const char *  name,
short  uifont_id 
)
static

This is a complete set of layout rules, the 'state' of the Layout Engine. Multiple styles are possible, defined via C or Python. Styles get a name, and will typically get activated per region type, like "Header", or "Listview" or "Toolbar". Properties of Style definitions are:

  • default column properties, internal spacing, aligning, min/max width
  • button alignment rules (for groups)
  • label placement rules
  • internal labeling or external labeling default
  • default minimum widths for buttons/labels (in amount of characters)
  • font types, styles and relative sizes for Panel titles, labels, etc.

Definition at line 58 of file interface_style.cc.

References BLI_addtail(), BLI_strncpy(), uiStyle::boxspace, uiStyle::buttonspacex, uiStyle::buttonspacey, uiStyle::columnspace, uiStyle::grouplabel, MAX_STYLE_NAME, uiStyle::name, uiStyle::panelouter, uiStyle::panelspace, uiStyle::paneltitle, uiStyle::panelzoom, uiFontStyle::points, uiFontStyle::shadow, uiFontStyle::shadowalpha, uiFontStyle::shadowcolor, uiFontStyle::shadx, uiFontStyle::shady, uiStyle::templatespace, UI_DEFAULT_TEXT_POINTS, UI_DEFAULT_TITLE_POINTS, uiFontStyle::uifont_id, uiStyle::widget, and uiStyle::widgetlabel.

Referenced by uiStyleInit().

◆ uifont_to_blfont()

static uiFont* uifont_to_blfont ( int  id)
static

Definition at line 109 of file interface_style.cc.

References uiFont::next, and uiFont::uifont_id.

Referenced by UI_fontstyle_set().

◆ uiStyleInit()

void uiStyleInit ( void  )