diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-01-24 09:04:28 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-01-24 09:04:28 +0000 |
commit | f06f6852733b084a5bd09528322d9ffc6886d2f3 (patch) | |
tree | 1b5519291250a96fccb0a4660ba266c7f6b84802 /apps | |
parent | cb39ac6b1e2fa14ef3a12a2f6a1f9083c7eeb4aa (diff) | |
download | rockbox-f06f6852733b084a5bd09528322d9ffc6886d2f3.tar.gz 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.c | 3 | ||||
-rw-r--r-- | apps/gui/scrollbar.h | 1 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 22 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 16 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 1 |
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, | |||
192 | screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 192 | screen->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
193 | 193 | ||
194 | /* clear pixels in progress bar */ | 194 | /* clear pixels in progress bar */ |
195 | screen->fillrect(x, y, width, height); | 195 | if ((flags&DONT_CLEAR_EXCESS) == 0) |
196 | screen->fillrect(x, y, width, height); | ||
196 | 197 | ||
197 | screen->set_drawmode(DRMODE_SOLID); | 198 | screen->set_drawmode(DRMODE_SOLID); |
198 | 199 | ||
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 { | |||
37 | color even if FOREGROUND */ | 37 | color even if FOREGROUND */ |
38 | INNER_FILL_MASK = 0x00c0, | 38 | INNER_FILL_MASK = 0x00c0, |
39 | #endif | 39 | #endif |
40 | DONT_CLEAR_EXCESS = 0x0100, /* Don't clear the entire bar area */ | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | /* | 43 | /* |
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) | |||
234 | y += img->bm.height / 2; | 234 | y += img->bm.height / 2; |
235 | } | 235 | } |
236 | } | 236 | } |
237 | |||
238 | if (pb->backdrop) | ||
239 | { | ||
240 | struct gui_img *img = pb->backdrop; | ||
241 | #if LCD_DEPTH > 1 | ||
242 | if(img->bm.format == FORMAT_MONO) { | ||
243 | #endif | ||
244 | display->mono_bitmap_part(img->bm.data, | ||
245 | 0, 0, img->bm.width, | ||
246 | x, y, width, height); | ||
247 | #if LCD_DEPTH > 1 | ||
248 | } else { | ||
249 | display->transparent_bitmap_part((fb_data *)img->bm.data, | ||
250 | 0, 0, | ||
251 | STRIDE(display->screen_type, | ||
252 | img->bm.width, img->bm.height), | ||
253 | x, y, width, height); | ||
254 | } | ||
255 | #endif | ||
256 | flags |= DONT_CLEAR_EXCESS; | ||
257 | } | ||
258 | |||
237 | if (!pb->nobar) | 259 | if (!pb->nobar) |
238 | { | 260 | { |
239 | if (pb->image) | 261 | 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, | |||
601 | pb->nobar = false; | 601 | pb->nobar = false; |
602 | pb->image = NULL; | 602 | pb->image = NULL; |
603 | pb->slider = NULL; | 603 | pb->slider = NULL; |
604 | pb->backdrop = NULL; | ||
604 | pb->invert_fill_direction = false; | 605 | pb->invert_fill_direction = false; |
605 | pb->horizontal = true; | 606 | pb->horizontal = true; |
606 | 607 | ||
@@ -696,6 +697,18 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
696 | else /* option needs the next param */ | 697 | else /* option needs the next param */ |
697 | return -1; | 698 | return -1; |
698 | } | 699 | } |
700 | else if (!strcmp(param->data.text, "backdrop")) | ||
701 | { | ||
702 | if (curr_param+1 < element->params_count) | ||
703 | { | ||
704 | curr_param++; | ||
705 | param++; | ||
706 | pb->backdrop = find_image(param->data.text, wps_data); | ||
707 | |||
708 | } | ||
709 | else /* option needs the next param */ | ||
710 | return -1; | ||
711 | } | ||
699 | else if (!strcmp(param->data.text, "vertical")) | 712 | else if (!strcmp(param->data.text, "vertical")) |
700 | { | 713 | { |
701 | pb->horizontal = false; | 714 | pb->horizontal = false; |
@@ -735,8 +748,7 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
735 | add_to_ll_chain(&wps_data->images, item); | 748 | add_to_ll_chain(&wps_data->images, item); |
736 | pb->image = img; | 749 | pb->image = img; |
737 | } | 750 | } |
738 | } | 751 | } |
739 | |||
740 | 752 | ||
741 | if (token->type == SKIN_TOKEN_VOLUME) | 753 | if (token->type == SKIN_TOKEN_VOLUME) |
742 | token->type = SKIN_TOKEN_VOLUMEBAR; | 754 | 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 { | |||
111 | bool nobar; | 111 | bool nobar; |
112 | struct gui_img *slider; | 112 | struct gui_img *slider; |
113 | bool horizontal; | 113 | bool horizontal; |
114 | struct gui_img *backdrop; | ||
114 | }; | 115 | }; |
115 | #endif | 116 | #endif |
116 | 117 | ||