summaryrefslogtreecommitdiff
path: root/apps/gui/wps_parser.c (follow)
Commit message (Collapse)AuthorAge
* Don't accept 0 for the width or height of a progress bar in the %pb tag. A ↵Dave Chapman2008-10-22
| | | | | | zero width causes a divide by zero, and a zero height simply doesn't make any sense, so we assume it was a mistake. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18863 a1c6a512-1295-4272-9138-f99709370657
* * Make %t stricter by aborting if a value is not given.Jonathan Gordon2008-10-11
| | | | | | | | * Move the default value for %mv back into wps_parser.c where it belongs * Add the debug line for the %mv tag git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18773 a1c6a512-1295-4272-9138-f99709370657
* update the %mv wps tag to let you specify how long it should wait after ↵Jonathan Gordon2008-10-11
| | | | | | | | | being released to go back to false. e.g %mv2 will stay true for 2 seconds or %mv3.5 is 3.5 seconds (same as the %t syntax)... if no number is specified it defaults to 1 second git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18769 a1c6a512-1295-4272-9138-f99709370657
* FS#9460 - Add a tag %mv which can be used to check if the volume button is ↵Jonathan Gordon2008-10-09
| | | | | | being pressed (e.g %?mv<yes|no> ). It will stay true after its released for a little over half a second (not configurable unless someone comes up with a nice way to add a parameter to the tag? 1s is too long and .5s is too short... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18752 a1c6a512-1295-4272-9138-f99709370657
* Add wpseditor, the Google Summer of Code 2008 project of Rostislav Chekan. ↵Frank Gevaerts2008-08-29
| | | | | | Closes FS#9327 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18362 a1c6a512-1295-4272-9138-f99709370657
* Unify opening of utf-8 files (FS#6203). This also adds ignoring the BOM in ↵Dominik Riebeling2008-08-02
| | | | | | several places it has been missing (as FS#6071). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18185 a1c6a512-1295-4272-9138-f99709370657
* Introduce a new WPS parsing error case: limits exceeded. It includes the ↵Nicolas Pennequin2008-07-12
| | | | | | | | | cases when there are too many tokens, lines, sublines, viewports, strings, characters or conditional levels. This prevents the parser from failing silently or going on, as it used to do in those cases. Thanks to fml (Alexander Levin) for mentioning this issue. I also changed the error types from #defines to an enum, for cleanliness. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18015 a1c6a512-1295-4272-9138-f99709370657
* Fix FS #9181, allowing the documented 3 progress bars per WPS. Also simplify ↵Magnus Holmgren2008-07-11
| | | | | | the code a little. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18008 a1c6a512-1295-4272-9138-f99709370657
* get checkwps building again (FS#9150) - still doesnt compile on d2 and mr500 ↵Jonathan Gordon2008-07-06
| | | | | | though git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17957 a1c6a512-1295-4272-9138-f99709370657
* Remove a viewport ambiguity by changing the screens width/heigth members ↵Peter D'Hoye2008-06-28
| | | | | | into lcdwidth/lcdheight. Normal usercode should always use getwidth()/getheigth() as that returns the viewport width/height. Fixes issues that would have appeared in many places when introducing viewports with sizes != lcd sizes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17857 a1c6a512-1295-4272-9138-f99709370657
* Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg2008-06-28
| | | | | | | | | later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
* allow the full lowercase a-z to be used as conditional viewport grouping id'sJonathan Gordon2008-06-25
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17789 a1c6a512-1295-4272-9138-f99709370657
* FS#9051 - remove LCD margins... use viewports if you need them...Jonathan Gordon2008-06-23
| | | | | | | | | | | NOTE to WPS people.... %m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored. Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected. Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
* fix yellowJonathan Gordon2008-06-23
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17760 a1c6a512-1295-4272-9138-f99709370657
* commit FS#9027 - conditional viewportsJonathan Gordon2008-06-23
| | | | | | | | | | | | | | | | | | | ** BREAKS CURRENT WPS's ** * %P has been removed, merged with the new %pb * %pb is now %pb or %pb|bitmap|x|y|width|height| (any of those params can be - to use sane defaults... check wiki/task for more explaination) * New %Vl and %Vd tags which are used to setup and display conditionaly displayed viewports (%Vl|<id>|<usual %V params>| to set up, then %Vd<id> to enable the viewport * bumps the max allowed viewport count to 24 * you can setup 3 different progressbars in a WPS... max of one per viewport though http://www.rockbox.org/tracker/task/9027?getfile=16785 is a simple perl script to convert old %P/%pb to the new %pb syntax I'll commit changes to the cabbie wps soon which shows how to use %Vl/%Vd properly... Reminder: %m will be removed soonish also so when fixing your WPS's remember to use conditional viewports to replace %m git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17759 a1c6a512-1295-4272-9138-f99709370657
* Accept FS#9075 and rename valid_vals to set_valsJonathan Gordon2008-06-07
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17698 a1c6a512-1295-4272-9138-f99709370657
* Fix typo in the new default values for %V, so that the background color is ↵Magnus Holmgren2008-06-05
| | | | | | actually set on 16-bit targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17692 a1c6a512-1295-4272-9138-f99709370657
* make %V a little simpler. only the x and y values have to be specified now ↵Jonathan Gordon2008-06-05
| | | | | | | | | | | | | | | (i.e %V|0|0|||||| ) default values are as follows: width - lcd width - the x value height - lcd height - y value font - user font fg colour - the themes fg colour on 16bit targets, black on greyscale targets bg colour - the themes bg colour on 16bit targets, white on greyscale targets git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17690 a1c6a512-1295-4272-9138-f99709370657
* Fix FS#9010 warning in checkwps when building on an amd64 machineNils Wallménius2008-05-19
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17582 a1c6a512-1295-4272-9138-f99709370657
* Moved atoi declaration to stdlib.h. Deleted atoi.hBertrik Sikken2008-04-28
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17280 a1c6a512-1295-4272-9138-f99709370657
* WPS parser: also revert to the default WPS when there were bitmap loading ↵Nicolas Pennequin2008-04-01
| | | | | | errors. The reverting is moved from wps_parse() to wps_data_load(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16914 a1c6a512-1295-4272-9138-f99709370657
* Remove unnecessary (and incorrect) #ifdefs surrounding #include ↵Dave Chapman2008-03-29
| | | | | | "backdrop.h", and correct remaining references to HAVE_LCD_REMOTE to HAVE_REMOTE_LCD git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16873 a1c6a512-1295-4272-9138-f99709370657
* Major cleanup of checkwps - fix all warnings and add a script to build ↵Dave Chapman2008-03-26
| | | | | | versions for all supported targets (plus some unsupported ones). You now need to run the version of checkwps that matches the device your WPS is for. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16831 a1c6a512-1295-4272-9138-f99709370657
* Move checkwps to its own subdir in preparation for compiling target-specific ↵Dave Chapman2008-03-26
| | | | | | versions. Also remove a DEBUGF that should not have been left in. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16827 a1c6a512-1295-4272-9138-f99709370657
* Fix yellow, and at the same time simplify some #ifdefsDave Chapman2008-03-26
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16823 a1c6a512-1295-4272-9138-f99709370657
* 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