summaryrefslogtreecommitdiff
path: root/wps/wpsbuild.pl
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-10-19 15:28:15 +0000
committerThomas Martitz <kugel@rockbox.org>2009-10-19 15:28:15 +0000
commit1016ee4e809776619fa9e4e773ceb1523bd7bc66 (patch)
tree585cd873c118bee7c2459205e6eb54ff3e76a21b /wps/wpsbuild.pl
parent00695baac0b797cbe46e7bc2999a83f73b36aae8 (diff)
downloadrockbox-1016ee4e809776619fa9e4e773ceb1523bd7bc66.tar.gz
rockbox-1016ee4e809776619fa9e4e773ceb1523bd7bc66.zip
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
Diffstat (limited to 'wps/wpsbuild.pl')
-rwxr-xr-xwps/wpsbuild.pl87
1 files changed, 72 insertions, 15 deletions
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;
32my @depthlist = ( 16, 8, 4, 2, 1 ); 32my @depthlist = ( 16, 8, 4, 2, 1 );
33 33
34# These parameters are filled in as we parse wpslist 34# These parameters are filled in as we parse wpslist
35my $req_size;
36my $req_g_wps;
37my $req_t;
38my $req_t_wps;
35my $wps; 39my $wps;
36my $wps_prefix; 40my $wps_prefix;
41my $sbs_prefix;
37my $rwps; 42my $rwps;
43my $sbs;
44my $sbs_w_size;
45my $rsbs;
46my $rsbs_w_size;
38my $width; 47my $width;
39my $height; 48my $height;
40my $font; 49my $font;
@@ -42,9 +51,6 @@ my $fgcolor;
42my $bgcolor; 51my $bgcolor;
43my $statusbar; 52my $statusbar;
44my $author; 53my $author;
45my $req_g;
46my $req_g_wps;
47my $req_t_wps;
48my $backdrop; 54my $backdrop;
49my $lineselectstart; 55my $lineselectstart;
50my $lineselectend; 56my $lineselectend;
@@ -191,12 +197,26 @@ sub copywps
191 my $dir; 197 my $dir;
192 my @filelist; 198 my @filelist;
193 my $file; 199 my $file;
200 my $__sb;
194 201
195 if($wpslist =~ /(.*)WPSLIST/) { 202 if($wpslist =~ /(.*)WPSLIST/) {
196 $dir = $1; 203 $dir = $1;
197# system("cp $dir/$wps .rockbox/wps/"); 204 $__sb = $sbs_prefix . "." . $req_size . ".sbs";
198 #print "$req_t_wps $req_g_wps\n"; 205 #print "$req_t_wps $req_g_wps $sbs_prefix\n";
206 #print "$dir/$__sb\n";
199 207
208# system("cp $dir/$wps .rockbox/wps/");
209 # check for <name>.WIDTHxHEIGHTxDEPTH.sbs
210 if (-e "$dir/$__sb") {
211 system("cp $dir/$__sb $rbdir/wps/$sbs");
212 }
213 # check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sbs and overwrite the
214 # previous sb if needed
215 $__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs";
216 if (-e "$dir/$__sb") {
217 system("cp $dir/$__sb $rbdir/wps/$sbs");
218 }
219
200 if (-e "$dir/$req_t_wps" ) { 220 if (-e "$dir/$req_t_wps" ) {
201 system("cp $dir/$req_t_wps $rbdir/wps/$wps"); 221 system("cp $dir/$req_t_wps $rbdir/wps/$wps");
202 222
@@ -210,9 +230,9 @@ sub copywps
210 close(WPSFILE); 230 close(WPSFILE);
211 231
212 if ($#filelist >= 0) { 232 if ($#filelist >= 0) {
213 if (-e "$dir/$wps_prefix/$req_g") { 233 if (-e "$dir/$wps_prefix/$req_size") {
214 foreach $file (@filelist) { 234 foreach $file (@filelist) {
215 system("cp $dir/$wps_prefix/$req_g/$file $rbdir/wps/$wps_prefix/"); 235 system("cp $dir/$wps_prefix/$req_size/$file $rbdir/wps/$wps_prefix/");
216 } 236 }
217 } 237 }
218 elsif (-e "$dir/$wps_prefix") { 238 elsif (-e "$dir/$wps_prefix") {
@@ -235,7 +255,7 @@ sub copywps
235 255
236sub buildcfg { 256sub buildcfg {
237 my $cfg = $wps; 257 my $cfg = $wps;
238 my @out; 258 my @out;
239 259
240 $cfg =~ s/\.(r|)wps/.cfg/; 260 $cfg =~ s/\.(r|)wps/.cfg/;
241 261
@@ -247,6 +267,20 @@ sub buildcfg {
247wps: /$rbdir/wps/$wps 267wps: /$rbdir/wps/$wps
248MOO 268MOO
249; 269;
270 if(defined($sbs)) {
271 if ($sbs eq '') {
272 push @out, "sbs: -\n";
273 } else {
274 push @out, "sbs: /$rbdir/wps/$sbs\n";
275 }
276 }
277 if(defined($sbs) && $has_remote) {
278 if ($rsbs eq '') {
279 push @out, "rsbs: -\n";
280 } else {
281 push @out, "rsbs: /$rbdir/wps/$rsbs\n";
282 }
283 }
250 if($font) { 284 if($font) {
251 push @out, "font: /$rbdir/fonts/$font\n"; 285 push @out, "font: /$rbdir/fonts/$font\n";
252 } 286 }
@@ -264,7 +298,7 @@ MOO
264 } 298 }
265 if(defined($backdrop)) { 299 if(defined($backdrop)) {
266 if ($backdrop eq '') { 300 if ($backdrop eq '') {
267 push @out, "backdrop:\n"; 301 push @out, "backdrop: -\n";
268 } else { 302 } else {
269 # clip resolution from filename 303 # clip resolution from filename
270 $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; 304 $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//;
@@ -338,6 +372,8 @@ while(<WPS>) {
338 undef $wps; 372 undef $wps;
339 undef $wps_prefix; 373 undef $wps_prefix;
340 undef $rwps; 374 undef $rwps;
375 undef $sbs;
376 undef $rsbs;
341 undef $width; 377 undef $width;
342 undef $height; 378 undef $height;
343 undef $font; 379 undef $font;
@@ -386,23 +422,24 @@ while(<WPS>) {
386 foreach my $d (@depthlist) { 422 foreach my $d (@depthlist) {
387 next if ($d > $rdepth); 423 next if ($d > $rdepth);
388 424
389 $req_g = $rwidth . "x" . $rheight . "x" . $d; 425 $req_size = $rwidth . "x" . $rheight . "x" . $d;
390 426
391 # check for model specific wps 427 # check for model specific wps
392 $req_g_wps = $wps_prefix . "." . $req_g . "." . $modelname . ".wps"; 428 $req_g_wps = $wps_prefix . "." . $req_size . "." . $modelname . ".wps";
393 last if (-e "$wpsdir/$req_g_wps"); 429 last if (-e "$wpsdir/$req_g_wps");
394 430
395 $req_g_wps = $wps_prefix . "." . $req_g . ".wps"; 431 # check for normal wps (with WIDTHxHEIGHTxDEPTH)
432 $req_g_wps = $wps_prefix . "." . $req_size . ".wps";
396 last if (-e "$wpsdir/$req_g_wps"); 433 last if (-e "$wpsdir/$req_g_wps");
397 434
398 if ($isrwps) { 435 if ($isrwps) {
399 $req_g = $req_g . "." . $main_width . "x" . $main_height . "x" . "$main_depth"; 436 $req_size = $req_size . "." . $main_width . "x" . $main_height . "x" . "$main_depth";
400 437
401 $req_g_wps = $wps_prefix . "." . $req_g . ".wps"; 438 $req_g_wps = $wps_prefix . "." . $req_size . ".wps";
402 last if (-e "$wpsdir/$req_g_wps"); 439 last if (-e "$wpsdir/$req_g_wps");
403 } 440 }
404 } 441 }
405 $req_t_wps = $wps_prefix . ".txt" . ".wps"; 442 $req_t_wps = $wps_prefix . $req_t . ".wps";
406 443
407 #print "LCD: $wps wants $width x $height\n"; 444 #print "LCD: $wps wants $width x $height\n";
408 #print "LCD: is $rwidth x $rheight\n"; 445 #print "LCD: is $rwidth x $rheight\n";
@@ -454,6 +491,20 @@ while(<WPS>) {
454 elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { 491 elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
455 $rwps = $1; 492 $rwps = $1;
456 } 493 }
494 elsif($l =~ /^SBS: *(.*)/i) {
495 $sbs = $sbs_prefix = $1;
496 $sbs_prefix =~ s/\.(r|)sbs//;
497 }
498 elsif($l =~ /^SBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
499 $sbs = $sbs_prefix = $1;
500 $sbs_prefix =~ s/\.(r|)sbs//;
501 }
502 elsif($l =~ /^RSBS: *(.*)/i) {
503 $rsbs = $1;
504 }
505 elsif($l =~ /^RSBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
506 $rsbs = $1;
507 }
457 elsif($l =~ /^Author: *(.*)/i) { 508 elsif($l =~ /^Author: *(.*)/i) {
458 $author = $1; 509 $author = $1;
459 } 510 }
@@ -526,9 +577,15 @@ while(<WPS>) {
526 elsif($l =~ /^ui viewport: *(.*)/i) { 577 elsif($l =~ /^ui viewport: *(.*)/i) {
527 $listviewport = $1; 578 $listviewport = $1;
528 } 579 }
580 elsif($l =~ /^ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
581 $listviewport = $1;
582 }
529 elsif($l =~ /^remote ui viewport: *(.*)/i) { 583 elsif($l =~ /^remote ui viewport: *(.*)/i) {
530 $remotelistviewport = $1; 584 $remotelistviewport = $1;
531 } 585 }
586 elsif($l =~ /^remote ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
587 $remotelistviewport = $1;
588 }
532 else{ 589 else{
533 #print "Unknown line: $l!\n"; 590 #print "Unknown line: $l!\n";
534 } 591 }