diff options
| author | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 21:46:18 +0000 |
|---|---|---|
| committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-08-28 21:46:18 +0000 |
| commit | 0f063b7d725e2c418aa0fb6f06193c79cc9ebea6 (patch) | |
| tree | 706a782ecdb656a3a59fb70d1ac185a3f9f34286 | |
| parent | e78a12bca72cb5b1d559cda0fc68bd324017f9b0 (diff) | |
| download | rockbox-0f063b7d725e2c418aa0fb6f06193c79cc9ebea6.zip rockbox-0f063b7d725e2c418aa0fb6f06193c79cc9ebea6.tar.gz rockbox-0f063b7d725e2c418aa0fb6f06193c79cc9ebea6.tar.bz2 rockbox-0f063b7d725e2c418aa0fb6f06193c79cc9ebea6.tar.xz | |
Implement lcd(_remote)_putsxyf() and export to plugins
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27921 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/plugin.c | 1 | ||||
| -rw-r--r-- | apps/plugin.h | 1 | ||||
| -rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 11 | ||||
| -rw-r--r-- | firmware/export/lcd-remote.h | 1 | ||||
| -rw-r--r-- | firmware/export/lcd.h | 1 |
5 files changed, 15 insertions, 0 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 5101cee..767c593 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -723,6 +723,7 @@ static const struct plugin_api rockbox_api = { the API gets incompatible */ lcd_putsf, + lcd_putsxyf, }; int plugin_load(const char* plugin, const void* parameter) diff --git a/apps/plugin.h b/apps/plugin.h index 2bcd93e..2f187f1 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -896,6 +896,7 @@ struct plugin_api { the API gets incompatible */ void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...); + void (*lcd_putsxyf)(int x, int y, const unsigned char *fmt, ...); }; /* plugin header */ diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index fba09cf..9f1d5fe 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -219,6 +219,17 @@ void LCDFN(putsxy)(int x, int y, const unsigned char *str) LCDFN(putsxyofs)(x, y, 0, str); } +/* Formatting version of LCDFN(putsxy) */ +void LCDFN(putsxyf)(int x, int y, const unsigned char *fmt, ...) +{ + va_list ap; + char buf[256]; + va_start(ap, fmt); + vsnprintf(buf, sizeof (buf), fmt, ap); + va_end(ap); + LCDFN(putsxy)(x, y, buf); +} + static void LCDFN(putsxyofs_style)(int xpos, int ypos, const unsigned char *str, int style, int w, int h, int offset) diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index 62e82ca..5b96863 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -178,6 +178,7 @@ extern void lcd_remote_bitmap_part(const fb_remote_data *src, int src_x, extern void lcd_remote_bitmap(const fb_remote_data *src, int x, int y, int width, int height); extern void lcd_remote_putsxy(int x, int y, const unsigned char *str); +extern void lcd_remote_putsxyf(int x, int y, const unsigned char *fmt, ...); extern void lcd_remote_bidir_scroll(int threshold); extern void lcd_remote_scroll_step(int pixels); diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 3572090..1cbb286 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -191,6 +191,7 @@ extern void lcd_update_viewport(void); extern void lcd_clear_viewport(void); extern void lcd_clear_display(void); extern void lcd_putsxy(int x, int y, const unsigned char *string); +extern void lcd_putsxyf(int x, int y, const unsigned char *fmt, ...); extern void lcd_puts(int x, int y, const unsigned char *string); extern void lcd_putsf(int x, int y, const unsigned char *fmt, ...); extern void lcd_puts_style(int x, int y, const unsigned char *string, int style); |