Theme Editor: Implemented a flags column in the tag table, removed the \n flag at the end of the param list and replaced it with a NOBREAK flag to prevent the renderer from inserting a line break at the end of the line. Modified the theme editor's renderer to accomodate this flag

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27268 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-07-04 01:39:57 +00:00
parent d4e7ab7a93
commit 32ff4e93bd
5 changed files with 171 additions and 189 deletions

View file

@ -459,21 +459,9 @@ static int skin_parse_tag(struct skin_element* element, char** document)
return 1;
}
/* Eating a newline if necessary */
if(tag_args[0] == '\n')
{
while (*cursor && *cursor != '\n')
cursor++;
if (*cursor)
cursor++;
skin_line++;
*document = cursor;
return 1;
}
/* Checking the number of arguments and allocating args */
if(*cursor != ARGLISTOPENSYM && tag_args[0] != '|'
&& tag_args[0] != '\n')
if(*cursor != ARGLISTOPENSYM && tag_args[0] != '|')
{
skin_error(ARGLIST_EXPECTED);
return 0;
@ -521,7 +509,7 @@ static int skin_parse_tag(struct skin_element* element, char** document)
for(i = 0; i < num_args; i++)
{
/* Making sure we haven't run out of arguments */
if(*tag_args == '\0' || *tag_args == '\n')
if(*tag_args == '\0')
{
skin_error(TOO_MANY_ARGS);
return 0;
@ -620,27 +608,11 @@ static int skin_parse_tag(struct skin_element* element, char** document)
}
/* Checking for a premature end */
if(*tag_args != '\0' && *tag_args != '\n' && !optional)
if(*tag_args != '\0' && !optional)
{
skin_error(INSUFFICIENT_ARGS);
return 0;
}
if(*tag_args == '\n')
{
while (*cursor && *cursor != '\n')
cursor++;
if (*cursor)
cursor++;
skin_line++;
}
if((strcmp(tag->name, "Vf") == 0 || strcmp(tag->name, "Vb") == 0)
&& *cursor == '\n' && skin_line == viewport_line)
{
cursor++;
skin_line++;
}
*document = cursor;

View file

@ -26,191 +26,191 @@
/* The tag definition table */
struct tag_info legal_tags[] =
{
{ SKIN_TOKEN_ALIGN_CENTER, "ac", "" },
{ SKIN_TOKEN_ALIGN_LEFT, "al", "" },
{ SKIN_TOKEN_ALIGN_LEFT_RTL, "aL", "" },
{ SKIN_TOKEN_ALIGN_RIGHT, "ar", "" },
{ SKIN_TOKEN_ALIGN_RIGHT_RTL, "aR", "" },
{ SKIN_TOKEN_ALIGN_LANGDIRECTION, "ax", "" },
{ SKIN_TOKEN_ALIGN_CENTER, "ac", "", 0 },
{ SKIN_TOKEN_ALIGN_LEFT, "al", "", 0 },
{ SKIN_TOKEN_ALIGN_LEFT_RTL, "aL", "", 0 },
{ SKIN_TOKEN_ALIGN_RIGHT, "ar", "", 0 },
{ SKIN_TOKEN_ALIGN_RIGHT_RTL, "aR", "", 0 },
{ SKIN_TOKEN_ALIGN_LANGDIRECTION, "ax", "", 0 },
{ SKIN_TOKEN_BATTERY_PERCENT, "bl" , BAR_PARAMS },
{ SKIN_TOKEN_BATTERY_VOLTS, "bv", "" },
{ SKIN_TOKEN_BATTERY_TIME, "bt", "" },
{ SKIN_TOKEN_BATTERY_SLEEPTIME, "bs", "" },
{ SKIN_TOKEN_BATTERY_CHARGING, "bc", "" },
{ SKIN_TOKEN_BATTERY_CHARGER_CONNECTED, "bp", "" },
{ SKIN_TOKEN_USB_POWERED, "bu", "" },
{ SKIN_TOKEN_BATTERY_PERCENT, "bl" , BAR_PARAMS, 0 },
{ SKIN_TOKEN_BATTERY_VOLTS, "bv", "", 0 },
{ SKIN_TOKEN_BATTERY_TIME, "bt", "", 0 },
{ SKIN_TOKEN_BATTERY_SLEEPTIME, "bs", "", 0 },
{ SKIN_TOKEN_BATTERY_CHARGING, "bc", "", 0 },
{ SKIN_TOKEN_BATTERY_CHARGER_CONNECTED, "bp", "", 0 },
{ SKIN_TOKEN_USB_POWERED, "bu", "", 0 },
{ SKIN_TOKEN_RTC_PRESENT, "cc", "" },
{ SKIN_TOKEN_RTC_DAY_OF_MONTH, "cd", "" },
{ SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, "ce", "" },
{ SKIN_TOKEN_RTC_12HOUR_CFG, "cf", "" },
{ SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", "" },
{ SKIN_TOKEN_RTC_HOUR_24, "ck", "" },
{ SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", "" },
{ SKIN_TOKEN_RTC_HOUR_12, "cl", "" },
{ SKIN_TOKEN_RTC_MONTH, "cm", "" },
{ SKIN_TOKEN_RTC_MINUTE, "cM", "" },
{ SKIN_TOKEN_RTC_SECOND, "cS", "" },
{ SKIN_TOKEN_RTC_YEAR_2_DIGITS, "cy", "" },
{ SKIN_TOKEN_RTC_YEAR_4_DIGITS, "cY", "" },
{ SKIN_TOKEN_RTC_AM_PM_UPPER, "cP", "" },
{ SKIN_TOKEN_RTC_AM_PM_LOWER, "cp", "" },
{ SKIN_TOKEN_RTC_WEEKDAY_NAME, "ca", "" },
{ SKIN_TOKEN_RTC_MONTH_NAME, "cb", "" },
{ SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON, "cu", "" },
{ SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN, "cw", "" },
{ SKIN_TOKEN_RTC_PRESENT, "cc", "", 0 },
{ SKIN_TOKEN_RTC_DAY_OF_MONTH, "cd", "", 0 },
{ SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, "ce", "", 0 },
{ SKIN_TOKEN_RTC_12HOUR_CFG, "cf", "", 0 },
{ SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", "", 0 },
{ SKIN_TOKEN_RTC_HOUR_24, "ck", "", 0 },
{ SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", "", 0 },
{ SKIN_TOKEN_RTC_HOUR_12, "cl", "", 0 },
{ SKIN_TOKEN_RTC_MONTH, "cm", "", 0 },
{ SKIN_TOKEN_RTC_MINUTE, "cM", "", 0 },
{ SKIN_TOKEN_RTC_SECOND, "cS", "", 0 },
{ SKIN_TOKEN_RTC_YEAR_2_DIGITS, "cy", "", 0 },
{ SKIN_TOKEN_RTC_YEAR_4_DIGITS, "cY", "", 0 },
{ SKIN_TOKEN_RTC_AM_PM_UPPER, "cP", "", 0 },
{ SKIN_TOKEN_RTC_AM_PM_LOWER, "cp", "", 0 },
{ SKIN_TOKEN_RTC_WEEKDAY_NAME, "ca", "", 0 },
{ SKIN_TOKEN_RTC_MONTH_NAME, "cb", "", 0 },
{ SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON, "cu", "", 0 },
{ SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN, "cw", "", 0 },
{ SKIN_TOKEN_FILE_BITRATE, "fb", "" },
{ SKIN_TOKEN_FILE_CODEC, "fc", "" },
{ SKIN_TOKEN_FILE_FREQUENCY, "ff", "" },
{ SKIN_TOKEN_FILE_FREQUENCY_KHZ, "fk", "" },
{ SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, "fm", "" },
{ SKIN_TOKEN_FILE_NAME, "fn", "" },
{ SKIN_TOKEN_FILE_PATH, "fp", "" },
{ SKIN_TOKEN_FILE_SIZE, "fs", "" },
{ SKIN_TOKEN_FILE_VBR, "fv", "" },
{ SKIN_TOKEN_FILE_DIRECTORY, "d" , "I" },
{ SKIN_TOKEN_FILE_BITRATE, "fb", "", 0 },
{ SKIN_TOKEN_FILE_CODEC, "fc", "", 0 },
{ SKIN_TOKEN_FILE_FREQUENCY, "ff", "", 0 },
{ SKIN_TOKEN_FILE_FREQUENCY_KHZ, "fk", "", 0 },
{ SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, "fm", "", 0 },
{ SKIN_TOKEN_FILE_NAME, "fn", "", 0 },
{ SKIN_TOKEN_FILE_PATH, "fp", "", 0 },
{ SKIN_TOKEN_FILE_SIZE, "fs", "", 0 },
{ SKIN_TOKEN_FILE_VBR, "fv", "", 0 },
{ SKIN_TOKEN_FILE_DIRECTORY, "d" , "I", 0 },
{ SKIN_TOKEN_FILE_BITRATE, "Fb", "" },
{ SKIN_TOKEN_FILE_CODEC, "Fc", "" },
{ SKIN_TOKEN_FILE_FREQUENCY, "Ff", "" },
{ SKIN_TOKEN_FILE_FREQUENCY_KHZ, "Fk", "" },
{ SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, "Fm", "" },
{ SKIN_TOKEN_FILE_NAME, "Fn", "" },
{ SKIN_TOKEN_FILE_PATH, "Fp", "" },
{ SKIN_TOKEN_FILE_SIZE, "Fs", "" },
{ SKIN_TOKEN_FILE_VBR, "Fv", "" },
{ SKIN_TOKEN_FILE_DIRECTORY, "D" , "I" },
{ SKIN_TOKEN_FILE_BITRATE, "Fb", "", 0 },
{ SKIN_TOKEN_FILE_CODEC, "Fc", "", 0 },
{ SKIN_TOKEN_FILE_FREQUENCY, "Ff", "", 0 },
{ SKIN_TOKEN_FILE_FREQUENCY_KHZ, "Fk", "", 0 },
{ SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, "Fm", "", 0 },
{ SKIN_TOKEN_FILE_NAME, "Fn", "", 0 },
{ SKIN_TOKEN_FILE_PATH, "Fp", "", 0 },
{ SKIN_TOKEN_FILE_SIZE, "Fs", "", 0 },
{ SKIN_TOKEN_FILE_VBR, "Fv", "", 0 },
{ SKIN_TOKEN_FILE_DIRECTORY, "D" , "I", 0 },
{ SKIN_TOKEN_METADATA_ARTIST, "ia", "" },
{ SKIN_TOKEN_METADATA_COMPOSER, "ic", "" },
{ SKIN_TOKEN_METADATA_ALBUM, "id", "" },
{ SKIN_TOKEN_METADATA_ALBUM_ARTIST, "iA", "" },
{ SKIN_TOKEN_METADATA_GROUPING, "iG", "" },
{ SKIN_TOKEN_METADATA_GENRE, "ig", "" },
{ SKIN_TOKEN_METADATA_DISC_NUMBER, "ik", "" },
{ SKIN_TOKEN_METADATA_TRACK_NUMBER, "in", "" },
{ SKIN_TOKEN_METADATA_TRACK_TITLE, "it", "" },
{ SKIN_TOKEN_METADATA_VERSION, "iv", "" },
{ SKIN_TOKEN_METADATA_YEAR, "iy", "" },
{ SKIN_TOKEN_METADATA_COMMENT, "iC", "" },
{ SKIN_TOKEN_METADATA_ARTIST, "ia", "", 0 },
{ SKIN_TOKEN_METADATA_COMPOSER, "ic", "", 0 },
{ SKIN_TOKEN_METADATA_ALBUM, "id", "", 0 },
{ SKIN_TOKEN_METADATA_ALBUM_ARTIST, "iA", "", 0 },
{ SKIN_TOKEN_METADATA_GROUPING, "iG", "", 0 },
{ SKIN_TOKEN_METADATA_GENRE, "ig", "", 0 },
{ SKIN_TOKEN_METADATA_DISC_NUMBER, "ik", "", 0 },
{ SKIN_TOKEN_METADATA_TRACK_NUMBER, "in", "", 0 },
{ SKIN_TOKEN_METADATA_TRACK_TITLE, "it", "", 0 },
{ SKIN_TOKEN_METADATA_VERSION, "iv", "", 0 },
{ SKIN_TOKEN_METADATA_YEAR, "iy", "", 0 },
{ SKIN_TOKEN_METADATA_COMMENT, "iC", "", 0 },
{ SKIN_TOKEN_METADATA_ARTIST, "Ia", "" },
{ SKIN_TOKEN_METADATA_COMPOSER, "Ic", "" },
{ SKIN_TOKEN_METADATA_ALBUM, "Id", "" },
{ SKIN_TOKEN_METADATA_ALBUM_ARTIST, "IA", "" },
{ SKIN_TOKEN_METADATA_GROUPING, "IG", "" },
{ SKIN_TOKEN_METADATA_GENRE, "Ig", "" },
{ SKIN_TOKEN_METADATA_DISC_NUMBER, "Ik", "" },
{ SKIN_TOKEN_METADATA_TRACK_NUMBER, "In", "" },
{ SKIN_TOKEN_METADATA_TRACK_TITLE, "It", "" },
{ SKIN_TOKEN_METADATA_VERSION, "Iv", "" },
{ SKIN_TOKEN_METADATA_YEAR, "Iy", "" },
{ SKIN_TOKEN_METADATA_COMMENT, "IC", "" },
{ SKIN_TOKEN_METADATA_ARTIST, "Ia", "", 0 },
{ SKIN_TOKEN_METADATA_COMPOSER, "Ic", "", 0 },
{ SKIN_TOKEN_METADATA_ALBUM, "Id", "", 0 },
{ SKIN_TOKEN_METADATA_ALBUM_ARTIST, "IA", "", 0 },
{ SKIN_TOKEN_METADATA_GROUPING, "IG", "", 0 },
{ SKIN_TOKEN_METADATA_GENRE, "Ig", "", 0 },
{ SKIN_TOKEN_METADATA_DISC_NUMBER, "Ik", "", 0 },
{ SKIN_TOKEN_METADATA_TRACK_NUMBER, "In", "", 0 },
{ SKIN_TOKEN_METADATA_TRACK_TITLE, "It", "", 0 },
{ SKIN_TOKEN_METADATA_VERSION, "Iv", "", 0 },
{ SKIN_TOKEN_METADATA_YEAR, "Iy", "", 0 },
{ SKIN_TOKEN_METADATA_COMMENT, "IC", "", 0 },
{ SKIN_TOKEN_SOUND_PITCH, "Sp", "" },
{ SKIN_TOKEN_SOUND_SPEED, "Ss", "" },
{ SKIN_TOKEN_SOUND_PITCH, "Sp", "", 0 },
{ SKIN_TOKEN_SOUND_SPEED, "Ss", "", 0 },
{ SKIN_TOKEN_VLED_HDD, "lh", "" },
{ SKIN_TOKEN_VLED_HDD, "lh", "", 0 },
{ SKIN_TOKEN_MAIN_HOLD, "mh", "" },
{ SKIN_TOKEN_REMOTE_HOLD, "mr", "" },
{ SKIN_TOKEN_REPEAT_MODE, "mm", "" },
{ SKIN_TOKEN_PLAYBACK_STATUS, "mp", "" },
{ SKIN_TOKEN_BUTTON_VOLUME, "mv", "|S" },
{ SKIN_TOKEN_MAIN_HOLD, "mh", "", 0 },
{ SKIN_TOKEN_REMOTE_HOLD, "mr", "", 0 },
{ SKIN_TOKEN_REPEAT_MODE, "mm", "", 0 },
{ SKIN_TOKEN_PLAYBACK_STATUS, "mp", "", 0 },
{ SKIN_TOKEN_BUTTON_VOLUME, "mv", "|S", 0 },
{ SKIN_TOKEN_PEAKMETER, "pm", "" },
{ SKIN_TOKEN_PLAYER_PROGRESSBAR, "pf", "" },
{ SKIN_TOKEN_PROGRESSBAR, "pb" , "*|iiiis" },
{ SKIN_TOKEN_VOLUME, "pv" , BAR_PARAMS },
{ SKIN_TOKEN_PEAKMETER, "pm", "", 0 },
{ SKIN_TOKEN_PLAYER_PROGRESSBAR, "pf", "", 0 },
{ SKIN_TOKEN_PROGRESSBAR, "pb" , "*|iiiis", 0 },
{ SKIN_TOKEN_VOLUME, "pv" , BAR_PARAMS, 0 },
{ SKIN_TOKEN_TRACK_ELAPSED_PERCENT, "px", "" },
{ SKIN_TOKEN_TRACK_TIME_ELAPSED, "pc", "" },
{ SKIN_TOKEN_TRACK_TIME_REMAINING, "pr", "" },
{ SKIN_TOKEN_TRACK_LENGTH, "pt", "" },
{ SKIN_TOKEN_TRACK_STARTING, "pS" , "|S"},
{ SKIN_TOKEN_TRACK_ENDING, "pE" , "|S"},
{ SKIN_TOKEN_PLAYLIST_POSITION, "pp", "" },
{ SKIN_TOKEN_PLAYLIST_ENTRIES, "pe", "" },
{ SKIN_TOKEN_PLAYLIST_NAME, "pn", "" },
{ SKIN_TOKEN_PLAYLIST_SHUFFLE, "ps", "" },
{ SKIN_TOKEN_TRACK_ELAPSED_PERCENT, "px", "", 0 },
{ SKIN_TOKEN_TRACK_TIME_ELAPSED, "pc", "", 0 },
{ SKIN_TOKEN_TRACK_TIME_REMAINING, "pr", "", 0 },
{ SKIN_TOKEN_TRACK_LENGTH, "pt", "", 0 },
{ SKIN_TOKEN_TRACK_STARTING, "pS" , "|S", 0 },
{ SKIN_TOKEN_TRACK_ENDING, "pE" , "|S", 0 },
{ SKIN_TOKEN_PLAYLIST_POSITION, "pp", "", 0 },
{ SKIN_TOKEN_PLAYLIST_ENTRIES, "pe", "", 0 },
{ SKIN_TOKEN_PLAYLIST_NAME, "pn", "", 0 },
{ SKIN_TOKEN_PLAYLIST_SHUFFLE, "ps", "", 0 },
{ SKIN_TOKEN_DATABASE_PLAYCOUNT, "rp", "" },
{ SKIN_TOKEN_DATABASE_RATING, "rr", "" },
{ SKIN_TOKEN_DATABASE_AUTOSCORE, "ra", "" },
{ SKIN_TOKEN_DATABASE_PLAYCOUNT, "rp", "", 0 },
{ SKIN_TOKEN_DATABASE_RATING, "rr", "", 0 },
{ SKIN_TOKEN_DATABASE_AUTOSCORE, "ra", "", 0 },
{ SKIN_TOKEN_REPLAYGAIN, "rg", "" },
{ SKIN_TOKEN_CROSSFADE, "xf", "" },
{ SKIN_TOKEN_REPLAYGAIN, "rg", "", 0 },
{ SKIN_TOKEN_CROSSFADE, "xf", "", 0 },
{ SKIN_TOKEN_HAVE_TUNER, "tp", "" },
{ SKIN_TOKEN_TUNER_TUNED, "tt", "" },
{ SKIN_TOKEN_TUNER_SCANMODE, "tm", "" },
{ SKIN_TOKEN_TUNER_STEREO, "ts", "" },
{ SKIN_TOKEN_TUNER_MINFREQ, "ta", "" },
{ SKIN_TOKEN_TUNER_MAXFREQ, "tb", "" },
{ SKIN_TOKEN_TUNER_CURFREQ, "tf", "" },
{ SKIN_TOKEN_PRESET_ID, "Ti", "" },
{ SKIN_TOKEN_PRESET_NAME, "Tn", "" },
{ SKIN_TOKEN_PRESET_FREQ, "Tf", "" },
{ SKIN_TOKEN_PRESET_COUNT, "Tc", "" },
{ SKIN_TOKEN_HAVE_RDS, "tx", "" },
{ SKIN_TOKEN_RDS_NAME, "ty", "" },
{ SKIN_TOKEN_RDS_TEXT, "tz", "" },
{ SKIN_TOKEN_HAVE_TUNER, "tp", "", 0 },
{ SKIN_TOKEN_TUNER_TUNED, "tt", "", 0 },
{ SKIN_TOKEN_TUNER_SCANMODE, "tm", "", 0 },
{ SKIN_TOKEN_TUNER_STEREO, "ts", "", 0 },
{ SKIN_TOKEN_TUNER_MINFREQ, "ta", "", 0 },
{ SKIN_TOKEN_TUNER_MAXFREQ, "tb", "", 0 },
{ SKIN_TOKEN_TUNER_CURFREQ, "tf", "", 0 },
{ SKIN_TOKEN_PRESET_ID, "Ti", "", 0 },
{ SKIN_TOKEN_PRESET_NAME, "Tn", "", 0 },
{ SKIN_TOKEN_PRESET_FREQ, "Tf", "", 0 },
{ SKIN_TOKEN_PRESET_COUNT, "Tc", "", 0 },
{ SKIN_TOKEN_HAVE_RDS, "tx", "", 0 },
{ SKIN_TOKEN_RDS_NAME, "ty", "", 0 },
{ SKIN_TOKEN_RDS_TEXT, "tz", "", 0 },
{ SKIN_TOKEN_SUBLINE_SCROLL, "s", "" },
{ SKIN_TOKEN_SUBLINE_TIMEOUT, "t" , "S" },
{ SKIN_TOKEN_SUBLINE_SCROLL, "s", "", 0 },
{ SKIN_TOKEN_SUBLINE_TIMEOUT, "t" , "S", 0 },
{ SKIN_TOKEN_ENABLE_THEME, "we", "\n" },
{ SKIN_TOKEN_DISABLE_THEME, "wd", "\n" },
{ SKIN_TOKEN_DRAW_INBUILTBAR, "wi", "\n" },
{ SKIN_TOKEN_ENABLE_THEME, "we", "", NOBREAK },
{ SKIN_TOKEN_DISABLE_THEME, "wd", "", NOBREAK },
{ SKIN_TOKEN_DRAW_INBUILTBAR, "wi", "", NOBREAK },
{ SKIN_TOKEN_IMAGE_PRELOAD, "xl", "SFII|I\n" },
{ SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, "xd", "S" },
{ SKIN_TOKEN_IMAGE_PRELOAD, "x", "SFII\n" },
{ SKIN_TOKEN_IMAGE_PRELOAD, "xl", "SFII|I", NOBREAK },
{ SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, "xd", "S", 0 },
{ SKIN_TOKEN_IMAGE_PRELOAD, "x", "SFII", NOBREAK },
{ SKIN_TOKEN_LOAD_FONT, "Fl" , "IF\n"},
{ SKIN_TOKEN_ALBUMART_LOAD, "Cl" , "IIII|ss\n"},
{ SKIN_TOKEN_ALBUMART_DISPLAY, "Cd" , ""},
{ SKIN_TOKEN_ALBUMART_FOUND, "C" , ""},
{ SKIN_TOKEN_LOAD_FONT, "Fl" , "IF", NOBREAK },
{ SKIN_TOKEN_ALBUMART_LOAD, "Cl" , "IIII|ss", NOBREAK },
{ SKIN_TOKEN_ALBUMART_DISPLAY, "Cd" , "", 0 },
{ SKIN_TOKEN_ALBUMART_FOUND, "C" , "", 0 },
{ SKIN_TOKEN_VIEWPORT_ENABLE, "Vd" , "S"},
{ SKIN_TOKEN_UIVIEWPORT_ENABLE, "VI" , "S"},
{ SKIN_TOKEN_VIEWPORT_ENABLE, "Vd" , "S", 0 },
{ SKIN_TOKEN_UIVIEWPORT_ENABLE, "VI" , "S", 0 },
{ SKIN_TOKEN_VIEWPORT_CUSTOMLIST, "Vp" , "ICC\n"},
{ SKIN_TOKEN_LIST_TITLE_TEXT, "Lt" , ""},
{ SKIN_TOKEN_LIST_TITLE_ICON, "Li" , ""},
{ SKIN_TOKEN_VIEWPORT_CUSTOMLIST, "Vp" , "ICC", NOBREAK },
{ SKIN_TOKEN_LIST_TITLE_TEXT, "Lt" , "", 0 },
{ SKIN_TOKEN_LIST_TITLE_ICON, "Li" , "", 0 },
{ SKIN_TOKEN_VIEWPORT_FGCOLOUR, "Vf" , "S"},
{ SKIN_TOKEN_VIEWPORT_BGCOLOUR, "Vb" , "S"},
{ SKIN_TOKEN_VIEWPORT_FGCOLOUR, "Vf" , "S", NOBREAK },
{ SKIN_TOKEN_VIEWPORT_BGCOLOUR, "Vb" , "S", NOBREAK },
{ SKIN_TOKEN_VIEWPORT_CONDITIONAL, "Vl" , "SIIiii"},
{ SKIN_TOKEN_UIVIEWPORT_LOAD, "Vi" , "sIIiii"},
{ SKIN_TOKEN_VIEWPORT_LOAD, "V" , "IIiii"},
{ SKIN_TOKEN_VIEWPORT_CONDITIONAL, "Vl" , "SIIiii", 0 },
{ SKIN_TOKEN_UIVIEWPORT_LOAD, "Vi" , "sIIiii", 0 },
{ SKIN_TOKEN_VIEWPORT_LOAD, "V" , "IIiii", 0 },
{ SKIN_TOKEN_IMAGE_BACKDROP, "X" , "f\n"},
{ SKIN_TOKEN_IMAGE_BACKDROP, "X" , "f", NOBREAK },
{ SKIN_TOKEN_SETTING, "St" , "S"},
{ SKIN_TOKEN_TRANSLATEDSTRING, "Sx" , "S"},
{ SKIN_TOKEN_LANG_IS_RTL, "Sr" , ""},
{ SKIN_TOKEN_SETTING, "St" , "S", 0 },
{ SKIN_TOKEN_TRANSLATEDSTRING, "Sx" , "S", 0 },
{ SKIN_TOKEN_LANG_IS_RTL, "Sr" , "", 0 },
{ SKIN_TOKEN_LASTTOUCH, "Tl" , "|S"},
{ SKIN_TOKEN_CURRENT_SCREEN, "cs", "" },
{ SKIN_TOKEN_TOUCHREGION, "T" , "IIiiS\n"},
{ SKIN_TOKEN_LASTTOUCH, "Tl" , "|S", 0 },
{ SKIN_TOKEN_CURRENT_SCREEN, "cs", "", 0 },
{ SKIN_TOKEN_TOUCHREGION, "T" , "IIiiS", NOBREAK },
{ SKIN_TOKEN_HAVE_RECORDING, "Rp" , ""},
{ SKIN_TOKEN_IS_RECORDING, "Rr" , ""},
{ SKIN_TOKEN_REC_FREQ, "Rf" , ""},
{ SKIN_TOKEN_REC_ENCODER, "Re" , ""},
{ SKIN_TOKEN_REC_BITRATE, "Rb" , ""},
{ SKIN_TOKEN_REC_MONO, "Rm" , ""},
{ SKIN_TOKEN_REC_SECONDS, "Rs" , ""},
{ SKIN_TOKEN_REC_MINUTES, "Rn" , ""},
{ SKIN_TOKEN_REC_HOURS, "Rh" , ""},
{ SKIN_TOKEN_HAVE_RECORDING, "Rp" , "", 0 },
{ SKIN_TOKEN_IS_RECORDING, "Rr" , "", 0 },
{ SKIN_TOKEN_REC_FREQ, "Rf" , "", 0 },
{ SKIN_TOKEN_REC_ENCODER, "Re" , "", 0 },
{ SKIN_TOKEN_REC_BITRATE, "Rb" , "", 0 },
{ SKIN_TOKEN_REC_MONO, "Rm" , "", 0 },
{ SKIN_TOKEN_REC_SECONDS, "Rs" , "", 0 },
{ SKIN_TOKEN_REC_MINUTES, "Rn" , "", 0 },
{ SKIN_TOKEN_REC_HOURS, "Rh" , "", 0 },
{ SKIN_TOKEN_UNKNOWN, "" , ""}
{ SKIN_TOKEN_UNKNOWN, "" , "", 0 }
/* Keep this here to mark the end of the table */
};

View file

@ -27,6 +27,9 @@ extern "C"
{
#endif
/* Flag to tell the renderer not to insert a line break */
#define NOBREAK 0x1
enum skin_token_type {
@ -271,7 +274,7 @@ struct tag_info
enum skin_token_type type;
char* name;
char* params;
int flags;
};
/*

View file

@ -31,6 +31,7 @@
#include <iostream>
int ParseTreeNode::openConditionals = 0;
bool ParseTreeNode::breakFlag = false;
/* Root element constructor */
ParseTreeNode::ParseTreeNode(struct skin_element* data)
@ -520,8 +521,11 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
{
for(int i = 0; i < children.count(); i++)
children[i]->render(info, viewport);
if(!noBreak)
if(!noBreak && !breakFlag)
viewport->newLine();
if(breakFlag)
breakFlag = false;
}
else if(element->type == TEXT)
{
@ -531,6 +535,8 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
{
if(!execTag(info, viewport))
viewport->write(evalTag(info).toString());
if(element->tag->flags & NOBREAK)
breakFlag = true;
}
else if(element->type == CONDITIONAL)
{

View file

@ -79,6 +79,7 @@ private:
QList<ParseTreeNode*> children;
static int openConditionals;
static bool breakFlag;
QGraphicsItem* rendered;
};