Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2010 Robert Bieber |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
| 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #include "tag_table.h" |
| 23 | |
| 24 | #include <string.h> |
Jonathan Gordon | 9acd702 | 2012-02-14 19:53:29 +1100 | [diff] [blame] | 25 | #define BAR_PARAMS "?iiii|s*" |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 26 | /* The tag definition table */ |
Nils Wallménius | c2529c3 | 2010-07-31 11:28:37 +0000 | [diff] [blame] | 27 | static const struct tag_info legal_tags[] = |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 28 | { |
Robert Bieber | 32ff4e9 | 2010-07-04 01:39:57 +0000 | [diff] [blame] | 29 | { SKIN_TOKEN_ALIGN_CENTER, "ac", "", 0 }, |
| 30 | { SKIN_TOKEN_ALIGN_LEFT, "al", "", 0 }, |
| 31 | { SKIN_TOKEN_ALIGN_LEFT_RTL, "aL", "", 0 }, |
| 32 | { SKIN_TOKEN_ALIGN_RIGHT, "ar", "", 0 }, |
| 33 | { SKIN_TOKEN_ALIGN_RIGHT_RTL, "aR", "", 0 }, |
| 34 | { SKIN_TOKEN_ALIGN_LANGDIRECTION, "ax", "", 0 }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 35 | |
Jonathan Gordon | 74ec011 | 2010-08-19 13:49:32 +0000 | [diff] [blame] | 36 | { SKIN_TOKEN_LOGICAL_IF, "if", "TS[ITS]|D", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 37 | { SKIN_TOKEN_LOGICAL_AND, "and", "T*", SKIN_REFRESH_DYNAMIC }, |
| 38 | { SKIN_TOKEN_LOGICAL_OR, "or", "T*", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 74ec011 | 2010-08-19 13:49:32 +0000 | [diff] [blame] | 39 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 40 | { SKIN_TOKEN_BATTERY_PERCENT, "bl" , BAR_PARAMS, SKIN_REFRESH_DYNAMIC }, |
| 41 | { SKIN_TOKEN_BATTERY_VOLTS, "bv", "", SKIN_REFRESH_DYNAMIC }, |
| 42 | { SKIN_TOKEN_BATTERY_TIME, "bt", "", SKIN_REFRESH_DYNAMIC }, |
| 43 | { SKIN_TOKEN_BATTERY_SLEEPTIME, "bs", "", SKIN_REFRESH_DYNAMIC }, |
| 44 | { SKIN_TOKEN_BATTERY_CHARGING, "bc", "", SKIN_REFRESH_DYNAMIC }, |
| 45 | { SKIN_TOKEN_BATTERY_CHARGER_CONNECTED, "bp", "", SKIN_REFRESH_DYNAMIC }, |
| 46 | { SKIN_TOKEN_USB_POWERED, "bu", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 47 | |
| 48 | |
Jonathan Gordon | 943de3c | 2010-10-28 11:00:36 +0000 | [diff] [blame] | 49 | { SKIN_TOKEN_RTC_PRESENT, "cc", "", FEATURE_TAG }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 50 | { SKIN_TOKEN_RTC_DAY_OF_MONTH, "cd", "", SKIN_RTC_REFRESH }, |
| 51 | { SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, "ce", "", SKIN_RTC_REFRESH }, |
| 52 | { SKIN_TOKEN_RTC_12HOUR_CFG, "cf", "", SKIN_RTC_REFRESH }, |
| 53 | { SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", "", SKIN_RTC_REFRESH }, |
| 54 | { SKIN_TOKEN_RTC_HOUR_24, "ck", "", SKIN_RTC_REFRESH }, |
| 55 | { SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", "", SKIN_RTC_REFRESH }, |
| 56 | { SKIN_TOKEN_RTC_HOUR_12, "cl", "", SKIN_RTC_REFRESH }, |
| 57 | { SKIN_TOKEN_RTC_MONTH, "cm", "", SKIN_RTC_REFRESH }, |
| 58 | { SKIN_TOKEN_RTC_MINUTE, "cM", "", SKIN_RTC_REFRESH }, |
| 59 | { SKIN_TOKEN_RTC_SECOND, "cS", "", SKIN_RTC_REFRESH }, |
| 60 | { SKIN_TOKEN_RTC_YEAR_2_DIGITS, "cy", "", SKIN_RTC_REFRESH }, |
| 61 | { SKIN_TOKEN_RTC_YEAR_4_DIGITS, "cY", "", SKIN_RTC_REFRESH }, |
| 62 | { SKIN_TOKEN_RTC_AM_PM_UPPER, "cP", "", SKIN_RTC_REFRESH }, |
| 63 | { SKIN_TOKEN_RTC_AM_PM_LOWER, "cp", "", SKIN_RTC_REFRESH }, |
| 64 | { SKIN_TOKEN_RTC_WEEKDAY_NAME, "ca", "", SKIN_RTC_REFRESH }, |
| 65 | { SKIN_TOKEN_RTC_MONTH_NAME, "cb", "", SKIN_RTC_REFRESH }, |
| 66 | { SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON, "cu", "", SKIN_RTC_REFRESH }, |
| 67 | { SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN, "cw", "", SKIN_RTC_REFRESH }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 68 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 69 | { SKIN_TOKEN_FILE_BITRATE, "fb", "", SKIN_REFRESH_STATIC }, |
| 70 | { SKIN_TOKEN_FILE_CODEC, "fc", "", SKIN_REFRESH_STATIC }, |
| 71 | { SKIN_TOKEN_FILE_FREQUENCY, "ff", "", SKIN_REFRESH_STATIC }, |
| 72 | { SKIN_TOKEN_FILE_FREQUENCY_KHZ, "fk", "", SKIN_REFRESH_STATIC }, |
| 73 | { SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, "fm", "", SKIN_REFRESH_STATIC }, |
| 74 | { SKIN_TOKEN_FILE_NAME, "fn", "", SKIN_REFRESH_STATIC }, |
| 75 | { SKIN_TOKEN_FILE_PATH, "fp", "", SKIN_REFRESH_STATIC }, |
| 76 | { SKIN_TOKEN_FILE_SIZE, "fs", "", SKIN_REFRESH_STATIC }, |
| 77 | { SKIN_TOKEN_FILE_VBR, "fv", "", SKIN_REFRESH_STATIC }, |
| 78 | { SKIN_TOKEN_FILE_DIRECTORY, "d" , "I", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 79 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 80 | { SKIN_TOKEN_FILE_BITRATE, "Fb", "", SKIN_REFRESH_STATIC }, |
| 81 | { SKIN_TOKEN_FILE_CODEC, "Fc", "", SKIN_REFRESH_STATIC }, |
| 82 | { SKIN_TOKEN_FILE_FREQUENCY, "Ff", "", SKIN_REFRESH_STATIC }, |
| 83 | { SKIN_TOKEN_FILE_FREQUENCY_KHZ, "Fk", "", SKIN_REFRESH_STATIC }, |
| 84 | { SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, "Fm", "", SKIN_REFRESH_STATIC }, |
| 85 | { SKIN_TOKEN_FILE_NAME, "Fn", "", SKIN_REFRESH_STATIC }, |
| 86 | { SKIN_TOKEN_FILE_PATH, "Fp", "", SKIN_REFRESH_STATIC }, |
| 87 | { SKIN_TOKEN_FILE_SIZE, "Fs", "", SKIN_REFRESH_STATIC }, |
| 88 | { SKIN_TOKEN_FILE_VBR, "Fv", "", SKIN_REFRESH_STATIC }, |
| 89 | { SKIN_TOKEN_FILE_DIRECTORY, "D" , "I", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 90 | |
| 91 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 92 | { SKIN_TOKEN_METADATA_ARTIST, "ia", "", SKIN_REFRESH_STATIC }, |
| 93 | { SKIN_TOKEN_METADATA_COMPOSER, "ic", "", SKIN_REFRESH_STATIC }, |
| 94 | { SKIN_TOKEN_METADATA_ALBUM, "id", "", SKIN_REFRESH_STATIC }, |
| 95 | { SKIN_TOKEN_METADATA_ALBUM_ARTIST, "iA", "", SKIN_REFRESH_STATIC }, |
| 96 | { SKIN_TOKEN_METADATA_GROUPING, "iG", "", SKIN_REFRESH_STATIC }, |
| 97 | { SKIN_TOKEN_METADATA_GENRE, "ig", "", SKIN_REFRESH_STATIC }, |
| 98 | { SKIN_TOKEN_METADATA_DISC_NUMBER, "ik", "", SKIN_REFRESH_STATIC }, |
| 99 | { SKIN_TOKEN_METADATA_TRACK_NUMBER, "in", "", SKIN_REFRESH_STATIC }, |
| 100 | { SKIN_TOKEN_METADATA_TRACK_TITLE, "it", "", SKIN_REFRESH_STATIC }, |
| 101 | { SKIN_TOKEN_METADATA_VERSION, "iv", "", SKIN_REFRESH_STATIC }, |
| 102 | { SKIN_TOKEN_METADATA_YEAR, "iy", "", SKIN_REFRESH_STATIC }, |
| 103 | { SKIN_TOKEN_METADATA_COMMENT, "iC", "", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 104 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 105 | { SKIN_TOKEN_METADATA_ARTIST, "Ia", "", SKIN_REFRESH_STATIC }, |
| 106 | { SKIN_TOKEN_METADATA_COMPOSER, "Ic", "", SKIN_REFRESH_STATIC }, |
| 107 | { SKIN_TOKEN_METADATA_ALBUM, "Id", "", SKIN_REFRESH_STATIC }, |
| 108 | { SKIN_TOKEN_METADATA_ALBUM_ARTIST, "IA", "", SKIN_REFRESH_STATIC }, |
| 109 | { SKIN_TOKEN_METADATA_GROUPING, "IG", "", SKIN_REFRESH_STATIC }, |
| 110 | { SKIN_TOKEN_METADATA_GENRE, "Ig", "", SKIN_REFRESH_STATIC }, |
| 111 | { SKIN_TOKEN_METADATA_DISC_NUMBER, "Ik", "", SKIN_REFRESH_STATIC }, |
| 112 | { SKIN_TOKEN_METADATA_TRACK_NUMBER, "In", "", SKIN_REFRESH_STATIC }, |
| 113 | { SKIN_TOKEN_METADATA_TRACK_TITLE, "It", "", SKIN_REFRESH_STATIC }, |
| 114 | { SKIN_TOKEN_METADATA_VERSION, "Iv", "", SKIN_REFRESH_STATIC }, |
| 115 | { SKIN_TOKEN_METADATA_YEAR, "Iy", "", SKIN_REFRESH_STATIC }, |
| 116 | { SKIN_TOKEN_METADATA_COMMENT, "IC", "", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 117 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 118 | { SKIN_TOKEN_SOUND_PITCH, "Sp", "", SKIN_REFRESH_DYNAMIC }, |
| 119 | { SKIN_TOKEN_SOUND_SPEED, "Ss", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 120 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 121 | { SKIN_TOKEN_VLED_HDD, "lh", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 122 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 123 | { SKIN_TOKEN_MAIN_HOLD, "mh", "", SKIN_REFRESH_DYNAMIC }, |
| 124 | { SKIN_TOKEN_REMOTE_HOLD, "mr", "", SKIN_REFRESH_DYNAMIC }, |
| 125 | { SKIN_TOKEN_REPEAT_MODE, "mm", "", SKIN_REFRESH_DYNAMIC }, |
| 126 | { SKIN_TOKEN_PLAYBACK_STATUS, "mp", "", SKIN_REFRESH_DYNAMIC }, |
| 127 | { SKIN_TOKEN_BUTTON_VOLUME, "mv", "|D", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 128 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 129 | { SKIN_TOKEN_PEAKMETER, "pm", "", SKIN_REFRESH_PEAK_METER }, |
Jonathan Gordon | 261c56b | 2011-01-13 06:48:39 +0000 | [diff] [blame] | 130 | { SKIN_TOKEN_PEAKMETER_LEFT, "pL", BAR_PARAMS, SKIN_REFRESH_PEAK_METER }, |
| 131 | { SKIN_TOKEN_PEAKMETER_RIGHT, "pR", BAR_PARAMS, SKIN_REFRESH_PEAK_METER }, |
| 132 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 133 | { SKIN_TOKEN_PLAYER_PROGRESSBAR, "pf", "", SKIN_REFRESH_DYNAMIC|SKIN_REFRESH_PLAYER_PROGRESS }, |
| 134 | { SKIN_TOKEN_PROGRESSBAR, "pb" , BAR_PARAMS, SKIN_REFRESH_PLAYER_PROGRESS }, |
| 135 | { SKIN_TOKEN_VOLUME, "pv" , BAR_PARAMS, SKIN_REFRESH_DYNAMIC }, |
| 136 | { SKIN_TOKEN_TRACK_ELAPSED_PERCENT, "px", "", SKIN_REFRESH_DYNAMIC }, |
| 137 | { SKIN_TOKEN_TRACK_TIME_ELAPSED, "pc", "", SKIN_REFRESH_DYNAMIC }, |
| 138 | { SKIN_TOKEN_TRACK_TIME_REMAINING, "pr", "", SKIN_REFRESH_DYNAMIC }, |
| 139 | { SKIN_TOKEN_TRACK_LENGTH, "pt", "", SKIN_REFRESH_STATIC }, |
| 140 | { SKIN_TOKEN_TRACK_STARTING, "pS" , "|D", SKIN_REFRESH_DYNAMIC }, |
| 141 | { SKIN_TOKEN_TRACK_ENDING, "pE" , "|D", SKIN_REFRESH_DYNAMIC }, |
| 142 | { SKIN_TOKEN_PLAYLIST_POSITION, "pp", "", SKIN_REFRESH_STATIC }, |
| 143 | { SKIN_TOKEN_PLAYLIST_ENTRIES, "pe", "", SKIN_REFRESH_STATIC }, |
| 144 | { SKIN_TOKEN_PLAYLIST_NAME, "pn", "", SKIN_REFRESH_STATIC }, |
| 145 | { SKIN_TOKEN_PLAYLIST_SHUFFLE, "ps", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 146 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 147 | { SKIN_TOKEN_DATABASE_PLAYCOUNT, "rp", "", SKIN_REFRESH_DYNAMIC }, |
| 148 | { SKIN_TOKEN_DATABASE_RATING, "rr", "", SKIN_REFRESH_DYNAMIC }, |
| 149 | { SKIN_TOKEN_DATABASE_AUTOSCORE, "ra", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 150 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 151 | { SKIN_TOKEN_REPLAYGAIN, "rg", "", SKIN_REFRESH_STATIC }, |
| 152 | { SKIN_TOKEN_CROSSFADE, "xf", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 153 | |
Jonathan Gordon | 943de3c | 2010-10-28 11:00:36 +0000 | [diff] [blame] | 154 | { SKIN_TOKEN_HAVE_TUNER, "tp", "", FEATURE_TAG }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 155 | { SKIN_TOKEN_TUNER_TUNED, "tt", "", SKIN_REFRESH_DYNAMIC }, |
| 156 | { SKIN_TOKEN_TUNER_SCANMODE, "tm", "", SKIN_REFRESH_DYNAMIC }, |
| 157 | { SKIN_TOKEN_TUNER_STEREO, "ts", "", SKIN_REFRESH_DYNAMIC }, |
| 158 | { SKIN_TOKEN_TUNER_MINFREQ, "ta", "", SKIN_REFRESH_STATIC }, |
| 159 | { SKIN_TOKEN_TUNER_MAXFREQ, "tb", "", SKIN_REFRESH_STATIC }, |
| 160 | { SKIN_TOKEN_TUNER_CURFREQ, "tf", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 1ce7ba4 | 2010-11-18 11:47:42 +0000 | [diff] [blame] | 161 | { SKIN_TOKEN_TUNER_RSSI, "tr", BAR_PARAMS, SKIN_REFRESH_DYNAMIC }, |
Bertrik Sikken | de870b3 | 2010-11-11 21:13:29 +0000 | [diff] [blame] | 162 | { SKIN_TOKEN_TUNER_RSSI_MIN, "tl", "", SKIN_REFRESH_STATIC }, |
| 163 | { SKIN_TOKEN_TUNER_RSSI_MAX, "th", "", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 164 | { SKIN_TOKEN_PRESET_ID, "Ti", "", SKIN_REFRESH_STATIC }, |
| 165 | { SKIN_TOKEN_PRESET_NAME, "Tn", "", SKIN_REFRESH_STATIC }, |
| 166 | { SKIN_TOKEN_PRESET_FREQ, "Tf", "", SKIN_REFRESH_STATIC }, |
| 167 | { SKIN_TOKEN_PRESET_COUNT, "Tc", "", SKIN_REFRESH_STATIC }, |
| 168 | { SKIN_TOKEN_HAVE_RDS, "tx", "", SKIN_REFRESH_STATIC }, |
| 169 | { SKIN_TOKEN_RDS_NAME, "ty", "", SKIN_REFRESH_DYNAMIC }, |
| 170 | { SKIN_TOKEN_RDS_TEXT, "tz", "", SKIN_REFRESH_DYNAMIC }, |
| 171 | |
| 172 | { SKIN_TOKEN_SUBLINE_SCROLL, "s", "", SKIN_REFRESH_SCROLL }, |
Robert Bieber | 15488a0 | 2010-07-15 06:24:11 +0000 | [diff] [blame] | 173 | { SKIN_TOKEN_SUBLINE_TIMEOUT, "t" , "D", 0 }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 174 | |
| 175 | { SKIN_TOKEN_ENABLE_THEME, "we", "", 0|NOBREAK }, |
| 176 | { SKIN_TOKEN_DISABLE_THEME, "wd", "", 0|NOBREAK }, |
| 177 | { SKIN_TOKEN_DRAW_INBUILTBAR, "wi", "", SKIN_REFRESH_STATIC|NOBREAK }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 178 | |
Jonathan Gordon | 1c1e1c0 | 2012-02-29 00:07:16 +1100 | [diff] [blame] | 179 | { SKIN_TOKEN_IMAGE_PRELOAD, "xl", "SF|III", 0|NOBREAK }, |
Jonathan Gordon | 863d239 | 2010-08-14 11:17:49 +0000 | [diff] [blame] | 180 | { SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, "xd", "S|[IT]I", 0 }, |
Jonathan Gordon | 1c1e1c0 | 2012-02-29 00:07:16 +1100 | [diff] [blame] | 181 | { SKIN_TOKEN_IMAGE_DISPLAY, "x", "SF|II", SKIN_REFRESH_STATIC|NOBREAK }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 182 | |
Jonathan Gordon | a264733 | 2010-09-06 12:27:27 +0000 | [diff] [blame] | 183 | { SKIN_TOKEN_LOAD_FONT, "Fl" , "IF|I", 0|NOBREAK }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 184 | { SKIN_TOKEN_ALBUMART_LOAD, "Cl" , "IIII|ss", 0|NOBREAK }, |
| 185 | { SKIN_TOKEN_ALBUMART_DISPLAY, "Cd" , "", SKIN_REFRESH_STATIC }, |
| 186 | { SKIN_TOKEN_ALBUMART_FOUND, "C" , "", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 187 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 188 | { SKIN_TOKEN_VIEWPORT_ENABLE, "Vd" , "S", SKIN_REFRESH_STATIC }, |
| 189 | { SKIN_TOKEN_UIVIEWPORT_ENABLE, "VI" , "S", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 190 | |
Jonathan Gordon | dc3778a | 2010-08-14 15:17:59 +0000 | [diff] [blame] | 191 | { SKIN_TOKEN_VIEWPORT_CUSTOMLIST, "Vp" , "IC", SKIN_REFRESH_DYNAMIC|NOBREAK }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 192 | { SKIN_TOKEN_LIST_TITLE_TEXT, "Lt" , "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 3d0317a | 2011-09-11 10:44:17 +0000 | [diff] [blame] | 193 | { SKIN_TOKEN_LIST_ITEM_TEXT, "LT", "|IS", SKIN_REFRESH_DYNAMIC }, |
Frank Gevaerts | b5cd5ce | 2012-02-25 02:34:23 +0100 | [diff] [blame] | 194 | { SKIN_TOKEN_LIST_ITEM_ROW, "LR", "", SKIN_REFRESH_DYNAMIC }, |
| 195 | { SKIN_TOKEN_LIST_ITEM_COLUMN, "LC", "", SKIN_REFRESH_DYNAMIC }, |
Frank Gevaerts | 28d5f2a | 2011-09-18 12:35:32 +0000 | [diff] [blame] | 196 | { SKIN_TOKEN_LIST_ITEM_NUMBER, "LN", "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 197 | { SKIN_TOKEN_LIST_TITLE_ICON, "Li" , "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 3d0317a | 2011-09-11 10:44:17 +0000 | [diff] [blame] | 198 | { SKIN_TOKEN_LIST_ITEM_ICON, "LI", "|IS", SKIN_REFRESH_DYNAMIC }, |
Frank Gevaerts | b9bf6cd | 2012-02-21 14:59:52 +0100 | [diff] [blame] | 199 | { SKIN_TOKEN_LIST_ITEM_CFG, "Lb" , "Sii|S", SKIN_REFRESH_DYNAMIC}, |
Jonathan Gordon | 9b6ac01 | 2011-09-06 13:49:41 +0000 | [diff] [blame] | 200 | { SKIN_TOKEN_LIST_ITEM_IS_SELECTED, "Lc" , "", SKIN_REFRESH_DYNAMIC }, |
| 201 | { SKIN_TOKEN_LIST_NEEDS_SCROLLBAR, "LB", BAR_PARAMS, SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 202 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 203 | { SKIN_TOKEN_VIEWPORT_FGCOLOUR, "Vf" , "s", SKIN_REFRESH_STATIC|NOBREAK }, |
| 204 | { SKIN_TOKEN_VIEWPORT_BGCOLOUR, "Vb" , "s", SKIN_REFRESH_STATIC|NOBREAK }, |
Jonathan Gordon | 281f1a1 | 2011-08-14 13:50:07 +0000 | [diff] [blame] | 205 | { SKIN_TOKEN_VIEWPORT_TEXTSTYLE, "Vs" , "S|s", SKIN_REFRESH_STATIC }, |
| 206 | { SKIN_TOKEN_VIEWPORT_GRADIENT_SETUP, "Vg" , "SS|s", SKIN_REFRESH_STATIC|NOBREAK }, |
Jonathan Gordon | 2c71aa9 | 2012-02-28 22:26:32 +1100 | [diff] [blame] | 207 | { SKIN_TOKEN_VIEWPORT_DRAWONBG, "VB" , "", SKIN_REFRESH_STATIC|NOBREAK }, |
Jonathan Gordon | 9f2bd98 | 2010-06-07 10:45:15 +0000 | [diff] [blame] | 208 | |
Robert Bieber | 32ff4e9 | 2010-07-04 01:39:57 +0000 | [diff] [blame] | 209 | { SKIN_TOKEN_VIEWPORT_CONDITIONAL, "Vl" , "SIIiii", 0 }, |
| 210 | { SKIN_TOKEN_UIVIEWPORT_LOAD, "Vi" , "sIIiii", 0 }, |
| 211 | { SKIN_TOKEN_VIEWPORT_LOAD, "V" , "IIiii", 0 }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 212 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 213 | { SKIN_TOKEN_IMAGE_BACKDROP, "X" , "f", SKIN_REFRESH_STATIC|NOBREAK }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 214 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 215 | { SKIN_TOKEN_SETTING, "St" , "S", SKIN_REFRESH_DYNAMIC }, |
| 216 | { SKIN_TOKEN_TRANSLATEDSTRING, "Sx" , "S", SKIN_REFRESH_STATIC }, |
| 217 | { SKIN_TOKEN_LANG_IS_RTL, "Sr" , "", SKIN_REFRESH_STATIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 218 | |
Jonathan Gordon | 156b0bc | 2011-02-28 11:19:59 +0000 | [diff] [blame] | 219 | /* HACK Alert (jdgordon): The next two tags have hacks so we could |
| 220 | * add a S param at the front without breaking old skins. |
| 221 | * [SD]D <- handled by the callback, allows SD or S or D params |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 222 | * [SI]III[SI]|SN <- SIIIIS|S or IIIIS|S |
Jonathan Gordon | 156b0bc | 2011-02-28 11:19:59 +0000 | [diff] [blame] | 223 | * keep in sync with parse_touchregion() and parse_lasttouch() */ |
| 224 | { SKIN_TOKEN_LASTTOUCH, "Tl" , "|[SD]D", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 225 | { SKIN_TOKEN_TOUCHREGION, "T" , "[SI]III[SI]|S*", 0|NOBREAK }, |
Jonathan Gordon | 156b0bc | 2011-02-28 11:19:59 +0000 | [diff] [blame] | 226 | |
Jonathan Gordon | 943de3c | 2010-10-28 11:00:36 +0000 | [diff] [blame] | 227 | { SKIN_TOKEN_HAVE_TOUCH, "Tp", "", FEATURE_TAG }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 228 | |
Jonathan Gordon | 156b0bc | 2011-02-28 11:19:59 +0000 | [diff] [blame] | 229 | { SKIN_TOKEN_CURRENT_SCREEN, "cs", "", SKIN_REFRESH_DYNAMIC }, |
| 230 | |
Jonathan Gordon | 943de3c | 2010-10-28 11:00:36 +0000 | [diff] [blame] | 231 | { SKIN_TOKEN_HAVE_RECORDING, "Rp" , "", FEATURE_TAG }, |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 232 | { SKIN_TOKEN_IS_RECORDING, "Rr" , "", SKIN_REFRESH_DYNAMIC }, |
| 233 | { SKIN_TOKEN_REC_FREQ, "Rf" , "", SKIN_REFRESH_DYNAMIC }, |
| 234 | { SKIN_TOKEN_REC_ENCODER, "Re" , "", SKIN_REFRESH_DYNAMIC }, |
| 235 | { SKIN_TOKEN_REC_BITRATE, "Rb" , "", SKIN_REFRESH_DYNAMIC }, |
| 236 | { SKIN_TOKEN_REC_MONO, "Rm" , "", SKIN_REFRESH_DYNAMIC }, |
| 237 | { SKIN_TOKEN_REC_SECONDS, "Rs" , "", SKIN_REFRESH_DYNAMIC }, |
| 238 | { SKIN_TOKEN_REC_MINUTES, "Rn" , "", SKIN_REFRESH_DYNAMIC }, |
| 239 | { SKIN_TOKEN_REC_HOURS, "Rh" , "", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | eeef8f6 | 2010-05-26 03:53:06 +0000 | [diff] [blame] | 240 | |
Jonathan Gordon | 87aa86c | 2011-03-27 08:01:58 +0000 | [diff] [blame] | 241 | /* Skin variables */ |
Jonathan Gordon | 9c21258 | 2012-02-21 00:34:58 +1100 | [diff] [blame] | 242 | { SKIN_TOKEN_VAR_SET, "vs", "SSi|I", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 87aa86c | 2011-03-27 08:01:58 +0000 | [diff] [blame] | 243 | { SKIN_TOKEN_VAR_GETVAL, "vg", "S", SKIN_REFRESH_DYNAMIC }, |
| 244 | { SKIN_TOKEN_VAR_TIMEOUT, "vl", "S|D", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 3b9ffd2 | 2011-09-11 01:50:06 +0000 | [diff] [blame] | 245 | |
Jonathan Gordon | 31a0595 | 2012-02-26 00:42:53 +1100 | [diff] [blame] | 246 | { SKIN_TOKEN_SUBSTRING, "ss", "IiT|s", SKIN_REFRESH_DYNAMIC }, |
Jonathan Gordon | 014a08c | 2012-03-15 22:50:17 +1100 | [diff] [blame] | 247 | { SKIN_TOKEN_DRAWRECTANGLE, "dr", "IIii|ss", SKIN_REFRESH_STATIC }, |
Robert Bieber | 32ff4e9 | 2010-07-04 01:39:57 +0000 | [diff] [blame] | 248 | { SKIN_TOKEN_UNKNOWN, "" , "", 0 } |
Robert Bieber | 0a054b2 | 2010-06-01 16:44:52 +0000 | [diff] [blame] | 249 | /* Keep this here to mark the end of the table */ |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 250 | }; |
| 251 | |
| 252 | /* A table of legal escapable characters */ |
Nils Wallménius | c2529c3 | 2010-07-31 11:28:37 +0000 | [diff] [blame] | 253 | static const char legal_escape_characters[] = "%(,);#<|>"; |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 254 | |
| 255 | /* |
| 256 | * Just does a straight search through the tag table to find one by |
| 257 | * the given name |
| 258 | */ |
Nils Wallménius | c2529c3 | 2010-07-31 11:28:37 +0000 | [diff] [blame] | 259 | const struct tag_info* find_tag(const char* name) |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 260 | { |
| 261 | |
Nils Wallménius | c2529c3 | 2010-07-31 11:28:37 +0000 | [diff] [blame] | 262 | const struct tag_info* current = legal_tags; |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 263 | |
| 264 | /* |
| 265 | * Continue searching so long as we have a non-empty name string |
| 266 | * and the name of the current element doesn't match the name |
| 267 | * we're searching for |
| 268 | */ |
| 269 | |
| 270 | while(strcmp(current->name, name) && current->name[0] != '\0') |
| 271 | current++; |
| 272 | |
| 273 | if(current->name[0] == '\0') |
| 274 | return NULL; |
| 275 | else |
Robert Bieber | 0a054b2 | 2010-06-01 16:44:52 +0000 | [diff] [blame] | 276 | return current; |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 277 | |
| 278 | } |
| 279 | |
| 280 | /* Searches through the legal escape characters string */ |
| 281 | int find_escape_character(char lookup) |
| 282 | { |
Nils Wallménius | c2529c3 | 2010-07-31 11:28:37 +0000 | [diff] [blame] | 283 | const char* current = legal_escape_characters; |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 284 | while(*current != lookup && *current != '\0') |
| 285 | current++; |
| 286 | |
Robert Bieber | 999990c | 2010-06-02 05:45:34 +0000 | [diff] [blame] | 287 | if(*current == lookup && *current) |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 288 | return 1; |
| 289 | else |
| 290 | return 0; |
| 291 | } |