Revision: 200949
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 09:29:34 +0200
changeset 0 1bad536211fd
child 1 cf26b8579a84
Revision: 200949 Kit: 200951
dtdinstaller/bin/convert_file.pm
dtdinstaller/bin/dtd.meta
dtdinstaller/bin/dtd.mk
dtdinstaller/bin/dtd_installer.pl
dtdinstaller/config/export.mk
dtdinstaller/group/bld.inf
dtdinstaller/makefile
group/bld.inf
layers.sysdef.xml
sysdef_1_4_0.dtd
themeinstaller/bin/themeinstaller.zip
themeinstaller/group/bld.inf
widgettools/group/bld.inf
widgettools/hspluginspreinstaller/bin/hspluginpreinstaller_v_2_0.zip
widgettools/hspluginspreinstaller/group/bld.inf
widgettools/wrtwidgetpreinstaller/bin/widgetpreinstaller.zip
widgettools/wrtwidgetpreinstaller/conf/availablewrtwidgets.confml
widgettools/wrtwidgetpreinstaller/conf/availablewrtwidgets.gcfml
widgettools/wrtwidgetpreinstaller/group/bld.inf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/bin/convert_file.pm	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,399 @@
+#
+# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  
+#
+package Convert_file;
+
+# Hash of file meta information (name etc.).
+my %file_meta_info;
+
+# List of logical name entries.
+my @entries = ();
+
+sub convert_file {
+    my $file_to_process = shift;
+    
+    %file_meta_info = ();
+    @entries = ();
+    
+    # Convert LOC file to DTD...
+    if ($file_to_process =~ /\.loc$/) {
+        (my $file_to_write = $file_to_process) =~ s/\.loc$/.dtd/;
+        (my $file_log = $file_to_process) =~ s/\.loc$/.log/; 
+        &read_loc_file($file_to_process);
+        &write_dtd_file($file_to_process, $file_to_write, $file_log);        
+    }
+    # Convert DTD file to LOC...
+    elsif ($file_to_process =~ /\.dtd$/) {
+        (my $file_to_write = $file_to_process) =~ s/\.dtd$/.loc/;
+        (my $file_log = $file_to_process) =~ s/\.dtd$/.log/; 
+        &read_dtd_file($file_to_process);
+        &write_loc_file($file_to_process, $file_to_write, $file_log);        
+    }
+    else {
+        print "Unknown file format.\n";
+    }
+}
+
+# This subroutine reads DTD file into a data structure. Reading is done line
+# by line.
+# Adding extra complexity to this subroutine is the fact that ENTITY tag can
+# either be declared before attribute definitions or after them.
+sub read_dtd_file { 
+    my $file_to_process = shift;
+    
+    open(FILE, $file_to_process) 
+    or die "Can't open `$file_to_process' for reading: $!";
+    
+    my %entry;
+    my $attribute_read = "FALSE";
+    my $entity_read = "FALSE";    
+    
+    while (my $line = <FILE>) {
+        # NCR notation is used in DTD files. This is removed since it's not
+        # used in LOC files.
+        #&remove_NCR_notation(\$line);
+        chomp($line);
+        
+        SWITCH: {            
+            # Extract file meta data. 
+            # Matches eg. <FileName: "<name_of_dtd_file>">
+            if ($line =~ /\s*(<FileName|<PartOf|<FileDescription|<FileVersion)\s*:\s*".[^"]*/) {
+                (my $item_name, my $content) = 
+                                       $line =~ /\s*<(.[^\s]*)\s*:\s*"(.[^"]*)/;                
+                $file_meta_info{$item_name} = $content;
+                last SWITCH;
+            }
+            # Matches ENTITY tag eg. 
+            # <!ENTITY <logical_name> "<engineering_english_string>">
+            if ($line =~ /\s*<!ENTITY\s*.[^\s]*\s*".[^"]*/) 
+            {   
+                # Case entity -> attributes -> entity
+                if ($attribute_read eq "TRUE" && $entity_read eq "TRUE") {
+                    my %temp = %entry;
+                    %entry = ();
+                    push @entries, \%temp;                
+                    $attribute_read = "FALSE";
+                    $entity_read = "TRUE";                    
+                
+                    (my $loc_name, my $translation) = 
+                                $line =~ /\s*<!ENTITY\s*(.[^\s]*)\s*"(.[^"]*)/;
+                
+                     $entry{'logical_name'} = $loc_name;
+                     $entry{'translation'} = $translation;                     
+                }
+                # Case attributes -> entity
+                elsif ($attribute_read eq "TRUE" && $entity_read eq "FALSE") {                                   
+                    (my $loc_name, my $translation) = 
+                                $line =~ /\s*<!ENTITY\s*(.[^\s]*)\s*"(.[^"]*)/;
+                
+                     $entry{'logical_name'} = $loc_name;
+                     $entry{'translation'} = $translation;
+                     
+                     my %temp = %entry;
+                     %entry = ();
+                     push @entries, \%temp;                
+                     $attribute_read = "FALSE";
+                     $entity_read = "FALSE"; 
+                }
+                # Case: nothing has been read yet.
+                elsif ($attribute_read eq "FALSE" && $entity_read eq "FALSE") {
+                    (my $loc_name, my $translation) = 
+                                $line =~ /\s*<!ENTITY\s*(.[^\s]*)\s*"(.[^"]*)/;
+                
+                     $entry{'logical_name'} = $loc_name;
+                     $entry{'translation'} = $translation;
+                     $entity_read = "TRUE"; 
+                }
+                
+                last SWITCH;
+            }
+            # Matches attributes e.g.
+            # <logical_name>.layout "<layout>"            
+            if ($line =~ /\s*.[^\.]*(.layout|.description|.recycled|.release|.grammar|.term|.refers|.islocalizable|.item_type|.action_before|.action_after|.variables|.parents)\s*".[^"]*/) {
+                (my $item_name, my $content) = 
+                                $line =~ /\s*.[^\.]*.(.[^\s]*)\s*"(.[^"]*)/;
+                                
+                $item_name =~ s/parents/Parents/;
+                $item_name =~ s/variables/Variables/;
+                
+                $entry{$item_name} = $content;
+                last SWITCH;
+            }
+            # Matches attribute tag.
+            if ($line =~ /\s*.[^\.]*.attributes/) {
+                # Case: entity -> attributes -> attributes
+                if ($entity_read eq "TRUE" && $attribute_read eq "TRUE") {
+                    my %temp = %entry;
+                    %entry = ();
+                    push @entries, \%temp;
+                    $entity_read = "FALSE";                    
+                }   
+                $attribute_read = "TRUE";
+                
+                last SWITCH;
+            }
+        }
+    }
+
+    # Include last entry also to results. This happens if file ends with an
+    # entry where attributes are defined after ENTITY.
+    if ($attribute_read eq "TRUE" && $entity_read eq "TRUE") {        
+        my %temp = %entry;
+        %entry = ();
+        push @entries, \%temp;
+    }
+    
+    close FILE;
+}
+
+# This subroutine reads LOC file into a data structure. Reading is done line
+# by line.
+sub read_loc_file {    
+    my $file_to_process = shift;
+    
+    chmod ($file_to_process, 0777); # Make sure that file can be read, before trying to open it
+    
+    open(FILE, $file_to_process) 
+    or die "Can't open `$file_to_process' for reading: $!";
+    
+    my %entry;
+        
+    while (my $line = <FILE>) {
+        # NCR notation is used in DTD files. Not allowed characters are
+        # converted to NCR.
+        #&add_NCR_notation(\$line);
+        chomp($line);
+        
+        # Each line with #define defines a logical name/translation pair. This
+        # is saved to the data structure.
+        if ($line =~ /\s*#define\s*.[^\s]*\s*".[^"]*/) {
+                (my $item_name, my $content) = 
+                                  $line =~ /\s*#define\s*(.[^\s]*)\s*"(.*)"$/;                
+                    
+                $entry{'logical_name'} = $item_name;
+                $entry{'translation'} = $content;
+                my %temp = %entry;
+                %entry = ();
+                push @entries, \%temp;
+        }                
+    }    
+    
+    close FILE;
+}
+
+# This subroutine writes the data into a LOC file.
+sub write_loc_file {  
+    my $file_to_process = shift;
+    my $file_to_write = shift;
+    my $file_log = shift;
+    
+    open(my $file_handle, ">$file_to_write") 
+    or die "Can't open `$file_to_write' for writing: $!";
+        
+    open(my $log_file_handle, ">$file_log") 
+    or die "Can't open `$file_log' for writing: $!";
+    
+    my $tstamp = localtime(time);  
+    
+    print $log_file_handle "Log created $tstamp:\n" . 
+                           "Errors and warnings for conversion of " .
+                           "$file_to_process to $file_to_write\n\n";
+    
+    # Write file header info. Mostly static text.
+    &write_loc_header($file_handle);
+    
+    print $file_handle "\n";
+    
+    # This array defines the order in which attributes are written to a LOC
+    # file.
+    my @fields = ("item_type", "action_before", "action_after", "grammar", 
+               "refers", "Parents", "Variables");
+    
+    for my $i (0 .. $#entries) {
+        # Analyze entry for correctness and report possible errors.
+        &print_dtd_errors_and_warnings(\%{$entries[$i]}, $log_file_handle);
+        
+        # Seach for attributes and write them to output if found.
+        for my $y (0 .. $#fields) {
+            if (exists($entries[$i]{$fields[$y]})) {
+                print $file_handle 
+                         "//d: [$fields[$y]] : \"$entries[$i]{$fields[$y]}\"\n";
+            }
+        }   
+        
+        print $file_handle "//d: $entries[$i]{'description'}\n";
+        print $file_handle "//l: $entries[$i]{'layout'}\n";
+        print $file_handle "//r: $entries[$i]{'release'}\n";
+            
+        print $file_handle "#define $entries[$i]{'logical_name'}" . 
+                           " \"$entries[$i]{'translation'}\"\n\n";        
+    }
+    
+    close $file_handle;
+    close $log_file_handle;
+}
+
+sub print_dtd_errors_and_warnings {
+    my $entry_ref = shift;
+    my $log_file_handle = shift;    
+    
+    # Either description or item_type and action_before should be defined.
+    if (!exists($entry_ref->{'description'}) && 
+       !(exists($entry_ref->{'item_type'}) && 
+        exists($entry_ref->{'action_before'})))
+    {
+        print $log_file_handle "ERROR: $entry_ref->{'logical_name'} " .
+                               "does not have any description data!\n";
+    }
+    if (!exists($entry_ref->{'layout'})) {
+        print $log_file_handle "ERROR: $entry_ref->{'logical_name'} " .
+                               "missing layout definition!\n";
+    }
+    if (!exists($entry_ref->{'release'})) {
+        print $log_file_handle "ERROR: $entry_ref->{'logical_name'} " .
+                               "missing release information!\n";
+    }
+    if (!exists($entry_ref->{'Parents'})) {
+        print $log_file_handle "ERROR: $entry_ref->{'logical_name'} " .
+                               "missing parent reference!\n";
+    }
+    # Grammar should be defined if translation is a single word.
+    if (!($entry_ref->{'translation'} =~ /\s/) && 
+        !exists($entry_ref->{'grammar'})) {
+        print $log_file_handle "\tWARNING: $entry_ref->{'logical_name'} " .
+                               "is a single word, but no grammar data is " .
+                               "given!\n";
+    }
+    # Variables should be defined if translation contains variables.
+    if ($entry_ref->{'translation'} =~ /\%/ &&
+        !exists($entry_ref->{'Variables'})) {
+        print $log_file_handle "\tWARNING: $entry_ref->{'logical_name'} " .
+                               "has a variable or parameter, but no variable " .
+                               "data is given!\n";
+    }    
+}
+
+# This subroutine writes the data into a DTD file. Only ENTITY definitions are 
+# written i.e. no attribute definitions.
+sub write_dtd_file {
+    my $file_to_process = shift;
+    my $file_to_write = shift;
+    my $file_log = shift;
+    
+    open(my $file_handle, ">$file_to_write") 
+    or die "Can't open `$file_to_write' for writing: $!";
+    
+    open(my $log_file_handle, ">$file_log") 
+    or die "Can't open `$file_log' for writing: $!";
+    
+    my $tstamp = localtime(time);  
+    
+    print $log_file_handle "Log created $tstamp:\n" . 
+                           "Errors and warnings for conversion of " .
+                           "$file_to_process to $file_to_write\n\n";
+    
+    # Write file header info. Mostly static text.
+    my $file_name = "";    
+    if ($file_to_process =~ /\//) {
+        ($file_name) = $file_to_process =~ /\/(.[^\/]*)$/;
+    }
+    else {
+        $file_name = $file_to_process;
+    }    
+    &write_dtd_header($file_handle, $file_name);
+    
+    for my $i (0 .. $#entries) {
+        print $log_file_handle "Found $entries[$i]{'logical_name'}\n";
+        
+        $entries[$i]{'translation'} =~ s/\\"/&quot;/g;
+        
+        print $file_handle "<!ENTITY $entries[$i]{'logical_name'}" . 
+                           " \"$entries[$i]{'translation'}\">\n";        
+    }
+
+    close $file_handle;
+    close $log_file_handle;    
+}
+
+sub write_loc_header {
+    my $file_handle = shift;
+    print $file_handle <<EOT;
+CHARACTER_SET UTF8
+// This file is best viewed with a non-proportian font, such as Courier
+// Or copied into a spreadsheet application.
+/*
+* ============================================================================
+* Name        :  $file_meta_info{'FileName'}
+* Part Of     :  $file_meta_info{'PartOf'}
+* Version     :  $file_meta_info{'FileVersion'}
+* 
+* Description :  $file_meta_info{'FileDescription'}
+* 
+* Copyright © 2005 Nokia Corporation. This material, including
+* documentation and any related computer programs, is protected by
+* copyright controlled by Nokia Corporation. All rights are reserved.
+* Copying, including reproducing, storing, adapting or translating, any
+* or all of this material requires the prior written consent of Nokia
+* Corporation. This material also contains confidential information
+* which may not be disclosed to others without the prior written consent
+* of Nokia Corporation.
+* ============================================================================
+*/
+EOT
+}
+
+sub write_dtd_header {  
+    my $file_handle = shift;
+    my $file_to_process = shift;
+    
+    my $tstamp = localtime(time);    
+    
+    print $file_handle <<EOT;
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+DTD file generated from $file_to_process
+$tstamp 
+by LocDTDConverter
+-->
+EOT
+}
+
+# Subroutine to add NCR notation to string.
+sub add_NCR_notation {
+    my $string = shift;
+    # Replace characters with NCR notation. 'eh' is used to denote &# character
+    # sequence. If this is not used then &# sequence would be also replaced with
+    # NCR.
+    $$string =~ s/'/eh39;/g;
+    $$string =~ s/\%/eh37;/g;    
+    $$string =~ s/>/eh62;/g;
+    $$string =~ s/</eh60;/g;
+    $$string =~ s/&/eh38;/g;
+    
+    $$string =~ s/eh(\d{2});/&#$1;/g;    
+}
+
+# Subroutine to remove NCR notation from a string.
+sub remove_NCR_notation {
+    my $string = shift;
+    
+    $$string =~ s/&#39;/'/g;    
+    $$string =~ s/&#37\;/\%/g;
+    $$string =~ s/&#38;/&/g;
+    $$string =~ s/&#62;/>/g;
+    $$string =~ s/&#60;/</g;
+}
+
+1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/bin/dtd.meta	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,8 @@
+# Meta information for widget file generation
+#
+# Copyright (c) 2008 Nokia Corporation.  All rights reserved.
+#
+
+platform	win32
+makefile 	gnumake
+techstream	tools
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/bin/dtd.mk	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,107 @@
+#
+# Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+# To ensure that EPOCROOT always ends with a forward slash
+TMPROOT:=$(subst \,/,$(EPOCROOT))
+EPOCROOT:=$(patsubst %/,%,$(TMPROOT))/
+
+ifndef SWITCH_LOC_FILE_NAME
+$(error switch loc file unknown)
+endif
+
+DTD_INSTALLER_TOOL := perl $(EPOCROOT)epoc32/tools/dtd_installer.pl
+
+ifdef SWITCH_LOC_FILE_PATH
+SWITCH_LOC_FILE_PATH := $(EPOCROOT)$(SWITCH_LOC_FILE_PATH)
+endif
+
+# default type is dtd (Theme installer is not called, only loc_to_dtd_converter.pl !)
+ifndef DTD_TYPE
+  DTD_TYPE := dtd
+endif
+
+
+ifeq ($(DTD_TYPE),widget)
+  ifndef DTD_PRIVATE_LOCATION
+    DTD_PRIVATE_LOCATION := z/private/200159c0/install
+  endif
+  ifeq ($(PLATFORM),WINSCW)
+        PRODUCTIZATION_LOCATION := $(EPOCROOT)epoc32/release/winscw/$(CFG)/$(DTD_PRIVATE_LOCATION)
+  endif
+  ifeq ($(PLATFORM),ARMV5)
+  		PRODUCTIZATION_LOCATION := $(EPOCROOT)epoc32/data/$(DTD_PRIVATE_LOCATION)
+  endif
+else # Type is DTD by default
+  ifndef DTD_PRIVATE_LOCATION
+    DTD_PRIVATE_LOCATION := z/private/200113DD/content
+  endif
+  ifeq ($(PLATFORM),WINSCW)
+        PRODUCTIZATION_LOCATION := $(EPOCROOT)epoc32/release/winscw/$(CFG)/$(DTD_PRIVATE_LOCATION)
+  endif
+  ifeq ($(PLATFORM),ARMV5)
+  		PRODUCTIZATION_LOCATION := $(EPOCROOT)epoc32/data/$(DTD_PRIVATE_LOCATION)
+  endif
+endif
+
+ifndef DTD_OUTPUT_LOCATION
+  DTD_OUTPUT_LOCATION := $(PRODUCTIZATION_LOCATION)
+else 
+  DTD_OUTPUT_LOCATION := $(EPOCROOT)$(DTD_OUTPUT_LOCATION)
+endif 
+
+DTD_INSTALLER_TOOL := $(DTD_INSTALLER_TOOL) -o $(DTD_OUTPUT_LOCATION) -n $(SWITCH_LOC_FILE_NAME) -t $(DTD_TYPE)
+
+ifdef LOC_FOLDERS
+	DTD_INSTALLER_TOOL := $(DTD_INSTALLER_TOOL) -f force
+endif
+
+ifdef DEBUG_MODE
+	DTD_INSTALLER_TOOL := $(DTD_INSTALLER_TOOL) -d yes
+endif
+
+DTD_INSTALLER_TOOL_BUILD := $(DTD_INSTALLER_TOOL) -a build
+DTD_INSTALLER_TOOL_CLEAN := $(DTD_INSTALLER_TOOL) -a clean
+DTD_INSTALLER_TOOL_WHAT := $(DTD_INSTALLER_TOOL) -a what
+
+#OUTPUT_PATH
+
+# DTD tool will be invoked here
+DO_DTD_BUILD:
+	$(DTD_INSTALLER_TOOL_BUILD)
+DO_DTD_CLEAN:	
+	$(DTD_INSTALLER_TOOL_CLEAN)
+DO_DTD_WHAT:	
+	$(DTD_INSTALLER_TOOL_WHAT)
+
+	
+BLD SAVESPACE: DO_NOTHING
+CLEAN : DO_DTD_CLEAN
+RELEASABLES :	DO_DTD_WHAT
+	
+DO_NOTHING :
+	@echo do nothing
+	
+MAKMAKE : 
+FREEZE : DO_NOTHING
+LIB : DO_NOTHING
+CLEANLIB : DO_NOTHING
+RESOURCE : DO_DTD_BUILD
+FINAL : DO_NOTHING
+
+FINAL FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE MAKMAKE :
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/bin/dtd_installer.pl	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,470 @@
+#
+# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  A tool that install widgets and dtd files.
+#  Tool is mainly meant to be used via dtd.mk makefile template,
+#  but can be run as such also.
+#
+
+use strict;
+
+#Tools path
+use constant LIBPATH => '/epoc32/tools';
+use lib  LIBPATH;
+
+use Cwd;
+use Getopt::Long;
+use Convert_file; # for .dtd to .loc file conversion
+use File::Copy;
+use File::Find; # for finding
+use File::Path; # mkpath
+use File::Basename; # fileparse
+
+if ( $#ARGV < 1)
+        {
+         print <<USAGE;
+Usage: dtd_installer.pl -n dtd_name [-t type][-l dtd_location] [-s sub_folder_name] [-o output_location] [-a action_type] [-f force_create] [-d debug]
+ -n: widget or dtd (switch_loc) file name
+ -t: optional, default type is dtd and other possibility is widget
+ -l: optional, input path location, 
+ default for widget type is \\epoc32\\data\\z\\resource\\homescreen
+ default for dtd is \\epoc32\\include\\domain\\<layer>\\loc
+ -s: optional, for widgets only, default are xuikon and hsps
+ -o: optional, default is \\epoc32\\release\\winscw\\udeb\\z\\private\\200159c0\\install
+ -a: optional, default is build other possible are what and clean
+ -f: optional, for widgets only, themeinstaller is always run for xuikon, even switch loc file don\'t exist
+ -d: optional, for debugging purposes (e.g. temporary folders aren't deleted)
+ 
+Example how to run for dtd files only: 
+ dtd_installer.pl -n matrixmenudata -o \\epoc32\\data\\z\\private\\200113DD\\content
+Example how to run for one widget: 
+ dtd_installer.pl -n view -t type widget
+Example how to run for all widgets:
+ dtd_installer.pl -n all_widgets -t type widget -d yes
+
+USAGE
+	exit -1;
+	}
+
+my ($dtd_name, $dtd_type, $dtd_location, $sub_folder_name, $output_location, $action_type, $force_create, $debug, $what_output_file);
+my (@all_dirs, @find_files, @files_to_convert);
+my @sub_folders=("xuikon","hsps");
+my @layers=("\\epoc32\\include\\domain\\osextensions\\loc", "\\epoc32\\include\\domain\\middleware\\loc", "\\epoc32\\include\\domain\\applications\\loc", "\\epoc32\\include\\platform\\loc", "\\epoc32\\include\\platform\\mw\\loc", "\\epoc32\\include\\platform\\app\\loc");
+my $themeinstaller_tool = "\\epoc32\\tools\\themeinstaller\\themeinstaller.bat";
+my $themeinstaller_property_file = "\\epoc32\\tools\\themeinstaller\\data\\widgetinstaller.prop";
+
+# Set this to 1 if you need to debug the script
+# $debug = 1;
+
+GetOptions(
+	'n=s' => \$dtd_name,
+	't=s' => \$dtd_type,
+	'l=s' => \$dtd_location,
+	's=s' => \$sub_folder_name,
+	'o=s' => \$output_location,
+	'a=s' => \$action_type,
+	'd=s' => \$debug,
+	'f=s' => \$force_create );
+
+check_options();
+
+if (($action_type eq "what") && (-e $what_output_file)) {
+	open( WHAT, $what_output_file) or die $!;
+	while( <WHAT> ){
+		print ;
+	}
+	close WHAT;
+	exit;
+} elsif (($action_type eq "clean") && (-e $what_output_file)) {
+	unlink $what_output_file;
+}
+
+if ($dtd_type eq "widget") {
+	if ((lc $dtd_name) eq "all_widgets") {
+		# read all widget names from given directory
+		opendir(SDIR, $dtd_location) or die("ERROR: dtd_installer.pl, can not open $dtd_location\n");
+		@all_dirs = grep !/^\.\.?$/, readdir SDIR;
+		closedir(SDIR);
+		if (!@all_dirs) {
+			warn"ERROR: dtd_installer.pl, couldn't find any widgets:\n";
+			die;
+		}	
+		foreach my $temp_dtd_name (@all_dirs) {
+			$dtd_name = $temp_dtd_name;
+			my  $dir = "${dtd_location}\\${dtd_name}";
+			if (-d $dir) { # Calling process_widget sub routine for every directory
+					process_widget();
+			}
+		}		
+	} else { # Only one widget processed
+		process_widget();
+	}
+} else {
+	# Run only .loc to .dtd conversion for non widgets
+	process_dtd($output_location, $dtd_name);
+}
+
+sub process_widget
+{
+  
+  foreach my $sub_f (@sub_folders) {
+  	my @lang_dirs;
+  	if ($debug) { print "Current subfolder:\n $sub_f\n"; }
+  	${sub_folder_name} = $sub_f;
+  	if ($debug) { print "Processing widget:\n${dtd_location}\\${dtd_name}\n"; }
+  	
+  	my $current_time = time;
+  	my $full_dtd_input_path = "${dtd_location}\\${dtd_name}\\${sub_folder_name}";
+  	my $full_dtd_output_path = "${output_location}\\${dtd_name}\\${sub_folder_name}";
+  	my $temp_path = "${dtd_location}\\${dtd_name}\\temp";
+  	my $temp_loc_path = "${dtd_location}\\${dtd_name}\\${sub_folder_name}\\temp";
+  	my $temp_dtd_path = "${temp_path}\\$current_time";
+  	my $temp_loc_files_path = "${temp_loc_path}\\$current_time";
+  	my $no_success = 1;
+  	my $count = 0;
+
+  	while ($no_success) { # make sure that temporary directory isn't already in the use
+  		undef $no_success;
+  		$current_time = time;
+  		$temp_dtd_path = "${temp_path}\\$current_time";
+			mkpath $temp_dtd_path or $no_success=1;
+			sleep 1; 
+			$count++;
+			if ($count > 100 ) { warn: "ERROR: dtd_installer.pl, couldn't create temp directory $temp_dtd_path !!!\nDtd_installer\.pl script stopped\n";	die;}
+		}
+		$count = 0;
+		$no_success = 1;
+  	while ($no_success) { # make sure that temporary directory isn't already in the use
+  		undef $no_success;
+  		$current_time = time;
+  		$temp_loc_files_path = "${temp_loc_path}\\$current_time";
+			mkpath $temp_loc_files_path or $no_success=1;
+			sleep 1; 
+			$count++;
+			if ($count > 100 ) { warn: "ERROR: dtd_installer.pl, couldn't create temp directory $temp_loc_files_path!!!\nDtd_installer\.pl script stopped\n";	die;}
+		}
+ 	
+  	if ($debug) { print "Full dtd input path:\n$full_dtd_input_path\n"; }
+  	if ($debug) { print "Full dtd output path:\n$full_dtd_output_path\n"; }
+  	opendir(SDIR, $full_dtd_input_path) or die("ERROR: dtd_installer.pl, can not open $full_dtd_input_path\n");
+		@lang_dirs = grep !/^\.\.?$/, readdir SDIR;
+  	closedir(SDIR);
+  	
+  	
+  	if (${sub_folder_name} eq "xuikon") { # Copy engineering english files always to 00 folder
+			copy_files($full_dtd_input_path,"${temp_loc_files_path}\\00");
+  	} else{ #hsps folder
+  		copy_files($full_dtd_input_path,"${full_dtd_output_path}\\00");
+  	}
+
+	
+  	foreach my $lang_id (@lang_dirs) {		# generate localized .dtd files
+
+  		my $dtd_temp = "${full_dtd_input_path}\\${lang_id}";
+  		if ((-f $dtd_temp) && ($lang_id =~ /.dtd/i) ) { # running loc to dtd for all .dtd files
+  				if ($debug) { print "Dtd file found:\n$dtd_temp\n"; }
+  				
+  				if (${sub_folder_name} eq "xuikon") { # generate xuikon .dtd files to temp path
+  					if ($debug) { print "Widget type DTD, xuikon subfolder\n"; }
+  				  process_dtd($temp_loc_files_path, $lang_id);
+  			  } else{ #hsps folder
+  			  	if ($debug) { print "Widget type DTD, hsps subfolder\n"; }
+	  				process_dtd($full_dtd_output_path, $lang_id);
+  			  }  			  
+  		} elsif ((${sub_folder_name} eq "xuikon") && ($force_create ne "") && (-d $dtd_temp)) {
+  			copy_files($dtd_temp,"${temp_loc_files_path}\\${lang_id}");
+  		}
+		}
+		
+		if (${sub_folder_name} eq "xuikon") { # generate localized files
+			if (!(-f $themeinstaller_tool)) { die("ERROR: dtd_installer.pl, can not find themeinstaller: $themeinstaller_tool\n");	}
+			if (!(-f $themeinstaller_property_file)) { die("ERROR: dtd_installer.pl, can not find themeinstaller property file: $themeinstaller_property_file\n");	}
+			
+	  	if (-d $temp_loc_files_path) {
+	  		opendir(SDIR, $temp_loc_files_path) or die("ERROR: dtd_installer.pl, can not open $temp_loc_files_path\n");
+				@lang_dirs = grep !/^\.\.?$/, readdir SDIR;
+	  		closedir(SDIR);
+		  	
+		  	foreach my $lang_id (@lang_dirs) {		
+		  		my $lang_dir = "$temp_loc_files_path\\$lang_id";
+		  		if ($debug) { print"Language directory:\n$lang_dir\n"; }
+		  		if (-d $lang_dir) { # Running themeinstaller for all language folders in temp path
+		  			my $temp_dir = "$temp_dtd_path\\$lang_id";
+		  			copy_files($full_dtd_input_path, "$temp_dir");
+		  			my $lang_temp_dir = "$full_dtd_input_path\\$lang_id";
+		  			if (-d $lang_temp_dir) {
+		  				copy_files("$lang_temp_dir", "$temp_dir");
+		  			}
+		  			copy_files("$temp_loc_files_path\\$lang_id", "$temp_dir");
+	  			  if  (($action_type eq "build") || ($debug)) {	
+	  			  	print ("Calling themeinstaller: \n$themeinstaller_tool $temp_dtd_path\\${lang_id}\\${dtd_name}.dat $temp_dtd_path\\${lang_id} -prop:${themeinstaller_property_file}\n"); 
+	  			  	system ("$themeinstaller_tool","$temp_dtd_path\\${lang_id}\\${dtd_name}.dat","$temp_dtd_path\\${lang_id}", "-prop:${themeinstaller_property_file}");
+	  			  } else {
+	  			  	system ("$themeinstaller_tool","$temp_dtd_path\\${lang_id}\\${dtd_name}.dat","$temp_dtd_path\\${lang_id}", "-prop:${themeinstaller_property_file}", ">$temp_dtd_path\\${lang_id}\\themeinstaller.log", "2>&1" );
+	  			  }
+	  				copy_files("$temp_dir", "$full_dtd_output_path\\$lang_id", "recursive");
+		  		}
+		  	}
+		  }
+	  }
+	  
+	  if ($debug) { 
+	  	print "Widget processed: ${dtd_name} \n"; 
+	  } else {
+		  # Remove all temporary directories
+			if (-d $temp_dtd_path) { rmtree ($temp_dtd_path);	}
+			if (-d $temp_loc_files_path) { rmtree ($temp_loc_files_path);	}
+			rmdir $temp_path;
+			rmdir $temp_loc_path;
+		}
+	}
+}
+
+sub process_dtd {
+	
+	my $output_path = shift;
+	my $switch_loc_name = shift;
+	$switch_loc_name =~ s/.dtd//i;; # remove the .dtd extension
+	my $input_path = $dtd_location;
+	my ($found, $loc_file);
+	if ($action_type eq "build") { print "Used switch loc file name:\n${switch_loc_name}\n"; }
+	if ($debug) { print "Used input path:\n${input_path}\n"; }
+	if ($debug) { print "Used output path:\n${output_path}\n"; }
+	
+	foreach (@layers) {
+		$input_path = $_;
+			if ($debug) { print("Used switch loc file path:\n${input_path}\n"); }
+			my $loc_file = "${input_path}\\${switch_loc_name}.loc";
+			if (-e $loc_file) {
+				convert_locs_to_dtds($loc_file, $input_path, $output_path);
+				$found = "yes";
+			} 
+		}
+		if ($found ne "yes") {
+			warn "ERROR: dtd_installer.pl, no .loc file found:\n${switch_loc_name}.loc\n";
+		}
+}
+
+sub check_options {
+	
+	if ($dtd_name eq "") {
+		warn: "ERROR: dtd_installer.pl, no widget name given!!!\nDtd_installer\.pl script stopped\n";
+		die;
+	}
+
+	if ($dtd_type eq "") {
+		$dtd_type = "dtd";
+	}
+
+	if ($dtd_location eq "") {
+		if ($dtd_type eq "widget") {
+			$dtd_location = "\\epoc32\\data\\z\\resource\\homescreen";
+		}
+	} else {
+		if ($dtd_type eq "dtd") {
+		  undef @layers;
+	 	 	@layers[0]=${dtd_location};
+	 	}
+	}
+	
+	if ($output_location eq "") {
+		$output_location = "\\epoc32\\release\\winscw\\udeb\\z\\private\\200159c0\\install";
+	}
+	
+	if (${sub_folder_name} ne ""){
+	  undef @sub_folders;
+	  @sub_folders[0]=${sub_folder_name};
+  }
+
+	if ($action_type eq "") {
+		$action_type = "build";
+	} 
+	
+	$dtd_location =~ s/\//\\/g;    #Change / marks to \
+	$output_location =~ s/\//\\/g;    #Change / marks to \
+	$what_output_file = $output_location;
+	$what_output_file =~ s/\\/_/g; #Change \ marks to _
+	$what_output_file = "\\epoc32\\build\\dtd_installer\\" . $what_output_file . $dtd_name . ".txt";
+	if ( !-d "/epoc32/build/dtd_installer") { mkdir("/epoc32/build/dtd_installer"); }
+	if ($debug) { print "Output what file: $what_output_file\n"; }
+}
+
+# This subroutine moves files to/from temporary themeinstaller location.
+sub copy_files {
+    my $in_path = shift;
+    my $out_path = shift;
+    my $recursive = shift;
+	 	if ($debug) { print "Copying from: $in_path\n"; }
+	 	if ($debug) { print "To: $out_path\n"; }
+    
+    if ($recursive) {
+  	  	find( \&getFiles, $in_path );
+  	} else {
+				opendir(SDIR, $in_path) or die("ERROR: dtd_installer.pl, can not open $in_path\n");
+				@find_files = grep !/^\.\.?$/, readdir SDIR;
+				closedir(SDIR);  	
+		}
+		
+		foreach my $file (@find_files) {
+				my $in_file = "${in_path}\\${file}";
+				my $out_file= "${out_path}\\${file}";			
+				if ($recursive) {
+					$in_file = $file;
+		    	$file =~ /.*\\(.*)\\.*\\.*\\.*\\(.*)\\(.*)/i;  	
+		    	my $temp=$1; # lang code	
+		    	my $temp2=$3;	# file name
+		    	if ((lc $2) eq "sources") {
+		    		$out_file = "${out_path}\\$2\\$3";
+		    	} else {
+		    		if (length($temp) > 4) { #skip extra files
+		    			next;
+		    		}
+            while (length($temp) < 4){ $temp = "0".$temp; }
+			    	$temp2 =~ s/\d{4}/$temp/g; # change .odt filename for correct lang
+		    		$out_file = "${out_path}\\$temp2";
+		    	}
+	  		}
+				if ($debug) { print "Copying file from: $in_file\n"; }
+			 	if ($debug) { print "To: $out_file\n"; }
+				if (-f $in_file){
+					if ($action_type eq "build") {
+						if ((!($out_file =~ /\\temp\\/i))) {write_what_file("$out_file")};
+						xcopy($in_file,$out_file);
+					} elsif ($action_type eq "clean") {
+						if (!($out_file =~ /\\temp\\/i)) {
+							unlink $out_file;
+							my $temp_dir_path = $out_file;
+							$temp_dir_path =~ /(.*)\\.*/;
+							$temp_dir_path = $1;
+							rmdir $temp_dir_path; # Try to remove empty language directories
+						} else {
+							xcopy($in_file,$out_file);
+						}
+					} elsif ($action_type eq "what") {
+						if (!($out_file =~ /\\temp\\/i)) {
+							write_what_file("$out_file");
+							print("$out_file\n");
+						} else {
+							xcopy($in_file,$out_file);
+						}
+					} else {
+						warn ("ERROR: dtd_installer.pl, unknown action type");	
+					}
+		 		} else {
+		 				if ($debug) { print "Not file found: $in_file\n"; }
+		 		}
+ 		}	
+}
+
+# This subroutine converts LOC files to DTD files. Files that are  
+# listed in the switch_loc file are converted to DTD files.
+
+sub convert_locs_to_dtds {
+    my $switch_loc_file = shift;
+    my $in_path = shift;
+    my $out_path = shift;
+        
+    open(my $switch_loc_file_handle, "$switch_loc_file") 
+    or die "Can't open `$switch_loc_file' for reading: $!";
+    
+    # Read localised .loc file names from used input switch loc file
+    while (my $line = <$switch_loc_file_handle>) {
+        chomp($line);
+        if (($line =~ "include") && (!($line =~ /\<sc\//i)) && (!($line =~ /\<00\//i)) ){ # Read all lines that contains include, except sc and 00
+	       	$line=~ /.*\<(.*)\>.*/;
+  	     	$line=$1;
+        	$line =~ s/\//\\/g;    #Change / marks to \
+        	if ($debug) { print"Adding localised file to conversion list:\n$line\n"; }
+        	push @files_to_convert, $line;
+        }
+    }
+    
+    close $switch_loc_file_handle;
+    
+  # Process all the .loc files.
+  foreach (@files_to_convert) {
+  	my $loc_file = "$in_path\\$_";
+  	my $out_file = "$out_path\\$_";
+  	$out_file =~ s/_\d{2,5}(.{4})$/$1/i; # remove the language code from the file name.
+    if ($debug) { print"Trying to convert file:\n$loc_file\n"; }
+		if ($debug) { print"To out file:\n$out_file\n"; }
+    if (-f $loc_file) {
+			if (($action_type eq "build") || ((${dtd_type} eq "widget") && (${sub_folder_name} eq "xuikon")) ) {
+#old 				if ((!($out_file =~ /\\temp\\/i))) {write_what_file("$out_file")};
+				xcopy($loc_file,$out_file);
+    			Convert_file::convert_file($out_file);
+				if ((!($out_file =~ /\\temp\\/i))) {
+					my $convert_out_file = $out_file;
+					$convert_out_file =~ s/\.loc/\.dtd/; # replace .loc with .dtd 
+					write_what_file("$convert_out_file");
+				}
+		  		if (!($debug)) { unlink $out_file; } # Delete the copied .loc file
+		  		$out_file =~ s/\.loc/\.log/; # replace .loc with .log
+		  		if (!($debug)) { unlink $out_file; } # Delete the conversion .log file
+			} elsif ($action_type eq "clean") {
+				$out_file =~ s/\.loc/\.dtd/; # replace .loc with .dtd
+				unlink $out_file; # delete the output file
+				my $temp_dir_path = $out_file;
+				$temp_dir_path =~ /(.*)\\.*/;
+				$temp_dir_path = $1;
+				rmdir $temp_dir_path; # Try to remove empty language directories
+			} elsif (($action_type eq "what") && (!($out_file =~ /\\temp\\/i))) {
+				$out_file =~ s/\.loc/\.dtd/; # replace .loc with .dtd
+				print("$out_file\n");
+				write_what_file("$out_file");
+			}
+    } else {
+   		warn "ERROR: dtd_installer.pl, no .loc file found: $loc_file\n";
+   	}
+  }
+}
+
+# This subroutine is for file copying
+sub xcopy
+{
+    my $source = shift;
+    my $dist = shift;
+    
+    # if distination file exist then clear read flag
+    if (-f $dist)
+    {
+        chmod ($dist , 0755);
+    }
+    else
+    {
+        my($n, $d, $ext) = fileparse($dist, '\..*');
+        # check weather distination directory exist or not. If directory doesn't exist then create it.
+        -d $d || mkpath($d, 0, 0x755);
+    }
+    
+    # copy source to distination
+    copy($source,$dist);
+}
+
+# read files from given path to filelist
+sub getFiles {
+	my $file_name = $File::Find::name;
+	$file_name =~ s/\//\\/g;    #Change / marks to \
+	chomp $file_name;
+	next if ( -d $file_name ); # Skip directories
+	next if ((!($file_name =~ /o0000/i)) && (!($file_name =~ /\/sources\//i))); # Skip other then resource and source files
+	push @find_files, $file_name;
+}
+
+sub write_what_file {
+	my $out = shift;
+	open( WHAT, ">>$what_output_file") or die $!;
+		print WHAT "$out\n";
+	close WHAT;
+	
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/config/export.mk	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+# dtdinstaller's actual configuration export makefile
+
+MAKEFILE =	/sf/tools/homescreentools/dtdinstaller/config/export.mk
+$(call push,MAKEFILE_STACK,$(MAKEFILE))
+
+DTDINSTALLERFILES =	$(MAKEFILEDIR)../bin/dtd_installer.pl													/epoc32/tools/ \
+													$(MAKEFILEDIR)../bin/convert_file.pm										/epoc32/tools/ \
+													$(MAKEFILEDIR)../bin/dtd.meta														/epoc32/tools/makefile_templates/tools/ \
+													$(MAKEFILEDIR)../bin/dtd.mk															/epoc32/tools/makefile_templates/tools/
+
+dtdinstaller_config								:: dtdinstaller_config-dtdinstaller 
+dtdinstaller_config-dtdinstaller	::
+
+$(call addfiles, $(DTDINSTALLERFILES), dtdinstaller_config-dtdinstaller)
+
+$(call popout,MAKEFILE_STACK)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/group/bld.inf	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the information for exporting the Theme 
+*                Installer tool under the epoc tools
+*
+*/
+
+
+PRJ_PLATFORMS
+ARMV5 WINSCW
+
+PRJ_EXPORTS
+../bin/convert_file.pm									/epoc32/tools/convert_file.pm
+../bin/dtd_installer.pl                	/epoc32/tools/dtd_installer.pl
+../bin/dtd.meta                         /epoc32/tools/makefile_templates/tools/dtd.meta
+../bin/dtd.mk                         	/epoc32/tools/makefile_templates/tools/dtd.mk
+
+PRJ_MMPFILES
+PRJ_TESTMMPFILES
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dtdinstaller/makefile	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,8 @@
+# dtdinstaller level configuration makefile 
+ 
+MAKEFILE = /sf/tools/homescreentools/dtdinstaller/makefile
+
+# Place the first target as the default target which is executed from this level 
+dtdinstaller_all :: dtdinstaller_config
+  
+include include_template.mk
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the information for exporting the Theme 
+*                Installer tool under the epoc tools
+*
+*/
+
+
+PRJ_PLATFORMS
+ARMV5 WINSCW
+
+PRJ_EXPORTS
+#include "../dtdinstaller/group/bld.inf"
+#include "../themeinstaller/group/bld.inf"
+#include "../widgettools/group/bld.inf"
+
+PRJ_MMPFILES
+PRJ_TESTMMPFILES
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/tools/homescreentools" >
+]>
+
+<SystemDefinition name="homescreentools" schema="1.4.0">
+  <systemModel>
+    <layer name="bldmefirst_layer">
+      <module name="homescreentoolsdtd">
+        <unit unitID="hsdo.dtdinstaller" mrp="" bldFile="&layer_real_source_path;/dtdinstaller/group" name="dtdinstaller" />
+      </module>
+    </layer>
+    <layer name="tools_layer">
+      <module name="homescreentools">
+        <unit unitID="hsdo.themeinstaller" mrp="" bldFile="&layer_real_source_path;/themeinstaller/group" name="themeinstaller" />
+        <unit unitID="hsdo.widgettools" mrp="" bldFile="&layer_real_source_path;/widgettools/group" name="widgettools" />
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>  
Binary file themeinstaller/bin/themeinstaller.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/themeinstaller/group/bld.inf	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the information for exporting the Theme 
+*                Installer tool under the epoc tools
+*
+*/
+
+
+PRJ_PLATFORMS
+ARMV5 WINSCW
+
+PRJ_EXPORTS
+:zip ../bin/themeinstaller.zip /epoc32/tools/themeinstaller
+
+PRJ_MMPFILES
+PRJ_TESTMMPFILES
+PRJ_TESTEXPORTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/widgettools/group/bld.inf	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the information for exporting the Theme 
+*                Installer tool under the epoc tools
+*
+*/
+
+PRJ_EXPORTS
+#include "../hspluginspreinstaller/group/bld.inf"
+#include "../wrtwidgetpreinstaller/group/bld.inf"
Binary file widgettools/hspluginspreinstaller/bin/hspluginpreinstaller_v_2_0.zip has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/widgettools/hspluginspreinstaller/group/bld.inf	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the information for exporting the Theme 
+*                Installer tool under the epoc tools
+*
+*/
+
+
+PRJ_EXPORTS
+:zip ../bin/hspluginpreinstaller_v_2_0.zip
+
Binary file widgettools/wrtwidgetpreinstaller/bin/widgetpreinstaller.zip has changed
Binary file widgettools/wrtwidgetpreinstaller/conf/availablewrtwidgets.confml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/widgettools/wrtwidgetpreinstaller/conf/availablewrtwidgets.gcfml	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,20 @@
+<file xmlns="http://www.s60.com/xml/genconfml/1" name="widget_config.ini" target="epoc32\tools\rom\">
+	<setting ref="WrtWidgetsC/WrtWidgetC"/>
+	<setting ref="WrtWidgetsC/DriveC"/>
+	<setting ref="WrtWidgetsC/CommandsExtension"/>
+	<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict">
+		<xsl:output method="text" encoding="UTF-16"/>
+		<xsl:template match="configuration/data">
+		<xsl:value-of select="WrtWidgetsC/DriveC"/><xsl:text>&#xA;</xsl:text>
+			<xsl:for-each select="WrtWidgetsC/WrtWidgetC">
+			 <xsl:if test="PreInstalled = 1">
+				<xsl:value-of select="path" /><xsl:text>&#x20;</xsl:text><xsl:value-of select="homescreen"/> <xsl:text>&#xA;</xsl:text>
+			 </xsl:if>
+			</xsl:for-each>
+		  <xsl:text>&#xA;</xsl:text>[run-commands]<xsl:text>&#xA;</xsl:text>
+		  <xsl:for-each select="WrtWidgetsC/CommandsExtension">				
+				<xsl:value-of select="CommandExt" /><xsl:text>&#xA;</xsl:text>			
+		  </xsl:for-each>
+		</xsl:template>
+	</xsl:stylesheet>
+</file>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/widgettools/wrtwidgetpreinstaller/group/bld.inf	Thu Dec 17 09:29:34 2009 +0200
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  This file contains the information for exporting the Theme 
+*                Installer tool under the epoc tools
+*
+*/
+
+
+PRJ_EXPORTS
+:zip ../bin/widgetpreinstaller.zip
+
+//../conf/availablewrtwidgets.confml   APP_LAYER_CONFML(availablewrtwidgets.confml)
+//../conf/availablewrtwidgets.gcfml    APP_LAYER_GCFML(availablewrtwidgets.gcfml)