summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-04-16 09:14:36 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-04-16 09:14:36 +0000
commit6a5cc0bd25bd468c79e453fa49f353edd824141a (patch)
tree8b406e8390550ff8b87eae3214309867574657f0 /tools
parent7afe2e86931313653d4dedb6d5167c79c2822aba (diff)
downloadrockbox-6a5cc0bd25bd468c79e453fa49f353edd824141a.tar.gz
rockbox-6a5cc0bd25bd468c79e453fa49f353edd824141a.zip
Customizable icons for all bitmap targets. (FS#7013)
http://www.rockbox.org/twiki/bin/view/Main/CustomIcons for info on format and how to load them git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13177 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-xtools/buildzip.pl44
1 files changed, 41 insertions, 3 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 380c3a41e2..1dc33979af 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -61,6 +61,8 @@ while(1) {
my $firmdir="$ROOT/firmware";
+my $appsdir="$ROOT/apps";
+my $viewer_bmpdir="$ROOT/apps/plugins/bitmaps/viewer_defaults";
my $cppdef = $target;
@@ -72,8 +74,17 @@ sub gettargetinfo {
#ifdef HAVE_LCD_BITMAP
Bitmap: yes
Depth: LCD_DEPTH
+Icon Width: CONFIG_DEFAULT_ICON_WIDTH
+Icon Height: CONFIG_DEFAULT_ICON_HEIGHT
#endif
Codec: CONFIG_CODEC
+#ifdef HAVE_REMOTE_LCD
+Remote Depth: LCD_REMOTE_DEPTH
+Remote Icon Width: CONFIG_REMOTE_DEFAULT_ICON_WIDTH
+Remote Icon Height: CONFIG_REMOTE_DEFAULT_ICON_WIDTH
+#else
+Remote Depth: 0
+#endif
STOP
;
close(GCC);
@@ -84,7 +95,9 @@ STOP
open(TARGET, "$c|");
- my ($bitmap, $depth, $swcodec);
+ my ($bitmap, $depth, $swcodec, $icon_h, $icon_w);
+ my ($remote_depth, $remote_icon_h, $remote_icon_w);
+ $icon_count = 1;
while(<TARGET>) {
# print STDERR "DATA: $_";
if($_ =~ /^Bitmap: (.*)/) {
@@ -93,15 +106,31 @@ STOP
elsif($_ =~ /^Depth: (\d*)/) {
$depth = $1;
}
+ elsif($_ =~ /^Icon Width: (\d*)/) {
+ $icon_w = $1;
+ }
+ elsif($_ =~ /^Icon Height: (\d*)/) {
+ $icon_h = $1;
+ }
elsif($_ =~ /^Codec: (\d*)/) {
# SWCODEC is 1, the others are HWCODEC
$swcodec = ($1 == 1);
}
+ elsif($_ =~ /^Remote Depth: (\d*)/) {
+ $remote_depth = $1;
+ }
+ elsif($_ =~ /^Remote Icon Width: (\d*)/) {
+ $remote_icon_w = $1;
+ }
+ elsif($_ =~ /^Remote Icon Height: (\d*)/) {
+ $remote_icon_h = $1;
+ }
}
close(TARGET);
unlink("gcctemp");
- return ($bitmap, $depth, $swcodec);
+ return ($bitmap, $depth, $icon_w, $icon_h,
+ $swcodec, $remote_depth, $remote_icon_w, $remote_icon_h);
}
sub filesize {
@@ -130,7 +159,8 @@ sub buildlangs {
sub buildzip {
my ($zip, $image, $fonts)=@_;
- my ($bitmap, $depth, $swcodec) = &gettargetinfo();
+ my ($bitmap, $depth, $icon_w, $icon_h, $swcodec,
+ $remote_depth, $remote_icon_w, $remote_icon_h) = &gettargetinfo();
# print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n";
@@ -261,6 +291,14 @@ sub buildzip {
}
close VIEWERS;
+ if ($bitmap) {
+ mkdir ".rockbox/icons", 0777;
+ `cp $viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp .rockbox/icons/viewers.bmp`;
+ if ($remote_depth) {
+ `cp $viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp .rockbox/icons/remote_viewers.bmp`;
+ }
+ }
+
`cp $ROOT/apps/tagnavi.config .rockbox/`;
if($bitmap) {