Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
- index ccedea9..4b24527 100644
- --- a/apps/gui/skin_engine/skin_display.c
- +++ b/apps/gui/skin_engine/skin_display.c
- @@ -234,6 +234,19 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
- y += img->bm.height / 2;
- }
- }
- +
- + if (pb->backdrop)
- + {
- + int xoff = 0, yoff = 0;
- + int w = width, h = height;
- + struct gui_img *img = pb->backdrop;
- + 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);
- + }
- +
- 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 e23f842..5b9e9be 100644
- --- a/apps/gui/skin_engine/skin_parser.c
- +++ b/apps/gui/skin_engine/skin_parser.c
- @@ -584,7 +584,7 @@ static int parse_progressbar_tag(struct skin_element* element,
- struct viewport *vp = &curr_vp->vp;
- struct skin_tag_parameter *param = element->params;
- int curr_param = 0;
- - char *image_filename = NULL;
- + char *image_filename = NULL, *backdrop_filename = NULL;
- if (element->params_count == 0 &&
- element->tag->type != SKIN_TOKEN_PROGRESSBAR)
- @@ -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++;
- + backdrop_filename = param->data.text;
- +
- + }
- + else /* option needs the next param */
- + return -1;
- + }
- else if (!strcmp(param->data.text, "vertical"))
- {
- pb->horizontal = false;
- @@ -736,6 +749,33 @@ static int parse_progressbar_tag(struct skin_element* element,
- pb->image = img;
- }
- }
- +
- + if (backdrop_filename)
- + {
- + pb->backdrop = find_image(backdrop_filename, wps_data);
- + if (!pb->backdrop) /* load later */
- + {
- + struct gui_img* img = (struct gui_img*)skin_buffer_alloc(sizeof(struct gui_img));
- + if (!img)
- + return WPS_ERROR_INVALID_PARAM;
- + /* save a pointer to the filename */
- + img->bm.data = (char*)backdrop_filename;
- + img->label = backdrop_filename;
- + img->x = 0;
- + img->y = 0;
- + img->num_subimages = 1;
- + img->always_display = false;
- + img->display = -1;
- + img->using_preloaded_icons = false;
- + img->vp = &curr_vp->vp;
- + struct skin_token_list *item =
- + (struct skin_token_list *)new_skin_token_list_item(NULL, img);
- + if (!item)
- + return WPS_ERROR_INVALID_PARAM;
- + add_to_ll_chain(&wps_data->images, item);
- + pb->backdrop = img;
- + }
- + }
- if (token->type == SKIN_TOKEN_VOLUME)
- diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
- index 02585f2..2bf0ee9 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement