summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index fa35ed994f..434e7c9fa5 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -683,8 +683,15 @@ static int parse_viewport(const char *wps_bufptr,
683 curr_line = NULL; 683 curr_line = NULL;
684 if (!skin_start_new_line(skin_vp, wps_data->num_tokens)) 684 if (!skin_start_new_line(skin_vp, wps_data->num_tokens))
685 return WPS_ERROR_INVALID_PARAM; 685 return WPS_ERROR_INVALID_PARAM;
686 686
687 if (*ptr == 'l') 687
688 if (*ptr == 'i')
689 {
690 skin_vp->label = VP_INFO_LABEL;
691 skin_vp->hidden_flags = VP_NEVER_VISIBLE;
692 ++ptr;
693 }
694 else if (*ptr == 'l')
688 { 695 {
689 if (*(ptr+1) == '|') 696 if (*(ptr+1) == '|')
690 { 697 {
@@ -1674,7 +1681,6 @@ static bool load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char
1674 else 1681 else
1675 { 1682 {
1676 /* Abort if we can't load an image */ 1683 /* Abort if we can't load an image */
1677 DEBUGF("ERR: Failed to load image - %s\n",img_path);
1678 loaded = false; 1684 loaded = false;
1679 } 1685 }
1680 return loaded; 1686 return loaded;
@@ -1733,7 +1739,6 @@ static bool load_skin_bitmaps(struct wps_data *wps_data, char *bmpdir)
1733/* to setup up the wps-data from a format-buffer (isfile = false) 1739/* to setup up the wps-data from a format-buffer (isfile = false)
1734 from a (wps-)file (isfile = true)*/ 1740 from a (wps-)file (isfile = true)*/
1735bool skin_data_load(struct wps_data *wps_data, 1741bool skin_data_load(struct wps_data *wps_data,
1736 struct screen *display,
1737 const char *buf, 1742 const char *buf,
1738 bool isfile) 1743 bool isfile)
1739{ 1744{
@@ -1755,6 +1760,7 @@ bool skin_data_load(struct wps_data *wps_data,
1755 1760
1756 skin_data_reset(wps_data); 1761 skin_data_reset(wps_data);
1757 1762
1763 /* alloc default viewport, will be fixed up later */
1758 curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); 1764 curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport));
1759 if (!curr_vp) 1765 if (!curr_vp)
1760 return false; 1766 return false;
@@ -1766,9 +1772,6 @@ bool skin_data_load(struct wps_data *wps_data,
1766 1772
1767 /* Initialise the first (default) viewport */ 1773 /* Initialise the first (default) viewport */
1768 curr_vp->label = VP_DEFAULT_LABEL; 1774 curr_vp->label = VP_DEFAULT_LABEL;
1769 curr_vp->vp.x = 0;
1770 curr_vp->vp.width = display->getwidth();
1771 curr_vp->vp.height = display->getheight();
1772 curr_vp->pb = NULL; 1775 curr_vp->pb = NULL;
1773 curr_vp->hidden_flags = 0; 1776 curr_vp->hidden_flags = 0;
1774 curr_vp->lines = NULL; 1777 curr_vp->lines = NULL;
@@ -1777,31 +1780,6 @@ bool skin_data_load(struct wps_data *wps_data,
1777 if (!skin_start_new_line(curr_vp, 0)) 1780 if (!skin_start_new_line(curr_vp, 0))
1778 return false; 1781 return false;
1779 1782
1780 switch (statusbar_position(display->screen_type))
1781 {
1782 case STATUSBAR_OFF:
1783 curr_vp->vp.y = 0;
1784 break;
1785 case STATUSBAR_TOP:
1786 curr_vp->vp.y = STATUSBAR_HEIGHT;
1787 curr_vp->vp.height -= STATUSBAR_HEIGHT;
1788 break;
1789 case STATUSBAR_BOTTOM:
1790 curr_vp->vp.y = 0;
1791 curr_vp->vp.height -= STATUSBAR_HEIGHT;
1792 break;
1793 }
1794#ifdef HAVE_LCD_BITMAP
1795 curr_vp->vp.font = FONT_UI;
1796 curr_vp->vp.drawmode = DRMODE_SOLID;
1797#endif
1798#if LCD_DEPTH > 1
1799 if (display->depth > 1)
1800 {
1801 curr_vp->vp.fg_pattern = display->get_foreground();
1802 curr_vp->vp.bg_pattern = display->get_background();
1803 }
1804#endif
1805 if (!isfile) 1783 if (!isfile)
1806 { 1784 {
1807 return wps_parse(wps_data, buf, false); 1785 return wps_parse(wps_data, buf, false);