diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-06-10 20:28:36 +0200 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-06-10 21:20:36 +0200 |
commit | 66b6fdbb73f90cbb58fe814cdecc58858b584e1e (patch) | |
tree | 6fa8dd17555b1daf05bd4c2fa51a1de921f57162 | |
parent | 300ff4c952d41fa49768b0e66e13f1354a83fa64 (diff) | |
download | rockbox-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.bmp | bin | 478 -> 0 bytes | |||
-rw-r--r-- | apps/plugins/bitmaps/viewer_defaults/remote_viewers.6x8x2.bmp | bin | 478 -> 0 bytes | |||
-rw-r--r-- | icons/viewers.6x8x1.bmp (renamed from apps/plugins/bitmaps/viewer_defaults/viewers.6x8x1.bmp) | bin | 478 -> 478 bytes | |||
-rw-r--r-- | icons/viewers.6x8x16.bmp (renamed from apps/plugins/bitmaps/viewer_defaults/viewers.6x8x16.bmp) | bin | 2134 -> 2134 bytes | |||
-rw-r--r-- | icons/viewers.6x8x2.bmp (renamed from apps/plugins/bitmaps/viewer_defaults/viewers.6x8x2.bmp) | bin | 478 -> 478 bytes | |||
-rwxr-xr-x | tools/buildzip.pl | 78 | ||||
-rw-r--r-- | wps/WPSLIST | 247 | ||||
-rw-r--r-- | wps/rockbox_default.txt.wps | 2 | ||||
-rw-r--r-- | wps/rockbox_failsafe.fms | 2 | ||||
-rw-r--r-- | wps/rockbox_failsafe.sbs | 2 | ||||
-rw-r--r-- | wps/rockbox_failsafe.wps | 2 | ||||
-rwxr-xr-x | wps/wpsbuild.pl | 724 |
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 | ||
336 | sub 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 | ||
363 | wps: $dir/wps/rockbox_failsafe.wps | ||
364 | sbs: $dir/wps/rockbox_failsafe.sbs | ||
365 | fms: $dir/wps/rockbox_failsafe.fms | ||
366 | STOP | ||
367 | ; | ||
368 | if ($remote_depth) { | ||
369 | print FOO <<STOP | ||
370 | rwps: $dir/wps/rockbox_failsafe.rwps | ||
371 | rsbs: $dir/wps/rockbox_failsafe.rsbs | ||
372 | rfms: $dir/wps/rockbox_failsafe.rfms | ||
373 | STOP | ||
374 | ; | ||
375 | } | ||
376 | print FOO <<STOP | ||
377 | statusbar: top | ||
378 | font: 08-Schumacher-Clean.fnt | ||
379 | foreground color: 000000 | ||
380 | background color: B6C6E5 | ||
381 | selector type: bar (inverse) | ||
382 | backdrop: - | ||
383 | STOP | ||
384 | ; | ||
385 | close(FOO); | ||
386 | } | ||
387 | 336 | ||
388 | sub buildzip { | 337 | sub 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 | ||
463 | iconset: - | ||
464 | # taken from apps/gui/icon.c | ||
465 | viewers iconset: /$rbdir/icons/viewers.bmp | ||
466 | remote iconset: - | ||
467 | # taken from apps/gui/icon.c | ||
468 | remote viewers iconset: /$rbdir/icons/remote_viewers.bmp | ||
469 | |||
470 | STOP | ||
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> | ||
23 | Name: rockbox_default_icons | ||
24 | Author: Rockbox team | ||
25 | |||
26 | <main> | ||
27 | iconset: - | ||
28 | viewers iconset..+x16: icons/viewers.6x8x16.bmp | ||
29 | viewers iconset..+x1: icons/viewers.6x8x1.bmp | ||
30 | viewers iconset..+x2: icons/viewers.6x8x2.bmp | ||
31 | </main> | ||
32 | |||
33 | <remote> | ||
34 | iconset: - | ||
35 | viewers iconset..+x1: icons/viewers.6x8x1.bmp | ||
36 | viewers iconset..+x2: icons/viewers.6x8x2.bmp | ||
37 | </remote> | ||
38 | |||
39 | </theme> | ||
22 | 40 | ||
23 | <rwps> | 41 | <theme> |
24 | Name: rockbox_default.rwps | 42 | Name: rockbox_failsafe |
25 | Author: Rockbox team | 43 | Author: Rockbox team |
26 | Font: 08-Schumacher-Clean.fnt | 44 | |
27 | Statusbar: top | 45 | WPS: yes |
28 | </rwps> | 46 | RWPS: yes |
29 | 47 | SBS: yes | |
30 | <wps> | 48 | RSBS: yes |
31 | Name: cabbiev2.wps | 49 | FMS: yes |
32 | RWPS: cabbiev2.rwps | 50 | RFMS: yes |
33 | SBS: | 51 | |
34 | RSBS: | 52 | <main> |
53 | backdrop: - | ||
54 | font: - | ||
55 | statusbar: top | ||
56 | foreground color: 000000 | ||
57 | background color: B6C6E5 | ||
58 | selector type: bar (inverse) | ||
59 | ui viewport: - | ||
60 | </main> | ||
61 | |||
62 | <remote> | ||
63 | font: - | ||
64 | statusbar: top | ||
65 | ui viewport: - | ||
66 | </remote> | ||
67 | </theme> | ||
68 | |||
69 | <theme> | ||
70 | Name: cabbiev2 | ||
35 | # Real name of the creator of the WPS | 71 | # Real name of the creator of the WPS |
36 | Author: 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. | 72 | Authors: 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. |
73 | WPS: yes | ||
74 | RWPS: yes | ||
75 | SBS: no | ||
76 | RSBS: no | ||
77 | |||
78 | <main> | ||
79 | |||
80 | # override implicit .wps filename | ||
81 | wps.800x480x16: cabbiev2.800x480x16.wps | ||
82 | wps.480x800x16: cabbiev2.480x800x16.wps | ||
83 | wps.320x480x16: cabbiev2.320x480x16.wps | ||
84 | wps.320x240x16: cabbiev2.320x240x16.wps | ||
85 | wps.128x128x16: cabbiev2.128x128x16.wps | ||
86 | wps.128x160x16: cabbiev2.128x160x16.wps | ||
87 | wps.132x80x16: cabbiev2.132x80x16.wps | ||
88 | wps.138x110x2: cabbiev2.138x110x2.wps | ||
89 | wps.160x128x16: cabbiev2.160x128x16.wps | ||
90 | wps.160x128x2: cabbiev2.160x128x2.wps | ||
91 | wps.176x132x16: cabbiev2.176x132x16.wps | ||
92 | wps.176x220x16: cabbiev2.176x220x16.wps | ||
93 | wps.220x176x16: cabbiev2.220x176x16.wps | ||
94 | wps.240x320x16: cabbiev2.240x320x16.wps | ||
95 | wps.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): |
39 | Font.800x480x16: 35-Adobe-Helvetica.fnt | 98 | Font.800x480x16: 35-Adobe-Helvetica.fnt |
@@ -46,19 +105,16 @@ Font.220x176x16: 12-Adobe-Helvetica.fnt | |||
46 | Font.176x220x16: 12-Adobe-Helvetica.fnt | 105 | Font.176x220x16: 12-Adobe-Helvetica.fnt |
47 | Font.176x132x16: 12-Adobe-Helvetica.fnt | 106 | Font.176x132x16: 12-Adobe-Helvetica.fnt |
48 | Font.160x128x16: 12-Adobe-Helvetica.fnt | 107 | Font.160x128x16: 12-Adobe-Helvetica.fnt |
49 | Font.160x128x2: 12-Adobe-Helvetica.fnt | 108 | Font.160x128x2: 12-Adobe-Helvetica.fnt |
50 | Font.160x128x1: 12-Adobe-Helvetica.fnt | 109 | Font.160x128x1: 12-Adobe-Helvetica.fnt |
51 | Font.138x110x2: 12-Adobe-Helvetica.fnt | 110 | Font.138x110x2: 12-Adobe-Helvetica.fnt |
52 | Font.128x128x16: 12-Adobe-Helvetica.fnt | 111 | Font.128x128x16: 12-Adobe-Helvetica.fnt |
53 | Font.128x160x16: 12-Adobe-Helvetica.fnt | 112 | Font.128x160x16: 12-Adobe-Helvetica.fnt |
54 | Font.128x128x2: 12-Adobe-Helvetica.fnt | 113 | Font.128x128x2: 12-Adobe-Helvetica.fnt |
55 | Font.132x80x16: 11-Sazanami-Mincho.fnt | 114 | Font.132x80x16: 11-Sazanami-Mincho.fnt |
56 | Font.128x64x1: 08-Rockfont.fnt | 115 | Font.128x64x1: 08-Rockfont.fnt |
57 | Font.112x64x1: 08-Rockfont.fnt | 116 | Font.112x64x1: 08-Rockfont.fnt |
58 | Font.96x96x16: 08-Rockfont.fnt | 117 | Font.96x96x16: 08-Rockfont.fnt |
59 | |||
60 | # Remote font for iriver | ||
61 | Remote 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 |
64 | foreground color: CCCCCC | 120 | foreground color: CCCCCC |
@@ -66,92 +122,73 @@ background color: 000000 | |||
66 | line selector start color: fde89e | 122 | line selector start color: fde89e |
67 | line selector end color: b58c00 | 123 | line selector end color: b58c00 |
68 | line selector text color: 000000 | 124 | line selector text color: 000000 |
69 | filetype colours: | 125 | filetype 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! |
72 | backdrop.800x480x16: backdrops/cabbiev2.800x480x16.bmp | 128 | backdrop.800x480x16: backdrops/cabbiev2.800x480x16.bmp |
73 | backdrop.480x800x16: backdrops/cabbiev2.480x800x16.bmp | 129 | backdrop.480x800x16: backdrops/cabbiev2.480x800x16.bmp |
74 | backdrop.320x480x16: backdrops/cabbiev2.320x480x16.bmp | 130 | backdrop.320x480x16: backdrops/cabbiev2.320x480x16.bmp |
75 | backdrop.320x240x16: backdrops/cabbiev2.320x240x16.bmp | 131 | backdrop.320x240x16: backdrops/cabbiev2.320x240x16.bmp |
76 | backdrop.128x128x16: backdrops/cabbiev2.128x128x16.bmp | 132 | backdrop.128x128x16: backdrops/cabbiev2.128x128x16.bmp |
77 | backdrop.128x160x16: backdrops/cabbiev2.128x160x16.bmp | 133 | backdrop.128x160x16: backdrops/cabbiev2.128x160x16.bmp |
78 | backdrop.132x80x16: backdrops/cabbiev2.132x80x16.bmp | 134 | backdrop.132x80x16: backdrops/cabbiev2.132x80x16.bmp |
79 | backdrop.138x110x2: backdrops/cabbiev2.138x110x2.bmp | 135 | backdrop.138x110x2: backdrops/cabbiev2.138x110x2.bmp |
80 | backdrop.160x128x16: backdrops/cabbiev2.160x128x16.bmp | 136 | backdrop.160x128x16: backdrops/cabbiev2.160x128x16.bmp |
81 | backdrop.160x128x2: backdrops/cabbiev2.160x128x2.bmp | 137 | backdrop.160x128x2: backdrops/cabbiev2.160x128x2.bmp |
82 | backdrop.176x132x16: backdrops/cabbiev2.176x132x16.bmp | 138 | backdrop.176x132x16: backdrops/cabbiev2.176x132x16.bmp |
83 | backdrop.176x220x16: backdrops/cabbiev2.176x220x16.bmp | 139 | backdrop.176x220x16: backdrops/cabbiev2.176x220x16.bmp |
84 | backdrop.220x176x16: backdrops/cabbiev2.220x176x16.bmp | 140 | backdrop.220x176x16: backdrops/cabbiev2.220x176x16.bmp |
85 | backdrop.240x320x16: backdrops/cabbiev2.240x320x16.bmp | 141 | backdrop.240x320x16: backdrops/cabbiev2.240x320x16.bmp |
86 | backdrop.240x400x16: backdrops/cabbiev2.240x400x16.bmp | 142 | backdrop.240x400x16: backdrops/cabbiev2.240x400x16.bmp |
87 | backdrop.96x96x16: backdrops/cabbiev2.96x96x16.bmp | 143 | backdrop.96x96x16: backdrops/cabbiev2.96x96x16.bmp |
88 | 144 | ||
89 | #selection bar settings for color targets | 145 | #selection bar settings for color targets |
90 | selector type.800x480x16: bar (gradient) | 146 | selector type..+x16: bar (gradient) |
91 | selector type.480x800x16: bar (gradient) | 147 | selector type..+x2: bar (inverse) |
92 | selector type.320x480x16: bar (gradient) | ||
93 | selector type.320x240x16: bar (gradient) | ||
94 | selector type.128x128x16: bar (gradient) | ||
95 | selector type.128x160x16: bar (gradient) | ||
96 | selector type.132x80x16: bar (gradient) | ||
97 | selector type.220x176x16: bar (gradient) | ||
98 | selector type.160x128x16: bar (gradient) | ||
99 | selector type.240x400x16: bar (gradient) | ||
100 | selector type.240x320x16: bar (gradient) | ||
101 | selector type.176x132x16: bar (gradient) | ||
102 | selector type.176x220x16: bar (gradient) | ||
103 | selector type.160x128x2: bar (inverse) | ||
104 | selector type.138x110x2: bar (inverse) | ||
105 | selector type.96x96x16: bar (gradient) | ||
106 | 148 | ||
107 | #icons | 149 | #icons |
108 | iconset.800x480x16: icons/tango_icons.32x32.bmp | 150 | iconset.800x480x16: icons/tango_icons.32x32.bmp |
109 | iconset.480x800x16: icons/tango_icons.32x32.bmp | 151 | iconset.480x800x16: icons/tango_icons.32x32.bmp |
110 | iconset.320x480x16: icons/tango_icons.24x24.bmp | 152 | iconset.320x480x16: icons/tango_icons.24x24.bmp |
111 | iconset.320x240x16: icons/tango_icons.16x16.bmp | 153 | iconset.320x240x16: icons/tango_icons.16x16.bmp |
112 | iconset.128x128x16: icons/tango_icons.12x12.bmp | 154 | iconset.128x128x16: icons/tango_icons.12x12.bmp |
113 | iconset.128x160x16: icons/tango_icons.12x12.bmp | 155 | iconset.128x160x16: icons/tango_icons.12x12.bmp |
114 | iconset.132x80x16: icons/tango_icons.12x12.bmp | 156 | iconset.132x80x16: icons/tango_icons.12x12.bmp |
115 | iconset.138x110x2: icons/tango_small_mono.bmp | 157 | iconset.160x128x16: icons/tango_icons.12x12.bmp |
116 | iconset.160x128x16: icons/tango_icons.12x12.bmp | 158 | iconset.176x132x16: icons/tango_icons.12x12.bmp |
117 | iconset.160x128x2: icons/tango_small_mono.bmp | 159 | iconset.176x220x16: icons/tango_icons.12x12.bmp |
118 | iconset.176x132x16: icons/tango_icons.12x12.bmp | 160 | iconset.220x176x16: icons/tango_icons.12x12.bmp |
119 | iconset.176x220x16: icons/tango_icons.12x12.bmp | 161 | iconset.240x320x16: icons/tango_icons.16x16.bmp |
120 | iconset.220x176x16: icons/tango_icons.12x12.bmp | 162 | iconset.240x400x16: icons/tango_icons.16x16.bmp |
121 | iconset.240x320x16: icons/tango_icons.16x16.bmp | 163 | iconset.96x96x16: icons/tango_icons.8x8.bmp |
122 | iconset.240x400x16: icons/tango_icons.16x16.bmp | 164 | iconset..+x2: icons/tango_small_mono.bmp |
123 | iconset.96x96x16: icons/tango_icons.8x8.bmp | ||
124 | 165 | ||
125 | #viewer icons | 166 | #viewer icons |
126 | viewers iconset.800x480x16: icons/tango_icons_viewers.32x32.bmp | 167 | viewers iconset.800x480x16: icons/tango_icons_viewers.32x32.bmp |
127 | viewers iconset.480x800x16: icons/tango_icons_viewers.32x32.bmp | 168 | viewers iconset.480x800x16: icons/tango_icons_viewers.32x32.bmp |
128 | viewers iconset.320x480x16: icons/tango_icons_viewers.24x24.bmp | 169 | viewers iconset.320x480x16: icons/tango_icons_viewers.24x24.bmp |
129 | viewers iconset.320x240x16: icons/tango_icons_viewers.16x16.bmp | 170 | viewers iconset.320x240x16: icons/tango_icons_viewers.16x16.bmp |
130 | viewers iconset.128x128x16: icons/tango_icons_viewers.12x12.bmp | 171 | viewers iconset.128x128x16: icons/tango_icons_viewers.12x12.bmp |
131 | viewers iconset.128x160x16: icons/tango_icons_viewers.12x12.bmp | 172 | viewers iconset.128x160x16: icons/tango_icons_viewers.12x12.bmp |
132 | viewers iconset.132x80x16: icons/tango_icons_viewers.12x12.bmp | 173 | viewers iconset.132x80x16: icons/tango_icons_viewers.12x12.bmp |
133 | viewers iconset.138x110x2: icons/tango_small_viewers_mono.bmp | 174 | viewers iconset.160x128x16: icons/tango_icons_viewers.12x12.bmp |
134 | viewers iconset.160x128x16: icons/tango_icons_viewers.12x12.bmp | 175 | viewers iconset.176x132x16: icons/tango_icons_viewers.12x12.bmp |
135 | viewers iconset.160x128x2: icons/tango_small_viewers_mono.bmp | 176 | viewers iconset.176x220x16: icons/tango_icons_viewers.12x12.bmp |
136 | viewers iconset.176x132x16: icons/tango_icons_viewers.12x12.bmp | 177 | viewers iconset.220x176x16: icons/tango_icons_viewers.12x12.bmp |
137 | viewers iconset.176x220x16: icons/tango_icons_viewers.12x12.bmp | 178 | viewers iconset.240x320x16: icons/tango_icons_viewers.16x16.bmp |
138 | viewers iconset.220x176x16: icons/tango_icons_viewers.12x12.bmp | 179 | viewers iconset.240x400x16: icons/tango_icons_viewers.16x16.bmp |
139 | viewers iconset.240x320x16: icons/tango_icons_viewers.16x16.bmp | 180 | viewers iconset.96x96x16: icons/tango_icons_viewers.8x8.bmp |
140 | viewers iconset.240x400x16: icons/tango_icons_viewers.16x16.bmp | 181 | viewers iconset..+x2: icons/tango_small_viewers_mono.bmp |
141 | viewers iconset.96x96x16: icons/tango_icons_viewers.8x8.bmp | 182 | |
142 | 183 | statusbar: top | |
143 | # Whether the WPS is designed to have the statusbar on or off | 184 | ui viewport: - |
144 | Statusbar: top | 185 | </main> |
145 | remote statusbar: top | 186 | |
146 | 187 | <remote> | |
147 | # list & remote ui viewports | 188 | rwps.128x64x1: cabbiev2.128x64x1.wps |
148 | ui viewport: | 189 | Font.128x64x1: 08-Rockfont.fnt |
149 | remote ui viewport: | 190 | statusbar: top |
150 | </wps> | 191 | ui viewport: - |
151 | 192 | </remote> | |
152 | <rwps> | 193 | |
153 | Name: cabbiev2.rwps | 194 | </theme> |
154 | Author: 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. | ||
155 | Font: 12-Adobe-Helvetica.fnt | ||
156 | Statusbar: 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; | |||
12 | use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DTYPE_STUFF | 12 | use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DTYPE_STUFF |
13 | 13 | ||
14 | my $ROOT=".."; | 14 | my $ROOT=".."; |
15 | my $wpsdir; | ||
15 | my $verbose; | 16 | my $verbose; |
16 | my $rbdir=".rockbox"; | 17 | my $rbdir=".rockbox"; |
17 | my $tempdir=".rockbox"; | 18 | my $tempdir=".rockbox"; |
@@ -31,21 +32,22 @@ GetOptions ( 'r|root=s' => \$ROOT, | |||
31 | 32 | ||
32 | my $firmdir="$ROOT/firmware"; | 33 | my $firmdir="$ROOT/firmware"; |
33 | my $cppdef = $target; | 34 | my $cppdef = $target; |
34 | my @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 |
37 | my $req_size; | ||
38 | my $req_g_wps; | ||
39 | my $req_t; | 37 | my $req_t; |
40 | my $req_t_wps; | 38 | my $theme; |
39 | my $has_wps; | ||
41 | my $wps; | 40 | my $wps; |
42 | my $wps_prefix; | 41 | my $has_rwps; |
43 | my $sbs_prefix; | ||
44 | my $rwps; | 42 | my $rwps; |
43 | my $has_sbs; | ||
45 | my $sbs; | 44 | my $sbs; |
46 | my $sbs_w_size; | 45 | my $has_rsbs; |
47 | my $rsbs; | 46 | my $rsbs; |
48 | my $rsbs_w_size; | 47 | my $has_fms; |
48 | my $fms; | ||
49 | my $has_rfms; | ||
50 | my $rfms; | ||
49 | my $width; | 51 | my $width; |
50 | my $height; | 52 | my $height; |
51 | my $font; | 53 | my $font; |
@@ -53,13 +55,16 @@ my $remotefont; | |||
53 | my $fgcolor; | 55 | my $fgcolor; |
54 | my $bgcolor; | 56 | my $bgcolor; |
55 | my $statusbar; | 57 | my $statusbar; |
58 | my $remotestatusbar; | ||
56 | my $author; | 59 | my $author; |
57 | my $backdrop; | 60 | my $backdrop; |
58 | my $lineselectstart; | 61 | my $lineselectstart; |
59 | my $lineselectend; | 62 | my $lineselectend; |
60 | my $selecttype; | 63 | my $selecttype; |
61 | my $iconset; | 64 | my $iconset; |
65 | my $remoteiconset; | ||
62 | my $viewericon; | 66 | my $viewericon; |
67 | my $remoteviewericon; | ||
63 | my $lineselecttextcolor; | 68 | my $lineselecttextcolor; |
64 | my $filetylecolor; | 69 | my $filetylecolor; |
65 | my $listviewport; | 70 | my $listviewport; |
@@ -135,28 +140,33 @@ STOP | |||
135 | 140 | ||
136 | sub mkdirs | 141 | sub 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 | ||
156 | sub 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 | |||
152 | sub copybackdrop | 164 | sub 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 | ||
174 | sub copythemeicon | 183 | sub 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 | ||
185 | sub copythemeviewericon | 194 | sub 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 | ||
197 | sub copywps | 206 | sub 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 | ||
260 | sub buildcfg { | 250 | sub 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 | \# |
271 | wps: $rbdir/wps/$wps | ||
272 | MOO | 259 | MOO |
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 | ||
394 | my $isrwps; | 326 | |
395 | my $within; | 327 | # check if line matches the setting string or if it contains a regex |
328 | # that contains the targets resolution | ||
329 | sub 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 | ||
349 | sub 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 | ||
397 | open(WPS, "<$wpslist"); | 368 | open(WPS, "<$wpslist"); |
398 | while(<WPS>) { | 369 | while(<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 | ||