From 30804e5a3f6ab53cff56f11b44c077b5044e0b51 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 3 Jun 2010 13:44:41 +0000 Subject: almost finished... copy fonts, backdrops, icon files, skins. last thing to do is copy the images from inside the skins git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26511 a1c6a512-1295-4272-9138-f99709370657 --- tools/buildtheme.pl | 140 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 134 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/buildtheme.pl b/tools/buildtheme.pl index 7f135fd121..488a57d0ab 100755 --- a/tools/buildtheme.pl +++ b/tools/buildtheme.pl @@ -39,7 +39,7 @@ my $has_remote; if(!$wpslist) { - print "Usage: wpsbuilds.pl \n", + print "Usage: buildtheme.pl \n", "Run this script in the root of the target build, and it will put all the\n", "stuff in $rbdir/wps/\n"; exit; @@ -101,8 +101,8 @@ STOP } # Get the LCD sizes first -($main_height, $main_width, $main_depth) = (320,240,16);#getlcdsizes(); -($remote_height, $remote_width, $remote_depth) = ();#getlcdsizes(1); +($main_height, $main_width, $main_depth) = getlcdsizes(); +($remote_height, $remote_width, $remote_depth) = getlcdsizes(1); #print "LCD: ${main_width}x${main_height}x${main_depth}\n"; $has_remote = 1 if ($remote_height && $remote_width && $remote_depth); @@ -134,6 +134,8 @@ sub mkdirs mkdir "$rbdir", 0777; mkdir "$rbdir/wps", 0777; mkdir "$rbdir/themes", 0777; + mkdir "$rbdir/icons", 0777; + mkdir "$rbdir/backdrops", 0777; if( -d "$rbdir/wps/$themename") { # print STDERR "wpsbuild warning: directory wps/$themename already exists!\n"; @@ -150,7 +152,7 @@ sub buildcfg { push @out, < $depth); + $src = "${dir}$skin.${width}x${height}x${d}.$ext"; + last if (-e $src); + } + if (-e $src) + { + my $cmd = "cp $src $rbdir/wps/$themename.$ext"; + print "$cmd\n"; + `$cmd`; + } + elsif (-e "${dir}$skin.$ext") + { + my $cmd = "cp ${dir}$skin.$ext $rbdir/wps/$themename.$ext"; + `$cmd`; + } + else + { + #print STDERR "buildtheme warning: No suitable skin file for $ext\n"; + } + } + } +} + open(WPS, "<$wpslist"); while() { my $l = $_; @@ -222,8 +336,22 @@ while() { mkdirs($theme{Name}); buildcfg($theme{Name}); + copyskin($theme{"Name"}, $theme{"WPS"}, "wps") if exists($theme{"WPS"}); + copyskin($theme{"Name"}, $theme{"RWPS"}, "rwps") if exists($theme{"RWPS"}); + copyskin($theme{"Name"}, $theme{"FMS"}, "fms") if exists($theme{"FMS"}); + copyskin($theme{"Name"}, $theme{"RFMS"}, "rfms") if exists($theme{"RFMS"}); + copyskin($theme{"Name"}, $theme{"SBS"}, "sbs") if exists($theme{"SBS"}); + copyskin($theme{"Name"}, $theme{"RSBS"}, "rsbs") if exists($theme{"RSBS"}); + + copyiconset($theme{"iconset"}) if exists($theme{"iconset"}); + copyiconset($theme{"remote iconset"}) if exists($theme{"remote iconset"}); + copyiconset($theme{"viewers iconset"}) if exists($theme{"viewers iconset"}); + copyiconset($theme{"remote viewers iconset"}) if exists($theme{"remote viewers iconset"}); + copythemefont($theme{"Font"}) if exists($theme{"Font"}); + copythemefont($theme{"Remote Font"}) if exists($theme{"Remote Font"}); + copybackdrop($theme{"backdrop"}) if exists($theme{"backdrop"}); @@ -238,7 +366,7 @@ while() { ($extra && (match($target, $extra) || matchdisplaystring($extra)))) { $theme{$var} = $value; - # print "\'$var\': $value\n"; + #print "\'$var\': $value\n"; } } } -- cgit v1.2.3