Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
- index 64ac462..4785a55 100644
- --- a/lib/skin_parser/skin_parser.c
- +++ b/lib/skin_parser/skin_parser.c
- @@ -877,6 +877,7 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
- #ifdef ROCKBOX
- bool feature_available = true;
- const char *false_branch = NULL;
- + const char *conditional_end = NULL;
- #endif
- /* Some conditional tags allow for target feature checking,
- @@ -955,6 +956,12 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
- false_branch = cursor+1;
- children--;
- }
- + if (element->tag.flags&FEATURE_TAG)
- + {
- + if (feature_avialable)
- + children--;
- + }
- + conditional_end = cursor;
- /* if we are skipping the true branch fix that up */
- cursor = false_branch ? false_branch : bookmark;
- #else
- @@ -986,7 +993,9 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
- cursor++;
- }
- }
- -
- +#ifdef ROCKBOX
- + cursor = conditional_end;
- +#endif
- *document = cursor;
- return 1;
- diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c
- index 8b31ada..0caa987 100644
- --- a/lib/skin_parser/tag_table.c
- +++ b/lib/skin_parser/tag_table.c
- @@ -44,7 +44,7 @@ static const struct tag_info legal_tags[] =
- { SKIN_TOKEN_USB_POWERED, "bu", "", SKIN_REFRESH_DYNAMIC },
- - { SKIN_TOKEN_RTC_PRESENT, "cc", "", SKIN_REFRESH_STATIC },
- + { SKIN_TOKEN_RTC_PRESENT, "cc", "", SKIN_REFRESH_STATIC|FEATURE_TAG },
- { SKIN_TOKEN_RTC_DAY_OF_MONTH, "cd", "", SKIN_RTC_REFRESH },
- { SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, "ce", "", SKIN_RTC_REFRESH },
- { SKIN_TOKEN_RTC_12HOUR_CFG, "cf", "", SKIN_RTC_REFRESH },
- @@ -201,7 +201,7 @@ static const struct tag_info legal_tags[] =
- { SKIN_TOKEN_CURRENT_SCREEN, "cs", "", SKIN_REFRESH_DYNAMIC },
- { SKIN_TOKEN_TOUCHREGION, "T" , "IIIIS|S", 0|NOBREAK },
- - { SKIN_TOKEN_HAVE_RECORDING, "Rp" , "", SKIN_REFRESH_STATIC },
- + { SKIN_TOKEN_HAVE_RECORDING, "Rp" , "", SKIN_REFRESH_STATIC|FEATURE_TAG },
- { SKIN_TOKEN_IS_RECORDING, "Rr" , "", SKIN_REFRESH_DYNAMIC },
- { SKIN_TOKEN_REC_FREQ, "Rf" , "", SKIN_REFRESH_DYNAMIC },
- { SKIN_TOKEN_REC_ENCODER, "Re" , "", SKIN_REFRESH_DYNAMIC },
- diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h
- index f16709d..5f73804 100644
- --- a/lib/skin_parser/tag_table.h
- +++ b/lib/skin_parser/tag_table.h
- @@ -32,7 +32,7 @@ extern "C"
- /* Flag to tell the renderer not to insert a line break */
- #define NOBREAK 0x1
- -
- +#define FEATURE_TAG 0x2
- /* constants used in line_type and as refresh_mode for wps_refresh */
- #define SKIN_REFRESH_SHIFT 16
- #define SKIN_REFRESH_STATIC (1u<<SKIN_REFRESH_SHIFT) /* line doesn't change over time */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement