summaryrefslogtreecommitdiff
path: root/wps
diff options
context:
space:
mode:
Diffstat (limited to 'wps')
-rw-r--r--wps/WPSLIST44
-rwxr-xr-xwps/wpsbuild.pl69
2 files changed, 61 insertions, 52 deletions
diff --git a/wps/WPSLIST b/wps/WPSLIST
index 13cb263865..3068f48513 100644
--- a/wps/WPSLIST
+++ b/wps/WPSLIST
@@ -346,30 +346,30 @@ selector type.160x128x2: bar (inverse)
346selector type.138x110x2: bar (inverse) 346selector type.138x110x2: bar (inverse)
347 347
348#icons 348#icons
349iconset.320x240x16: /.rockbox/icons/tango_small.bmp 349iconset.320x240x16: icons/tango_small.bmp
350iconset.128x128x16: /.rockbox/icons/tango_small.bmp 350iconset.128x128x16: icons/tango_small.bmp
351iconset.132x80x16: /.rockbox/icons/tango_small.bmp 351iconset.132x80x16: icons/tango_small.bmp
352iconset.138x110x2: /.rockbox/icons/tango_small_mono.bmp 352iconset.138x110x2: icons/tango_small_mono.bmp
353iconset.160x128x16: /.rockbox/icons/tango_small.bmp 353iconset.160x128x16: icons/tango_small.bmp
354iconset.160x128x2: /.rockbox/icons/tango_small_mono.bmp 354iconset.160x128x2: icons/tango_small_mono.bmp
355iconset.176x132x16: /.rockbox/icons/tango_small.bmp 355iconset.176x132x16: icons/tango_small.bmp
356iconset.176x220x16: /.rockbox/icons/tango_small.bmp 356iconset.176x220x16: icons/tango_small.bmp
357iconset.220x176x16: /.rockbox/icons/tango_small.bmp 357iconset.220x176x16: icons/tango_small.bmp
358iconset.240x320x16: /.rockbox/icons/tango_small.bmp 358iconset.240x320x16: icons/tango_small.bmp
359iconset.240x400x16: /.rockbox/icons/tango_small.bmp 359iconset.240x400x16: icons/tango_small.bmp
360 360
361#viewer icons 361#viewer icons
362viewers iconset.320x240x16: /.rockbox/icons/tango_small_viewers.bmp 362viewers iconset.320x240x16: icons/tango_small_viewers.bmp
363viewers iconset.128x128x16: /.rockbox/icons/tango_small_viewers.bmp 363viewers iconset.128x128x16: icons/tango_small_viewers.bmp
364viewers iconset.132x80x16: /.rockbox/icons/tango_small_viewers.bmp 364viewers iconset.132x80x16: icons/tango_small_viewers.bmp
365viewers iconset.138x110x2: /.rockbox/icons/tango_small_viewers_mono.bmp 365viewers iconset.138x110x2: icons/tango_small_viewers_mono.bmp
366viewers iconset.160x128x16: /.rockbox/icons/tango_small_viewers.bmp 366viewers iconset.160x128x16: icons/tango_small_viewers.bmp
367viewers iconset.160x128x2: /.rockbox/icons/tango_small_viewers_mono.bmp 367viewers iconset.160x128x2: icons/tango_small_viewers_mono.bmp
368viewers iconset.176x132x16: /.rockbox/icons/tango_small_viewers.bmp 368viewers iconset.176x132x16: icons/tango_small_viewers.bmp
369viewers iconset.176x220x16: /.rockbox/icons/tango_small_viewers.bmp 369viewers iconset.176x220x16: icons/tango_small_viewers.bmp
370viewers iconset.220x176x16: /.rockbox/icons/tango_small_viewers.bmp 370viewers iconset.220x176x16: icons/tango_small_viewers.bmp
371viewers iconset.240x320x16: /.rockbox/icons/tango_small_viewers.bmp 371viewers iconset.240x320x16: icons/tango_small_viewers.bmp
372viewers iconset.240x400x16: /.rockbox/icons/tango_small_viewers.bmp 372viewers iconset.240x400x16: icons/tango_small_viewers.bmp
373 373
374# Whether the WPS is designed to have the statusbar on or off 374# Whether the WPS is designed to have the statusbar on or off
375Statusbar: top 375Statusbar: top
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl
index f07ad6dc01..7e54f109cb 100755
--- a/wps/wpsbuild.pl
+++ b/wps/wpsbuild.pl
@@ -14,6 +14,7 @@ use Getopt::Long qw(:config pass_through); # pass_through so not confused by -DT
14my $ROOT=".."; 14my $ROOT="..";
15my $verbose; 15my $verbose;
16my $rbdir=".rockbox"; 16my $rbdir=".rockbox";
17my $tempdir=".rockbox";
17my $wpslist; 18my $wpslist;
18my $target; 19my $target;
19my $modelname; 20my $modelname;
@@ -23,6 +24,7 @@ GetOptions ( 'r|root=s' => \$ROOT,
23 'm|modelname=s' => \$modelname, 24 'm|modelname=s' => \$modelname,
24 'v|verbose' => \$verbose, 25 'v|verbose' => \$verbose,
25 'rbdir=s' => \$rbdir, # If we want to put in a different directory 26 'rbdir=s' => \$rbdir, # If we want to put in a different directory
27 'tempdir=s' => \$tempdir, # override .rockbox temporary dir
26 ); 28 );
27 29
28($wpslist, $target) = @ARGV; 30($wpslist, $target) = @ARGV;
@@ -72,7 +74,7 @@ my $has_remote;
72if(!$wpslist) { 74if(!$wpslist) {
73 print "Usage: wpsbuilds.pl <WPSLIST> <target>\n", 75 print "Usage: wpsbuilds.pl <WPSLIST> <target>\n",
74 "Run this script in the root of the target build, and it will put all the\n", 76 "Run this script in the root of the target build, and it will put all the\n",
75 "stuff in $rbdir/wps/\n"; 77 "stuff in $tempdir/wps/\n and build the cfg according to $rbdir";
76 exit; 78 exit;
77} 79}
78 80
@@ -135,15 +137,15 @@ sub mkdirs
135{ 137{
136 my $wpsdir = $wps; 138 my $wpsdir = $wps;
137 $wpsdir =~ s/\.(r|)wps//; 139 $wpsdir =~ s/\.(r|)wps//;
138 mkdir "$rbdir/wps", 0777; 140 mkdir "$tempdir/wps", 0777;
139 mkdir "$rbdir/themes", 0777; 141 mkdir "$tempdir/themes", 0777;
140 142
141 if( -d "$rbdir/wps/$wpsdir") { 143 if( -d "$tempdir/wps/$wpsdir") {
142 #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; 144 #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n";
143 } 145 }
144 else 146 else
145 { 147 {
146 mkdir "$rbdir/wps/$wpsdir", 0777; 148 mkdir "$tempdir/wps/$wpsdir", 0777;
147 } 149 }
148} 150}
149 151
@@ -153,7 +155,7 @@ sub copybackdrop
153 if ($backdrop ne '') { 155 if ($backdrop ne '') {
154 my $dst = $backdrop; 156 my $dst = $backdrop;
155 $dst =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; 157 $dst =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//;
156 my $cmd = "cp $ROOT/$backdrop $rbdir/$dst"; 158 my $cmd = "cp $ROOT/$backdrop $tempdir/$dst";
157 `$cmd`; 159 `$cmd`;
158 } 160 }
159} 161}
@@ -164,19 +166,19 @@ sub copythemefont
164 my $o = $_[0]; 166 my $o = $_[0];
165 167
166 $o =~ s/\.fnt/\.bdf/; 168 $o =~ s/\.fnt/\.bdf/;
167 mkdir "$rbdir/fonts"; 169 mkdir "$tempdir/fonts";
168 my $cmd ="$ROOT/tools/convbdf -f -o \"$rbdir/fonts/$_[0]\" \"$ROOT/fonts/$o\" "; 170 my $cmd ="$ROOT/tools/convbdf -f -o \"$tempdir/fonts/$_[0]\" \"$ROOT/fonts/$o\" ";
169 `$cmd`; 171 `$cmd`;
170} 172}
171 173
172sub copythemeicon 174sub copythemeicon
173{ 175{
174 #copy the icon specified by the theme 176 #copy the icon specified by the theme
175
176 if ($iconset ne '') { 177 if ($iconset ne '') {
177 $iconset =~ s/.rockbox/$rbdir/; 178 my $tempicon = $tempdir . "/" . $iconset;
178 $iconset =~ /\/(.*icons\/(.*))/i; 179 $iconset = $rbdir . "/" . $iconset;
179 `cp $ROOT/icons/$2 $1`; 180 $tempicon =~ /\/.*icons\/(.*)/i;
181 `cp $ROOT/icons/$1 $tempicon`;
180 } 182 }
181} 183}
182 184
@@ -185,9 +187,10 @@ sub copythemeviewericon
185 #copy the viewer icon specified by the theme 187 #copy the viewer icon specified by the theme
186 188
187 if ($viewericon ne '') { 189 if ($viewericon ne '') {
188 $viewericon =~ s/.rockbox/$rbdir/; 190 my $tempviewericon = $tempdir . "/" . $viewericon;
189 $viewericon =~ /\/(.*icons\/(.*))/i; 191 $viewericon = $rbdir . "/" . $viewericon;
190 `cp $ROOT/icons/$2 $1`; 192 $tempviewericon =~ /\/.*icons\/(.*)/i;
193 `cp $ROOT/icons/$1 $tempviewericon`;
191 } 194 }
192} 195}
193 196
@@ -209,20 +212,20 @@ sub copywps
209# system("cp $dir/$wps .rockbox/wps/"); 212# system("cp $dir/$wps .rockbox/wps/");
210 # check for <name>.WIDTHxHEIGHTxDEPTH.sbs 213 # check for <name>.WIDTHxHEIGHTxDEPTH.sbs
211 if (-e "$dir/$__sb") { 214 if (-e "$dir/$__sb") {
212 system("cp $dir/$__sb $rbdir/wps/$sbs"); 215 system("cp $dir/$__sb $tempdir/wps/$sbs");
213 } 216 }
214 # check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sbs and overwrite the 217 # check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sbs and overwrite the
215 # previous sb if needed 218 # previous sb if needed
216 $__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs"; 219 $__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs";
217 if (-e "$dir/$__sb") { 220 if (-e "$dir/$__sb") {
218 system("cp $dir/$__sb $rbdir/wps/$sbs"); 221 system("cp $dir/$__sb $tempdir/wps/$sbs");
219 } 222 }
220 223
221 if (-e "$dir/$req_t_wps" ) { 224 if (-e "$dir/$req_t_wps" ) {
222 system("cp $dir/$req_t_wps $rbdir/wps/$wps"); 225 system("cp $dir/$req_t_wps $tempdir/wps/$wps");
223 226
224 } elsif (-e "$dir/$req_g_wps") { 227 } elsif (-e "$dir/$req_g_wps") {
225 system("cp $dir/$req_g_wps $rbdir/wps/$wps"); 228 system("cp $dir/$req_g_wps $tempdir/wps/$wps");
226 229
227 open(WPSFILE, "$dir/$req_g_wps"); 230 open(WPSFILE, "$dir/$req_g_wps");
228 while (<WPSFILE>) { 231 while (<WPSFILE>) {
@@ -233,12 +236,12 @@ sub copywps
233 if ($#filelist >= 0) { 236 if ($#filelist >= 0) {
234 if (-e "$dir/$wps_prefix/$req_size") { 237 if (-e "$dir/$wps_prefix/$req_size") {
235 foreach $file (@filelist) { 238 foreach $file (@filelist) {
236 system("cp $dir/$wps_prefix/$req_size/$file $rbdir/wps/$wps_prefix/"); 239 system("cp $dir/$wps_prefix/$req_size/$file $tempdir/wps/$wps_prefix/");
237 } 240 }
238 } 241 }
239 elsif (-e "$dir/$wps_prefix") { 242 elsif (-e "$dir/$wps_prefix") {
240 foreach $file (@filelist) { 243 foreach $file (@filelist) {
241 system("cp $dir/$wps_prefix/$file $rbdir/wps/$wps_prefix/"); 244 system("cp $dir/$wps_prefix/$file $tempdir/wps/$wps_prefix/");
242 } 245 }
243 } 246 }
244 else { 247 else {
@@ -265,35 +268,35 @@ sub buildcfg {
265\# $cfg generated by wpsbuild.pl 268\# $cfg generated by wpsbuild.pl
266\# $wps is made by $author 269\# $wps is made by $author
267\# 270\#
268wps: /$rbdir/wps/$wps 271wps: $rbdir/wps/$wps
269MOO 272MOO
270; 273;
271 if(defined($sbs)) { 274 if(defined($sbs)) {
272 if ($sbs eq '') { 275 if ($sbs eq '') {
273 push @out, "sbs: -\n"; 276 push @out, "sbs: -\n";
274 } else { 277 } else {
275 push @out, "sbs: /$rbdir/wps/$sbs\n"; 278 push @out, "sbs: $rbdir/wps/$sbs\n";
276 } 279 }
277 } 280 }
278 if(defined($rsbs) && $has_remote) { 281 if(defined($rsbs) && $has_remote) {
279 if ($rsbs eq '') { 282 if ($rsbs eq '') {
280 push @out, "rsbs: -\n"; 283 push @out, "rsbs: -\n";
281 } else { 284 } else {
282 push @out, "rsbs: /$rbdir/wps/$rsbs\n"; 285 push @out, "rsbs: $rbdir/wps/$rsbs\n";
283 } 286 }
284 } 287 }
285 if($font) { 288 if($font) {
286 if ($font eq '') { 289 if ($font eq '') {
287 push @out, "font: -\n"; 290 push @out, "font: -\n";
288 } else { 291 } else {
289 push @out, "font: /$rbdir/fonts/$font\n"; 292 push @out, "font: $rbdir/fonts/$font\n";
290 } 293 }
291 } 294 }
292 if(defined($remotefont) && $has_remote) { 295 if(defined($remotefont) && $has_remote) {
293 if ($remotefont eq '') { 296 if ($remotefont eq '') {
294 push @out, "remote font: -\n"; 297 push @out, "remote font: -\n";
295 } else { 298 } else {
296 push @out, "remote font: /$rbdir/fonts/$remotefont\n"; 299 push @out, "remote font: $rbdir/fonts/$remotefont\n";
297 } 300 }
298 } 301 }
299 if($fgcolor && $main_depth > 2) { 302 if($fgcolor && $main_depth > 2) {
@@ -314,7 +317,7 @@ MOO
314 } else { 317 } else {
315 # clip resolution from filename 318 # clip resolution from filename
316 $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; 319 $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//;
317 push @out, "backdrop: /$rbdir/$backdrop\n"; 320 push @out, "backdrop: $rbdir/$backdrop\n";
318 } 321 }
319 } 322 }
320 if($lineselectstart && $main_depth > 2) { 323 if($lineselectstart && $main_depth > 2) {
@@ -354,7 +357,7 @@ MOO
354 if ($rwps eq '') { 357 if ($rwps eq '') {
355 push @out, "rwps: -\n"; 358 push @out, "rwps: -\n";
356 } else { 359 } else {
357 push @out, "rwps: /$rbdir/wps/$rwps\n"; 360 push @out, "rwps: $rbdir/wps/$rwps\n";
358 } 361 }
359 } 362 }
360 if(defined($listviewport)) { 363 if(defined($listviewport)) {
@@ -371,11 +374,11 @@ MOO
371 push @out, "remote ui viewport: $listviewport\n"; 374 push @out, "remote ui viewport: $listviewport\n";
372 } 375 }
373 } 376 }
374 if(-f "$rbdir/wps/$cfg") { 377 if(-f "$tempdir/wps/$cfg") {
375 print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; 378 print STDERR "wpsbuild warning: wps/$cfg already exists!\n";
376 } 379 }
377 else { 380 else {
378 open(CFG, ">$rbdir/themes/$cfg"); 381 open(CFG, ">$tempdir/themes/$cfg");
379 print CFG @out; 382 print CFG @out;
380 close(CFG); 383 close(CFG);
381 } 384 }
@@ -401,6 +404,12 @@ while(<WPS>) {
401 # skip comment 404 # skip comment
402 next; 405 next;
403 } 406 }
407
408 # prefix $rbdir with / if needed (needed for the theme.cfg)
409 unless ($rbdir =~ /\/.*/) {
410 $rbdir = "/" . $rbdir;
411 }
412
404 if($l =~ /^ *<(r|)wps>/i) { 413 if($l =~ /^ *<(r|)wps>/i) {
405 $isrwps = $1; 414 $isrwps = $1;
406 $within = 1; 415 $within = 1;