From 1016ee4e809776619fa9e4e773ceb1523bd7bc66 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 19 Oct 2009 15:28:15 +0000 Subject: Initial custom statusbar commit. The custom statusbar can be used as a WPS for the main UI, using .(r)sbs files. It's using the skin engine and knows all tags the WPS also knows. The default folder for .sbs is the wps folder to reuse images used in the WPS. As it can be shown in the WPS also, it's useful to move shared parts to the custom statusbar in order to save skin buffer space. There are a few restrictions/TODOs: *) Peak meter doesn't redraw nicely(not frequent enough), as very frequent updates would slow the UI down as hell (some targets fight with it in the WPS already: FS#10686) *) No touchregion support as the statusbar doesn't have any action handling (it won't fail to parse though). *) Drawing stuff into the default VP is forbidden (loading images in it is not). You *need* to use viewports for the displaying stuff (parsing fails if no viewport is used). *) Themes that don't use a custom ui viewport can be fixed up using the new %Vi tag to avoid nasty redraw effectts (you must not draw into it as well, it's used to fix up the ui viewport). %Vi describes the viewport that the lists can use without getting in the way of the statusbar. Otherwise, it behaves like the classic statusbar, it can be configured in the theme settings, and can be turned off in the wps using %wd. Note to translaters: When translating LANG_STATUSBAR_CUSTOM, please consider using the same translation as for LANG_CHANNEL_CUSTOM if it's compatible. They could be combined later then. Flyspray: FS#10566 Author: myself git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23258 a1c6a512-1295-4272-9138-f99709370657 --- wps/wpsbuild.pl | 87 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 15 deletions(-) (limited to 'wps/wpsbuild.pl') diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl index e9e5c29a30..7378f30b32 100755 --- a/wps/wpsbuild.pl +++ b/wps/wpsbuild.pl @@ -32,9 +32,18 @@ my $cppdef = $target; my @depthlist = ( 16, 8, 4, 2, 1 ); # These parameters are filled in as we parse wpslist +my $req_size; +my $req_g_wps; +my $req_t; +my $req_t_wps; my $wps; my $wps_prefix; +my $sbs_prefix; my $rwps; +my $sbs; +my $sbs_w_size; +my $rsbs; +my $rsbs_w_size; my $width; my $height; my $font; @@ -42,9 +51,6 @@ my $fgcolor; my $bgcolor; my $statusbar; my $author; -my $req_g; -my $req_g_wps; -my $req_t_wps; my $backdrop; my $lineselectstart; my $lineselectend; @@ -191,12 +197,26 @@ sub copywps my $dir; my @filelist; my $file; + my $__sb; if($wpslist =~ /(.*)WPSLIST/) { $dir = $1; -# system("cp $dir/$wps .rockbox/wps/"); - #print "$req_t_wps $req_g_wps\n"; + $__sb = $sbs_prefix . "." . $req_size . ".sbs"; + #print "$req_t_wps $req_g_wps $sbs_prefix\n"; + #print "$dir/$__sb\n"; +# system("cp $dir/$wps .rockbox/wps/"); + # check for .WIDTHxHEIGHTxDEPTH.sbs + if (-e "$dir/$__sb") { + system("cp $dir/$__sb $rbdir/wps/$sbs"); + } + # check for .WIDTHxHEIGHTxDEPTH..sbs and overwrite the + # previous sb if needed + $__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs"; + if (-e "$dir/$__sb") { + system("cp $dir/$__sb $rbdir/wps/$sbs"); + } + if (-e "$dir/$req_t_wps" ) { system("cp $dir/$req_t_wps $rbdir/wps/$wps"); @@ -210,9 +230,9 @@ sub copywps close(WPSFILE); if ($#filelist >= 0) { - if (-e "$dir/$wps_prefix/$req_g") { + if (-e "$dir/$wps_prefix/$req_size") { foreach $file (@filelist) { - system("cp $dir/$wps_prefix/$req_g/$file $rbdir/wps/$wps_prefix/"); + system("cp $dir/$wps_prefix/$req_size/$file $rbdir/wps/$wps_prefix/"); } } elsif (-e "$dir/$wps_prefix") { @@ -235,7 +255,7 @@ sub copywps sub buildcfg { my $cfg = $wps; - my @out; + my @out; $cfg =~ s/\.(r|)wps/.cfg/; @@ -247,6 +267,20 @@ sub buildcfg { wps: /$rbdir/wps/$wps MOO ; + if(defined($sbs)) { + if ($sbs eq '') { + push @out, "sbs: -\n"; + } else { + push @out, "sbs: /$rbdir/wps/$sbs\n"; + } + } + if(defined($sbs) && $has_remote) { + if ($rsbs eq '') { + push @out, "rsbs: -\n"; + } else { + push @out, "rsbs: /$rbdir/wps/$rsbs\n"; + } + } if($font) { push @out, "font: /$rbdir/fonts/$font\n"; } @@ -264,7 +298,7 @@ MOO } if(defined($backdrop)) { if ($backdrop eq '') { - push @out, "backdrop:\n"; + push @out, "backdrop: -\n"; } else { # clip resolution from filename $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; @@ -338,6 +372,8 @@ while() { undef $wps; undef $wps_prefix; undef $rwps; + undef $sbs; + undef $rsbs; undef $width; undef $height; undef $font; @@ -386,23 +422,24 @@ while() { foreach my $d (@depthlist) { next if ($d > $rdepth); - $req_g = $rwidth . "x" . $rheight . "x" . $d; + $req_size = $rwidth . "x" . $rheight . "x" . $d; # check for model specific wps - $req_g_wps = $wps_prefix . "." . $req_g . "." . $modelname . ".wps"; + $req_g_wps = $wps_prefix . "." . $req_size . "." . $modelname . ".wps"; last if (-e "$wpsdir/$req_g_wps"); - $req_g_wps = $wps_prefix . "." . $req_g . ".wps"; + # check for normal wps (with WIDTHxHEIGHTxDEPTH) + $req_g_wps = $wps_prefix . "." . $req_size . ".wps"; last if (-e "$wpsdir/$req_g_wps"); if ($isrwps) { - $req_g = $req_g . "." . $main_width . "x" . $main_height . "x" . "$main_depth"; + $req_size = $req_size . "." . $main_width . "x" . $main_height . "x" . "$main_depth"; - $req_g_wps = $wps_prefix . "." . $req_g . ".wps"; + $req_g_wps = $wps_prefix . "." . $req_size . ".wps"; last if (-e "$wpsdir/$req_g_wps"); } } - $req_t_wps = $wps_prefix . ".txt" . ".wps"; + $req_t_wps = $wps_prefix . $req_t . ".wps"; #print "LCD: $wps wants $width x $height\n"; #print "LCD: is $rwidth x $rheight\n"; @@ -454,6 +491,20 @@ while() { elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { $rwps = $1; } + elsif($l =~ /^SBS: *(.*)/i) { + $sbs = $sbs_prefix = $1; + $sbs_prefix =~ s/\.(r|)sbs//; + } + elsif($l =~ /^SBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { + $sbs = $sbs_prefix = $1; + $sbs_prefix =~ s/\.(r|)sbs//; + } + elsif($l =~ /^RSBS: *(.*)/i) { + $rsbs = $1; + } + elsif($l =~ /^RSBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { + $rsbs = $1; + } elsif($l =~ /^Author: *(.*)/i) { $author = $1; } @@ -526,9 +577,15 @@ while() { elsif($l =~ /^ui viewport: *(.*)/i) { $listviewport = $1; } + elsif($l =~ /^ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) { + $listviewport = $1; + } elsif($l =~ /^remote ui viewport: *(.*)/i) { $remotelistviewport = $1; } + elsif($l =~ /^remote ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) { + $remotelistviewport = $1; + } else{ #print "Unknown line: $l!\n"; } -- cgit v1.2.3