Blender V2.61 - r43446
|
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_screen_types.h"
#include "DNA_userdef_types.h"
#include "BLI_math.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 "BLF_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 | uiStyleFontDrawExt (uiFontStyle *fs, rcti *rect, const char *str, float *r_xofs, float *r_yofs) |
void | uiStyleFontDraw (uiFontStyle *fs, rcti *rect, const char *str) |
void | uiStyleFontDrawRotated (uiFontStyle *fs, rcti *rect, const char *str) |
uiStyle * | UI_GetStyle (void) |
int | UI_GetStringWidth (const char *str) |
void | UI_DrawString (float x, float y, const char *str) |
void | uiStyleInit (void) |
void | uiStyleFontSet (uiFontStyle *fs) |
Definition in file interface_style.c.
void UI_DrawString | ( | float | x, |
float | y, | ||
const char * | str | ||
) |
Definition at line 285 of file interface_style.c.
References BLF_disable(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_KERNING_DEFAULT, BLF_position(), uiFontStyle::kerning, UI_GetStyle(), uiFontStyle::uifont_id, uiStyleFontSet(), and uiStyle::widget.
Referenced by ANIM_channel_draw(), draw_cfra_number(), draw_marker(), draw_nla_channel_list_gl(), outliner_draw_tree_element(), wm_drags_draw(), and wm_drop_operator_draw().
int UI_GetStringWidth | ( | const char * | str | ) |
Definition at line 266 of file interface_style.c.
References BLF_disable(), BLF_enable(), BLF_KERNING_DEFAULT, BLF_width(), uiFontStyle::kerning, UI_GetStyle(), uiFontStyle::uifont_id, uiStyleFontSet(), and uiStyle::widget.
Referenced by draw_cfra_number(), file_draw_buttons(), GetButStringLength(), node_draw_basis(), outliner_buttons(), outliner_draw_tree_element(), ui_text_icon_width(), wm_drags_draw(), and wm_drop_operator_draw().
uiStyle* UI_GetStyle | ( | void | ) |
Definition at line 257 of file interface_style.c.
References ListBase::first, NULL, U, and UserDef::uistyles.
Referenced by clip_draw_curfra_label(), ED_region_header(), ED_region_info_draw(), ED_region_panels(), file_draw_string(), file_font_pointsize(), file_string_width(), logic_buttons_new(), menu_add_shortcut(), menu_change_shortcut(), node_draw_group(), node_update_basis(), reset_exec(), socket_component_menu(), UI_DrawString(), UI_GetStringWidth(), ui_offset_panel_block(), ui_popup_menu_create(), ui_searchbox_create(), ui_text_bounds_block(), ui_textedit_set_cursor_pos(), ui_tooltip_create(), ui_tooltip_region_draw_cb(), UI_view2d_region_reinit(), uiDrawBlock(), uiPupMenuBegin(), uiTemplateReportsBanner(), wm_block_create_redo(), wm_block_create_splash(), wm_block_dialog_create(), and wm_operator_ui_create().
Definition at line 81 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, uiFontStyle::uifont_id, uiStyle::widget, and uiStyle::widgetlabel.
Referenced by uiStyleInit().
static uiFont* uifont_to_blfont | ( | int | id | ) | [static] |
Definition at line 132 of file interface_style.c.
References ListBase::first, uiFont::next, U, uiFont::uifont_id, and UserDef::uifonts.
Referenced by uiStyleFontSet().
void uiStyleFontDraw | ( | uiFontStyle * | fs, |
rcti * | rect, | ||
const char * | str | ||
) |
Definition at line 194 of file interface_style.c.
References uiStyleFontDrawExt().
Referenced by file_draw_string(), ui_draw_aligned_panel_header(), ui_draw_menu_item(), ui_draw_preview_item(), ui_tooltip_region_draw_cb(), and widget_draw_text().
void uiStyleFontDrawExt | ( | uiFontStyle * | fs, |
rcti * | rect, | ||
const char * | str, | ||
float * | r_xofs, | ||
float * | r_yofs | ||
) |
Definition at line 147 of file interface_style.c.
References uiFontStyle::align, BLF_ascender(), BLF_CLIPPING, BLF_clipping(), BLF_disable(), BLF_draw(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_KERNING_DEFAULT, BLF_position(), BLF_shadow(), BLF_SHADOW, BLF_shadow_offset(), BLF_width(), uiFontStyle::kerning, uiFontStyle::shadow, uiFontStyle::shadowalpha, uiFontStyle::shadowcolor, uiFontStyle::shadx, uiFontStyle::shady, UI_STYLE_TEXT_CENTER, UI_STYLE_TEXT_RIGHT, uiFontStyle::uifont_id, uiStyleFontSet(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by uiStyleFontDraw(), and widget_draw_text().
void uiStyleFontDrawRotated | ( | uiFontStyle * | fs, |
rcti * | rect, | ||
const char * | str | ||
) |
Definition at line 202 of file interface_style.c.
References angle(), BLF_ascender(), BLF_CLIPPING, BLF_clipping(), 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(), uiFontStyle::kerning, uiFontStyle::shadow, uiFontStyle::shadowalpha, uiFontStyle::shadowcolor, uiFontStyle::shadx, uiFontStyle::shady, uiFontStyle::uifont_id, uiStyleFontSet(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ui_draw_aligned_panel_header().
void uiStyleFontSet | ( | uiFontStyle * | fs | ) |
Definition at line 391 of file interface_style.c.
References uiFont::blf_id, BLF_size(), UserDef::dpi, uiFontStyle::points, U, uiFontStyle::uifont_id, and uifont_to_blfont().
Referenced by file_font_pointsize(), file_string_width(), ui_draw_menu_item(), UI_DrawString(), UI_GetStringWidth(), ui_searchbox_create(), ui_text_bounds_block(), ui_text_label_rightclip(), ui_text_leftclip(), ui_textedit_set_cursor_pos(), ui_tooltip_create(), ui_tooltip_region_draw_cb(), uiStyleFontDrawExt(), uiStyleFontDrawRotated(), and widget_draw_text().
void uiStyleInit | ( | void | ) |
Definition at line 304 of file interface_style.c.
References uiFont::blf_id, BLF_load(), BLF_load_mem(), BLF_load_mem_unique(), blf_mono_font, blf_mono_font_render, BLF_size(), BLF_unload(), BLI_addtail(), BLI_strncpy(), CLAMP(), datatoc_bfont_ttf, datatoc_bfont_ttf_size, datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size, UserDef::dpi, uiFont::filename, ListBase::first, G, G_DEBUG, MEM_callocN(), uiFont::next, NULL, UserDef::transopts, U, ui_style_new(), UIFONT_DEFAULT, uiFont::uifont_id, UserDef::uifonts, UserDef::uistyles, and USER_DOTRANSLATE.
Referenced by UI_init_userdef(), and UI_reinit_font().