|
Blender
V2.93
|
#include <limits.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#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 "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 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 (const uiFontStyle *fs, const rcti *rect, const char *str, 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_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 uchar | col[4], | ||
| const struct uiFontStyleDraw_Params * | fs_params | ||
| ) |
Definition at line 218 of file interface_style.c.
References BLF_DRAW_STR_DUMMY_MAX, col, NULL, str, and UI_fontstyle_draw_ex().
| 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 | ||
| ) |
Definition at line 144 of file interface_style.c.
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_KERNING_DEFAULT, 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, floor(), height, uiFontStyle::italic, uiFontStyle::kerning, len, 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 230 of file interface_style.c.
References angle(), BLF_ascender(), BLF_clipping(), BLF_CLIPPING, BLF_color4ubv(), BLF_descender(), BLF_disable(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_KERNING_DEFAULT, 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, uiFontStyle::kerning, 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] | ||
| ) |
Similar to UI_fontstyle_draw but ignore alignment, shadow & no clipping rect.
For drawing on-screen labels.
Definition at line 302 of file interface_style.c.
References BLF_color4ubv(), BLF_disable(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_KERNING_DEFAULT, BLF_position(), col, uiFontStyle::kerning, 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] | ||
| ) |
Same as UI_fontstyle_draw but draw a colored backdrop.
Definition at line 322 of file interface_style.c.
References BLF_color4fv(), BLF_descender(), BLF_disable(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_height_max(), BLF_KERNING_DEFAULT, BLF_position(), BLF_width(), height, uiFontStyle::kerning, str, UI_CNR_ALL, UI_draw_roundbox_aa(), UI_draw_roundbox_corner_set(), UI_fontstyle_set(), uiFontStyle::uifont_id, width, x, and y.
| int UI_fontstyle_height_max | ( | const uiFontStyle * | fs | ) |
Definition at line 425 of file interface_style.c.
References BLF_height_max(), UI_fontstyle_set(), and uiFontStyle::uifont_id.
| void UI_fontstyle_set | ( | const uiFontStyle * | fs | ) |
Definition at line 572 of file interface_style.c.
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 406 of file interface_style.c.
References BLF_disable(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_KERNING_DEFAULT, BLF_width(), uiFontStyle::kerning, str, UI_fontstyle_set(), uiFontStyle::uifont_id, and width.
| const uiStyle* UI_style_get | ( | void | ) |
Definition at line 368 of file interface_style.c.
References BLI_findstring(), and NULL.
Referenced by BLF_draw_default(), BLF_draw_default_ascii(), BLF_set_default(), 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(), get_column_width(), get_index_column_width(), node_draw_frame_label(), radial_control_paint_cursor(), reset_exec(), ui_block_bounds_calc_text(), UI_panel_category_draw_all(), ui_searchbox_create_generic(), UI_style_get_dpi(), ui_textedit_set_cursor_pos(), ui_tooltip_create_with_data(), ui_tooltip_region_draw_cb(), UI_view2d_region_reinit(), uiTemplateReportsBanner(), and voxel_size_edit_draw().
| const uiStyle* UI_style_get_dpi | ( | void | ) |
Definition at line 381 of file interface_style.c.
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(), 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(), node_update_basis(), spreadsheet_footer_region_draw(), template_ID_tabs(), 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 75 of file interface_style.c.
References BLI_addtail(), BLI_strncpy(), uiStyle::boxspace, uiStyle::buttonspacex, uiStyle::buttonspacey, uiStyle::columnspace, uiStyle::grouplabel, uiFontStyle::kerning, MAX_STYLE_NAME, MEM_callocN, 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 130 of file interface_style.c.
References uiFont::next, and uiFont::uifont_id.
Referenced by UI_fontstyle_set().
| void uiStyleInit | ( | void | ) |
Second for rendering else we get threading problems,
Definition at line 435 of file interface_style.c.
References BLF_default_set(), BLF_disable(), BLF_enable(), BLF_HINTING_FULL, BLF_HINTING_NONE, BLF_HINTING_SLIGHT, BLF_load(), BLF_load_default(), BLF_load_mono_default(), BLF_load_unique(), blf_mono_font, blf_mono_font_render, BLF_MONOCHROME, BLF_size(), BLF_unload_id(), BLI_addtail(), BLI_assert, BLI_strncpy(), CLAMP, uiFont::filename, G, G_DEBUG, LISTBASE_FOREACH, MEM_callocN, NULL, ui_style_new(), UIFONT_CUSTOM1, UIFONT_DEFAULT, uiFont::uifont_id, USER_TEXT_DISABLE_AA, USER_TEXT_HINTING_FULL, USER_TEXT_HINTING_NONE, and USER_TEXT_HINTING_SLIGHT.
Referenced by UI_init_userdef(), UI_reinit_font(), and UI_style_init_default().