Guest User

Untitled

a guest
Oct 27th, 2010
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
  2. index 64ac462..4785a55 100644
  3. --- a/lib/skin_parser/skin_parser.c
  4. +++ b/lib/skin_parser/skin_parser.c
  5. @@ -877,6 +877,7 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
  6. #ifdef ROCKBOX
  7. bool feature_available = true;
  8. const char *false_branch = NULL;
  9. + const char *conditional_end = NULL;
  10. #endif
  11.  
  12. /* Some conditional tags allow for target feature checking,
  13. @@ -955,6 +956,12 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
  14. false_branch = cursor+1;
  15. children--;
  16. }
  17. + if (element->tag.flags&FEATURE_TAG)
  18. + {
  19. + if (feature_avialable)
  20. + children--;
  21. + }
  22. + conditional_end = cursor;
  23. /* if we are skipping the true branch fix that up */
  24. cursor = false_branch ? false_branch : bookmark;
  25. #else
  26. @@ -986,7 +993,9 @@ static int skin_parse_conditional(struct skin_element* element, const char** doc
  27. cursor++;
  28. }
  29. }
  30. -
  31. +#ifdef ROCKBOX
  32. + cursor = conditional_end;
  33. +#endif
  34. *document = cursor;
  35.  
  36. return 1;
  37. diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c
  38. index 8b31ada..0caa987 100644
  39. --- a/lib/skin_parser/tag_table.c
  40. +++ b/lib/skin_parser/tag_table.c
  41. @@ -44,7 +44,7 @@ static const struct tag_info legal_tags[] =
  42. { SKIN_TOKEN_USB_POWERED, "bu", "", SKIN_REFRESH_DYNAMIC },
  43.  
  44.  
  45. - { SKIN_TOKEN_RTC_PRESENT, "cc", "", SKIN_REFRESH_STATIC },
  46. + { SKIN_TOKEN_RTC_PRESENT, "cc", "", SKIN_REFRESH_STATIC|FEATURE_TAG },
  47. { SKIN_TOKEN_RTC_DAY_OF_MONTH, "cd", "", SKIN_RTC_REFRESH },
  48. { SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, "ce", "", SKIN_RTC_REFRESH },
  49. { SKIN_TOKEN_RTC_12HOUR_CFG, "cf", "", SKIN_RTC_REFRESH },
  50. @@ -201,7 +201,7 @@ static const struct tag_info legal_tags[] =
  51. { SKIN_TOKEN_CURRENT_SCREEN, "cs", "", SKIN_REFRESH_DYNAMIC },
  52. { SKIN_TOKEN_TOUCHREGION, "T" , "IIIIS|S", 0|NOBREAK },
  53.  
  54. - { SKIN_TOKEN_HAVE_RECORDING, "Rp" , "", SKIN_REFRESH_STATIC },
  55. + { SKIN_TOKEN_HAVE_RECORDING, "Rp" , "", SKIN_REFRESH_STATIC|FEATURE_TAG },
  56. { SKIN_TOKEN_IS_RECORDING, "Rr" , "", SKIN_REFRESH_DYNAMIC },
  57. { SKIN_TOKEN_REC_FREQ, "Rf" , "", SKIN_REFRESH_DYNAMIC },
  58. { SKIN_TOKEN_REC_ENCODER, "Re" , "", SKIN_REFRESH_DYNAMIC },
  59. diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h
  60. index f16709d..5f73804 100644
  61. --- a/lib/skin_parser/tag_table.h
  62. +++ b/lib/skin_parser/tag_table.h
  63. @@ -32,7 +32,7 @@ extern "C"
  64.  
  65. /* Flag to tell the renderer not to insert a line break */
  66. #define NOBREAK 0x1
  67. -
  68. +#define FEATURE_TAG 0x2
  69. /* constants used in line_type and as refresh_mode for wps_refresh */
  70. #define SKIN_REFRESH_SHIFT 16
  71. #define SKIN_REFRESH_STATIC (1u<<SKIN_REFRESH_SHIFT) /* line doesn't change over time */
RAW Paste Data