summaryrefslogtreecommitdiffstats
path: root/lib/skin_parser/skin_parser.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-11Limit more variables to file scopeThomas Jarosch1-1/+1
Change-Id: I30219d626316776eb73b4205d63376fa3dbc6361
2015-01-05Fix yellowThomas Jarosch1-0/+4
Change-Id: I8685198c208b5324b09b5ad59f7379502e9ed977
2015-01-05Make thirty functions static to reduce binary sizeThomas Jarosch1-3/+3
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
2013-02-27more error handling for checkwpsJonathan Gordon1-0/+10
Change-Id: I03055d045c0a8e0e63e17b290cc71c54a8dc3634
2013-02-26checkwps: show a helpful error if the parser callback errors outJonathan Gordon1-0/+6
Change-Id: Ie3e35292ba8d74f0ff3d1bb3483a5e83aae0e6b6
2012-07-29skin_engine: Support percentages for viewport positioningJonathan Gordon1-5/+17
%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>
2012-07-05skin_engine: Fix a obscure parser bugJonathan Gordon1-2/+2
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
2012-04-22skin_engine: rework the parser to be closer to the langauge grammar.Jonathan Gordon1-60/+5
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
2012-04-17Revert "skin_engine: rework the parser to be closer to the langauge grammar."Thomas Martitz1-5/+60
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>
2012-04-17skin_engine: rework the parser to be closer to the langauge grammar.Jonathan Gordon1-60/+5
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>
2012-02-07skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a ↵Jonathan Gordon1-22/+29
single conditional. Use these tags to stop having multiple conditionals.. e.g: OLD: %?C<%?Ia<something>> NEW: %?and(%C, %Ia)<something> Change-Id: Ia3bbe4611cf808e87dcd1b1147181461fa08294a
2012-02-01skin parser: Allow the first character after conditional seperators to be \nJonathan Gordon1-1/+10
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
2012-02-01skin parser: skip \t characters at the begining of lines to allow for more ↵Jonathan Gordon1-0/+5
readable skins Change-Id: I8f3154d17807ad202fc65d462e85da2195ce605c
2011-11-15Use buflib for all skin engine allocations.Jonathan Gordon1-80/+98
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
2011-10-08de-tabifyNils Wallménius1-39/+39
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30734 a1c6a512-1295-4272-9138-f99709370657
2011-09-25Partial fix for FS#12289 - comment lines would waste lots of buffer space. ↵Jonathan Gordon1-3/+23
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
2011-05-01Fix further 'variable set but not used' warnings reported from GCC 4.6.0.Andree Buschmann1-3/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
2011-04-17Remove duplicate #include in skin_parser.cBertrik Sikken1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29736 a1c6a512-1295-4272-9138-f99709370657
2010-12-24Fix FS#11829 - %?xx<....> Crashes on targets where the %xx feature tag isnt ↵Jonathan Gordon1-27/+45
avilable. rather hacky fix though better than crashing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28890 a1c6a512-1295-4272-9138-f99709370657
2010-11-05Fix unchecked result skin_parse_tag() exposed by r28480.Thomas Martitz1-1/+2
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
2010-11-05Correct spelling of 'seperate' in the skin parsing code - FS#11724 by ↵Bertrik Sikken1-17/+17
Alexander Levin git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28485 a1c6a512-1295-4272-9138-f99709370657
2010-11-03Fix a bug introduced with r28370 (feature check tag improvements) where ↵Jonathan Gordon1-1/+1
%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
2010-10-28skin_parser: Change the way hardware conditionals are done (i.e %?cc)Jonathan Gordon1-1/+13
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
2010-10-05libskin_parser: fix a annoying bug where viewports required at least one ↵Jonathan Gordon1-0/+6
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
2010-08-19New skin tag: %if(<tag>, <operator>, <operand> [,option count]) which lets ↵Jonathan Gordon1-2/+4
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
2010-08-14Change %xd to allow for a number to be used to specify the subimage. i.e ↵Jonathan Gordon1-9/+67
%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
2010-08-05Add a T type to the tag table which allows parameters to be a single tagJonathan Gordon1-0/+11
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27716 a1c6a512-1295-4272-9138-f99709370657
2010-08-03make -vvv display the parse tree in checkwps. Fix a potential bug in the ↵Jonathan Gordon1-3/+9
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
2010-07-31skinparser lib: more const correctnessNils Wallménius1-46/+34
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27641 a1c6a512-1295-4272-9138-f99709370657
2010-07-31skinparser lib: some const correctness and marking of local vars as 'static'Nils Wallménius1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27635 a1c6a512-1295-4272-9138-f99709370657
2010-07-29FS#11470 - new skin code, finally svn uses the new parser from the theme ↵Jonathan Gordon1-11/+158
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
2010-07-18Theme Editor: Added column number to parser error messagesRobert Bieber1-12/+14
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27477 a1c6a512-1295-4272-9138-f99709370657
2010-07-15Theme Editor: Committed FS#11477 to add a DECIMAL parameter type in the ↵Robert Bieber1-3/+32
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
2010-07-04s/SUBLINES/LINE_ALTERNATOR/Jonathan Gordon1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27271 a1c6a512-1295-4272-9138-f99709370657
2010-07-04Theme Editor: Implemented a flags column in the tag table, removed the \n ↵Robert Bieber1-31/+3
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
2010-07-02Theme Editor: Fixed a warning in the parser due to a stray asteriskRobert Bieber1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27239 a1c6a512-1295-4272-9138-f99709370657
2010-07-02Theme Editor: Removed some old hash code that caused viewer not to update ↵Robert Bieber1-0/+10
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
2010-07-01Theme Editor: Fixed line numbering bug in parser. Implemented playlist ↵Robert Bieber1-0/+2
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
2010-07-01minor tweak to r27210 to make it the same as the svn parser... eat ↵Jonathan Gordon1-3/+9
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
2010-07-01Theme Editor: Implemented JdGordon's tag newline-eating mechanismRobert Bieber1-3/+17
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27210 a1c6a512-1295-4272-9138-f99709370657
2010-06-22skin_parser: Fixed bug handling sublines with no contentRobert Bieber1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27060 a1c6a512-1295-4272-9138-f99709370657
2010-06-17tiny clean up of memory allocationJonathan Gordon1-9/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26887 a1c6a512-1295-4272-9138-f99709370657
2010-06-17make the parser slightly more usable for rockbox, move the buffer allocation ↵Jonathan Gordon1-20/+5
into the lib (maybe not the best spot?) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26880 a1c6a512-1295-4272-9138-f99709370657
2010-06-17Move the skin parser to a seperate libraryJonathan Gordon1-0/+923
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26877 a1c6a512-1295-4272-9138-f99709370657