From 2bace6a37569044b38dc7de79b4cbebc33513c93 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 17 Nov 2005 22:39:26 +0000 Subject: .rwps support and support for a rwps: field within the WPSLIST file, which really is more like a list of themes now... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7940 a1c6a512-1295-4272-9138-f99709370657 --- wps/wpsbuild.pl | 72 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 14 deletions(-) (limited to 'wps') diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl index a8e325fde7..74aad42417 100755 --- a/wps/wpsbuild.pl +++ b/wps/wpsbuild.pl @@ -38,13 +38,28 @@ if(!$wpslist) { } sub getlcdsizes { + my ($remote) = @_; + open(GCC, ">gcctemp"); + if($remote) { + # Get the remote LCD screen size + print GCC <.rockbox/wps/$cfg"); - print CFG @out; - close(CFG); + if(-f ".rockbox/wps/$cfg") { + print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; + } + else { + open(CFG, ">.rockbox/wps/$cfg"); + print CFG @out; + close(CFG); + } } +# Get the LCD sizes first +my ($main_height, $main_width) = getlcdsizes(); +my ($remote_height, $remote_width) = getlcdsizes(1); + open(WPS, "<$wpslist"); while() { my $l = $_; @@ -130,18 +163,26 @@ while() { # skip comment next; } - if($l =~ /^ */i) { + if($l =~ /^ *<(r|)wps>/i) { + $isrwps = $1; $within = 1; next; } if($within) { - if($l =~ /^ *<\/wps>/i) { - - my ($rheight, $rwidth) = getlcdsizes(); + if($l =~ /^ *<\/${isrwps}wps>/i) { + # Get the required width and height + my ($rheight, $rwidth); + if($isrwps) { + ($rheight, $rwidth) = ($remote_height, $remote_width); + } + else { + ($rheight, $rwidth) = ($main_height, $main_width); + } if(!$rheight || !$rwidth) { - print STDER "Failed to get LCD sizes!\n"; - exit; + printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n", + $isrwps?"remote ":""; + next; } #print "LCD: $wps wants $height x $width\n"; @@ -163,11 +204,14 @@ while() { } $within = 0; - undef $wps, $width, $height, $font, $statusbar, $author; + undef $wps, $rwps, $width, $height, $font, $statusbar, $author; } elsif($l =~ /^Name: (.*)/i) { $wps = $1; } + elsif($l =~ /^RWPS: (.*)/i) { + $rwps = $1; + } elsif($l =~ /^Author: (.*)/i) { $author = $1; } -- cgit