From 09eec627ed730532905b45d409f9009023623437 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 20 Jan 2015 14:25:39 +1100 Subject: UI: cleanup UI_fontstyle_string_width, UI_draw_string Both were maked as temp, but used often. Now pass uiFontStyle to both, rename UI_draw_string to UI_fontstyle_draw_simple, since its a variant of UI_fontstyle_draw that skips shadow, align... etc. --- source/blender/editors/include/UI_interface.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 159fda89f59..da857c27435 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -974,15 +974,15 @@ void UI_context_active_but_prop_get_filebrowser(const struct bContext *C, struct void UI_context_active_but_prop_get_templateID(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA **prop); /* Styled text draw */ -void UI_fontstyle_set(struct uiFontStyle *fs); +void UI_fontstyle_set(const struct uiFontStyle *fs); void UI_fontstyle_draw_ex( - struct uiFontStyle *fs, const struct rcti *rect, const char *str, + const struct uiFontStyle *fs, const struct rcti *rect, const char *str, size_t len, float *r_xofs, float *r_yofs); -void UI_fontstyle_draw(struct uiFontStyle *fs, const struct rcti *rect, const char *str); -void UI_fontstyle_draw_rotated(struct uiFontStyle *fs, const struct rcti *rect, const char *str); +void UI_fontstyle_draw(const struct uiFontStyle *fs, const struct rcti *rect, const char *str); +void UI_fontstyle_draw_rotated(const struct uiFontStyle *fs, const struct rcti *rect, const char *str); +void UI_fontstyle_draw_simple(const struct uiFontStyle *fs, float x, float y, const char *str); -int UI_fontstyle_string_width(const char *str); // XXX temp -void UI_draw_string(float x, float y, const char *str); // XXX temp +int UI_fontstyle_string_width(const struct uiFontStyle *fs, const char *str); void UI_draw_icon_tri(float x, float y, char dir); uiStyle *UI_style_get(void); /* use for fonts etc */ @@ -1013,6 +1013,9 @@ void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p); /* Float precision helpers */ #define UI_PRECISION_FLOAT_MAX 7 +/* Typical UI text */ +#define UI_FSTYLE_WIDGET (const uiFontStyle *)&(UI_style_get()->widget) + int UI_calc_float_precision(int prec, double value); #endif /* __UI_INTERFACE_H__ */ -- cgit v1.2.3