Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-04 01:58:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-04 03:00:48 +0300
commit54a4c1cf359c369c8fc16ecf0ecaa92e6f650e2f (patch)
tree763437a793072d559095c6bb8d9cf23ca1c111f1 /source/blender/editors/include
parent4431c5825bf26d314abe1f79646883fd746e495b (diff)
UI: refactor layout vars out of uiFontStyle
Word wrap and alignment layout args only used by UI_fontstyle_draw were vars in uiFontStyle. These were written to before drawing, so better pass as an argument. Pass uiFontStyle & uiWidgetColors as const args.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/UI_interface.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index b1dc5821d7a..c525d9cffe6 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -367,7 +367,7 @@ void UI_draw_widget_scroll(struct uiWidgetColors *wcol, const struct rcti *rect,
/* Shortening string helper. */
float UI_text_clip_middle_ex(
- struct uiFontStyle *fstyle, char *str, float okwidth, const float minwidth,
+ const struct uiFontStyle *fstyle, char *str, float okwidth, const float minwidth,
const size_t max_len, const char rpart_sep);
/* Callbacks
@@ -1254,20 +1254,33 @@ struct ID *UI_context_active_but_get_tab_ID(struct bContext *C);
uiBut *UI_region_active_but_get(struct ARegion *ar);
+/* uiFontStyle.align */
+typedef enum eFontStyle_Align {
+ UI_STYLE_TEXT_LEFT = 0,
+ UI_STYLE_TEXT_CENTER = 1,
+ UI_STYLE_TEXT_RIGHT = 2
+} eFontStyle_Align;
+
+struct uiFontStyleDraw_Params {
+ eFontStyle_Align align;
+ uint word_wrap : 1;
+};
+
/* Styled text draw */
void UI_fontstyle_set(const struct uiFontStyle *fs);
void UI_fontstyle_draw_ex(
const struct uiFontStyle *fs, const struct rcti *rect, const char *str,
- const unsigned char col[4], size_t len, float *r_xofs, float *r_yofs);
+ const uchar col[4], const struct uiFontStyleDraw_Params *fs_params,
+ size_t len, float *r_xofs, float *r_yofs);
void UI_fontstyle_draw(
const struct uiFontStyle *fs, const struct rcti *rect, const char *str,
- const unsigned char col[4]);
+ const uchar col[4], const struct uiFontStyleDraw_Params *fs_params);
void UI_fontstyle_draw_rotated(
const struct uiFontStyle *fs, const struct rcti *rect, const char *str,
- const unsigned char col[4]);
+ const uchar col[4]);
void UI_fontstyle_draw_simple(
const struct uiFontStyle *fs, float x, float y, const char *str,
- const unsigned char col[4]);
+ const uchar col[4]);
void UI_fontstyle_draw_simple_backdrop(
const struct uiFontStyle *fs, float x, float y, const char *str,
const float col_fg[4], const float col_bg[4]);