Blender
V3.3
|
#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 uiStyle * | ui_style_new (ListBase *styles, const char *name, short uifont_id) |
static uiFont * | uifont_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 uiStyle * | UI_style_get (void) |
const uiStyle * | UI_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) |
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().
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 | ||
) |
Definition at line 123 of file interface_style.cc.
References uiFontStyleDraw_Params::align, BLF_ascender(), BLF_BOLD, BLF_clipping(), BLF_CLIPPING, BLF_color4ubv(), BLF_descender(), BLF_disable(), BLF_draw_ex(), BLF_enable(), BLF_height_max(), BLF_ITALIC, BLF_position(), BLF_shadow(), BLF_SHADOW, BLF_shadow_offset(), BLF_width(), BLF_WORD_WRAP, BLI_rcti_size_x(), BLI_rcti_size_y(), uiFontStyle::bold, ceil(), col, blender::math::floor(), height, uiFontStyle::italic, MAX2, uiFontStyle::shadow, uiFontStyle::shadowalpha, uiFontStyle::shadowcolor, uiFontStyle::shadx, uiFontStyle::shady, str, UI_fontstyle_set(), UI_STYLE_TEXT_CENTER, UI_STYLE_TEXT_RIGHT, uiFontStyle::uifont_id, uiFontStyleDraw_Params::word_wrap, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by UI_fontstyle_draw().
void UI_fontstyle_draw_rotated | ( | const uiFontStyle * | fs, |
const rcti * | rect, | ||
const char * | str, | ||
const uchar | col[4] | ||
) |
Definition at line 204 of file interface_style.cc.
References angle(), BLF_ascender(), BLF_clipping(), BLF_CLIPPING, BLF_color4ubv(), BLF_descender(), BLF_disable(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_position(), BLF_rotation(), BLF_ROTATION, BLF_shadow(), BLF_SHADOW, BLF_shadow_offset(), BLF_width(), BLI_rcti_size_x(), BLI_rcti_size_y(), ceil(), col, height, M_PI_2, uiFontStyle::shadow, uiFontStyle::shadowalpha, uiFontStyle::shadowcolor, uiFontStyle::shadx, uiFontStyle::shady, str, UI_fontstyle_set(), uiFontStyle::uifont_id, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
void UI_fontstyle_draw_simple | ( | const uiFontStyle * | fs, |
float | x, | ||
float | y, | ||
const char * | str, | ||
const uchar | col[4] | ||
) |
Definition at line 263 of file interface_style.cc.
References BLF_color4ubv(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_position(), col, str, UI_fontstyle_set(), uiFontStyle::uifont_id, x, and y.
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] | ||
) |
Definition at line 272 of file interface_style.cc.
References BLF_color4fv(), BLF_descender(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_height_max(), BLF_position(), BLF_width(), height, str, UI_CNR_ALL, UI_draw_roundbox_4fv(), UI_draw_roundbox_corner_set(), UI_fontstyle_set(), uiFontStyle::uifont_id, width, x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.
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.
void UI_fontstyle_set | ( | const uiFontStyle * | fs | ) |
Definition at line 495 of file interface_style.cc.
References uiFont::blf_id, BLF_size(), uiFontStyle::points, uiFontStyle::uifont_id, and uifont_to_blfont().
Referenced by UI_fontstyle_draw_ex(), UI_fontstyle_draw_rotated(), UI_fontstyle_draw_simple(), UI_fontstyle_draw_simple_backdrop(), UI_fontstyle_height_max(), and UI_fontstyle_string_width().
int UI_fontstyle_string_width | ( | const uiFontStyle * | fs, |
const char * | str | ||
) |
Definition at line 340 of file interface_style.cc.
References BLF_DRAW_STR_DUMMY_MAX, BLF_width(), str, UI_fontstyle_set(), and uiFontStyle::uifont_id.
Referenced by UI_fontstyle_string_width_with_block_aspect().
int UI_fontstyle_string_width_with_block_aspect | ( | const uiFontStyle * | fs, |
const char * | str, | ||
const float | aspect | ||
) |
Definition at line 346 of file interface_style.cc.
References ceilf, uiFontStyle::points, str, ui_fontscale(), UI_fontstyle_string_width(), and width.
Definition at line 303 of file interface_style.cc.
References BLI_findstring().
Referenced by clip_draw_dopesheet_channels(), component_menu(), drw_text_cache_draw_ex(), ED_region_cache_draw_curfra_label(), file_draw_string(), file_draw_string_multiline(), file_font_pointsize(), file_string_width(), blender::ed::space_node::frame_node_draw_label(), get_column_width(), get_index_column_width(), radial_control_paint_cursor(), reset_exec(), slider_draw(), ui_block_bounds_calc_text(), UI_panel_category_draw_all(), UI_preview_tile_size_y(), ui_searchbox_create_generic_ex(), UI_style_get_dpi(), ui_textedit_set_cursor_pos(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), UI_view2d_region_reinit(), uiTemplateReportsBanner(), uiTemplateStatusInfo(), voxel_size_edit_draw(), and widget_preview_tile().
Definition at line 315 of file interface_style.cc.
References uiStyle::boxspace, uiStyle::buttonspacex, uiStyle::buttonspacey, uiStyle::columnspace, uiStyle::grouplabel, uiStyle::panelouter, uiStyle::panelspace, uiStyle::paneltitle, uiFontStyle::shadx, uiFontStyle::shady, uiStyle::templatespace, UI_DPI_FAC, UI_style_get(), and uiStyle::widgetlabel.
Referenced by colorband_tools_func(), blender::ed::space_node::draw_tree_path(), ed_panel_draw(), ED_region_header_layout(), ED_region_image_metadata_draw(), ED_region_info_draw_multiline(), ED_region_property_search(), ED_time_scrub_channel_search_draw(), get_index_column_width(), menu_add_shortcut(), menu_change_shortcut(), menu_items_from_ui_create(), blender::ed::space_node::node_update_basis(), spreadsheet_footer_region_draw(), template_ID_tabs(), text_size_get(), UI_block_draw(), ui_offset_panel_block(), UI_pie_menu_begin(), ui_popover_create_block(), ui_popover_panel_create(), UI_popup_menu_begin_ex(), ui_popup_menu_create(), uiItemsAlertBox(), wm_block_create_about(), wm_block_create_redo(), wm_block_create_splash(), wm_block_dialog_create(), and wm_operator_ui_create().
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:
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().
|
static |
Definition at line 109 of file interface_style.cc.
References uiFont::next, and uiFont::uifont_id.
Referenced by UI_fontstyle_set().
Called on each startup.blend read, reading without uiFont will create one.
Second for rendering else we get threading problems,
Definition at line 375 of file interface_style.cc.
References BLF_cache_flush_set_fn(), BLF_default_set(), BLF_default_size(), BLF_disable(), BLF_enable(), BLF_HINTING_FULL, BLF_HINTING_NONE, BLF_HINTING_SLIGHT, BLF_load(), BLF_load_default(), BLF_load_font_stack(), BLF_load_mono_default(), BLF_load_unique(), blf_mono_font, blf_mono_font_render, BLF_MONOCHROME, BLF_unload_all(), BLI_addtail(), BLI_assert, BLI_strncpy(), CLAMP, uiFont::filepath, G, G_DEBUG, LISTBASE_FOREACH, uiFontStyle::points, ui_style_new(), UI_widgetbase_draw_cache_flush(), UIFONT_CUSTOM1, UIFONT_DEFAULT, uiFont::uifont_id, USER_TEXT_DISABLE_AA, USER_TEXT_HINTING_FULL, USER_TEXT_HINTING_NONE, USER_TEXT_HINTING_SLIGHT, and uiStyle::widgetlabel.
Referenced by UI_init_userdef(), UI_reinit_font(), and UI_style_init_default().