From 36e469db8bb7789c89ff642b51c1471669b830f5 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 16 Apr 2013 23:47:17 +0200 Subject: lcd-common: Remove direct style (line decorations) from lcd-puts* functions. This logic is moved into apps (put_line()) which can better handle line decorations with respect to scrolling, mulitline and other complications. Firmware doesn't need this. The remaining drawing function know only one style, that is foreground on background/backdrop (changing drawmode is still supported). Change-Id: I707060edc388a7d723a7d09b0cf5cbda6ec56708 --- apps/gui/line.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'apps/gui/line.h') diff --git a/apps/gui/line.h b/apps/gui/line.h index d5350eb410..fa1522003c 100644 --- a/apps/gui/line.h +++ b/apps/gui/line.h @@ -29,6 +29,28 @@ #include "lcd.h" #include "screens.h" +/* Possible line decoration styles. Specify one of + * STYLE_NONE, _DEFAULT, _INVERT, _COLORBAR or _GRADIENT, and optionally + * or with STYLE_COLORED specifying line_desc.text_color */ +enum line_styles { + /* Just print the text. Do not clear or draw line decorations */ + STYLE_NONE = 0x00, + /* Line background filled with the bg color (or backdrop if present) */ + STYLE_DEFAULT = 0x01, + /* Like STYLE_DFEAULT except that text and background color will be swapped */ + STYLE_INVERT = 0x02, + /* Line background filled with line color line_desc.line_color */ + STYLE_COLORBAR = 0x04, + /* Line background filled with gradient, colors taken from + * line_desc.line_color and line_desc.line_end_color */ + STYLE_GRADIENT = 0x08, + /* Modifier for the text color, which will be taken from line_desc.text_color */ + STYLE_COLORED = 0x10, + /* These are used internally */ + _STYLE_DECO_MASK = 0x0f, + _STYLE_MODE_MASK = 0x7F, +}; + struct line_desc { /* height of the line (in pixels). -1 to inherit the height * from the font. The text will be centered if the height is larger, @@ -49,7 +71,7 @@ struct line_desc { * lcd format (convert with LCD_RGBPACK() if necessary) */ fb_data line_color, line_end_color; /* line decorations, see STYLE_DEFAULT etc. */ - int style; + enum line_styles style; /* whether the line can scroll */ bool scroll; }; -- cgit v1.2.3