summaryrefslogtreecommitdiff
path: root/lib/skin_parser/skin_parser.c (follow)
Commit message (Collapse)AuthorAge
* Limit more variables to file scopeThomas Jarosch2015-01-11
| | | | Change-Id: I30219d626316776eb73b4205d63376fa3dbc6361
* Fix yellowThomas Jarosch2015-01-05
| | | | Change-Id: I8685198c208b5324b09b5ad59f7379502e9ed977
* Make thirty functions static to reduce binary sizeThomas Jarosch2015-01-05
| | | | | | | | | | | If any of those functions should be (unused) API functions, they can easily be turned back once really needed. Detected using a new cppcheck check that uses the internal symbol database to catch functions that are only used in the current file. Change-Id: Ic2b1e5b8020b76397f11cefc4e205f3b7ac1f184
* more error handling for checkwpsJonathan Gordon2013-02-27
| | | | Change-Id: I03055d045c0a8e0e63e17b290cc71c54a8dc3634
* checkwps: show a helpful error if the parser callback errors outJonathan Gordon2013-02-26
| | | | Change-Id: Ie3e35292ba8d74f0ff3d1bb3483a5e83aae0e6b6
* skin_engine: Support percentages for viewport positioningJonathan Gordon2012-07-29
| | | | | | | | | | | %V(0,50%,75%,50%,-) - make a viewport at x=0, y=half the lcd height, 75% lcd width and the remaining height (the other half) of the lcd. Change-Id: If26ccb65e8dc52c9225f3fd6d7b222d770add0f0 Reviewed-on: http://gerrit.rockbox.org/184 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Tested-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info>
* skin_engine: Fix a obscure parser bugJonathan Gordon2012-07-05
| | | | | | | | Tag params where a [] group is followed (but not immediatly) by a * will not parse correctly. e.g [si]iii|s* will attempt to find an 'i' after the second s instead of looping s's Change-Id: I3982f726b6539818f8332334b263b673259f98ef
* skin_engine: rework the parser to be closer to the langauge grammar.Jonathan Gordon2012-04-22
| | | | | | | | | | | | | The parser was unconditionally scanning things which it thought were conditional/enum lists (or tag arg lists) when they couldn't possibly be (i.e < inside a param which should be valid). This change fixes it (i.e %?and(%if(%pv, <, -50), %if(%mp, >i, 1)) is perfectly valid now. This *may* break your exsiting skins if you were using %if with < or > Change-Id: Ia24dbdf0b11fc7d8a735c1111d648c3bebd68ac6
* Revert "skin_engine: rework the parser to be closer to the langauge grammar."Thomas Martitz2012-04-17
| | | | | | | | This reverts commit ec8b21eef8b2fe1bd02f335dbc0dfbf05c2deff2 which was pushed by accident. Change-Id: I1aaedf6876d0448a100dc582b79f1293d021bac1 Reviewed-on: http://gerrit.rockbox.org/216 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
* skin_engine: rework the parser to be closer to the langauge grammar.Jonathan Gordon2012-04-17
| | | | | | | | | | | | | | | The parser was unconditionally scanning things which it thought were conditional/enum lists (or tag arg lists) when they couldn't possibly be (i.e < inside a param which should be valid). This change fixes it (i.e %?and(%if(%pv, <, -50), %if(%mp, > 1)) is perfectly valid now. This *may* break your exsiting skins if you were using %if with < or > Change-Id: Ibcb42bc6bb78908f79de024b61276b91b1ce02a0 Reviewed-on: http://gerrit.rockbox.org/214 Reviewed-by: Thomas Martitz <kugel@rockbox.org>
* skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a ↵Jonathan Gordon2012-02-07
| | | | | | | | | | single conditional. Use these tags to stop having multiple conditionals.. e.g: OLD: %?C<%?Ia<something>> NEW: %?and(%C, %Ia)<something> Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
* skin parser: Allow the first character after conditional seperators to be \nJonathan Gordon2012-02-01
| | | | | | | | | | | | | | | | | | This hopefully makes difficult conditionals more easy to read: i.e OLD: %?bp<%?bc<%xd(Ba)|%xd(Bb)>|%?bl<|%xd(Bc)|%xd(Bd)|%xd(Be)|%xd(Bf)|%xd(Bg)|%xd(Bh)|%xd(Bi)|%xd(Bj)>> NEW: %?bp< %?bc< %xd(Ba)|%xd(Bb) >| %?bl<|%xd(Bc)|%xd(Bd)| %xd(Be)|%xd(Bf)| %xd(Bg)|%xd(Bh)| %xd(Bi)|%xd(Bj) > > Change-Id: Ic89d2c95562b27e7427c3a5d528340f9aec55cf2
* skin parser: skip \t characters at the begining of lines to allow for more ↵Jonathan Gordon2012-02-01
| | | | | | readable skins Change-Id: I8f3154d17807ad202fc65d462e85da2195ce605c
* Use buflib for all skin engine allocations.Jonathan Gordon2011-11-15
| | | | | | | | Massive thanks to Michael Chicoine and other testers for finding the early bugs. This removes all skin memory limitations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30991 a1c6a512-1295-4272-9138-f99709370657
* de-tabifyNils Wallménius2011-10-08
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30734 a1c6a512-1295-4272-9138-f99709370657
* Partial fix for FS#12289 - comment lines would waste lots of buffer space. ↵Jonathan Gordon2011-09-25
| | | | | | Still not perfect but should get 90+% of comments completly ignored now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30596 a1c6a512-1295-4272-9138-f99709370657
* Fix further 'variable set but not used' warnings reported from GCC 4.6.0.Andree Buschmann2011-05-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
* Remove duplicate #include in skin_parser.cBertrik Sikken2011-04-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29736 a1c6a512-1295-4272-9138-f99709370657
* Fix FS#11829 - %?xx<....> Crashes on targets where the %xx feature tag isnt ↵Jonathan Gordon2010-12-24
| | | | | | avilable. rather hacky fix though better than crashing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28890 a1c6a512-1295-4272-9138-f99709370657
* Fix unchecked result skin_parse_tag() exposed by r28480.Thomas Martitz2010-11-05
| | | | | | | It caused the parser to not see that skin parsing failed and to enter an infinite loop. And as a result it continued to endlessly malloc(). In normal build the skin buffer size limit made it end. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28497 a1c6a512-1295-4272-9138-f99709370657
* Correct spelling of 'seperate' in the skin parsing code - FS#11724 by ↵Bertrik Sikken2010-11-05
| | | | | | Alexander Levin git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28485 a1c6a512-1295-4272-9138-f99709370657
* Fix a bug introduced with r28370 (feature check tag improvements) where ↵Jonathan Gordon2010-11-03
| | | | | | %Rp<foo> would fail to parse if the target had recording. Also enable debugging in the checkwps build line git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28473 a1c6a512-1295-4272-9138-f99709370657
* skin_parser: Change the way hardware conditionals are done (i.e %?cc)Jonathan Gordon2010-10-28
| | | | | | | | They now only parse the correct branch (so only the true branch, or only the false branch). This shuold allow you to load different images/backdrops with the same id's depending on the targets hardware. Add a new %Tp - "touchscreen present?" tag to check if the target has a touchscreen git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28370 a1c6a512-1295-4272-9138-f99709370657
* libskin_parser: fix a annoying bug where viewports required at least one ↵Jonathan Gordon2010-10-05
| | | | | | line (even %Vi()). multiple %Vi lines direclty under eachother should now work git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28210 a1c6a512-1295-4272-9138-f99709370657
* New skin tag: %if(<tag>, <operator>, <operand> [,option count]) which lets ↵Jonathan Gordon2010-08-19
| | | | | | | | | | | | | | | | | you do very simple logical comparissons on other tags. <tag> is the tag to check against <operator> is the comparisson to do, any one of... =, !=, >, >=, <, <= (when comparring against a string tag like %ia only = and != work, and it is done NOT case sensitive) <operand> is either another tag, a number, or text. [option count] is an optinal number to use for the few tags which scale to the amount of options when used as a conditional (i.e %?pv<a|b|c|d> would have 4 options) example: %?if(%pv, >=, 0)<Warning.. volume clipping|coool...> That says "If the value from %pv (volume) is greater than or equal to 0 then display the warning line, otherwise the cool line." %?if(%ia, =, %Ia)<same artist> <= this artist and next artist are the same. some tags might need a touch of tweaking to work better with this. experiment and have fun git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27846 a1c6a512-1295-4272-9138-f99709370657
* Change %xd to allow for a number to be used to specify the subimage. i.e ↵Jonathan Gordon2010-08-14
| | | | | | | | | %xd(Ac) can now we written as %xd(A, 3). subimage count start at 1 so a=1, b=2 etc. Also adds the possibility to specify a set of params which a tag can have (i.e a tag or a integer) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27812 a1c6a512-1295-4272-9138-f99709370657
* Add a T type to the tag table which allows parameters to be a single tagJonathan Gordon2010-08-05
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27716 a1c6a512-1295-4272-9138-f99709370657
* make -vvv display the parse tree in checkwps. Fix a potential bug in the ↵Jonathan Gordon2010-08-03
| | | | | | parser where recursive tags (the playlist viewier) would share params with its parant which meant bad things git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27677 a1c6a512-1295-4272-9138-f99709370657
* skinparser lib: more const correctnessNils Wallménius2010-07-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27641 a1c6a512-1295-4272-9138-f99709370657
* skinparser lib: some const correctness and marking of local vars as 'static'Nils Wallménius2010-07-31
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27635 a1c6a512-1295-4272-9138-f99709370657
* FS#11470 - new skin code, finally svn uses the new parser from the theme ↵Jonathan Gordon2010-07-29
| | | | | | editor. This means that a skin that passes the editor WILL pass svn and checkwps (unless the target runs out of skin buffer or something. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27613 a1c6a512-1295-4272-9138-f99709370657
* Theme Editor: Added column number to parser error messagesRobert Bieber2010-07-18
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27477 a1c6a512-1295-4272-9138-f99709370657
* Theme Editor: Committed FS#11477 to add a DECIMAL parameter type in the ↵Robert Bieber2010-07-15
| | | | | | parser and adapt the Theme Editor to accomodate the change by Johnathan Gordon. Fixed bug in the parser caused by the patch (error was thrown on zero value) and adapted tag rendering for new format git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27426 a1c6a512-1295-4272-9138-f99709370657
* s/SUBLINES/LINE_ALTERNATOR/Jonathan Gordon2010-07-04
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27271 a1c6a512-1295-4272-9138-f99709370657
* Theme Editor: Implemented a flags column in the tag table, removed the \n ↵Robert Bieber2010-07-04
| | | | | | 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
* Theme Editor: Fixed a warning in the parser due to a stray asteriskRobert Bieber2010-07-02
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27239 a1c6a512-1295-4272-9138-f99709370657
* Theme Editor: Removed some old hash code that caused viewer not to update ↵Robert Bieber2010-07-02
| | | | | | due to hash collisions. Made Vf and Vb tags attached to viewport definition eat newline at end of line' git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27238 a1c6a512-1295-4272-9138-f99709370657
* Theme Editor: Fixed line numbering bug in parser. Implemented playlist ↵Robert Bieber2010-07-01
| | | | | | display in renderer: playlist will use info for next track for all tracks other than the current track git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27227 a1c6a512-1295-4272-9138-f99709370657
* minor tweak to r27210 to make it the same as the svn parser... eat ↵Jonathan Gordon2010-07-01
| | | | | | everything up to and including the \n after these tags git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27211 a1c6a512-1295-4272-9138-f99709370657
* Theme Editor: Implemented JdGordon's tag newline-eating mechanismRobert Bieber2010-07-01
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27210 a1c6a512-1295-4272-9138-f99709370657
* skin_parser: Fixed bug handling sublines with no contentRobert Bieber2010-06-22
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27060 a1c6a512-1295-4272-9138-f99709370657
* tiny clean up of memory allocationJonathan Gordon2010-06-17
| | | | git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26887 a1c6a512-1295-4272-9138-f99709370657
* make the parser slightly more usable for rockbox, move the buffer allocation ↵Jonathan Gordon2010-06-17
| | | | | | into the lib (maybe not the best spot?) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26880 a1c6a512-1295-4272-9138-f99709370657
* Move the skin parser to a seperate libraryJonathan Gordon2010-06-17
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26877 a1c6a512-1295-4272-9138-f99709370657