diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-10-19 15:28:15 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-10-19 15:28:15 +0000 |
commit | 1016ee4e809776619fa9e4e773ceb1523bd7bc66 (patch) | |
tree | 585cd873c118bee7c2459205e6eb54ff3e76a21b /wps | |
parent | 00695baac0b797cbe46e7bc2999a83f73b36aae8 (diff) | |
download | rockbox-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')
-rw-r--r-- | wps/WPSLIST | 21 | ||||
-rwxr-xr-x | wps/wpsbuild.pl | 87 |
2 files changed, 93 insertions, 15 deletions
diff --git a/wps/WPSLIST b/wps/WPSLIST index 662fb82cb0..9b52416ec2 100644 --- a/wps/WPSLIST +++ b/wps/WPSLIST | |||
@@ -44,6 +44,8 @@ selector type: bar (inverse) | |||
44 | <wps> | 44 | <wps> |
45 | Name: rockbox_default.wps | 45 | Name: rockbox_default.wps |
46 | RWPS: rockbox_default.rwps | 46 | RWPS: rockbox_default.rwps |
47 | SBS: | ||
48 | RSBS: | ||
47 | Author: Rockbox team | 49 | Author: Rockbox team |
48 | Font: 08-Schumacher-Clean.fnt | 50 | Font: 08-Schumacher-Clean.fnt |
49 | Font.11x2x1: | 51 | Font.11x2x1: |
@@ -59,6 +61,8 @@ selector type: bar (inverse) | |||
59 | <wps> | 61 | <wps> |
60 | Name: boxes.wps | 62 | Name: boxes.wps |
61 | rwps: boxes.rwps | 63 | rwps: boxes.rwps |
64 | SBS: | ||
65 | RSBS: | ||
62 | Author: Christi Scarborough (after Magnus Westerlund) | 66 | Author: Christi Scarborough (after Magnus Westerlund) |
63 | Font: 08-Schumacher-Clean.fnt | 67 | Font: 08-Schumacher-Clean.fnt |
64 | Statusbar: top | 68 | Statusbar: top |
@@ -76,6 +80,8 @@ remote ui viewport: - | |||
76 | <wps> | 80 | <wps> |
77 | Name: engineeer2.wps | 81 | Name: engineeer2.wps |
78 | RWPS: engineeer2.rwps | 82 | RWPS: engineeer2.rwps |
83 | SBS: | ||
84 | RSBS: | ||
79 | Author: Magnus Westerlund | 85 | Author: Magnus Westerlund |
80 | Font: 08-Nedore.fnt | 86 | Font: 08-Nedore.fnt |
81 | Statusbar: top | 87 | Statusbar: top |
@@ -90,6 +96,8 @@ remote ui viewport: - | |||
90 | <wps> | 96 | <wps> |
91 | Name: iAmp.wps | 97 | Name: iAmp.wps |
92 | RWPS: iAmp.rwps | 98 | RWPS: iAmp.rwps |
99 | SBS: | ||
100 | RSBS: | ||
93 | Author: Raymond Hoh | 101 | Author: Raymond Hoh |
94 | Font: 12-Nimbus.fnt | 102 | Font: 12-Nimbus.fnt |
95 | backdrop: | 103 | backdrop: |
@@ -104,6 +112,8 @@ remote ui viewport: - | |||
104 | <wps> | 112 | <wps> |
105 | Name: zezayer.wps | 113 | Name: zezayer.wps |
106 | RWPS: zezayer.rwps | 114 | RWPS: zezayer.rwps |
115 | SBS: | ||
116 | RSBS: | ||
107 | Author: Jake Owen | 117 | Author: Jake Owen |
108 | Font: 08-Nedore.fnt | 118 | Font: 08-Nedore.fnt |
109 | Statusbar: top | 119 | Statusbar: top |
@@ -153,6 +163,8 @@ Statusbar: top | |||
153 | <wps> | 163 | <wps> |
154 | Name: DancePuffDuo.wps | 164 | Name: DancePuffDuo.wps |
155 | RWPS: DancePuffDuo.rwps | 165 | RWPS: DancePuffDuo.rwps |
166 | SBS: | ||
167 | RSBS: | ||
156 | Author: Chris Oxtoby | 168 | Author: Chris Oxtoby |
157 | Font: 13-Nimbus.fnt | 169 | Font: 13-Nimbus.fnt |
158 | Statusbar: top | 170 | Statusbar: top |
@@ -176,6 +188,8 @@ Statusbar: top | |||
176 | <wps> | 188 | <wps> |
177 | Name: iCatcher.wps | 189 | Name: iCatcher.wps |
178 | RWPS: iCatcher.rwps | 190 | RWPS: iCatcher.rwps |
191 | SBS: | ||
192 | RSBS: | ||
179 | Author: Ioannis Koutoulakis | 193 | Author: Ioannis Koutoulakis |
180 | Font.112x64x1: 08-Rockfont.fnt | 194 | Font.112x64x1: 08-Rockfont.fnt |
181 | Font.128x64x1: 08-Rockfont.fnt | 195 | Font.128x64x1: 08-Rockfont.fnt |
@@ -212,6 +226,8 @@ Statusbar: top | |||
212 | <wps> | 226 | <wps> |
213 | Name: UniCatcher.wps | 227 | Name: UniCatcher.wps |
214 | RWPS: UniCatcher.rwps | 228 | RWPS: UniCatcher.rwps |
229 | SBS: | ||
230 | RSBS: | ||
215 | Author: Ioannis Koutoulakis | 231 | Author: Ioannis Koutoulakis |
216 | Font: 16-GNU-Unifont.fnt | 232 | Font: 16-GNU-Unifont.fnt |
217 | Foreground Color: 000000 | 233 | Foreground Color: 000000 |
@@ -235,6 +251,8 @@ Statusbar: top | |||
235 | <wps> | 251 | <wps> |
236 | Name: Rockboxed.wps | 252 | Name: Rockboxed.wps |
237 | RWPS: rockbox_default.rwps | 253 | RWPS: rockbox_default.rwps |
254 | SBS: | ||
255 | RSBS: | ||
238 | Author: Roan Horning | 256 | Author: Roan Horning |
239 | Font.112x64x1: 08-Schumacher-Clean.fnt | 257 | Font.112x64x1: 08-Schumacher-Clean.fnt |
240 | Font.128x64x1: 08-Schumacher-Clean.fnt | 258 | Font.128x64x1: 08-Schumacher-Clean.fnt |
@@ -268,6 +286,8 @@ Author: Jens Arnold | |||
268 | <wps> | 286 | <wps> |
269 | Name: cabbiev2.wps | 287 | Name: cabbiev2.wps |
270 | RWPS: cabbiev2.rwps | 288 | RWPS: cabbiev2.rwps |
289 | SBS: | ||
290 | RSBS: | ||
271 | # Real name of the creator of the WPS | 291 | # Real name of the creator of the WPS |
272 | 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. | 292 | 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. |
273 | 293 | ||
@@ -349,6 +369,7 @@ viewers iconset.240x400x16: /.rockbox/icons/tango_small_viewers.bmp | |||
349 | 369 | ||
350 | # Whether the WPS is designed to have the statusbar on or off | 370 | # Whether the WPS is designed to have the statusbar on or off |
351 | Statusbar: top | 371 | Statusbar: top |
372 | remote statusbar: top | ||
352 | 373 | ||
353 | # list & remote ui viewports | 374 | # list & remote ui viewports |
354 | ui viewport: - | 375 | ui viewport: - |
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; | |||
32 | my @depthlist = ( 16, 8, 4, 2, 1 ); | 32 | my @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 |
35 | my $req_size; | ||
36 | my $req_g_wps; | ||
37 | my $req_t; | ||
38 | my $req_t_wps; | ||
35 | my $wps; | 39 | my $wps; |
36 | my $wps_prefix; | 40 | my $wps_prefix; |
41 | my $sbs_prefix; | ||
37 | my $rwps; | 42 | my $rwps; |
43 | my $sbs; | ||
44 | my $sbs_w_size; | ||
45 | my $rsbs; | ||
46 | my $rsbs_w_size; | ||
38 | my $width; | 47 | my $width; |
39 | my $height; | 48 | my $height; |
40 | my $font; | 49 | my $font; |
@@ -42,9 +51,6 @@ my $fgcolor; | |||
42 | my $bgcolor; | 51 | my $bgcolor; |
43 | my $statusbar; | 52 | my $statusbar; |
44 | my $author; | 53 | my $author; |
45 | my $req_g; | ||
46 | my $req_g_wps; | ||
47 | my $req_t_wps; | ||
48 | my $backdrop; | 54 | my $backdrop; |
49 | my $lineselectstart; | 55 | my $lineselectstart; |
50 | my $lineselectend; | 56 | my $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 | ||
236 | sub buildcfg { | 256 | sub 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 { | |||
247 | wps: /$rbdir/wps/$wps | 267 | wps: /$rbdir/wps/$wps |
248 | MOO | 268 | MOO |
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 | } |