summaryrefslogtreecommitdiffstats
path: root/apps/screen_access.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-12-20 23:34:28 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-07 14:13:17 +0100
commit5d6974641b14ef81396e8deebcc65a87c07334e5 (patch)
treea3c12feecc5ae2007d71be2fb383ea7047c87f11 /apps/screen_access.c
parent5752d029fd80e87fe522d7d5e952a56dc371d65e (diff)
downloadrockbox-5d6974641b14ef81396e8deebcc65a87c07334e5.tar.gz
rockbox-5d6974641b14ef81396e8deebcc65a87c07334e5.tar.bz2
rockbox-5d6974641b14ef81396e8deebcc65a87c07334e5.zip
Introduce put_line().
This function is a fully-fletched, high-level pixel-based line printer, that combines functionality of several firmware and list functions. It can draw spacing, icons and text in a single call, in any order and each multiple times. It can also apply line decorations at the same time. It features printf-like semantics by accepting a format string that contain format tags as well as inline text. It's accessible directly, but also through the multi-screen api for plugins. Change-Id: I70f5a77bbf4b0252521f2e47ead377b9d6d29b54
Diffstat (limited to 'apps/screen_access.c')
-rw-r--r--apps/screen_access.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/screen_access.c b/apps/screen_access.c
index 7f44cf5305..81bb6bae8f 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -100,6 +100,15 @@ static void screen_helper_set_drawmode(int mode)
#endif
}
+static void screen_helper_put_line(int x, int y, struct line_desc *line,
+ const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vput_line(&screens[0], x, y, line, fmt, ap);
+ va_end(ap);
+}
+
#if NB_SCREENS == 2
static int screen_helper_remote_getcharwidth(void)
{
@@ -156,6 +165,15 @@ static void screen_helper_remote_setuifont(int font)
#endif
}
+static void screen_helper_remote_put_line(int x, int y, struct line_desc *line,
+ const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vput_line(&screens[0], x, y, line, fmt, ap);
+ va_end(ap);
+}
+
#endif
struct screen screens[NB_SCREENS] =
@@ -280,6 +298,7 @@ struct screen screens[NB_SCREENS] =
.gradient_fillrect_part = lcd_gradient_fillrect_part,
#endif
#endif
+ .put_line = screen_helper_put_line,
},
#if NB_SCREENS == 2
{
@@ -380,6 +399,7 @@ struct screen screens[NB_SCREENS] =
#if defined(HAVE_LCD_BITMAP)
.set_framebuffer = (void*)lcd_remote_set_framebuffer,
#endif
+ .put_line = screen_helper_remote_put_line,
}
#endif /* NB_SCREENS == 2 */
};