summaryrefslogtreecommitdiffstats
path: root/apps/gui/line.h
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-04-16 23:47:17 +0200
committerThomas Martitz <kugel@rockbox.org>2014-01-07 14:13:48 +0100
commit36e469db8bb7789c89ff642b51c1471669b830f5 (patch)
tree14e40cf0b2258dfe34a2fbf5a436db5de2abcdd1 /apps/gui/line.h
parentad0985ea1c4841498084dc3bc2158492f207e6fb (diff)
downloadrockbox-36e469db8bb7789c89ff642b51c1471669b830f5.tar.gz
rockbox-36e469db8bb7789c89ff642b51c1471669b830f5.tar.bz2
rockbox-36e469db8bb7789c89ff642b51c1471669b830f5.zip
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
Diffstat (limited to 'apps/gui/line.h')
-rw-r--r--apps/gui/line.h24
1 files changed, 23 insertions, 1 deletions
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;
};