summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-06-10 20:28:36 +0200
committerThomas Martitz <kugel@rockbox.org>2012-06-10 21:20:36 +0200
commit66b6fdbb73f90cbb58fe814cdecc58858b584e1e (patch)
tree6fa8dd17555b1daf05bd4c2fa51a1de921f57162
parent300ff4c952d41fa49768b0e66e13f1354a83fa64 (diff)
downloadrockbox-66b6fdbb73f90cbb58fe814cdecc58858b584e1e.tar.gz
rockbox-66b6fdbb73f90cbb58fe814cdecc58858b584e1e.zip
wpsbuild: Rewrite to fix various issues and support .fms
wpsbuild.pl is enhanced to produce fallback themes that were previously hardcoded in buildzip.pl. It also recognizes resolution strings as regular expressions now so you can specify resolution dependant settings as <setting>.<regex>: <value> (needed to support single themes on multiple resolutions). The WPSBUILD syntax completely changed as well and it includes the fallback themes as well. Ultimately wpsbuild is also able to install .fms files. Change-Id: Idf5994f17b9750983d7bc3ef583540a8cdae1dde
-rw-r--r--apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x1.bmpbin478 -> 0 bytes
-rw-r--r--apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x2.bmpbin478 -> 0 bytes
-rw-r--r--icons/viewers.6x8x1.bmp (renamed from apps/plugins/bitmaps/viewer_defaults/viewers.6x8x1.bmp)bin478 -> 478 bytes
-rw-r--r--icons/viewers.6x8x16.bmp (renamed from apps/plugins/bitmaps/viewer_defaults/viewers.6x8x16.bmp)bin2134 -> 2134 bytes
-rw-r--r--icons/viewers.6x8x2.bmp (renamed from apps/plugins/bitmaps/viewer_defaults/viewers.6x8x2.bmp)bin478 -> 478 bytes
-rwxr-xr-xtools/buildzip.pl78
-rw-r--r--wps/WPSLIST247
-rw-r--r--wps/rockbox_default.txt.wps2
-rw-r--r--wps/rockbox_failsafe.fms2
-rw-r--r--wps/rockbox_failsafe.sbs2
-rw-r--r--wps/rockbox_failsafe.wps2
-rwxr-xr-xwps/wpsbuild.pl724
12 files changed, 494 insertions, 563 deletions
diff --git a/apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x1.bmp b/apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x1.bmp
deleted file mode 100644
index d7d896608c..0000000000
--- a/apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x1.bmp
+++ /dev/null
Binary files differ
diff --git a/apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x2.bmp b/apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x2.bmp
deleted file mode 100644
index d7d896608c..0000000000
--- a/apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x2.bmp
+++ /dev/null
Binary files differ
diff --git a/apps/plugins/bitmaps/viewer_defaults/viewers.6x8x1.bmp b/icons/viewers.6x8x1.bmp
index d7d896608c..d7d896608c 100644
--- a/apps/plugins/bitmaps/viewer_defaults/viewers.6x8x1.bmp
+++ b/icons/viewers.6x8x1.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/viewer_defaults/viewers.6x8x16.bmp b/icons/viewers.6x8x16.bmp
index 9b039b1217..9b039b1217 100644
--- a/apps/plugins/bitmaps/viewer_defaults/viewers.6x8x16.bmp
+++ b/icons/viewers.6x8x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/viewer_defaults/viewers.6x8x2.bmp b/icons/viewers.6x8x2.bmp
index d7d896608c..d7d896608c 100644
--- a/apps/plugins/bitmaps/viewer_defaults/viewers.6x8x2.bmp
+++ b/icons/viewers.6x8x2.bmp
Binary files differ
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 70445570f8..56bbe6de1a 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -333,57 +333,6 @@ sub filesize {
333 return $size; 333 return $size;
334} 334}
335 335
336sub create_failsafefiles {
337 my ($dir, $remote_depth) = @_;
338 my $text = "# Dummy file to allow Rockbox to reset to the default skin config.
339# Do not edit this file. It's never actually loaded by Rockbox.";
340 open (FOO, ">$dir/wps/rockbox_failsafe.wps");
341 print FOO $text;
342 close(FOO);
343 open (FOO, ">$dir/wps/rockbox_failsafe.sbs");
344 print FOO $text;
345 close(FOO);
346 open (FOO, ">$dir/wps/rockbox_failsafe.fms");
347 print FOO $text;
348 close(FOO);
349 if ($remote_depth) {
350 open (FOO, ">$dir/wps/rockbox_failsafe.rwps");
351 print FOO $text;
352 close(FOO);
353 open (FOO, ">$dir/wps/rockbox_failsafe.rsbs");
354 print FOO $text;
355 close(FOO);
356 open (FOO, ">$dir/wps/rockbox_failsafe.rfms");
357 print FOO $text;
358 close(FOO);
359 }
360 open (FOO, ">$dir/themes/rockbox_failsafe.cfg");
361 print FOO <<STOP
362# This config has been autogenerated to reload the failsafe setup
363wps: $dir/wps/rockbox_failsafe.wps
364sbs: $dir/wps/rockbox_failsafe.sbs
365fms: $dir/wps/rockbox_failsafe.fms
366STOP
367;
368 if ($remote_depth) {
369 print FOO <<STOP
370rwps: $dir/wps/rockbox_failsafe.rwps
371rsbs: $dir/wps/rockbox_failsafe.rsbs
372rfms: $dir/wps/rockbox_failsafe.rfms
373STOP
374;
375 }
376 print FOO <<STOP
377statusbar: top
378font: 08-Schumacher-Clean.fnt
379foreground color: 000000
380background color: B6C6E5
381selector type: bar (inverse)
382backdrop: -
383STOP
384;
385 close(FOO);
386}
387 336
388sub buildzip { 337sub buildzip {
389 my ($image, $fonts)=@_; 338 my ($image, $fonts)=@_;
@@ -454,24 +403,8 @@ sub buildzip {
454 } 403 }
455 404
456 glob_mkdir("$temp_dir/wps"); 405 glob_mkdir("$temp_dir/wps");
406 glob_mkdir("$temp_dir/icons");
457 glob_mkdir("$temp_dir/themes"); 407 glob_mkdir("$temp_dir/themes");
458 if ($bitmap) {
459 open(THEME, ">$temp_dir/themes/rockbox_default_icons.cfg");
460 print THEME <<STOP
461# this config file was auto-generated to make it
462# easy to reset the icons back to default
463iconset: -
464# taken from apps/gui/icon.c
465viewers iconset: /$rbdir/icons/viewers.bmp
466remote iconset: -
467# taken from apps/gui/icon.c
468remote viewers iconset: /$rbdir/icons/remote_viewers.bmp
469
470STOP
471;
472 close(THEME);
473 }
474
475 glob_mkdir("$temp_dir/codepages"); 408 glob_mkdir("$temp_dir/codepages");
476 409
477 if($bitmap) { 410 if($bitmap) {
@@ -576,14 +509,6 @@ STOP
576 509
577 glob_unlink("$temp_dir/rocks/*.lua"); # Clean up unwanted *.lua files (e.g. actions.lua, buttons.lua) 510 glob_unlink("$temp_dir/rocks/*.lua"); # Clean up unwanted *.lua files (e.g. actions.lua, buttons.lua)
578 511
579 if ($bitmap) {
580 glob_mkdir("$temp_dir/icons");
581 copy("$viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp", "$temp_dir/icons/viewers.bmp");
582 if ($remote_depth) {
583 copy("$viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp", "$temp_dir/icons/remote_viewers.bmp");
584 }
585 }
586
587 copy("$ROOT/apps/tagnavi.config", "$temp_dir/"); 512 copy("$ROOT/apps/tagnavi.config", "$temp_dir/");
588 copy("$ROOT/apps/plugins/disktidy.config", "$temp_dir/rocks/apps/"); 513 copy("$ROOT/apps/plugins/disktidy.config", "$temp_dir/rocks/apps/");
589 514
@@ -606,7 +531,6 @@ STOP
606 "$temp_dir/rocks/demos/pictureflow_splash.bmp"); 531 "$temp_dir/rocks/demos/pictureflow_splash.bmp");
607 532
608 } 533 }
609 create_failsafefiles($temp_dir, $remote_depth);
610 534
611 if($image) { 535 if($image) {
612 # image is blank when this is a simulator 536 # image is blank when this is a simulator
diff --git a/wps/WPSLIST b/wps/WPSLIST
index 2d08392945..34f6cbdd46 100644
--- a/wps/WPSLIST
+++ b/wps/WPSLIST
@@ -11,7 +11,7 @@
11# This should list all WPS and RWPS files we have and what their requirements 11# This should list all WPS and RWPS files we have and what their requirements
12# and preferences are. 12# and preferences are.
13# 13#
14# Each <wps> section will also cause a "theme" .cfg to be made, which the 14# Each <theme> section will also cause a "theme" .cfg to be made, which the
15# <rwps> sections will not cause. 15# <rwps> sections will not cause.
16# 16#
17# A <wps> section can thus mention a "preferred" rwps file to load when that 17# A <wps> section can thus mention a "preferred" rwps file to load when that
@@ -19,21 +19,80 @@
19# 19#
20# All sections should list what font and status bar setting they "like". 20# All sections should list what font and status bar setting they "like".
21 21
22<theme>
23Name: rockbox_default_icons
24Author: Rockbox team
25
26<main>
27iconset: -
28viewers iconset..+x16: icons/viewers.6x8x16.bmp
29viewers iconset..+x1: icons/viewers.6x8x1.bmp
30viewers iconset..+x2: icons/viewers.6x8x2.bmp
31</main>
32
33<remote>
34iconset: -
35viewers iconset..+x1: icons/viewers.6x8x1.bmp
36viewers iconset..+x2: icons/viewers.6x8x2.bmp
37</remote>
38
39</theme>
22 40
23<rwps> 41<theme>
24Name: rockbox_default.rwps 42Name: rockbox_failsafe
25Author: Rockbox team 43Author: Rockbox team
26Font: 08-Schumacher-Clean.fnt 44
27Statusbar: top 45WPS: yes
28</rwps> 46RWPS: yes
29 47SBS: yes
30<wps> 48RSBS: yes
31Name: cabbiev2.wps 49FMS: yes
32RWPS: cabbiev2.rwps 50RFMS: yes
33SBS: 51
34RSBS: 52<main>
53backdrop: -
54font: -
55statusbar: top
56foreground color: 000000
57background color: B6C6E5
58selector type: bar (inverse)
59ui viewport: -
60</main>
61
62<remote>
63font: -
64statusbar: top
65ui viewport: -
66</remote>
67</theme>
68
69<theme>
70Name: cabbiev2
35# Real name of the creator of the WPS 71# Real name of the creator of the WPS
36Author: Johannes Voggenthaler, Apoo Maha, Marc Guay, Alex Vanderpol, Jerry Lange, Keith Perri, Mark Fawcus, and Marianne Arnold with support from Rockbox developers and forums. Based on Cabbie by Yohann Misquitta. 72Authors: Johannes Voggenthaler, Apoo Maha, Marc Guay, Alex Vanderpol, Jerry Lange, Keith Perri, Mark Fawcus, and Marianne Arnold with support from Rockbox developers and forums. Based on Cabbie by Yohann Misquitta.
73WPS: yes
74RWPS: yes
75SBS: no
76RSBS: no
77
78<main>
79
80# override implicit .wps filename
81wps.800x480x16: cabbiev2.800x480x16.wps
82wps.480x800x16: cabbiev2.480x800x16.wps
83wps.320x480x16: cabbiev2.320x480x16.wps
84wps.320x240x16: cabbiev2.320x240x16.wps
85wps.128x128x16: cabbiev2.128x128x16.wps
86wps.128x160x16: cabbiev2.128x160x16.wps
87wps.132x80x16: cabbiev2.132x80x16.wps
88wps.138x110x2: cabbiev2.138x110x2.wps
89wps.160x128x16: cabbiev2.160x128x16.wps
90wps.160x128x2: cabbiev2.160x128x2.wps
91wps.176x132x16: cabbiev2.176x132x16.wps
92wps.176x220x16: cabbiev2.176x220x16.wps
93wps.220x176x16: cabbiev2.220x176x16.wps
94wps.240x320x16: cabbiev2.240x320x16.wps
95wps.240x400x16: cabbiev2.240x400x16.wps
37 96
38# Preferred font (including .fnt extension - leave blank for player): 97# Preferred font (including .fnt extension - leave blank for player):
39Font.800x480x16: 35-Adobe-Helvetica.fnt 98Font.800x480x16: 35-Adobe-Helvetica.fnt
@@ -46,19 +105,16 @@ Font.220x176x16: 12-Adobe-Helvetica.fnt
46Font.176x220x16: 12-Adobe-Helvetica.fnt 105Font.176x220x16: 12-Adobe-Helvetica.fnt
47Font.176x132x16: 12-Adobe-Helvetica.fnt 106Font.176x132x16: 12-Adobe-Helvetica.fnt
48Font.160x128x16: 12-Adobe-Helvetica.fnt 107Font.160x128x16: 12-Adobe-Helvetica.fnt
49Font.160x128x2: 12-Adobe-Helvetica.fnt 108Font.160x128x2: 12-Adobe-Helvetica.fnt
50Font.160x128x1: 12-Adobe-Helvetica.fnt 109Font.160x128x1: 12-Adobe-Helvetica.fnt
51Font.138x110x2: 12-Adobe-Helvetica.fnt 110Font.138x110x2: 12-Adobe-Helvetica.fnt
52Font.128x128x16: 12-Adobe-Helvetica.fnt 111Font.128x128x16: 12-Adobe-Helvetica.fnt
53Font.128x160x16: 12-Adobe-Helvetica.fnt 112Font.128x160x16: 12-Adobe-Helvetica.fnt
54Font.128x128x2: 12-Adobe-Helvetica.fnt 113Font.128x128x2: 12-Adobe-Helvetica.fnt
55Font.132x80x16: 11-Sazanami-Mincho.fnt 114Font.132x80x16: 11-Sazanami-Mincho.fnt
56Font.128x64x1: 08-Rockfont.fnt 115Font.128x64x1: 08-Rockfont.fnt
57Font.112x64x1: 08-Rockfont.fnt 116Font.112x64x1: 08-Rockfont.fnt
58Font.96x96x16: 08-Rockfont.fnt 117Font.96x96x16: 08-Rockfont.fnt
59
60# Remote font for iriver
61Remote Font.128x64x1: 08-Rockfont.fnt
62 118
63#misc settings that should be ignored on grayscale targets 119#misc settings that should be ignored on grayscale targets
64foreground color: CCCCCC 120foreground color: CCCCCC
@@ -66,92 +122,73 @@ background color: 000000
66line selector start color: fde89e 122line selector start color: fde89e
67line selector end color: b58c00 123line selector end color: b58c00
68line selector text color: 000000 124line selector text color: 000000
69filetype colours: 125filetype colours: -
70 126
71#backdrop - remember this is the source file name in your SVN folder, not dest name! 127#backdrop - remember this is the source file name in your SVN folder, not dest name!
72backdrop.800x480x16: backdrops/cabbiev2.800x480x16.bmp 128backdrop.800x480x16: backdrops/cabbiev2.800x480x16.bmp
73backdrop.480x800x16: backdrops/cabbiev2.480x800x16.bmp 129backdrop.480x800x16: backdrops/cabbiev2.480x800x16.bmp
74backdrop.320x480x16: backdrops/cabbiev2.320x480x16.bmp 130backdrop.320x480x16: backdrops/cabbiev2.320x480x16.bmp
75backdrop.320x240x16: backdrops/cabbiev2.320x240x16.bmp 131backdrop.320x240x16: backdrops/cabbiev2.320x240x16.bmp
76backdrop.128x128x16: backdrops/cabbiev2.128x128x16.bmp 132backdrop.128x128x16: backdrops/cabbiev2.128x128x16.bmp
77backdrop.128x160x16: backdrops/cabbiev2.128x160x16.bmp 133backdrop.128x160x16: backdrops/cabbiev2.128x160x16.bmp
78backdrop.132x80x16: backdrops/cabbiev2.132x80x16.bmp 134backdrop.132x80x16: backdrops/cabbiev2.132x80x16.bmp
79backdrop.138x110x2: backdrops/cabbiev2.138x110x2.bmp 135backdrop.138x110x2: backdrops/cabbiev2.138x110x2.bmp
80backdrop.160x128x16: backdrops/cabbiev2.160x128x16.bmp 136backdrop.160x128x16: backdrops/cabbiev2.160x128x16.bmp
81backdrop.160x128x2: backdrops/cabbiev2.160x128x2.bmp 137backdrop.160x128x2: backdrops/cabbiev2.160x128x2.bmp
82backdrop.176x132x16: backdrops/cabbiev2.176x132x16.bmp 138backdrop.176x132x16: backdrops/cabbiev2.176x132x16.bmp
83backdrop.176x220x16: backdrops/cabbiev2.176x220x16.bmp 139backdrop.176x220x16: backdrops/cabbiev2.176x220x16.bmp
84backdrop.220x176x16: backdrops/cabbiev2.220x176x16.bmp 140backdrop.220x176x16: backdrops/cabbiev2.220x176x16.bmp
85backdrop.240x320x16: backdrops/cabbiev2.240x320x16.bmp 141backdrop.240x320x16: backdrops/cabbiev2.240x320x16.bmp
86backdrop.240x400x16: backdrops/cabbiev2.240x400x16.bmp 142backdrop.240x400x16: backdrops/cabbiev2.240x400x16.bmp
87backdrop.96x96x16: backdrops/cabbiev2.96x96x16.bmp 143backdrop.96x96x16: backdrops/cabbiev2.96x96x16.bmp
88 144
89#selection bar settings for color targets 145#selection bar settings for color targets
90selector type.800x480x16: bar (gradient) 146selector type..+x16: bar (gradient)
91selector type.480x800x16: bar (gradient) 147selector type..+x2: bar (inverse)
92selector type.320x480x16: bar (gradient)
93selector type.320x240x16: bar (gradient)
94selector type.128x128x16: bar (gradient)
95selector type.128x160x16: bar (gradient)
96selector type.132x80x16: bar (gradient)
97selector type.220x176x16: bar (gradient)
98selector type.160x128x16: bar (gradient)
99selector type.240x400x16: bar (gradient)
100selector type.240x320x16: bar (gradient)
101selector type.176x132x16: bar (gradient)
102selector type.176x220x16: bar (gradient)
103selector type.160x128x2: bar (inverse)
104selector type.138x110x2: bar (inverse)
105selector type.96x96x16: bar (gradient)
106 148
107#icons 149#icons
108iconset.800x480x16: icons/tango_icons.32x32.bmp 150iconset.800x480x16: icons/tango_icons.32x32.bmp
109iconset.480x800x16: icons/tango_icons.32x32.bmp 151iconset.480x800x16: icons/tango_icons.32x32.bmp
110iconset.320x480x16: icons/tango_icons.24x24.bmp 152iconset.320x480x16: icons/tango_icons.24x24.bmp
111iconset.320x240x16: icons/tango_icons.16x16.bmp 153iconset.320x240x16: icons/tango_icons.16x16.bmp
112iconset.128x128x16: icons/tango_icons.12x12.bmp 154iconset.128x128x16: icons/tango_icons.12x12.bmp
113iconset.128x160x16: icons/tango_icons.12x12.bmp 155iconset.128x160x16: icons/tango_icons.12x12.bmp
114iconset.132x80x16: icons/tango_icons.12x12.bmp 156iconset.132x80x16: icons/tango_icons.12x12.bmp
115iconset.138x110x2: icons/tango_small_mono.bmp 157iconset.160x128x16: icons/tango_icons.12x12.bmp
116iconset.160x128x16: icons/tango_icons.12x12.bmp 158iconset.176x132x16: icons/tango_icons.12x12.bmp
117iconset.160x128x2: icons/tango_small_mono.bmp 159iconset.176x220x16: icons/tango_icons.12x12.bmp
118iconset.176x132x16: icons/tango_icons.12x12.bmp 160iconset.220x176x16: icons/tango_icons.12x12.bmp
119iconset.176x220x16: icons/tango_icons.12x12.bmp 161iconset.240x320x16: icons/tango_icons.16x16.bmp
120iconset.220x176x16: icons/tango_icons.12x12.bmp 162iconset.240x400x16: icons/tango_icons.16x16.bmp
121iconset.240x320x16: icons/tango_icons.16x16.bmp 163iconset.96x96x16: icons/tango_icons.8x8.bmp
122iconset.240x400x16: icons/tango_icons.16x16.bmp 164iconset..+x2: icons/tango_small_mono.bmp
123iconset.96x96x16: icons/tango_icons.8x8.bmp
124 165
125#viewer icons 166#viewer icons
126viewers iconset.800x480x16: icons/tango_icons_viewers.32x32.bmp 167viewers iconset.800x480x16: icons/tango_icons_viewers.32x32.bmp
127viewers iconset.480x800x16: icons/tango_icons_viewers.32x32.bmp 168viewers iconset.480x800x16: icons/tango_icons_viewers.32x32.bmp
128viewers iconset.320x480x16: icons/tango_icons_viewers.24x24.bmp 169viewers iconset.320x480x16: icons/tango_icons_viewers.24x24.bmp
129viewers iconset.320x240x16: icons/tango_icons_viewers.16x16.bmp 170viewers iconset.320x240x16: icons/tango_icons_viewers.16x16.bmp
130viewers iconset.128x128x16: icons/tango_icons_viewers.12x12.bmp 171viewers iconset.128x128x16: icons/tango_icons_viewers.12x12.bmp
131viewers iconset.128x160x16: icons/tango_icons_viewers.12x12.bmp 172viewers iconset.128x160x16: icons/tango_icons_viewers.12x12.bmp
132viewers iconset.132x80x16: icons/tango_icons_viewers.12x12.bmp 173viewers iconset.132x80x16: icons/tango_icons_viewers.12x12.bmp
133viewers iconset.138x110x2: icons/tango_small_viewers_mono.bmp 174viewers iconset.160x128x16: icons/tango_icons_viewers.12x12.bmp
134viewers iconset.160x128x16: icons/tango_icons_viewers.12x12.bmp 175viewers iconset.176x132x16: icons/tango_icons_viewers.12x12.bmp
135viewers iconset.160x128x2: icons/tango_small_viewers_mono.bmp 176viewers iconset.176x220x16: icons/tango_icons_viewers.12x12.bmp
136viewers iconset.176x132x16: icons/tango_icons_viewers.12x12.bmp 177viewers iconset.220x176x16: icons/tango_icons_viewers.12x12.bmp
137viewers iconset.176x220x16: icons/tango_icons_viewers.12x12.bmp 178viewers iconset.240x320x16: icons/tango_icons_viewers.16x16.bmp
138viewers iconset.220x176x16: icons/tango_icons_viewers.12x12.bmp 179viewers iconset.240x400x16: icons/tango_icons_viewers.16x16.bmp
139viewers iconset.240x320x16: icons/tango_icons_viewers.16x16.bmp 180viewers iconset.96x96x16: icons/tango_icons_viewers.8x8.bmp
140viewers iconset.240x400x16: icons/tango_icons_viewers.16x16.bmp 181viewers iconset..+x2: icons/tango_small_viewers_mono.bmp
141viewers iconset.96x96x16: icons/tango_icons_viewers.8x8.bmp 182
142 183statusbar: top
143# Whether the WPS is designed to have the statusbar on or off 184ui viewport: -
144Statusbar: top 185</main>
145remote statusbar: top 186
146 187<remote>
147# list & remote ui viewports 188rwps.128x64x1: cabbiev2.128x64x1.wps
148ui viewport: 189Font.128x64x1: 08-Rockfont.fnt
149remote ui viewport: 190statusbar: top
150</wps> 191ui viewport: -
151 192</remote>
152<rwps> 193
153Name: cabbiev2.rwps 194</theme>
154Author: Johannes Voggenthaler, Apoo Maha, Marc Guay, Alex Vanderpol, Jerry Lange, Keith Perri, Mark Fawcus, and Marianne Arnold with support from Rockbox developers and forums. Based on Cabbie by Yohann Misquitta.
155Font: 12-Adobe-Helvetica.fnt
156Statusbar: top
157</rwps>
diff --git a/wps/rockbox_default.txt.wps b/wps/rockbox_default.txt.wps
deleted file mode 100644
index b1427cab84..0000000000
--- a/wps/rockbox_default.txt.wps
+++ /dev/null
@@ -1,2 +0,0 @@
1# Dummy file to allow Rockbox to reset to the default WPS config.
2# Do not edit this file. It's never actually loaded by Rockbox.
diff --git a/wps/rockbox_failsafe.fms b/wps/rockbox_failsafe.fms
new file mode 100644
index 0000000000..41691158d0
--- /dev/null
+++ b/wps/rockbox_failsafe.fms
@@ -0,0 +1,2 @@
1# Dummy file to allow Rockbox to reset to the default skin config.
2# Do not edit this file. It's never actually loaded by Rockbox.
diff --git a/wps/rockbox_failsafe.sbs b/wps/rockbox_failsafe.sbs
new file mode 100644
index 0000000000..41691158d0
--- /dev/null
+++ b/wps/rockbox_failsafe.sbs
@@ -0,0 +1,2 @@
1# Dummy file to allow Rockbox to reset to the default skin config.
2# Do not edit this file. It's never actually loaded by Rockbox.
diff --git a/wps/rockbox_failsafe.wps b/wps/rockbox_failsafe.wps
new file mode 100644
index 0000000000..41691158d0
--- /dev/null
+++ b/wps/rockbox_failsafe.wps
@@ -0,0 +1,2 @@
1# Dummy file to allow Rockbox to reset to the default skin config.
2# Do not edit this file. It's never actually loaded by Rockbox.
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl
index e516c3d444..873331318a 100755
--- a/wps/wpsbuild.pl
+++ b/wps/wpsbuild.pl
@@ -12,6 +12,7 @@ use strict;
12use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DTYPE_STUFF 12use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DTYPE_STUFF
13 13
14my $ROOT=".."; 14my $ROOT="..";
15my $wpsdir;
15my $verbose; 16my $verbose;
16my $rbdir=".rockbox"; 17my $rbdir=".rockbox";
17my $tempdir=".rockbox"; 18my $tempdir=".rockbox";
@@ -31,21 +32,22 @@ GetOptions ( 'r|root=s' => \$ROOT,
31 32
32my $firmdir="$ROOT/firmware"; 33my $firmdir="$ROOT/firmware";
33my $cppdef = $target; 34my $cppdef = $target;
34my @depthlist = ( 16, 8, 4, 2, 1 );
35 35
36# These parameters are filled in as we parse wpslist 36# These parameters are filled in as we parse wpslist
37my $req_size;
38my $req_g_wps;
39my $req_t; 37my $req_t;
40my $req_t_wps; 38my $theme;
39my $has_wps;
41my $wps; 40my $wps;
42my $wps_prefix; 41my $has_rwps;
43my $sbs_prefix;
44my $rwps; 42my $rwps;
43my $has_sbs;
45my $sbs; 44my $sbs;
46my $sbs_w_size; 45my $has_rsbs;
47my $rsbs; 46my $rsbs;
48my $rsbs_w_size; 47my $has_fms;
48my $fms;
49my $has_rfms;
50my $rfms;
49my $width; 51my $width;
50my $height; 52my $height;
51my $font; 53my $font;
@@ -53,13 +55,16 @@ my $remotefont;
53my $fgcolor; 55my $fgcolor;
54my $bgcolor; 56my $bgcolor;
55my $statusbar; 57my $statusbar;
58my $remotestatusbar;
56my $author; 59my $author;
57my $backdrop; 60my $backdrop;
58my $lineselectstart; 61my $lineselectstart;
59my $lineselectend; 62my $lineselectend;
60my $selecttype; 63my $selecttype;
61my $iconset; 64my $iconset;
65my $remoteiconset;
62my $viewericon; 66my $viewericon;
67my $remoteviewericon;
63my $lineselecttextcolor; 68my $lineselecttextcolor;
64my $filetylecolor; 69my $filetylecolor;
65my $listviewport; 70my $listviewport;
@@ -135,28 +140,33 @@ STOP
135 140
136sub mkdirs 141sub mkdirs
137{ 142{
138 my $wpsdir = $wps;
139 $wpsdir =~ s/\.(r|)wps//;
140 mkdir "$tempdir/wps", 0777; 143 mkdir "$tempdir/wps", 0777;
141 mkdir "$tempdir/themes", 0777; 144 mkdir "$tempdir/themes", 0777;
145 mkdir "$tempdir/icons", 0777;
142 146
143 if( -d "$tempdir/wps/$wpsdir") { 147 if( -d "$tempdir/wps/$theme") {
144 #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; 148 #print STDERR "wpsbuild warning: directory wps/$theme already exists!\n";
145 } 149 }
146 else 150 else
147 { 151 {
148 mkdir "$tempdir/wps/$wpsdir", 0777; 152 mkdir "$tempdir/wps/$theme", 0777;
149 } 153 }
150} 154}
151 155
156sub normalize
157{
158 my $in = $_[0];
159 # strip resolution
160 $in =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//;
161 return $in;
162}
163
152sub copybackdrop 164sub copybackdrop
153{ 165{
154 #copy the backdrop file into the build dir 166 #copy the backdrop file into the build dir
155 if ($backdrop ne '') { 167 if ($backdrop ne '') {
156 my $dst = $backdrop; 168 my $dst = normalize($backdrop);
157 $dst =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; 169 system("cp $ROOT/$backdrop $tempdir/$dst");
158 my $cmd = "cp $ROOT/$backdrop $tempdir/$dst";
159 `$cmd`;
160 } 170 }
161} 171}
162 172
@@ -167,31 +177,30 @@ sub copythemefont
167 177
168 $o =~ s/\.fnt/\.bdf/; 178 $o =~ s/\.fnt/\.bdf/;
169 mkdir "$tempdir/fonts"; 179 mkdir "$tempdir/fonts";
170 my $cmd ="$ROOT/tools/convbdf -f -o \"$tempdir/fonts/$_[0]\" \"$ROOT/fonts/$o\" "; 180 system("$ROOT/tools/convbdf -f -o \"$tempdir/fonts/$_[0]\" \"$ROOT/fonts/$o\" ");
171 `$cmd`;
172} 181}
173 182
174sub copythemeicon 183sub copythemeicon
175{ 184{
185 my $i = $_[0];
176 #copy the icon specified by the theme 186 #copy the icon specified by the theme
177 if ($iconset ne '') { 187 if ($i ne "-") {
178 my $tempicon = $tempdir . "/" . $iconset; 188 my $tempicon = $tempdir . "/" . $i;
179 $iconset = $rbdir . "/" . $iconset;
180 $tempicon =~ /\/.*icons\/(.*)/i; 189 $tempicon =~ /\/.*icons\/(.*)/i;
181 `cp $ROOT/icons/$1 $tempicon`; 190 system("cp $ROOT/icons/$1 $tempicon");
182 } 191 }
183} 192}
184 193
185sub copythemeviewericon 194sub uniq {
186{ 195 my %seen = ();
187 #copy the viewer icon specified by the theme 196 my @r = ();
188 197 foreach my $a (@_) {
189 if ($viewericon ne '') { 198 unless ($seen{$a}) {
190 my $tempviewericon = $tempdir . "/" . $viewericon; 199 push @r, $a;
191 $viewericon = $rbdir . "/" . $viewericon; 200 $seen{$a} = 1;
192 $tempviewericon =~ /\/.*icons\/(.*)/i; 201 }
193 `cp $ROOT/icons/$1 $tempviewericon`;
194 } 202 }
203 return @r;
195} 204}
196 205
197sub copywps 206sub copywps
@@ -199,181 +208,104 @@ sub copywps
199 # we assume that we copy the WPS files from the same dir the WPSLIST 208 # we assume that we copy the WPS files from the same dir the WPSLIST
200 # file is located in 209 # file is located in
201 my $dir; 210 my $dir;
211 my %skinfiles = ("wps", $wps,
212 "sbs", $sbs,
213 "fms", $fms,
214 "rwps", $rwps,
215 "rsbs", $rsbs,
216 "rfms", $rfms);
202 my @filelist; 217 my @filelist;
203 my $file; 218 my $file;
204 my $__sb;
205 219
206 if($wpslist =~ /(.*)WPSLIST/) { 220 if($wpslist =~ /(.*)\/WPSLIST/) {
207 $dir = $1; 221 $dir = $1;
208 $__sb = $sbs_prefix . "." . $req_size . ".sbs"; 222
209 #print "$req_t_wps $req_g_wps $sbs_prefix\n"; 223 # copy fully-fledged wps, sbs, etc. including graphics
210 #print "$dir/$__sb\n"; 224 foreach my $ext (keys %skinfiles) {
211 225 next unless ($skinfiles{$ext});
212# system("cp $dir/$wps .rockbox/wps/"); 226 $file = $skinfiles{$ext};
213 # check for <name>.WIDTHxHEIGHTxDEPTH.sbs 227 system("cp $dir/$file $tempdir/wps/$theme.$ext");
214 if (-e "$dir/$__sb") { 228 open(SKIN, "$dir/$file");
215 system("cp $dir/$__sb $tempdir/wps/$sbs"); 229 while (<SKIN>) {
230 $filelist[$#filelist + 1] = $1 if (/[\(,]([^,]*?.bmp)[\),]/);
231 }
232 close(SKIN);
216 } 233 }
217 # check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sbs and overwrite the 234
218 # previous sb if needed 235 if ($#filelist >= 0) {
219 $__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs"; 236 if (-e "$dir/$theme") {
220 if (-e "$dir/$__sb") { 237 foreach $file (uniq(@filelist)) {
221 system("cp $dir/$__sb $tempdir/wps/$sbs"); 238 system("cp $dir/$theme/$file $tempdir/wps/$theme/");
239 }
240 }
241 else {
242 print STDERR "beep, no dir to copy WPS from!\n";
243 }
222 } 244 }
223
224 if (-e "$dir/$req_t_wps" ) {
225 system("cp $dir/$req_t_wps $tempdir/wps/$wps");
226
227 } elsif (-e "$dir/$req_g_wps") {
228 system("cp $dir/$req_g_wps $tempdir/wps/$wps");
229
230 open(WPSFILE, "$dir/$req_g_wps");
231 while (<WPSFILE>) {
232 $filelist[$#filelist + 1] = $1 if (/[\(,]([^,]*?.bmp)[\),]/);
233 }
234 close(WPSFILE);
235
236 if ($#filelist >= 0) {
237 if (-e "$dir/$wps_prefix/$req_size") {
238 foreach $file (@filelist) {
239 system("cp $dir/$wps_prefix/$req_size/$file $tempdir/wps/$wps_prefix/");
240 }
241 }
242 elsif (-e "$dir/$wps_prefix") {
243 foreach $file (@filelist) {
244 system("cp $dir/$wps_prefix/$file $tempdir/wps/$wps_prefix/");
245 }
246 }
247 else {
248 print STDERR "beep, no dir to copy WPS from!\n";
249 }
250 }
251
252 } else {
253 print STDERR "Skipping $wps - no matching resolution.\n";
254 }
255 } else { 245 } else {
256 print STDERR "No source directory!\n"; 246 print STDERR "No source directory!\n";
257 } 247 }
258} 248}
259 249
260sub buildcfg { 250sub buildcfg {
261 my $cfg = $wps; 251 my $cfg = $theme . ".cfg";
262 my @out; 252 my @out;
263
264 $cfg =~ s/\.(r|)wps/.cfg/;
265 253
266 push @out, <<MOO 254 push @out, <<MOO
267\# 255\#
268\# $cfg generated by wpsbuild.pl 256\# $cfg generated by wpsbuild.pl
269\# $wps is made by $author 257\# $wps is made by $author
270\# 258\#
271wps: $rbdir/wps/$wps
272MOO 259MOO
273; 260;
274 if(defined($sbs)) { 261
275 if ($sbs eq '') { 262 my %skinfiles = ("wps" => $wps,
276 push @out, "sbs: -\n"; 263 "sbs" => $sbs,
277 } else { 264 "fms" => $fms,
278 push @out, "sbs: $rbdir/wps/$sbs\n"; 265 "rwps" => $rwps,
279 } 266 "rsbs" => $rsbs,
280 } 267 "rfms" => $rfms);
281 if(defined($rsbs) && $has_remote) { 268 for my $skin (keys %skinfiles) {
282 if ($rsbs eq '') { 269 my $val = $skinfiles{$skin};
283 push @out, "rsbs: -\n"; 270 print "$skin: $val\n";
284 } else { 271 if (!defined($val)) {
285 push @out, "rsbs: $rbdir/wps/$rsbs\n"; 272 # dont put value if not defined (e.g. rwps when there's no remote)
286 } 273 next;
287 } 274 } elsif ($val eq '') {
288 if($font) { 275 # empty resets to built-in
289 if ($font eq '') { 276 push @out, "$skin: -\n";
290 push @out, "font: -\n";
291 } else {
292 push @out, "font: $rbdir/fonts/$font\n";
293 }
294 }
295 if(defined($remotefont) && $has_remote) {
296 if ($remotefont eq '') {
297 push @out, "remote font: -\n";
298 } else {
299 push @out, "remote font: $rbdir/fonts/$remotefont\n";
300 }
301 }
302 if($fgcolor && $main_depth > 2) {
303 push @out, "foreground color: $fgcolor\n";
304 }
305 if($bgcolor && $main_depth > 2) {
306 push @out, "background color: $bgcolor\n";
307 }
308 if($statusbar) {
309 if($rwps && $has_remote ) {
310 push @out, "remote statusbar: $statusbar\n";
311 }
312 push @out, "statusbar: $statusbar\n";
313 }
314 if(defined($backdrop)) {
315 if ($backdrop eq '') {
316 push @out, "backdrop: -\n";
317 } else {
318 # clip resolution from filename
319 $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//;
320 push @out, "backdrop: $rbdir/$backdrop\n";
321 }
322 }
323 if($lineselectstart && $main_depth > 2) {
324 push @out, "line selector start color: $lineselectstart\n";
325 }
326 if($lineselectend && $main_depth > 2) {
327 push @out, "line selector end color: $lineselectend\n";
328 }
329 if($selecttype) {
330 push @out, "selector type: $selecttype\n";
331 }
332 if(defined($iconset)) {
333 if ($iconset eq '') {
334 push @out, "iconset: -\n";
335 } else {
336 push @out, "iconset: $iconset\n";
337 }
338 }
339 if(defined($viewericon)) {
340 if ($viewericon eq '') {
341 push @out, "viewers iconset: -\n";
342 } else {
343 push @out, "viewers iconset: $viewericon\n";
344 }
345 }
346 if($lineselecttextcolor && $main_depth > 2 ) {
347 push @out, "line selector text color: $lineselecttextcolor\n";
348 }
349 if($filetylecolor && $main_depth > 2) {
350 if ($filetylecolor eq '') {
351 push @out, "filetype colours: -\n";
352 } else {
353 push @out, "filetype colours: $filetylecolor\n";
354 }
355 }
356 if($rwps && $has_remote ) {
357 if ($rwps eq '') {
358 push @out, "rwps: -\n";
359 } else { 277 } else {
360 push @out, "rwps: $rbdir/wps/$rwps\n"; 278 # file name is always <theme>.{wps,rwps,...} (see copywps())
279 push @out, "$skin: $rbdir/wps/$theme.$skin\n";
361 } 280 }
362 } 281 }
363 if(defined($listviewport)) { 282
364 if ($listviewport eq '') { 283 push @out, "selector type: $selecttype\n" if (defined($selecttype));
365 push @out, "ui viewport: -\n"; 284 push @out, "backdrop: $backdrop\n" if (defined($backdrop));
366 } else { 285 push @out, "filetype colours: $filetylecolor\n" if (defined($filetylecolor));
367 push @out, "ui viewport: $listviewport\n"; 286
368 } 287 if ($main_depth > 2) {
288 push @out, "foreground color: $fgcolor\n" if($fgcolor);
289 push @out, "background color: $bgcolor\n" if($bgcolor);
290 push @out, "line selector start color: $lineselectstart\n" if($lineselectstart);
291 push @out, "line selector end color: $lineselectend\n" if($lineselectend);;
292 push @out, "line selector text color: $lineselecttextcolor\n" if($lineselecttextcolor);
369 } 293 }
370 if(defined($remotelistviewport) && $has_remote) { 294
371 if ($remotelistviewport eq '') { 295 push @out, "font: $font\n" if (defined($font));
372 push @out, "remote ui viewport: -\n"; 296 push @out, "statusbar: $statusbar\n" if (defined($statusbar));
373 } else { 297 push @out, "iconset: $iconset\n" if (defined($iconset));
374 push @out, "remote ui viewport: $listviewport\n"; 298 push @out, "viewers iconset: $viewericon\n" if (defined($viewericon));
375 } 299 push @out, "ui viewport: $listviewport\n" if (defined($listviewport));
300
301 if ($has_remote) {
302 push @out, "remote font: $remotefont\n" if (defined($remotefont));
303 push @out, "remote statusbar: $remotestatusbar\n" if (defined($remotestatusbar));
304 push @out, "remote iconset: $remoteiconset\n" if (defined($remoteiconset));
305 push @out, "remote viewers iconset: $remoteviewericon\n" if (defined($remoteviewericon));
306 push @out, "remote ui viewport: $remotelistviewport\n" if (defined($remotelistviewport));
376 } 307 }
308
377 if(-f "$tempdir/wps/$cfg") { 309 if(-f "$tempdir/wps/$cfg") {
378 print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; 310 print STDERR "wpsbuild warning: wps/$cfg already exists!\n";
379 } 311 }
@@ -391,8 +323,47 @@ MOO
391#print "LCD: ${main_width}x${main_height}x${main_depth}\n"; 323#print "LCD: ${main_width}x${main_height}x${main_depth}\n";
392$has_remote = 1 if ($remote_height && $remote_width && $remote_depth); 324$has_remote = 1 if ($remote_height && $remote_width && $remote_depth);
393 325
394my $isrwps; 326
395my $within; 327# check if line matches the setting string or if it contains a regex
328# that contains the targets resolution
329sub check_res {
330 my ($line, $string, $remote) = @_;
331 if ($line =~ /^${string}: *(.*)/i) {
332 return $1;
333 }
334 elsif($line =~ /^${string}.(.*): *(.*)/i) {
335 # $1 is a resolution regex, $2 the filename incl. resolution
336 my $fn = $2;
337 my $size_str = "${main_width}x${main_height}x${main_depth}";
338 if ($remote) {
339 $size_str = "${remote_width}x${remote_height}x${remote_depth}";
340 }
341 if ($size_str =~ /$1$/) {
342 return $fn;
343 }
344 }
345 return "";
346}
347
348# check if <theme>.<model>.<ext> exists. If not, check if <theme>.<ext> exists
349sub check_skinfile {
350 my $ext = $_[0];
351 my $req_skin = $theme . "." . $modelname . ".$ext";
352 if (-e "$wpsdir/$req_skin") {
353 return $req_skin;
354 } else {
355 $req_skin = $theme . ".$ext";
356 if (-e "$wpsdir/$req_skin") {
357 return $req_skin;
358 }
359 }
360 return '';
361}
362
363
364# Infer WPS (etc.) filename from the the if it wasnt given
365$wpslist =~ /(.*)WPSLIST/;
366$wpsdir = $1;
396 367
397open(WPS, "<$wpslist"); 368open(WPS, "<$wpslist");
398while(<WPS>) { 369while(<WPS>) {
@@ -410,15 +381,21 @@ while(<WPS>) {
410 $rbdir = "/" . $rbdir; 381 $rbdir = "/" . $rbdir;
411 } 382 }
412 383
413 if($l =~ /^ *<(r|)wps>/i) { 384 if($l =~ /^ *<theme>/i) {
414 $isrwps = $1;
415 $within = 1;
416 # undef is a unary operator (!) 385 # undef is a unary operator (!)
386 undef $theme;
387 undef $has_wps;
388 undef $has_rwps;
389 undef $has_sbs;
390 undef $has_rsbs;
391 undef $has_fms;
392 undef $has_rfms;
417 undef $wps; 393 undef $wps;
418 undef $wps_prefix;
419 undef $rwps; 394 undef $rwps;
420 undef $sbs; 395 undef $sbs;
421 undef $rsbs; 396 undef $rsbs;
397 undef $fms;
398 undef $rfms;
422 undef $width; 399 undef $width;
423 undef $height; 400 undef $height;
424 undef $font; 401 undef $font;
@@ -426,224 +403,213 @@ while(<WPS>) {
426 undef $fgcolor; 403 undef $fgcolor;
427 undef $bgcolor; 404 undef $bgcolor;
428 undef $statusbar; 405 undef $statusbar;
406 undef $remotestatusbar;
429 undef $author; 407 undef $author;
430 undef $req_g_wps;
431 undef $req_t_wps;
432 undef $backdrop; 408 undef $backdrop;
433 undef $lineselectstart; 409 undef $lineselectstart;
434 undef $lineselectend; 410 undef $lineselectend;
435 undef $selecttype; 411 undef $selecttype;
436 undef $iconset; 412 undef $iconset;
413 undef $remoteiconset;
437 undef $viewericon; 414 undef $viewericon;
415 undef $remoteviewericon;
438 undef $lineselecttextcolor; 416 undef $lineselecttextcolor;
439 undef $filetylecolor; 417 undef $filetylecolor;
440 undef $listviewport; 418 undef $listviewport;
441 undef $remotelistviewport; 419 undef $remotelistviewport;
442
443 next;
444 } 420 }
445 if($within) { 421 elsif($l =~ /^Name: *(.*)/i) {
446 if($l =~ /^ *<\/${isrwps}wps>/i) { 422 $theme = $1;
447 # Get the required width and height 423 }
448 my ($rheight, $rwidth, $rdepth); 424 elsif($l =~ /^Authors: *(.*)/i) {
449 if($isrwps) { 425 $author = $1;
450 ($rheight, $rwidth, $rdepth) = 426 }
451 ($remote_height, $remote_width, $remote_depth); 427 elsif ($l =~ /^WPS: *(yes|no)/i) {
428 $has_wps = $1;
429 }
430 elsif ($l =~ /^RWPS: *(yes|no)/i) {
431 $has_rwps = $1;
432 }
433 elsif ($l =~ /^SBS: *(yes|no)/i) {
434 $has_sbs = $1;
435 }
436 elsif ($l =~ /^RSBS: *(yes|no)/i) {
437 $has_rsbs = $1;
438 }
439 elsif ($l =~ /^FMS: *(yes|no)/i) {
440 $has_fms = $1;
441 }
442 elsif ($l =~ /^RFMS: *(yes|no)/i) {
443 $has_rfms = $1;
444 }
445 elsif($l =~ /^ *<main>/i) {
446 # parse main unit settings
447 while(<WPS>) {
448 my $l = $_;
449 if ($l =~ /^ *<\/main>/i) {
450 last;
452 } 451 }
453 else { 452 elsif($_ = check_res($l, "wps")) {
454 ($rheight, $rwidth, $rdepth) = 453 $wps = $_;
455 ($main_height, $main_width, $main_depth);
456 } 454 }
457 455 elsif($_ = check_res($l, "sbs")) {
458 if(!$rheight || !$rwidth) { 456 $sbs = $_;
459 #printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n",
460 #$isrwps?"remote ":"";
461 $within = 0;
462 next;
463 } 457 }
464 $wpslist =~ /(.*)WPSLIST/; 458 elsif($_ = check_res($l, "fms")) {
465 my $wpsdir = $1; 459 $fms = $_;
466 # If this WPS installable on this platform, one of the following
467 # two files will be present
468 foreach my $d (@depthlist) {
469 next if ($d > $rdepth);
470
471 $req_size = $rwidth . "x" . $rheight . "x" . $d;
472
473 # check for model specific wps
474 $req_g_wps = $wps_prefix . "." . $req_size . "." . $modelname . ".wps";
475 last if (-e "$wpsdir/$req_g_wps");
476
477 # check for normal wps (with WIDTHxHEIGHTxDEPTH)
478 $req_g_wps = $wps_prefix . "." . $req_size . ".wps";
479 last if (-e "$wpsdir/$req_g_wps");
480
481 if ($isrwps) {
482 $req_size = $req_size . "." . $main_width . "x" . $main_height . "x" . "$main_depth";
483
484 $req_g_wps = $wps_prefix . "." . $req_size . ".wps";
485 last if (-e "$wpsdir/$req_g_wps");
486 }
487 } 460 }
488 $req_t_wps = $wps_prefix . ".txt" . ".wps"; 461 elsif($_ = check_res($l, "Font")) {
489 462 $font = $_;
490 #print "LCD: $wps wants $width x $height\n";
491 #print "LCD: is $rwidth x $rheight\n";
492
493 #print "gwps: $wpsdir/$req_g_wps" . "\n";
494 if (-e "$wpsdir/$req_g_wps" || -e "$wpsdir/$req_t_wps" ) {
495 #
496 # The target model has an LCD that is suitable for this
497 # WPS
498 #
499 #print "Size requirement is fine!\n";
500 mkdirs() if (-e "$wpsdir/$req_g_wps");
501 # Do the copying before building the .cfg - buildcfg()
502 # mangles some filenames
503 if ($backdrop) {
504 copybackdrop();
505 }
506 if ($iconset) {
507 copythemeicon();
508 }
509 if ($viewericon) {
510 copythemeviewericon();
511 }
512 if ($font) {
513 copythemefont($font);
514 }
515 if ($remotefont) {
516 copythemefont($remotefont);
517 }
518 if(!$isrwps) {
519 # We only make .cfg files for <wps> sections:
520 buildcfg();
521 }
522 copywps();
523 } 463 }
524 else { 464 elsif($_ = check_res($l, "Statusbar")) {
525 #print "(${wps_prefix}-${rwidth}x${rheight}x$rdepth) "; 465 $statusbar = $_;
526 #print "Skip $wps due to size restraints\n"; 466 }
467 elsif($_ = check_res($l, "Backdrop")) {
468 $backdrop = $_;
469 }
470 elsif($l =~ /^Foreground Color: *(.*)/i) {
471 $fgcolor = $1;
472 }
473 elsif($l =~ /^Background Color: *(.*)/i) {
474 $bgcolor = $1;
475 }
476 elsif($l =~ /^line selector start color: *(.*)/i) {
477 $lineselectstart = $1;
478 }
479 elsif($l =~ /^line selector end color: *(.*)/i) {
480 $lineselectend = $1;
481 }
482 elsif($_ = check_res($l, "selector type")) {
483 $selecttype = $_;
484 }
485 elsif($_ = check_res($l, "iconset")) {
486 $iconset = $_;
487 }
488 elsif($_ = check_res($l, "viewers iconset")) {
489 $viewericon = $_;
490 }
491 elsif($l =~ /^line selector text color: *(.*)/i) {
492 $lineselecttextcolor = $1;
493 }
494 elsif($l =~ /^filetype colours: *(.*)/i) {
495 $filetylecolor = $1;
496 }
497 elsif($_ = check_res($l, "ui viewport")) {
498 $listviewport = $_;
527 } 499 }
528 $within = 0;
529 }
530 elsif($l =~ /^Name: *(.*)/i) {
531 # Note that in the case this is within <rwps>, $wps will contain the
532 # name of the rwps. Use $isrwps to figure out what type it is.
533 $wps = $wps_prefix = $1;
534 $wps_prefix =~ s/\.(r|)wps//;
535 #print $wps_prefix . "\n";
536 }
537 elsif($l =~ /^RWPS: *(.*)/i) {
538 $rwps = $1;
539 }
540 elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
541 $rwps = $1;
542 }
543 elsif($l =~ /^SBS: *(.*)/i) {
544 $sbs = $sbs_prefix = $1;
545 $sbs_prefix =~ s/\.(r|)sbs//;
546 }
547 elsif($l =~ /^SBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
548 $sbs = $sbs_prefix = $1;
549 $sbs_prefix =~ s/\.(r|)sbs//;
550 }
551 elsif($l =~ /^RSBS: *(.*)/i) {
552 $rsbs = $1;
553 }
554 elsif($l =~ /^RSBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
555 $rsbs = $1;
556 }
557 elsif($l =~ /^Author: *(.*)/i) {
558 $author = $1;
559 }
560 elsif($l =~ /^Width: *(.*)/i) {
561 $width = $1;
562 }
563 elsif($l =~ /^Width\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
564 $width = $1;
565 }
566 elsif($l =~ /^Height: *(.*)/i) {
567 $height = $1;
568 }
569 elsif($l =~ /^Height\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
570 $height = $1;
571 }
572 elsif($l =~ /^Font: *(.*)/i) {
573 $font = $1;
574 }
575 elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
576 $font = $1;
577 }
578 elsif($l =~ /^Remote Font\.${remote_width}x${remote_height}x$remote_depth: *(.*)/i) {
579 $remotefont = $1;
580 }
581 elsif($l =~ /^Remote Font: *(.*)/i) {
582 $remotefont = $1;
583 }
584 elsif($l =~ /^Foreground Color: *(.*)/i) {
585 $fgcolor = $1;
586 }
587 elsif($l =~ /^Background Color: *(.*)/i) {
588 $bgcolor = $1;
589 }
590 elsif($l =~ /^Statusbar: *(.*)/i) {
591 $statusbar = $1;
592 }
593 elsif($l =~ /^Statusbar\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
594 $statusbar = $1;
595 }
596 elsif($l =~ /^Backdrop: *(.*)/i) {
597 $backdrop = $1;
598 }
599 elsif($l =~ /^Backdrop\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
600 $backdrop = $1;
601 }
602 elsif($l =~ /^line selector start color: *(.*)/i) {
603 $lineselectstart = $1;
604 }
605 elsif($l =~ /^line selector end color: *(.*)/i) {
606 $lineselectend = $1;
607 }
608 elsif($l =~ /^selector type: *(.*)/i) {
609 $selecttype = $1;
610 }
611 elsif($l =~ /^selector type\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
612 $selecttype = $1;
613 }
614 elsif($l =~ /^iconset: *(.*)/i) {
615 $iconset = $1;
616 }
617 elsif($l =~ /^iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
618 $iconset = $1;
619 }
620 elsif($l =~ /^viewers iconset: *(.*)/i) {
621 $viewericon = $1;
622 } 500 }
623 elsif($l =~ /^viewers iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) { 501 }
624 $viewericon = $1; 502 elsif($l =~ /^ *<remote>/i) {
503 while(<WPS>) {
504 # parse remote settings
505 my $l = $_;
506 if ($l =~ /^ *<\/remote>/i) {
507 last;
508 }
509 elsif(!$has_remote) {
510 next; # dont parse <remote> section
511 }
512 elsif($_ = check_res($l, "rwps", 1)) {
513 $rwps = $_;
514 }
515 elsif($_ = check_res($l, "rsbs", 1)) {
516 $rsbs = $_;
517 }
518 elsif($_ = check_res($l, "rfms", 1)) {
519 $rfms = $_;
520 }
521 elsif($_ = check_res($l, "Font", 1)) {
522 $remotefont = $_;
523 }
524 elsif($_ = check_res($l, "iconset", 1)) {
525 $remoteiconset = $_;
526 }
527 elsif($_ = check_res($l, "viewers iconset", 1)) {
528 $remoteviewericon = $_;
529 }
530 elsif($_ = check_res($l, "statusbar", 1)) {
531 $remotestatusbar = $_;
532 }
533 elsif($_ = check_res($l, "ui viewport", 1)) {
534 $remotelistviewport = $_;
535 }
625 } 536 }
626 elsif($l =~ /^line selector text color: *(.*)/i) { 537 }
627 $lineselecttextcolor = $1; 538 elsif($l =~ /^ *<\/theme>/i) {
539 # for each wps,sbs,fms (+ remote variants) check if <theme>[.<model>].wps
540 # exists if no filename was specified in WPSLIST
541 my $req_skin;
542
543 if ($has_wps eq "yes" && !$wps) {
544 $wps = check_skinfile("wps");
545 } elsif ($has_wps eq "no") {
546 $wps = '';
628 } 547 }
629 elsif($l =~ /^filetype colours: *(.*)/i) { 548
630 $filetylecolor = $1; 549 if ($has_sbs eq "yes" && !$sbs) {
550 $sbs = check_skinfile("sbs");
551 } elsif ($has_sbs eq "no") {
552 $sbs = '';
631 } 553 }
632 elsif($l =~ /^ui viewport: *(.*)/i) { 554
633 $listviewport = $1; 555 if ($has_fms eq "yes" && !$fms) {
556 $fms = check_skinfile("fms");
557 } elsif ($has_fms eq "no") {
558 $fms = '';
634 } 559 }
635 elsif($l =~ /^ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) { 560
636 $listviewport = $1; 561 # now check for remote skin files (use main screen's extension)
562 if ($has_remote) {
563 if ($has_rwps eq "yes" && !$rwps) {
564 $rwps = check_skinfile("wps");
565 } elsif ($has_rwps eq "no") {
566 $rwps = '';
567 }
568
569 if ($has_rsbs eq "yes" && !$rsbs) {
570 $rsbs = check_skinfile("sbs");
571 } elsif ($has_rsbs eq "no") {
572 $rsbs = '';
573 }
574
575 if ($has_rfms eq "yes" && !$rfms) {
576 $rfms = check_skinfile("fms");
577 } elsif ($has_rfms eq "no") {
578 $rfms = '';
579 }
637 } 580 }
638 elsif($l =~ /^remote ui viewport: *(.*)/i) { 581 #print "LCD: $wps wants $width x $height\n";
639 $remotelistviewport = $1; 582
583 #
584 # The target model has an LCD that is suitable for this
585 # WPS
586 #
587 #print "Size requirement is fine!\n";
588 mkdirs() if (-e "$wpsdir/$theme");
589 # Do the copying before building the .cfg - buildcfg()
590 # mangles some filenames
591 if (defined($backdrop) && $backdrop ne "-") {
592 copybackdrop();
593 $backdrop = normalize($backdrop);
594 }
595 foreach my $i ($iconset, $viewericon, $remoteiconset, $remoteviewericon) {
596 if (defined($i) && $i ne "-") {
597 copythemeicon($i);
598 }
640 } 599 }
641 elsif($l =~ /^remote ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) { 600 if (defined($font) && $font ne "-") {
642 $remotelistviewport = $1; 601 copythemefont($font);
602 $font = "$rbdir/fonts/$font";
643 } 603 }
644 else{ 604 if (defined($remotefont) && $remotefont ne "-") {
645 #print "Unknown line: $l!\n"; 605 copythemefont($remotefont);
606 $remotefont = "$rbdir/fonts/$remotefont";
646 } 607 }
608 buildcfg();
609 copywps();
610 }
611 else{
612 #print "Unknown line: $l!\n";
647 } 613 }
648} 614}
649 615