summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-bitmap-common.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-10-10 23:15:05 +0000
committerThomas Martitz <kugel@rockbox.org>2010-10-10 23:15:05 +0000
commit8a0152bd4ae638c1fe4917b855fcb9fc6a15202c (patch)
tree7a3a81bf30d49a3c072d89485f79207bc7d2c29e /firmware/drivers/lcd-bitmap-common.c
parent752c91b50dcf36e4476cf89cceb6493e2fd4c586 (diff)
downloadrockbox-8a0152bd4ae638c1fe4917b855fcb9fc6a15202c.tar.gz
rockbox-8a0152bd4ae638c1fe4917b855fcb9fc6a15202c.zip
Two new lcd/multi screen api convinience functions: draw_viewport(), fill_viewport().
They work as the drawrect/fillrect pendants but work on a viewport basis; pass NULL to draw the current viewport (the one set with set_viewport()). In conjunction with action_get_touchscreen_press_in_vp() it should be less of a pain to draw buttons and get presses on them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28239 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-bitmap-common.c')
-rw-r--r--firmware/drivers/lcd-bitmap-common.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
index 2ce11e3398..d242096138 100644
--- a/firmware/drivers/lcd-bitmap-common.c
+++ b/firmware/drivers/lcd-bitmap-common.c
@@ -81,6 +81,28 @@ static void lcd_gradient_rect(int x1, int x2, int y, unsigned h,
81} 81}
82#endif 82#endif
83 83
84/*
85 * draws the borders of the viewport, or of current_vp if vp == NULL
86 **/
87void LCDFN(draw_viewport)(const struct viewport *vp)
88{
89 if (vp == NULL)
90 LCDFN(drawrect)(0, 0, current_vp->width, current_vp->height);
91 else
92 LCDFN(drawrect)(vp->x, vp->y, vp->width, vp->height);
93}
94
95/*
96 * fills the rectangle formed by vp or by current_vp if vp == NULL
97 **/
98void LCDFN(fill_viewport)(const struct viewport *vp)
99{
100 if (vp == NULL)
101 LCDFN(fillrect)(0, 0, current_vp->width, current_vp->height);
102 else
103 LCDFN(fillrect)(vp->x, vp->y, vp->width, vp->height);
104}
105
84/* put a string at a given pixel position, skipping first ofs pixel columns */ 106/* put a string at a given pixel position, skipping first ofs pixel columns */
85static void LCDFN(putsxyofs)(int x, int y, int ofs, const unsigned char *str) 107static void LCDFN(putsxyofs)(int x, int y, int ofs, const unsigned char *str)
86{ 108{