summaryrefslogtreecommitdiff
path: root/apps/gui/wps_parser.c (follow)
Commit message (Collapse)AuthorAge
...
* 1) Make Rockbox reject any WPSs if there are errors loading any of the ↵Dave Chapman2008-03-26
| | | | | | required bmps; 2) Make checkwps actually load the images using the Rockbox bmp loader, and reject the WPS in the same was as Rockbox on bmp errors. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16822 a1c6a512-1295-4272-9138-f99709370657
* Make checkwps compile again. Still more work is needed though, as checkwps ↵Dave Chapman2008-03-25
| | | | | | is compiled to emulate an iPod Color - this needs changing to allow the LCD (and remote LCD) dimensions/depth to be specified on the commandline - the new %V tags are validated against the LCD characteristics git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16807 a1c6a512-1295-4272-9138-f99709370657
* D'oh - fix a silly #ifdef mistake that caused problems with remote WPSs ↵Dave Chapman2008-03-25
| | | | | | using viewports. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16787 a1c6a512-1295-4272-9138-f99709370657
* Stricter syntax checking of the %V tag - pay attention to the return-code ↵Dave Chapman2008-03-24
| | | | | | from parse_list, and check for the tailing | symbol. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16784 a1c6a512-1295-4272-9138-f99709370657
* Hopefully get the viewport position/dimensions validation correct this time.Dave Chapman2008-03-24
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16782 a1c6a512-1295-4272-9138-f99709370657
* Add another safety-check in the bitmap strips parsing - don't allow the ↵Dave Chapman2008-03-24
| | | | | | num_subimages parameter to %xl to be <= 0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16779 a1c6a512-1295-4272-9138-f99709370657
* Add a sanity-check to ensure only in-range subimages are referenced in %xd ↵Dave Chapman2008-03-24
| | | | | | tags. Plus some tab policing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16774 a1c6a512-1295-4272-9138-f99709370657
* Add the ability to use bitmap strips (a single .bmp file containing many ↵Dave Chapman2008-03-23
| | | | | | images of the same dimensions, tiled vertically - similar to icon strips) in the WPS. The %xl tag now has an optional "number of subimages" parameter, and the %xd tag has an optional "subimage to display" parameter (a-z,A-Z - allowing up to 52 sub-images). So for example, a bitmap with 10 subimages is loaded with %xl|M|volume.bmp|134|153|10| and then this can be used in a conditional as %?pv<%xdMa|%xdMb|%xdMc|%xdMd|%xdMe|%xdMf|%xdMg|%xdMh|%xdMi|%xdMj>. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16764 a1c6a512-1295-4272-9138-f99709370657
* Oops - correctly reset the bmp filenamesDave Chapman2008-03-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16762 a1c6a512-1295-4272-9138-f99709370657
* Small simplification - take advantage of the fact that x/y/width/height are ↵Dave Chapman2008-03-22
| | | | | | non-negative integers when validating the viewport bounds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16736 a1c6a512-1295-4272-9138-f99709370657
* Reduce the shocking amount of RAM my viewports implementation was using. ↵Dave Chapman2008-03-22
| | | | | | The first version stored an array of lines for each of the 16 possible viewports (MAX_VIEWPORTS * the number of lines on the LCD with a 5-pixel high font). This version reverts back to a single global array of lines, with each viewport specifying the first and last lines as indexes into that array. This also turns out to be simpler, reducing binsize a little as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16735 a1c6a512-1295-4272-9138-f99709370657
* Commit viewports-in-WPS patch (FS#8385). This adds the %V tag - see the ↵Dave Chapman2008-03-21
| | | | | | CustomWPS page for details (shortly...). There is still some work to do - decide how to handle font references, decide how to handle conditionals. Plus checkwps is broken - I'll fix that in a separate commit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16733 a1c6a512-1295-4272-9138-f99709370657
* Add a general-purpose parse_list function to parse a string containing a ↵Dave Chapman2008-03-21
| | | | | | delimited list of items and adapt the parse_image_load() function in the WPS parser to use it. This function will also be used to parse the upcoming WPS %V viewport tag, but I'm committing it separately as these changes are unrelated to the viewport implementation itself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16728 a1c6a512-1295-4272-9138-f99709370657
* revert my previous commit and use a conditional for the time format instead ↵Jonathan Gordon2007-11-27
| | | | | | | | | which is probably better. %?cf<24 hour stuff|12 hour stuff> git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15830 a1c6a512-1295-4272-9138-f99709370657
* add 2 new tags which display the hour in 12 or 24 hour format depending on ↵Jonathan Gordon2007-11-27
| | | | | | | | | | the config setting. %cf is for padded hour %cg is for just the number git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15826 a1c6a512-1295-4272-9138-f99709370657
* Improve clearing of pictures in conditional constructs. This fixes improper ↵Nicolas Pennequin2007-11-18
| | | | | | clearing of pictures used in several conditionals or in nested conditionals (FS#7856). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15663 a1c6a512-1295-4272-9138-f99709370657
* Make the WPS parser stricter with invalid parameter lists. It will now ↵Nicolas Pennequin2007-11-14
| | | | | | reject them instead of ignoring them (this includes the second parameter to %m|x|, which is invalid and now causes a failure). Also change the debugging code in order to allow more precise error messages, including the faulty token's index and description. Finally, add a few missing token description and fine-tune the #ifdefs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15624 a1c6a512-1295-4272-9138-f99709370657
* Allow setting a margin on a non-scrolling line by using %m|margin| instead ↵Nicolas Pennequin2007-11-14
| | | | | | of %s|margin|. This allows to easily place dynamic info next to album art. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15610 a1c6a512-1295-4272-9138-f99709370657
* FS#8135 - add an optional "left margin" parameter to the %s WPS tag - e.g. ↵Dave Chapman2007-11-12
| | | | | | %s|100|. This patch uses parts of the scroll-margins patch (FS#2954), but is much smaller, only offers a left-margin, and only affects the WPS code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15604 a1c6a512-1295-4272-9138-f99709370657
* Add detection for a previously ignored error case: a conditional token is ↵Nicolas Pennequin2007-11-12
| | | | | | present but no conditional start token (e.g. "%?C%al|>"). This would cause an inifnite loop in the displaying code. Thanks to markun for making the mistake and reporting it ;) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15598 a1c6a512-1295-4272-9138-f99709370657
* Various album art improvements:Nicolas Pennequin2007-11-12
| | | | | | | | * Make the album art display tag static instead of dynamic, making it be drawn less often, which is good. * Add the possibility of clearing the album art bitmap instead of drawing it, and use this abaility when the display tag is inside a conditional construct. * Add the album art display tag to wps_debug.c. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15592 a1c6a512-1295-4272-9138-f99709370657
* Album art support. Based on FS#3045, but heavily modified to adapt to MoB ↵Nicolas Pennequin2007-11-11
| | | | | | | | | | | | and for cleanness. The cover pictures are loaded from external bitmaps. JPEG and embedded art are not supported. The pictures will only be drawn on the main display. There is no resizing but it is possible to specify the WPS bitmap size in the bitmap names (e.g. cover.100x100.bmp). The bitmaps are stored in the main buffer and read directly from there. Currently, duplicate bitmaps will simply be present several times in the buffer, but this will be improved. To enable for a target, #define HAVE_ALBUMART in its config file. For more information, see the wiki page: http://www.rockbox.org/wiki/AlbumArt. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15572 a1c6a512-1295-4272-9138-f99709370657
* Add support for grouping tags. From FS#7362.Dan Everton2007-08-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14242 a1c6a512-1295-4272-9138-f99709370657
* Add support for parsing the disc number tag from metadata and use of it in ↵Dan Everton2007-08-03
| | | | | | the database. Patch originally from FS#4961 with some minor tweaks by me. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14154 a1c6a512-1295-4272-9138-f99709370657
* Implement feature request FS#7476: Add a "song progress percentage" WPS tag ↵Nicolas Pennequin2007-07-25
| | | | | | (%px) that can be used in a conditional to create custom progress meters. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13987 a1c6a512-1295-4272-9138-f99709370657
* Make the '%mh' wps tag (to indicate keylock status) available on the Archos ↵Marianne Arnold2007-06-25
| | | | | | targets as well. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13716 a1c6a512-1295-4272-9138-f99709370657
* Make RTC tags display hyphens instead of nothing on non-rtc targets. This ↵Brandon Low2007-06-16
| | | | | | makes WPSs that use RTC tags look decent again with the new separated RTC tag style git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13639 a1c6a512-1295-4272-9138-f99709370657
* Add some more explicit defines for my previous commit.Nicolas Pennequin2007-06-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13561 a1c6a512-1295-4272-9138-f99709370657
* Make the bitmap loading code handle the progressbar and backdrop bitmaps in ↵Nicolas Pennequin2007-06-05
| | | | | | a slightly more generic way. This hopefully simplifies the code a bit and should make adding special bitmaps less painful. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13560 a1c6a512-1295-4272-9138-f99709370657
* Commit my patch from FS#7179 - a standalone command-line checkwps tool. To ↵Dave Chapman2007-05-29
| | | | | | build, just type "make checkwps" in tools and run it with "checkwps wpsname.wps". git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13517 a1c6a512-1295-4272-9138-f99709370657
* Oops, next file info should be dynamic.Nicolas Pennequin2007-05-21
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13456 a1c6a512-1295-4272-9138-f99709370657
* Add %fk and %Fk WPS tags : (next) file audio frequency in KHz (rewrite of ↵Nicolas Pennequin2007-05-21
| | | | | | FS#6393 to adapt it to the tokenizer). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13455 a1c6a512-1295-4272-9138-f99709370657
* Trim a bunch of long lines and fix an infinite loop and buffer overrun in ↵Nicolas Pennequin2007-05-02
| | | | | | the impossible case that a WPS line ends with a litteral string but without a newline char (wps_parser.c:774). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13306 a1c6a512-1295-4272-9138-f99709370657
* Add a check for unclosed conditionals at the end of the WPS parsing in case ↵Nicolas Pennequin2007-05-02
| | | | | | we didn't reach the end of the file. Also a few minor other changes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13303 a1c6a512-1295-4272-9138-f99709370657
* FS #7093 by Dave Hooper: prevent crash when loading too many/long static ↵Peter D'Hoye2007-05-01
| | | | | | strings in the wps git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13302 a1c6a512-1295-4272-9138-f99709370657
* Better handling of strings in the WPS parser by detecting duplicates to ↵Nicolas Pennequin2007-04-30
| | | | | | avoid having two copies of the same string in the string buffer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13295 a1c6a512-1295-4272-9138-f99709370657
* Change some ifdefs for the recent backdrop changes (fixes the yellow builds) ↵Nicolas Pennequin2007-04-25
| | | | | | and move the backdrop files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13265 a1c6a512-1295-4272-9138-f99709370657
* Add backdrop support for LCD remotes with depth > 1-bit. Only WPS backdrops, ↵Nicolas Pennequin2007-04-25
| | | | | | but the groundwork is laid for main backdrops too (all that's really needed are menus to set/clear them). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13263 a1c6a512-1295-4272-9138-f99709370657
* Make bitmaps use the right format in a RWPS and prevent a backdrop tag in a ↵Nicolas Pennequin2007-04-25
| | | | | | RWPS from clearing the main display's backdrop. This also allows future backdrop support for LCD remotes by making the parsing code aware of whether the display for a WPS is a remote or not. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13261 a1c6a512-1295-4272-9138-f99709370657
* Add a new commandline switch to the simulator: "--debugwps". It enables ↵Nicolas Pennequin2007-04-24
| | | | | | printing of advanced (and very verbose) WPS debugging information. Also make the debugging code a bit cleaner. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13257 a1c6a512-1295-4272-9138-f99709370657
* WPS Parser: On parse failure, print a (hopefully) useful error message with ↵Nicolas Pennequin2007-04-24
| | | | | | | | | line number (sim only). Also the debug code is still disabled but now in a nicer way. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13251 a1c6a512-1295-4272-9138-f99709370657
* More strict WPS parsing and displaying code. If there are errors, WPS ↵Nicolas Pennequin2007-04-21
| | | | | | loading will fail and the default WPS will be displayed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13236 a1c6a512-1295-4272-9138-f99709370657
* General housekeeping: Make plugin buffer functions take size_t * instead of ↵Michael Sevakis2007-04-21
| | | | | | int * to match the parameter type of the buffer functions called in the core. Get rid of unsafe int * <==> size_t * casting. Use ssize_t where int was used and size_t where unsigned int was used in the buffer calls to not alter signedness in the plugins. No API version change since it should only be an issue for 64-bit sim builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13233 a1c6a512-1295-4272-9138-f99709370657
* Added autoscore tag (%ra) to wps.Miika Pekkarinen2007-04-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13169 a1c6a512-1295-4272-9138-f99709370657
* Reverted FS#6949 as we have a strict policy against anonymous contributions.Miika Pekkarinen2007-04-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13168 a1c6a512-1295-4272-9138-f99709370657
* FS#6949 - WPS tag for database autoscore. Author wanted to remain anonymous.Miika Pekkarinen2007-04-15
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13164 a1c6a512-1295-4272-9138-f99709370657
* * Make the WPS parser close open conditionals on new sublines and comments ↵Nicolas Pennequin2007-04-15
| | | | | | | | | | | as well as new lines. * Make the displaying code check for invalid conditional constructs in order to avoid some rare cases of infinite looping. * Make the WPS parser check that it doesn't read more strings than it can. * Increase the string buffer size (from 512 to 1024, to accomodate the TextBox WPS which uses a lot of unicode characters). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13162 a1c6a512-1295-4272-9138-f99709370657
* Better error checking for the image display tag (%xdn). Should prevent ↵Nicolas Pennequin2007-04-14
| | | | | | problems with the former crossfeed tag (%xd) when used in a conditional construct. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13158 a1c6a512-1295-4272-9138-f99709370657
* FS#7020. Make the behaviour of '#' more consistent. It now requires escaping ↵Nicolas Pennequin2007-04-13
| | | | | | by a '%' to be displayed. If it is not escaped, the following text will be interpreted as a comment (including the newline character). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13140 a1c6a512-1295-4272-9138-f99709370657
* * Add the crossfade (%xf) WPS tagNicolas Pennequin2007-04-12
| | | | | | | * Avoid eating the whole line when unsuccessfully parsing a %x or %xl tag. This will prevent unknown tags starting with %x from making the line disappear. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13127 a1c6a512-1295-4272-9138-f99709370657