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 | #ifndef TAG_TABLE_H |
| 23 | #define TAG_TABLE_H |
| 24 | |
Robert Bieber | 0769fc5 | 2010-05-25 22:24:08 +0000 | [diff] [blame] | 25 | #ifdef __cplusplus |
| 26 | extern "C" |
| 27 | { |
Robert Bieber | 0769fc5 | 2010-05-25 22:24:08 +0000 | [diff] [blame] | 28 | #endif |
| 29 | |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 30 | #define MAX_TAG_LENGTH 4 /* includes the \0 */ |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 31 | #define MAX_TAG_PARAMS 12 |
| 32 | |
Jonathan Gordon | 943de3c | 2010-10-28 11:00:36 +0000 | [diff] [blame] | 33 | #define NOBREAK 0x1 /* Flag to tell the renderer not to insert a line break */ |
| 34 | #define FEATURE_TAG 0x2 /* Parse time conditional for feature checks (e.g HAVE_RTC) */ |
Robert Bieber | 32ff4e9 | 2010-07-04 01:39:57 +0000 | [diff] [blame] | 35 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 36 | /* constants used in line_type and as refresh_mode for wps_refresh */ |
| 37 | #define SKIN_REFRESH_SHIFT 16 |
| 38 | #define SKIN_REFRESH_STATIC (1u<<SKIN_REFRESH_SHIFT) /* line doesn't change over time */ |
| 39 | #define SKIN_REFRESH_DYNAMIC (1u<<(SKIN_REFRESH_SHIFT+1)) /* line may change (e.g. time flag) */ |
| 40 | #define SKIN_REFRESH_SCROLL (1u<<(SKIN_REFRESH_SHIFT+2)) /* line scrolls */ |
| 41 | #define SKIN_REFRESH_PLAYER_PROGRESS (1u<<(SKIN_REFRESH_SHIFT+3)) /* line contains a progress bar */ |
| 42 | #define SKIN_REFRESH_PEAK_METER (1u<<(SKIN_REFRESH_SHIFT+4)) /* line contains a peak meter */ |
| 43 | #define SKIN_REFRESH_STATUSBAR (1u<<(SKIN_REFRESH_SHIFT+5)) /* refresh statusbar */ |
| 44 | #define SKIN_RTC_REFRESH (1u<<(SKIN_REFRESH_SHIFT+6)) /* refresh rtc, convert at parse time */ |
| 45 | #define SKIN_REFRESH_ALL (0xffffu<<SKIN_REFRESH_SHIFT) /* to refresh all line types */ |
| 46 | |
| 47 | /* to refresh only those lines that change over time */ |
| 48 | #define SKIN_REFRESH_NON_STATIC (SKIN_REFRESH_DYNAMIC| \ |
| 49 | SKIN_REFRESH_PLAYER_PROGRESS| \ |
| 50 | SKIN_REFRESH_PEAK_METER) |
Robert Bieber | 0769fc5 | 2010-05-25 22:24:08 +0000 | [diff] [blame] | 51 | |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 52 | enum skin_token_type { |
| 53 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 54 | SKIN_TOKEN_NO_TOKEN, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 55 | SKIN_TOKEN_UNKNOWN, |
| 56 | |
| 57 | /* Markers */ |
| 58 | SKIN_TOKEN_CHARACTER, |
| 59 | SKIN_TOKEN_STRING, |
| 60 | SKIN_TOKEN_TRANSLATEDSTRING, |
| 61 | |
| 62 | /* Alignment */ |
| 63 | SKIN_TOKEN_ALIGN_LEFT, |
| 64 | SKIN_TOKEN_ALIGN_LEFT_RTL, |
| 65 | SKIN_TOKEN_ALIGN_CENTER, |
| 66 | SKIN_TOKEN_ALIGN_RIGHT, |
| 67 | SKIN_TOKEN_ALIGN_RIGHT_RTL, |
| 68 | SKIN_TOKEN_ALIGN_LANGDIRECTION, |
| 69 | |
| 70 | |
| 71 | /* Sublines */ |
| 72 | SKIN_TOKEN_SUBLINE_TIMEOUT, |
| 73 | SKIN_TOKEN_SUBLINE_SCROLL, |
| 74 | |
| 75 | /* Conditional */ |
Jonathan Gordon | 74ec011 | 2010-08-19 13:49:32 +0000 | [diff] [blame] | 76 | SKIN_TOKEN_LOGICAL_IF, |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 77 | SKIN_TOKEN_LOGICAL_AND, |
| 78 | SKIN_TOKEN_LOGICAL_OR, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 79 | SKIN_TOKEN_CONDITIONAL, |
| 80 | SKIN_TOKEN_CONDITIONAL_START, |
| 81 | SKIN_TOKEN_CONDITIONAL_OPTION, |
| 82 | SKIN_TOKEN_CONDITIONAL_END, |
| 83 | |
| 84 | /* Viewport display */ |
| 85 | SKIN_TOKEN_VIEWPORT_LOAD, |
| 86 | SKIN_TOKEN_VIEWPORT_CONDITIONAL, |
| 87 | SKIN_TOKEN_VIEWPORT_ENABLE, |
| 88 | SKIN_TOKEN_VIEWPORT_CUSTOMLIST, |
| 89 | SKIN_TOKEN_UIVIEWPORT_ENABLE, |
| 90 | SKIN_TOKEN_UIVIEWPORT_LOAD, |
Jonathan Gordon | 9f2bd98 | 2010-06-07 10:45:15 +0000 | [diff] [blame] | 91 | SKIN_TOKEN_VIEWPORT_FGCOLOUR, |
| 92 | SKIN_TOKEN_VIEWPORT_BGCOLOUR, |
Jonathan Gordon | 281f1a1 | 2011-08-14 13:50:07 +0000 | [diff] [blame] | 93 | SKIN_TOKEN_VIEWPORT_TEXTSTYLE, |
| 94 | SKIN_TOKEN_VIEWPORT_GRADIENT_SETUP, |
Jonathan Gordon | 2c71aa9 | 2012-02-28 22:26:32 +1100 | [diff] [blame] | 95 | SKIN_TOKEN_VIEWPORT_DRAWONBG, |
| 96 | |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 97 | /* Battery */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 98 | SKIN_TOKEN_BATTERY_PERCENT, |
| 99 | SKIN_TOKEN_BATTERY_PERCENTBAR, |
| 100 | SKIN_TOKEN_BATTERY_VOLTS, |
| 101 | SKIN_TOKEN_BATTERY_TIME, |
| 102 | SKIN_TOKEN_BATTERY_CHARGER_CONNECTED, |
| 103 | SKIN_TOKEN_BATTERY_CHARGING, |
| 104 | SKIN_TOKEN_BATTERY_SLEEPTIME, |
| 105 | SKIN_TOKEN_USB_POWERED, |
| 106 | |
| 107 | /* Sound */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 108 | SKIN_TOKEN_SOUND_PITCH, |
| 109 | SKIN_TOKEN_SOUND_SPEED, |
| 110 | SKIN_TOKEN_REPLAYGAIN, |
| 111 | SKIN_TOKEN_CROSSFADE, |
| 112 | |
| 113 | /* Time */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 114 | SKIN_TOKEN_RTC_PRESENT, |
| 115 | |
| 116 | /* The begin/end values allow us to know if a token is an RTC one. |
| 117 | New RTC tokens should be added between the markers. */ |
| 118 | |
Jonathan Gordon | 2d31d77 | 2010-07-29 12:37:48 +0000 | [diff] [blame] | 119 | SKIN_TOKENS_RTC_BEGIN, /* just the start marker, not an actual token */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 120 | |
| 121 | SKIN_TOKEN_RTC_DAY_OF_MONTH, |
| 122 | SKIN_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, |
| 123 | SKIN_TOKEN_RTC_12HOUR_CFG, |
| 124 | SKIN_TOKEN_RTC_HOUR_24_ZERO_PADDED, |
| 125 | SKIN_TOKEN_RTC_HOUR_24, |
| 126 | SKIN_TOKEN_RTC_HOUR_12_ZERO_PADDED, |
| 127 | SKIN_TOKEN_RTC_HOUR_12, |
| 128 | SKIN_TOKEN_RTC_MONTH, |
| 129 | SKIN_TOKEN_RTC_MINUTE, |
| 130 | SKIN_TOKEN_RTC_SECOND, |
| 131 | SKIN_TOKEN_RTC_YEAR_2_DIGITS, |
| 132 | SKIN_TOKEN_RTC_YEAR_4_DIGITS, |
| 133 | SKIN_TOKEN_RTC_AM_PM_UPPER, |
| 134 | SKIN_TOKEN_RTC_AM_PM_LOWER, |
| 135 | SKIN_TOKEN_RTC_WEEKDAY_NAME, |
| 136 | SKIN_TOKEN_RTC_MONTH_NAME, |
| 137 | SKIN_TOKEN_RTC_DAY_OF_WEEK_START_MON, |
| 138 | SKIN_TOKEN_RTC_DAY_OF_WEEK_START_SUN, |
| 139 | |
| 140 | SKIN_TOKENS_RTC_END, /* just the end marker, not an actual token */ |
| 141 | |
| 142 | /* Database */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 143 | SKIN_TOKEN_DATABASE_PLAYCOUNT, |
| 144 | SKIN_TOKEN_DATABASE_RATING, |
| 145 | SKIN_TOKEN_DATABASE_AUTOSCORE, |
| 146 | |
| 147 | /* File */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 148 | SKIN_TOKEN_FILE_BITRATE, |
| 149 | SKIN_TOKEN_FILE_CODEC, |
| 150 | SKIN_TOKEN_FILE_FREQUENCY, |
| 151 | SKIN_TOKEN_FILE_FREQUENCY_KHZ, |
| 152 | SKIN_TOKEN_FILE_NAME, |
| 153 | SKIN_TOKEN_FILE_NAME_WITH_EXTENSION, |
| 154 | SKIN_TOKEN_FILE_PATH, |
| 155 | SKIN_TOKEN_FILE_SIZE, |
| 156 | SKIN_TOKEN_FILE_VBR, |
| 157 | SKIN_TOKEN_FILE_DIRECTORY, |
| 158 | |
| 159 | /* Image */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 160 | SKIN_TOKEN_IMAGE_BACKDROP, |
| 161 | SKIN_TOKEN_IMAGE_PROGRESS_BAR, |
| 162 | SKIN_TOKEN_IMAGE_PRELOAD, |
| 163 | SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, |
| 164 | SKIN_TOKEN_IMAGE_DISPLAY, |
Jonathan Gordon | 70ebe46 | 2010-08-12 13:27:10 +0000 | [diff] [blame] | 165 | SKIN_TOKEN_IMAGE_DISPLAY_LISTICON, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 166 | |
| 167 | /* Albumart */ |
| 168 | SKIN_TOKEN_ALBUMART_LOAD, |
| 169 | SKIN_TOKEN_ALBUMART_DISPLAY, |
Jonathan Gordon | 20b9020 | 2010-06-09 14:51:52 +0000 | [diff] [blame] | 170 | SKIN_TOKEN_ALBUMART_FOUND, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 171 | |
| 172 | /* Metadata */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 173 | SKIN_TOKEN_METADATA_ARTIST, |
| 174 | SKIN_TOKEN_METADATA_COMPOSER, |
| 175 | SKIN_TOKEN_METADATA_ALBUM_ARTIST, |
| 176 | SKIN_TOKEN_METADATA_GROUPING, |
| 177 | SKIN_TOKEN_METADATA_ALBUM, |
| 178 | SKIN_TOKEN_METADATA_GENRE, |
| 179 | SKIN_TOKEN_METADATA_DISC_NUMBER, |
| 180 | SKIN_TOKEN_METADATA_TRACK_NUMBER, |
| 181 | SKIN_TOKEN_METADATA_TRACK_TITLE, |
| 182 | SKIN_TOKEN_METADATA_VERSION, |
| 183 | SKIN_TOKEN_METADATA_YEAR, |
| 184 | SKIN_TOKEN_METADATA_COMMENT, |
| 185 | |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 186 | /* Mode */ |
| 187 | SKIN_TOKEN_REPEAT_MODE, |
| 188 | SKIN_TOKEN_PLAYBACK_STATUS, |
| 189 | /* Progressbar */ |
| 190 | SKIN_TOKEN_PROGRESSBAR, |
| 191 | SKIN_TOKEN_PLAYER_PROGRESSBAR, |
| 192 | /* Peakmeter */ |
| 193 | SKIN_TOKEN_PEAKMETER, |
Jonathan Gordon | 261c56b | 2011-01-13 06:48:39 +0000 | [diff] [blame] | 194 | SKIN_TOKEN_PEAKMETER_LEFT, |
| 195 | SKIN_TOKEN_PEAKMETER_LEFTBAR, |
| 196 | SKIN_TOKEN_PEAKMETER_RIGHT, |
| 197 | SKIN_TOKEN_PEAKMETER_RIGHTBAR, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 198 | |
| 199 | /* Current track */ |
| 200 | SKIN_TOKEN_TRACK_ELAPSED_PERCENT, |
| 201 | SKIN_TOKEN_TRACK_TIME_ELAPSED, |
| 202 | SKIN_TOKEN_TRACK_TIME_REMAINING, |
| 203 | SKIN_TOKEN_TRACK_LENGTH, |
| 204 | SKIN_TOKEN_TRACK_STARTING, |
| 205 | SKIN_TOKEN_TRACK_ENDING, |
| 206 | |
| 207 | /* Playlist */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 208 | SKIN_TOKEN_PLAYLIST_ENTRIES, |
| 209 | SKIN_TOKEN_PLAYLIST_NAME, |
| 210 | SKIN_TOKEN_PLAYLIST_POSITION, |
| 211 | SKIN_TOKEN_PLAYLIST_SHUFFLE, |
| 212 | |
| 213 | |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 214 | SKIN_TOKEN_ENABLE_THEME, |
| 215 | SKIN_TOKEN_DISABLE_THEME, |
| 216 | SKIN_TOKEN_DRAW_INBUILTBAR, |
| 217 | SKIN_TOKEN_LIST_TITLE_TEXT, |
| 218 | SKIN_TOKEN_LIST_TITLE_ICON, |
Jonathan Gordon | 9b6ac01 | 2011-09-06 13:49:41 +0000 | [diff] [blame] | 219 | SKIN_TOKEN_LIST_ITEM_CFG, |
| 220 | SKIN_TOKEN_LIST_SELECTED_ITEM_CFG, |
| 221 | SKIN_TOKEN_LIST_ITEM_IS_SELECTED, |
| 222 | SKIN_TOKEN_LIST_ITEM_TEXT, |
Frank Gevaerts | b5cd5ce | 2012-02-25 02:34:23 +0100 | [diff] [blame] | 223 | SKIN_TOKEN_LIST_ITEM_ROW, |
| 224 | SKIN_TOKEN_LIST_ITEM_COLUMN, |
Frank Gevaerts | 28d5f2a | 2011-09-18 12:35:32 +0000 | [diff] [blame] | 225 | SKIN_TOKEN_LIST_ITEM_NUMBER, |
Jonathan Gordon | 9b6ac01 | 2011-09-06 13:49:41 +0000 | [diff] [blame] | 226 | SKIN_TOKEN_LIST_ITEM_ICON, |
| 227 | SKIN_TOKEN_LIST_NEEDS_SCROLLBAR, |
| 228 | SKIN_TOKEN_LIST_SCROLLBAR, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 229 | |
| 230 | SKIN_TOKEN_LOAD_FONT, |
| 231 | |
| 232 | /* buttons */ |
| 233 | SKIN_TOKEN_BUTTON_VOLUME, |
| 234 | SKIN_TOKEN_LASTTOUCH, |
| 235 | SKIN_TOKEN_TOUCHREGION, |
Jonathan Gordon | 943de3c | 2010-10-28 11:00:36 +0000 | [diff] [blame] | 236 | SKIN_TOKEN_HAVE_TOUCH, |
| 237 | |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 238 | /* Virtual LED */ |
| 239 | SKIN_TOKEN_VLED_HDD, |
| 240 | /* Volume level */ |
| 241 | SKIN_TOKEN_VOLUME, |
| 242 | SKIN_TOKEN_VOLUMEBAR, |
| 243 | /* hold */ |
| 244 | SKIN_TOKEN_MAIN_HOLD, |
| 245 | SKIN_TOKEN_REMOTE_HOLD, |
| 246 | |
| 247 | /* Setting option */ |
| 248 | SKIN_TOKEN_SETTING, |
| 249 | SKIN_TOKEN_CURRENT_SCREEN, |
| 250 | SKIN_TOKEN_LANG_IS_RTL, |
| 251 | |
| 252 | /* Recording Tokens */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 253 | SKIN_TOKEN_HAVE_RECORDING, |
| 254 | SKIN_TOKEN_IS_RECORDING, |
| 255 | SKIN_TOKEN_REC_FREQ, |
| 256 | SKIN_TOKEN_REC_ENCODER, |
| 257 | SKIN_TOKEN_REC_BITRATE, /* SWCODEC: MP3 bitrate, HWCODEC: MP3 "quality" */ |
| 258 | SKIN_TOKEN_REC_MONO, |
| 259 | SKIN_TOKEN_REC_SECONDS, |
| 260 | SKIN_TOKEN_REC_MINUTES, |
| 261 | SKIN_TOKEN_REC_HOURS, |
| 262 | |
| 263 | |
| 264 | /* Radio Tokens */ |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 265 | SKIN_TOKEN_HAVE_TUNER, |
| 266 | SKIN_TOKEN_TUNER_TUNED, |
| 267 | SKIN_TOKEN_TUNER_SCANMODE, |
| 268 | SKIN_TOKEN_TUNER_STEREO, |
| 269 | SKIN_TOKEN_TUNER_MINFREQ, /* changes based on "region" */ |
| 270 | SKIN_TOKEN_TUNER_MAXFREQ, /* changes based on "region" */ |
| 271 | SKIN_TOKEN_TUNER_CURFREQ, |
Bertrik Sikken | de870b3 | 2010-11-11 21:13:29 +0000 | [diff] [blame] | 272 | SKIN_TOKEN_TUNER_RSSI, |
| 273 | SKIN_TOKEN_TUNER_RSSI_MIN, |
| 274 | SKIN_TOKEN_TUNER_RSSI_MAX, |
Jonathan Gordon | 1ce7ba4 | 2010-11-18 11:47:42 +0000 | [diff] [blame] | 275 | SKIN_TOKEN_TUNER_RSSI_BAR, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 276 | SKIN_TOKEN_PRESET_ID, /* "id" of this preset.. really the array element number */ |
| 277 | SKIN_TOKEN_PRESET_NAME, |
| 278 | SKIN_TOKEN_PRESET_FREQ, |
| 279 | SKIN_TOKEN_PRESET_COUNT, |
| 280 | /* RDS tokens */ |
| 281 | SKIN_TOKEN_HAVE_RDS, |
| 282 | SKIN_TOKEN_RDS_NAME, |
| 283 | SKIN_TOKEN_RDS_TEXT, |
Jonathan Gordon | 87aa86c | 2011-03-27 08:01:58 +0000 | [diff] [blame] | 284 | |
| 285 | /* Skin variables */ |
| 286 | SKIN_TOKEN_VAR_SET, |
| 287 | SKIN_TOKEN_VAR_GETVAL, |
| 288 | SKIN_TOKEN_VAR_TIMEOUT, |
Jonathan Gordon | 3b9ffd2 | 2011-09-11 01:50:06 +0000 | [diff] [blame] | 289 | |
| 290 | SKIN_TOKEN_SUBSTRING, |
Jonathan Gordon | 014a08c | 2012-03-15 22:50:17 +1100 | [diff] [blame] | 291 | |
| 292 | SKIN_TOKEN_DRAWRECTANGLE, |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 293 | }; |
| 294 | |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 295 | /* |
| 296 | * Struct for tag parsing information |
| 297 | * name - The name of the tag, i.e. V for %V |
| 298 | * params - A string specifying all of the tags parameters, each |
| 299 | * character representing a single parameter. Valid |
| 300 | * characters for parameters are: |
| 301 | * I - Required integer |
| 302 | * i - Nullable integer |
Robert Bieber | 15488a0 | 2010-07-15 06:24:11 +0000 | [diff] [blame] | 303 | * D - Required decimal |
| 304 | * d - Nullable decimal |
| 305 | * Decimals are stored as (whole*10)+part |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 306 | * S - Required string |
| 307 | * s - Nullable string |
| 308 | * F - Required file name |
| 309 | * f - Nullable file name |
Jonathan Gordon | 20b9020 | 2010-06-09 14:51:52 +0000 | [diff] [blame] | 310 | * C - Required skin code |
Jonathan Gordon | 145571d | 2010-08-05 11:28:35 +0000 | [diff] [blame] | 311 | * T - Required single skin tag |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 312 | * * - Any amonut of the previous tag (or group if after a [] |
Robert Bieber | 7dfd0c0 | 2010-07-01 08:45:49 +0000 | [diff] [blame] | 313 | * \n - causes the parser to eat everything up to and including the \n |
| 314 | * MUST be the last character of the prams string |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 315 | * Any nullable parameter may be replaced in the WPS file |
| 316 | * with a '-'. To specify that parameters may be left off |
| 317 | * altogether, place a '|' in the parameter string. For |
| 318 | * instance, with the parameter string... |
| 319 | * Ii|Ss |
| 320 | * one integer must be specified, one integer can be |
| 321 | * specified or set to default with '-', and the user can |
| 322 | * stop providing parameters at any time after that. |
| 323 | * To specify multiple instances of the same type, put a |
| 324 | * number before the character. For instance, the string... |
| 325 | * 2s |
Jonathan Gordon | 40ecdf6 | 2012-02-02 22:26:16 +1100 | [diff] [blame] | 326 | * will specify two strings. A ? at the beginning of the |
Robert Bieber | f02a244 | 2010-06-02 05:27:37 +0000 | [diff] [blame] | 327 | * string will specify that you may choose to omit all arguments |
Jonathan Gordon | 863d239 | 2010-08-14 11:17:49 +0000 | [diff] [blame] | 328 | * |
| 329 | * You may also group param types in [] which will tell the parser to |
| 330 | * accept any *one* of those types for that param. i.e [IT] will |
| 331 | * accept either an integer or tag type. [ITs] will also accept a string or - |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 332 | * |
| 333 | */ |
| 334 | struct tag_info |
| 335 | { |
Robert Bieber | 4819882 | 2010-05-30 05:51:50 +0000 | [diff] [blame] | 336 | enum skin_token_type type; |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 337 | char* name; |
| 338 | char* params; |
Robert Bieber | 32ff4e9 | 2010-07-04 01:39:57 +0000 | [diff] [blame] | 339 | int flags; |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 340 | }; |
| 341 | |
| 342 | /* |
| 343 | * Finds a tag by name and returns its parameter list, or an empty |
| 344 | * string if the tag is not found in the table |
| 345 | */ |
Nils Wallménius | c2529c3 | 2010-07-31 11:28:37 +0000 | [diff] [blame] | 346 | const struct tag_info* find_tag(const char* name); |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 347 | |
| 348 | /* |
| 349 | * Determines whether a character is legal to escape or not. If |
| 350 | * lookup is not found in the legal escape characters string, returns |
| 351 | * false, otherwise returns true |
| 352 | */ |
| 353 | int find_escape_character(char lookup); |
| 354 | |
Robert Bieber | c5e14b5 | 2010-05-31 17:39:58 +0000 | [diff] [blame] | 355 | #ifdef __cplusplus |
| 356 | } |
| 357 | #endif |
| 358 | |
Robert Bieber | d5b24dd | 2010-05-25 15:19:52 +0000 | [diff] [blame] | 359 | #endif /* TAG_TABLE_H */ |