# HG changeset patch # User William Roberts # Date 1277385403 -3600 # Node ID 35d98d69ca78ed33c38db460cf8a1841c0d28479 # Parent 851206cea67b601e99daf310c425a1b6a51dac1a Move s60ibymacros.pm into buildrom_plugins, and export it to epoc32\tools - bug 2901 diff -r 851206cea67b -r 35d98d69ca78 imgtools/imaker/buildrom_plugins/group/bld.inf --- a/imgtools/imaker/buildrom_plugins/group/bld.inf Mon Jun 21 17:57:23 2010 +0100 +++ b/imgtools/imaker/buildrom_plugins/group/bld.inf Thu Jun 24 14:16:43 2010 +0100 @@ -24,5 +24,6 @@ ../localise_all_resources.pm +/tools/ // ../obyparse.pm +/tools/ // ../override.pm +/tools/ // +../s60ibymacros.pm +/tools/ // // END OF BLD.INF diff -r 851206cea67b -r 35d98d69ca78 imgtools/imaker/buildrom_plugins/s60ibymacros.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imgtools/imaker/buildrom_plugins/s60ibymacros.pm Thu Jun 24 14:16:43 2010 +0100 @@ -0,0 +1,119 @@ +# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Symbian Foundation License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# S60 specific IBY file macro handling +# + +package s60ibymacros; + +BEGIN + { + use Exporter (); + our ( $VERSION, @ISA, @EXPORT ); + # set the version for version checking + $VERSION = 1.00; + + @ISA = qw( Exporter ); + @EXPORT = qw( &s60ibymacros_info &DoS60IbyModifications ); + } + +my %s60ibymacros_infostruct = + ( + name => "s60ibymacros", + invocation => "InvocationPoint1", + single => "s60ibymacros::DoS60IbyModifications" + ); + +my @newobydata; + +sub s60ibymacros_info + { + return \%s60ibymacros_infostruct; + } + +sub DoS60IbyModifications + { + my $obydata = shift; + + undef @newobydata; + foreach $line (@{$obydata}) + { + if ($line =~ /^\s*REM/i) + { + # Ignore REM statements, to avoid processing "REM __SCALABLE_IMAGE( ... )" + push @newobydata, $line; + } + elsif( ! ( HandleIconMacros($line) || HandleCenrepMacros($line) ) ) + { + push @newobydata, $line; + } + } + @{$obydata} = @newobydata; + } + +sub HandleCenrepMacros + { + my $line = shift; + if ( $line =~ m/^.*__CENREP_TXT_FILES\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/i ) + # __CENREP_TXT_FILES(dataz_, source dir, target dir) + { + my $sourcepath="$1\\$2"; + my $targetpath=$3; + my $s60extras_export_list_filename = "$sourcepath"."\\s60extras_export_list.txt"; + + open(DH, $s60extras_export_list_filename); + my @dlist = ; + chop @dlist; + close(DH); + + my $cenreptxtfile; + foreach $cenreptxtfile (@dlist) + { + if ($cenreptxtfile =~ /^\S+\.txt/) + { + push @newobydata, "data=$sourcepath\\$cenreptxtfile $targetpath\\$cenreptxtfile\n"; + } + } + return 1; + } + } + +sub HandleIconMacros + { + my $line = shift; + if ( $line =~ m/^.*__SCALABLE_IMAGE\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/i ) + # __SCALABLE_IMAGE(emulator directory, file rom dir, dataz_, resource rom dir, + # filename, resource filename) + { + + my $sourcepath="$1\\$2"; + my $targetpath=$3; + my $filename=$4; + + if( -e "$sourcepath\\$filename.mbm" ) + { + push @newobydata, "AUTO-BITMAP=$sourcepath\\$filename.mbm $targetpath\\$filename.mbm\n"; + } + if( -e "$sourcepath\\$filename.mif" ) + { + push @newobydata, "data=$sourcepath\\$filename.mif $targetpath\\$filename.mif\n"; + } + elsif( ! -e "$sourcepath\\$filename.mbm ") + { + print STDERR "* Invalid image file name: $sourcepath\\$filename.mbm or .mif\n"; + } + return 1; + } + } + +1; # Return a true value from the file \ No newline at end of file diff -r 851206cea67b -r 35d98d69ca78 imgtools/imaker/group/bld.inf --- a/imgtools/imaker/group/bld.inf Mon Jun 21 17:57:23 2010 +0100 +++ b/imgtools/imaker/group/bld.inf Thu Jun 24 14:16:43 2010 +0100 @@ -37,8 +37,6 @@ ../src/imaker_uda.mk +/tools/rom/imaker/ // ../src/imaker_variant.mk +/tools/rom/imaker/ // -../src/s60ibymacros.pm +/tools/rom/imaker/ // - // GNU make port to mingw32 (http://www.mingw.org/) ../bin/mingw_make.exe +/tools/rom/imaker/ // diff -r 851206cea67b -r 35d98d69ca78 imgtools/imaker/src/s60ibymacros.pm --- a/imgtools/imaker/src/s60ibymacros.pm Mon Jun 21 17:57:23 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -# Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of the License "Symbian Foundation License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# S60 specific IBY file macro handling -# - -package s60ibymacros; - -BEGIN - { - use Exporter (); - our ( $VERSION, @ISA, @EXPORT ); - # set the version for version checking - $VERSION = 1.00; - - @ISA = qw( Exporter ); - @EXPORT = qw( &s60ibymacros_info &DoS60IbyModifications ); - } - -my %s60ibymacros_infostruct = - ( - name => "s60ibymacros", - invocation => "InvocationPoint1", - single => "s60ibymacros::DoS60IbyModifications" - ); - -my @newobydata; - -sub s60ibymacros_info - { - return \%s60ibymacros_infostruct; - } - -sub DoS60IbyModifications - { - my $obydata = shift; - - undef @newobydata; - foreach $line (@{$obydata}) - { - if ($line =~ /^\s*REM/i) - { - # Ignore REM statements, to avoid processing "REM __SCALABLE_IMAGE( ... )" - push @newobydata, $line; - } - elsif( ! ( HandleIconMacros($line) || HandleCenrepMacros($line) ) ) - { - push @newobydata, $line; - } - } - @{$obydata} = @newobydata; - } - -sub HandleCenrepMacros - { - my $line = shift; - if ( $line =~ m/^.*__CENREP_TXT_FILES\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/i ) - # __CENREP_TXT_FILES(dataz_, source dir, target dir) - { - my $sourcepath="$1\\$2"; - my $targetpath=$3; - my $s60extras_export_list_filename = "$sourcepath"."\\s60extras_export_list.txt"; - - open(DH, $s60extras_export_list_filename); - my @dlist = ; - chop @dlist; - close(DH); - - my $cenreptxtfile; - foreach $cenreptxtfile (@dlist) - { - if ($cenreptxtfile =~ /^\S+\.txt/) - { - push @newobydata, "data=$sourcepath\\$cenreptxtfile $targetpath\\$cenreptxtfile\n"; - } - } - return 1; - } - } - -sub HandleIconMacros - { - my $line = shift; - if ( $line =~ m/^.*__SCALABLE_IMAGE\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/i ) - # __SCALABLE_IMAGE(emulator directory, file rom dir, dataz_, resource rom dir, - # filename, resource filename) - { - - my $sourcepath="$1\\$2"; - my $targetpath=$3; - my $filename=$4; - - if( -e "$sourcepath\\$filename.mbm" ) - { - push @newobydata, "AUTO-BITMAP=$sourcepath\\$filename.mbm $targetpath\\$filename.mbm\n"; - } - if( -e "$sourcepath\\$filename.mif" ) - { - push @newobydata, "data=$sourcepath\\$filename.mif $targetpath\\$filename.mif\n"; - } - elsif( ! -e "$sourcepath\\$filename.mbm ") - { - print STDERR "* Invalid image file name: $sourcepath\\$filename.mbm or .mif\n"; - } - return 1; - } - } - -1; # Return a true value from the file \ No newline at end of file