Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2011
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
  2. index ccedea9..4b24527 100644
  3. --- a/apps/gui/skin_engine/skin_display.c
  4. +++ b/apps/gui/skin_engine/skin_display.c
  5. @@ -234,6 +234,19 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
  6. y += img->bm.height / 2;
  7. }
  8. }
  9. +
  10. + if (pb->backdrop)
  11. + {
  12. + int xoff = 0, yoff = 0;
  13. + int w = width, h = height;
  14. + struct gui_img *img = pb->backdrop;
  15. + display->transparent_bitmap_part((fb_data *)img->bm.data,
  16. + 0, 0,
  17. + STRIDE(display->screen_type,
  18. + img->bm.width, img->bm.height),
  19. + x, y, width, height);
  20. + }
  21. +
  22. if (!pb->nobar)
  23. {
  24. if (pb->image)
  25. diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
  26. index e23f842..5b9e9be 100644
  27. --- a/apps/gui/skin_engine/skin_parser.c
  28. +++ b/apps/gui/skin_engine/skin_parser.c
  29. @@ -584,7 +584,7 @@ static int parse_progressbar_tag(struct skin_element* element,
  30. struct viewport *vp = &curr_vp->vp;
  31. struct skin_tag_parameter *param = element->params;
  32. int curr_param = 0;
  33. - char *image_filename = NULL;
  34. + char *image_filename = NULL, *backdrop_filename = NULL;
  35.  
  36. if (element->params_count == 0 &&
  37. element->tag->type != SKIN_TOKEN_PROGRESSBAR)
  38. @@ -601,6 +601,7 @@ static int parse_progressbar_tag(struct skin_element* element,
  39. pb->nobar = false;
  40. pb->image = NULL;
  41. pb->slider = NULL;
  42. + pb->backdrop = NULL;
  43. pb->invert_fill_direction = false;
  44. pb->horizontal = true;
  45.  
  46. @@ -696,6 +697,18 @@ static int parse_progressbar_tag(struct skin_element* element,
  47. else /* option needs the next param */
  48. return -1;
  49. }
  50. + else if (!strcmp(param->data.text, "backdrop"))
  51. + {
  52. + if (curr_param+1 < element->params_count)
  53. + {
  54. + curr_param++;
  55. + param++;
  56. + backdrop_filename = param->data.text;
  57. +
  58. + }
  59. + else /* option needs the next param */
  60. + return -1;
  61. + }
  62. else if (!strcmp(param->data.text, "vertical"))
  63. {
  64. pb->horizontal = false;
  65. @@ -736,6 +749,33 @@ static int parse_progressbar_tag(struct skin_element* element,
  66. pb->image = img;
  67. }
  68. }
  69. +
  70. + if (backdrop_filename)
  71. + {
  72. + pb->backdrop = find_image(backdrop_filename, wps_data);
  73. + if (!pb->backdrop) /* load later */
  74. + {
  75. + struct gui_img* img = (struct gui_img*)skin_buffer_alloc(sizeof(struct gui_img));
  76. + if (!img)
  77. + return WPS_ERROR_INVALID_PARAM;
  78. + /* save a pointer to the filename */
  79. + img->bm.data = (char*)backdrop_filename;
  80. + img->label = backdrop_filename;
  81. + img->x = 0;
  82. + img->y = 0;
  83. + img->num_subimages = 1;
  84. + img->always_display = false;
  85. + img->display = -1;
  86. + img->using_preloaded_icons = false;
  87. + img->vp = &curr_vp->vp;
  88. + struct skin_token_list *item =
  89. + (struct skin_token_list *)new_skin_token_list_item(NULL, img);
  90. + if (!item)
  91. + return WPS_ERROR_INVALID_PARAM;
  92. + add_to_ll_chain(&wps_data->images, item);
  93. + pb->backdrop = img;
  94. + }
  95. + }
  96.  
  97.  
  98. if (token->type == SKIN_TOKEN_VOLUME)
  99. diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
  100. index 02585f2..2bf0ee9 100644
  101. --- a/apps/gui/skin_engine/wps_internals.h
  102. +++ b/apps/gui/skin_engine/wps_internals.h
  103. @@ -111,6 +111,7 @@ struct progressbar {
  104. bool nobar;
  105. struct gui_img *slider;
  106. bool horizontal;
  107. + struct gui_img *backdrop;
  108. };
  109. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement