Commit graph

41 commits

Author SHA1 Message Date
Jonathan Gordon
2febee5265 more error handling for checkwps
Change-Id: I03055d045c0a8e0e63e17b290cc71c54a8dc3634
2013-02-27 21:15:57 +11:00
Jonathan Gordon
d76dca165b checkwps: show a helpful error if the parser callback errors out
Change-Id: Ie3e35292ba8d74f0ff3d1bb3483a5e83aae0e6b6
2013-02-26 21:18:16 +11:00
Jonathan Gordon
9dd2eb49be skin_engine: Support percentages for viewport positioning
%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-29 04:24:38 +02:00
Jonathan Gordon
4c94b98422 skin_engine: Fix a obscure parser bug
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-07-05 22:41:10 +10:00
Jonathan Gordon
2d3c43dffe skin_engine: rework the parser to be closer to the langauge grammar.
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-22 00:24:16 +10:00
Thomas Martitz
728db21502 Revert "skin_engine: rework the parser to be closer to the langauge grammar."
This reverts commit ec8b21eef8 which was pushed by accident.

Change-Id: I1aaedf6876d0448a100dc582b79f1293d021bac1
Reviewed-on: http://gerrit.rockbox.org/216
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
2012-04-17 17:07:43 +02:00
Jonathan Gordon
e43b856ed0 skin_engine: rework the parser to be closer to the langauge grammar.
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-04-17 17:05:20 +02:00
Jonathan Gordon
40ecdf6811 skin engine: New logical 'and' and 'or' tags to evaluate multiple tags in a 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-07 21:41:18 +11:00
Jonathan Gordon
f417312a71 skin parser: Allow the first character after conditional seperators to be \n
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-01 22:05:06 +11:00
Jonathan Gordon
5f387c28ce skin parser: skip \t characters at the begining of lines to allow for more readable skins
Change-Id: I8f3154d17807ad202fc65d462e85da2195ce605c
2012-02-01 21:27:18 +11:00
Jonathan Gordon
9e07ef2b0a Use buflib for all skin engine allocations.
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-11-15 14:11:08 +00:00
Nils Wallménius
e52600eb67 de-tabify
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30734 a1c6a512-1295-4272-9138-f99709370657
2011-10-08 13:54:55 +00:00
Jonathan Gordon
d7372533d0 Partial fix for FS#12289 - comment lines would waste lots of buffer space. 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-09-25 07:43:36 +00:00
Andree Buschmann
f7c4594134 Fix further 'variable set but not used' warnings reported from GCC 4.6.0.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29809 a1c6a512-1295-4272-9138-f99709370657
2011-05-01 13:48:28 +00:00
Bertrik Sikken
837b8ccce0 Remove duplicate #include in skin_parser.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29736 a1c6a512-1295-4272-9138-f99709370657
2011-04-17 06:58:28 +00:00
Jonathan Gordon
78a11cf648 Fix FS#11829 - %?xx<....> Crashes on targets where the %xx feature tag isnt avilable. rather hacky fix though better than crashing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28890 a1c6a512-1295-4272-9138-f99709370657
2010-12-24 07:58:26 +00:00
Thomas Martitz
d98f2929e9 Fix unchecked result skin_parse_tag() exposed by r28480.
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-05 18:46:21 +00:00
Bertrik Sikken
fffbdcc996 Correct spelling of 'seperate' in the skin parsing code - FS#11724 by Alexander Levin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28485 a1c6a512-1295-4272-9138-f99709370657
2010-11-05 09:51:19 +00:00
Jonathan Gordon
f6cf295dd3 Fix a bug introduced with r28370 (feature check tag improvements) where %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-11-03 11:08:55 +00:00
Jonathan Gordon
943de3ce49 skin_parser: Change the way hardware conditionals are done (i.e %?cc)
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-28 11:00:36 +00:00
Jonathan Gordon
d402abe3f8 libskin_parser: fix a annoying bug where viewports required at least one 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-10-05 13:02:34 +00:00
Jonathan Gordon
74ec011bb8 New skin tag: %if(<tag>, <operator>, <operand> [,option count]) which lets 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-19 13:49:32 +00:00
Jonathan Gordon
863d239aa2 Change %xd to allow for a number to be used to specify the subimage. i.e %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-14 11:17:49 +00:00
Jonathan Gordon
145571d9b5 Add a T type to the tag table which allows parameters to be a single tag
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27716 a1c6a512-1295-4272-9138-f99709370657
2010-08-05 11:28:35 +00:00
Jonathan Gordon
1e0a01063d make -vvv display the parse tree in checkwps. Fix a potential bug in the 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-08-03 12:14:50 +00:00
Nils Wallménius
597ccddb39 skinparser lib: more const correctness
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27641 a1c6a512-1295-4272-9138-f99709370657
2010-07-31 16:25:41 +00:00
Nils Wallménius
c2529c341d skinparser lib: some const correctness and marking of local vars as 'static'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27635 a1c6a512-1295-4272-9138-f99709370657
2010-07-31 11:28:37 +00:00
Jonathan Gordon
2d31d77a8b FS#11470 - new skin code, finally svn uses the new parser from the theme 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-29 12:37:48 +00:00
Robert Bieber
3c4fb8abe4 Theme Editor: Added column number to parser error messages
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27477 a1c6a512-1295-4272-9138-f99709370657
2010-07-18 00:59:02 +00:00
Robert Bieber
15488a00ea Theme Editor: Committed FS#11477 to add a DECIMAL parameter type in the 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-15 06:24:11 +00:00
Jonathan Gordon
dc34785b18 s/SUBLINES/LINE_ALTERNATOR/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27271 a1c6a512-1295-4272-9138-f99709370657
2010-07-04 02:04:14 +00:00
Robert Bieber
32ff4e93bd Theme Editor: Implemented a flags column in the tag table, removed the \n 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-04 01:39:57 +00:00
Robert Bieber
00a3024924 Theme Editor: Fixed a warning in the parser due to a stray asterisk
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27239 a1c6a512-1295-4272-9138-f99709370657
2010-07-02 08:43:01 +00:00
Robert Bieber
4429fb02b7 Theme Editor: Removed some old hash code that caused viewer not to update 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-02 08:05:03 +00:00
Robert Bieber
26a2f810f1 Theme Editor: Fixed line numbering bug in parser. Implemented playlist 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-01 21:49:55 +00:00
Jonathan Gordon
aa1a126772 minor tweak to r27210 to make it the same as the svn parser... eat 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-01 10:17:41 +00:00
Robert Bieber
7dfd0c0651 Theme Editor: Implemented JdGordon's tag newline-eating mechanism
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27210 a1c6a512-1295-4272-9138-f99709370657
2010-07-01 08:45:49 +00:00
Robert Bieber
09db2ae203 skin_parser: Fixed bug handling sublines with no content
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27060 a1c6a512-1295-4272-9138-f99709370657
2010-06-22 18:51:44 +00:00
Jonathan Gordon
95b0cefad0 tiny clean up of memory allocation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26887 a1c6a512-1295-4272-9138-f99709370657
2010-06-17 13:54:09 +00:00
Jonathan Gordon
b2ea95e8d2 make the parser slightly more usable for rockbox, move the buffer allocation 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-17 07:56:51 +00:00
Jonathan Gordon
36b934d241 Move the skin parser to a seperate library
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26877 a1c6a512-1295-4272-9138-f99709370657
2010-06-17 06:52:02 +00:00
Renamed from utils/themeeditor/parser/skin_parser.c (Browse further)