diff options
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r-- | apps/gui/gwps-common.c | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 86003fa9ef..cb2329c65d 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -1396,10 +1396,6 @@ static bool get_line(struct gui_wps *gwps, | |||
1396 | i = find_conditional_end(data, i); | 1396 | i = find_conditional_end(data, i); |
1397 | break; | 1397 | break; |
1398 | 1398 | ||
1399 | case WPS_TOKEN_SUBLINE_TIMEOUT: | ||
1400 | data->time_mult[line][subline] = data->tokens[i].value.i; | ||
1401 | break; | ||
1402 | |||
1403 | #ifdef HAVE_LCD_BITMAP | 1399 | #ifdef HAVE_LCD_BITMAP |
1404 | case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: | 1400 | case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: |
1405 | { | 1401 | { |
@@ -1484,9 +1480,44 @@ static bool get_line(struct gui_wps *gwps, | |||
1484 | return update; | 1480 | return update; |
1485 | } | 1481 | } |
1486 | 1482 | ||
1483 | static void get_subline_timeout(struct gui_wps *gwps, int line, int subline) | ||
1484 | { | ||
1485 | struct wps_data *data = gwps->data; | ||
1486 | int i = data->format_lines[line][subline]; | ||
1487 | |||
1488 | while (data->tokens[i].type != WPS_TOKEN_EOL | ||
1489 | && data->tokens[i].type != WPS_TOKEN_SUBLINE_SEPARATOR | ||
1490 | && i < data->num_tokens) | ||
1491 | { | ||
1492 | switch(data->tokens[i].type) | ||
1493 | { | ||
1494 | case WPS_TOKEN_CONDITIONAL: | ||
1495 | /* place ourselves in the right conditional case */ | ||
1496 | i = evaluate_conditional(gwps, i); | ||
1497 | break; | ||
1498 | |||
1499 | case WPS_TOKEN_CONDITIONAL_OPTION: | ||
1500 | /* we've finished in the curent conditional case, | ||
1501 | skip to the end of the conditional structure */ | ||
1502 | i = find_conditional_end(data, i); | ||
1503 | break; | ||
1504 | |||
1505 | case WPS_TOKEN_SUBLINE_TIMEOUT: | ||
1506 | data->time_mult[line][subline] = data->tokens[i].value.i; | ||
1507 | break; | ||
1508 | |||
1509 | default: | ||
1510 | break; | ||
1511 | } | ||
1512 | i++; | ||
1513 | } | ||
1514 | } | ||
1515 | |||
1487 | /* Calculate which subline should be displayed for each line */ | 1516 | /* Calculate which subline should be displayed for each line */ |
1488 | static bool get_curr_subline(struct wps_data *data, int line) | 1517 | static bool get_curr_subline(struct gui_wps *gwps, int line) |
1489 | { | 1518 | { |
1519 | struct wps_data *data = gwps->data; | ||
1520 | |||
1490 | int search, search_start; | 1521 | int search, search_start; |
1491 | bool reset_subline; | 1522 | bool reset_subline; |
1492 | bool new_subline_refresh; | 1523 | bool new_subline_refresh; |
@@ -1532,6 +1563,9 @@ static bool get_curr_subline(struct wps_data *data, int line) | |||
1532 | } | 1563 | } |
1533 | else | 1564 | else |
1534 | { | 1565 | { |
1566 | /* get initial time multiplier for this subline */ | ||
1567 | get_subline_timeout(gwps, line, data->curr_subline[line]); | ||
1568 | |||
1535 | /* only use this subline if subline time > 0 */ | 1569 | /* only use this subline if subline time > 0 */ |
1536 | if (data->time_mult[line][data->curr_subline[line]] > 0) | 1570 | if (data->time_mult[line][data->curr_subline[line]] > 0) |
1537 | { | 1571 | { |
@@ -1791,7 +1825,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, | |||
1791 | update_line = false; | 1825 | update_line = false; |
1792 | 1826 | ||
1793 | /* get current subline for the line */ | 1827 | /* get current subline for the line */ |
1794 | new_subline_refresh = get_curr_subline(data, line); | 1828 | new_subline_refresh = get_curr_subline(gwps, line); |
1795 | 1829 | ||
1796 | flags = data->line_type[line][data->curr_subline[line]]; | 1830 | flags = data->line_type[line][data->curr_subline[line]]; |
1797 | 1831 | ||