summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-01-24 09:04:28 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-01-24 09:04:28 +0000
commitf06f6852733b084a5bd09528322d9ffc6886d2f3 (patch)
tree1b5519291250a96fccb0a4660ba266c7f6b84802 /apps
parentcb39ac6b1e2fa14ef3a12a2f6a1f9083c7eeb4aa (diff)
downloadrockbox-f06f6852733b084a5bd09528322d9ffc6886d2f3.tar.gz
rockbox-f06f6852733b084a5bd09528322d9ffc6886d2f3.tar.bz2
rockbox-f06f6852733b084a5bd09528322d9ffc6886d2f3.zip
New option for the bar tags: 'backdrop, <label>' will draw another image under the progressbar (only works with image and slider bars)
example: %V(22,253,198,14,-) %xl(a,PLAY_BAR_BACKDROP-240x320x16.bmp,0,0) %pb(0,0,198,14,PLAY_BAR-240x320x16.bmp, backdrop, a) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29127 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/scrollbar.c3
-rw-r--r--apps/gui/scrollbar.h1
-rw-r--r--apps/gui/skin_engine/skin_display.c22
-rw-r--r--apps/gui/skin_engine/skin_parser.c16
-rw-r--r--apps/gui/skin_engine/wps_internals.h1
5 files changed, 40 insertions, 3 deletions
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c
index 83e86c1527..70d34176e1 100644
--- a/apps/gui/scrollbar.c
+++ b/apps/gui/scrollbar.c
@@ -192,7 +192,8 @@ void gui_bitmap_scrollbar_draw(struct screen * screen, struct bitmap *bm, int x,
screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
/* clear pixels in progress bar */
- screen->fillrect(x, y, width, height);
+ if ((flags&DONT_CLEAR_EXCESS) == 0)
+ screen->fillrect(x, y, width, height);
screen->set_drawmode(DRMODE_SOLID);
diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h
index 31f91a3eaa..606b9bd3d3 100644
--- a/apps/gui/scrollbar.h
+++ b/apps/gui/scrollbar.h
@@ -37,6 +37,7 @@ enum orientation {
color even if FOREGROUND */
INNER_FILL_MASK = 0x00c0,
#endif
+ DONT_CLEAR_EXCESS = 0x0100, /* Don't clear the entire bar area */
};
/*
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index ccedea92a8..5d90e14a0e 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -234,6 +234,28 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
y += img->bm.height / 2;
}
}
+
+ if (pb->backdrop)
+ {
+ struct gui_img *img = pb->backdrop;
+#if LCD_DEPTH > 1
+ if(img->bm.format == FORMAT_MONO) {
+#endif
+ display->mono_bitmap_part(img->bm.data,
+ 0, 0, img->bm.width,
+ x, y, width, height);
+#if LCD_DEPTH > 1
+ } else {
+ display->transparent_bitmap_part((fb_data *)img->bm.data,
+ 0, 0,
+ STRIDE(display->screen_type,
+ img->bm.width, img->bm.height),
+ x, y, width, height);
+ }
+#endif
+ flags |= DONT_CLEAR_EXCESS;
+ }
+
if (!pb->nobar)
{
if (pb->image)
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index e23f84207e..31dd89d0bb 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -601,6 +601,7 @@ static int parse_progressbar_tag(struct skin_element* element,
pb->nobar = false;
pb->image = NULL;
pb->slider = NULL;
+ pb->backdrop = NULL;
pb->invert_fill_direction = false;
pb->horizontal = true;
@@ -696,6 +697,18 @@ static int parse_progressbar_tag(struct skin_element* element,
else /* option needs the next param */
return -1;
}
+ else if (!strcmp(param->data.text, "backdrop"))
+ {
+ if (curr_param+1 < element->params_count)
+ {
+ curr_param++;
+ param++;
+ pb->backdrop = find_image(param->data.text, wps_data);
+
+ }
+ else /* option needs the next param */
+ return -1;
+ }
else if (!strcmp(param->data.text, "vertical"))
{
pb->horizontal = false;
@@ -735,8 +748,7 @@ static int parse_progressbar_tag(struct skin_element* element,
add_to_ll_chain(&wps_data->images, item);
pb->image = img;
}
- }
-
+ }
if (token->type == SKIN_TOKEN_VOLUME)
token->type = SKIN_TOKEN_VOLUMEBAR;
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 02585f22b2..2bf0ee9fe0 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -111,6 +111,7 @@ struct progressbar {
bool nobar;
struct gui_img *slider;
bool horizontal;
+ struct gui_img *backdrop;
};
#endif