diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-01-20 06:25:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-20 07:50:20 +0300 |
commit | 09eec627ed730532905b45d409f9009023623437 (patch) | |
tree | 0b352ce642e5cf54b2ccf83c4f11485e50bdadef /source/blender/editors/include/UI_interface.h | |
parent | f8c52402d6c76392444a9dd9ab90d2f48b1a03fe (diff) |
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.
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 15 |
1 files changed, 9 insertions, 6 deletions
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__ */ |