diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 51 |
1 files changed, 39 insertions, 12 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index bd6199c5e9..dbbdc32730 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -104,8 +104,6 @@ extern void print_debug_info(struct wps_data *data, int fail, int line); | |||
104 | extern void debug_skin_usage(void); | 104 | extern void debug_skin_usage(void); |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | static void wps_reset(struct wps_data *data); | ||
108 | |||
109 | /* Function for parsing of details for a token. At the moment the | 107 | /* Function for parsing of details for a token. At the moment the |
110 | function is called, the token type has already been set. The | 108 | function is called, the token type has already been set. The |
111 | function must fill in the details and possibly add more tokens | 109 | function must fill in the details and possibly add more tokens |
@@ -1582,16 +1580,45 @@ static bool wps_parse(struct wps_data *data, const char *wps_bufptr, bool debug) | |||
1582 | return (fail == 0); | 1580 | return (fail == 0); |
1583 | } | 1581 | } |
1584 | 1582 | ||
1585 | static void wps_reset(struct wps_data *data) | 1583 | |
1584 | /* | ||
1585 | * initial setup of wps_data; does reset everything | ||
1586 | * except fields which need to survive, i.e. | ||
1587 | * | ||
1588 | * wps_data->remote_wps | ||
1589 | **/ | ||
1590 | void skin_data_reset(struct wps_data *wps_data) | ||
1586 | { | 1591 | { |
1587 | #ifdef HAVE_REMOTE_LCD | 1592 | #ifdef HAVE_LCD_BITMAP |
1588 | bool rwps = data->remote_wps; /* remember whether the data is for a RWPS */ | 1593 | wps_data->images = NULL; |
1594 | wps_data->progressbars = NULL; | ||
1589 | #endif | 1595 | #endif |
1590 | memset(data, 0, sizeof(*data)); | 1596 | #ifdef HAVE_TOUCHSCREEN |
1591 | skin_data_init(data); | 1597 | wps_data->touchregions = NULL; |
1592 | #ifdef HAVE_REMOTE_LCD | 1598 | #endif |
1593 | data->remote_wps = rwps; | 1599 | wps_data->viewports = NULL; |
1600 | wps_data->strings = NULL; | ||
1601 | #ifdef HAVE_ALBUMART | ||
1602 | wps_data->albumart = NULL; | ||
1603 | #endif | ||
1604 | wps_data->tokens = NULL; | ||
1605 | wps_data->num_tokens = 0; | ||
1606 | wps_data->button_time_volume = 0; | ||
1607 | |||
1608 | #ifdef HAVE_LCD_BITMAP | ||
1609 | wps_data->peak_meter_enabled = false; | ||
1610 | wps_data->wps_sb_tag = false; | ||
1611 | wps_data->show_sb_on_wps = false; | ||
1612 | #else /* HAVE_LCD_CHARCELLS */ | ||
1613 | /* progress bars */ | ||
1614 | int i; | ||
1615 | for (i = 0; i < 8; i++) | ||
1616 | { | ||
1617 | wps_data->wps_progress_pat[i] = 0; | ||
1618 | } | ||
1619 | wps_data->full_line_progressbar = false; | ||
1594 | #endif | 1620 | #endif |
1621 | wps_data->wps_loaded = false; | ||
1595 | } | 1622 | } |
1596 | 1623 | ||
1597 | #ifdef HAVE_LCD_BITMAP | 1624 | #ifdef HAVE_LCD_BITMAP |
@@ -1704,7 +1731,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1704 | } | 1731 | } |
1705 | #endif | 1732 | #endif |
1706 | 1733 | ||
1707 | wps_reset(wps_data); | 1734 | skin_data_reset(wps_data); |
1708 | 1735 | ||
1709 | curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); | 1736 | curr_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); |
1710 | if (!curr_vp) | 1737 | if (!curr_vp) |
@@ -1796,7 +1823,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1796 | 1823 | ||
1797 | /* parse the WPS source */ | 1824 | /* parse the WPS source */ |
1798 | if (!wps_parse(wps_data, wps_buffer, true)) { | 1825 | if (!wps_parse(wps_data, wps_buffer, true)) { |
1799 | wps_reset(wps_data); | 1826 | skin_data_reset(wps_data); |
1800 | return false; | 1827 | return false; |
1801 | } | 1828 | } |
1802 | 1829 | ||
@@ -1811,7 +1838,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1811 | 1838 | ||
1812 | /* load the bitmaps that were found by the parsing */ | 1839 | /* load the bitmaps that were found by the parsing */ |
1813 | if (!load_skin_bitmaps(wps_data, bmpdir)) { | 1840 | if (!load_skin_bitmaps(wps_data, bmpdir)) { |
1814 | wps_reset(wps_data); | 1841 | skin_data_reset(wps_data); |
1815 | return false; | 1842 | return false; |
1816 | } | 1843 | } |
1817 | #endif | 1844 | #endif |