Permalink
Browse files

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
  • Loading branch information...
1 parent 300ff4c commit 66b6fdbb73f90cbb58fe814cdecc58858b584e1e @kugel- kugel- committed Jun 10, 2012
View
@@ -333,57 +333,6 @@ sub filesize {
return $size;
}
-sub create_failsafefiles {
- my ($dir, $remote_depth) = @_;
- my $text = "# Dummy file to allow Rockbox to reset to the default skin config.
-# Do not edit this file. It's never actually loaded by Rockbox.";
- open (FOO, ">$dir/wps/rockbox_failsafe.wps");
- print FOO $text;
- close(FOO);
- open (FOO, ">$dir/wps/rockbox_failsafe.sbs");
- print FOO $text;
- close(FOO);
- open (FOO, ">$dir/wps/rockbox_failsafe.fms");
- print FOO $text;
- close(FOO);
- if ($remote_depth) {
- open (FOO, ">$dir/wps/rockbox_failsafe.rwps");
- print FOO $text;
- close(FOO);
- open (FOO, ">$dir/wps/rockbox_failsafe.rsbs");
- print FOO $text;
- close(FOO);
- open (FOO, ">$dir/wps/rockbox_failsafe.rfms");
- print FOO $text;
- close(FOO);
- }
- open (FOO, ">$dir/themes/rockbox_failsafe.cfg");
- print FOO <<STOP
-# This config has been autogenerated to reload the failsafe setup
-wps: $dir/wps/rockbox_failsafe.wps
-sbs: $dir/wps/rockbox_failsafe.sbs
-fms: $dir/wps/rockbox_failsafe.fms
-STOP
-;
- if ($remote_depth) {
- print FOO <<STOP
-rwps: $dir/wps/rockbox_failsafe.rwps
-rsbs: $dir/wps/rockbox_failsafe.rsbs
-rfms: $dir/wps/rockbox_failsafe.rfms
-STOP
-;
- }
- print FOO <<STOP
-statusbar: top
-font: 08-Schumacher-Clean.fnt
-foreground color: 000000
-background color: B6C6E5
-selector type: bar (inverse)
-backdrop: -
-STOP
-;
- close(FOO);
-}
sub buildzip {
my ($image, $fonts)=@_;
@@ -454,24 +403,8 @@ sub buildzip {
}
glob_mkdir("$temp_dir/wps");
+ glob_mkdir("$temp_dir/icons");
glob_mkdir("$temp_dir/themes");
- if ($bitmap) {
- open(THEME, ">$temp_dir/themes/rockbox_default_icons.cfg");
- print THEME <<STOP
-# this config file was auto-generated to make it
-# easy to reset the icons back to default
-iconset: -
-# taken from apps/gui/icon.c
-viewers iconset: /$rbdir/icons/viewers.bmp
-remote iconset: -
-# taken from apps/gui/icon.c
-remote viewers iconset: /$rbdir/icons/remote_viewers.bmp
-
-STOP
-;
- close(THEME);
- }
-
glob_mkdir("$temp_dir/codepages");
if($bitmap) {
@@ -576,14 +509,6 @@ sub buildzip {
glob_unlink("$temp_dir/rocks/*.lua"); # Clean up unwanted *.lua files (e.g. actions.lua, buttons.lua)
- if ($bitmap) {
- glob_mkdir("$temp_dir/icons");
- copy("$viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp", "$temp_dir/icons/viewers.bmp");
- if ($remote_depth) {
- copy("$viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp", "$temp_dir/icons/remote_viewers.bmp");
- }
- }
-
copy("$ROOT/apps/tagnavi.config", "$temp_dir/");
copy("$ROOT/apps/plugins/disktidy.config", "$temp_dir/rocks/apps/");
@@ -606,7 +531,6 @@ sub buildzip {
"$temp_dir/rocks/demos/pictureflow_splash.bmp");
}
- create_failsafefiles($temp_dir, $remote_depth);
if($image) {
# image is blank when this is a simulator
View
@@ -11,29 +11,88 @@
# This should list all WPS and RWPS files we have and what their requirements
# and preferences are.
#
-# Each <wps> section will also cause a "theme" .cfg to be made, which the
+# Each <theme> section will also cause a "theme" .cfg to be made, which the
# <rwps> sections will not cause.
#
# A <wps> section can thus mention a "preferred" rwps file to load when that
# theme is loaded.
#
# All sections should list what font and status bar setting they "like".
+<theme>
+Name: rockbox_default_icons
+Author: Rockbox team
+
+<main>
+iconset: -
+viewers iconset..+x16: icons/viewers.6x8x16.bmp
+viewers iconset..+x1: icons/viewers.6x8x1.bmp
+viewers iconset..+x2: icons/viewers.6x8x2.bmp
+</main>
+
+<remote>
+iconset: -
+viewers iconset..+x1: icons/viewers.6x8x1.bmp
+viewers iconset..+x2: icons/viewers.6x8x2.bmp
+</remote>
+
+</theme>
-<rwps>
-Name: rockbox_default.rwps
+<theme>
+Name: rockbox_failsafe
Author: Rockbox team
-Font: 08-Schumacher-Clean.fnt
-Statusbar: top
-</rwps>
-
-<wps>
-Name: cabbiev2.wps
-RWPS: cabbiev2.rwps
-SBS:
-RSBS:
+
+WPS: yes
+RWPS: yes
+SBS: yes
+RSBS: yes
+FMS: yes
+RFMS: yes
+
+<main>
+backdrop: -
+font: -
+statusbar: top
+foreground color: 000000
+background color: B6C6E5
+selector type: bar (inverse)
+ui viewport: -
+</main>
+
+<remote>
+font: -
+statusbar: top
+ui viewport: -
+</remote>
+</theme>
+
+<theme>
+Name: cabbiev2
# Real name of the creator of the WPS
-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.
+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.
+WPS: yes
+RWPS: yes
+SBS: no
+RSBS: no
+
+<main>
+
+# override implicit .wps filename
+wps.800x480x16: cabbiev2.800x480x16.wps
+wps.480x800x16: cabbiev2.480x800x16.wps
+wps.320x480x16: cabbiev2.320x480x16.wps
+wps.320x240x16: cabbiev2.320x240x16.wps
+wps.128x128x16: cabbiev2.128x128x16.wps
+wps.128x160x16: cabbiev2.128x160x16.wps
+wps.132x80x16: cabbiev2.132x80x16.wps
+wps.138x110x2: cabbiev2.138x110x2.wps
+wps.160x128x16: cabbiev2.160x128x16.wps
+wps.160x128x2: cabbiev2.160x128x2.wps
+wps.176x132x16: cabbiev2.176x132x16.wps
+wps.176x220x16: cabbiev2.176x220x16.wps
+wps.220x176x16: cabbiev2.220x176x16.wps
+wps.240x320x16: cabbiev2.240x320x16.wps
+wps.240x400x16: cabbiev2.240x400x16.wps
# Preferred font (including .fnt extension - leave blank for player):
Font.800x480x16: 35-Adobe-Helvetica.fnt
@@ -46,112 +105,90 @@ Font.220x176x16: 12-Adobe-Helvetica.fnt
Font.176x220x16: 12-Adobe-Helvetica.fnt
Font.176x132x16: 12-Adobe-Helvetica.fnt
Font.160x128x16: 12-Adobe-Helvetica.fnt
-Font.160x128x2: 12-Adobe-Helvetica.fnt
-Font.160x128x1: 12-Adobe-Helvetica.fnt
-Font.138x110x2: 12-Adobe-Helvetica.fnt
+Font.160x128x2: 12-Adobe-Helvetica.fnt
+Font.160x128x1: 12-Adobe-Helvetica.fnt
+Font.138x110x2: 12-Adobe-Helvetica.fnt
Font.128x128x16: 12-Adobe-Helvetica.fnt
Font.128x160x16: 12-Adobe-Helvetica.fnt
-Font.128x128x2: 12-Adobe-Helvetica.fnt
-Font.132x80x16: 11-Sazanami-Mincho.fnt
-Font.128x64x1: 08-Rockfont.fnt
-Font.112x64x1: 08-Rockfont.fnt
-Font.96x96x16: 08-Rockfont.fnt
-
-# Remote font for iriver
-Remote Font.128x64x1: 08-Rockfont.fnt
+Font.128x128x2: 12-Adobe-Helvetica.fnt
+Font.132x80x16: 11-Sazanami-Mincho.fnt
+Font.128x64x1: 08-Rockfont.fnt
+Font.112x64x1: 08-Rockfont.fnt
+Font.96x96x16: 08-Rockfont.fnt
#misc settings that should be ignored on grayscale targets
foreground color: CCCCCC
background color: 000000
line selector start color: fde89e
line selector end color: b58c00
line selector text color: 000000
-filetype colours:
+filetype colours: -
#backdrop - remember this is the source file name in your SVN folder, not dest name!
-backdrop.800x480x16: backdrops/cabbiev2.800x480x16.bmp
-backdrop.480x800x16: backdrops/cabbiev2.480x800x16.bmp
-backdrop.320x480x16: backdrops/cabbiev2.320x480x16.bmp
-backdrop.320x240x16: backdrops/cabbiev2.320x240x16.bmp
-backdrop.128x128x16: backdrops/cabbiev2.128x128x16.bmp
-backdrop.128x160x16: backdrops/cabbiev2.128x160x16.bmp
-backdrop.132x80x16: backdrops/cabbiev2.132x80x16.bmp
-backdrop.138x110x2: backdrops/cabbiev2.138x110x2.bmp
-backdrop.160x128x16: backdrops/cabbiev2.160x128x16.bmp
-backdrop.160x128x2: backdrops/cabbiev2.160x128x2.bmp
-backdrop.176x132x16: backdrops/cabbiev2.176x132x16.bmp
-backdrop.176x220x16: backdrops/cabbiev2.176x220x16.bmp
-backdrop.220x176x16: backdrops/cabbiev2.220x176x16.bmp
-backdrop.240x320x16: backdrops/cabbiev2.240x320x16.bmp
-backdrop.240x400x16: backdrops/cabbiev2.240x400x16.bmp
-backdrop.96x96x16: backdrops/cabbiev2.96x96x16.bmp
+backdrop.800x480x16: backdrops/cabbiev2.800x480x16.bmp
+backdrop.480x800x16: backdrops/cabbiev2.480x800x16.bmp
+backdrop.320x480x16: backdrops/cabbiev2.320x480x16.bmp
+backdrop.320x240x16: backdrops/cabbiev2.320x240x16.bmp
+backdrop.128x128x16: backdrops/cabbiev2.128x128x16.bmp
+backdrop.128x160x16: backdrops/cabbiev2.128x160x16.bmp
+backdrop.132x80x16: backdrops/cabbiev2.132x80x16.bmp
+backdrop.138x110x2: backdrops/cabbiev2.138x110x2.bmp
+backdrop.160x128x16: backdrops/cabbiev2.160x128x16.bmp
+backdrop.160x128x2: backdrops/cabbiev2.160x128x2.bmp
+backdrop.176x132x16: backdrops/cabbiev2.176x132x16.bmp
+backdrop.176x220x16: backdrops/cabbiev2.176x220x16.bmp
+backdrop.220x176x16: backdrops/cabbiev2.220x176x16.bmp
+backdrop.240x320x16: backdrops/cabbiev2.240x320x16.bmp
+backdrop.240x400x16: backdrops/cabbiev2.240x400x16.bmp
+backdrop.96x96x16: backdrops/cabbiev2.96x96x16.bmp
#selection bar settings for color targets
-selector type.800x480x16: bar (gradient)
-selector type.480x800x16: bar (gradient)
-selector type.320x480x16: bar (gradient)
-selector type.320x240x16: bar (gradient)
-selector type.128x128x16: bar (gradient)
-selector type.128x160x16: bar (gradient)
-selector type.132x80x16: bar (gradient)
-selector type.220x176x16: bar (gradient)
-selector type.160x128x16: bar (gradient)
-selector type.240x400x16: bar (gradient)
-selector type.240x320x16: bar (gradient)
-selector type.176x132x16: bar (gradient)
-selector type.176x220x16: bar (gradient)
-selector type.160x128x2: bar (inverse)
-selector type.138x110x2: bar (inverse)
-selector type.96x96x16: bar (gradient)
+selector type..+x16: bar (gradient)
+selector type..+x2: bar (inverse)
#icons
-iconset.800x480x16: icons/tango_icons.32x32.bmp
-iconset.480x800x16: icons/tango_icons.32x32.bmp
-iconset.320x480x16: icons/tango_icons.24x24.bmp
-iconset.320x240x16: icons/tango_icons.16x16.bmp
-iconset.128x128x16: icons/tango_icons.12x12.bmp
-iconset.128x160x16: icons/tango_icons.12x12.bmp
-iconset.132x80x16: icons/tango_icons.12x12.bmp
-iconset.138x110x2: icons/tango_small_mono.bmp
-iconset.160x128x16: icons/tango_icons.12x12.bmp
-iconset.160x128x2: icons/tango_small_mono.bmp
-iconset.176x132x16: icons/tango_icons.12x12.bmp
-iconset.176x220x16: icons/tango_icons.12x12.bmp
-iconset.220x176x16: icons/tango_icons.12x12.bmp
-iconset.240x320x16: icons/tango_icons.16x16.bmp
-iconset.240x400x16: icons/tango_icons.16x16.bmp
-iconset.96x96x16: icons/tango_icons.8x8.bmp
+iconset.800x480x16: icons/tango_icons.32x32.bmp
+iconset.480x800x16: icons/tango_icons.32x32.bmp
+iconset.320x480x16: icons/tango_icons.24x24.bmp
+iconset.320x240x16: icons/tango_icons.16x16.bmp
+iconset.128x128x16: icons/tango_icons.12x12.bmp
+iconset.128x160x16: icons/tango_icons.12x12.bmp
+iconset.132x80x16: icons/tango_icons.12x12.bmp
+iconset.160x128x16: icons/tango_icons.12x12.bmp
+iconset.176x132x16: icons/tango_icons.12x12.bmp
+iconset.176x220x16: icons/tango_icons.12x12.bmp
+iconset.220x176x16: icons/tango_icons.12x12.bmp
+iconset.240x320x16: icons/tango_icons.16x16.bmp
+iconset.240x400x16: icons/tango_icons.16x16.bmp
+iconset.96x96x16: icons/tango_icons.8x8.bmp
+iconset..+x2: icons/tango_small_mono.bmp
#viewer icons
-viewers iconset.800x480x16: icons/tango_icons_viewers.32x32.bmp
-viewers iconset.480x800x16: icons/tango_icons_viewers.32x32.bmp
-viewers iconset.320x480x16: icons/tango_icons_viewers.24x24.bmp
-viewers iconset.320x240x16: icons/tango_icons_viewers.16x16.bmp
-viewers iconset.128x128x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.128x160x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.132x80x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.138x110x2: icons/tango_small_viewers_mono.bmp
-viewers iconset.160x128x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.160x128x2: icons/tango_small_viewers_mono.bmp
-viewers iconset.176x132x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.176x220x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.220x176x16: icons/tango_icons_viewers.12x12.bmp
-viewers iconset.240x320x16: icons/tango_icons_viewers.16x16.bmp
-viewers iconset.240x400x16: icons/tango_icons_viewers.16x16.bmp
-viewers iconset.96x96x16: icons/tango_icons_viewers.8x8.bmp
-
-# Whether the WPS is designed to have the statusbar on or off
-Statusbar: top
-remote statusbar: top
-
-# list & remote ui viewports
-ui viewport:
-remote ui viewport:
-</wps>
-
-<rwps>
-Name: cabbiev2.rwps
-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.
-Font: 12-Adobe-Helvetica.fnt
-Statusbar: top
-</rwps>
+viewers iconset.800x480x16: icons/tango_icons_viewers.32x32.bmp
+viewers iconset.480x800x16: icons/tango_icons_viewers.32x32.bmp
+viewers iconset.320x480x16: icons/tango_icons_viewers.24x24.bmp
+viewers iconset.320x240x16: icons/tango_icons_viewers.16x16.bmp
+viewers iconset.128x128x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.128x160x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.132x80x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.160x128x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.176x132x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.176x220x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.220x176x16: icons/tango_icons_viewers.12x12.bmp
+viewers iconset.240x320x16: icons/tango_icons_viewers.16x16.bmp
+viewers iconset.240x400x16: icons/tango_icons_viewers.16x16.bmp
+viewers iconset.96x96x16: icons/tango_icons_viewers.8x8.bmp
+viewers iconset..+x2: icons/tango_small_viewers_mono.bmp
+
+statusbar: top
+ui viewport: -
+</main>
+
+<remote>
+rwps.128x64x1: cabbiev2.128x64x1.wps
+Font.128x64x1: 08-Rockfont.fnt
+statusbar: top
+ui viewport: -
+</remote>
+
+</theme>
@@ -1,2 +0,0 @@
-# Dummy file to allow Rockbox to reset to the default WPS config.
-# Do not edit this file. It's never actually loaded by Rockbox.
@@ -0,0 +1,2 @@
+# Dummy file to allow Rockbox to reset to the default skin config.
+# Do not edit this file. It's never actually loaded by Rockbox.
Oops, something went wrong.

0 comments on commit 66b6fdb

Please sign in to comment.