v2.2.19_1
authorhgs
Fri, 15 Oct 2010 12:29:39 +0300
changeset 80 d6dafc5d983f
parent 78 71ad690e91f5
child 87 1627c337e51e
v2.2.19_1
build/Makefile.defs
build/Makefile.project
build/Makefile.subsystem
build/buildutils/checkcopyrights.py
build/buildutils/checkemptydirectories.py
build/buildutils/checkfilenames.py
build/buildutils/distribution.policy.s60.configuration.txt
build/buildutils/extractJavaLocFiles.py
build/buildutils/extractJavaLocFiles_qt.py
build/buildutils/finddirs.py
build/buildutils/omake.bat
build/buildutils/setpolicyfiles.py
build/loc/resources_qt.jar
build/makefile
build/makefile.javaversion
build/properties.xml
build/sis/java_2_0.pkg
build/templates/10.1.layers.sysdef.xml
build/templates/nokia_pkgdef_template.xml
build/templates/pkgdef_template.xml
inc/build_defines.hrh
inc/build_defines.pri
inc/java.txt
javacommons/gcfprotocols/http/inc.s60/chttptransactionclient.h
javacommons/gcfprotocols/http/inc.s60/mrefhttpclientobserver.h
javacommons/gcfprotocols/http/inc.s60/nativehttpsession.h
javacommons/gcfprotocols/http/inc.s60/nativehttptransaction.h
javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java
javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp
javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp
javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp
javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp
javacommons/javastorage/tsrc/Makefile
javacommons/javastorage/tsrc/java_api/build/build.xml
javacommons/javastorage/tsrc/java_api/build/dummy.pro
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestAppendTable.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestConnection.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestCreateTable.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestOTATable.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestPreinstallTable.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRead.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRemove.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRobustness.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestSearch.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestStorageEntry.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestStorageException.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestTransaction.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestUpdate.java
javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestWrite.java
javacommons/javastorage/tsrc/storageclient/build/alltests.mmp
javacommons/javastorage/tsrc/storageclient/build/bld.inf
javacommons/javastorage/tsrc/storageclient/build/testjavastorage.pro
javacommons/javastorage/tsrc/subsystem.mk
javacommons/javastorage/tsrc/tst.bat
javacommons/jvms/nativeportlayer/build/bwins/jvmnativeportu.def
javacommons/jvms/nativeportlayer/build/eabi/jvmnativeportu.def
javacommons/jvms/nativeportlayer/inc.s60/javafile.h
javacommons/jvms/nativeportlayer/inc.s60/jvmnativeportlayer.h
javacommons/jvms/nativeportlayer/src.s60/javafile.cpp
javacommons/jvms/nativeportlayer/src.s60/jvmnativeportlayer.cpp
javacommons/jvms/nativeportlayer/tsrc/build/exports.inf
javacommons/jvms/nativeportlayer/tsrc/build/testjvmport.pro
javacommons/jvms/nativeportlayer/tsrc/readme.txt
javacommons/jvms/nativeportlayer/tsrc/src/alltests.cpp
javacommons/jvms/nativeportlayer/tsrc/src/testjvmnativeport.cpp
javacommons/jvms/nativeportlayer/tsrc/subsystem.mk
javacommons/jvms/nativeportlayer/tsrc/testfiles/test.dcf
javacommons/jvms/nativeportlayer/tsrc/testfiles/test.dm
javacommons/jvms/nativeportlayer/tsrc/testfiles/test.jar
javacommons/jvms/nativeportlayer/tsrc/testfiles/testDrm.dcf
javacommons/jvms/nativeportlayer/tsrc/testfiles/testDrm.dr
javacommons/jvms/nativeportlayer/tsrc/testfiles/testDrm.jar
javacommons/jvms/nativeportlayer/tsrc/tst.bat
javacommons/security/build/javasecurity.pro
javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro
javacommons/security/src.s60/ocspclient.cpp
javacommons/security/tsrc/src/testcertchains.cpp
javacommons/utils/build/build.xml
javacommons/utils/build/javautils.pro
javacommons/utils/javasrc.cdc/com/ibm/oti/nokiaextcdc/SystemPropertyExtension.java
javacommons/utils/javasrc/com/ibm/oti/nokiaextcldc/SystemPropertyExtension.java
javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/DynamicProperty.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/JvmPort.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/JvmPortCldc.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/JvmPortCommon.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/NativeMemoryBlockImpl.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationInfo.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/Jvm.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/MemoryManager.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/ui/ConfirmData.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/ui/RuntimeUiTexts.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/FormatterAvkon.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/FormatterQt.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoaderAvkon.java
javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoaderQt.java
javacommons/utils/src.s60/formatternative.cpp
javacommons/utils/src/formatterqtnative.cpp
javacommons/utils/tsrc/build/java/build.xml
javacommons/utils/tsrc/build/java/bwins/javacommonutilstestu.def
javacommons/utils/tsrc/build/java/dummy.pro
javacommons/utils/tsrc/build/java/eabi/javacommonutilstestu.def
javacommons/utils/tsrc/build/java/javacommonutilstest.pro
javacommons/utils/tsrc/build/native/exports.inf
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/ApplicationInfoTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtilsTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/FinalizableBase.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/FinalizerStatistics.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/FinalizerTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/JvmPortBasicTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/JvmPortTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/prot/ProtectedTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/restricted/RestrictedTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/test/ApplicationInfoImpl.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/test/ApplicationUtilsImpl.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/test/JvmPortTest.java
javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/LoggerTests.java
javacommons/utils/tsrc/jvmportapp.jar
javacommons/utils/tsrc/jvmportapp2.jar
javacommons/utils/tsrc/localisation/javasrc/com/nokia/mj/impl/utils/LocalisationTest.java
javacommons/utils/tsrc/localisation/loc/testresource2.loc
javacommons/utils/tsrc/rtsupport/build/build.xml
javacommons/utils/tsrc/rtsupport/build/javaruntimesupporttest.pro
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/properties/test/Property.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/properties/test/Property2.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/midptest/ApplicationInfoImpl.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/midptest/ApplicationUtilsImpl.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/midptest/MidpTest.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/FinalizerStatistics.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test1.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test2.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test3.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test4.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test5.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test6.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/TestMain.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/TestPermission.java
javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/testvm/JvmPortTest.java
javacommons/utils/tsrc/testdll/src/jvmporttest.cpp
javacommons/utils/tsrc/tst.bat
javaextensions/bluetooth/omjbluetooth/src.s60/discoveryagent.cpp
javaextensions/pim/build/javapim.pro
javaextensions/pim/framework/src.s60/cpimmanager.cpp
javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp
javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp
javamanager/javainstaller/installer/build/javainstaller.pro
javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp
javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp
javamanager/javainstaller/installerui/data/javaapplicationinstaller.css
javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java
javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java
javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp
javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h
javamanager/javainstaller/javasifplugin/inc/javasifplugin.h
javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp
javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp
javamanager/javainstaller/javasifplugin/src/resultsserver.cpp
javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp
javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/RuntimeErrorDialog.java
javauis/coreui_qt/javasrc/com/nokia/mj/impl/coreuiqt/CoreUiImpl.java
javauis/eswt_qt/build/eswtqt/eswtqt.pro
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/TextExtensionExtension.java
javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/build.xml
javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/emma.sh
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/CaptionedControl.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/Command.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/HyperLink.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/ListBox.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/TimedMessageBox.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/Image.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/ColorDialog.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Combo.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Label.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Table.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/qt/UIThreadHandOverManager.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxos.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxutils.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxutils.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.pri
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphicsfactory.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/graphicscontextimpl.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/graphicscontextimpl.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagebase.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagebase.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagedataimpl.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageimpl.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageimpl.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageloaderimpl.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageloaderimpl.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/pixmap.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/pixmap.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/jniutils.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/jniutils.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/listdatamodel.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/listdatamodel.h
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/os.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swts60.cpp
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/ercp/swt/mobile/Internal_MobilePackageSupport.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/graphics/Internal_GfxPackageSupport.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandArranger.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/OS.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Config.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Image.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/ImageLoader.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/OS.java
javauis/javauis.pro
javauis/lcdui_qt/build.linux.j2se/emma.sh
javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java
javauis/lcdui_qt/src_j2se/com/nokia/mj/impl/fileutils/FileUtility.java
javauis/lcdui_qt/src_j2se/com/nokia/mj/impl/rt/support/ApplicationInfo.java
javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/CollisionDetectionTest.java
javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/image/ImageTest.java
javauis/m2g_qt/.cproject
javauis/m2g_qt/.project
javauis/m2g_qt/build/build.xml
javauis/m2g_qt/build/bwins/javam2gu.def
javauis/m2g_qt/build/eabi/javam2gu.def
javauis/m2g_qt/build/javam2g.pro
javauis/m2g_qt/inc/CM2GRenderContext.h
javauis/m2g_qt/inc/CM2GSVGProxy.h
javauis/m2g_qt/inc/CSynchronization.h
javauis/m2g_qt/inc/JcfAutoPtr.h
javauis/m2g_qt/inc/M2GGeneral.h
javauis/m2g_qt/inc/M2GNamespace.h
javauis/m2g_qt/inc/M2GUtils.h
javauis/m2g_qt/inc/MM2GRenderContext.h
javauis/m2g_qt/inc/MM2GSVGProxy.h
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/ESWTScalableGraphics.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GDOMChangeObserver.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GDestroyable.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GDocument.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GEvent.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GManager.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GObject.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GRunnableQt.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGAnimationElement.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGAnimator.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGConstants.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGElement.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGElementWrapper.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGImage.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGLocatableElement.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGMatrix.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGPath.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGPoint.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGRGBColor.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGRect.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGSVGElement.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGeSWTAnimator.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GScalableGraphics.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/NativeError.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/Platform.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionFactory.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionPolicy.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionPolicyHandler.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionProxy.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GDefaultExternalResourceHandler.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GUrlTokenizer.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/common/M2GConnectionPolicyImpl.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/common/M2GConnectionProxyImpl.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/file/M2GConnectionPolicyImpl.java
javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/file/M2GConnectionProxyImpl.java
javauis/m2g_qt/javasrc/eclipse/swt/widgets/SVGAnimatorControl.java
javauis/m2g_qt/javasrc/javax/microedition/m2g/ExternalResourceHandler.java
javauis/m2g_qt/javasrc/javax/microedition/m2g/SVGAnimator.java
javauis/m2g_qt/javasrc/javax/microedition/m2g/SVGEventListener.java
javauis/m2g_qt/javasrc/javax/microedition/m2g/SVGImage.java
javauis/m2g_qt/javasrc/javax/microedition/m2g/ScalableGraphics.java
javauis/m2g_qt/javasrc/javax/microedition/m2g/ScalableImage.java
javauis/m2g_qt/javasrc/org/w3c/dom/DOMException.java
javauis/m2g_qt/javasrc/org/w3c/dom/Document.java
javauis/m2g_qt/javasrc/org/w3c/dom/Element.java
javauis/m2g_qt/javasrc/org/w3c/dom/Node.java
javauis/m2g_qt/javasrc/org/w3c/dom/events/Event.java
javauis/m2g_qt/javasrc/org/w3c/dom/events/EventListener.java
javauis/m2g_qt/javasrc/org/w3c/dom/events/EventTarget.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGAnimationElement.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGElement.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGException.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGLocatableElement.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGMatrix.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGPath.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGPoint.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGRGBColor.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGRect.java
javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGSVGElement.java
javauis/m2g_qt/src/CM2GRenderContext.cpp
javauis/m2g_qt/src/CM2GSVGProxy.cpp
javauis/m2g_qt/src/CSynchronization.cpp
javauis/m2g_qt/src/M2GGeneral.cpp
javauis/m2g_qt/src/M2GUtils.cpp
javauis/m2g_qt/src/jni/M2GDocument.cpp
javauis/m2g_qt/src/jni/M2GManager.cpp
javauis/m2g_qt/src/jni/M2GSVGAnimationElement.cpp
javauis/m2g_qt/src/jni/M2GSVGElement.cpp
javauis/m2g_qt/src/jni/M2GSVGImage.cpp
javauis/m2g_qt/src/jni/M2GSVGPath.cpp
javauis/m2g_qt/src/jni/M2GSVGSVGElement.cpp
javauis/m2g_qt/src/jni/M2GScalableGraphics.cpp
javauis/runtimeui_qt/javasrc.s60/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQt.java
javauis/runtimeui_qt/src.s60/runtimeuiqt.cpp
javauis/runtimeui_qt/tsrc.s60/build/build.xml
javauis/runtimeui_qt/tsrc.s60/build/dummy.pro
javauis/runtimeui_qt/tsrc.s60/build/jiut.bat
javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/RuntimeUiQtIconTest.java
javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQtTests.java
javauis/runtimeui_qt/tsrc.s60/subsystem.mk
javauis/runtimeui_qt/tsrc.s60/tst.bat
javauis/subsystem_qt.mk
layers.sysdef.xml
package_definition.xml
rom/installerodclist30
rom/javalocalization_3_1.iby
--- a/build/Makefile.defs	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/Makefile.defs	Fri Oct 15 12:29:39 2010 +0300
@@ -190,19 +190,22 @@
 
 export VARIANT
 
-# Specify RVCT version explicitly by default
-OVERRIDE_RVCT = 1
-SBSCONFIG = $(PLATFORM)_$(CFG)
-ifeq ($(OVERRIDE_RVCT),1)
-  ifeq ($(PLATFORM),armv5)
+ifeq ($(BUILDENV),symbian)
+  # Specify RVCT version explicitly by default
+  OVERRIDE_RVCT = 1
+  SBSCONFIG = $(PLATFORM)_$(CFG)
+  ifeq ($(OVERRIDE_RVCT),1)
     ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
-      SBSCONFIG = $(PLATFORM)_$(CFG).rvct4_0
+      RVCTREL = .rvct4_0
       RVCTBIN = $(RVCT40BIN)
     else 
-      SBSCONFIG = $(PLATFORM)_$(CFG).rvct2_2
+      RVCTREL = .rvct2_2
       RVCTBIN = $(RVCT22BIN)
     endif
     export PATH:=$(RVCTBIN);$(subst $(RVCT40BIN),,$(subst $(RVCT22BIN),,$(PATH)))
+    ifeq ($(PLATFORM),armv5)
+      SBSCONFIG = $(PLATFORM)_$(CFG)$(RVCTREL)
+    endif
   endif
 endif
 
@@ -259,17 +262,21 @@
 
 # Echo the S60 release before export
 ifeq ($(BUILDENV),symbian)
-all init export configure qmake java native releasebuild test: echo_s60_release
+all init export prep configure qmake java native releasebuild test: echo_s60_release
 echo_s60_release:
 	@echo Building on top of S60 $(RD_JAVA_S60_RELEASE), PLATFORM=$(PLATFORM) VARIANT=$(VARIANT)
 endif
 
+endif # FIRSTTIME
+
+
 include $(JAVA_SRC_ROOT)/build/makefile.javaversion
 
 COMMA = ,
 JAVA_VERSION_ = $(subst .,$(COMMA),$(JAVA_VERSION))
 
-configure: create_inc_dir generateconffiles generatereleasefile
+configure: make_configure
+make_configure: create_inc_dir generateconffiles generatereleasefile
 
 create_inc_dir:
 	$(call MKDIR, $(call PATHFIX,$(GEN_BUILD_FILES_DIR)/inc))
@@ -301,13 +308,12 @@
 	$(shell echo RD_JAVA_S60_RELEASE=$(RD_JAVA_S60_RELEASE)>$(RD_JAVA_S60_RELEASE_FILE))
 
 # Clean file on clean_generated
-clean_configure: clean_conffiles
-
-clean_conffiles:
+clean_configure: make_clean_configure
+make_clean_configure: make_clean_conffiles
+make_clean_conffiles:
 	$(call RMFILES,$(BUILDDEFINEFILE) $(QBUILDDEFINEFILE) $(JAVAVERSIONFILE) \
 	$(PROJECTDEFINEFILE) $(RD_JAVA_S60_RELEASE_FILE))
 
-endif # FIRSTTIME
 
 
 # Symbian ----------------------------------
--- a/build/Makefile.project	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/Makefile.project	Fri Oct 15 12:29:39 2010 +0300
@@ -49,7 +49,7 @@
       # Use release written in file
       include $(RD_JAVA_S60_RELEASE_FILE)
     else
-    ifneq ($(wildcard $(addsuffix Symbianv4.sis,$(S60_STUBSIS_DIRS))),)
+    ifneq ($(wildcard $(addsuffix Symbianv4*.sis,$(S60_STUBSIS_DIRS))),)
       RD_JAVA_S60_RELEASE = 10.1
     else
     ifneq ($(wildcard $(addsuffix Series60v5.2.sis,$(S60_STUBSIS_DIRS))),)
--- a/build/Makefile.subsystem	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/Makefile.subsystem	Fri Oct 15 12:29:39 2010 +0300
@@ -169,9 +169,12 @@
 	echo #endif >> bld.inf
 endif
 
+# Release build for build automation (sbs case is optimized to build on one go)
+releasebuild: build_all sis
+
 build_all: configure qmake
 ifdef USESBS
-	$(SBS) -c winscw_udeb -c armv5_urel -f -
+	$(SBS) -c winscw_udeb -c armv5_urel$(RVCTREL) -f -
 else
 	$(MAKE) -f subsystem.mk PLATFORM=winscw VARIANT=debug NODEP=1 native
 	$(MAKE) -f subsystem.mk PLATFORM=armv5 VARIANT=release NODEP=1 native
--- a/build/buildutils/checkcopyrights.py	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/checkcopyrights.py	Fri Oct 15 12:29:39 2010 +0300
@@ -24,9 +24,39 @@
 
 import sys, os, re
 
+
 # Specify here the file types to be checked
 checkedFileTypes = [".cpp", ".h", ".java", ".py", ".mk"]
 
+# Specify here the directories to be ignored relative to the root
+ignoredRootDirs = [
+    "javaextensions/bluetooth/bluecove", # Bluecove
+    "javacommons/jvms/j9/s60/inc",       # IBM J9
+    "javauis/eswt_akn",                  # eSWT checked separately
+    "javauis/eswt_qt",                   # eSWT checked separately
+    "javauis/tsrc/fute/eswt",            # eSWT checked separately
+    "javaextensions/webservices",        # Webservices not delivered
+    "tools"                              # Tools not delivered
+    ]
+
+# Specify here the directories to be ignored everywhere
+ignoredAnyDirs = [
+    ".svn",         # SVN directories
+    "internal"      # Internal directories not delivered
+    ]
+ 
+# Specify here any individual files to be ignored relative to the root
+ignoredFiles = [
+    "javacommons/jvms/cldc_1.1.1/javasrc/java/util/Timer.java",     # Apache
+    "javacommons/jvms/cldc_1.1.1/javasrc/java/util/TimerTask.java", # Apache
+    "javacommons/jvms/cldc_1.1.1/tsrc/javasrc/com/nokia/mj/test/java/util/TimerTaskTest.java", # Apache
+    "javacommons/jvms/cldc_1.1.1/tsrc/javasrc/com/nokia/mj/test/java/util/TimerTest.java",     # Apache
+    "javacommons/utils/inc/convertutf.h",   # Unicode Inc.
+    "javacommons/utils/src/convertutf.cpp", # Unicode Inc.
+    "javaextensions/ccapi/ccapiext/javasrc/com/innovision/rf/JewelTagConnection.java",  # Innovision
+    "javaextensions/ccapi/ccapiext/javasrc/com/sony/felica/Type3TagConnection.java"     # Sony
+]
+
 
 # The copyright texts to be searched for
 copyrightText1 = "Nokia Corporation and/or its subsidiary(-ies)"
@@ -35,72 +65,37 @@
 
 def main():
 
-    root = sys.argv[1]
-    if root[-1] != '\\':
-        root = root + '\\'
+    root = os.path.abspath(sys.argv[1])
+    rootlen = len(root) + 1
 
-    # Include here the directories to be ignored
-    ignoredDirectories = [
-        root + "javaextensions\\bluetooth\\bluecove",  # Bluecove
-        root + "javacommons\\jvms\\j9\\s60\\inc",      # IBM J9
-        root + "javauis\\eswt_akn",                    # eSWT checked separately
-        root + "javauis\\eswt_qt",                     # eSWT checked separately
-        root + "javauis\\tsrc\\fute\\eswt\\",          # eSWT checked separately
-        root + "javaextensions\\webservices",          # Webservices not delivered
-        root + "tools",                                # Tools not delivered
-        "\\internal"                                   # Internal directories not delivered
-        ]
-     
-    # Include here any individual files to be ignored
-    ignoredFiles = [
-        root + "javacommons\\jvms\\cldc_1.1.1\\javasrc\\java\\util\\Timer.java",       # Apache license
-        root + "javacommons\\jvms\\cldc_1.1.1\\javasrc\\java\\util\\TimerTask.java",   # Apache license
-        root + "javacommons\\jvms\\cldc_1.1.1\\tsrc\\javasrc\\com\\nokia\\mj\\test\\java\\util\\TimerTaskTest.java",   # Apache license
-        root + "javacommons\\jvms\\cldc_1.1.1\\tsrc\\javasrc\\com\\nokia\\mj\\test\\java\\util\\TimerTest.java",       # Apache license
-        root + "javacommons\\utils\\inc\\convertutf.h",                                # Unicode Inc.
-        root + "javacommons\\utils\\src\\convertutf.cpp"                               # Unicode Inc.
-    ]
+    # Preprocess the ignore lists to speed up the actual checking
+    rootDirsToIgnore = map(os.path.normpath, ignoredRootDirs)
+    filesToIgnore = map(os.path.normpath, ignoredFiles)
 
-    
     def visitFun(arg, dirname, names):
 
-        # Skip SVN directories
-        if dirname.find("\\.svn") != -1:
-            return
-        
-        # Skip all the directories to be ignored 
-        for dir in ignoredDirectories:
-            if dirname.find(dir) != -1:
+        # Skip the ignored directories
+        if os.path.split(dirname)[1] in ignoredAnyDirs or \
+           dirname[rootlen:] in rootDirsToIgnore:
                 names[:] = []
-                # print "Ignoring directory", dirname
                 return
 
         # Check then the files
         for f in names: 
         
-            fname = dirname + "\\" + f
+            fname = os.path.join(dirname, f)
             
-            # Skip directories
-            if os.path.isdir(fname):
+            # Skip directories and ignored files
+            if os.path.isdir(fname) or fname[rootlen:] in filesToIgnore:
                 continue
-        
-            # Skip ignored files
-            found = False
-            for file in ignoredFiles:
-                if fname.find(file) != -1:
-                    # print "Ignoring file", fname
-                    found = True
-                    break
-            if found:
-                continue
-            
+
             # Skip non-wanted file types
             lastDot = f.rfind(".")
             if lastDot == -1 or not f[lastDot:] in checkedFileTypes:
-                # print "Ignoring file", f
                 continue
-
+            
             # Check if the file contains the copyright texts
+            found = False
             try:                       
                 file = open(fname)
                 
--- a/build/buildutils/checkemptydirectories.py	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/checkemptydirectories.py	Fri Oct 15 12:29:39 2010 +0300
@@ -24,7 +24,8 @@
     def visitFun(arg, dirname, names):
 
         # Skip SVN directories
-        if dirname.find("\\.svn") != -1:
+        if dirname.endswith(".svn"):
+            names[:] = []
             return
         
         # Check if the directory is empty (except for the .svn subdirectory)
--- a/build/buildutils/checkfilenames.py	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/checkfilenames.py	Fri Oct 15 12:29:39 2010 +0300
@@ -40,7 +40,7 @@
      ".classpath_qt", ".classpath_qt_j2me",
     ".cmd", ".comp", ".conf", ".css", ".confml", ".cpp", ".cproject", ".crml",
     ".cvsignore", ".dat", ".dcf", ".def", ".defs", ".dll", ".der", ".doc",
-    ".dr", ".dso", ".dsp", ".dsw", ".dtd",
+    ".dm", ".dr", ".dso", ".dsp", ".dsw", ".dtd",
     ".emx", ".exe", ".flm", ".gcfml", ".gif",
     ".h", ".hrh", ".htm", ".html", ".iby", ".inf", ".ini", ".inl",
     ".jad", ".jar", ".java", ".javaversion", ".jpeg", ".jpg", ".js", ".jsp", ".jupiter",
--- a/build/buildutils/distribution.policy.s60.configuration.txt	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/distribution.policy.s60.configuration.txt	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,6 @@
 /internal                          : 1
 /releng                            : 1
 ROOT/tools                         : 1
-ROOT/jrt_info                      : 1
 ROOT/javacommons/jvms/j9/s60       : 810
 /midprms                           : 102
 /webservices/javasrc               : 102
--- a/build/buildutils/extractJavaLocFiles.py	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/extractJavaLocFiles.py	Fri Oct 15 12:29:39 2010 +0300
@@ -50,9 +50,15 @@
 
 def main():
     parser = OptionParser(
-        usage = "Usage: %prog [args] <input_dir> <output_dir>")
+        usage = "Usage: %prog [args] <input_dir> <output_dir> <loc-file.jar>")
+    parser.add_option(
+        "--files", dest = "files", default = ",".join(JAVA_LOC_FILES),
+        help = "list of Java loc files to read from input (default: %s)" % 
+        ",".join(JAVA_LOC_FILES))
     (opts, args) = parser.parse_args()
 
+    locFiles = opts.files.split(",")
+
     try:
         inputDir = args[0]
         outputDir = args[1]
@@ -67,7 +73,7 @@
                     outFilename = os.path.join(outputDir, file.lower())
                     (fileIndex, fileExt) = os.path.splitext(file)
                     print "Extracting %s" % inFilename
-                    extractJavaLocFiles(fileIndex, inFilename)
+                    extractJavaLocFiles(locFiles, fileIndex, inFilename)
                     print "Creating %s" % outFilename
                     os.system("jar cfM " + outFilename + " " + fileIndex)
                     print "Updating %s" % resourcesFilename
@@ -83,12 +89,13 @@
         traceback.print_exc()
         sys.exit(1)
 
-def extractJavaLocFiles(index, inFilename):
+def extractJavaLocFiles(locFiles, index, inFilename):
     javaLocFiles = ""
-    for javaLocFile in JAVA_LOC_FILES:
-        javaLocFilename = os.path.join(index, javaLocFile + "_" + index + ".loc")
+    for javaLocFile in locFiles:
+        javaLocFilename = index + "/" + javaLocFile + "_" + index + ".loc"
         javaLocFiles = javaLocFiles + " " + javaLocFilename
-    os.system("jar xf " + inFilename + javaLocFiles)
+    command = "jar xf " + inFilename + javaLocFiles
+    os.system(command)
 
 def updateResources(index, resourcesFilename):
     resourcesDir = os.path.join(index, RESOURCES_PATH)
--- a/build/buildutils/extractJavaLocFiles_qt.py	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/extractJavaLocFiles_qt.py	Fri Oct 15 12:29:39 2010 +0300
@@ -46,8 +46,10 @@
     'javaapplicationinstaller',
     'javaapplicationinstallererrors',
     'javaapplicationsecuritymessages',
+    'javapim',
     'javaruntimeapplicationsettings',
-    'javaruntimecertificatemanagement'
+    'javaruntimecertificatemanagement',
+    'javauitoolkits',
     ]
 
 # Path for java loc files inside RESOURCES_FILE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/buildutils/finddirs.py	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2010 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: Find all paths matching pattern
+#
+#! /usr/bin/python
+
+import os.path, fnmatch, sys
+from optparse import OptionParser
+
+def findDirs(root, pattern, exclude):
+    result = []
+    for path, dirs, files in os.walk(root):
+        if exclude and fnmatch.filter(path.replace("\\", "/").split("/"), exclude):
+            continue
+        result.extend([os.path.join(path, d) 
+                       for d in fnmatch.filter(dirs, pattern)])
+    return result
+
+def main():
+    parser = OptionParser()
+    parser.add_option(
+        "-e", "--exclude", dest = "exclude", 
+        help = "Exclude paths having this pattern as directory component, e.g. tsrc")
+    parser.add_option(
+        "-o", "--output", dest = "out", help = "Output file")
+    (options, args) = parser.parse_args()
+
+    if len(args) != 2:
+        print "Usage: %s [options] <root> <pattern>" % sys.argv[0]
+        sys.exit(1)
+
+    root = args[0]
+    pattern = args[1]
+
+    dirs = findDirs(root, pattern, options.exclude)
+    output = "\n".join(dirs) + "\n"
+
+    if options.out:
+        open(options.out, "w").write(output)
+        print "Wrote %s" % options.out
+    else:
+        print output
+
+    
+if __name__ == "__main__":
+    main()
--- a/build/buildutils/omake.bat	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/omake.bat	Fri Oct 15 12:29:39 2010 +0300
@@ -32,10 +32,6 @@
 if "%JAVA_SRC_ROOT%" == "" for /F "delims=\ tokens=2-4" %%a in ("%CD%") do if "%%a\%%b\%%c" == "ext\app\jrtext" set JAVA_SRC_ROOT=\sf\app\jrt
 if not "%JAVA_SRC_ROOT%" == "" goto :resolved
 
-echo Could not determine JAVA_SRC_ROOT.
-goto :EOF
-
-
 :resolved
 echo JAVA_SRC_ROOT=%JAVA_SRC_ROOT%
 
--- a/build/buildutils/setpolicyfiles.py	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/buildutils/setpolicyfiles.py	Fri Oct 15 12:29:39 2010 +0300
@@ -15,15 +15,16 @@
 #
 #!/usr/bin/python
 
-import datetime, os, os.path, sys, traceback
+import datetime, os, os.path, sys, traceback, shutil
 from optparse import OptionParser
 
-"""This script sets up S60 distribution policy files."""
+"""This script sets up S60 distribution policy files and optionally filters out non-distributed directories."""
 
 class PolicyData:
     def __init__(self):
         self.root_policy = None
         self.policies = []
+        self.filtered_directories = 0
         self.created_policies = 0
         self.existing_policies = 0
         self.warning_count = 0
@@ -35,6 +36,7 @@
         msg = "Distribution policies generation time " + str(self.stop_time - self.start_time)
         msg += "\nCreated policies: " + str(self.created_policies)
         msg += "\nExisting policies: " + str(self.existing_policies)
+        msg += "\nFiltered directories: " + str(self.filtered_directories)
         if self.warning_count > 0:
             msg += "\nWarnings: " + str(self.warning_count)
         return msg
@@ -43,7 +45,14 @@
 
 def main():
     parser = OptionParser(usage = "python -u %prog [options] <path>")
+    parser.add_option("-f", "--filter", action="store_true", dest="filter",
+                  help="filter non-distributed directories")
     (opts, args) = parser.parse_args()
+    if len(args) == 0:
+        print "Mandatory argument <path> missing"
+        parser.print_help()
+        sys.exit(1);
+    
     root_path = args[0]
     if not os.path.isdir(root_path):
         print "ERROR: %s is not a directory" % root_path
@@ -54,9 +63,11 @@
         print "Started " + str(policy_data.start_time)
         parseConfigurationFile(policy_data)
         print "Generating S60 distribution policies to", root_path
+        if opts.filter:
+            print "Removing non-contributed directories"
         print "Policy config:", str(policy_data.policies)
         print "Policy for root dir:", str(policy_data.root_policy)
-        writePolicies(root_path, policy_data)
+        filterAndWritePolicies(root_path, policy_data, opts.filter)
         policy_data.stop_time = datetime.datetime.now()
         print "Finished " + str(policy_data.stop_time)
         print str(policy_data)
@@ -97,7 +108,7 @@
     finally:
         f.close()
 
-def writePolicies(root_path, policy_data):
+def filterAndWritePolicies(root_path, policy_data, filter):
     # Write policy for the root directory.
     if (not policy_data.root_policy is None) and \
             (policy_data.root_policy != "IGNORE"):
@@ -108,7 +119,12 @@
             path = os.path.join(root, dir)
             policy = getPolicyForPath(path.replace(root_path, ""), policy_data)
             if policy != "IGNORE":
-                writePolicy(path, policy)
+                if filter and policy != "7":
+                    print "Removing directory", path
+                    shutil.rmtree(path)
+                    policy_data.filtered_directories += 1
+                else:
+                    writePolicy(path, policy)
 
 def writePolicy(path, policy):
     global policy_data
Binary file build/loc/resources_qt.jar has changed
--- a/build/makefile	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/makefile	Fri Oct 15 12:29:39 2010 +0300
@@ -69,9 +69,9 @@
 include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
 
 # Prepare delivery for S60/SF
-prep: sysdefsetup generatereleasefile
+prep: sysdefsetup generatereleasefile configure
 ifdef RD_JAVA_S60_RELEASE_9_2
-prep: configure qmake
+prep: qmake
 endif
 ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
 prep: pkgdefsetup
@@ -82,20 +82,14 @@
 	$(call CATCOMMAND,$(wildcard $(SYSDEF_TEMPLATE)))>$(JAVA_SRC_ROOT)/layers.sysdef.xml
 
 pkgdefsetup:
-	$(call MKDIR, $(call PATHFIX, $(JAVA_SRC_ROOT)/jrt_info))
-	$(call MKDIR, $(call PATHFIX, $(JAVA_SRC_ROOT)/jrt_info/nokia_jrt_metadata))
 	$(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/pkgmap_template.xml)>$(JAVA_SRC_ROOT)/package_map.xml
 	$(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/pkgdef_template.xml)>$(JAVA_SRC_ROOT)/package_definition.xml
-	$(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/nokia_pkgdef_template.xml)>$(JAVA_SRC_ROOT)/jrt_info/nokia_jrt_metadata/package_definition.xml
 
 # Cleaning java from top level cleans also the API jars
 clean_java: cleanapijars
 cleanapijars:
 	$(ANT) -f $(JAVA_SRC_ROOT)/build/utilities.xml -q -Dtarget.platform=$(PLATFORM) -Dtarget.cfg=$(VARIANT) clean.api.jars
 
-# Release build for build automation (sbs case is optimized to build on one go)
-releasebuild: build_all sis
-
 sis:
 ifeq ($(BUILDENV),symbian)
 	$(MAKE) -C $(JAVA_SRC_ROOT)/build/sis all deploy
--- a/build/makefile.javaversion	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/makefile.javaversion	Fri Oct 15 12:29:39 2010 +0300
@@ -1,2 +1,2 @@
 # Set Java version (must be dot separated, without spaces)
-JAVA_VERSION = 2.2.17
+JAVA_VERSION = 2.2.19
--- a/build/properties.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/properties.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -61,6 +61,13 @@
              value="${epocroot}epoc32/include/platform/app/classes.cdc.zip" />
   <available file="${epocroot}epoc32/include/platform/app/classes.fp.zip" property="bootclasspath.fp"
              value="${epocroot}epoc32/include/platform/app/classes.fp.zip" />
+
+  <available file="${epocroot}epoc32/include/domain/applications/classes.cldc.zip" property="bootclasspath.cldc"
+             value="${epocroot}epoc32/include/domain/applications/classes.cldc.zip" />
+  <available file="${epocroot}epoc32/include/domain/applications/classes.cdc.zip" property="bootclasspath.cdc"
+             value="${epocroot}epoc32/include/domain/applications/classes.cdc.zip" />
+  <available file="${epocroot}epoc32/include/domain/applications/classes.fp.zip" property="bootclasspath.fp"
+             value="${epocroot}epoc32/include/domain/applications/classes.fp.zip" />
                           
   <!-- Old SF cldc/cdc class file location -->
   <property name="bootclasspath.cldc" location="${epocroot}epoc32/jrt/classes.cldc.zip"/>
--- a/build/sis/java_2_0.pkg	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/sis/java_2_0.pkg	Fri Oct 15 12:29:39 2010 +0300
@@ -393,8 +393,10 @@
 "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\tckrunner.odc"-"c:\resource\java\jvm\lib\jrt\tckrunner.odc"
 "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacontrolpanel.odc"-"c:\resource\java\jvm\lib\jrt\javacontrolpanel.odc"
 
+#ifndef RD_JAVA_S60_RELEASE_5_0_IAD
 "\epoc32\release\armv5\urel\javacentrep.dll"-"c:\sys\bin\javacentrep.dll"
 "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacentrep.odc"-"c:\resource\java\jvm\lib\jrt\javacentrep.odc"
+#endif 
 
 ; Misc dlls
 #ifdef RD_JAVA_S60_RELEASE_5_0_IAD
--- a/build/templates/10.1.layers.sysdef.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/templates/10.1.layers.sysdef.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -8,15 +8,7 @@
     <layer name="app_layer">
       <module name="jrt">
         <unit name="jrt" unitID="jrt.jrt" mrp=""
-              bldFile="&layer_real_source_path;" proFile="jrt.pro" 
-              qmakeArgs="-r"
-              filter="!sf_build" />
-      </module>
-      <module name="jrt_sf">
-        <unit name="jrt_sf" unitID="jrt.jrt_sf" mrp=""
-              bldFile="&layer_real_source_path;" proFile="jrt.pro"
-              qmakeArgs="-r RD_JAVA_SF_BUILD=1"
-              filter="sf_build" />
+              bldFile="&layer_real_source_path;" proFile="jrt.pro" />
       </module>
     </layer>
   </systemModel>
--- a/build/templates/nokia_pkgdef_template.xml	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition xmlns:sf="http://www.symbian.org/system-definition" xmlns:qt="http://www.nokia.com/qt" schema="3.0.1" id-namespace="http://www.nokia.com/schema/drd/system-definition">
-  <package id="sf:jrt" name="Java Runtime" levels="util generic rt ui">
-  
-    <!-- Redefines some of the SF collections with Nokia versions. This file
-         can be removed after the jrt package has been split properly. -->
-    
-    <collection id="sf:javacommons" name="Java Commons" level="generic" replace="sf:javacommons">
-      <component id="javacommons_build" filter="s60" name="Java Commons Build">
-        <unit bldFile="../../javacommons" qt:proFile="javacommons.pro"/>
-      </component>
-    </collection>
-    <collection id="sf:javaruntimes" name="Java Runtimes" level="rt" replace="sf:javaruntimes">
-      <component id="javaruntimes_build" filter="s60" name="Java Runtimes Build">
-        <unit bldFile="../../javaruntimes" qt:proFile="javaruntimes.pro"/>
-      </component>
-    </collection>
-    <collection id="sf:javauis" name="Java UIs" level="ui" replace="sf:javauis">
-      <component id="javauis_build" filter="s60" name="Java UIs Build">
-        <unit bldFile="../../javauis" qt:proFile="javauis.pro"/>
-      </component>
-    </collection>
-    <collection id="sf:javamanager" name="Java Manager" level="generic" replace="sf:javamanager">
-      <component id="javamanager_build" filter="s60" name="Java Manager Build">
-        <unit bldFile="../../javamanager" qt:proFile="javamanager.pro"/>
-      </component>
-    </collection>
-    <collection id="sf:javatools" name="Java Tools" level="util" replace="sf:javatools">
-      <component id="javatools_build" filter="s60" name="Java Tools Build">
-        <unit bldFile="../../javatools" qt:proFile="javatools.pro"/>
-      </component>
-    </collection>
-    <collection id="sf:javaextensions" name="Java Extensions" level="generic" replace="sf:javaextensions">
-      <component id="javaextensions_build" filter="s60" name="Java Extensions Build">
-        <unit bldFile="../../javaextensions" qt:proFile="javaextensions.pro"/>
-      </component>
-    </collection>
-    
-  </package>
-</SystemDefinition>
--- a/build/templates/pkgdef_template.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/build/templates/pkgdef_template.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -36,32 +36,32 @@
     
     <collection id="javacommons" name="Java Commons" level="generic">
       <component id="javacommons_build" filter="s60" name="Java Commons Build">
-        <unit bldFile="javacommons" qt:proFile="javacommons.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javacommons" qt:proFile="javacommons.pro"/>
       </component>
     </collection>
     <collection id="javaruntimes" name="Java Runtimes" level="rt">
       <component id="javaruntimes_build" filter="s60" name="Java Runtimes Build">
-        <unit bldFile="javaruntimes" qt:proFile="javaruntimes.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javaruntimes" qt:proFile="javaruntimes.pro"/>
       </component>
     </collection>
     <collection id="javauis" name="Java UIs" level="ui">
       <component id="javauis_build" filter="s60" name="Java UIs Build">
-        <unit bldFile="javauis" qt:proFile="javauis.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javauis" qt:proFile="javauis.pro"/>
       </component>
     </collection>
     <collection id="javamanager" name="Java Manager" level="generic">
       <component id="javamanager_build" filter="s60" name="Java Manager Build">
-        <unit bldFile="javamanager" qt:proFile="javamanager.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javamanager" qt:proFile="javamanager.pro"/>
       </component>
     </collection>
     <collection id="javatools" name="Java Tools" level="util">
       <component id="javatools_build" filter="s60" name="Java Tools Build">
-        <unit bldFile="javatools" qt:proFile="javatools.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javatools" qt:proFile="javatools.pro"/>
       </component>
     </collection>
     <collection id="javaextensions" name="Java Extensions" level="generic">
       <component id="javaextensions_build" filter="s60" name="Java Extensions Build">
-        <unit bldFile="javaextensions" qt:proFile="javaextensions.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javaextensions" qt:proFile="javaextensions.pro"/>
       </component>
     </collection>
     
--- a/inc/build_defines.hrh	Mon Oct 04 11:29:25 2010 +0300
+++ b/inc/build_defines.hrh	Fri Oct 15 12:29:39 2010 +0300
@@ -15,8 +15,8 @@
 *
 */
 
-#define RD_JAVA_VERSION 2,2,17
-#define RD_JAVA_BIN_VERSION_NONQT 10.529
+#define RD_JAVA_VERSION 2,2,19
+#define RD_JAVA_BIN_VERSION_NONQT 10.531
 #define RD_JAVA_SYMBIAN_TARGET
 #define RD_JAVA_S60_RELEASE_10_1
 #define RD_JAVA_S60_RELEASE_10_1_ONWARDS
--- a/inc/build_defines.pri	Mon Oct 04 11:29:25 2010 +0300
+++ b/inc/build_defines.pri	Fri Oct 15 12:29:39 2010 +0300
@@ -13,5 +13,5 @@
 #
 # Description: Generated file - do not edit manually
 #
-RD_JAVA_BIN_VERSION = 10.2.17
+RD_JAVA_BIN_VERSION = 10.2.19
 PROJECT_DEFINES *= RD_JAVA_SYMBIAN_TARGET RD_JAVA_S60_RELEASE_10_1 RD_JAVA_S60_RELEASE_10_1_ONWARDS RD_JAVA_S60_RELEASE_9_2_ONWARDS RD_JAVA_S60_RELEASE_5_0_ONWARDS RD_JAVA_PKG_SPLIT RD_JAVA_UI_QT RD_JAVA_STDCPPV5 RD_JAVA_EPOCALLOWDLLDATA_FIX RD_JAVA_HTTP_EMC_ENABLED RD_JAVA_NGA_ENABLED SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK RD_JAVA_PROXIMITY_LISTENER_ENABLED RD_JAVA_OPENC_BETA_PATCH OPENLCDUI_ENABLED RD_JAVA_OPENLCDUI_ENABLED RD_JAVA_INSTALLERUI_ENABLED RD_JAVA_PREWARM RD_JAVA_ADVANCED_TACTILE_FEEDBACK RD_JAVA_APPLICATION_SETTINGS_QT RD_JAVA_MIDPRMS_DB 
--- a/inc/java.txt	Mon Oct 04 11:29:25 2010 +0300
+++ b/inc/java.txt	Fri Oct 15 12:29:39 2010 +0300
@@ -1,1 +1,1 @@
-2.2.17
+2.2.19
--- a/javacommons/gcfprotocols/http/inc.s60/chttptransactionclient.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/inc.s60/chttptransactionclient.h	Fri Oct 15 12:29:39 2010 +0300
@@ -22,7 +22,7 @@
 #include <http/rhttptransaction.h>
 #include <http/mhttptransactioncallback.h>
 #include <http/mhttpdatasupplier.h>
-#include "monitor.h"
+
 
 class MNativeSecureConnectionInformation;
 class CX509Certificate;
@@ -43,7 +43,7 @@
     * call this function to make the request.
     * Takes ownership of aPostData
     */
-    void SubmitL(RPointerArray<HBufC8>* aRawHeaders , TDesC8* aPostData, int aResponseTimeout);
+    void SubmitL(RPointerArray<HBufC8>* aRawHeaders , TDesC8* aPostData, int aResponseTimeout, bool aPartialDataFlag);
     /*
     * Get the response headers back from the transaction
     */
@@ -82,6 +82,8 @@
      */
     void SetHTTPAuthenticationCallbackL(MHTTPAuthenticationCallback& aCallBack);
 
+    void PostDataL(HBufC8* aPostData, const bool aEndOfRequest);
+
 private:
     enum TTransactionState
     {
@@ -129,9 +131,6 @@
     MHTTPDataSupplier* iRespBody;
     MRefHttpClientObserver* iObserver;
     CHttpsCertInfo* iCertInfo;
-    java::util::Monitor *iMonitor1;
-    java::util::Monitor *iMonitor2;
-    java::util::Monitor *iMonitor3;
     HBufC8* iBuf;
     HBufC8* iDrmBuf;
     TInt iStatus;
@@ -147,6 +146,9 @@
     TInt iMinLength;
     TBool iDrmDownload;
     TInt iFlag;
+    bool iPartialPostData;
+    bool iEndOfRequest;
+
 };
 
 #endif // CHTTPTRANSACTIONCLIENT_H
--- a/javacommons/gcfprotocols/http/inc.s60/mrefhttpclientobserver.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/inc.s60/mrefhttpclientobserver.h	Fri Oct 15 12:29:39 2010 +0300
@@ -23,6 +23,7 @@
 public:
     virtual void SubmitComplete(TInt aStatus) =0 ;
     virtual void DataReadyForRead(TInt aStatus) = 0;
+    virtual void DoPostCallBack() = 0;
 };
 
 #endif // MREFHTTPCLIENTOBSERVER_H
--- a/javacommons/gcfprotocols/http/inc.s60/nativehttpsession.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/inc.s60/nativehttpsession.h	Fri Oct 15 12:29:39 2010 +0300
@@ -40,9 +40,9 @@
     void doSubmitCallback(TInt aStatus,jobject &aPeer);
     //void doReadCallback(TInt aStatus);
     void doReadCallback(TInt aStatus,jobject &aPeer);
-
+    void doDataConsumedCallback(jobject &aPeer);
     void vmAttached();
-    
+
 private:
     NativeHttpSession();
 
@@ -51,12 +51,13 @@
 private:
 
     TInt ExecuteCreateHttpSessionL(int aSelf, TInt aType,  TInt aAPNId, TInt* apnerr);
-    
+
 private:
     HttpSessionClient* iHttpSessionClient;
     TInt                iSuiteId;
     jmethodID   iSubmitCallbackMethodID;
     jmethodID   iReadCallbackMethodID;
+    jmethodID   iPostCallbackMethodID;
 public:
     java::util::Monitor *iMonitor;
 };
--- a/javacommons/gcfprotocols/http/inc.s60/nativehttptransaction.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/inc.s60/nativehttptransaction.h	Fri Oct 15 12:29:39 2010 +0300
@@ -42,7 +42,7 @@
     * After the headers and other details have been set up,
     * call this function to make the request.
     */
-    void SubmitL(JNIEnv* aJni, jobject * aPeer,const jobjectArray aHeaders, const jbyteArray aPostData, const jint aPostDataLength, int aResponseTimeout);
+    void SubmitL(JNIEnv* aJni, jobject * aPeer,const jobjectArray aHeaders, const jbyteArray aPostData, const jint aPostDataLength, int aResponseTimeout, const jboolean aPartialDataFlag);
     /*
     * Get the response headers back from the transaction
     */
@@ -63,6 +63,8 @@
     *   CloseTransaction
     */
     void CloseTransaction();
+
+    int PostDataL(JNIEnv* aJni,const jbyteArray aPostData, const jint aPostDataLength, const jboolean iEndOfRequest);
     /*
     * Get the secutiry information
     */
@@ -74,6 +76,7 @@
 private: //from MRefHttpClientObserver
     void SubmitComplete(TInt aStatus);
     void DataReadyForRead(TInt aStatus);
+    void DoPostCallBack();
 private:
     NativeHttpTransaction(HttpSessionClient& aSession,FunctionServer* aFuncServer);
     void ConstructL(JNIEnv& aJni, jobject aPeer,/* TJavaEventServer aServer,*/ const TDesC* aUri, const TDesC* aRequestMethod);
@@ -81,7 +84,7 @@
 private:
     //static void ExecuteCreateTransactionL(NativeHttpTransaction* aSelf, const TDesC* aUri, const TDesC* aRequestMethod);
     void ExecuteCreateTransactionL(int,int,int);
-    void ExecuteSubmitL(int aSelfhandle , int aRawHeadershandle , int aPostBufhandle, int aResponseTimeout);
+    void ExecuteSubmitL(int aSelfhandle , int aRawHeadershandle , int aPostBufhandle, int aResponseTimeout, bool aPartialDataFlag);
     //void ExecuteSubmitL(NativeHttpTransaction* aSelf , RPointerArray<HBufC8>* aRawHeaders, HBufC8* aPostBuf );
     //static void ExecuteGetResponseL(NativeHttpTransaction* aSelf, RPointerArray<HBufC8>* aRawHeaders);
     void ExecuteGetResponseL(int aSelf,int aRawHeaders);
@@ -90,6 +93,8 @@
     //static void ExecuteCloseTransaction(NativeHttpTransaction* aSelf);
     void ExecuteCloseTransaction(int aSelfhandle);
 
+    TInt ExecutePostDataL(int aSelfhandle, int aPostBufhandle, bool iEndOfRequest);
+
 private:
     HttpSessionClient& iSessionClient;
     CHttpTransactionClient* iTransactionClient;
--- a/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java	Fri Oct 15 12:29:39 2010 +0300
@@ -78,6 +78,7 @@
     protected final static int REQUEST_HEADERS_SENT = 3;
     protected final static int REQUEST_SENT = 4;
     protected final static int REPLY_RECEIVED = 5;
+    protected final static int PARTIAL_REQUEST_SENT = 6;
 
     // Character constants
     protected final static char HASH = '#';
@@ -131,6 +132,12 @@
     private boolean iTrustedSuite = true;
     private int iRespTimeOut = -1;
     private int iRetries = 0;
+    private int iRequestBodyLen = -1;
+    private int iTotalPostDataLen = 0;
+    private boolean iEndOfRequest = false;
+    private boolean iChunkedTransfer = false;
+
+    protected final BlockingOperation iPostDataBlock;
 
     static
     {
@@ -194,6 +201,7 @@
         iTransactionBlock = new BlockingOperation();
         iNativeDataReadyForRead = new BlockingOperation();
         iNativeDataReadyForRead.setResult(BlockingOperation.BLOCKED);
+        iPostDataBlock = new BlockingOperation();
         iFinalizer = registerForFinalization();
         Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- HttpConnectionNative new ");
 
@@ -814,6 +822,20 @@
             {
                 iRequestProperties.put(aKey, aValue);
             }
+            if (aKey.equals(TRANSFER_ENCODING))
+            {
+                String tmp = aValue.toLowerCase();
+                if (tmp.equals("chunked"))
+                {
+                    iChunkedTransfer = true;
+                    iRequestBodyLen = -1;    // as per RFC, precedence should be give to "transfer-encoding" when "content-length" is also set.
+                }
+            }
+            if (aKey.equals(CONTENT_LENGTH))
+            {
+                iRequestBodyLen = Integer.parseInt(aValue);
+
+            }
         }
         //Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- setRequestProperty(String, String)" );
         return;
@@ -864,20 +886,114 @@
     }
 
 
-    protected synchronized void outputStreamFlushed() throws IOException
+    private void waitForPostDataCompletion()
     {
-        // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "+ outputStreamFlushed()" );
+        Logger.LOG(Logger.ESOCKET, Logger.EInfo, "+waitForPostDataCompletion");
+        iPostDataBlock.waitForCompletion();
+        Logger.LOG(Logger.ESOCKET, Logger.EInfo, "-waitForPostDataCompletion");
+
+    }
+
+    private synchronized void sendPartialRequest() throws IOException
+    {
+        // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "HTTP sendPartialRequest() ");
         switch (iState)
         {
         case SETUP:
         case CONNECTED:
-        case REQUEST_HEADERS_SENT:
-            ensureResponse();
+
+            synchronized (iPostDataBlock.getLock())
+            {
+                synchronized (iPostDataBlock)
+                {
+                    sendRequest(true);
+                    iPostedDataStream.reset();
+                    waitForPostDataCompletion();
+                }
+            }
             break;
 
-        default:
-            // No-op
-            ;
+        case PARTIAL_REQUEST_SENT :
+
+            byte[] postData = iPostedDataStream.toByteArray();
+            iPostedDataStream.reset();
+            int len = -1;
+            if (postData != null)
+            {
+                len = postData.length;
+                iTotalPostDataLen = iTotalPostDataLen + len;
+            }
+            // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "HTTP content-len = "+iRequestBodyLen + " totalflushed = "+ iTotalPostDataLen +" os len = "+ postData.length);
+            if (iTotalPostDataLen == iRequestBodyLen)
+            {
+                iEndOfRequest = true;
+            }
+
+            synchronized (iPostDataBlock.getLock())
+            {
+                synchronized (iPostDataBlock)
+                {
+                    int err = _postData(iNativeTransactionHande, postData, len, iEndOfRequest);
+
+                    if (err != 0)
+                    {
+                        throwIOException("Unable to write data .Symbian os error code: "
+                                         + err);
+                    }
+                    if (iEndOfRequest == false)
+                    {
+                        // wait until http stack consumes the data
+                        waitForPostDataCompletion();
+                    }
+                    else
+                    {
+                        // request complete, wait until the first chunk of response header arrives
+                        synchronized (iTransactionBlock.getLock())
+                        {
+                            synchronized (iTransactionBlock)
+                            {
+                                waitForTransaction();
+                            }
+                        }
+
+                    }  // end else
+                } // end syn
+
+            } // end syn getlock
+
+            break;
+        }
+
+    }
+
+    protected synchronized void outputStreamFlushed() throws IOException
+    {
+        int postDataLength = iPostedDataStream.size();
+
+
+        if ((iRequestBodyLen > postDataLength) || (iChunkedTransfer == true))
+        {
+            // chunked http request will be sent in two cases
+            // 1) application sets "Content-Lenght" request header and writes to output stream multiple times using flush
+            //     like a sequence of os.write(); os.flush() operations
+            // 2) application sets "Transfer-Encoding" request header and writes to ouput stream multiple times using flush
+            sendPartialRequest();
+
+        }
+        else
+        {
+            switch (iState)
+            {
+            case SETUP:
+            case CONNECTED:
+            case REQUEST_HEADERS_SENT:
+                ensureResponse();
+                break;
+
+            default:
+                // No-op
+                ;
+            }
         }
         // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- outputStreamFlushed()" );
     }
@@ -938,15 +1054,55 @@
         return;
     }
 
+    private void waitForResponse() throws IOException
+    {
+        // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "HTTP flush case, waitForResponse: total len =  "+iRequestBodyLen + " totalflushed = "+ iTotalPostDataLen );
+        if (iEndOfRequest == false)
+        {
+            // chunked http request was sent, but end of request not sent
+            // only in case of "transfer-encoding" request header, control will come here
+            iEndOfRequest = true;
+            byte[] postData = iPostedDataStream.toByteArray();
+            iPostedDataStream.reset();
+            int len = -1;
+            if (postData != null)
+            {
+                len = postData.length;
+                // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "More data left in os, len = "+len);
+                iTotalPostDataLen = iTotalPostDataLen + len;
+            }
+            int err = _postData(iNativeTransactionHande, postData, len , iEndOfRequest);
+            if (err != 0)
+            {
+                throwIOException("Unable to write data .Symbian os error code: "
+                                 + err);
+            }
+            synchronized (iTransactionBlock.getLock())
+            {
+                synchronized (iTransactionBlock)
+                {
+                    waitForTransaction();
+                }
+            }
+        }
+        getResponse();
+        iState = REPLY_RECEIVED;
+
+    }
+
     protected void ensureResponse() throws IOException
     {
         // Logger.LOG(Logger.ESOCKET, Logger.EInfo, "+ ensureResponse()" );
         ensureConnected();
         switch (iState)
         {
+        case PARTIAL_REQUEST_SENT:
+            waitForResponse();
+            break;
+
         case CONNECTED:
 
-            sendRequest();
+            sendRequest(false);      // sendRequest() will block until the first chunk of http response arrives from the server.
             // Fall Through
         case REQUEST_HEADERS_SENT:
         case REQUEST_SENT:
@@ -1073,9 +1229,10 @@
         //Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- readHeaders(InputStream)" );
     }
 
-    protected synchronized void sendRequest() throws IOException
+    protected synchronized void sendRequest(boolean aPartialDataFlag) throws IOException
     {
         ensureConnected();
+        Logger.PLOG(Logger.ESOCKET, "HTTP sendRequest() , Flag : "  + aPartialDataFlag);
         final int count = iRequestProperties.size();
         int headerCount = count;
 
@@ -1107,6 +1264,7 @@
         {
             postData = iPostedDataStream.toByteArray();
             postDataLength = postData.length;
+
         }
 
         synchronized (iTransactionBlock.getLock())
@@ -1119,7 +1277,7 @@
                 Logger.LOG(Logger.ESOCKET, Logger.EInfo,
                            "before _submitTransaction ");
                 final int err = _submitTransaction(iNativeTransactionHande,
-                                                   headers, postData, postDataLength,iRespTimeOut);
+                                                   headers, postData, postDataLength,iRespTimeOut, aPartialDataFlag);
 
                 Logger.LOG(Logger.ESOCKET, Logger.EInfo,
                            "-_submitTransaction +err " + err);
@@ -1130,20 +1288,32 @@
                 if (err != 0)
                     throwIOException("Unable to connect to server.Symbian os error code: "
                                      + err);
-                iState = REQUEST_SENT;
-                waitForTransaction();
+                if (aPartialDataFlag == true)
+                {
+                    iState = PARTIAL_REQUEST_SENT;
+                    iTotalPostDataLen = iTotalPostDataLen + postDataLength;
+                }
+                else
+                {
+                    // block and wait for response headers only when it a complete request
+                    iState = REQUEST_SENT;
+                    waitForTransaction();
+                }
                 Logger.LOG(Logger.ESOCKET, Logger.EInfo,
                            "- sendRequest _submitTransaction");
             }
         }
-        if ((iTransactionBlock.getResult() == -18) &&(iRetries < 2))
+        if (aPartialDataFlag == false)
         {
-            iRetries++;
-            Logger.LOG(Logger.ESOCKET, Logger.EInfo,
-                       "- sendRequest KErrNotReady erroi, calling recursive sendRequest()");
-            sendRequest();
-            Logger.LOG(Logger.ESOCKET, Logger.EInfo,
-                       "- sendRequest KErrNotReady erroi, calling recursive sendRequest() returned");
+            if ((iTransactionBlock.getResult() == -18) &&(iRetries < 2))
+            {
+                iRetries++;
+                Logger.LOG(Logger.ESOCKET, Logger.EInfo,
+                           "- sendRequest KErrNotReady erroi, calling recursive sendRequest()");
+                sendRequest(false);
+                Logger.LOG(Logger.ESOCKET, Logger.EInfo,
+                           "- sendRequest KErrNotReady erroi, calling recursive sendRequest() returned");
+            }
         }
     }
 
@@ -1291,6 +1461,13 @@
         Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- dataReadyForReadCallBack");
     }
 
+    protected void postDataConsumedCallback()
+    {
+        Logger.LOG(Logger.ESOCKET, Logger.EInfo, "+ postDataconsumedCallback  ");
+        iPostDataBlock.notifyCompleted(0);
+
+    }
+
     /*
      * Native Calls
      */
@@ -1300,13 +1477,14 @@
             String aUri, String aRequestMethod);
     private native int _submitTransaction(int aNativeTransactionHande,
                                           String[] aHeaders, byte[] aPostData, int aPostLength,
-                                          int aRespTimeOut);
+                                          int aRespTimeOut, boolean aPartialData);
     private native String[] _getResponse(int aNativeTransactionHande);
     private native int _getBytes(int aNativeTransactionHande, byte[] aBuffer,
                                  int aLength);
     private native void _closeTransaction(int aNativeTransactionHande);
     private native int _available(int aNativeTransactionHande);
     private native String _getUserAgentHeaderValue(boolean aMidpRuntime);
+    private native int _postData(int aNativeTransactionHandle, byte[] aPostData, int aLength, boolean iEndOfRequest);
 
     /*
      *
--- a/javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -72,6 +72,7 @@
     LOG(ESOCKET,EInfo, "CHttpTransactionClient::ConstructL ");
     iFlag = 0;
     iDrmBuf = HBufC8::NewL(256);
+    iEndOfRequest = false;
     OpenTransactionL(aUri , aRequestMethod);
 }
 
@@ -98,10 +99,11 @@
     LOG(ESOCKET,EInfo,"CHttpTransactionClient::OpenTransactionL - ");
 }
 
-void CHttpTransactionClient::SubmitL(RPointerArray<HBufC8>* aRawHeaders , TDesC8* aPostData, int aResponseTimeout)
+void CHttpTransactionClient::SubmitL(RPointerArray<HBufC8>* aRawHeaders , TDesC8* aPostData, int aResponseTimeout, bool aPartialDataFlag)
 {
     //ELOG(ESOCKET,"CHttpTransactionClient::SubmitL + ");
     //retrieve the headers
+    iPartialPostData = aPartialDataFlag;
     TInt respTimeOut = aResponseTimeout;
     delete iBuf;
     iBuf=NULL;
@@ -696,7 +698,7 @@
 
 void CHttpTransactionClient::NotifyErrorL(TInt aErrorCode)
 {
-    LOG1(ESOCKET,EInfo," CHttpTransactionClient::NotifyErrorL: %d ",aErrorCode);
+    ELOG1(ESOCKET," CHttpTransactionClient::NotifyErrorL: %d ",aErrorCode);
     if ((aErrorCode  ==  KErrNotReady))
     {
         iTransaction.Cancel();
@@ -761,12 +763,18 @@
 TBool CHttpTransactionClient::GetNextDataPart(TPtrC8& aDataPart)
 {
     LOG(ESOCKET,EInfo,"CHttpTransactionClient::GetNextDataPart");
-    TBool lastPart=EFalse;
+    TBool lastPart=ETrue;
+
     if (iBuf!=NULL)
     {
-        lastPart = ETrue;
+        // in-case of non-chunked, this is the end of POST data
         aDataPart.Set(iBuf->Des());
     }
+    if (iPartialPostData)
+    {
+        lastPart = iEndOfRequest;
+    }
+    LOG1(ESOCKET,EInfo,"CHttpTransactionClient::GetNextDataPart, returning : %d", lastPart);
     return lastPart;
 }
 
@@ -776,12 +784,18 @@
     appropriate.  */
 void CHttpTransactionClient::ReleaseData()
 {
-    LOG(ESOCKET,EInfo," CHttpTransactionClient::ReleaseData: delete iBuf");
+    LOG(ESOCKET,EInfo," CHttpTransactionClient::ReleaseData: ");
     if (iBuf)
     {
         delete iBuf;
         iBuf=NULL;
     }
+    if (iPartialPostData)
+    {
+        // inform the java side that post data is consumed
+        TRAP_IGNORE(iObserver->DoPostCallBack());
+    }
+
 }
 
 /** Obtain the overall size of the data being supplied, if known
@@ -795,7 +809,11 @@
 TInt CHttpTransactionClient::OverallDataSize()
 {
     TInt overallSize = KErrNotFound;
-    if (iBuf)
+    if (iPartialPostData == true)
+    {
+        overallSize = KErrNotFound;
+    }
+    else if (iBuf)
     {
         overallSize=iBuf->Length();
     }
@@ -803,6 +821,24 @@
     return overallSize;
 }
 
+void CHttpTransactionClient::PostDataL(HBufC8* aPostData, const bool aEndOfRequest)
+{
+    LOG(ESOCKET,EInfo,"CHttpTransactionClient::PostData ");
+    iEndOfRequest = aEndOfRequest;
+    if (aPostData!=NULL && aPostData->Length()>0)
+    {
+        iBuf=aPostData;
+    }
+    else
+    {
+        HBufC8* buf = HBufC8::NewL(1);      // descriptor of length 0
+        iBuf = buf;
+    }
+    iTransaction.NotifyNewRequestBodyPartL();  // notify the stack that new request body data is available
+
+
+}
+
 /** Reset the data supplier.  This indicates to the data supplier that it should
     return to the first part of the data.  This could be used in a situation where
     the data consumer has encountered an error and needs the data to be supplied
@@ -814,7 +850,16 @@
 TInt CHttpTransactionClient::Reset()
 {
     LOG(ESOCKET,EInfo,"CHttpTransactionClient::Reset");
-    TInt err = KErrNone;
+    ELOG1(ESOCKET, "Reset() , Tran = %d", iTransaction.Id());
+    TInt err = 0;
+    if(iPartialPostData == false)
+    {
+        err = KErrNone; 
+    }
+    else
+    {
+        err = KErrNotSupported;
+    }
     return err;
 }
 
--- a/javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -70,6 +70,9 @@
     iReadCallbackMethodID = NULL;
     iReadCallbackMethodID = mJniEnv->GetMethodID(httpNativeClass, "dataReadyForReadCallBack", "(I)V");
 
+    iPostCallbackMethodID = NULL;
+    iPostCallbackMethodID = mJniEnv->GetMethodID(httpNativeClass, "postDataConsumedCallback", "()V");
+
     LOG(ESOCKET,EInfo,"-vmAttached");
 }
 
@@ -148,3 +151,21 @@
     LOG(ESOCKET,EInfo,"-doReadCallback1");
 }
 
+void NativeHttpSession::doDataConsumedCallback(jobject &aPeer)
+{
+    LOG(ESOCKET,EInfo,"+doDataConsumedCallback");
+    jobject localPeerObject = mJniEnv->NewLocalRef(aPeer);
+    if (localPeerObject)
+    {
+        mJniEnv->CallVoidMethod(aPeer,iPostCallbackMethodID);
+    }
+    else
+    {
+        ELOG(ESOCKET,"NativeHttpSession::doDataConsumedCallback: Error!! java peer object not found ");
+    }
+
+
+}
+
+
+
--- a/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -108,7 +108,7 @@
 }
 
 void NativeHttpTransaction::SubmitL(JNIEnv* aJni, jobject* /*aPeer*/,const jobjectArray aHeaders, const jbyteArray aPostData, const jint aPostDataLength,
-                                    int aResponseTimeout)
+                                    int aResponseTimeout, jboolean aPartialDataFlag)
 {
 
     //retrieve the headers
@@ -160,7 +160,7 @@
 
     int hbufhandle = reinterpret_cast<int>(postBuf);
 
-    CallMethodL(this, &NativeHttpTransaction::ExecuteSubmitL,handle,arrayhandle , hbufhandle, aResponseTimeout, iFuncServer);
+    CallMethodL(this, &NativeHttpTransaction::ExecuteSubmitL,handle,arrayhandle , hbufhandle, aResponseTimeout, aPartialDataFlag, iFuncServer);
     if (postBuf!=NULL)
     {
         delete postBuf;
@@ -171,14 +171,14 @@
     CleanupStack::PopAndDestroy();//rawHeaderArray;
 }
 
-void NativeHttpTransaction::ExecuteSubmitL(int aSelfhandle , int aRawHeadershandle , int aPostBufhandle, int aResponseTimeout)
+void NativeHttpTransaction::ExecuteSubmitL(int aSelfhandle , int aRawHeadershandle , int aPostBufhandle, int aResponseTimeout, bool aPartialDataFlag)
 {
 
     NativeHttpTransaction *aSelf = reinterpret_cast<NativeHttpTransaction*>(aSelfhandle);
     RPointerArray<HBufC8>* aRawHeaders = reinterpret_cast<RPointerArray<HBufC8>*>(aRawHeadershandle);
     HBufC8* aPostBuf = reinterpret_cast<HBufC8*>(aPostBufhandle);
 
-    aSelf->iTransactionClient->SubmitL(aRawHeaders, aPostBuf, aResponseTimeout);
+    aSelf->iTransactionClient->SubmitL(aRawHeaders, aPostBuf, aResponseTimeout, aPartialDataFlag);
 }
 
 jobjectArray NativeHttpTransaction::GetResponseL(JNIEnv* aJni)
@@ -273,6 +273,17 @@
     LOG(ESOCKET,EInfo,"-NativeHttpTransaction::DataReadyForRead");
 }
 
+void NativeHttpTransaction::DoPostCallBack()
+{
+    LOG(ESOCKET,EInfo,"+NativeHttpTransaction::DoPostCallBack");
+
+    NativeHttpSession* session = reinterpret_cast<NativeHttpSession*>(iFuncServer);
+    session->doDataConsumedCallback(iJniPeer);
+
+    LOG(ESOCKET,EInfo,"-NativeHttpTransaction::DoPostCallBack");
+
+}
+
 void NativeHttpTransaction::ExecuteCloseTransaction(int aSelfhandle)
 {
     NativeHttpTransaction *aSelf = reinterpret_cast<NativeHttpTransaction*>(aSelfhandle);
@@ -309,6 +320,35 @@
     return handle;
 }
 
+int NativeHttpTransaction::PostDataL(JNIEnv* aJni,const jbyteArray aPostData, const jint aPostDataLength, const jboolean iEndOfRequest)
+{
+
+    HBufC8* postBuf=NULL;
+    TInt ret = 0;
+    if (aPostDataLength>KErrNone)
+    {
+        postBuf=HBufC8::NewLC(aPostDataLength);
+        TPtr8 bufPtr = postBuf->Des();
+        User::LeaveIfError(S60CommonUtils::CopyToNative(*aJni , aPostData , 0 , aPostDataLength , bufPtr));
+        CleanupStack::Pop(postBuf);
+    }
+    int handle = reinterpret_cast<int>(this);
+    int hbufhandle = reinterpret_cast<int>(postBuf);
+    CallMethodL(ret, this,&NativeHttpTransaction::ExecutePostDataL,handle, hbufhandle, iEndOfRequest, iFuncServer);
+    return KErrNone;
+}
+
+TInt NativeHttpTransaction::ExecutePostDataL(int aSelfhandle, int aPostBufhandle, bool iEndOfRequest)
+{
+
+    NativeHttpTransaction *aSelf = reinterpret_cast<NativeHttpTransaction*>(aSelfhandle);
+    HBufC8* aPostBuf = reinterpret_cast<HBufC8*>(aPostBufhandle);
+    aSelf->iTransactionClient->PostDataL(aPostBuf , iEndOfRequest);
+
+
+    return KErrNone;
+}
+
 /*
 * Returns the amount of bytes avaible for read in our buffer.
 */
--- a/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -112,7 +112,8 @@
     jobjectArray aHeaders,
     jbyteArray aPostData,
     jint aPostDataLength,
-    jint aResponseTimeout)
+    jint aResponseTimeout,
+    jboolean aPartialDataFlag)
 {
     LOG(ESOCKET,EInfo,"http jni _submitTransaction");
     NativeHttpTransaction* tran = reinterpret_cast<NativeHttpTransaction*>(aNativeHttpTransaction);
@@ -120,7 +121,7 @@
     tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer);
     try
     {
-        TRAPD(err,tran->SubmitL(aJni, &aPeer,aHeaders, aPostData, aPostDataLength, respTimeOut));
+        TRAPD(err,tran->SubmitL(aJni, &aPeer,aHeaders, aPostData, aPostDataLength, respTimeOut, aPartialDataFlag));
         return err;
     }
     catch (...)
@@ -220,6 +221,7 @@
 
 jstring GetUserAgentL(JNIEnv *aJni, jboolean aMidpRuntime)
 {
+
     jstring header = NULL;
 
     if (aMidpRuntime == false)
@@ -293,3 +295,25 @@
     LOG(ESOCKET,EInfo,"GetUserAgentL() -");
     return header;
 }
+
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1postData
+(JNIEnv *aJni, jobject, jint aNativeHttpTransaction, jbyteArray aPostData, jint aPostDataLength, jboolean iEndOfRequest)
+{
+    LOG(ESOCKET,EInfo,"http jni _postData");
+    NativeHttpTransaction* tran = reinterpret_cast<NativeHttpTransaction*>(aNativeHttpTransaction);
+    try
+    {
+        TRAPD(err,tran->PostDataL(aJni, aPostData, aPostDataLength, iEndOfRequest));
+        return err;
+    }
+    catch (...)
+    {
+        ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction");
+        return -1;
+    }
+
+
+
+
+}
+
--- a/javacommons/javastorage/tsrc/Makefile	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# 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: 
-#
-
-include $(JAVA_SRC_ROOT)/build/Makefile.defs
-
-COMPONENTS = \
-	storageclient/build
-
-include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javacommons/javastorage/tsrc/java_api/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/build/build.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -1,6 +1,6 @@
 <!--
 #
-# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 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"
@@ -12,141 +12,32 @@
 #
 # Contributors:
 #
-# Description: 
+# Description:
 #
 -->
 
-<project name="javastoragetest" default="deploy.ut" basedir=".">
+<project name="javastorageunittests" basedir="." default="deploy">
 
   <import file="../../../../../build/utilities.xml"/>
-
-  <property environment="env"/>
-  <property name="java.src.root" location="${env.JAVA_SRC_ROOT}"/>
-  <property name="java.bin.root" location="${env.JAVA_BIN_ROOT}"/>
+  <property file="../../../../../build/unittest.properties"/>
 
-  <property name="src.dir" location="../javasrc"/>
-  <property name="build.dir" location="../build"/>
-  <property name="classes.dir" location="${build.dir}/javabuild"/>
-  <property name="dist" location="${java.bin.root}/jsr/classes"/>
-  <property name="installer.jar.filename" value="javainstaller.jar"/>
-  <property name="javastoragetest.jar.filename" value="javastoragetest.jar"/>
-  <property name="utils.jar.filename" value="javacommonutils.jar"/>
-  <property name="logger.jar.filename" value="logger.jar"/>
-  <property name="junit.jar.dir" location="${java.src.root}/tools/junit"/>
-  <property name="junit.jar.filename" value="j2meunit1.1.1.jar"/>
-  <property name="junit.omj.jar.filename" value="j2meunitomj.jar"/>
-
-  <property name="bootclasspath.cdc" location="${java.src.root}/javaruntime/jvm/ibm/j9_23/ibmdelivery/resource/lib/jclCdc11/classes.zip"/>
-
-  <property name="javac.source" value="1.3"/>
-  <property name="javac.target" value="1.3"/>
-
-  <target name="clean">
-    <delete dir="${classes.dir}"/>
-    <delete file="${dist}/${javastoragetest.jar.filename}"/>
-    <delete file="${dist}/${junit.jar.filename}"/>
-    <delete file="${dist}/${junit.omj.jar.filename}"/>
-  </target>
+  <property name="java.src.paths" value="../javasrc"/>
+  <property name="java.bin.root" value="${env.JAVA_BIN_ROOT}"/>
 
-  <target name="compile.ut" depends="init.properties">
-    <property name="jars.dir" location="${jarfiles.collect.root}"/>
-    <property name="jars.dir.cdc" location="${jarfiles.collect.cdc.root}"/>
-    <mkdir dir="${classes.dir}"/>
-    <javac source="${javac.source}" target="${javac.target}"
-           destdir="${classes.dir}"
-           bootclasspath="${bootclasspath.cdc}">
-           <classpath>
-               <pathelement
-                 location="${jars.dir.cdc}/${installer.jar.filename}"/>
-               <pathelement location="${impl.cldc.jar}"/>
-               <pathelement location="${impl.cdc.jar}"/>
-               <pathelement location="${public.api.jar}"/>
-               <pathelement location="${platform.api.jar}"/>
-               <pathelement location="${junit.jar.dir}/${junit.jar.filename}"/>
-               <pathelement location="${junit.jar.dir}/${junit.omj.jar.filename}"/>
-           </classpath>
-      <src path="${src.dir}"/>
-    </javac>
+  <target name="run" depends="deploy">
+      <echo>Running TestStorageAttribute</echo>
+      <exec executable="${java.bin.root}/bin/javaunittester">
+          <arg line="-mainclass=com.nokia.mj.impl.storage.TestStorageAttribute"/>
+      </exec>
+
+      <echo>Running TestStorageAttribute</echo>
+      <exec executable="${java.bin.root}/bin/javaunittester">
+          <arg line="-mainclass=com.nokia.mj.test.storage.TestStorageEntry"/>
+      </exec>
   </target>
-
-  <target name="deploy.ut" depends="compile.ut">
-      <mkdir dir="${dist}"/>
-      <jar destfile="${vm.extension.directory}/${javastoragetest.jar.filename}" basedir="${classes.dir}"/>
-      <copy file="${junit.jar.dir}/${junit.jar.filename}"
-            tofile="${vm.extension.directory}/${junit.jar.filename}"/>
-      <copy file="${junit.jar.dir}/${junit.omj.jar.filename}"
-            tofile="${vm.extension.directory}/${junit.omj.jar.filename}"/>
-  </target>
+  
+  <!-- NOTE: MISSING CASES from test run -->
 
   <target name="main" depends="clean,run"/>
 
-  <!--<target name="run" depends="deploy.ut">
-      <echo>Running TestStorageAttribute</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.impl.storage.TestStorageAttribute"/>
-      </exec>
-  </target>-->
-
-  <target name="run" depends="deploy.ut">
-      <echo>Running TestStorageAttribute</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.impl.storage.TestStorageAttribute"/>
-      </exec>
-      <echo>Running TestStorageEntry</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestStorageEntry"/>
-      </exec>
-      <echo>Running TestConnection</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestConnection"/>
-      </exec>
-      <echo>Running TestTransaction</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestTransaction"/>
-      </exec>
-      <echo>Running TestSearch</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestSearch"/>
-      </exec>
-      <echo>Running TestWrite</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestWrite"/>
-      </exec>
-      <echo>Running TestUpdate</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestUpdate"/>
-      </exec>
-      <echo>Running TestRemove</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestRemove"/>
-      </exec>
-      <echo>Running TestRead</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestRead"/>
-      </exec>
-      <echo>Running TestCreateTable</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestCreateTable"/>
-      </exec>
-      <echo>Running TestAppendTable</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestAppendTable"/>
-      </exec>
-      <echo>Running TestOTATable</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestOTATable"/>
-      </exec>
-      <echo>Running TestPreinstallTable</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestPreinstallTable"/>
-      </exec>
-      <echo>Running TestRobustness</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestRobustness"/>
-      </exec>
-      <echo>Running TestStorageException</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.test.storage.TestStorageException"/>
-      </exec>
-  </target>
 </project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/javastorage/tsrc/java_api/build/dummy.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2010 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 dummy pro file for generating a Jar file. Keeping
+#              build system happy.
+#
+
+TEMPLATE = subdirs
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java	Fri Oct 15 12:29:39 2010 +0300
@@ -20,7 +20,7 @@
 
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
  * StorageAttirubte test cases. See test methods for test case details.
  */
 public class TestStorageAttribute extends TestCase
-        implements InstallerMain, StorageNames
+        implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -97,7 +87,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestStorageAttribute()
@@ -391,6 +381,9 @@
      * 4. Test value null. If value is not set null is returned.
      * 5. Test value "".
      * 6. Test one len arguments.
+     * 7. Test hashCode.
+     * 8. Test instanceof true.
+     * 9. Test instanceof false.
      */
     public void testAttribute()
     {
@@ -487,6 +480,58 @@
         {
             assertTrue("Attribute set failed: " + se.getMessage(), false);
         }
+
+        // 7. Test hashCode.
+        try
+        {
+            String name = "HashCode";
+            String value = "V";
+            sa.setAttribute(name, value, StorageAttribute.STRING_TYPE);
+
+            assertTrue(sa.hashCode() > 0);
+        }
+        catch (StorageException se)
+        {
+            assertTrue("Attribute hashCode failed: " + se.getMessage(), false);
+        }
+        // 8. Test instanceof true and same.
+        try
+        {
+            String name = "Instanceof";
+            String value = "V";
+            sa.setAttribute(name, value, StorageAttribute.STRING_TYPE);
+            StorageAttribute sa2 = sa;
+            assertTrue(sa.equals(sa2));
+        }
+        catch (StorageException se)
+        {
+            assertTrue("Attribute equals same failed: " + se.getMessage(), false);
+        }
+
+        // 9. Test instanceof false.
+        try
+        {
+            String name = "Instanceof";
+            assertTrue(!(sa.equals(name)));
+        }
+        catch (StorageException se)
+        {
+            assertTrue("Attribute equals instanceof failed: " + se.getMessage(), false);
+        }
+
+        // 10. Test equals false
+        try
+        {
+            String name = "nottheSame";
+            String value = "V";
+            StorageAttribute sa2 = new StorageAttribute(name, value);
+            assertTrue(!(sa.equals(sa2)));
+        }
+        catch (StorageException se)
+        {
+            assertTrue("Attribute equals instanceof failed: " + se.getMessage(), false);
+        }
+
     }
 
     /**
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestAppendTable.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestAppendTable.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
 /**
  * StorageSession write test cases. See test methods for test case details.
  */
-public class TestAppendTable extends TestCase implements InstallerMain, StorageNames
+public class TestAppendTable extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -73,7 +63,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestAppendTable()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestConnection.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestConnection.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
 /**
  * StorageSession connection test cases. See test methods for test case details.
  */
-public class TestConnection extends TestCase implements InstallerMain, StorageNames
+public class TestConnection extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -73,7 +63,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestConnection()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestCreateTable.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestCreateTable.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
 /**
  * StorageSession write test cases. See test methods for test case details.
  */
-public class TestCreateTable extends TestCase implements InstallerMain
+public class TestCreateTable extends TestCase implements UnitTestSuiteCreator
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -65,7 +55,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestCreateTable()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestOTATable.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestOTATable.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -31,22 +31,12 @@
  * StorageSession OTA table specific test cases. See test methods for test
  * case details.
  */
-public class TestOTATable extends TestCase implements InstallerMain, StorageNames
+public class TestOTATable extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -58,7 +48,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestOTATable()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestPreinstallTable.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestPreinstallTable.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -31,22 +31,12 @@
  * StorageSession OTA table specific test cases. See test methods for test
  * case details.
  */
-public class TestPreinstallTable extends TestCase implements InstallerMain, StorageNames
+public class TestPreinstallTable extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -58,7 +48,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestPreinstallTable()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRead.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRead.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import com.nokia.mj.impl.utils.Uid;
 
 import j2meunit.framework.Test;
@@ -32,22 +32,12 @@
 /**
  * StorageSession read test cases. See test methods for test case details.
  */
-public class TestRead extends TestCase implements InstallerMain, StorageNames
+public class TestRead extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -83,7 +73,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestRead()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRemove.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRemove.java	Fri Oct 15 12:29:39 2010 +0300
@@ -22,7 +22,7 @@
 import com.nokia.mj.impl.storage.*;
 import com.nokia.mj.impl.utils.Uid;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -31,22 +31,12 @@
 /**
  * StorageSession remove test cases. See test methods for test case details.
  */
-public class TestRemove extends TestCase implements InstallerMain, StorageNames
+public class TestRemove extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -90,7 +80,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestRemove()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRobustness.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestRobustness.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -31,7 +31,7 @@
  * StorageSession OTA table specific test cases. See test methods for test
  * case details.
  */
-public class TestRobustness extends TestCase implements InstallerMain, StorageNames
+public class TestRobustness extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
     /**
      * Directory for JavaStorage tests.
@@ -46,7 +46,7 @@
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -66,7 +66,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestRobustness()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestSearch.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestSearch.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
 /**
  * StorageSession search test cases. See test methods for test case details.
  */
-public class TestSearch extends TestCase implements InstallerMain, StorageNames
+public class TestSearch extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -73,7 +63,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestSearch()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestStorageEntry.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestStorageEntry.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -31,20 +31,9 @@
 /**
  * StorageSession connection test cases. See test methods for test case details.
  */
-public class TestStorageEntry extends TestCase implements InstallerMain
+public class TestStorageEntry extends TestCase implements UnitTestSuiteCreator
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
-
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -96,7 +85,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestStorageEntry()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestStorageException.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestStorageException.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -31,22 +31,12 @@
  * StorageSession OTA table specific test cases. See test methods for test
  * case details.
  */
-public class TestStorageException extends TestCase implements InstallerMain, StorageNames
+public class TestStorageException extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -58,7 +48,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestStorageException()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestTransaction.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestTransaction.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -33,22 +33,12 @@
  * they're not tested. If second transaction can be created however
  * writing data with it causes DB server busy.
  */
-public class TestTransaction extends TestCase implements InstallerMain
+public class TestTransaction extends TestCase implements UnitTestSuiteCreator
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -84,7 +74,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestTransaction()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestUpdate.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestUpdate.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
 /**
  * StorageSession write test cases. See test methods for test case details.
  */
-public class TestUpdate extends TestCase implements InstallerMain, StorageNames
+public class TestUpdate extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -65,7 +55,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestUpdate()
--- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestWrite.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/test/storage/TestWrite.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,7 +21,7 @@
 import com.nokia.mj.test.storage.utils.StorageSessionTestUtils;
 import com.nokia.mj.impl.storage.*;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import j2meunit.framework.Test;
 import j2meunit.framework.TestCase;
 import j2meunit.framework.TestMethod;
@@ -30,22 +30,12 @@
 /**
  * StorageSession write test cases. See test methods for test case details.
  */
-public class TestWrite extends TestCase implements InstallerMain, StorageNames
+public class TestWrite extends TestCase implements UnitTestSuiteCreator, StorageNames
 {
-    /**
-     * Directory for JavaStorage tests.
-     */
-    private static final String iTestRoot = "./jstest";
-
-    /**
-     * Directory for JavaStorage journal and temp files.
-     */
-    private static final String iIsRoot = iTestRoot + "/js";
-
     private StorageSession iSession = null;
     private StorageSessionTestUtils iJtu = null;
 
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -65,7 +55,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public TestWrite()
--- a/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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: 
-*
-*/
-TARGET		  JavaStorageTests.exe
-TARGETTYPE	  exe
-UID			 0x00000000 0x03A6305A
-CAPABILITY all -tcb -allfiles -drm
-
-#include <../../../../../inc/java_stdcpp_support_for_exe.hrh>
-#include <platform_paths.hrh>
-
-APP_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE ../../../inc
-USERINCLUDE ../../../../../tools/cpputest/include/cpputest
-USERINCLUDE ../../../../../tools/cpputest/include/platforms/symbian
-USERINCLUDE ../src/utils
-USERINCLUDE ../../../../../inc
-
-LIBRARY cpputest.lib
-
-LIBRARY javastorage.lib
-
-SOURCEPATH ../src
-SOURCE alltests.cpp     // For STL execution
-SOURCE teststorageentry.cpp
-SOURCE testconnection.cpp
-SOURCE testsearch.cpp
-SOURCE testremove.cpp
-SOURCE testcreateTable.cpp
-SOURCE testread.cpp
-SOURCE testupdate.cpp
-SOURCE testappend.cpp
-SOURCE testtransaction.cpp
-SOURCE testwrite.cpp
-SOURCE testrobustness.cpp
-SOURCE testconcurrent.cpp
-SOURCE /utils/storagetestutils.cpp
--- a/javacommons/javastorage/tsrc/storageclient/build/bld.inf	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/*
-* 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: 
-*
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-alltests.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/javastorage/tsrc/storageclient/build/testjavastorage.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2010 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:
+#
+
+TEMPLATE=app
+TARGET=testjavastorage
+CONFIG += omj no_icon stl
+CONFIG -= qt
+
+LIBS += -lCppUTest -ljavastorage
+
+INCLUDEPATH += ../../../../../tools/cpputest/include/CppUTest
+
+INCLUDEPATH += ../../../../../tools/cpputest/include/Platforms/Symbian
+INCLUDEPATH += ../src
+TARGET.CAPABILITY = all -tcb
+
+include(../../../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/javastorage/tsrc/subsystem.mk	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2010 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:
+#
+
+include $(JAVA_SRC_ROOT)/build/Makefile.defs
+
+# Include the test frameworks.
+SUBSYSTEMS = \
+	$(JAVA_SRC_ROOT)/tools
+
+COMPONENTS = \
+	java_api/build \
+	storageclient/build
+
+# Make dependency to those.
+java_api/build storageclient/build: $(JAVA_SRC_ROOT)/tools
+include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/javastorage/tsrc/tst.bat	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,31 @@
+@rem
+@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+javaunittester -mainclass=com.nokia.mj.impl.storage.TestStorageAttribute
+javaunittester -mainclass=com.nokia.mj.test.storage.TestStorageEntry
+javaunittester -mainclass=com.nokia.mj.test.storage.TestConnection
+javaunittester -mainclass=com.nokia.mj.test.storage.TestTransaction
+javaunittester -mainclass=com.nokia.mj.test.storage.TestSearch
+javaunittester -mainclass=com.nokia.mj.test.storage.TestWrite
+javaunittester -mainclass=com.nokia.mj.test.storage.TestUpdate
+javaunittester -mainclass=com.nokia.mj.test.storage.TestRemove
+javaunittester -mainclass=com.nokia.mj.test.storage.TestRead
+javaunittester -mainclass=com.nokia.mj.test.storage.TestCreateTable
+javaunittester -mainclass=com.nokia.mj.test.storage.TestAppendTable
+javaunittester -mainclass=com.nokia.mj.test.storage.TestOTATable
+javaunittester -mainclass=com.nokia.mj.test.storage.TestPreinstallTable
+javaunittester -mainclass=com.nokia.mj.test.storage.TestRobustness
+javaunittester -mainclass=com.nokia.mj.test.storage.TestStorageException
--- a/javacommons/jvms/nativeportlayer/build/bwins/jvmnativeportu.def	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/build/bwins/jvmnativeportu.def	Fri Oct 15 12:29:39 2010 +0300
@@ -1,14 +1,9 @@
 EXPORTS
-	?GetPortLayerL@@YAPAVMJvmNativePortLayer@javaruntime@@XZ @ 1 NONAME ; class javaruntime::MJvmNativePortLayer * GetPortLayerL(void)
-	?SetPointerToCafMethod@CJvmNativePortLayer@javaruntime@@SAXP6AHABVTDesC16@@@Z@Z @ 2 NONAME ; void javaruntime::CJvmNativePortLayer::SetPointerToCafMethod(int (*)(class TDesC16 const &))
-	?Dummy1@@YAXXZ @ 3 NONAME ; void Dummy1(void)
-	?Dummy2@@YAXXZ @ 4 NONAME ; void Dummy2(void)
-	?Dummy3@@YAXXZ @ 5 NONAME ; void Dummy3(void)
-	?GetSingleThreadPriority@@YA?AW4TThreadPriority@@ABH@Z @ 6 NONAME ; enum TThreadPriority GetSingleThreadPriority(int const &)
-	?Dummy4@@YAXXZ @ 7 NONAME ; void Dummy4(void)
-	?Dummy5@@YAXXZ @ 8 NONAME ; void Dummy5(void)
-	?Dummy6@@YAXXZ @ 9 NONAME ; void Dummy6(void)
-	?Dummy7@@YAXXZ @ 10 NONAME ; void Dummy7(void)
-	?Dummy8@@YAXXZ @ 11 NONAME ; void Dummy8(void)
-	?Dummy9@@YAXXZ @ 12 NONAME ; void Dummy9(void)
+	?GetPortLayerL@javaruntime@@YAPAVMJvmNativePortLayer@1@XZ @ 1 NONAME ; class javaruntime::MJvmNativePortLayer * javaruntime::GetPortLayerL(void)
+	?SetPointerToCafMethod@CJvmNativePortLayer@javaruntime@@SAXP6AHABVTDesC16@@@Z@Z @ 2 NONAME ABSENT; void javaruntime::CJvmNativePortLayer::SetPointerToCafMethod(int (*)(class TDesC16 const &))
+	??0RJavaMutex@@QAE@XZ @ 3 NONAME ABSENT; RJavaMutex::RJavaMutex(void)
+	?Signal@RJavaMutex@@QAEXXZ @ 4 NONAME ABSENT; void RJavaMutex::Signal(void)
+	?Wait@RJavaMutex@@QAEXXZ @ 5 NONAME ABSENT; void RJavaMutex::Wait(void)
+	?GetSingleThreadPriority@javaruntime@@YA?AW4TThreadPriority@@ABH@Z @ 6 NONAME ; enum TThreadPriority javaruntime::GetSingleThreadPriority(int const &)
+	?GetThreadPriorityTable@javaruntime@@YAQBW4TThreadPriority@@AAH@Z @ 7 NONAME ABSENT; enum TThreadPriority const * const javaruntime::GetThreadPriorityTable(int &)
 
--- a/javacommons/jvms/nativeportlayer/build/eabi/jvmnativeportu.def	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/build/eabi/jvmnativeportu.def	Fri Oct 15 12:29:39 2010 +0300
@@ -1,14 +1,14 @@
 EXPORTS
-	_Z13GetPortLayerLv @ 1 NONAME
-	_ZN11javaruntime19CJvmNativePortLayer21SetPointerToCafMethodEPFiRK7TDesC16E @ 2 NONAME
-	_Z6Dummy1v @ 3 NONAME
-	_Z6Dummy2v @ 4 NONAME
-	_Z6Dummy3v @ 5 NONAME
-	_Z6Dummy4v @ 6 NONAME
-	_Z6Dummy5v @ 7 NONAME
-	_Z6Dummy6v @ 8 NONAME
-	_Z6Dummy7v @ 9 NONAME
-	_Z6Dummy8v @ 10 NONAME
-	_Z6Dummy9v @ 11 NONAME
-	_Z23GetSingleThreadPriorityRKi @ 12 NONAME
+	_ZN11javaruntime13GetPortLayerLEv @ 1 NONAME
+	_ZN11javaruntime19CJvmNativePortLayer21SetPointerToCafMethodEPFiRK7TDesC16E @ 2 NONAME ABSENT
+	_ZTIN11javaruntime19CJvmNativePortLayerE @ 3 NONAME ABSENT; #<TI>#
+	_ZTIN11javaruntime9CJavaFileE @ 4 NONAME ABSENT; #<TI>#
+	_ZTVN11javaruntime19CJvmNativePortLayerE @ 5 NONAME ABSENT; #<VT>#
+	_ZTVN11javaruntime9CJavaFileE @ 6 NONAME ABSENT; #<VT>#
+	_ZN10RJavaMutex4WaitEv @ 7 NONAME ABSENT
+	_ZN10RJavaMutex6SignalEv @ 8 NONAME ABSENT
+	_ZN10RJavaMutexC1Ev @ 9 NONAME ABSENT
+	_ZN10RJavaMutexC2Ev @ 10 NONAME ABSENT
+	_ZN11javaruntime22GetThreadPriorityTableERi @ 11 NONAME ABSENT
+	_ZN11javaruntime23GetSingleThreadPriorityERKi @ 12 NONAME
 
--- a/javacommons/jvms/nativeportlayer/inc.s60/javafile.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/inc.s60/javafile.h	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -37,8 +37,8 @@
 {
 
 public:
-    static MJavaFile* NewL();
 
+    CJavaFile();
     virtual ~CJavaFile();
 
     virtual TInt Open(RFs& aFs,const TDesC& aFileName, TUint aFileMode);
@@ -58,9 +58,6 @@
     virtual TInt Size(TInt& aSize) const;
     virtual TInt SetSize(TInt aSize);
 
-protected:
-    CJavaFile();
-
 private:
     enum TJavaFileMode
     {
@@ -75,8 +72,8 @@
     void OpenCafL(const TDesC& aFileName);
 
 private:
-    ContentAccess::CContent*    iCafContent; //Owns
-    ContentAccess::CData*       iCafData; //Owns
+    ContentAccess::CContent*    iCafContent; // Owns
+    ContentAccess::CData*       iCafData;    // Owns
     TJavaFileMode               iJavaFileMode;
     RFile                       iNormalFile;
     std::wstring                mFileName;
@@ -84,14 +81,5 @@
 
 } // end of namespace javaruntime
 
-IMPORT_C void Dummy1(); //These are keeping the ordinals in J9 understandable order. TODO remove these at some point
-IMPORT_C void Dummy2();
-IMPORT_C void Dummy3();
-IMPORT_C void Dummy4();
-IMPORT_C void Dummy5();
-IMPORT_C void Dummy6();
-IMPORT_C void Dummy7();
-IMPORT_C void Dummy8();
-IMPORT_C void Dummy9();
 #endif // JAVAFILE_H
 
--- a/javacommons/jvms/nativeportlayer/inc.s60/jvmnativeportlayer.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/inc.s60/jvmnativeportlayer.h	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -29,7 +29,6 @@
 {
 public:
     static MJvmNativePortLayer* NewL();
-    IMPORT_C static void SetPointerToCafMethod(TBool(*aUseCafForFileOpen)(const TDesC&));
 public:
 
     virtual ~CJvmNativePortLayer();
@@ -42,13 +41,10 @@
 
     CJvmNativePortLayer();
 
-    void ConstructL();
+    void Construct();
 
 private:
-//        static  TBool (*iUseCafForFileOpen)(const TDesC&);
-    TBool   iLogging;
-    HBufC*  iStdOut;
-    HBufC*  iStdErr;
+    TBool      iLogging;
     Redirector iRedirector;
 };
 } // end of namespace javaruntime
--- a/javacommons/jvms/nativeportlayer/src.s60/javafile.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/src.s60/javafile.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -22,29 +22,12 @@
 using namespace javaruntime;
 
 //*****************************************************************************
-MJavaFile* CJavaFile::NewL()
-{
-    JELOG2(EJVM);
-    CJavaFile* self = new(ELeave) CJavaFile();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-//*****************************************************************************
 CJavaFile::CJavaFile(): iJavaFileMode(EJavaFileClosed)
 {
     JELOG2(EJVM);
 }
 
 //*****************************************************************************
-void CJavaFile::ConstructL()
-{
-    JELOG2(EJVM);
-}
-
-//*****************************************************************************
 CJavaFile::~CJavaFile()
 {
     JELOG2(EJVM);
@@ -81,11 +64,6 @@
         //in order to allow proper
         //cleanup if something fails.
         TRAP(status, OpenCafL(aFileName));
-        if (status != KErrNone)
-        {
-            // Clean up and set the class ready for opening another file.
-            Close();
-        }
     }
     else
     {
@@ -96,7 +74,11 @@
         {
             iJavaFileMode = EJavaFileOpenForNormalFile;
         }
-        // No need for cleaning.
+    }
+    if (status != KErrNone)
+    {
+        // Clean up and set the class ready for opening another file.
+        Close();
     }
     return status;
 }
@@ -176,7 +158,7 @@
 //*****************************************************************************
 TInt CJavaFile::Read(TDes8& aDes) const
 {
-    //JELOG4(EJVM, EEntry & EInfoHeavyLoad);
+    JELOG4(EJVM, EEntry & EInfoHeavyLoad);
     if (iJavaFileMode == EJavaFileOpenForCaf)
     {
         //Using CAF
@@ -192,7 +174,7 @@
 //*****************************************************************************
 TInt CJavaFile::Read(TDes8& aDes, TInt aLength) const
 {
-    //JELOG4(EJVM, EEntry & EInfoHeavyLoad);
+    JELOG4(EJVM, EEntry & EInfoHeavyLoad);
     if (iJavaFileMode == EJavaFileOpenForCaf)
     {
         //Using CAF
@@ -210,6 +192,11 @@
 {
     JELOG2(EJVM);
     //Using RFile
+    if (iJavaFileMode != EJavaFileClosed)
+    {
+        // Not allowed if some file is already opened and not properly closed.
+        return KErrInUse;
+    }
     TInt status = iNormalFile.Replace(aFs, aName, aFileMode);
     if (status == KErrNone)
     {
@@ -324,7 +311,7 @@
 //*****************************************************************************
 TInt CJavaFile::Seek(TSeek aMode,TInt& aPos) const
 {
-//        JELOG4(EJVM, EEntry & EInfoHeavyLoad);
+    JELOG4(EJVM, EEntry & EInfoHeavyLoad);
     if (iJavaFileMode == EJavaFileOpenForCaf)
     {
         //Using CAF
@@ -360,14 +347,17 @@
     filename.Set(aFileName, NULL, NULL);
     TPtrC filenameExt = filename.Ext();
 
-    if (filenameExt.CompareF(_L(".dm")) == 0 ||
-            filenameExt.CompareF(_L(".dcf")) == 0)
+    _LIT(KDmExtension, ".dm");
+    _LIT(KDcfExtension, ".dcf");
+    if (filenameExt.CompareF(KDmExtension) == 0 ||
+            filenameExt.CompareF(KDcfExtension) == 0)
     {
         // Filename extension indicates this is a DRM protected file.
         return ETrue;
     }
 
-    if (filenameExt.CompareF(_L(".jar")) != 0)
+    _LIT(KJarExtension, ".jar");
+    if (filenameExt.CompareF(KJarExtension) != 0)
     {
         // Filename extension indicates this is not a jar file,
         // assume it is not DRM protected.
@@ -376,7 +366,8 @@
 
     RProcess thisProcess;
     TName thisProcessName = thisProcess.Name();
-    if (KErrNotFound == thisProcessName.FindF(_L("Installer")))
+    _LIT(KInstallerName, "Installer");
+    if (KErrNotFound == thisProcessName.FindF(KInstallerName))
     {
         // We are not running in JavaInstaller process,
         // do not check if file is DRM protected from CAF
@@ -386,37 +377,23 @@
 
     // Check from CAF if file is DRM protected.
     TBool drmFile = EFalse;
-    if (NULL == iCafContent)
+    TRAP_IGNORE(iCafContent = ContentAccess::CContent::NewL(aFileName));
+    if (NULL != iCafContent)
     {
-        TRAP_IGNORE(iCafContent = ContentAccess::CContent::NewL(aFileName));
-        if (NULL != iCafContent)
+        TInt value = 0;
+        TInt err = iCafContent->GetAttribute(
+                       ContentAccess::EIsProtected, value);
+        if (KErrNone == err && value)
         {
-            TInt value = 0;
-            TInt err = iCafContent->GetAttribute(
-                           ContentAccess::EIsProtected, value);
-            if (KErrNone == err && value)
-            {
-                // This is a DRM file.
-                drmFile = ETrue;
-            }
-            else
-            {
-                // Not a DRM file, delete iCafContent instance.
-                delete iCafContent;
-                iCafContent = NULL;
-            }
+            // This is a DRM file.
+            drmFile = ETrue;
+        }
+        else
+        {
+            // Not a DRM file, delete iCafContent instance.
+            delete iCafContent;
+            iCafContent = NULL;
         }
     }
     return drmFile;
 }
-
-
-EXPORT_C void Dummy1() {}
-EXPORT_C void Dummy2() {}
-EXPORT_C void Dummy3() {}
-EXPORT_C void Dummy4() {}
-EXPORT_C void Dummy5() {}
-EXPORT_C void Dummy6() {}
-EXPORT_C void Dummy7() {}
-EXPORT_C void Dummy8() {}
-EXPORT_C void Dummy9() {}
--- a/javacommons/jvms/nativeportlayer/src.s60/jvmnativeportlayer.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/src.s60/jvmnativeportlayer.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -30,13 +30,11 @@
 {
     JELOG2(EJVM);
     CJvmNativePortLayer* portLayer = new(ELeave) CJvmNativePortLayer;
-    CleanupStack::PushL(portLayer);
-    portLayer->ConstructL();
-    CleanupStack::Pop(portLayer);
+    portLayer->Construct();
     return portLayer;
 }
 
-CJvmNativePortLayer::CJvmNativePortLayer():iStdOut(0), iStdErr(0)
+CJvmNativePortLayer::CJvmNativePortLayer()
 {
     JELOG2(EJVM);
 }
@@ -44,16 +42,6 @@
 CJvmNativePortLayer::~CJvmNativePortLayer()
 {
     JELOG2(EJVM);
-    if (iStdOut != 0)
-    {
-        delete iStdOut;
-        iStdOut = 0;
-    }
-    if (iStdErr != 0)
-    {
-        delete iStdErr;
-        iStdErr = 0;
-    }
     iRedirector.close();
 }
 
@@ -62,13 +50,9 @@
 _LIT(KOutpuFullDir,"c:\\logs\\java");
 _LIT(KConsole,"vmconsole.txt");
 
-void CJvmNativePortLayer::ConstructL(void)
+void CJvmNativePortLayer::Construct()
 {
     JELOG2(EJVM);
-    _LIT(KStdOut,"stdout_%02i%02i_%02i%02i%02i.txt");
-    _LIT(KStdErr,"stderr_%02i%02i_%02i%02i%02i.txt");
-    iStdOut = HBufC::NewL(KDesLength);
-    iStdErr = HBufC::NewL(KDesLength);
 
     RFs rfs;
     TUint dummy;
@@ -85,14 +69,6 @@
     else
     {
         iLogging = ETrue;
-        TTime time;
-        time.HomeTime();
-        TDateTime dt = time.DateTime();
-
-        iStdOut->Des().Format(KStdOut, dt.Month()+1, dt.Day()+1,
-                              dt.Hour(), dt.Minute(), dt.Second());
-        iStdErr->Des().Format(KStdErr, dt.Month()+1, dt.Day()+1,
-                              dt.Hour(), dt.Minute(), dt.Second());
     }
     rfs.Close();
 
@@ -102,15 +78,13 @@
 MJavaFile* CJvmNativePortLayer::GetJavaFileL()
 {
     JELOG2(EJVM);
-    MJavaFile* javaFile = CJavaFile::NewL();
-    return javaFile;
+    return new(ELeave) CJavaFile();
 }
 
 void CJvmNativePortLayer::WriteToStdoutL(const TDesC8& aData)
 {
     if (iLogging)
     {
-//              RFileLogger::Write( KOutpuDir, *iStdOut, EFileLoggingModeAppendRaw, aData);
         RFileLogger::Write(KOutpuDir, KConsole, EFileLoggingModeAppendRaw, aData);
     }
     iRedirector.systemOut(aData);
@@ -119,24 +93,18 @@
 {
     if (iLogging)
     {
-//              RFileLogger::Write( KOutpuDir, *iStdErr, EFileLoggingModeAppendRaw, aData);
         RFileLogger::Write(KOutpuDir, KConsole, EFileLoggingModeAppendRaw, aData);
     }
     iRedirector.systemErr(aData);
 }
 
 
-
-//Obsolite method, but keeping to be in sync with legacy
-EXPORT_C void CJvmNativePortLayer::SetPointerToCafMethod(TBool(* /*aUseCafForFileOpen*/)(const TDesC&))
-{
-    JELOG2(EJVM);
-}
-EXPORT_C MJvmNativePortLayer* GetPortLayerL()
+EXPORT_C MJvmNativePortLayer* javaruntime::GetPortLayerL()
 {
     JELOG2(EJVM);
     return CJvmNativePortLayer::NewL();
 }
+
 const TThreadPriority priorityMapping[] =
 {
     EPriorityMuchLess, //0
@@ -152,7 +120,8 @@
     EPriorityNormal,   //10
     EPriorityMore,     //11
 };
-EXPORT_C TThreadPriority GetSingleThreadPriority(const TInt& aJavaPriority)
+
+EXPORT_C TThreadPriority javaruntime::GetSingleThreadPriority(const TInt& aJavaPriority)
 {
     JELOG2(EJVM);
     TInt index = Max(Min(aJavaPriority,11),0);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/build/exports.inf	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+PRJ_EXPORTS
+
+#include "../../../../../inc/build_defines.hrh"
+#ifdef RD_JAVA_SYMBIAN_TARGET
+../tst.bat          /epoc32/winscw/c/tst.bat
+../testfiles/test.dm          /epoc32/winscw/c/test.dm
+../testfiles/test.dcf         /epoc32/winscw/c/test.dcf
+../testfiles/test.jar         /epoc32/winscw/c/test.jar
+../testfiles/testDrm.jar      /epoc32/winscw/c/testDrm.jar
+../testfiles/testDrm.dcf      /epoc32/winscw/c/testDrm.dcf
+../testfiles/testDrm.dr       /epoc32/winscw/c/data/DRM/testDrm.dr
+
+#endif // RD_JAVA_SYMBIAN_TARGET
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/build/testjvmport.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2010 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:
+#
+
+TEMPLATE=app
+         TARGET=testjvmport
+                CONFIG += omj no_icon stl
+                          CONFIG -= qt
+
+                                    LIBS += -lCppUTest -ljvmnativeport -lefsrv
+
+                                            INCLUDEPATH += ../../../../../tools/cpputest/include/CppUTest
+
+                                                    INCLUDEPATH += ../../../../../tools/cpputest/include/Platforms/Symbian
+                                                            INCLUDEPATH += ../../inc.s60
+                                                                    TARGET.CAPABILITY = all -tcb
+
+                                                                            include(../../../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/readme.txt	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,24 @@
+This directory contains test for jvmnativeport.
+
+To compile test run make frome the tsrc folder.
+
+The uses uses DRM protected files which means that the right objects must be
+added to key store. Compilation puts right objet into correct folder. Before 
+running tests a tool DRMEncryptor must be run in the device. From the application
+select Options/Encrypt and wait for dialog telling 'Encryption done. 1 rights 
+object processed.' 
+
+To run tests start eshell and type tst.bat
+
+Description of used files:
+
+test.dcf:    This non encrypted file that is used to test that data can be read
+             through CAF.
+test.dm:     This non encrypted file that is used to test that data can be read
+             through CAF.
+test.jar:    This special jar file that contains only plain text.
+testDrm.dcf: This is drm protected file containing text:
+             'This is a drm protected file.'
+testDrm.dr:  Rights object for the drm protected files
+testDrm.jar: Same as testDrm.dcf, only extension has been changed to jar to tesr
+             one installer realted branch.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/src/alltests.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* 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:  AllTests
+*
+*/
+
+#include "Platform.h"
+#include "CommandLineTestRunner.h"
+
+int main(int ac, char** av)
+{
+    return CommandLineTestRunner::RunAllTests(ac, av);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/src/testjvmnativeport.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,749 @@
+/*
+* Copyright (c) 2010 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:  Tests for function server
+*
+*/
+
+#include <e32base.h>
+#include "TestHarness.h"
+#include "testutils.h"
+
+#include "mjvmnativeportlayer.h"
+#include "mjavafile.h"
+
+TEST_GROUP(TestJvmPortPriority)
+{
+    TEST_SETUP()
+    {
+    }
+
+    TEST_TEARDOWN()
+    {
+    }
+};
+
+TEST_GROUP(TestJvmPort)
+{
+    TEST_SETUP()
+    {
+    }
+
+    TEST_TEARDOWN()
+    {
+    }
+};
+
+_LIT(KTestFileName, "c:\\javaFileTest.txt");
+_LIT(KTestReplaceFileName, "c:\\javaFileReplaceTest.txt");
+_LIT(KTestDrmFileName1, "c:\\test.dm");
+_LIT(KTestDrmFileName2, "c:\\test.dcf");
+_LIT(KTestJarFileName, "c:\\test.jar");
+_LIT(KTestDrmEncryptedFileName, "c:\\testDrm.dcf");
+_LIT(KTestDrmEncryptedInstallerFileName, "c:\\testDrm.jar");
+
+_LIT8(KTestText, "Testing..");
+_LIT8(KTestText2, "Testing2..");
+_LIT8(KJarText, "This is a jar file.");
+_LIT8(KDrmText, "This is a drm protected file.");
+_LIT8(KDM_CONTENT, "This is a dm file.");
+_LIT8(KDCF_CONTENT, "This is a dcf file.");
+
+TEST_GROUP(TestJavaFile)
+{
+    RFs fs;
+    javaruntime::MJvmNativePortLayer* port;
+    javaruntime::MJavaFile* file;
+    TEST_SETUP()
+    {
+        port = 0;
+        fs.Connect();
+        fs.Delete(KTestFileName);
+        fs.Delete(KTestReplaceFileName);
+    }
+
+    TEST_TEARDOWN()
+    {
+        delete port;
+        delete file;
+        fs.Close();
+    }
+};
+// #undef CHECKWITHNOTE
+// #define CHECKWITHNOTE(x, y) CHECK(x)
+void checkPriority(const TThreadPriority& expected,
+                   const TThreadPriority& recieved)
+{
+    CHECKWITHNOTE(expected == recieved, "Priority check failed. Expecting: "<<expected<<", received: "<<recieved);
+}
+
+// Testing priority table.
+TEST(TestJvmPortPriority, priorityTest)
+{
+    int i = 0;
+    checkPriority(EPriorityMuchLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityMuchLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityMuchLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityMuchLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityMuchLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityLess, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityNormal, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityNormal, javaruntime::GetSingleThreadPriority(i++));
+    checkPriority(EPriorityMore, javaruntime::GetSingleThreadPriority(i++));
+
+}
+void getPort(javaruntime::MJvmNativePortLayer*& port)
+{
+    TRAPD(err, port = javaruntime::GetPortLayerL());
+    CHECKWITHNOTE(err == KErrNone, "Error in getting MJvmNativePortLayer: "<<err);
+    CHECKWITHNOTE(port, "Got null pointer when getting port layer");
+}
+
+void getFileAndPort(javaruntime::MJvmNativePortLayer*& port, javaruntime::MJavaFile*& file)
+{
+    if (port == 0)
+    {
+        getPort(port);
+    }
+    TRAPD(err, file = port->GetJavaFileL());
+    CHECKWITHNOTE(err == KErrNone, "Error in getting MJavaFile: "<<err);
+    CHECKWITHNOTE(file, "Got null pointer when getting Java file");
+}
+
+_LIT(KOutpuFullDir,"c:\\logs\\java\\");
+_LIT(KOutpuFullDir2,"c:\\logs\\java2\\");
+_LIT(KConsole,"c:\\logs\\java\\vmconsole.txt");
+
+// Testing log writings works.
+TEST(TestJvmPort, logWritingTest)
+{
+    RFs fs;
+    fs.Connect();
+    TUint dummy;
+    TBool dirExists = fs.Att(KOutpuFullDir, dummy) == KErrNone;
+
+    TInt res;
+
+    // If the c:\logs\java directory exixts rename it to java2
+    if (dirExists)
+    {
+        res = fs.Rename(KOutpuFullDir, KOutpuFullDir2);
+        CHECKWITHNOTE(res == KErrNone, "Rename failed: "<<res);
+    }
+
+    // Testing that writing to nonexisting dir works.
+    javaruntime::MJvmNativePortLayer* port;
+    getPort(port);
+    TRAP(res, port->WriteToStdoutL(_L8("StdOutTestNonExisting\n")));
+    CHECKWITHNOTE(res == KErrNone, "Error in writing to std.out: "<<res);
+    TRAP(res, port->WriteToStderrL(_L8("StdErrTestNonExisting\n")));
+    CHECKWITHNOTE(res == KErrNone, "Error in writing to std.err: "<<res);
+
+    CHECKWITHNOTE(fs.Att(KOutpuFullDir, dummy) != KErrNone, "The logs\\java dir should not be present: ");
+
+    delete port;
+    port = 0;
+
+    // Create c:\logs\java directory.
+    res = fs.MkDir(KOutpuFullDir);
+    CHECKWITHNOTE(res == KErrNone, "MkDir failed: "<<res);
+
+    // Needs to reinit the port, because the logs dir exists now.
+    getPort(port);
+    TRAP(res, port->WriteToStdoutL(_L8("StdOutTest\n")));
+    CHECKWITHNOTE(res == KErrNone, "Error in writing to std.out: "<<res);
+    TRAP(res, port->WriteToStderrL(_L8("StdErrTest\n")));
+    CHECKWITHNOTE(res == KErrNone, "Error in writing to std.err: "<<res);
+
+    // Check that the vmconsole.txt contains correct content.
+    RFile file;
+    res = file.Open(fs, KConsole, EFileShareReadersOrWriters);
+    CHECKWITHNOTE(res == KErrNone, "file open failed: "<<res);
+    TBuf8<30> bufR;
+    res = file.Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "file read failed: "<<res);
+    file.Close();
+    res = bufR.Compare(_L8("StdOutTest\nStdErrTest\n"));
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    // Delete the vmconsole.txt. RFileLogger seems to keep the file open for
+    // a while.
+    int tryCount = 0;
+    do
+    {
+        res = fs.Delete(KConsole);
+        if (res == KErrInUse)
+        {
+            tryCount++;
+            User::After(500 * 1000);
+        }
+    }
+    while (res == KErrInUse && tryCount < 200);
+
+    CHECKWITHNOTE(res == 0, "Delete failed: "<<res);
+
+    // Delete c:\logs\java directory.
+    res = fs.RmDir(KOutpuFullDir);;
+    CHECKWITHNOTE(res == 0, "RmDir failed: "<<res);
+
+    // If the c:\logs\java directory exixted before the tests, return it back.
+    if (dirExists)
+    {
+        res = fs.Rename(KOutpuFullDir2, KOutpuFullDir);
+        CHECKWITHNOTE(res == 0, "Rename2 failed: "<<res);
+    }
+    fs.Close();
+    delete port;
+}
+
+// Testing that opening a file works ok and when trying to re-open KErrInUse
+// is returned.
+TEST(TestJavaFile, fileOpen)
+{
+    getFileAndPort(port, file);
+    int res = file->Open(fs, KTestJarFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file: "<<res);
+
+    res = file->Open(fs, KTestJarFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "Open, unexpected result: "<<res);
+    file->Close();
+}
+
+// Testing that opening unexisting files.
+TEST(TestJavaFile, fileOpenUnexisting)
+{
+    getFileAndPort(port, file);
+    int res = file->Open(fs, _L("c:\\nonexisting.txt"), EFileRead);
+    CHECKWITHNOTE(res == KErrNotFound, "Open, unexpected result: "<<res);
+
+    res = file->Open(fs, _L("c:\\nonexisting.dcf"), EFileRead);
+    CHECKWITHNOTE(res == KErrNotFound, "Open2, unexpected result: "<<res);
+
+    res = file->Open(fs, _L("c:\\nonexisting.txt"), EFileRead);
+    CHECKWITHNOTE(res == KErrNotFound, "Open3, unexpected result: "<<res);
+    file->Close();
+
+    res = file->Open(fs, _L("c:\\nonexisting.dcf"), EFileRead);
+    CHECKWITHNOTE(res == KErrNotFound, "Open4, unexpected result: "<<res);
+
+    file->Close();
+}
+
+// Testing that creation of file to unaccessable location fails.
+TEST(TestJavaFile, fileCreateUnAccessible)
+{
+    getFileAndPort(port, file);
+    int res = file->Create(fs, _L("z:\\nonexisting.txt"), EFileRead);
+    CHECKWITHNOTE(res == KErrAccessDenied, "Create, unexpected result: "<<res);
+    file->Close();
+}
+
+// Testing that Replacing of file to unaccessable location fails.
+TEST(TestJavaFile, fileReplaceUnAccessible)
+{
+    getFileAndPort(port, file);
+    int res = file->Replace(fs, _L("z:\\nonexisting.txt"), EFileRead);
+    CHECKWITHNOTE(res == KErrAccessDenied, "Replace, unexpected result: "<<res);
+    file->Close();
+}
+
+// Testing that file creation succceeds. As a side test testing that Open,
+// Create and replace will fail when using file object that is in use.
+TEST(TestJavaFile, fileCreate1)
+{
+    getFileAndPort(port, file);
+    int res = file->Create(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to create file: "<<res);
+    TUint dummy;
+    CHECKWITHNOTE(fs.Att(KTestFileName, dummy) == KErrNone, "File does't exist");
+
+    res = file->Open(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReOpen, unexpected result: "<<res);
+
+    res = file->Replace(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReReplace, unexpected result: "<<res);
+
+    res = file->Create(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReCreate, unexpected result: "<<res);
+
+    file->Close();
+}
+
+// Testing read, write flush and seek for normal files.
+TEST(TestJavaFile, fileCreateWriteReads)
+{
+    getFileAndPort(port, file);
+
+    // Create the test file.
+    int res = file->Create(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to create file: "<<res);
+    TUint dummy;
+    CHECKWITHNOTE(fs.Att(KTestFileName, dummy) == KErrNone, "File does't exist");
+
+    TBuf8<15> bufR;
+    TBuf8<15> bufW;
+    bufW.Append(KTestText);
+
+    // Write content to buffer.
+    res = file->Write(bufW);
+    CHECKWITHNOTE(res == KErrNone, "Write failed: "<<res);
+
+    // Flush content to buffer.
+    res = file->Flush();
+    CHECKWITHNOTE(res == KErrNone, "Flush failed: "<<res);
+
+    // Set current position to the start of the file.
+    TInt pos = 0;
+    res = file->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed: "<<res);
+
+    // Read the whole content of the file.
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+
+    // Compare the the read and written are the same.
+    res = bufW.Compare(bufR);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    // Read a portion of the content from the file.
+    bufR.Zero();
+    pos = 2;
+    res = file->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek2 failed: "<<res);
+    res = file->Read(bufR, 5);
+    CHECKWITHNOTE(res == KErrNone, "Read2 failed: "<<res);
+    res = bufW.Mid(2,5).Compare(bufR);
+    CHECKWITHNOTE(res == 0, "Compare2 failed: "<<res);
+
+    // Read a portion of the content from the file. Testing
+    // ESeekEnd.
+    bufR.Zero();
+    pos = -6;
+    res = file->Seek(ESeekEnd, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek3 failed: "<<res);
+    res = file->Read(bufR, 4);
+    CHECKWITHNOTE(res == KErrNone, "Read3 failed: "<<res);
+    res = bufW.Mid(3,4).Compare(bufR);
+    CHECKWITHNOTE(res == 0, "Compare2 failed: "<<res);
+
+    file->Close();
+}
+
+// Testing all variants of Write methods, Size, and SetSize. As a side test
+// testing that Open, Create and replace will fail when using file object
+// that is in use.
+TEST(TestJavaFile, fileCreateWritesRead)
+{
+    getFileAndPort(port, file);
+    int res = file->Create(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to create file: "<<res);
+    TUint dummy;
+    CHECKWITHNOTE(fs.Att(KTestFileName, dummy) == KErrNone, "File does't exist");
+
+    res = file->Open(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReOpen, unexpected result: "<<res);
+
+    res = file->Replace(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReReplace, unexpected result: "<<res);
+
+    res = file->Create(fs, KTestFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReCreate, unexpected result: "<<res);
+
+
+    // Write some content to file.
+    TBuf8<45> bufR;
+    TBuf8<15> bufW;
+    bufW.Append(KTestText);
+    res = file->Write(bufW);
+    CHECKWITHNOTE(res == KErrNone, "Write failed: "<<res);
+    res = file->Write(bufW, 8);  // Testing..Testing.
+    CHECKWITHNOTE(res == KErrNone, "Write failed2: "<<res);
+    res = file->Write(2, bufW);  // TeTesting..sting.
+    CHECKWITHNOTE(res == KErrNone, "Write failed3: "<<res);
+    res = file->Write(8, bufW, 2); // TeTestinTe.sting.
+    CHECKWITHNOTE(res == KErrNone, "Write failed4: "<<res);
+    TInt pos = 0;
+    res = file->Seek(ESeekEnd, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed: "<<res);
+    res = file->Write(bufW, 4);  // TeTestinTe.sting.Test
+    CHECKWITHNOTE(res == KErrNone, "Write failed5: "<<res);
+    file->Flush();
+    CHECKWITHNOTE(res == KErrNone, "Flush failed: "<<res);
+
+    // Set current position to the start of the file.
+    pos = 0;
+    res = file->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed2: "<<res);
+
+    // Read the whole content of the file.
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    _LIT8(KTestRes, "TeTestinTe.sting.Test");
+
+    // Compare that the file content is correct.
+    res = bufR.Compare(KTestRes);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    // Testing that Size works ok.
+    TInt size;
+    res = file->Size(size);
+    CHECKWITHNOTE(res == 0, "Size call failed: "<<res);
+    CHECKWITHNOTE(size == 21, "Size failed: "<<size);
+
+    // Testing that SetSize works ok.
+    res = file->SetSize(10);
+    CHECKWITHNOTE(size == 21, "SetSize failed: "<<res);
+
+    // Read the content ater size change.
+    bufR.Zero();
+    res = file->Seek(ESeekStart, pos);
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed2: "<<res);
+
+    // The new size should be smaller that before SetSize.
+    pos = 0;
+    res = file->Size(size);
+    CHECKWITHNOTE(res == 0, "Size call failed2: "<<res);
+    CHECKWITHNOTE(size == 10, "Size failed2: "<<size);
+
+    // Compare that the file content is correct.
+    res = bufR.Compare(KTestRes().Left(10));
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    file->Close();
+}
+
+// Testing Replace method. As a side test testing that Open, Create and
+// replace will fail when using file object that is in use.
+TEST(TestJavaFile, fileReplace)
+{
+    getFileAndPort(port, file);
+
+    // Checking that file that we are about to create doesn't exist.
+    TUint dummy;
+    CHECKWITHNOTE(fs.Att(KTestReplaceFileName, dummy) != KErrNone, "File exists before");
+
+    // Using Replace to create the file.
+    int res = file->Replace(fs, KTestReplaceFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to Replace file: "<<res);
+    CHECKWITHNOTE(fs.Att(KTestReplaceFileName, dummy) == KErrNone, "File does't exist");
+
+    res = file->Open(fs, KTestReplaceFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReOpen, unexpected result: "<<res);
+
+    res = file->Replace(fs, KTestReplaceFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReReplace, unexpected result: "<<res);
+
+    res = file->Create(fs, KTestReplaceFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "ReCreate, unexpected result: "<<res);
+
+    // Write content to created file.
+    TBuf8<45> bufR;
+    TBuf8<15> bufW;
+    bufW.Append(KTestText);
+    res = file->Write(bufW);
+    CHECKWITHNOTE(res == KErrNone, "Write failed: "<<res);
+
+    // Read the content and compare that the content is correct.
+    TInt pos = 0;
+    res = file->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed: "<<res);
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    res = bufR.Compare(KTestText);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+    file->Close();
+
+    // Replace the existing file.
+    res = file->Replace(fs, KTestReplaceFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to Replace file2: "<<res);
+    CHECKWITHNOTE(fs.Att(KTestReplaceFileName, dummy) == KErrNone, "File does't exist2");
+
+    // Check that the file size is zero i.e. a new file.
+    TInt size;
+    res = file->Size(size);
+    CHECKWITHNOTE(res == 0, "Size call failed: "<<res);
+    CHECKWITHNOTE(size == 0, "Size failed: "<<size);
+
+    // Write content to recreated file.
+    bufW.Zero();
+    bufR.Zero();
+    bufW.Append(KTestText2);
+    res = file->Write(bufW);
+    CHECKWITHNOTE(res == KErrNone, "Write failed2: "<<res);
+
+    // Read the content and compare that the content is correct.
+    res = file->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed2: "<<res);
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed2: "<<res);
+    res = bufR.Compare(KTestText2);
+    CHECKWITHNOTE(res == 0, "Compare failed2: "<<res);
+    file->Close();
+}
+
+// Testing Lock and Unlock methods.
+TEST(TestJavaFile, fileLock)
+{
+    getFileAndPort(port, file);
+
+    // Creating two files objects pointing to same directory.
+    int res = file->Create(fs, KTestFileName, EFileWrite | EFileShareAny);
+    CHECKWITHNOTE(res == KErrNone, "Failed to Create file: "<<res);
+
+    javaruntime::MJavaFile* file2;
+    getFileAndPort(port, file2);
+    res = file2->Open(fs, KTestFileName, EFileRead | EFileShareAny);
+    CHECKWITHNOTE(res == KErrNone, "Failed to Open file: "<<res);
+
+    // Write some content.
+    res = file->Write(KTestText);
+    CHECKWITHNOTE(res == KErrNone, "Failed to write to file: "<<res);
+
+    // Write some content.
+    res = file->Lock(3, 4);
+    CHECKWITHNOTE(res == KErrNone, "Failed to lock the file: "<<res);
+
+    // Lock the area
+    TInt pos = 4;
+    res = file2->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed: "<<res);
+
+    // Check that locked the area is unaccessable.
+    TBuf8<45> bufR;
+    res = file2->Read(bufR, 2);
+    CHECKWITHNOTE(res == KErrLocked, "Expecting locked when reading: "<<res);
+
+    // Unlock the area
+    res = file->UnLock(3, 4);
+    CHECKWITHNOTE(res == KErrNone, "Failed to unlock the file: "<<res);
+
+    // Check that unlocked the area is now accessable.
+    res = file2->Read(bufR, 2);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    res = KTestText().Mid(4,2).Compare(bufR);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    file->Close();
+    file2->Close();
+    delete file2;
+}
+
+
+// Testing that jar file can be opened. This test is for checking a branch in
+// IsDrm() method.
+TEST(TestJavaFile, openJar)
+{
+    getFileAndPort(port, file);
+
+    // Open the jar file.
+    TInt res = file->Open(fs, KTestJarFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Open, unexpected result: "<<res);
+
+    // Read and compare content.
+    TBuf8<45> bufR;
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    res = bufR.Compare(KJarText);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+    file->Close();
+}
+
+// Testing the file open through CAF with files that are not DRM protected.
+void testOpenCafFile(RFs& fs,
+                     javaruntime::MJavaFile* file,
+                     const TDesC& fileName,
+                     const TDesC8& compareString)
+{
+    // Open file using CAF.
+    TInt res = file->Open(fs, fileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file: "<<res);
+
+    // Read the content and compare.
+    TBuf8<45> bufR;
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    res = bufR.Compare(compareString);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    // Read the partial content and compare. Using ESeekStart.
+    bufR.Zero();
+    TInt pos = 2;
+    res = file->Seek(ESeekStart, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek failed: "<<res);
+    res = file->Read(bufR, 5);
+    CHECKWITHNOTE(res == KErrNone, "Read2 failed: "<<res);
+    res = compareString.Mid(2,5).Compare(bufR);
+    CHECKWITHNOTE(res == 0, "Compare2 failed: "<<res);
+
+    // Read the partial content and compare. Using ESeekEnd.
+    bufR.Zero();
+    pos = -6;
+    res = file->Seek(ESeekEnd, pos);
+    CHECKWITHNOTE(res == KErrNone, "Seek3 failed: "<<res);
+    res = file->Read(bufR, 4);
+    CHECKWITHNOTE(res == KErrNone, "Read3 failed: "<<res);
+    res = compareString.Mid(compareString.Length() - 6, 4).Compare(bufR);
+    CHECKWITHNOTE(res == 0, "Compare2 failed: "<<res);
+
+    // Check that Size method works also in case of CAF.
+    TInt size;
+    res = file->Size(size);
+    CHECKWITHNOTE(res == 0, "Size call failed: "<<res);
+    CHECKWITHNOTE(size == compareString.Length(), "Size failed: "<<size);
+
+    file->Close();
+}
+
+
+// Testing CAF with .dm file extension.
+TEST(TestJavaFile, readDrmDmFile)
+{
+    getFileAndPort(port, file);
+    testOpenCafFile(fs, file, KTestDrmFileName1, KDM_CONTENT);
+}
+
+// Testing CAF with .dcf file extension.
+TEST(TestJavaFile, readDrmDcfFile)
+{
+    getFileAndPort(port, file);
+    testOpenCafFile(fs, file, KTestDrmFileName2, KDCF_CONTENT);
+}
+
+// Testing methods that are not supported by CAF. Expecting correct error codes.
+TEST(TestJavaFile, readDrmNotSupportedMethods)
+{
+    // Open file using CAF.
+    getFileAndPort(port, file);
+    TInt res = file->Open(fs, KTestDrmFileName1, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file: "<<res);
+
+    // Trying to re-open the file - this should fail.
+    res = file->Open(fs, KTestDrmFileName1, EFileRead);
+    CHECKWITHNOTE(res == KErrInUse, "Open, unexpected result: "<<res);
+
+    res = file->SetSize(10);
+    CHECKWITHNOTE(res == KErrNotSupported, "SetSize, unexpected result: "<<res);
+
+    _LIT8(KDummy, "dummy");
+    res = file->Write(KDummy);
+    CHECKWITHNOTE(res == KErrNotSupported, "Write, unexpected result: "<<res);
+
+    res = file->Write(KDummy, 1);
+    CHECKWITHNOTE(res == KErrNotSupported, "Write2, unexpected result: "<<res);
+
+    res = file->Write(1, KDummy);
+    CHECKWITHNOTE(res == KErrNotSupported, "Write3, unexpected result: "<<res);
+
+    res = file->Write(1, KDummy, 1);
+    CHECKWITHNOTE(res == KErrNotSupported, "Write4, unexpected result: "<<res);
+
+    res = file->Lock(1, 1);
+    CHECKWITHNOTE(res == KErrNotSupported, "Lock, unexpected result: "<<res);
+
+    res = file->UnLock(1, 1);
+    CHECKWITHNOTE(res == KErrNotSupported, "UnLock, unexpected result: "<<res);
+
+    res = file->Flush();
+    CHECKWITHNOTE(res == KErrNotSupported, "Flush, unexpected result: "<<res);
+
+    file->Close();
+}
+
+// Testing file reading that is DRM protected. Reading through CAF. This test
+// requires that rights object is added to key store. See readme.txt for
+// instructions.
+TEST(TestJavaFile, readDrmProtectedFile)
+{
+    // Open the DRM protected jar file.
+    getFileAndPort(port, file);
+    TInt res = file->Open(fs, KTestDrmEncryptedFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file: "<<res);
+
+    // Read the content and compare.
+    TBuf8<45> bufR;
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    res = bufR.Compare(KDrmText);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    file->Close();
+
+    // Open the DRM protected file having .jar extension. This will not be
+    // opened through CAF and therefore the content should not be in decrypted
+    // format.
+    res = file->Open(fs, KTestDrmEncryptedInstallerFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file2: "<<res);
+
+    // Read the content.
+    bufR.Zero();
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed2: "<<res);
+
+    // Check that we were not able to read the content as decrypted format.
+    res = bufR.Compare(KDrmText);
+    CHECKWITHNOTE(res != 0, "Compare failed2: "<<res);
+    file->Close();
+}
+
+// This test tests that the jar file that is DRM protected can be opended in
+// decrypted format when the process name is JavaInstaller.
+TEST(TestJavaFile, readDrmProtectedInstaller)
+{
+    // OpenC uses statics and those will cause a memory allocations that will
+    // be interpreted as a leak.
+    EXPECT_N_LEAKS(33);
+
+    // Faking the process name to be JavaInstaller.
+    _LIT(KJavaInstallerProcessName, "JavaInstaller");
+    _LIT(KOrigProcessName, "testjvmport");
+    // Rename installer process and main thread.
+    TInt res = User::RenameProcess(KJavaInstallerProcessName);
+
+    // Open the DRM protected jar file.
+    getFileAndPort(port, file);
+    res = file->Open(fs, KTestDrmEncryptedInstallerFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file: "<<res);
+
+    // Read the content and check that it was in decrypted format.
+    TBuf8<45> bufR;
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed: "<<res);
+    res = bufR.Compare(KDrmText);
+    CHECKWITHNOTE(res == 0, "Compare failed: "<<res);
+
+    file->Close();
+
+    // Testing that opening of jar file that is not DRM protected succeeds.
+    res = file->Open(fs, KTestJarFileName, EFileRead);
+    CHECKWITHNOTE(res == KErrNone, "Failed to open file2: "<<res);
+
+    // Read the content and compare.
+    bufR.Zero();
+    res = file->Read(bufR);
+    CHECKWITHNOTE(res == KErrNone, "Read failed2: "<<res);
+    res = bufR.Compare(KJarText);
+    CHECKWITHNOTE(res == 0, "Compare failed2: "<<res);
+    file->Close();
+
+    // Testing that opening nonexisting file leads to error.
+    res = file->Open(fs, _L("c:\\nonexisting.jar"), EFileRead);
+    CHECKWITHNOTE(res == KErrNotFound, "Open, unexpected result: "<<res);
+    file->Close();
+
+    // Rename the process name to original.
+    User::RenameProcess(KOrigProcessName);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/subsystem.mk	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2010 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:
+#
+
+include $(JAVA_SRC_ROOT)/build/Makefile.defs
+
+# Include the test frameworks.
+NONQTSUBSYSTEMS += $(JAVA_SRC_ROOT)/tools/cpputest/build
+
+COMPONENTS = \
+	build
+
+SYMBIAN_ONLY = build/native
+
+# Make dependency to those.
+build: $(JAVA_SRC_ROOT)/tools/cpputest/build
+include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/testfiles/test.dcf	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1 @@
+This is a dcf file.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/testfiles/test.dm	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1 @@
+This is a dm file.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/testfiles/test.jar	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1 @@
+This is a jar file.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/testfiles/testDrm.dcf	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,8 @@
+
+text/plaincid:file:///c:/testDrm.txtg0Encryption-Method: AES128CBC
+Content-Name: "NameOfContent"
+Rights-Issuer: http://rights-issuer.com/content
+Content-Description: "DescriptionOfContent"
+Content-Vendor: "VendorName"
+Icon-Uri: http://vendor.com/content-icon.gif
+b7 ªºgÖeµ{¾(ºíØ…k±¡žöS¸+±Æ׺”d~Wœ'»ùÃô#Êc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/testfiles/testDrm.dr	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE o-ex:rights PUBLIC "-//OMA//DTD DRMREL 1.0//EN"
+	"http://www.oma.org/dtd/dr">
+<o-ex:rights
+   xmlns:o-ex="http://odrl.net/1.1/ODRL-EX"
+   xmlns:o-dd="http://odrl.net/1.1/ODRL-DD"
+   xmlns:ds="http://www.w3.org/2000/09/xmldsig#/"
+>
+  <o-ex:context>
+    <o-dd:version>1.0</o-dd:version>
+  </o-ex:context>
+  <o-ex:agreement>
+    <o-ex:asset>
+      <o-ex:context>
+        <o-dd:uid>cid:file:///c:/testDrm.txt        </o-dd:uid>
+      </o-ex:context>
+      <ds:KeyInfo><ds:KeyValue>EiTBk2hL7BdqR58qU0qJUA==      </ds:KeyValue></ds:KeyInfo>
+    </o-ex:asset> 
+  <o-ex:permission>
+    
+<o-dd:play>
+      <o-ex:constraint>
+        <o-dd:datetime>          <o-dd:end>1951-09-30T11:09:00</o-dd:end>
+        </o-dd:datetime>
+      </o-ex:constraint>
+    </o-dd:play>
+    
+<o-dd:display>
+      <o-ex:constraint>
+        <o-dd:datetime>          <o-dd:end>1951-09-30T11:09:00</o-dd:end>
+        </o-dd:datetime>
+      </o-ex:constraint>
+    </o-dd:display>
+    
+<o-dd:execute>
+      <o-ex:constraint>
+        <o-dd:datetime>          <o-dd:end>1951-09-30T11:09:00</o-dd:end>
+        </o-dd:datetime>
+      </o-ex:constraint>
+    </o-dd:execute>
+    
+<o-dd:print>
+      <o-ex:constraint>
+        <o-dd:datetime>          <o-dd:end>1951-09-30T11:09:00</o-dd:end>
+        </o-dd:datetime>
+      </o-ex:constraint>
+    </o-dd:print>
+  </o-ex:permission>
+  </o-ex:agreement>
+</o-ex:rights>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/testfiles/testDrm.jar	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,8 @@
+
+text/plaincid:file:///c:/testDrm.txtg0Encryption-Method: AES128CBC
+Content-Name: "NameOfContent"
+Rights-Issuer: http://rights-issuer.com/content
+Content-Description: "DescriptionOfContent"
+Content-Vendor: "VendorName"
+Icon-Uri: http://vendor.com/content-icon.gif
+b7 ªºgÖeµ{¾(ºíØ…k±¡žöS¸+±Æ׺”d~Wœ'»ùÃô#Êc
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/jvms/nativeportlayer/tsrc/tst.bat	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,2 @@
+cls
+testjvmport
--- a/javacommons/security/build/javasecurity.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/security/build/javasecurity.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 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"
@@ -14,6 +14,8 @@
 # Description: 
 #
 
+include(../../../inc/build_defines.pri)
+
 TEMPLATE=lib
 TARGET=javasecurity
 CONFIG += omj java stl
@@ -36,9 +38,7 @@
 
 symbian {
     DEPENDPATH += ../src.s60
-    INCLUDEPATH += ../src.s60 \
-                   /src/common/generic/security/common/inc \
-                   /sf/os/security/cryptomgmtlibs/securityutils/inc
+    INCLUDEPATH += ../src.s60
     SOURCES += ../src.s60/*.cpp
     LIBS += -llibcrypto \
             -letel \
@@ -51,6 +51,15 @@
             -lx509 \
             -lcentralrepository \
             -lcaf
+
+    contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) {
+        INCLUDEPATH += /src/common/generic/security/common/inc
+    }
+
+    contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
+        CONFIG += qt hb
+        TRANSLATIONS = javaapplicationsecuritymessages.ts
+    }
 }
 
 !symbian {
--- a/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 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"
@@ -56,6 +56,9 @@
             -lx509 \
             -ljavacomms \
             -lCommonEngine
+    contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
+        TRANSLATIONS = javaruntimecertificatemanagement.ts
+    }
     !contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
         LIBS += -laknnotify
     }
--- a/javacommons/security/src.s60/ocspclient.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/security/src.s60/ocspclient.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -294,6 +294,7 @@
         delete iCertArray;
     }
     COCSPParameters* ocspParams = COCSPParameters::NewL();
+    CleanupStack::PushL(ocspParams);
     if (iDefaultUrl)
     {
         ocspParams->SetURIL(*iDefaultUrl, ETrue);
@@ -323,6 +324,7 @@
         }
     }
     iOcspClient = COCSPClient::NewL(ocspParams);
+    CleanupStack::Pop(ocspParams);
 }
 
 OcspResponse* OcspResponse::NewL()
--- a/javacommons/security/tsrc/src/testcertchains.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/security/tsrc/src/testcertchains.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -110,7 +110,7 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
@@ -127,14 +127,13 @@
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, foolEntry);
 
         authMod->getCertChains(suite1Uid, chains);
-        CHECK(chains.size() == 1);
-
-        string refString("abc123");
-        CHECK(chains.front() == refString);
-
         js->remove(MIDP_PACKAGE_TABLE, entry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, foolEntry);
+        
+        CHECK(chains.size() == 1);
+        string refString("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode(chains.front()) == refString);
     }
     catch (JavaStorageException& aJse)
     {
@@ -158,31 +157,30 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-3-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         CHECK(chains.size() == 2);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter) == cert2Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -206,51 +204,50 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-3-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         JavaStorageApplicationEntry_t certEntry3;
         certEntry3 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-4-1",
-                                 L"fooBar");
+                                 L"Zm9vQmFy");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
 
         JavaStorageApplicationEntry_t certEntry4;
         certEntry4 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-5-1",
-                                 L"HelloWorld");
+                                 L"SGVsbG9Xb3JsZA==");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry4);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry4);
 
         CHECK(chains.size() == 4);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter++) == cert2Ref);
-        string cert3Ref("fooBar");
-        CHECK((*iter++) == cert3Ref);
-        string cert4Ref("HelloWorld");
-        CHECK((*iter) == cert4Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry4);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
+        string cert3Ref("Zm9vQmFy");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert3Ref);
+        string cert4Ref("SGVsbG9Xb3JsZA==");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert4Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -274,31 +271,30 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-2-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         CHECK(chains.size() == 2);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter) == cert2Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -322,31 +318,30 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-2-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         CHECK(chains.size() == 2);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter) == cert2Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -370,41 +365,40 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-2-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         JavaStorageApplicationEntry_t certEntry3;
         certEntry3 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-3-1",
-                                 L"fooBar");
+                                 L"Zm9vQmFy");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
 
         CHECK(chains.size() == 3);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter++) == cert2Ref);
-        string cert3Ref("fooBar");
-        CHECK((*iter) == cert3Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
+        string cert3Ref("Zm9vQmFy");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert3Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -428,31 +422,30 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-2-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         CHECK(chains.size() == 2);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter) == cert2Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -476,31 +469,30 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-2-1",
-                                 L"def456");
+                                 L"ZGVmNDU2");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         authMod->getCertChains(suite1Uid, chains);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
+        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         CHECK(chains.size() == 2);
 
         list<string>::const_iterator iter = chains.begin();
 
-        string cert1Ref("abc123");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("def456");
-        CHECK((*iter) == cert2Ref);
-
-        js->remove(MIDP_PACKAGE_TABLE, entry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
-        js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
+        string cert1Ref("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
+        string cert2Ref("ZGVmNDU2");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert2Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -523,34 +515,33 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-1-2",
-                                 L"fib8");
+                                 L"ZmliOA==");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         JavaStorageApplicationEntry_t certEntry3;
         certEntry3 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-1-3",
-                                 L"D");
+                                 L"RA==");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
 
         authMod->getCertChains(suite1Uid, chains);
-        CHECK(chains.size() == 1);
-
-        string refString("abc123fib8D");
-        CHECK(chains.front() == refString);
-
         js->remove(MIDP_PACKAGE_TABLE, entry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
+
+        CHECK(chains.size() == 1);
+        string refString("YWJjMTIzZmliOEQ=");
+        CHECK(JavaCommonUtils::base64encode(chains.front()) == refString);
     }
     catch (JavaStorageException& aJse)
     {
@@ -573,21 +564,21 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"See");
+                                L"U2Vl");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
         JavaStorageApplicationEntry_t certEntry2;
         certEntry2 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-1-2",
-                                 L"No");
+                                 L"Tm8=");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
 
         JavaStorageApplicationEntry_t certEntry3;
         certEntry3 = createEntry(suite1Uid.toString(),
                                  L"MIDlet-Certificate-1-3",
-                                 L"More");
+                                 L"TW9yZQ==");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry3);
 
@@ -614,16 +605,6 @@
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry6);
 
         authMod->getCertChains(suite1Uid, chains);
-
-        CHECK(chains.size() == 2);
-
-        list<string>::const_iterator iter = chains.begin();
-
-        string cert1Ref("SeeNoMore");
-        CHECK((*iter++) == cert1Ref);
-        string cert2Ref("MeAndMy");
-        CHECK((*iter) == cert2Ref);
-
         js->remove(MIDP_PACKAGE_TABLE, entry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry2);
@@ -631,6 +612,13 @@
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry4);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry5);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry6);
+
+        CHECK(chains.size() == 1);
+
+        list<string>::const_iterator iter = chains.begin();
+
+        string cert1Ref("U2VlTm9Nb3Jl");
+        CHECK(JavaCommonUtils::base64encode((*iter++)) == cert1Ref);
     }
     catch (JavaStorageException& aJse)
     {
@@ -653,7 +641,7 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
@@ -670,14 +658,14 @@
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, foolEntry);
 
         authMod->getCertChains(suite1Uid, chains);
-        CHECK(chains.size() == 1);
-
-        string refString("abc123");
-        CHECK(chains.front() == refString);
-
         js->remove(MIDP_PACKAGE_TABLE, entry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, foolEntry);
+
+        CHECK(chains.size() == 1);
+
+        string refString("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode(chains.front()) == refString);
     }
     catch (JavaStorageException& aJse)
     {
@@ -698,7 +686,7 @@
 
         certEntry = createEntry(suite1Uid.toString(),
                                 L"MIDlet-Certificate-1-1",
-                                L"abc123");
+                                L"YWJjMTIz");
 
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
 
@@ -715,14 +703,14 @@
         js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, foolEntry);
 
         authMod->getCertChains(suite1Uid, chains);
-        CHECK(chains.size() == 1);
-
-        string refString("abc123");
-        CHECK(chains.front() == refString);
-
         js->remove(MIDP_PACKAGE_TABLE, entry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, certEntry);
         js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, foolEntry);
+
+        CHECK(chains.size() == 1);
+
+        string refString("YWJjMTIz");
+        CHECK(JavaCommonUtils::base64encode(chains.front()) == refString);
     }
     catch (JavaStorageException& aJse)
     {
@@ -744,9 +732,9 @@
         js->write(MIDP_PACKAGE_TABLE, entry);
 
         authMod->getCertChains(suite1Uid, chains);
-        CHECK(chains.size() == 0);
+        js->remove(MIDP_PACKAGE_TABLE, entry);
 
-        js->remove(MIDP_PACKAGE_TABLE, entry);
+        CHECK(chains.size() == 0);
     }
     catch (JavaStorageException& aJse)
     {
--- a/javacommons/utils/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/build/build.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -1,6 +1,6 @@
 <!--
 #
-# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2008-2010 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"
@@ -29,9 +29,11 @@
                    com.nokia.mj.impl.properties.common.FreeMemory,
                    com.nokia.mj.impl.properties.common.Locale,
                    com.nokia.mj.impl.properties.common.Platform,
-                   com.nokia.mj.impl.utils.Formatter,
+                   com.nokia.mj.impl.utils.FormatterAvkon,
+                   com.nokia.mj.impl.utils.FormatterQt,
                    com.nokia.mj.impl.utils.InstallerErrorMessage,
-                   com.nokia.mj.impl.utils.ResourceLoader"/>
+                   com.nokia.mj.impl.utils.ResourceLoader,
+                   com.nokia.mj.impl.utils.ResourceLoaderQt"/>
 
   <target name="system.properties">
       <properties>
--- a/javacommons/utils/build/javautils.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/build/javautils.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -22,7 +22,7 @@
 include(../../../inc/build_defines.pri)
 
 contains(PROJECT_DEFINES,RD_JAVA_UI_QT) {
-  CONFIG += qt
+  CONFIG += qt hb
   QT = core
 }
 
--- a/javacommons/utils/javasrc.cdc/com/ibm/oti/nokiaextcdc/SystemPropertyExtension.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc.cdc/com/ibm/oti/nokiaextcdc/SystemPropertyExtension.java	Fri Oct 15 12:29:39 2010 +0300
@@ -24,6 +24,7 @@
 
 import com.nokia.mj.impl.rt.SystemPropertyProperties;
 import com.nokia.mj.impl.rt.JvmPort;
+import com.nokia.mj.impl.utils.Logger;
 
 /**
  * A class that implements a system property extension mechanism provided
@@ -46,14 +47,24 @@
     {
         // Create a new object extending jva.util.Properties and fill with the
         // original properties.
-        SystemPropertyProperties newProperties =
-            new SystemPropertyProperties(originalProperties);
+        SystemPropertyProperties newProperties = null;
 
-        // Store the hashtable to be able to add properties during runtime.
-        JvmPort.setPropertiesContainer(newProperties);
-
-        //Override existing line.separator
-        newProperties.put("line.separator", "\n");
+        try
+        {
+            newProperties = new SystemPropertyProperties(originalProperties);
+            // Store the hashtable to be able to add properties during runtime.
+            JvmPort.setPropertiesContainer(newProperties);
+    
+            // Override existing line.separator
+            newProperties.put("line.separator", "\n");
+        }
+        catch (Throwable t)
+        {
+            Logger.LOG(Logger.EUtils, Logger.EInfo, 
+               "Failed to init system properties", t);
+            // In case of error, return original properties.
+            return originalProperties;
+        }
 
         return newProperties;
     }
--- a/javacommons/utils/javasrc/com/ibm/oti/nokiaextcldc/SystemPropertyExtension.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/ibm/oti/nokiaextcldc/SystemPropertyExtension.java	Fri Oct 15 12:29:39 2010 +0300
@@ -26,6 +26,7 @@
 import com.nokia.mj.impl.rt.SystemPropertyHashtable;
 import com.nokia.mj.impl.rt.support.Finalizer;
 import com.nokia.mj.impl.rt.JvmPort;
+import com.nokia.mj.impl.utils.Logger;
 
 /**
  * A class that implements a system property extension mechanism provided
@@ -44,23 +45,31 @@
 
     public Hashtable extendSystemProperties(Hashtable originalProperties)
     {
-        // Vital to make finalizer implementation reliable. If this is not done
-        // the first class registering for finalization never receves
-        // finalization serverces - i.e. none of the instances of that
-        // particular class will ever be finalized.
-        VM.enableFinalization(Finalizer.class);
-
-        // Create a new object extending java.util.Hashtable and fill with the
-        // original properties.
-        SystemPropertyHashtable newProperties =
-            new SystemPropertyHashtable(originalProperties);
-
-        // Store the hashtable to be able to add properties during runtime.
-        JvmPort.setPropertiesContainer(newProperties);
-
-        // Override existing line.separator
-        newProperties.put("line.separator", "\n");
-
-        return newProperties;
+        try
+        {
+            // Vital to make finalizer implementation reliable. If this is not
+            // done the first class registering for finalization never receves
+            // finalization serverces - i.e. none of the instances of that
+            // particular class will ever be finalized.
+            VM.enableFinalization(Finalizer.class);
+    
+            // Create a new object extending java.util.Hashtable and fill with
+            // the original properties.
+            SystemPropertyHashtable newProperties = 
+                new SystemPropertyHashtable(originalProperties);
+            // Store the hashtable to be able to add properties during runtime.
+            JvmPort.setPropertiesContainer(newProperties);
+    
+            // Override existing line.separator
+            newProperties.put("line.separator", "\n");
+            return newProperties;
+        }
+        catch (Throwable t)
+        {
+            Logger.LOG(Logger.EUtils, Logger.EInfo, 
+               "Failed to init system properties", t);
+            // In case of error, return original properties.
+        }
+        return originalProperties;
     }
 }
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java	Fri Oct 15 12:29:39 2010 +0300
@@ -141,10 +141,56 @@
         }
     }
 
+    /**
+     * Executes given Runnable synchronously in UI thread.
+     * <br>
+     * This method should only be used in cases where it
+     * is absolutely needed. Before using this method,
+     * consider carefully if the use case really requires
+     * code to be executed in UI thread.
+     * <br>
+     * This method is only supported in Qt based runtimes.
+     * <br>
+     * @param runnable Runnable to be executed
+     * @throws RuntimeException if execution in UI thread
+     * is not supported
+     */
+    public static void runInSyncUiThread(Runnable runnable)
+    {
+        if (sInstance != null)
+        {
+            sInstance.runInSyncUiThreadImpl(runnable);
+        }
+    }
+
+    /**
+     * Executes given Runnable asynchronously in UI thread.
+     * <br>
+     * This method should only be used in cases where it
+     * is absolutely needed. Before using this method,
+     * consider carefully if the use case really requires
+     * code to be executed in UI thread.
+     * <br>
+     * This method is only supported in Qt based runtimes.
+     * <br>
+     * @param runnable Runnable to be executed
+     * @throws RuntimeException if execution in UI thread
+     * is not supported
+     */
+    public static void runInAsyncUiThread(Runnable runnable)
+    {
+        if (sInstance != null)
+        {
+            sInstance.runInAsyncUiThreadImpl(runnable);
+        }
+    }
+
     protected abstract boolean connectToUiImpl();
     protected abstract void createUiImpl(Uid uid, boolean backGroundStart);
     protected abstract void shutdownRequestImpl();
     protected abstract void foregroundRequestImpl();
     protected abstract boolean isUiInForegroundImpl();
     protected abstract void hideApplicationImpl(boolean hide);
+    protected abstract void runInSyncUiThreadImpl(Runnable runnable);
+    protected abstract void runInAsyncUiThreadImpl(Runnable runnable);
 }
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/DynamicProperty.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/DynamicProperty.java	Fri Oct 15 12:29:39 2010 +0300
@@ -21,9 +21,10 @@
 /**
  * Interface for accessing configuration dependent system property extension
  * mechanism.
+ * The package visiblity is set to public for unit testing purposes.
  */
 
-interface DynamicProperty
+public interface DynamicProperty
 {
     /**
      * Adds the defined system property containing all the system
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/JvmPort.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/JvmPort.java	Fri Oct 15 12:29:39 2010 +0300
@@ -39,16 +39,18 @@
     private static final String PORTCLASS_PACKAGE = "com.nokia.mj.impl.rt.";
 
     /**
-     * When the class is loaded it will try to create the VM porting class
-     * defined in the system property PORTCLASS_PROPERTY_NAME
+     * When the getInstace() is first called it will be tried to create the
+     * VM porting class defined in the system property PORTCLASS_PROPERTY_NAME.
+     * The package visiblity is set to protected for unit testing purposes.
      */
-    private static JvmPort sInstance = null;
+    protected static JvmPort sInstance = null;
 
     /**
      * A reference to object containing properties. In CLDC it is Hashtable,
      * otherwise it is Properties.
+     * The package visiblity is set to protected for unit testing purposes.
      */
-    private static DynamicProperty mPropertiesContainer;
+    protected static DynamicProperty mPropertiesContainer;
 
     protected JvmPort()
     {
@@ -57,8 +59,12 @@
     /**
      * Static initializer
      */
-    static
+    private static synchronized void loadImpl()
     {
+		if (sInstance != null)
+		{
+			return;
+		}
         String vmPortClass = System.getProperty(PORTCLASS_PROPERTY_NAME);
         if (vmPortClass == null)
         {
@@ -74,8 +80,7 @@
         }
         catch (Exception e)
         {
-            String errTxt = "Not able to instantiate class " +
-                            vmPortClass + ".";
+            String errTxt = "Not able to instantiate class " + vmPortClass;
             Logger.ELOG(Logger.EUtils, errTxt, e);
             throw new RuntimeException(errTxt);
         }
@@ -88,6 +93,10 @@
      */
     public static JvmPort getInstance()
     {
+        if (sInstance == null)
+        {
+            loadImpl();
+        }
         return sInstance;
     }
 
@@ -125,7 +134,7 @@
     public abstract void setThreadAsDaemon(Thread Thread,
                                            boolean daemon)
     throws IllegalThreadStateException,
-                SecurityException;
+        SecurityException;
 
 
     /**
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/JvmPortCldc.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/JvmPortCldc.java	Fri Oct 15 12:29:39 2010 +0300
@@ -37,8 +37,7 @@
         }
         catch (Exception e)
         {
-            e.printStackTrace();
-            throw new RuntimeException("Not able to load library "+libName+". Reason is: "+e);
+            throw new Error("Not able to load library "+libName+". Reason is: "+e);
         }
     }
 
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/JvmPortCommon.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/JvmPortCommon.java	Fri Oct 15 12:29:39 2010 +0300
@@ -48,7 +48,12 @@
      */
     public final NativeMemoryBlock getResourceAsNativeMemory(String jarPath, String resName)
     {
-        return new NativeMemoryBlockImpl(jarPath, resName);
+        NativeMemoryBlock nativeMemoryBlock = new NativeMemoryBlockImpl(jarPath, resName);
+        if (nativeMemoryBlock.getPointer() != 0)
+        {
+            return nativeMemoryBlock;
+        }
+        return null;
     }
 
     /**
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/NativeMemoryBlockImpl.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/j9/NativeMemoryBlockImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -32,7 +32,7 @@
 class NativeMemoryBlockImpl implements NativeMemoryBlock
 {
 
-    InputStream mMemInputStream = null;
+    private InputStream mMemInputStream = null;
 
     /**
      * Default constructor not allowed
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationInfo.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationInfo.java	Fri Oct 15 12:29:39 2010 +0300
@@ -18,6 +18,7 @@
 package com.nokia.mj.impl.rt.support;
 
 import com.nokia.mj.impl.utils.Uid;
+import com.nokia.mj.impl.utils.Logger;
 
 /**
  * ApplicationInfo is an abstract base class for API implementations,
@@ -192,11 +193,12 @@
             Class clazz = Class.forName(className);
             sInstance = (ApplicationInfo)clazz.newInstance();
         }
-        catch (Exception e)
+        catch (Throwable t)
         {
-            e.printStackTrace();
-            throw new RuntimeException("Not able to instantiate class " +
-                                       className+". Reason is: " + e);
+            String err = "Not able to instantiate class " +
+                         className + ". Reason is: ";
+            Logger.LOG(Logger.EUtils, Logger.EInfo, err, t);
+            throw new RuntimeException(err + t);
         }
     }
 
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java	Fri Oct 15 12:29:39 2010 +0300
@@ -17,11 +17,13 @@
 
 package com.nokia.mj.impl.rt.support;
 
-import com.nokia.mj.impl.utils.Uid;
-import java.util.Vector;
+import java.security.AccessControlException;
+import java.security.Permission;
 import java.util.Enumeration;
-import java.security.Permission;
-import java.security.AccessControlException;
+import java.util.Vector;
+
+import com.nokia.mj.impl.utils.Uid;
+import com.nokia.mj.impl.utils.Logger;
 
 /**
  * ApplicationUtils is an abstract base class for API implementations,
@@ -135,11 +137,12 @@
             Class clazz = Class.forName(className);
             sInstance = (ApplicationUtils)clazz.newInstance();
         }
-        catch (Exception e)
+        catch (Throwable t)
         {
-            e.printStackTrace();
-            throw new RuntimeException("Not able to instantiate class " +
-                                       className+". Reason is: " + e);
+            String err = "Not able to instantiate class " +
+                         className + ". Reason is: ";
+            Logger.LOG(Logger.EUtils, Logger.EInfo, err, t);
+            throw new RuntimeException(err + t);
         }
     }
 
@@ -189,8 +192,8 @@
      * This method is meant ONLY for the UI and no other API are allowed
      * to use it.
      * <p>
-     * It is possible that the method is called several times from different 
-     * phases of the UI exit sequence. 
+     * It is possible that the method is called several times from different
+     * phases of the UI exit sequence.
      */
     public void uiDisposed()
     {
@@ -220,11 +223,11 @@
      */
     public abstract void checkPermission(Permission p)
     throws AccessControlException,
-                NullPointerException;
+        NullPointerException;
 
     public abstract void checkPermission(Uid appUid,Permission p)
     throws AccessControlException,
-                NullPointerException;
+        NullPointerException;
 
     /**
      * Adds a shutdown notifications listener to receive notifications when
@@ -258,15 +261,15 @@
      * Removes the registered shutdown listener.
      *
      * @param listener the listener to be removed. If the listener is not
-     *                 found nothing happens. If the key is null, a 
+     *                 found nothing happens. If the key is null, a
      * @throws NullPointerException if the listener is null.
      */
     public void removeShutdownListener(ShutdownListener listener)
     {
         if (listener == null)
         {
-            throw new 
-              NullPointerException("Listener was null when trying to remove");
+            throw new
+            NullPointerException("Listener was null when trying to remove");
         }
         if (mListeners != null)
         {
@@ -353,5 +356,6 @@
                 listener.shuttingDown();
             }
         }
+        mListeners = null;
     }
 }
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/Jvm.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/Jvm.java	Fri Oct 15 12:29:39 2010 +0300
@@ -100,8 +100,7 @@
      * provided then it can be any Jar file availble in the file system.
      * @param resName Name of the desired resource
      *
-     * @return MemoryInputStream object as InputStream if resource is found,
-     *         otherwise null.
+     * @return NativeMemoryBlock instance if resource is found, otherwise null.
      */
     public static NativeMemoryBlock getResourceAsNativeMemory(String jarPath,
             String resName)
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/MemoryManager.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/MemoryManager.java	Fri Oct 15 12:29:39 2010 +0300
@@ -105,6 +105,11 @@
                 setWindow();
                 return;
             }
+            else
+            {
+                // inside window - nothing to do
+                return;
+            }
         }
 
         // Collection has been requested
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/ui/ConfirmData.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/ui/ConfirmData.java	Fri Oct 15 12:29:39 2010 +0300
@@ -34,7 +34,8 @@
      *
      * @param aQuestion              the question (as localized text) to be
      *                               asked from user
-     * @param aAnswerOptions         the answer options (as localized texts)
+     * @param aAnswerOptions         the answer options (as localized texts).
+     *                               If null UI loads default values.
      * @param aAnswerSuggestion      the suggestion for the option to be
      *                               selected (e.g. the option to be
      *                               highlighted when presenting the answer
@@ -65,6 +66,16 @@
     }
 
     /**
+     * Setter for the answer options.
+     * @param aAnswerOptions Set answer options. Answer options are
+     *                       button labels.
+     */    
+    public void setAnswerOptions(String[] aAnswerOptions)
+    {
+        iAnswerOptions = aAnswerOptions;
+    }
+
+    /**
      * Getter for the user's question
      *
      * @return the question (as localized text) to be asked from user
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/ui/RuntimeUiTexts.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/ui/RuntimeUiTexts.java	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -21,16 +21,13 @@
 
 /**
  * Class defining RuntimeUi texts.
- *
- * @author Nokia Corporation
- * @version 1.0
  */
 public class RuntimeUiTexts
 {
     /*** ----------------------------- PUBLIC ------------------------------ */
 
-    public static final String OK = "secur_prompt_ok";
-    public static final String DETAILS_QUERY = "secur_error_details_message";
+    public static final String OK = "secur_prompt_ok,prompt_ok";
+    public static final String DETAILS_QUERY = "secur_error_details_message,error_details";
 
     /**
      * Method for retrieving a text string with given id and no parameters.
@@ -54,7 +51,9 @@
     {
         if (iRes == null)
         {
-            iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_");
+            iRes = ResourceLoader.getInstance(
+                "javausermessages,javaapplicationsecuritymessages",
+                "qtn_java_,txt_java_secur_button_");
         }
         return iRes.format(aTextId, aTextParameters);
     }
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java	Fri Oct 15 12:29:39 2010 +0300
@@ -34,10 +34,12 @@
             Jvm.loadSystemLibrary("javautils");
         }
 
-        catch (Exception e)
+        catch (Throwable t)
         {
-            Logger.ELOG(Logger.EUtils, "Error loading debug utils native.",
-                        e);
+            String errStr = "Error loading debug utils native. ";
+            Logger.ELOG(Logger.EUtils, errStr,
+                        t);
+            throw new RuntimeException(errStr);
         }
     }
 
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java	Fri Oct 15 12:29:39 2010 +0300
@@ -24,7 +24,7 @@
  * Utility for formatting text strings from a pattern with positional
  * parameters.
  * <br>
- * Supported parameters are:
+ * Supported parameters in Avkon environment are:
  * <UL>
  * <LI>%nU - String in position n
  * <LI>%U - Next string
@@ -36,70 +36,42 @@
  * <LI>%n - Parameter in position n
  * </UL>
  * <br>
+ * Supported parameters in Qt environment are:
+ * <UL>
+ * <LI>%1, %2, %3, ... - for String parameters
+ * <LI>%L1, %L2, %L3, ... - for Integer parameters (%1, %2, %3, ... is also ok)
+ * <LI>%Ln - for Integers indicating plurality
+ * </UL>
+ * <br>
+ * Text parameter indices start from 0 when Avkon is used and from 1
+ * when Qt is used. One text can only contain one %Ln parameter.
+ * <br>
  * Example of usage:
  * <pre>
- *   Formatter formatter = new Formatter("You have %N email(s) left");
+ *   Formatter formatter = resourceLoader.format("You have %N email(s) left");
  *   String message = formatter.arg(5).toString();
- *   // Becomes :You have 5 email(s) left
+ *   // Becomes: You have 5 email(s) left
  *
  *   Formatter formatter = new Formatter("There are %N0 files in folder \"%U1\"");
  *   String message = formatter.arg(5).arg("photos").toString();
- *   // Becomes :There are 5 files in folder "photos"
+ *   // Becomes: There are 5 files in folder "photos"
  * </pre>
  * <br>
- * Limitation: more than 10 positional arguments are not supported (only 0...9)
- * <br>
- * Note that Formatter supports Avkon and Qt based localisation.
- * Text parameter indices start from 0 when Avkon is used and from 1
- * when Qt is used.
  */
-public class Formatter
+abstract public class Formatter
 {
-    /** Original pattern string */
-    private String pattern;
-
-    /** String with latest replacements */
-    private String replaced;
-
-    /**
-     * Platform localisation type.
-     * Either ResourceLoader.AVKON or ResourceLoader.QT. */
-    private final int locType;
-
-    /**
-     * The first text parameter replacement index. For Avkon based
-     * localisation this is 0, for Qt based localisation this is 1.
-     */
-    private final int startIndex;
-
-    /** Next replacement index */
-    private int nextIndex;
-
     /*** ----------------------------- PUBLIC ------------------------------ */
 
     /**
-     * Create a new formatter
+     * Set the plurality for this Formatter. Note that this method does
+     * nothing when Avkon localisation is used.
      *
-     * @param pattern formatter pattern
+     * @param n number indicating plurality
+     * @return same formatter
      */
-    Formatter(String aPattern)
+    public Formatter argn(int n)
     {
-        this(aPattern, ResourceLoader.AVKON);
-    }
-
-    /**
-     * Create a new formatter
-     *
-     * @param pattern formatter pattern
-     * @param aLocType platform localisation type
-     */
-    Formatter(String aPattern, int aLocType)
-    {
-        pattern = aPattern;
-        replaced = aPattern;
-        locType = aLocType;
-        startIndex = (locType == ResourceLoader.QT? 1: 0);
-        nextIndex = startIndex;
+        return this;
     }
 
     /**
@@ -109,25 +81,7 @@
      * @param string string to replace at the argument
      * @return same formatter
      */
-    public Formatter arg(String string)
-    {
-        // Try to replace with patterns %[N...N]n, %nU, %n, %U
-        String maxPattern = findMaxPattern();
-        if ((maxPattern != null && replace(maxPattern, string)) ||
-                replace("%" + nextIndex + "U", string) ||
-                replace("%" + nextIndex, string) ||
-                replace("%U", string))
-        {
-            nextIndex++;
-        }
-        else
-        {
-            Logger.WLOG(Logger.EUtils,
-                        "String replacement failed on parameter " +
-                        nextIndex + ": " + pattern);
-        }
-        return this;
-    }
+    abstract public Formatter arg(String string);
 
     /**
      * Replace the least numbered parameter in the string, which is not yet
@@ -136,29 +90,7 @@
      * @param number number to replace at the argument
      * @return same formatter
      */
-    public Formatter arg(int number)
-    {
-        String localisedNumber = _formatInteger(number);
-
-        // Try to replace with patterns %[N...N]n, %Ln, %nN, %n, %N
-        String maxPattern = findMaxPattern();
-        if ((maxPattern != null && replace(maxPattern, localisedNumber)) ||
-                replace("%" + "L" + nextIndex, localisedNumber) ||
-                replace("%" + nextIndex + "N", localisedNumber) ||
-                replace("%" + nextIndex, localisedNumber) ||
-                replace("%N", localisedNumber))
-        {
-            nextIndex++;
-
-        }
-        else
-        {
-            Logger.WLOG(Logger.EUtils,
-                        "Integer replacement failed on parameter " +
-                        nextIndex + ": " + pattern);
-        }
-        return this;
-    }
+    abstract public Formatter arg(int number);
 
     /**
      * Replace the least numbered parameter in the string, which is not yet
@@ -167,26 +99,7 @@
      * @param ch character to replace at the argument
      * @return same formatter
      */
-    public Formatter arg(char ch)
-    {
-        String chString = new String(new char[] { ch });
-
-        // Try to replace with patterns %nC, %n, %C
-        if (replace("%" + nextIndex + "C", chString) ||
-                replace("%" + nextIndex, chString) ||
-                replace("%C", chString))
-        {
-            nextIndex++;
-
-        }
-        else
-        {
-            Logger.WLOG(Logger.EUtils,
-                        "Character replacement failed on parameter " +
-                        nextIndex + ": " + pattern);
-        }
-        return this;
-    }
+    abstract public Formatter arg(char ch);
 
     /**
      * Replace the least numbered parameter in the string, which is not yet
@@ -195,17 +108,13 @@
      * @param date date to replace at the argument
      * @return same formatter
      */
-    public Formatter arg(Date date)
-    {
-        String dateString = _formatDate(date.getTime());
-        return arg(dateString);
-    }
+    abstract public Formatter arg(Date date);
 
     /**
      * Replace the least numbered parameter in the string, which is not yet
      * replaced.
      *
-     * @param o object whose toString() will be used for argument position
+     * @param o object which will be used for argument position
      * @return same formatter
      */
     public Formatter arg(Object o)
@@ -239,16 +148,7 @@
      *
      * @return string where parameters are replaced
      */
-    public String toString()
-    {
-        String result = replaced;
-
-        // Reset for next usage
-        replaced = pattern;
-        nextIndex = startIndex;
-
-        return result;
-    }
+    abstract public String toString();
 
     /**
      * Formats localised text with specified parameters from an array.
@@ -265,22 +165,7 @@
         {
             for (int i = 0; i < textParameters.length; i++)
             {
-                if (textParameters[i] instanceof String)
-                {
-                    arg((String)textParameters[i]);
-                }
-                else if (textParameters[i] instanceof Integer)
-                {
-                    arg(((Integer)textParameters[i]).intValue());
-                }
-                else if (textParameters[i] instanceof Date)
-                {
-                    arg((Date)textParameters[i]);
-                }
-                else
-                {
-                    arg(textParameters[i]);
-                }
+                arg(textParameters[i]);
             }
         }
         return toString();
@@ -295,136 +180,26 @@
      */
     public static String formatDigits(String str)
     {
-        return _formatDigits(str);
+        if (ResourceLoader.getLocaleIdQt() == null)
+        {
+            return FormatterAvkon.formatDigits(str);
+        }
+        else
+        {
+            return FormatterQt.formatDigits(str);
+        }
+    }
+
+    /*** ----------------------------- PROTECTED -------------------------- */
+
+    /**
+     * Default constructor.
+     */
+    protected Formatter()
+    {
     }
 
     /*** ----------------------------- PRIVATE ---------------------------- */
 
-    /**
-     * Replace first occurrence of the string pattern in the replaced field.
-     *
-     * @param pattern string to search for
-     * @param replacement string to replace patterns
-     * @return true if pattern was found and replaced, false if pattern was
-     *         not found
-     */
-    private boolean replace(String pattern, String replacement)
-    {
-        int index = replaced.indexOf(pattern);
-        if (index != -1)
-        {
-            if (replaced.indexOf(pattern + "[]") != -1)
-            {
-                replaced =
-                    replaced.substring(0, index) + replacement +
-                    replaced.substring(index + pattern.length() + 2);
-            }
-            else if (replaced.indexOf(pattern + "[") != -1)
-            {
-                return replaceWithMax(pattern, replacement, index);
-            }
-            else
-            {
-                replaced =
-                    replaced.substring(0, index) + replacement +
-                    replaced.substring(index + pattern.length());
-            }
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Replace first occurrence of the string pattern in the replaced field.
-     * Replace [N...N] defined amount of characters.
-     *
-     * @param pattern string to search for
-     * @param replacement string to replace patterns
-     * @param index of replacement tag.
-     * @return true if pattern was found and replaced, false if pattern was
-     *         not found
-     */
-    private boolean replaceWithMax(String pattern, String replacement, int maxIndex)
-    {
-        boolean result = false;
-        int closingIndex = replaced.indexOf("]", maxIndex + pattern.length());
-
-        // Check format [N...N] comply. If not skip.
-        if (closingIndex > 0)
-        {
-            try
-            {
-                int maxLen = Integer.parseInt(replaced.substring(
-                                                  maxIndex + pattern.length() + 1, closingIndex));
-
-                if (maxLen > replacement.length())
-                {
-                    maxLen = replacement.length();
-                }
-
-                replaced = replaced.substring(0, maxIndex) +
-                           replacement.substring(0, maxLen) +
-                           replaced.substring(closingIndex + 1);
-                result = true;
-            }
-            catch (NumberFormatException nfe)
-            {
-                Logger.WLOG(Logger.EUtils, "Replace with max failed to invalid"
-                            + " replacement amount");
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Finds next %[N...N]n pattern from the replaced field.
-     * Returns found pattern, or null if no pattern was found.
-     */
-    private String findMaxPattern()
-    {
-        String result = null;
-        String startPattern = "%[";
-        String endPattern = "]" + nextIndex;
-        int startIndex = replaced.indexOf(startPattern);
-        if (startIndex >= 0)
-        {
-            int endIndex = replaced.indexOf(endPattern, startIndex);
-            if (endIndex >= 0)
-            {
-                result = replaced.substring(
-                    startIndex, endIndex + endPattern.length());
-            }
-        }
-        return result;
-    }
-
     /*** ----------------------------- NATIVE ----------------------------- */
-
-    /**
-     * Format integer to current locale.
-     *
-     * @param number to be formatted.
-     * @return number formatted as current locale String.
-     */
-    private native String _formatInteger(int number);
-
-    /**
-     * Format date to current locale.
-     *
-     * @param timeInMilliSecs to be formatted.
-     * @param format Date format.
-     * @return date formatted as current locale String.
-     *
-     */
-    private native String _formatDate(long timeInMilliSecs);
-
-    /**
-     * Applies convertion from european digits into arabic-indic digits
-     * based on existing language settings
-     *
-     * @param str String which might contain european digits
-     * @return A string identical with the provided string but with the
-     *         european digits (if any) converted to arabic-indic digits
-     */
-    private static native String _formatDigits(String str);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/FormatterAvkon.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,346 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.utils;
+
+import java.util.Date;
+
+/**
+ * Formatter for Avkon based platform.
+ * @see Formatter
+ */
+public class FormatterAvkon extends Formatter
+{
+    /** Original pattern string */
+    private String pattern;
+
+    /** String with latest replacements */
+    private String replaced;
+
+    /**
+     * Platform localisation type.
+     * Either ResourceLoader.AVKON or ResourceLoader.QT.
+     */
+    private final int locType;
+
+    /**
+     * The first text parameter replacement index. For Avkon based
+     * localisation this is 0, for Qt based localisation this is 1.
+     */
+    private final int startIndex;
+
+    /** Next replacement index */
+    private int nextIndex;
+
+    /*** ----------------------------- PUBLIC ------------------------------ */
+
+    /**
+     * Replace the lowest numbered parameter in the string, which is not yet
+     * replaced.
+     *
+     * @param string string to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(String string)
+    {
+        // Try to replace with patterns %[N...N]n, %nU, %n, %U
+        String maxPattern = findMaxPattern();
+        if ((maxPattern != null && replace(maxPattern, string)) ||
+                replace("%" + nextIndex + "U", string) ||
+                replace("%" + nextIndex, string) ||
+                replace("%U", string))
+        {
+            nextIndex++;
+        }
+        else
+        {
+            Logger.WLOG(Logger.EUtils,
+                        "FormatterAvkon: String replacement failed on parameter " +
+                        nextIndex + ": " + pattern);
+        }
+        return this;
+    }
+
+    /**
+     * Replace the least numbered parameter in the string, which is not yet
+     * replaced.
+     *
+     * @param number number to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(int number)
+    {
+        String localisedNumber = _formatInteger(number);
+
+        // Try to replace with patterns %[N...N]n, %Ln, %nN, %n, %N
+        String maxPattern = findMaxPattern();
+        if ((maxPattern != null && replace(maxPattern, localisedNumber)) ||
+                replace("%" + "L" + nextIndex, localisedNumber) ||
+                replace("%" + nextIndex + "N", localisedNumber) ||
+                replace("%" + nextIndex, localisedNumber) ||
+                replace("%N", localisedNumber))
+        {
+            nextIndex++;
+
+        }
+        else
+        {
+            Logger.WLOG(Logger.EUtils,
+                        "FormatterAvkon: Integer replacement failed on parameter " +
+                        nextIndex + ": " + pattern);
+        }
+        return this;
+    }
+
+    /**
+     * Replace the least numbered parameter in the string, which is not yet
+     * replaced.
+     *
+     * @param ch character to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(char ch)
+    {
+        String chString = new String(new char[] { ch });
+
+        // Try to replace with patterns %nC, %n, %C
+        if (replace("%" + nextIndex + "C", chString) ||
+                replace("%" + nextIndex, chString) ||
+                replace("%C", chString))
+        {
+            nextIndex++;
+
+        }
+        else
+        {
+            Logger.WLOG(Logger.EUtils,
+                        "FormatterAvkon: Character replacement failed on parameter " +
+                        nextIndex + ": " + pattern);
+        }
+        return this;
+    }
+
+    /**
+     * Replace the least numbered parameter in the string, which is not yet
+     * replaced. Date is formatted according to current device date format.
+     *
+     * @param date date to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(Date date)
+    {
+        String dateString = _formatDate(date.getTime());
+        return arg(dateString);
+    }
+
+    /**
+     * Convert the current pattern to string, along with parameter
+     * replacements.
+     *
+     * @return string where parameters are replaced
+     */
+    public String toString()
+    {
+        String result = replaced;
+
+        // Reset for next usage
+        replaced = pattern;
+        nextIndex = startIndex;
+
+        return result;
+    }
+
+    /**
+     * Applies convertion from european digits into arabic-indic digits
+     * based on existing language settings
+     *
+     * @param str String which might contain european digits
+     * @return A string identical with the provided string but with the
+     *         european digits (if any) converted to arabic-indic digits
+     */
+    public static String formatDigits(String str)
+    {
+        return _formatDigits(str);
+    }
+
+    /*** ----------------------------- PROTECTED -------------------------- */
+
+    /**
+     * Default constructor.
+     */
+    protected FormatterAvkon()
+    {
+        this("");
+    }
+
+    /**
+     * Create a new formatter
+     *
+     * @param pattern formatter pattern
+     */
+    protected FormatterAvkon(String aPattern)
+    {
+        this(aPattern, ResourceLoader.AVKON);
+    }
+
+    /**
+     * Create a new formatter
+     *
+     * @param pattern formatter pattern
+     * @param aLocType platform localisation type
+     */
+    protected FormatterAvkon(String aPattern, int aLocType)
+    {
+        pattern = aPattern;
+        replaced = aPattern;
+        locType = aLocType;
+        startIndex = (locType == ResourceLoader.QT? 1: 0);
+        nextIndex = startIndex;
+    }
+
+    /*** ----------------------------- PRIVATE ---------------------------- */
+
+    /**
+     * Replace first occurrence of the string pattern in the replaced field.
+     *
+     * @param pattern string to search for
+     * @param replacement string to replace patterns
+     * @return true if pattern was found and replaced, false if pattern was
+     *         not found
+     */
+    private boolean replace(String pattern, String replacement)
+    {
+        int index = replaced.indexOf(pattern);
+        if (index != -1)
+        {
+            if (replaced.indexOf(pattern + "[]") != -1)
+            {
+                replaced =
+                    replaced.substring(0, index) + replacement +
+                    replaced.substring(index + pattern.length() + 2);
+            }
+            else if (replaced.indexOf(pattern + "[") != -1)
+            {
+                return replaceWithMax(pattern, replacement, index);
+            }
+            else
+            {
+                replaced =
+                    replaced.substring(0, index) + replacement +
+                    replaced.substring(index + pattern.length());
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Replace first occurrence of the string pattern in the replaced field.
+     * Replace [N...N] defined amount of characters.
+     *
+     * @param pattern string to search for
+     * @param replacement string to replace patterns
+     * @param index of replacement tag.
+     * @return true if pattern was found and replaced, false if pattern was
+     *         not found
+     */
+    private boolean replaceWithMax(String pattern, String replacement, int maxIndex)
+    {
+        boolean result = false;
+        int closingIndex = replaced.indexOf("]", maxIndex + pattern.length());
+
+        // Check format [N...N] comply. If not skip.
+        if (closingIndex > 0)
+        {
+            try
+            {
+                int maxLen = Integer.parseInt(replaced.substring(
+                                                  maxIndex + pattern.length() + 1, closingIndex));
+
+                if (maxLen > replacement.length())
+                {
+                    maxLen = replacement.length();
+                }
+
+                replaced = replaced.substring(0, maxIndex) +
+                           replacement.substring(0, maxLen) +
+                           replaced.substring(closingIndex + 1);
+                result = true;
+            }
+            catch (NumberFormatException nfe)
+            {
+                Logger.WLOG(Logger.EUtils,
+                            "FormatterAvkon: Replace with max failed to " +
+                            "invalid replacement amount");
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Finds next %[N...N]n pattern from the replaced field.
+     * Returns found pattern, or null if no pattern was found.
+     */
+    private String findMaxPattern()
+    {
+        String result = null;
+        String startPattern = "%[";
+        String endPattern = "]" + nextIndex;
+        int startIndex = replaced.indexOf(startPattern);
+        if (startIndex >= 0)
+        {
+            int endIndex = replaced.indexOf(endPattern, startIndex);
+            if (endIndex >= 0)
+            {
+                result = replaced.substring(
+                    startIndex, endIndex + endPattern.length());
+            }
+        }
+        return result;
+    }
+
+    /*** ----------------------------- NATIVE ----------------------------- */
+
+    /**
+     * Format integer to current locale.
+     *
+     * @param number to be formatted.
+     * @return number formatted as current locale String.
+     */
+    private static native String _formatInteger(int number);
+
+    /**
+     * Format date to current locale.
+     *
+     * @param timeInMilliSecs to be formatted.
+     * @param format Date format.
+     * @return date formatted as current locale String.
+     *
+     */
+    private static native String _formatDate(long timeInMilliSecs);
+
+    /**
+     * Applies conversion from european digits into arabic-indic digits
+     * based on existing language settings
+     *
+     * @param str String which might contain european digits
+     * @return A string identical with the provided string but with the
+     *         european digits (if any) converted to arabic-indic digits
+     */
+    private static native String _formatDigits(String str);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/FormatterQt.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.utils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Vector;
+
+/**
+ * Formatter for Qt based platform.
+ * @see Formatter
+ */
+class FormatterQt extends Formatter
+{
+    /** ResourceLoader to be used with this Formatter. */
+    private ResourceLoaderQt iResourceLoader = null;
+
+    /** Original text id. */
+    private String iTextId = null;
+
+    /** Number indicating plurality set with argn() method. */
+    private int iArgN = -1;
+
+    /** Text parameters set with arg() methods. */
+    private Vector iArgs = new Vector();
+
+    /*** ----------------------------- PUBLIC ------------------------------ */
+
+    /**
+     * Set the plurality for this Formatter.
+     *
+     * @param n number indicating plurality
+     * @return same formatter
+     */
+    public Formatter argn(int n)
+    {
+        iArgN = n;
+        return this;
+    }
+
+    /**
+     * Replace the lowest numbered parameter in the string, which is not yet
+     * replaced.
+     *
+     * @param string string to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(String string)
+    {
+        iArgs.addElement(string);
+        return this;
+    }
+
+    /**
+     * Replace the least numbered parameter in the string, which is not yet
+     * replaced.
+     *
+     * @param number number to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(int number)
+    {
+        iArgs.addElement(new Integer(number));
+        return this;
+    }
+
+    /**
+     * Replace the least numbered parameter in the string, which is not yet
+     * replaced.
+     *
+     * @param ch character to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(char ch)
+    {
+        iArgs.addElement(new Character(ch));
+        return this;
+    }
+
+    /**
+     * Replace the least numbered parameter in the string, which is not yet
+     * replaced. Date is formatted according to current device date format.
+     *
+     * @param date date to replace at the argument
+     * @return same formatter
+     */
+    public Formatter arg(Date date)
+    {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(date);
+        iArgs.addElement(cal);
+        return this;
+    }
+
+    /**
+     * Convert the current pattern to string, along with parameter
+     * replacements.
+     *
+     * @return string where parameters are replaced
+     */
+    public String toString()
+    {
+        // Fetch localized text from iResourceLoader.
+        String result = iResourceLoader.string(iTextId, iArgN);
+        // Replace text parameters.
+        Object[] args = new Object[iArgs.size()];
+        for (int i = 0; i < iArgs.size(); i++)
+        {
+            args[i] = iArgs.elementAt(i);
+        }
+        result = _formatParameters(result, args);
+        // Reset for next usage.
+        iArgN = -1;
+        iArgs.removeAllElements();
+        return result;
+    }
+
+    /**
+     * Applies conversion from european digits into arabic-indic digits
+     * based on existing language settings
+     *
+     * @param str String which might contain european digits
+     * @return A string identical with the provided string but with the
+     *         european digits (if any) converted to arabic-indic digits
+     */
+    public static String formatDigits(String str)
+    {
+        return str;
+    }
+
+    /*** ----------------------------- PROTECTED -------------------------- */
+
+    /**
+     * Default constructor.
+     */
+    protected FormatterQt()
+    {
+        this(null, "");
+    }
+
+    /**
+     * Create a new formatter
+     *
+     * @param aResourceLoader ResourceLoader to be used with this Formatter
+     * @param aTextId text id
+     */
+    protected FormatterQt(ResourceLoaderQt aResourceLoader, String aTextId)
+    {
+        iResourceLoader = aResourceLoader;
+        iTextId = aTextId;
+    }
+
+    /*** ----------------------------- PRIVATE ---------------------------- */
+
+    /*** ----------------------------- NATIVE ----------------------------- */
+
+    /**
+     * Formats given parameters to given text.
+     *
+     * @param aText text to be formatted
+     * @param aArgs text parameters
+     * @return formatted text
+     */
+    private static native String _formatParameters(String aText, Object[] aArgs);
+
+    /**
+     * Applies conversion from european digits into arabic-indic digits
+     * based on existing language settings
+     *
+     * @param str String which might contain european digits
+     * @return A string identical with the provided string but with the
+     *         european digits (if any) converted to arabic-indic digits
+     */
+    private static native String _formatDigits(String str);
+}
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java	Fri Oct 15 12:29:39 2010 +0300
@@ -19,8 +19,7 @@
 package com.nokia.mj.impl.utils;
 
 /**
- * Localisation Identifier. This class is used to hide platform localisation
- * specifics.
+ * Localisation identifier.
  */
 public class Id
 {
@@ -34,6 +33,12 @@
     {
     }
 
+    /**
+     * Localisation identifier with Avkon and Qt type text identifiers.
+     *
+     * @param aAvkonLocString text id fof Avkon based localisation
+     * @param aQtLocString text id for Qt based localisation
+     */
     public Id(String aAvkonLocString, String aQtLocString)
     {
         this.iAvkonLocString = aAvkonLocString;
@@ -48,7 +53,7 @@
         }
         else
         {
-            return iAvkonLocString;       
+            return iAvkonLocString;
         }
-    }     
+    }
 }
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java	Fri Oct 15 12:29:39 2010 +0300
@@ -161,18 +161,20 @@
     //private static ByteArrayOutputStream byte_stream = new ByteArrayOutputStream();
     //private static PrintStream print_stream = new PrintStream(byte_stream);
 
+    private static boolean mNativeAvailable = false;
+
     static
     {
 
         try
         {
             Jvm.loadSystemLibrary("javautils");
+            mNativeAvailable = true;
         }
 
-        catch (Exception e)
+        catch (Throwable t)
         {
-
-            System.err.println(e.toString());
+            System.err.println("Error loading javautils: " + t);
         }
     }
 
@@ -345,7 +347,24 @@
         }
         else
         {
-            _logging(component, level, str, DebugUtils.getStackTrace(thrown));
+            if (mNativeAvailable)
+            {
+                _logging(component, level, str, DebugUtils.getStackTrace(thrown));
+            }
+            else
+            {
+                PrintStream printStream = System.out;
+                if (level == EError || level == EWarning)
+                {
+                    printStream = System.err;
+                }
+                printStream.println("Component: " + component + ", level: " +
+                                    level + ", msg: " + str);
+                if (thrown != null)
+                {
+                    thrown.printStackTrace();
+                }
+            }
         }
     }
 
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java	Fri Oct 15 12:29:39 2010 +0300
@@ -18,135 +18,131 @@
 
 package com.nokia.mj.impl.utils;
 
-import java.io.*;
-import java.util.*;
+import com.nokia.mj.impl.coreui.CoreUi;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
 
 /**
  * Resource loader to get localised strings and Formatter patterns.
  * <br>
  * Usage:
  * <pre>
- *   ResourceLoader res = new ResourceLoader("javainstaller", "qtn_java_installer_");
+ *   ResourceLoader res = ResourceLoader.getInstance("javainstaller", "qtn_java_installer_");
  *   Label subjectLabel = createLabel(
  *       res.format("subject").arg(certificate.getSubject()).toString(),
  *       horizontalSpan, labelStyle);
  * </pre>
+ * <br>
+ * It is possible to pass a comma separated list of text ids to format
+ * method and also to pass a comma separated list of resource filenames
+ * and text id prefixes to getInstance method. In this case the texts
+ * are searched in the order they are listed and the first text
+ * that is found will be returned. This can be used to specify texts
+ * for different platforms in a single parameter, provided that the
+ * text ids, prefixes and resource filenames are unique in each platform.
+ * <br>
+ * If the text ids, prefixes and resource filenames are not unique
+ * in each platform, then a separate ResourceLoader instance must
+ * be obtained for every platform.
+ * <br>
+ * When more than one resource filenames and text id prefixes
+ * are used, the Nth prefix is applied only to the Nth resource file.
+ * This means that the number of comma separated resource filenames and
+ * prefixes must be the same.
+ * <br>
+ * If the localised text for given id is not found, ResourceLoader
+ * returns the id itself.
  */
-public class ResourceLoader
+abstract public class ResourceLoader
 {
     /** AVKON UI identifier. */
-    public static final int AVKON = 1;
+    protected static final int AVKON = 1;
     /** QT UI identifier. */
-    public static final int QT = 2;
+    protected static final int QT = 2;
 
-    /** Localisation resource basepath */
-    private static final String LOC_RESOURCE_BASE = "/resources/com/nokia/mj/impl/";
+    /** Separator in text id, resource filename, and prefix strings. */
+    protected static final String SEPARATOR = ",";
 
     /** Map for ResourceLoader instances. */
-    private static Hashtable resourceLoaders = new Hashtable();
-
-    /** Resource string map. Null if resource could not be loaded. */
-    private Hashtable resourceMap = new Hashtable();
+    protected static Hashtable iResourceLoaders = new Hashtable();
 
-    /** Resource name prefix */
-    private String prefix = null;
-
-    /** Platform localisation type. */
-    private int locType = -1;
+    /**
+     * Flag telling if ResourceLoader has already ensured that
+     * UI thread exists.
+     */
+    private static boolean iUiThreadExists = false;
 
     /*** ----------------------------- PUBLIC ------------------------------ */
 
-    public static ResourceLoader getInstance(String avkonFileName,
-                                             String avkonPrefix,
-                                             String qtFileName,
-                                             String qtPrefix)
+    /**
+     * Returns a resource loader instance.
+     *
+     * @param avkonFileName name of the Avkon resource file
+     * @param avkonPrefix prefix added before each id when retrieving
+     * @param qtFileName name of the Qt resource file
+     * @param qtPrefix prefix added before each id when retrieving
+     * @return resource loader instance
+     */
+    synchronized public static ResourceLoader getInstance(
+        String avkonFileName, String avkonPrefix,
+        String qtFileName, String qtPrefix)
     {
-        // Construct key from filenames and prefixes, this is the same
-        // between platforms.
-        String key = (new StringBuffer()).append(avkonFileName).append(":")
-            .append(avkonPrefix).append(":").append(qtFileName).append(":")
-            .append(qtPrefix).toString();
-        ResourceLoader result = (ResourceLoader)resourceLoaders.get(key);
-
-        if (result == null)
+        ResourceLoader rl = null;
+        if (getLocaleIdQt() == null || qtFileName == null)
+        {
+            rl = ResourceLoaderAvkon.getInstance(avkonFileName, avkonPrefix);
+        }
+        else
         {
-            result = new ResourceLoader(avkonFileName, avkonPrefix, qtFileName, qtPrefix);
-            resourceLoaders.put(key, result);
+            try
+            {
+                rl = ResourceLoaderQt.getInstance(qtFileName, qtPrefix);
+            }
+            catch (Throwable t)
+            {
+                Logger.WLOG(Logger.EUtils,
+                            "ResourceLoader: Creating ResourceLoaderQt for " +
+                            qtFileName + " failed: " + t);
+            }
+            if (rl == null)
+            {
+                rl = ResourceLoaderAvkon.getInstance(
+                    avkonFileName, avkonPrefix, qtFileName, qtPrefix);
+            }
         }
-        return result;
+        return rl;
     }
 
     /**
      * Returns a resource loader instance.
      *
-     * @param resourceName name of the resource
-     * @param prefix prefix added before each id when retrieving
+     * @param resourceName comma separated list of resource file names
+     * @param prefix comma separated list of prefixes added before each
+     * id when retrieving
      * @return resource loader instance
      */
-    public static ResourceLoader getInstance(String resourceName, String prefix)
+    synchronized public static ResourceLoader getInstance(
+        String resourceName, String prefix)
     {
-        String key = resourceName + ":" + prefix;
-        ResourceLoader result = (ResourceLoader)resourceLoaders.get(key);
-        if (result == null)
+        if (getLocaleIdQt() == null)
         {
-            result = new ResourceLoader(resourceName, prefix);
-            resourceLoaders.put(key, result);
-        }
-        return result;
-    }
-
-    /**
-     * Private constructor. Loads localisation resource file.
-     * On Avkon UI it's resources are loaded. On Qt platfor it's
-     * resource is first read and if that fails Avkon one is read.
-     *
-     * @param avkonFileName Avkon localisation resource file.
-     * @param avkonPrefix   Avkon logical string prefix.
-     * @param qtFileName    Qt localisation resource file.
-     * @param qtPrefix      Qt logical string prefix.
-     */
-    private ResourceLoader(String avkonFileName,
-                           String avkonPrefix,
-                           String qtFileName,
-                           String qtPrefix)
-    {
-        String localeId = getLocaleIdQt();
-
-        if (localeId == null)
-        {
-            locType = AVKON;
-            prefix = avkonPrefix;
-            loadFile(avkonFileName, true);
+            return getInstance(resourceName, prefix, null, null);
         }
         else
         {
-            if (!loadFile(qtFileName, false))
-            {
-                // Fallback to Avkon
-                locType = AVKON;
-                prefix = avkonPrefix;
-                loadFile(avkonFileName, true);
-            }
-            else
-            {
-                locType = QT;
-                prefix = qtPrefix;
-            }
+            return getInstance(resourceName, prefix, resourceName, prefix);
         }
     }
 
     /**
-     * Creates resource loader, using the current locale of the environment.
+     * Get a string formatter of a given resource id.
      *
-     * @param resourceName name of the resource
-     * @param aPrefix prefix added before each id when retrieving
+     * @param id comma separated list of resource ids
+     * @return formatter instance
+     * @see Formatter
      */
-    ResourceLoader(String resourceName, String aPrefix)
-    {
-        locType = AVKON;
-        prefix = aPrefix;
-        loadFile(resourceName, true);  // Avkon
-    }
+    public abstract Formatter format(String id);
 
     /**
      * Get a string formatter of a given resource id.
@@ -155,22 +151,17 @@
      * @return formatter instance
      * @see Formatter
      */
-    public Formatter format(String id)
-    {
-        return new Formatter(string(id), locType);
-    }
+    public abstract Formatter format(Id id);
 
     /**
-     * Get a string formatter of a given resource id.
+     * Formats localised text with specified parameters from an array.
      *
-     * @param id resource id
-     * @return formatter instance
+     * @param id comma separated list of resource ids
+     * @param textParameters parameters to be filled into the text
+     * @return localised text formatted with the provided parameters
      * @see Formatter
      */
-    public Formatter format(Id id)
-    {
-        return new Formatter(string(id.getString(locType)), locType);
-    }
+    public abstract String format(String id, Object[] textParameters);
 
     /**
      * Formats localised text with specified parameters from an array.
@@ -180,32 +171,16 @@
      * @return localised text formatted with the provided parameters
      * @see Formatter
      */
-    public String format(String id, Object[] textParameters)
-    {
-        return new Formatter(string(id), locType).format(textParameters);
-    }
+    public abstract String format(Id id, Object[] textParameters);
 
     /**
-     * Formats localised text with specified parameters from an array.
-     *
-     * @param id resource id
-     * @param textParameters parameters to be filled into the text
-     * @return localised text formatted with the provided parameters
-     * @see Formatter
-     */
-    public String format(Id id, Object[] textParameters)
-    {
-        return new Formatter(string(id.getString(locType)), locType).format(textParameters);
-    }
-
-
-    /**
-     * Gets the locale ID currently being used on the phone. This can be used
-     * e.g. to load a localized icon file, by adding the locale id as suffix.
+     * Gets the locale ID currently being used on the phone.
+     * This can be used e.g. to load a localized icon file, by
+     * adding the locale id as suffix.
      *
      * @return Locale ID as provided by the platform
      */
-    public String getLocaleId()
+    public static String getLocaleId()
     {
         int localeId = _getLocaleId();
         if (localeId > 0)
@@ -230,266 +205,57 @@
      */
     public static String getLocaleIdQt()
     {
+        if (!iUiThreadExists)
+        {
+            // Do something in UI thread to ensure that it exists
+            // before _getLocaleIdQt() is called. If _getLocaleIdQt()
+            // has been called before creating QApplication,
+            // QApplication creation will panic.
+            try
+            {
+                CoreUi.runInSyncUiThread(new Runnable() {
+                    public void run()
+                    {
+                        iUiThreadExists = true;
+                    }
+                });
+            }
+            catch (Throwable t)
+            {
+                // Assume that UI thread already exists.
+                iUiThreadExists = true;
+            }
+        }
         return _getLocaleIdQt();
     }
 
+    /**
+     * Releases resources and destroys all ResourceLoader instances.
+     */
+    synchronized public static void destroyAll()
+    {
+        Enumeration e = iResourceLoaders.keys();
+        while (e.hasMoreElements())
+        {
+            String key = (String)e.nextElement();
+            ResourceLoader rl = (ResourceLoader)iResourceLoaders.get(key);
+            if (rl instanceof ResourceLoaderQt)
+            {
+                ((ResourceLoaderQt)rl).destroy();
+            }
+        }
+        iResourceLoaders.clear();
+    }
 
     /*** ----------------------------- PRIVATE ---------------------------- */
 
     /**
-     * Get a plain string resource with a given resource id.
-     *
-     * @param id resource id, either with prefix or without
-     * @return resource string, or the id if does not exist
+     * Default constructor.
      */
-    private String string(String id)
-    {
-        String str = (String)resourceMap.get(id);
-        if (str == null)
-        {
-            // Try with prefix
-            str = (String)resourceMap.get(prefix + id);
-            if (str == null)
-            {
-                // Not found even with prefix. Use the id itself
-                if (!id.startsWith(prefix))
-                {
-                    str = prefix + id;
-                }
-                else
-                {
-                    str = id;
-                }
-
-                Logger.WLOG(Logger.EUtils, "Cannot find resource: " + id);
-            }
-
-            // Put back to hash with original key for quick retrieval
-            resourceMap.put(id, str);
-        }
-
-        str = decode(str);
-        str = replaceCharacterCodes(str);
-
-        return str;
-    }
-
-    /**
-     * Loads the resources from .loc type file.
-     *
-     * @param resourceName name of the resource file.
-     * @param aIs InputStream pointing to resource. It will be closed after use.
-     * @param true if operation succeed.
-     */
-    private boolean loadFile(String resourceName, boolean avkon)
+    protected ResourceLoader()
     {
-        InputStream is = null;
-
-        if (!avkon)  // Qt resources.
-        {
-            String langName = getLocaleIdQt();
-
-            // Emulator returns falsely en_GB as engineering English locale name.
-            if (langName.equals("en_GB"))
-            {
-                langName = "en";
-            }
-
-            // Load with real locale id
-            is = this.getClass().getResourceAsStream(
-                LOC_RESOURCE_BASE + resourceName + "_" + langName + ".loc");
-
-            if (is == null)
-            {
-                /*
-                 * Does not exist. No need to continue as avkon file cannot
-                 * found using qt name.
-                 */
-                return false;
-            }
-        }
-        else  // Avkon resources.
-        {
-            // Load with real locale id
-            is = this.getClass().getResourceAsStream(
-                 LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc");
-
-            if (is == null)
-            {
-                // Load the engineering english
-                is = this.getClass().getResourceAsStream(
-                         LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc");
-            }
-            if (is == null)
-            {
-                // Load the reference engineering english
-                is = this.getClass().getResourceAsStream(
-                         LOC_RESOURCE_BASE + resourceName + ".loc");
-            }
-            if (is == null)
-            {
-                Logger.WLOG(Logger.EUtils,
-                            "Cannot load resource file: " + resourceName);
-                return false;
-            }
-        }
-
-        try
-        {
-            // Loc-files area always on UTF8 format
-            LineReader lr = new LineReader(
-                new BufferedReader(new InputStreamReader(is, "UTF-8")));
-            String line;
-
-            while ((line = lr.readLine()) != null)
-            {
-                // Ignore lines which are not #define's
-                if (!line.startsWith("#define "))
-                {
-                    continue;
-                }
-                try
-                {
-                    // Skip "#define" + any whitespace
-                    line = line.substring(line.indexOf(' ')).trim();
-
-                    int idEnd = line.indexOf(' ');
-                    String id = line.substring(0, idEnd);
-
-                    int strStart = line.indexOf('"', idEnd);
-                    int strEnd = line.lastIndexOf('"');
-                    String str = line.substring(strStart + 1, strEnd);
-
-                    resourceMap.put(id, str);
-
-                }
-                catch (IndexOutOfBoundsException ex)
-                {
-                    String error = "Incorrect line " + lr.getLineNumber() + "\"" +
-                                   line + "\"";
-                    Logger.WLOG(Logger.EUtils, error);
-                }
-            }
-            is.close();
-
-        }
-        catch (IOException ex)
-        {
-            Logger.WLOG(Logger.EUtils,
-                        "Resource file " + resourceName + " handling failed: "
-                        + ex.getMessage());
-        }
-
-        return true;
     }
 
-    /**
-     * Decode given string. Decoding means unescaping escaped characters.
-     * Currently \n, \t, \', \\ and \" patterns are decoded to respective
-     * characters.
-     *
-     * @param str to be decoded.
-     * @return decoded String.
-     */
-    private String decode(String str)
-    {
-        str = replacePattern(str, "\\n", '\n');
-        str = replacePattern(str, "\\\\", '\\');
-        str = replacePattern(str, "\\\"", '\"');
-        str = replacePattern(str, "\\t", '\t');
-        str = replacePattern(str, "\\'", '\'');
-
-        return str;
-    }
-
-    /**
-     * Replace all occurrences of the pattern in the given String.
-     *
-     * @param resource string to be replaced.
-     * @param pattern to replace.
-     * @param replacement replacement character.
-     * @return String where all occurrences of the pattern are replaced.
-     */
-    private String replacePattern(
-        String resource, String pattern, char replacement)
-    {
-        StringBuffer sb = new StringBuffer();
-
-        int startIndex = resource.indexOf(pattern);
-        if (startIndex != -1)
-        {
-            sb.append(resource.substring(0, startIndex)).append(replacement);
-            startIndex = startIndex + pattern.length();
-            int endIndex = 0;
-
-            while ((endIndex = resource.indexOf(pattern, startIndex)) != -1)
-            {
-                sb.append(resource.substring(startIndex, endIndex))
-                .append(replacement);
-                startIndex = endIndex + pattern.length();
-            }
-
-            if (startIndex < resource.length())
-            {
-                sb.append(resource.substring(startIndex, resource.length()));
-            }
-            return sb.toString();
-        }
-        return resource;
-    }
-
-    /**
-     * Replace character codes. They are given as <0x0000> format. Where 0x0000
-     * contains character unicode as hex representation.
-     *
-     * @param str to replace characters.
-     * @return String where characters are replaced.
-     */
-    private String replaceCharacterCodes(String str)
-    {
-        StringBuffer sb = new StringBuffer();
-        int startIndex = str.indexOf("<0x");
-
-        if (startIndex != -1 && str.charAt(startIndex + 7) == '>')
-        {
-            sb.append(str.substring(0, startIndex));
-            try
-            {
-                int charint = Integer.parseInt(
-                                  str.substring(startIndex + 3, startIndex + 7), 16);
-                sb.append((char) charint);
-
-                int endIndex = 0;
-                startIndex+= 7;
-
-                while ((endIndex = str.indexOf("<0x", startIndex)) != -1
-                        && str.charAt(endIndex + 7) == '>')
-                {
-                    sb.append(str.substring(startIndex + 1, endIndex));
-
-                    charint = Integer.parseInt(
-                                  str.substring(endIndex + 3, endIndex + 7), 16);
-                    sb.append((char) charint);
-                    startIndex = endIndex + 7;
-                }
-            }
-            catch (NumberFormatException nfe)
-            {
-                Logger.ELOG(Logger.EUtils,
-                            "Cannot replace character from string: " + str);
-                return str;
-            }
-
-            if (startIndex < str.length())
-            {
-                sb.append(str.substring(startIndex + 1, str.length()));
-            }
-            return sb.toString();
-        }
-        return str;
-    }
-
-
     /*** ----------------------------- NATIVE ----------------------------- */
 
     /**
@@ -497,7 +263,7 @@
      *
      * @return languege code.
      */
-    private native int _getLocaleId();
+    private static native int _getLocaleId();
 
     /**
      * Get Locale Id on Qt platform.
@@ -505,5 +271,4 @@
      * @return locale Id string. If not in Qt null.
      */
     private static native String _getLocaleIdQt();
-
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoaderAvkon.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,547 @@
+/*
+* Copyright (c) 2008-2010 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 com.nokia.mj.impl.utils;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.util.Hashtable;
+
+/**
+ * Resource loader to get localised strings and Formatter patterns.
+ * <br>
+ * Usage:
+ * <pre>
+ *   ResourceLoader res = ResourceLoader.getInstance("javainstaller", "qtn_java_installer_");
+ *   Label subjectLabel = createLabel(
+ *       res.format("subject").arg(certificate.getSubject()).toString(),
+ *       horizontalSpan, labelStyle);
+ * </pre>
+ * @see ResourceLoader
+ */
+class ResourceLoaderAvkon extends ResourceLoader
+{
+    /** Localisation resource basepath */
+    private static final String LOC_RESOURCE_BASE = "/resources/com/nokia/mj/impl/";
+
+    /**
+     * Resource string map for the resources that have been fetched
+     * at least once.
+     */
+    private Hashtable iResourceMap = new Hashtable();
+
+    /**
+     * Resource string maps for resources read from each resource file
+     * specified in comma separated list of resource file names.
+     */
+    private Hashtable[] iResourceMaps = null;
+
+    /** Resource name prefix passed when ResourceLoader is constructed. */
+    private String iPrefix = null;
+
+    /** Array of resource name prefixes. */
+    private String[] iPrefixes = null;
+
+    /** Platform localisation type. */
+    private int iLocType = -1;
+
+    /*** ----------------------------- PUBLIC ------------------------------ */
+
+    /**
+     * Returns a resource loader instance.
+     *
+     * @param avkonFileName name of the Avkon resource file
+     * @param avkonPrefix prefix added before each id when retrieving
+     * @param qtFileName name of the Qt resource file
+     * @param qtPrefix prefix added before each id when retrieving
+     * @return resource loader instance
+     */
+    public static ResourceLoader getInstance(String avkonFileName,
+                                             String avkonPrefix,
+                                             String qtFileName,
+                                             String qtPrefix)
+    {
+        // Construct key from filenames and prefixes, this is the same
+        // between platforms.
+        String key = (new StringBuffer()).append(avkonFileName).append(":")
+            .append(avkonPrefix).append(":").append(qtFileName).append(":")
+            .append(qtPrefix).toString();
+        ResourceLoader result = (ResourceLoader)iResourceLoaders.get(key);
+        if (result == null)
+        {
+            result = new ResourceLoaderAvkon(
+                avkonFileName, avkonPrefix, qtFileName, qtPrefix);
+            iResourceLoaders.put(key, result);
+        }
+        return result;
+    }
+
+    /**
+     * Returns a resource loader instance.
+     *
+     * @param resourceName comma separated list of resource file names
+     * @param prefix comma separated list of prefixes added before each
+     * id when retrieving
+     * @return resource loader instance
+     */
+    public static ResourceLoader getInstance(String resourceName, String prefix)
+    {
+        String key = resourceName + ":" + prefix;
+        ResourceLoader result = (ResourceLoader)iResourceLoaders.get(key);
+        if (result == null)
+        {
+            result = new ResourceLoaderAvkon(resourceName, prefix);
+            iResourceLoaders.put(key, result);
+        }
+        return result;
+    }
+
+    /**
+     * Get a string formatter of a given resource id.
+     *
+     * @param id comma separated list of resource ids
+     * @return formatter instance
+     * @see Formatter
+     */
+    public Formatter format(String id)
+    {
+        return new FormatterAvkon(string(id), iLocType);
+    }
+
+    /**
+     * Get a string formatter of a given resource id.
+     *
+     * @param id resource id
+     * @return formatter instance
+     * @see Formatter
+     */
+    public Formatter format(Id id)
+    {
+        return new FormatterAvkon(string(id.getString(iLocType)), iLocType);
+    }
+
+    /**
+     * Formats localised text with specified parameters from an array.
+     *
+     * @param id comma separated list of resource ids
+     * @param textParameters parameters to be filled into the text
+     * @return localised text formatted with the provided parameters
+     * @see Formatter
+     */
+    public String format(String id, Object[] textParameters)
+    {
+        return new FormatterAvkon(string(id), iLocType).format(textParameters);
+    }
+
+    /**
+     * Formats localised text with specified parameters from an array.
+     *
+     * @param id resource id
+     * @param textParameters parameters to be filled into the text
+     * @return localised text formatted with the provided parameters
+     * @see Formatter
+     */
+    public String format(Id id, Object[] textParameters)
+    {
+        return new FormatterAvkon(string(id.getString(iLocType)), iLocType).format(textParameters);
+    }
+
+
+    /*** ----------------------------- PRIVATE ---------------------------- */
+
+    /**
+     * Get a plain string resource with a given resource id.
+     *
+     * @param id resource id, either with prefix or without
+     * @return resource string, or the id if does not exist
+     */
+    private String string(String id)
+    {
+        String str = (String)iResourceMap.get(id);
+        if (str == null)
+        {
+            str = getResourceStringByList(id);
+            // Put to resource map with original key for quick retrieval.
+            str = decode(str);
+            str = replaceCharacterCodes(str);
+            iResourceMap.put(id, str);
+        }
+        return str;
+    }
+
+    /**
+     * Private constructor. Loads localisation resource file.
+     * On Avkon UI it's resources are loaded. On Qt platfor it's
+     * resource is first read and if that fails Avkon one is read.
+     *
+     * @param avkonFileName Avkon localisation resource file.
+     * @param avkonPrefix   Avkon logical string prefix.
+     * @param qtFileName    Qt localisation resource file.
+     * @param qtPrefix      Qt logical string prefix.
+     */
+    private ResourceLoaderAvkon(String avkonFileName, String avkonPrefix,
+                                String qtFileName, String qtPrefix)
+    {
+        String localeId = getLocaleIdQt();
+        if (localeId == null)
+        {
+            iLocType = AVKON;
+            setPrefix(avkonPrefix);
+            loadFiles(avkonFileName, true);
+        }
+        else
+        {
+            if (!loadFiles(qtFileName, false))
+            {
+                // Fallback to Avkon
+                iLocType = AVKON;
+                setPrefix(avkonPrefix);
+                loadFiles(avkonFileName, true);
+            }
+            else
+            {
+                iLocType = QT;
+                setPrefix(qtPrefix);
+            }
+        }
+    }
+
+    /**
+     * Creates resource loader, using the current locale of the environment.
+     *
+     * @param resourceName name of the resource
+     * @param aPrefix prefix added before each id when retrieving
+     */
+    private ResourceLoaderAvkon(String resourceName, String aPrefix)
+    {
+        iLocType = AVKON;
+        setPrefix(aPrefix);
+        loadFiles(resourceName, true); // Avkon
+    }
+
+    /**
+     * Initializes member variables according to given prefix.
+     *
+     * @param aPrefix comma separated list of text id prefixes
+     */
+    private void setPrefix(String aPrefix)
+    {
+        iPrefix = aPrefix;
+        iPrefixes = Tokenizer.split(iPrefix, SEPARATOR);
+        if (iPrefixes == null)
+        {
+            iPrefixes = new String[0];
+        }
+        for (int i = 0; i < iPrefixes.length; i++)
+        {
+            iPrefixes[i] = iPrefixes[i].trim();
+        }
+    }
+
+    /**
+     * Loads the resources from .loc type files.
+     *
+     * @param resourceNames comma separated list of resource filenames.
+     * @param avkon true if Avkon based localisation is in use
+     * @param true if operation succeed.
+     */
+    private boolean loadFiles(String resourceNames, boolean avkon)
+    {
+        if (resourceNames == null)
+        {
+            return false;
+        }
+        boolean result = false;
+        String[] filenames = Tokenizer.split(resourceNames, SEPARATOR);
+        iResourceMaps = new Hashtable[filenames.length];
+        for (int i = 0; i < filenames.length; i++)
+        {
+            iResourceMaps[i] = new Hashtable();
+            if (loadFile(filenames[i].trim(), avkon, iResourceMaps[i]))
+            {
+                // Return true if loading succeeds for at least one file.
+                result = true;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Loads the resources from .loc type file.
+     *
+     * @param resourceName name of the resource file
+     * @param avkon true if Avkon based localisation is in use
+     * @param resourceMap Map where the resources are stored to
+     * @param true if operation succeed.
+     */
+    private boolean loadFile(String resourceName, boolean avkon, Hashtable resourceMap)
+    {
+        InputStream is = null;
+
+        if (!avkon)  // Qt resources.
+        {
+            String langName = getLocaleIdQt();
+
+            // Emulator returns falsely en_GB as engineering English locale name.
+            if (langName.equals("en_GB"))
+            {
+                langName = "en";
+            }
+
+            // Load with real locale id
+            is = this.getClass().getResourceAsStream(
+                LOC_RESOURCE_BASE + resourceName + "_" + langName + ".loc");
+
+            if (is == null)
+            {
+                // Load the reference without locale id
+                is = this.getClass().getResourceAsStream(
+                         LOC_RESOURCE_BASE + resourceName + ".loc");
+            }
+            if (is == null)
+            {
+                /*
+                 * Does not exist. No need to continue as avkon file cannot
+                 * found using qt name.
+                 */
+                return false;
+            }
+        }
+        else  // Avkon resources.
+        {
+            // Load with real locale id
+            is = this.getClass().getResourceAsStream(
+                 LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc");
+
+            if (is == null)
+            {
+                // Load the engineering english
+                is = this.getClass().getResourceAsStream(
+                         LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc");
+            }
+            if (is == null)
+            {
+                // Load the reference engineering english
+                is = this.getClass().getResourceAsStream(
+                         LOC_RESOURCE_BASE + resourceName + ".loc");
+            }
+            if (is == null)
+            {
+                Logger.WLOG(Logger.EUtils,
+                            "ResourceLoaderAvkon: Cannot load resource file: " +
+                            resourceName);
+                return false;
+            }
+        }
+
+        try
+        {
+            // Loc-files area always on UTF8 format
+            LineReader lr = new LineReader(
+                new BufferedReader(new InputStreamReader(is, "UTF-8")));
+            String line;
+
+            while ((line = lr.readLine()) != null)
+            {
+                // Ignore lines which are not #define's
+                if (!line.startsWith("#define "))
+                {
+                    continue;
+                }
+                try
+                {
+                    // Skip "#define" + any whitespace
+                    line = line.substring(line.indexOf(' ')).trim();
+
+                    int idEnd = line.indexOf(' ');
+                    String id = line.substring(0, idEnd);
+
+                    int strStart = line.indexOf('"', idEnd);
+                    int strEnd = line.lastIndexOf('"');
+                    String str = line.substring(strStart + 1, strEnd);
+
+                    str = decode(str);
+                    str = replaceCharacterCodes(str);
+                    resourceMap.put(id, str);
+
+                }
+                catch (IndexOutOfBoundsException ex)
+                {
+                    String error = "ResourceLoaderAvkon: Incorrect line " +
+                        resourceName + ":" + lr.getLineNumber() + "\"" +
+                        line + "\"";
+                    Logger.WLOG(Logger.EUtils, error);
+                }
+            }
+            is.close();
+
+        }
+        catch (IOException ex)
+        {
+            Logger.WLOG(Logger.EUtils,
+                        "ResourceLoaderAvkon: Resource file " + resourceName +
+                        " handling failed: " + ex.getMessage());
+        }
+
+        return true;
+    }
+
+    /**
+     * Decode given string. Decoding means unescaping escaped characters.
+     * Currently \n, \t, \', \\ and \" patterns are decoded to respective
+     * characters.
+     *
+     * @param str to be decoded.
+     * @return decoded String.
+     */
+    private String decode(String str)
+    {
+        str = replacePattern(str, "\\n", '\n');
+        str = replacePattern(str, "\\\\", '\\');
+        str = replacePattern(str, "\\\"", '\"');
+        str = replacePattern(str, "\\t", '\t');
+        str = replacePattern(str, "\\'", '\'');
+
+        return str;
+    }
+
+    /**
+     * Replace all occurrences of the pattern in the given String.
+     *
+     * @param resource string to be replaced.
+     * @param pattern to replace.
+     * @param replacement replacement character.
+     * @return String where all occurrences of the pattern are replaced.
+     */
+    private String replacePattern(
+        String resource, String pattern, char replacement)
+    {
+        StringBuffer sb = new StringBuffer();
+
+        int startIndex = resource.indexOf(pattern);
+        if (startIndex != -1)
+        {
+            sb.append(resource.substring(0, startIndex)).append(replacement);
+            startIndex = startIndex + pattern.length();
+            int endIndex = 0;
+
+            while ((endIndex = resource.indexOf(pattern, startIndex)) != -1)
+            {
+                sb.append(resource.substring(startIndex, endIndex))
+                .append(replacement);
+                startIndex = endIndex + pattern.length();
+            }
+
+            if (startIndex < resource.length())
+            {
+                sb.append(resource.substring(startIndex, resource.length()));
+            }
+            return sb.toString();
+        }
+        return resource;
+    }
+
+    /**
+     * Replace character codes. They are given as <0x0000> format. Where 0x0000
+     * contains character unicode as hex representation.
+     *
+     * @param str to replace characters.
+     * @return String where characters are replaced.
+     */
+    private String replaceCharacterCodes(String str)
+    {
+        StringBuffer sb = new StringBuffer();
+        int startIndex = str.indexOf("<0x");
+
+        if (startIndex != -1 && str.charAt(startIndex + 7) == '>')
+        {
+            sb.append(str.substring(0, startIndex));
+            try
+            {
+                int charint = Integer.parseInt(
+                                  str.substring(startIndex + 3, startIndex + 7), 16);
+                sb.append((char) charint);
+
+                int endIndex = 0;
+                startIndex += 7;
+
+                while ((endIndex = str.indexOf("<0x", startIndex)) != -1
+                        && str.charAt(endIndex + 7) == '>')
+                {
+                    sb.append(str.substring(startIndex + 1, endIndex));
+
+                    charint = Integer.parseInt(
+                                  str.substring(endIndex + 3, endIndex + 7), 16);
+                    sb.append((char) charint);
+                    startIndex = endIndex + 7;
+                }
+            }
+            catch (NumberFormatException nfe)
+            {
+                Logger.ELOG(Logger.EUtils,
+                            "ResourceLoaderAvkon: Cannot replace character from string: " +
+                            str);
+                return str;
+            }
+
+            if (startIndex < str.length())
+            {
+                sb.append(str.substring(startIndex + 1, str.length()));
+            }
+            return sb.toString();
+        }
+        return str;
+    }
+
+    /**
+     * Get a string from resource map with a given comma
+     * separated resource id list.
+     *
+     * @param id comma separated resource id list, either with prefix or without
+     * @return resource string, or the id if does not exist
+     */
+    private String getResourceStringByList(String id)
+    {
+        String str = null;
+        String[] ids = Tokenizer.split(id, SEPARATOR);
+        for (int i = 0; i < ids.length && str == null; i++)
+        {
+            // Search text ids from resource maps.
+            for (int j = 0; j < iResourceMaps.length && str == null; j++)
+            {
+                str = (String)iResourceMaps[j].get(ids[i]);
+                if (str == null && iPrefixes != null && iPrefixes.length > j)
+                {
+                    // Try with prefix.
+                    str = (String)iResourceMaps[j].get(
+                        iPrefixes[j] + ids[i]);
+                }
+            }
+        }
+        if (str == null)
+        {
+            // Not found. Use the id itself.
+            str = id;
+            Logger.WLOG(Logger.EUtils,
+                        "ResourceLoaderAvkon: Cannot find resource: " + id +
+                        ", prefix: " + iPrefix);
+        }
+        return str;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoaderQt.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,385 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.utils;
+
+import com.nokia.mj.impl.coreui.CoreUi;
+import java.util.Hashtable;
+
+
+/**
+ * Resource loader to get localised strings and Formatter patterns.
+ * <br>
+ * Usage:
+ * <pre>
+ *   ResourceLoader res = ResourceLoader.getInstance("javaapplicationinstaller", "txt_java_inst_");
+ *   Label subjectLabel = createLabel(
+ *       res.format("subject").arg(certificate.getSubject()).toString(),
+ *       horizontalSpan, labelStyle);
+ * </pre>
+ * @see ResourceLoader
+ */
+class ResourceLoaderQt extends ResourceLoader
+{
+    /**
+     * Resource string map for the resources that have been fetched
+     * at least once.
+     */
+    private Hashtable iResourceMap = new Hashtable();
+
+    /** Resource name passed when ResourceLoader is constructed. */
+    private String iResourceName = null;
+
+    /** Array of resource names. */
+    private String[] iResourceNames = null;
+
+    /** Resource name prefix passed when ResourceLoader is constructed. */
+    private String iPrefix = null;
+
+    /** Array of resource name prefixes. */
+    private String[] iPrefixes = null;
+
+    /** Array of handles to native translator objects. */
+    private int[] iTranslators = null;
+
+    /*** ----------------------------- PUBLIC ------------------------------ */
+
+    /**
+     * Returns a resource loader instance.
+     *
+     * @param avkonFileName this parameter is ignored
+     * @param avkonPrefix this parameter is ignored
+     * @param qtFileName name of the Qt resource file
+     * @param qtPrefix prefix added before each id when retrieving
+     * @return resource loader instance
+     */
+    public static ResourceLoader getInstance(String avkonFileName,
+                                             String avkonPrefix,
+                                             String qtFileName,
+                                             String qtPrefix)
+    {
+        return getInstance(qtFileName, qtPrefix);
+    }
+
+    /**
+     * Returns a resource loader instance.
+     *
+     * @param resourceName comma separated list of resource file names
+     * @param prefix comma separated list of prefixes added before each
+     * id when retrieving
+     * @return resource loader instance
+     */
+    public static ResourceLoader getInstance(String resourceName, String prefix)
+    {
+        String key = resourceName + ":" + prefix;
+        ResourceLoader result = (ResourceLoader)iResourceLoaders.get(key);
+        if (result == null)
+        {
+            result = new ResourceLoaderQt(resourceName, prefix);
+            iResourceLoaders.put(key, result);
+        }
+        return result;
+    }
+
+    /**
+     * Get a string formatter of a given resource id.
+     *
+     * @param id comma separated list of resource ids
+     * @return formatter instance
+     * @see Formatter
+     */
+    public Formatter format(String id)
+    {
+        return new FormatterQt(this, id);
+    }
+
+    /**
+     * Get a string formatter of a given resource id.
+     *
+     * @param id resource id
+     * @return formatter instance
+     * @see Formatter
+     */
+    public Formatter format(Id id)
+    {
+        return new FormatterQt(this, id.getString(QT));
+    }
+
+    /**
+     * Formats localised text with specified parameters from an array.
+     *
+     * @param id comma separated list of resource ids
+     * @param textParameters parameters to be filled into the text
+     * @return localised text formatted with the provided parameters
+     * @see Formatter
+     */
+    public String format(String id, Object[] textParameters)
+    {
+        return new FormatterQt(this, id).format(textParameters);
+    }
+
+    /**
+     * Formats localised text with specified parameters from an array.
+     *
+     * @param id resource id
+     * @param textParameters parameters to be filled into the text
+     * @return localised text formatted with the provided parameters
+     * @see Formatter
+     */
+    public String format(Id id, Object[] textParameters)
+    {
+        return new FormatterQt(this, id.getString(QT)).format(textParameters);
+    }
+
+
+    /*** ----------------------------- PACKAGE ---------------------------- */
+
+    /**
+     * Releases resources and destroys this ResourceLoader instance.
+     */
+    void destroy()
+    {
+        deleteTranslators();
+    }
+
+    /**
+     * Get a plain string resource with a given resource id.
+     *
+     * @param id resource id, either with prefix or without
+     * @param n used to identify plural forms
+     * @return resource string, or the id if does not exist
+     */
+    synchronized String string(final String id, final int n)
+    {
+        String str = (String)iResourceMap.get(id+n);
+        if (str == null)
+        {
+            str = getResourceStringByList(id, n);
+            // Put to resource map with original key for quick retrieval.
+            iResourceMap.put(id, str+n);
+        }
+        return str;
+    }
+
+    /*** ----------------------------- PRIVATE ---------------------------- */
+
+    /**
+     * Creates resource loader, using the current locale of the environment.
+     *
+     * @param resourceName name of the resource
+     * @param aPrefix prefix added before each id when retrieving
+     */
+    private ResourceLoaderQt(String aResourceName, String aPrefix)
+    {
+        setResourceName(aResourceName);
+        setPrefix(aPrefix);
+        if (!loadTranslators())
+        {
+            throw new IllegalArgumentException(
+                "Translations not found for " + aResourceName);
+        }
+    }
+
+    /**
+     * Initializes member variables according to given resource name.
+     *
+     * @param aResourceName comma separated list of resource names
+     */
+    private void setResourceName(String aResourceName)
+    {
+        iResourceName = aResourceName;
+        iResourceNames = Tokenizer.split(iResourceName, SEPARATOR);
+        if (iResourceNames == null)
+        {
+            iResourceNames = new String[0];
+        }
+        for (int i = 0; i < iResourceNames.length; i++)
+        {
+            iResourceNames[i] = iResourceNames[i].trim();
+        }
+    }
+
+    /**
+     * Initializes member variables according to given prefix.
+     *
+     * @param aPrefix comma separated list of text id prefixes
+     */
+    private void setPrefix(String aPrefix)
+    {
+        iPrefix = aPrefix;
+        iPrefixes = Tokenizer.split(iPrefix, SEPARATOR);
+        if (iPrefixes == null)
+        {
+            iPrefixes = new String[0];
+        }
+        for (int i = 0; i < iPrefixes.length; i++)
+        {
+            iPrefixes[i] = iPrefixes[i].trim();
+        }
+    }
+
+    /**
+     * Initializes iTranslators array from given resource files.
+     *
+     * @param true if operation succeeds.
+     */
+    private boolean loadTranslators()
+    {
+        if (iResourceName == null)
+        {
+            return false;
+        }
+        iTranslators = new int[iResourceNames.length];
+        CoreUi.runInSyncUiThread(new Runnable() {
+            public void run()
+            {
+                for (int i = 0; i < iResourceNames.length; i++)
+                {
+                    iTranslators[i] = _createTranslator(iResourceNames[i]);
+                    if (iTranslators[i] < 0)
+                    {
+                        Logger.ILOG(Logger.EUtils,
+                                    "ResourceLoaderQt: Cannot load resource file " +
+                                    iResourceNames[i] + ", error: " +
+                                    iTranslators[i]);
+                    }
+                }
+            }
+        });
+        boolean result = false;
+        for (int i = 0; i < iTranslators.length; i++)
+        {
+            if (iTranslators[i] > 0)
+            {
+                // Return true if loading succeeds for at least one translator.
+                result = true;
+                break;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Deletes translator from iTranslators array.
+     */
+    private void deleteTranslators()
+    {
+        CoreUi.runInSyncUiThread(new Runnable() {
+            public void run()
+            {
+                for (int i = 0; i < iTranslators.length; i++)
+                {
+                    if (iTranslators[i] <= 0)
+                    {
+                        continue;
+                    }
+                    int result = _deleteTranslator(iTranslators[i]);
+                    if (result < 0)
+                    {
+                        Logger.WLOG(Logger.EUtils,
+                                    "ResourceLoaderQt: Deleting translator for resource " +
+                                    iResourceNames[i] + " failed, error: " +
+                                    result);
+                    }
+                }
+            }
+        });
+    }
+
+    /**
+     * Get a string with a given comma separated resource id list.
+     *
+     * @param id comma separated resource id list, either with prefix or without
+     * @param n used to identify plural forms
+     * @return resource string, or the id if does not exist
+     */
+    private String getResourceStringByList(String id, int n)
+    {
+        String str = null;
+        String[] ids = Tokenizer.split(id, SEPARATOR);
+        String strIn = null;
+        String strOut = null;
+        for (int i = 0; i < ids.length && str == null; i++)
+        {
+            for (int j = 0; j < iTranslators.length && str == null; j++)
+            {
+                if (iTranslators[j] <= 0)
+                {
+                    // Skip invalid translator handles.
+                    continue;
+                }
+                // Check if id already has prefix.
+                if (iPrefixes != null && iPrefixes.length > j &&
+                    !ids[i].startsWith(iPrefixes[j]))
+                {
+                    // Try with prefix and id.
+                    strIn = iPrefixes[j] + ids[i];
+                }
+                else
+                {
+                    // Try with id.
+                    strIn = ids[i];
+                }
+                strOut = _translate(iTranslators[j], strIn, n);
+                if (!strIn.equals(strOut))
+                {
+                    // Translation was found.
+                    str = strOut;
+                }
+            }
+        }
+        if (str == null)
+        {
+            // Not found. Use the id itself.
+            str = id;
+            Logger.WLOG(Logger.EUtils,
+                        "ResourceLoaderQt: Cannot find resource: " + id +
+                        ", prefix: " + iPrefix);
+        }
+        return str;
+    }
+
+    /*** ----------------------------- NATIVE ----------------------------- */
+
+    /**
+     * Creates native translator object.
+     *
+     * @param aResourceFilename resource filename
+     * @return handle to native side translator object, or negative
+     * error code
+     */
+    private static native int _createTranslator(String aResourceFilename);
+
+    /**
+     * Deletes native translator object.
+     *
+     * @param handle to native side translator object
+     * @return 0 if deletion was successful, or negative error code
+     */
+    private static native int _deleteTranslator(int aHandle);
+
+    /**
+     * Fetches localized text for given text id.
+     *
+     * @param aHandle translator to be used
+     * @param aId text id
+     * @param aN used to identify plural forms
+     * @return localized text, or aId if text is not found
+     */
+    private static native String _translate(int aHandle, String aId, int aN);
+}
--- a/javacommons/utils/src.s60/formatternative.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/src.s60/formatternative.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 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"
@@ -19,13 +19,11 @@
 #include <memory>
 #include <stringresourcereader.h>
 
-#ifdef RD_JAVA_UI_QT
-#include <QLocale>
-#else // RD_JAVA_UI_QT
+#ifndef RD_JAVA_UI_QT
 #include <AknUtils.h>
 #endif // RD_JAVA_UI_QT
 
-#include "com_nokia_mj_impl_utils_Formatter.h"
+#include "com_nokia_mj_impl_utils_FormatterAvkon.h"
 #include "com_nokia_mj_impl_utils_ResourceLoader.h"
 #include "javajniutils.h"
 #include "s60commonutils.h"
@@ -50,8 +48,8 @@
 using namespace java::util;
 
 
-JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_Formatter__1formatInteger
-(JNIEnv *aJni, jobject, jint aNumber)
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_FormatterAvkon__1formatInteger
+(JNIEnv *aJni, jclass, jint aNumber)
 {
     JELOG2(EUtils);
     TReal64 realNumber = aNumber;
@@ -79,8 +77,8 @@
                (const jchar*)numberPtr.Ptr(), numberPtr.Length());
 }
 
-JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_Formatter__1formatDate
-(JNIEnv * aJni, jobject, jlong timeInMillis)
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_FormatterAvkon__1formatDate
+(JNIEnv * aJni, jclass, jlong timeInMillis)
 {
     std::auto_ptr<HBufC> dateString(HBufC::New(KMaxDateFormatSize));
     if (dateString.get() == 0)
@@ -108,15 +106,8 @@
                (const jchar*)datePtr.Ptr(), datePtr.Length());
 }
 
-JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_utils_ResourceLoader__1getLocaleId
-(JNIEnv *, jobject)
-
-{
-    return (jint)User::Language();
-}
-
-JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_Formatter__1formatDigits
-  (JNIEnv * aEnv, jclass, jstring str)
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_FormatterAvkon__1formatDigits
+(JNIEnv * aEnv, jclass, jstring str)
 {
     jstring ret = str;
     std::wstring wstr = JniUtils::jstringToWstring(aEnv, str);
@@ -131,15 +122,8 @@
     return ret;
 }
 
-JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_ResourceLoader__1getLocaleIdQt
-  (JNIEnv *env, jclass)
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_utils_ResourceLoader__1getLocaleId
+(JNIEnv *, jclass)
 {
-#ifdef RD_JAVA_UI_QT
-    QString localeName = QLocale::system().name();
-    jstring loc = env->NewString(localeName.utf16(), localeName.size());
-    return loc;
-#else // RD_JAVA_UI_QT
-    (void)env;     // just to suppress a warning
-    return NULL;
-#endif // RD_JAVA_UI_QT
+    return (jint)User::Language();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/src/formatterqtnative.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2010 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: formatterqtnative
+*
+*/
+
+
+#ifdef RD_JAVA_UI_QT
+#include <qcoreapplication.h>
+#include <qlibraryinfo.h>
+#include <qlocale.h>
+#include <qtranslator.h>
+#ifdef __SYMBIAN32__
+#include <hbparameterlengthlimiter.h>
+#include <hbstringutil.h>
+#else // __SYMBIAN32__
+// If HbParameterLengthLimiter is not available, define it as empty macro.
+#define HbParameterLengthLimiter(text) (text)
+#endif // __SYMBIAN32__
+#endif // RD_JAVA_UI_QT
+
+#include "com_nokia_mj_impl_utils_FormatterQt.h"
+#include "com_nokia_mj_impl_utils_ResourceLoader.h"
+#include "com_nokia_mj_impl_utils_ResourceLoaderQt.h"
+#include "javajniutils.h"
+#include "logger.h"
+
+#ifdef __SYMBIAN32__
+#include "s60commonutils.h"
+#else // __SYMBIAN32__
+#define KErrNone (0)
+#define KErrNotFound (-1)
+#endif // __SYMBIAN32__
+
+using namespace java::util;
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_ResourceLoader__1getLocaleIdQt
+(JNIEnv *env, jclass)
+{
+#ifdef RD_JAVA_UI_QT
+    QString localeName = QLocale::system().name();
+    jstring loc = env->NewString(localeName.utf16(), localeName.size());
+    return loc;
+#else // RD_JAVA_UI_QT
+    (void)env;     // just to suppress a warning
+    return NULL;
+#endif // RD_JAVA_UI_QT
+}
+
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_utils_ResourceLoaderQt__1createTranslator
+(JNIEnv *aEnv, jclass, jstring aResourceName)
+{
+#ifdef RD_JAVA_UI_QT
+    QString resourceName = QString::fromStdWString(
+        JniUtils::jstringToWstring(aEnv, aResourceName)) +
+        "_" + QLocale::system().name();
+
+    if (qApp == 0)
+    {
+        ELOG1(EUtils,
+              "ResourceLoaderQt__1createTranslator: QApplication "
+              "does not exist. Loading failed for %S",
+             resourceName.toStdWString().c_str());
+        return KErrNotFound;
+    }
+
+    QTranslator* translator = new QTranslator();
+    bool translatorLoaded = translator->load(
+        resourceName, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+    if (!translatorLoaded)
+    {
+        translatorLoaded = translator->load(
+            resourceName,
+            "C:" + QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+    }
+    if (!translatorLoaded)
+    {
+        translatorLoaded = translator->load(
+            resourceName,
+            "Z:" + QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+    }
+    if (translatorLoaded)
+    {
+        qApp->installTranslator(translator);
+    }
+    else
+    {
+        ILOG1(EUtils, "__1createTranslator: loading resource %S failed",
+              resourceName.toStdWString().c_str());
+        delete translator;
+        return KErrNotFound;
+    }
+    // Return handle to translator.
+    return reinterpret_cast<unsigned int>(translator)>>2;
+#else // RD_JAVA_UI_QT
+    (void)aEnv; // just to suppress a warning
+    (void)aResourceName; // just to suppress a warning
+    return KErrNone;
+#endif // RD_JAVA_UI_QT
+}
+
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_utils_ResourceLoaderQt__1deleteTranslator
+(JNIEnv *, jclass, jint aHandle)
+{
+#ifdef RD_JAVA_UI_QT
+    QTranslator *pTranslator = reinterpret_cast<QTranslator*>(aHandle<<2);
+    QCoreApplication::removeTranslator(pTranslator);
+    delete pTranslator;
+    return KErrNone;
+#else // RD_JAVA_UI_QT
+    (void)aHandle; // just to suppress a warning
+    return KErrNone;
+#endif // RD_JAVA_UI_QT
+}
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_ResourceLoaderQt__1translate
+(JNIEnv *aEnv, jclass, jint aHandle, jstring aId, jint aN)
+{
+#ifdef RD_JAVA_UI_QT
+    (void)aHandle; // just to suppress a warning
+    QString id = QString::fromStdWString(JniUtils::jstringToWstring(aEnv, aId));
+    QString result = QString(qtTrId(id.toUtf8().constData(), aN));
+    return aEnv->NewString(result.utf16(), result.size());
+#else // RD_JAVA_UI_QT
+    (void)aEnv; // just to suppress a warning
+    (void)aHandle; // just to suppress a warning
+    (void)aId; // just to suppress a warning
+    (void)aN; // just to suppress a warning
+    return aId;
+#endif // RD_JAVA_UI_QT
+}
+
+#ifdef RD_JAVA_UI_QT
+QString FormatTextArg(JNIEnv *aEnv, QString aText, jobjectArray aArgs, int aI)
+{
+    // Check the type of aArgs[aI] and call correct aText.arg() method.
+    jobject obj = aEnv->GetObjectArrayElement(aArgs, aI);
+    jclass clazz = aEnv->FindClass("java/lang/String");
+    if (aEnv->IsInstanceOf(obj, clazz))
+    {
+        return HbParameterLengthLimiter(aText).arg(
+            QString::fromStdWString(
+                JniUtils::jstringToWstring(aEnv, (jstring)obj)));
+    }
+    clazz = aEnv->FindClass("java/lang/Integer");
+    if (aEnv->IsInstanceOf(obj, clazz))
+    {
+        jmethodID method = aEnv->GetMethodID(clazz, "intValue", "()I");
+        return HbParameterLengthLimiter(aText).arg(
+            aEnv->CallIntMethod(obj, method));
+    }
+    clazz = aEnv->FindClass("java/lang/Character");
+    if (aEnv->IsInstanceOf(obj, clazz))
+    {
+        jmethodID method = aEnv->GetMethodID(clazz, "charValue", "()C");
+        return HbParameterLengthLimiter(aText).arg(
+            (char)aEnv->CallCharMethod(obj, method));
+    }
+    clazz = aEnv->FindClass("java/util/Calendar");
+    if (aEnv->IsInstanceOf(obj, clazz))
+    {
+        jmethodID method = aEnv->GetMethodID(clazz, "get", "(I)I");
+        int year = aEnv->CallIntMethod(obj, method, 1); // Calendar.YEAR
+        int month = aEnv->CallIntMethod(obj, method, 2) + 1; // Calendar.MONTH
+        int day = aEnv->CallIntMethod(obj, method, 5); // Calendar.DAY_OF_MONTH
+        QDate date(year, month, day);
+        QLocale locale;
+        return HbParameterLengthLimiter(aText).arg(
+            locale.toString(date, QLocale::ShortFormat));
+    }
+    return aText;
+}
+#endif // RD_JAVA_UI_QT
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_FormatterQt__1formatParameters
+(JNIEnv *aEnv, jclass, jstring aText, jobjectArray aArgs)
+{
+#ifdef RD_JAVA_UI_QT
+    std::wstring wsText = JniUtils::jstringToWstring(aEnv, aText);
+    QString text = QString::fromStdWString(wsText);
+    int argsLen = aEnv->GetArrayLength(aArgs);
+    for (int i = 0; i < argsLen; i++)
+    {
+        text = FormatTextArg(aEnv, text, aArgs, i);
+    }
+    return aEnv->NewString(text.utf16(), text.size());
+#else // RD_JAVA_UI_QT
+    (void)aEnv; // just to suppress a warning
+    (void)aText; // just to suppress a warning
+    (void)aArgs; // just to suppress a warning
+    return aText;
+#endif // RD_JAVA_UI_QT
+}
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_FormatterQt__1formatDigits
+(JNIEnv * aEnv, jclass, jstring aText)
+{
+    jstring ret = aText;
+#if defined(RD_JAVA_UI_QT) && defined(__SYMBIAN32__)
+    QString text = QString::fromStdWString(
+        JniUtils::jstringToWstring(aEnv, aText));
+    text = HbStringUtil::convertDigits(text);
+    ret = aEnv->NewString(text.utf16(), text.size());
+#else // RD_JAVA_UI_QT && __SYMBIAN32__
+    (void)aEnv; // just to suppress a warning
+#endif // RD_JAVA_UI_QT && __SYMBIAN32__
+    return ret;
+}
--- a/javacommons/utils/tsrc/build/java/build.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/tsrc/build/java/build.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -18,39 +18,45 @@
 
 <project name="javacommonutilstest" basedir="." default="deploy">
 
-  <import file="../../../../../build/utilities.xml"/>
-  <property file="../../../../../build/unittest.properties"/>
+                  <import file="../../../../../build/utilities.xml"/>
 
-  <property name="java.src.paths" value="../../javasrc"/>
-  <property name="java.bin.root" value="${env.JAVA_BIN_ROOT}"/>
+                               <property name="java.src.paths" value="../../javasrc"/>
+                                       <property name="java.bin.root" value="${env.JAVA_BIN_ROOT}"/>
+
+                                               <property name="javah.classnames"
+                                                       value="com.nokia.mj.impl.rt.support.JvmPortTest"/>
 
-  <target name="run" depends="deploy">
-      <echo>Running BufferedReaderTests</echo>
-      <exec executable="${java.bin.root}/bin/javaunittester">
-          <arg line="-mainclass=com.nokia.mj.impl.utils.BufferedReaderTests"/>
-      </exec>
+                                                               <target name="compile">
+                                                                       <omj.javac classpath="${compile.result.root}/javautils/classes/first"/>
+                                                                               </target>
 
-      <echo>Running ConcurrencyTests</echo>
-      <exec executable="${java.bin.root}/bin/javaunittester">
-          <arg line="-mainclass=com.nokia.mj.impl.utils.concurrent.ConcurrentTests"/>
-      </exec>
+                                                                               <target name="run" depends="deploy">
+                                                                                       <echo>Running BufferedReaderTests</echo>
+                                                                                       <exec executable="${java.bin.root}/bin/javaunittester">
+                                                                                               <arg line="-mainclass=com.nokia.mj.impl.utils.BufferedReaderTests"/>
+                                                                                                       </exec>
 
-      <echo>Running SystemPropertyTests</echo>
-      <exec executable="${java.bin.root}/bin/javaunittester">
-          <arg line="-mainclass=com.nokia.mj.impl.rt.SystemPropertyTests"/>
-      </exec>
+                                                                                                       <echo>Running ConcurrencyTests</echo>
+                                                                                                       <exec executable="${java.bin.root}/bin/javaunittester">
+                                                                                                               <arg line="-mainclass=com.nokia.mj.impl.utils.concurrent.ConcurrentTests"/>
+                                                                                                                       </exec>
 
-      <echo>Running DebugUtilsTests tests</echo>
-      <exec executable="${java.bin.root}/bin/javaunittester">
-          <arg line="-mainclass=com.nokia.mj.impl.utils.DebugUtilsTests"/>
-      </exec>
+                                                                                                                       <echo>Running SystemPropertyTests</echo>
+                                                                                                                       <exec executable="${java.bin.root}/bin/javaunittester">
+                                                                                                                               <arg line="-mainclass=com.nokia.mj.impl.rt.SystemPropertyTests"/>
+                                                                                                                                       </exec>
 
-      <echo>Running LoggerTests tests</echo>
-      <exec executable="${java.bin.root}/bin/javaunittester">
-          <arg line="-mainclass=com.nokia.mj.impl.utils.LoggerTests"/>
-      </exec>
-  </target>
+                                                                                                                                       <echo>Running DebugUtilsTests tests</echo>
+                                                                                                                                       <exec executable="${java.bin.root}/bin/javaunittester">
+                                                                                                                                               <arg line="-mainclass=com.nokia.mj.impl.utils.DebugUtilsTests"/>
+                                                                                                                                                       </exec>
 
-  <target name="main" depends="clean,run"/>
+                                                                                                                                                       <echo>Running LoggerTests tests</echo>
+                                                                                                                                                       <exec executable="${java.bin.root}/bin/javaunittester">
+                                                                                                                                                               <arg line="-mainclass=com.nokia.mj.impl.utils.LoggerTests"/>
+                                                                                                                                                                       </exec>
+                                                                                                                                                                       </target>
 
-</project>
+                                                                                                                                                                       <target name="main" depends="clean,run"/>
+
+                                                                                                                                                                               </project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/build/java/bwins/javacommonutilstestu.def	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,2 @@
+EXPORTS
+	?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
--- a/javacommons/utils/tsrc/build/java/dummy.pro	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#
-# Copyright (c) 2010 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 dummy pro file for generating a Jar file. Keeping
-#              build system happy.
-#
-
-TEMPLATE = subdirs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/build/java/eabi/javacommonutilstestu.def	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,2 @@
+EXPORTS
+	_Z10jni_lookupPKc @ 1 NONAME
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/build/java/javacommonutilstest.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2010 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:
+#
+
+TEMPLATE=lib
+TARGET=javacommonutilstest
+CONFIG += omj java staticdata stl
+CONFIG -= qt
+
+include(../../../../../inc/build_defines.pri)
+
+symbian {
+    TARGET.UID3 = 0xE0045056
+}
+
+SOURCES += ../../testdll/src/*.cpp
+
+include(../../../../../build/omj.pri)
--- a/javacommons/utils/tsrc/build/native/exports.inf	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/tsrc/build/native/exports.inf	Fri Oct 15 12:29:39 2010 +0300
@@ -19,5 +19,7 @@
 
 #include "../../../inc/build_defines.hrh"
 #ifdef RD_JAVA_SYMBIAN_TARGET
+../../jvmportapp.jar        /epoc32/winscw/c/java/jvmportapp.jar
+../../jvmportapp2.jar        /epoc32/winscw/c/java/jvmportapp2.jar
 ../../tst.bat        /epoc32/winscw/c/tst.bat
 #endif // RD_JAVA_SYMBIAN_TARGET
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/ApplicationInfoTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+
+
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+import com.nokia.mj.impl.rt.test.ApplicationInfoImpl;
+import j2meunit.framework.Test;
+import j2meunit.framework.TestCase;
+import j2meunit.framework.TestMethod;
+import j2meunit.framework.TestSuite;
+
+/**
+ * ApplicationInfo unit tests.
+ */
+public class ApplicationInfoTest extends TestCase implements UnitTestSuiteCreator
+{
+
+    // Begin j2meunit test framework setup
+    public TestSuite createTestSuite(String[] args)
+    {
+        TestSuite suite = new TestSuite(this.getClass().getName());
+
+        String testSelector = "0000000000000000";
+        if (args.length > 1 && args[1] != null)
+        {
+            testSelector = args[1]  + "0000000000000000";
+        }
+
+
+        if (testSelector.charAt(0) == '0')
+        {
+            suite.addTest(new ApplicationInfoTest("testAppInfo", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationInfoTest)tc).testAppInfo();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new ApplicationInfoTest("testAppInfoNotExist", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationInfoTest)tc).testAppInfoNotExist();
+                }
+            }));
+        }
+
+        return suite;
+
+    }
+
+    public ApplicationInfoTest()
+    {
+    }
+
+    public ApplicationInfoTest(String aTestName, TestMethod aTestMethod)
+    {
+        super(aTestName, aTestMethod);
+    }
+
+    // End j2meunit test framework setup
+
+    protected void setUp()
+    {
+    }
+
+    protected void tearDown()
+    {
+    }
+
+    // Test cases
+
+    private void check(String excpected, String received)
+    {
+        assertTrue("Expected: "+ excpected + ", Received: " + received,
+                   excpected.equals(received));
+    }
+
+    private void testAppInfo()
+    {
+        try
+        {
+            ApplicationInfo appInfo = ApplicationInfo.getInstance();
+            check(appInfo.getRuntimeType(), ApplicationInfoImpl.TEST_RT_TYPE);
+            check(appInfo.getProtectionDomain(), ApplicationInfoImpl.TEST_PROTECTION_DOMAIN);
+            check(appInfo.getUid().toString(), ApplicationInfoImpl.TEST_APP_UID.toString());
+            check(appInfo.getSuiteUid().toString(), ApplicationInfoImpl.TEST_APP_SUITE_UID.toString());
+            check(appInfo.getSuiteName(), ApplicationInfoImpl.TEST_APP_SUITE_NAME);
+            check(appInfo.getName(), ApplicationInfoImpl.TEST_APP_NAME);
+            check(appInfo.getVendor(), ApplicationInfoImpl.TEST_APP_VENDOR);
+            check(appInfo.getVersion(), ApplicationInfoImpl.TEST_APP_VERSION);
+            check(appInfo.getRootPath(), ApplicationInfoImpl.TEST_PATH);
+            check(appInfo.getMainClass(), ApplicationInfoImpl.MAIN_CLASS);
+            check(appInfo.getAttribute(ApplicationInfoImpl.TEST_KEY), ApplicationInfoImpl.TEST_VALUE);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testAppInfoNotExist()
+    {
+        try
+        {
+            ApplicationInfo.getInstance().getSuiteName();
+            assertTrue("No exception.", false);
+        }
+        catch (Error re)
+        {
+            int ind = re.toString().indexOf("Not able to instantiate class com.nokia.mj.impl.rt.test2.ApplicationInfoImpl");
+            boolean ok = ind >= 0;
+            if (!ok)
+            {
+                // Accept also java.lang.ExceptionInInitializerError.
+                ok = re.toString().equals("java.lang.ExceptionInInitializerError");
+            }
+            assertTrue(re.toString(),  ok);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtilsTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,491 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+import java.security.Permission;
+
+
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
+import com.nokia.mj.impl.rt.support.ShutdownListener;
+import com.nokia.mj.impl.rt.support.ApplicationUtils;
+import com.nokia.mj.impl.rt.test.ApplicationUtilsImpl;
+import com.nokia.mj.impl.utils.Uid;
+
+import j2meunit.framework.Test;
+import j2meunit.framework.TestCase;
+import j2meunit.framework.TestMethod;
+import j2meunit.framework.TestSuite;
+
+
+
+/**
+ * ApplicationUtils unit tests.
+ */
+public class ApplicationUtilsTest extends TestCase implements UnitTestSuiteCreator
+{
+
+    // Begin j2meunit test framework setup
+    public TestSuite createTestSuite(String[] args)
+    {
+        TestSuite suite = new TestSuite(this.getClass().getName());
+        String testSelector = "0000000000000000";
+        if (args.length > 1 && args[1] != null)
+        {
+            testSelector = args[1]  + "0000000000000000";
+        }
+
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new ApplicationUtilsTest("testShutdowListeners", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testShutdowListeners();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(1) != '0')
+        {
+            suite.addTest(new ApplicationUtilsTest("testShutdowListeners 2", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testShutdowListeners2();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(2) != '0')
+        {
+            suite.addTest(new ApplicationUtilsTest("testOtherCalls", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testOtherCalls();
+                }
+            }));
+        }
+
+
+        if (testSelector.charAt(3) != '0')
+        {
+            suite.addTest(new ApplicationUtilsTest("testEmptyWaiter", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testEmptyWaiter();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(4) != '0')
+        {
+
+            suite.addTest(new ApplicationUtilsTest("testWaiter", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testWaiter();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(5) != '0')
+        {
+
+            suite.addTest(new ApplicationUtilsTest("testWaiterNoStart", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testWaiterNoStart();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(6) != '0')
+        {
+
+            suite.addTest(new ApplicationUtilsTest("testWaiterNotifyBeforeStart", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testWaiterNotifyBeforeStart();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(7) != '0')
+        {
+
+            suite.addTest(new ApplicationUtilsTest("testAppUtilsNotExist", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((ApplicationUtilsTest)tc).testAppUtilsNotExist();
+                }
+            }));
+        }
+
+        return suite;
+
+    }
+
+    public ApplicationUtilsTest()
+    {
+    }
+
+    public ApplicationUtilsTest(String aTestName, TestMethod aTestMethod)
+    {
+        super(aTestName, aTestMethod);
+    }
+
+    // End j2meunit test framework setup
+
+    protected void setUp()
+    {
+    }
+
+    protected void tearDown()
+    {
+    }
+
+    private static class ShutdownListenerImpl implements ShutdownListener
+    {
+        public int mShutDownCallCount = 0;
+        public void shuttingDown()
+        {
+            mShutDownCallCount++;
+        }
+    }
+    // Test cases
+
+    private void testShutdowListeners()
+    {
+        try
+        {
+            final int count = 25;
+            ApplicationUtils appUtils = ApplicationUtils.getInstance();
+            ShutdownListenerImpl[] sls = new ShutdownListenerImpl[count];
+            for (int i = 0; i < count; ++i)
+            {
+                sls[i] = new ShutdownListenerImpl();
+                appUtils.addShutdownListener(sls[i]);
+            }
+            ApplicationUtilsImpl.doShutdownImpl();
+            for (int i = 0; i < count; ++i)
+            {
+                assertTrue(i + " call count incorrect: "+ sls[i].mShutDownCallCount,
+                           sls[i].mShutDownCallCount == 1);
+            }
+
+            for (int i = 0; i < count; ++i)
+            {
+                sls[i] = new ShutdownListenerImpl();
+                appUtils.addShutdownListener(sls[i]);
+            }
+            appUtils.removeShutdownListener(sls[count-1]);
+            ApplicationUtilsImpl.doShutdownImpl();
+            for (int i = 0; i < count - 1; ++i)
+            {
+                assertTrue(i + " call count incorrect: "+ sls[i].mShutDownCallCount,
+                           sls[i].mShutDownCallCount == 1);
+            }
+            assertTrue((count -1) + " call count incorrect: "+ sls[count -1].mShutDownCallCount,
+                       sls[count -1].mShutDownCallCount == 0);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testShutdowListeners2()
+    {
+        try
+        {
+            ApplicationUtils appUtils = ApplicationUtils.getInstance();
+            appUtils.removeShutdownListener(new ShutdownListenerImpl());
+            try
+            {
+                appUtils.removeShutdownListener(null);
+                assertTrue("No exception: ", false);
+            }
+            catch (NullPointerException ne)
+            {
+            }
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void checkCallCounts(String info, int ind)
+    {
+        assertTrue("ApplicationUtils." + info + " failed " + ApplicationUtilsImpl.print(),
+                   ApplicationUtilsImpl.checkCalls(ind));
+    }
+
+    public class TestPermission extends Permission
+    {
+
+        public TestPermission()
+        {
+            super("TestPermission");
+        }
+
+        public String getActions()
+        {
+            return "TestPermission Actions";
+        }
+
+        public boolean equals(Object obj)
+        {
+            return false;
+        }
+
+        public int hashCode()
+        {
+            return 0;
+        }
+        public boolean implies(Permission permission)
+        {
+            return true;
+        }
+    }
+
+    private void testOtherCalls()
+    {
+        try
+        {
+            ApplicationUtils appUtils = ApplicationUtils.getInstance();
+            appUtils.notifyExitCmd();
+            checkCallCounts("notifyExitCmd()", ApplicationUtilsImpl.NOTIFY_CALL);
+
+            ApplicationUtilsImpl.clear();
+            appUtils.uiDisposed();
+            checkCallCounts("uiDisposed()", ApplicationUtilsImpl.UI_DISPOSED_CALL);
+
+            ApplicationUtilsImpl.clear();
+            appUtils.pauseApplication();
+            checkCallCounts("pauseApplication()", ApplicationUtilsImpl.PAUSE_CALL);
+
+            ApplicationUtilsImpl.clear();
+            appUtils.pauseApplication();
+            checkCallCounts("pauseApplication()", ApplicationUtilsImpl.PAUSE_CALL);
+
+            ApplicationUtilsImpl.clear();
+            appUtils.resumeApplication();
+            checkCallCounts("resumeApplication()", ApplicationUtilsImpl.RESUME_CALL);
+
+            ApplicationUtilsImpl.clear();
+            Permission p1 = new TestPermission();
+            appUtils.checkPermission(p1);
+            assertTrue("ApplicationUtils.checkPermission(Permission) failed ",
+                       p1 == ApplicationUtilsImpl.mPermission);
+            checkCallCounts("checkPermission()", ApplicationUtilsImpl.PERMISSION_CALL1);
+
+            Permission p2 = new TestPermission();
+            Uid uid = Uid.createUid("[12345678]");
+            ApplicationUtilsImpl.clear();
+            appUtils.checkPermission(uid, p2);
+            checkCallCounts("checkPermission2()", ApplicationUtilsImpl.PERMISSION_CALL2);
+            assertTrue("ApplicationUtils.checkPermission(Permission2) failed ",
+                       p2 == ApplicationUtilsImpl.mPermission);
+
+            assertTrue("ApplicationUtils.checkPermission(Uid) failed ",
+                       uid.equals(ApplicationUtilsImpl.mUid));
+
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private static class TestWaiter extends Thread
+    {
+        private static TestWaiter[] mTestWaiters;
+        private boolean mWasReleased = false;
+        private Boolean mCanContinue = null;
+
+        private static void createWaiters(int count)
+        {
+            mTestWaiters = new TestWaiter[count];
+            for (int i = 0; i < mTestWaiters.length; ++i)
+            {
+                mTestWaiters[i] = new TestWaiter();
+                mTestWaiters[i].start();
+            }
+        }
+
+        private static boolean check(boolean canContinue)
+        {
+            for (int i = 0; i < mTestWaiters.length; ++i)
+            {
+                if (!mTestWaiters[i].mWasReleased)
+                {
+                    System.err.println("ID " + i + ": " + mTestWaiters[i].toString());
+                    return false;
+                }
+                if (mTestWaiters[i].mCanContinue == null ||
+                        mTestWaiters[i].mCanContinue.booleanValue() != canContinue)
+                {
+                    System.err.println("ID " + i + ": " + mTestWaiters[i].toString());
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        private static boolean checkWaiting(boolean isWaiting)
+        {
+            for (int i = 0; i < mTestWaiters.length; ++i)
+            {
+                if (mTestWaiters[i].mWasReleased == isWaiting)
+                {
+                    System.err.println("ID " + i + ": " + mTestWaiters[i].toString());
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        public String toString()
+        {
+            StringBuffer sb = new StringBuffer();
+            sb.append("State: \n");
+            sb.append("  mWasReleased " + mWasReleased);
+            sb.append("\n  mCanContinue " + mCanContinue);
+            return sb.toString();
+        }
+
+        public void run()
+        {
+            boolean canContinue = ApplicationUtils.getInstance().waitStart();
+            mCanContinue = new Boolean(canContinue);
+            mWasReleased = true;
+        }
+    }
+
+    private void testEmptyWaiter()
+    {
+        try
+        {
+            ApplicationUtilsImpl.releaseWaiterImpl(true);
+            ApplicationUtilsImpl.releaseWaiterImpl(false);
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testWaiter()
+    {
+        try
+        {
+            TestWaiter.createWaiters(5);
+            Thread.sleep(100);
+            assertTrue("releaseWaiterImpl(true) not waiting.", TestWaiter.checkWaiting(true));
+            ApplicationUtilsImpl.releaseWaiterImpl(true);
+            Thread.sleep(100);
+            assertTrue("releaseWaiterImpl(true) failed.", TestWaiter.check(true));
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testWaiterNoStart()
+    {
+        try
+        {
+            TestWaiter.createWaiters(5);
+            Thread.sleep(100);
+            assertTrue("releaseWaiterImpl(true) not waiting.", TestWaiter.checkWaiting(true));
+            ApplicationUtilsImpl.releaseWaiterImpl(false);
+            Thread.sleep(100);
+            assertTrue("releaseWaiterImpl(true) failed.", TestWaiter.check(false));
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testWaiterNotifyBeforeStart()
+    {
+        try
+        {
+            ApplicationUtilsImpl.releaseWaiterImpl(true);
+            TestWaiter.createWaiters(5);
+            Thread.sleep(100);
+            assertTrue("releaseWaiterImpl(true) not waiting.", TestWaiter.checkWaiting(false));
+            assertTrue("releaseWaiterImpl(true) failed.", TestWaiter.check(true));
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testAppUtilsNotExist()
+    {
+        try
+        {
+            ApplicationUtilsImpl.releaseWaiterImpl(true);
+            assertTrue("No exception.", false);
+        }
+        catch (Error re)
+        {
+            int ind = re.toString().indexOf("Not able to instantiate class com.nokia.mj.impl.rt.test2.ApplicationUtilsImpl");
+            boolean ok = ind >= 0;
+            if (!ok)
+            {
+                // Accept also java.lang.ExceptionInInitializerError.
+                ok = re.toString().equals("java.lang.ExceptionInInitializerError");
+            }
+            assertTrue(re.toString(),  ok);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+
+    }
+
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/FinalizableBase.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+abstract class FinalizableBase
+{
+    private Finalizer mFinalizer;
+
+    protected FinalizableBase()
+    {
+        FinalizerStatistics.finalizableCreated(getClass().getName());
+        mFinalizer = new Finalizer()
+        {
+            public void finalizeImpl()
+            {
+                doFinalize();
+            }
+        };
+    }
+
+    void doFinalize()
+    {
+        if (mFinalizer != null)
+        {
+            mFinalizer = null;
+            FinalizerStatistics.classFinalized(getClass().getName());
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/FinalizerStatistics.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+import java.util.Hashtable;
+import java.util.Enumeration;
+
+class FinalizerStatistics
+{
+    private static Hashtable mReferences = new Hashtable();
+
+    private static final boolean mTrace = false;
+    private static class Refcount
+    {
+        int    mCount;
+        String mClassName;
+
+        private Refcount(String className)
+        {
+            mCount = 1;
+            mClassName = className;
+        }
+    }
+
+    public static void finalizableCreated(String className)
+    {
+        synchronized (mReferences)
+        {
+            Refcount r = (Refcount)mReferences.get(className);
+            int count = 1;
+            if (r != null)
+            {
+                r.mCount++;
+                count = r.mCount;
+            }
+            else
+            {
+                mReferences.put(className, new Refcount(className));
+            }
+            if (mTrace) System.out.println("Finalizable created. name: " +
+                                               className + ", count: " + count);
+        }
+    }
+
+    public static void classFinalized(String className)
+    {
+        synchronized (mReferences)
+        {
+            Refcount r = (Refcount)mReferences.get(className);
+            r.mCount--;
+            if (mTrace) System.out.println("Finalizable destroyed. name: " +
+                                               className + ", count: " + r.mCount);
+        }
+    }
+
+    public static boolean getNonfinalizedObjects(StringBuffer sb)
+    {
+        synchronized (mReferences)
+        {
+            sb.append("Finalizable objects\n");
+            Enumeration e = mReferences.elements();
+            boolean allFinalized = true;
+            while (e.hasMoreElements())
+            {
+                Refcount r = (Refcount)e.nextElement();
+
+                if (r != null)
+                {
+                    if (r.mCount != 0)
+                    {
+                        allFinalized = false;
+                    }
+                    sb.append("  class=" + r.mClassName +
+                              " count="  + r.mCount + "\n");
+                }
+            }
+            sb.append("\nStatus ");
+            if (allFinalized)
+            {
+                sb.append("ALL FINALIZED");
+            }
+            else
+            {
+                sb.append("OBJECTS WAITING FOR FINALIZATION");
+            }
+            if (mTrace) System.out.println(sb.toString());
+
+            return allFinalized;
+        }
+    }
+
+    public static void reset()
+    {
+        mReferences.clear();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/FinalizerTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+
+
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
+import j2meunit.framework.Test;
+import j2meunit.framework.TestCase;
+import j2meunit.framework.TestMethod;
+import j2meunit.framework.TestSuite;
+
+import com.nokia.mj.impl.rt.support.JvmInternal;
+
+/**
+ * Finalizer unit tests.
+ */
+public class FinalizerTest extends TestCase implements UnitTestSuiteCreator
+{
+
+    // Begin j2meunit test framework setup
+    public TestSuite createTestSuite(String[] args)
+    {
+        TestSuite suite = new TestSuite(this.getClass().getName());
+
+        suite.addTest(new FinalizerTest("testFinalizerSingleClass", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((FinalizerTest)tc).testFinalizerSingleClass();
+            }
+        }));
+
+        suite.addTest(new FinalizerTest("testFinalizerManyClassesSingleObject", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((FinalizerTest)tc).testFinalizerManyClassesSingleObject();
+            }
+        }));
+
+        suite.addTest(new FinalizerTest("testFinalizerManyClasses", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((FinalizerTest)tc).testFinalizerManyClasses();
+            }
+        }));
+
+        return suite;
+    }
+
+    public FinalizerTest()
+    {
+    }
+
+    public FinalizerTest(String aTestName, TestMethod aTestMethod)
+    {
+        super(aTestName, aTestMethod);
+    }
+
+    // End j2meunit test framework setup
+
+    protected void setUp()
+    {
+    }
+
+    protected void tearDown()
+    {
+    }
+
+    // Test cases
+
+    private static class Test1 extends FinalizableBase
+    {
+    }
+
+    private static class Test2 extends FinalizableBase
+    {
+    }
+
+    private static class Test3 extends FinalizableBase
+    {
+    }
+
+    private static class Test4 extends FinalizableBase
+    {
+    }
+
+    private static class Test5 extends FinalizableBase
+    {
+    }
+
+    private static class Test6 extends FinalizableBase
+    {
+    }
+
+    private void testFinalizerSingleClass()
+    {
+        try
+        {
+            new Test1();
+            System.gc();
+            JvmInternal.runFinalization();
+            StringBuffer sb = new StringBuffer();
+            boolean ok = FinalizerStatistics.getNonfinalizedObjects(sb);
+            assertTrue(sb.toString(), ok);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+    private void testFinalizerManyClassesSingleObject()
+    {
+        try
+        {
+            new Test1();
+            new Test2();
+            new Test3();
+            new Test4();
+            new Test5();
+            new Test6();
+            System.gc();
+            JvmInternal.runFinalization();
+            StringBuffer sb = new StringBuffer();
+            boolean ok = FinalizerStatistics.getNonfinalizedObjects(sb);
+            assertTrue(sb.toString(), ok);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testFinalizerManyClasses()
+    {
+        try
+        {
+            for (int i = 0; i < 10; ++i)
+            {
+                new Test1();
+                new Test2();
+                new Test3();
+                new Test4();
+                new Test5();
+                new Test6();
+            }
+            System.gc();
+            JvmInternal.runFinalization();
+            StringBuffer sb = new StringBuffer();
+            boolean ok = FinalizerStatistics.getNonfinalizedObjects(sb);
+            assertTrue(sb.toString(), ok);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/JvmPortBasicTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,458 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
+import com.nokia.mj.impl.rt.test.JvmPortTest;
+import com.nokia.mj.impl.rt.support.Jvm;
+import com.nokia.mj.impl.rt.support.JvmInternal;
+import j2meunit.framework.Test;
+import j2meunit.framework.TestCase;
+import j2meunit.framework.TestMethod;
+import j2meunit.framework.TestSuite;
+
+/**
+ * JvmPort basic unit tests. Testing that the delegation works.
+ */
+public class JvmPortBasicTest extends TestCase implements UnitTestSuiteCreator
+{
+
+    // Begin j2meunit test framework setup
+    public TestSuite createTestSuite(String[] args)
+    {
+        TestSuite suite = new TestSuite(this.getClass().getName());
+
+        suite.addTest(new JvmPortBasicTest("testJvm", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((JvmPortBasicTest)tc).testJvm();
+            }
+        }));
+
+        suite.addTest(new JvmPortBasicTest("testVmPortNotExist", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((JvmPortBasicTest)tc).testVmPortNotExist();
+            }
+        }));
+
+
+        return suite;
+
+    }
+
+    public JvmPortBasicTest()
+    {
+    }
+
+    public JvmPortBasicTest(String aTestName, TestMethod aTestMethod)
+    {
+        super(aTestName, aTestMethod);
+    }
+
+    // End j2meunit test framework setup
+
+    protected void setUp()
+    {
+    }
+
+    protected void tearDown()
+    {
+    }
+
+    private void checkCallCounts(String info, int ind)
+    {
+
+        assertTrue(info + " failed " + JvmPortTest.print(),
+                   JvmPortTest.checkCalls(ind));
+
+    }
+
+    private void checkObjects(String info, Object obj1, Object obj2, Object res)
+    {
+
+        boolean ok = JvmPortTest.mObj1 == obj1;
+        if (!ok && obj1 != null)
+        {
+            ok = obj1.equals(JvmPortTest.mObj1);
+        }
+        assertTrue(info + " failed. obj1 " + obj1 + " != " + " mObj1 " + JvmPortTest.mObj1, ok);
+
+        ok = JvmPortTest.mObj2 == obj2;
+        if (!ok && obj2 != null)
+        {
+            ok = obj2.equals(JvmPortTest.mObj2);
+        }
+        assertTrue(info + " failed. obj2 " + obj2 + " != " + " mObj2 " + JvmPortTest.mObj2, ok);
+
+        ok = JvmPortTest.mReturnObj == res;
+        if (!ok && res != null)
+        {
+            ok = res.equals(JvmPortTest.mReturnObj);
+        }
+        assertTrue(info + " failed. res " + res + " != " + " mReturnObj " + JvmPortTest.mReturnObj, ok);
+
+    }
+    // Test cases
+
+    private static final String sysProp = "com.nokia.jvm.port";
+
+    private void setPort(String port)
+    {
+        JvmPortTest.setSystemPropertyImpl(sysProp, port);
+        JvmPortTest.resetInstance();
+    }
+    private void testJvm()
+    {
+        final String testProp = "test.JvmPortTest";
+        String origPort = System.getProperty(sysProp);
+        try
+        {
+            Object testObject1 = new String("testlib");
+            Object testObject2 = null;
+            Object returnObject = null;
+            String methodName;
+            //************ Jvm.loadSystemLibrary ***************************
+            setPort(testProp);
+            Jvm.loadSystemLibrary((String)testObject1);
+            setPort(origPort);
+            methodName = "Jvm.loadSystemLibrary()";
+            checkCallCounts(methodName, JvmPortTest.LOADSYSTEMLIBRARY_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            //************ Jvm.loadApplicationClass ***************************
+            testObject1 = new String("testClass");
+            JvmPortTest.mReturnObj = getClass();
+            setPort(testProp);
+            returnObject = Jvm.loadApplicationClass((String)testObject1);
+            methodName = "Jvm.loadApplicationClass()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.LOADAPPLICATIONCLASS_CALL);
+            checkObjects(methodName, testObject1, null, returnObject);
+            JvmPortTest.clear();
+
+            JvmPortTest.mThrowable = new ClassNotFoundException();
+            setPort(testProp);
+            try
+            {
+                returnObject = Jvm.loadApplicationClass((String)testObject1);
+                setPort(origPort);
+                assertTrue(methodName + ", no Excpetion", false);
+            }
+            catch (ClassNotFoundException cnfe)
+            {
+                setPort(origPort);
+                assertTrue(methodName + ", wrong exception: " + cnfe,
+                           cnfe == JvmPortTest.mThrowable);
+            }
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.LOADAPPLICATIONCLASS_CALL);
+            JvmPortTest.clear();
+
+            //************ Jvm.setThreadAsDaemon ***************************
+            testObject1 = new Thread(new Runnable()
+            {
+                public void run() {}
+            });
+            testObject2 = new Boolean(true);
+            setPort(testProp);
+            Jvm.setThreadAsDaemon((Thread)testObject1, ((Boolean)testObject2).booleanValue());
+            methodName = "Jvm.setThreadAsDaemon()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.SETTHREADASDAEMON_CALL);
+            checkObjects(methodName, testObject1, testObject2, null);
+            JvmPortTest.clear();
+
+            JvmPortTest.mThrowable = new IllegalThreadStateException();
+            setPort(testProp);
+            try
+            {
+                Jvm.setThreadAsDaemon((Thread)testObject1, ((Boolean)testObject2).booleanValue());
+                setPort(origPort);
+                assertTrue(methodName + ", no Excpetion", false);
+            }
+            catch (IllegalThreadStateException itse)
+            {
+                setPort(origPort);
+                assertTrue(methodName + ", wrong exception: " + itse,
+                           itse == JvmPortTest.mThrowable);
+            }
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.SETTHREADASDAEMON_CALL);
+            JvmPortTest.clear();
+
+            JvmPortTest.mThrowable = new SecurityException();
+            setPort(testProp);
+            try
+            {
+                Jvm.setThreadAsDaemon((Thread)testObject1, ((Boolean)testObject2).booleanValue());
+                setPort(origPort);
+                assertTrue(methodName + ", no Excpetion", false);
+            }
+            catch (SecurityException se)
+            {
+                setPort(origPort);
+                assertTrue(methodName + ", wrong exception: " + se,
+                           se == JvmPortTest.mThrowable);
+            }
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.SETTHREADASDAEMON_CALL);
+            JvmPortTest.clear();
+
+            //************ Jvm.getResourceAsNativeMemory ***************************
+            setPort(testProp);
+            testObject1 = new String("jarPath");
+            testObject2 = new String("resName");
+            JvmPortTest.mReturnObj = new NativeMemoryBlock()
+            {
+                public long getPointer()
+                {
+                    return 0;
+                }
+                public int getSize()
+                {
+                    return 0;
+                }
+                public void freeMemory() {}
+            };
+            returnObject = Jvm.getResourceAsNativeMemory((String)testObject1, (String)testObject2);
+            methodName = "Jvm.getResourceAsNativeMemory()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.GETRESOURCEASNATIVEMEMORY_CALL);
+            checkObjects(methodName, testObject1, testObject2, returnObject);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.enableRuntimeExit ***************************
+            setPort(testProp);
+            JvmInternal.enableRuntimeExit();
+            methodName = "JvmInternal.enableRuntimeExit()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.ENABLERUNTIMEEXIT_CALL);
+            checkObjects(methodName, null, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.disableRuntimeExit ***************************
+            setPort(testProp);
+            JvmInternal.disableRuntimeExit();
+            methodName = "JvmInternal.disableRuntimeExit()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.DISABLERUNTIMEEXIT_CALL);
+            checkObjects(methodName, null, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.exitVm ***************************
+            setPort(testProp);
+            testObject1 = new Integer(42);
+            JvmInternal.exitVm(((Integer)testObject1).intValue());
+            methodName = "JvmInternal.exitVm()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.EXITVM_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.enableFinalization ***************************
+            setPort(testProp);
+            testObject1 = getClass();
+            JvmInternal.enableFinalization((Class)testObject1);
+            methodName = "JvmInternal.enableFinalization()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.ENABLEFINALIZATION_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.runFinalization ***************************
+            setPort(testProp);
+            JvmInternal.runFinalization();
+            methodName = "JvmInternal.runFinalization()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.RUNFINALIZATION_CALL);
+            checkObjects(methodName, null, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.runYoungGenerationGc ***************************
+
+            setPort(testProp);
+            JvmPortTest.mReturnObj = new Boolean(true);
+            boolean res = JvmInternal.runYoungGenerationGc();
+            returnObject = new Boolean(res);
+            methodName = "JvmInternal.runYoungGenerationGc()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.RUNYOUNGGENERATIONGC_CALL);
+            checkObjects(methodName, null, null, returnObject);
+            JvmPortTest.clear();
+
+
+            //************ JvmInternal.setThreadEventListener ***************************
+            setPort(testProp);
+            testObject1 = new ThreadEventListener()
+            {
+                public void threadStarting(Thread newThread, Thread parentThread) {}
+                public void threadDied(Thread thread) {}
+                public void uncaughtException(Thread thread, Throwable e) {}
+            };
+            JvmInternal.setThreadEventListener((ThreadEventListener)testObject1);
+            methodName = "JvmInternal.setThreadEventListener()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.SETTHREADEVENTLISTENER_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.addRestrictedPackagePrefixes ***************************
+            setPort(testProp);
+            testObject1 = new String[] {"package1, package2, package3"};
+            JvmInternal.addRestrictedPackagePrefixes((String[])testObject1);
+            methodName = "JvmInternal.addRestrictedPackagePrefixes()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.ADDRESTRICTEDPACKAGEPREFIXES_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            JvmPortTest.mThrowable = new SecurityException();
+            setPort(testProp);
+            try
+            {
+                JvmInternal.addRestrictedPackagePrefixes((String[])testObject1);
+                setPort(origPort);
+                assertTrue(methodName + ", no Excpetion", false);
+            }
+            catch (SecurityException se)
+            {
+                setPort(origPort);
+                assertTrue(methodName + ", wrong exception: " + se,
+                           se == JvmPortTest.mThrowable);
+            }
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.ADDRESTRICTEDPACKAGEPREFIXES_CALL);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.addProtectedPackagePrefixes ***************************
+            setPort(testProp);
+            testObject1 = new String[] {"package4, package5, package6"};
+            JvmInternal.addProtectedPackagePrefixes((String[])testObject1);
+            methodName = "JvmInternal.addProtectedPackagePrefixes()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.ADDPROTECTEDPACKAGEPREFIXES_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            JvmPortTest.mThrowable = new SecurityException();
+            setPort(testProp);
+            try
+            {
+                JvmInternal.addProtectedPackagePrefixes((String[])testObject1);
+                setPort(origPort);
+                assertTrue(methodName + ", no Excpetion", false);
+            }
+            catch (SecurityException se)
+            {
+                setPort(origPort);
+                assertTrue(methodName + ", wrong exception: " + se,
+                           se == JvmPortTest.mThrowable);
+            }
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.ADDPROTECTEDPACKAGEPREFIXES_CALL);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.appendToClassPath ***************************
+            setPort(testProp);
+            testObject1 = new String("class to append");
+            JvmInternal.appendToClassPath((String)testObject1);
+            methodName = "JvmInternal.appendToClassPath()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.APPENDTOCLASSPATH_CALL);
+            checkObjects(methodName, testObject1, null, null);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.shrinkJavaHeapToMinimum ***************************
+            setPort(testProp);
+            JvmPortTest.mReturnObj = new Integer(22);
+            int res2 = JvmInternal.shrinkJavaHeapToMinimum();
+            returnObject = new Integer(res2);
+            methodName = "JvmInternal.shrinkJavaHeapToMinimum()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.SHRINKJAVAHEAPTOMINIMUM_CALL);
+            checkObjects(methodName, null, null, returnObject);
+            JvmPortTest.clear();
+
+            //************ JvmInternal.expandJavaHeap ***************************
+            setPort(testProp);
+            testObject1 = new Integer(33);
+            JvmPortTest.mReturnObj = new Integer(44);
+            int res3 = JvmInternal.expandJavaHeap(((Integer)testObject1).intValue());
+            returnObject = new Integer(res3);
+            methodName = "JvmInternal.expandJavaHeap()";
+            setPort(origPort);
+            checkCallCounts(methodName, JvmPortTest.EXPANDJAVAHEAP_CALL);
+            checkObjects(methodName, testObject1, null, returnObject);
+            JvmPortTest.clear();
+
+            //************ END***************************
+            assertTrue("Calls missed", JvmPortTest.allCalled());
+
+        }
+        catch (Throwable t)
+        {
+            setPort(origPort);
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+        setPort(origPort);
+    }
+
+    private void testVmPortNotExist()
+    {
+        System.out.println("NOTE!! IT IS EXPECTED THAT THIS TEST WILL LEAD TO SOME ERROR LOGS.");
+        final String testProp = "test.JvmPortTest";
+        String origPort = System.getProperty(sysProp);
+        try
+        {
+            setPort("TestPort");
+            JvmInternal.enableRuntimeExit();
+            setPort(origPort);
+            assertTrue("No exception.", false);
+        }
+        catch (RuntimeException re)
+        {
+            setPort(origPort);
+            int ind = re.toString().indexOf("Not able to instantiate class com.nokia.mj.impl.rt.TestPort");
+            boolean ok = ind >= 0;
+            if (!ok)
+            {
+                // Accept also java.lang.ExceptionInInitializerError.
+                ok = re.toString().equals("java.lang.ExceptionInInitializerError");
+            }
+            assertTrue(re.toString(),  ok);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+
+        try
+        {
+            setPort(origPort);
+        }
+        catch (Throwable t)
+        {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/JvmPortTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,799 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support;
+
+
+
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
+import com.nokia.mj.impl.rt.support.ShutdownListener;
+import com.nokia.mj.impl.rt.support.Jvm;
+import com.nokia.mj.impl.rt.support.JvmInternal;
+import j2meunit.framework.Test;
+import j2meunit.framework.TestCase;
+import j2meunit.framework.TestMethod;
+import j2meunit.framework.TestSuite;
+
+import com.nokia.mj.impl.rt.support.prot.ProtectedTest;
+/**
+ * JvmPort unit tests.
+ */
+public class JvmPortTest extends TestCase implements UnitTestSuiteCreator
+{
+
+    // Begin j2meunit test framework setup
+    public TestSuite createTestSuite(String[] args)
+    {
+        TestSuite suite = new TestSuite(this.getClass().getName());
+        String testSelector = "0000000000000000";
+        if (args.length > 1 && args[1] != null)
+        {
+            testSelector = args[1]  + "0000000000000000";
+        }
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testLoadSystemLibrary", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testLoadSystemLibrary();
+                }
+            }));
+        }
+
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testLoadApplicationClass", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testLoadApplicationClass();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(1) != '0')
+        {
+            suite.addTest(new JvmPortTest("testSetThreadAsDaemon", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testSetThreadAsDaemon();
+                }
+            }));
+        }
+
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testGetResourceAsNativeMemory", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testGetResourceAsNativeMemory();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(2) != '0')
+        {
+            suite.addTest(new JvmPortTest("testEnableRuntimeExit", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testEnableRuntimeExit();
+                }
+            }));
+        }
+
+
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testDisableRuntimeExit", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testDisableRuntimeExit();
+                }
+            }));
+        }
+
+
+        if (testSelector.charAt(3) != '0')
+        {
+            suite.addTest(new JvmPortTest("testExitVm", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testExitVm();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testYoungGenerationGc", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testYoungGenerationGc();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(4) != '0')
+        {
+            suite.addTest(new JvmPortTest("testFinalization", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testFinalization();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testSetThreadEventListener", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testSetThreadEventListener();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(8) != '0')
+        {
+            suite.addTest(new JvmPortTest("testAddRestrictedPackagePrefixes", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testAddRestrictedPackagePrefixes();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(0) != '0')
+        {
+            suite.addTest(new JvmPortTest("testAddProtectedPackagePrefixes", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testAddProtectedPackagePrefixes();
+                }
+            }));
+        }
+
+
+        if (testSelector.charAt(5) != '0')
+        {
+            suite.addTest(new JvmPortTest("testAppendToClassPath", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testAppendToClassPath();
+                }
+            }));
+        }
+
+
+        if (testSelector.charAt(6) != '0')
+        {
+            suite.addTest(new JvmPortTest("testShrinkJavaHeapToMinimum", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testShrinkJavaHeapToMinimum();
+                }
+            }));
+        }
+
+        if (testSelector.charAt(7) != '0')
+        {
+            suite.addTest(new JvmPortTest("testExpandJavaHeap", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((JvmPortTest)tc).testExpandJavaHeap();
+                }
+            }));
+        }
+
+
+        return suite;
+
+    }
+
+    public JvmPortTest()
+    {
+    }
+
+    public JvmPortTest(String aTestName, TestMethod aTestMethod)
+    {
+        super(aTestName, aTestMethod);
+    }
+
+    // End j2meunit test framework setup
+
+    protected void setUp()
+    {
+    }
+
+    protected void tearDown()
+    {
+    }
+
+    private static class ShutdownListenerImpl implements ShutdownListener
+    {
+        public int mShutDownCallCount = 0;
+        public void shuttingDown()
+        {
+            mShutDownCallCount++;
+        }
+    }
+    // Test cases
+
+    private void testLoadSystemLibrary()
+    {
+        try
+        {
+            //************ Jvm.loadSystemLibrary ***************************
+            Jvm.loadSystemLibrary("javacommonutilstest");
+
+            try
+            {
+                Jvm.loadSystemLibrary("nonexisting");
+                assertTrue("Call should have failed", false);
+            }
+            catch (Error e)
+            {
+                int ind = e.toString().indexOf("Not able to load library nonexisting.");
+                boolean ok = ind >= 0;
+                if (!ok)
+                {
+                    // Accept also java.lang.ExceptionInInitializerError.
+                    ok = e.toString().startsWith("java.lang.UnsatisfiedLinkError");
+//                    ok = e instanceof UnsatisfiedLinkError;
+                }
+                assertTrue(e.toString(),  ok);
+            }
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testLoadApplicationClass()
+    {
+        try
+        {
+            //************ Jvm.loadApplicationClass ***************************
+            javax.microedition.rms.RecordComparator obj = (javax.microedition.rms.RecordComparator)
+                    Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest.TestClass").newInstance();
+            assertTrue("Object was null", obj != null);
+            int res = obj.compare(null, null);
+            assertTrue("Incorrect result: " + res, res == 42);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private boolean isCldc()
+    {
+        String cldcProp = System.getProperty("com.nokia.jvm.port");
+        if (cldcProp != null && cldcProp.equals("j9.JvmPortCldc"))
+        {
+            return true;
+        }
+        return false;
+
+    }
+    private void testSetThreadAsDaemon()
+    {
+        try
+        {
+            //************ Jvm.setThreadAsDaemon ***************************
+            Thread th = new Thread(new Runnable()
+            {
+                public void run()
+                {
+                    try
+                    {
+                        Thread.sleep(2000);
+                    }
+                    catch (Exception re)
+                    {
+                    }
+                }
+            });
+            if (isCldc())
+            {
+                try
+                {
+                    Jvm.setThreadAsDaemon(th, false);
+                }
+                catch (RuntimeException re)
+                {
+                    assertTrue(re.toString(), re.toString().indexOf("Setting thread as non-daemon not supported") >= 0);
+                }
+            }
+            else
+            {
+                Jvm.setThreadAsDaemon(th, false);
+            }
+            Jvm.setThreadAsDaemon(th, true);
+            th.start();
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private static final String jarFile = "c:\\java\\jvmportapp.jar";
+    private static final String jarFile2 = "c:\\java\\jvmportapp2.jar";
+
+    private void testGetResourceAsNativeMemory()
+    {
+        if (!isCldc())
+        {
+            return;
+        }
+        try
+        {
+            //************ Jvm.getResourceAsNativeMemory ***************************
+            NativeMemoryBlock nativeMemory = Jvm.getResourceAsNativeMemory(null, "myres/info.txt");
+            assertTrue("NativeMemoryBlock was null", nativeMemory != null);
+
+            NativeMemoryBlock nativeMemory2 = Jvm.getResourceAsNativeMemory(null, "myres/info2.txt");
+            assertTrue("NativeMemoryBlock2 was null", nativeMemory2 != null);
+
+            String res = _getResource(nativeMemory.getPointer(), nativeMemory.getSize());
+            assertTrue("Incorrect content1: " + res, res.equals("jvmPort(info): The quick brown fox jumps over the lazy dog"));
+
+            res = _getResource(nativeMemory2.getPointer(), nativeMemory2.getSize());
+            assertTrue("Incorrect content2 " + res, res.equals("jvmPort(info2): The quick brown fox jumps over the lazy dog"));
+
+            nativeMemory.freeMemory();
+            nativeMemory2.freeMemory();
+
+            NativeMemoryBlock nativeMemory3 = Jvm.getResourceAsNativeMemory(jarFile2, "myres/info.txt");
+            assertTrue("NativeMemoryBlock3 was null", nativeMemory3 != null);
+
+            NativeMemoryBlock nativeMemory4 = Jvm.getResourceAsNativeMemory(jarFile2, "myres/info2.txt");
+            assertTrue("NativeMemoryBlock4 was null", nativeMemory4 != null);
+
+            res = _getResource(nativeMemory3.getPointer(), nativeMemory3.getSize());
+            assertTrue("Incorrect content3: " + res, res.equals("jvmPort2(info): The quick brown fox jumps over the lazy dog"));
+
+            res = _getResource(nativeMemory4.getPointer(), nativeMemory4.getSize());
+            assertTrue("Incorrect content4 " + res, res.equals("jvmPort2(info2): The quick brown fox jumps over the lazy dog"));
+
+            nativeMemory3.freeMemory();
+            nativeMemory4.freeMemory();
+
+            NativeMemoryBlock nativeMemory5 = Jvm.getResourceAsNativeMemory(jarFile2 + "t", "myres/info.txt");
+            assertTrue("NativeMemoryBlock5 was not null", nativeMemory5 == null);
+
+            NativeMemoryBlock nativeMemory6 = Jvm.getResourceAsNativeMemory(jarFile2 + "t", "myres/info2.txt");
+            assertTrue("NativeMemoryBlock6 was not null", nativeMemory6 == null);
+
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testEnableRuntimeExit()
+    {
+        try
+        {
+            //************ JvmInternal.enableRuntimeExit ***************************
+            if (isCldc())
+            {
+                JvmInternal.enableRuntimeExit();
+            }
+            System.exit(40);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testDisableRuntimeExit()
+    {
+        if (!isCldc())
+        {
+            return;
+        }
+
+        try
+        {
+            //************ JvmInternal.disableRuntimeExit ***************************
+            JvmInternal.disableRuntimeExit();
+            try
+            {
+                System.exit(-123);
+                assertTrue("System exit should have failed", false);
+            }
+            catch (SecurityException se)
+            {
+            }
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+        JvmInternal.enableRuntimeExit();
+    }
+
+    private void testExitVm()
+    {
+        try
+        {
+            //************ JvmInternal.exitVm ***************************
+            JvmInternal.exitVm(42);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testYoungGenerationGc()
+    {
+        try
+        {
+            //************ JvmInternal.runYoungGenerationGc ***************************
+            Runtime rt = Runtime.getRuntime();
+            {
+                new FinalizeClass();
+                new FinalizeClass();
+                new FinalizeClass();
+            }
+            long startFree = rt.freeMemory();
+            boolean supported = JvmInternal.runYoungGenerationGc();
+            long endFree = rt.freeMemory();
+            if (supported)
+            {
+                assertTrue("endFree (" + endFree + ") <= startFree (" + startFree + ")", startFree < endFree);
+            }
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private static class FinalizeClass
+    {
+        private static boolean mFinalized = false;
+
+        static
+        {
+            JvmInternal.enableFinalization(JvmPortTest.FinalizeClass.class);
+        }
+
+        protected final void finalize()
+        {
+            mFinalized = true;
+        }
+    }
+
+    private void testFinalization()
+    {
+        try
+        {
+            //************ JvmInternal.runYoungGenerationGc ***************************
+            FinalizeClass fClass = new FinalizeClass();
+            fClass = null;
+            System.gc();
+            JvmInternal.runFinalization();
+            assertTrue("Class was not finalized", FinalizeClass.mFinalized);
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private class TestListener implements ThreadEventListener
+    {
+        private int startCount = 0;
+        private int diedCount = 0;
+        private int uncaughtCount = 0;
+        private Throwable throwable;
+        private Thread throwngThread;
+        private Thread newThread;
+        private Thread parentThread;
+        private Thread dyingThread;
+
+        public synchronized void threadStarting(Thread newThread, Thread parentThread)
+        {
+            startCount++;
+            this.newThread = newThread;
+            this.parentThread = parentThread;
+        }
+        public synchronized void threadDied(Thread thread)
+        {
+            diedCount++;
+            dyingThread = thread;
+        }
+        public synchronized void uncaughtException(Thread thread, Throwable t)
+        {
+            throwngThread = thread;
+            throwable = t;
+            uncaughtCount++;
+        }
+
+    }
+    private void testSetThreadEventListener()
+    {
+        try
+        {
+            Thread currentThread = Thread.currentThread();
+            //************ JvmInternal.setThreadEventListener ***************************
+            TestListener listener = new TestListener();
+            JvmInternal.setThreadEventListener(listener);
+            Thread th = new Thread(new Runnable()
+            {
+                public void run() {}
+            });
+            th.start();
+            Thread.sleep(50);
+            assertTrue("new thread not correct(1)", th == listener.newThread);
+            assertTrue("parent thread not correct(1)", currentThread == listener.parentThread);
+            assertTrue("died thread not correct(1)", th == listener.dyingThread);
+
+            th = new Thread(new Runnable()
+            {
+                public void run() {}
+            });
+            th.start();
+            Thread.sleep(50);
+            assertTrue("new thread not correct(2)", th == listener.newThread);
+            assertTrue("parent thread not correct(2)", currentThread == listener.parentThread);
+            assertTrue("died thread not correct(2)", th == listener.dyingThread);
+
+            th = new Thread(new Runnable()
+            {
+                public void run() {}
+            });
+            th.start();
+            Thread.sleep(50);
+            assertTrue("new thread not correct(3)", th == listener.newThread);
+            assertTrue("parent thread not correct(3)", currentThread == listener.parentThread);
+            assertTrue("died thread not correct(3)", th == listener.dyingThread);
+
+            final RuntimeException re = new RuntimeException("ex");
+            th = new Thread(new Runnable()
+            {
+                public void run()
+                {
+                    throw re;
+                }
+            });
+            th.start();
+            Thread.sleep(150);
+            assertTrue("new thread not correct(4)", th == listener.newThread);
+            assertTrue("parent thread not correct(4)", currentThread == listener.parentThread);
+            assertTrue("died thread not correct(4)", th == listener.dyingThread);
+            assertTrue("Throwable not correct(4)", re == listener.throwable);
+
+            assertTrue("Start count not correct: " + listener.startCount, listener.startCount == 4);
+            assertTrue("End count not correct: " + listener.diedCount, listener.diedCount == 4);
+            assertTrue("Throwable count not correct: " + listener.uncaughtCount, listener.uncaughtCount == 1);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testAddRestrictedPackagePrefixes()
+    {
+        if (!isCldc())
+        {
+            return;
+        }
+        try
+        {
+            //************ JvmInternal.addRestrictedPackagePrefixes ***************************
+
+            javax.microedition.rms.RecordComparator obj0 = (javax.microedition.rms.RecordComparator)
+                    Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest2.TestClass").newInstance();
+            assertTrue("Object was null", obj0 != null);
+            int res = obj0.compare(null, new byte[1]);
+            assertTrue("Restricted test failed: " + res, res == 0);
+
+            JvmInternal.addRestrictedPackagePrefixes(new String[] {"com.nokia.mj.impl.rt.support.restricted."});
+
+            javax.microedition.rms.RecordComparator obj = (javax.microedition.rms.RecordComparator)
+                    Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest2.TestClass").newInstance();
+            assertTrue("Object was null", obj != null);
+            res = obj.compare(new byte[1], null);
+            assertTrue("Restricted test failed2: " + res, res == 0);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testAddProtectedPackagePrefixes()
+    {
+        if (!isCldc())
+        {
+            return;
+        }
+        try
+        {
+            //************ JvmInternal.addProtectedPackagePrefixes ***************************
+            javax.microedition.rms.RecordComparator obj0 = (javax.microedition.rms.RecordComparator)
+                    Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest.TestClass").newInstance();
+            assertTrue("Object was null", obj0 != null);
+            int res = obj0.compare(null, new byte[1]);
+            assertTrue("Protected test failed: " + res, res == 0);
+
+            JvmInternal.addProtectedPackagePrefixes(new String[] {"com.nokia.mj.impl.rt.support.prot."});
+
+            javax.microedition.rms.RecordComparator obj = (javax.microedition.rms.RecordComparator)
+                    Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest.TestClass").newInstance();
+            assertTrue("Object was null", obj != null);
+            res = obj.compare(new byte[1], null);
+            assertTrue("Protected test failed2: " + res, res == 0);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testAppendToClassPath()
+    {
+        try
+        {
+            //************ JvmInternal.appendToClassPath ***************************
+            javax.microedition.rms.RecordComparator obj = null;
+            try
+            {
+                obj = (javax.microedition.rms.RecordComparator)
+                      Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest.TestClass").newInstance();
+                assertTrue("Shouldn't be found.", false);
+            }
+            catch (ClassNotFoundException cnfe) {}
+
+            try
+            {
+                obj = (javax.microedition.rms.RecordComparator)
+                      Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest2.TestClass").newInstance();
+                assertTrue("Shouldn't be found2.", false);
+            }
+            catch (ClassNotFoundException cnfe)
+            {
+            }
+
+            JvmInternal.appendToClassPath(jarFile);
+            obj = (javax.microedition.rms.RecordComparator)
+                  Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest.TestClass").newInstance();
+            assertTrue("Object was null", obj != null);
+            int res = obj.compare(null, null);
+            assertTrue("Incorrect result: " + res, res == 42);
+
+            try
+            {
+                obj = (javax.microedition.rms.RecordComparator)
+                      Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest2.TestClass").newInstance();
+                assertTrue("Shouldn't be found3.", false);
+            }
+            catch (ClassNotFoundException cnfe)
+            {
+            }
+
+            JvmInternal.appendToClassPath(jarFile2);
+            obj = (javax.microedition.rms.RecordComparator)
+                  Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest.TestClass").newInstance();
+            assertTrue("Object was null 2", obj != null);
+            res = obj.compare(null, null);
+            assertTrue("Incorrect result(2): " + res, res == 42);
+
+            obj = (javax.microedition.rms.RecordComparator)
+                  Jvm.loadApplicationClass("com.nokia.mj.impl.test.jvmporttest2.TestClass").newInstance();
+            assertTrue("Object was null 3", obj != null);
+            res = obj.compare(null, null);
+            assertTrue("Incorrect result(3): " + res, res == 43);
+
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+
+    private void testShrinkJavaHeapToMinimum()
+    {
+        try
+        {
+            //************ JvmInternal.shrinkJavaHeapToMinimum ***************************
+            Object[] o = new Object[10000];
+            assertTrue("Alocation failed: " + o.length, o.length > 0);
+
+            Runtime rt = Runtime.getRuntime();
+            long startTotal = rt.totalMemory();
+            o = null;
+            int shrinkAmount = JvmInternal.shrinkJavaHeapToMinimum();
+            long endTotal = rt.totalMemory();
+            assertTrue("Heap shrink failed: " + shrinkAmount, shrinkAmount > 0);
+            assertTrue("Heap shrink failed, total mem was not reduced. endTotal: " + endTotal + ", startTotal: " + startTotal, endTotal < startTotal);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private void testExpandJavaHeap()
+    {
+        try
+        {
+            //************ JvmInternal.expandJavaHeap ***************************
+            Runtime rt = Runtime.getRuntime();
+            long startTotal = rt.totalMemory();
+            final int expandSize = 1024 * 1024;
+            int expanded = JvmInternal.expandJavaHeap(expandSize);
+            assertTrue("Didn't expand as expected: " + expanded, expandSize == expanded);
+            long endTotal = rt.totalMemory();
+            assertTrue("Runtime.totalMemory not what expected. startTotal: " + startTotal + ", endTotal: " + endTotal, (endTotal - startTotal) == expandSize);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    private native String _getResource(long ptr, int size);
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/prot/ProtectedTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support.prot;
+
+public class ProtectedTest
+{
+
+    public int getValue()
+    {
+        return 10;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/support/restricted/RestrictedTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.support.restricted;
+
+public class RestrictedTest
+{
+    public int getValue()
+    {
+        return 11;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/test/ApplicationInfoImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.test;
+
+import com.nokia.mj.impl.utils.Uid;
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+
+/**
+ *
+ * @author Nokia Corporation
+ * @version 1.0
+ */
+
+public class ApplicationInfoImpl extends ApplicationInfo
+{
+    public static final String TEST_RT_TYPE = "TEST RT";
+    public static final String TEST_PROTECTION_DOMAIN = "TEST DOMAIN";
+    public static final Uid    TEST_APP_UID = Uid.createUid("[12345678]");
+    public static final Uid    TEST_APP_SUITE_UID = Uid.createUid("[87654321]");
+    public static final String TEST_APP_NAME = "TEST NAME";
+    public static final String TEST_APP_SUITE_NAME = "TEST SUITE NAME";
+    public static final String TEST_APP_VENDOR = "TEST VENDOR";
+    public static final String TEST_APP_VERSION = "TEST VERSION";
+    public static final String TEST_PATH = "TEST PATH";
+    public static final String MAIN_CLASS = "TEST CLASS";
+    public static final String TEST_KEY = "TEST KEY";
+    public static final String TEST_VALUE = "TEST VALUE";
+
+    public String getRuntimeType()
+    {
+        return TEST_RT_TYPE;
+    }
+
+    public String getProtectionDomain()
+    {
+        return TEST_PROTECTION_DOMAIN;
+    }
+
+    public Uid getUid()
+    {
+        return TEST_APP_UID;
+    }
+
+    public Uid getSuiteUid()
+    {
+        return TEST_APP_SUITE_UID;
+    }
+
+    public String getSuiteName()
+    {
+        return TEST_APP_SUITE_NAME;
+    }
+
+    public String getName()
+    {
+        return TEST_APP_NAME;
+    }
+
+    public String getVendor()
+    {
+        return TEST_APP_VENDOR;
+    }
+
+    public String getVersion()
+    {
+        return TEST_APP_VERSION;
+    }
+
+    public String getRootPath()
+    {
+        return TEST_PATH;
+    }
+
+    public String getMainClass()
+    {
+        return MAIN_CLASS;
+    }
+
+    public String getAttribute(String key)
+    {
+        if (TEST_KEY.equals(key))
+        {
+            return TEST_VALUE;
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/test/ApplicationUtilsImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.test;
+
+import java.security.Permission;
+import java.security.AccessControlException;
+
+import com.nokia.mj.impl.rt.support.ApplicationUtils;
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+import com.nokia.mj.impl.utils.Uid;
+
+public class ApplicationUtilsImpl extends ApplicationUtils
+{
+
+    public static final int NOTIFY_CALL = 0;
+    public static final int UI_DISPOSED_CALL = 1;
+    public static final int PAUSE_CALL = 2;
+    public static final int RESUME_CALL = 3;
+    public static final int PERMISSION_CALL1 = 4;
+    public static final int PERMISSION_CALL2 = 5;
+
+    public static int[] mCalledArr = new int[6];
+
+    static
+    {
+        clear();
+    }
+
+    public static Permission mPermission = null;
+    public static Uid mUid = null;
+
+    public static void clear()
+    {
+        for (int i = 0; i < mCalledArr.length; ++i)
+        {
+            mCalledArr[i] = 0;
+        }
+    }
+
+    public static boolean checkCalls(int checkInd)
+    {
+        for (int i = 0; i < mCalledArr.length; ++i)
+        {
+            if (checkInd == i)
+            {
+                if (mCalledArr[i] != 1)
+                {
+                    return false;
+                }
+            }
+            else if (mCalledArr[i] != 0)
+            {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static String print()
+    {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < mCalledArr.length; ++i)
+        {
+            sb.append("\n");
+            sb.append("  " + (i + 1) + " == " + mCalledArr[i]);
+        }
+        return sb.toString();
+    }
+
+    public static void doShutdownImpl()
+    {
+//        sInstance.doShutdown();
+        ((ApplicationUtilsImpl)sInstance).doShutdown();
+    }
+
+    public void notifyExitCmd()
+    {
+        mCalledArr[NOTIFY_CALL]++;
+    }
+
+    public void uiDisposed()
+    {
+        mCalledArr[UI_DISPOSED_CALL]++;
+    }
+
+    public void pauseApplication()
+    {
+        mCalledArr[PAUSE_CALL]++;
+    }
+
+    public void resumeApplication()
+    {
+        mCalledArr[RESUME_CALL]++;
+    }
+
+    public void checkPermission(Permission p)
+    throws AccessControlException,
+        NullPointerException
+    {
+        mPermission = p;
+        mCalledArr[PERMISSION_CALL1]++;
+    }
+
+    public void checkPermission(Uid appUid,Permission p)
+    throws AccessControlException,
+        NullPointerException
+    {
+        mPermission = p;
+        mUid = appUid;
+        mCalledArr[PERMISSION_CALL2]++;
+    }
+
+    public static void releaseWaiterImpl(boolean doStart)
+    {
+        ((ApplicationUtilsImpl)sInstance).releaseStartWaiter(doStart);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/test/JvmPortTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,282 @@
+/*
+* Copyright (c) 2010 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 com.nokia.mj.impl.rt.test;
+
+
+import com.nokia.mj.impl.rt.JvmPort;
+import com.nokia.mj.impl.rt.support.ThreadEventListener;
+import com.nokia.mj.impl.rt.support.NativeMemoryBlock;
+
+public class JvmPortTest extends JvmPort
+{
+
+    public static final int LOADSYSTEMLIBRARY_CALL = 0;
+    public static final int LOADAPPLICATIONCLASS_CALL = 1;
+    public static final int RUNYOUNGGENERATIONGC_CALL = 2;
+    public static final int SETTHREADASDAEMON_CALL = 3;
+    public static final int GETRESOURCEASNATIVEMEMORY_CALL = 4;
+    public static final int DISABLERUNTIMEEXIT_CALL = 5;
+    public static final int ENABLERUNTIMEEXIT_CALL = 6;
+    public static final int EXITVM_CALL = 7;
+    public static final int RUNFINALIZATION_CALL = 8;
+    public static final int ENABLEFINALIZATION_CALL = 9;
+    public static final int SETTHREADEVENTLISTENER_CALL = 10;
+    public static final int ADDRESTRICTEDPACKAGEPREFIXES_CALL = 11;
+    public static final int ADDPROTECTEDPACKAGEPREFIXES_CALL = 12;
+    public static final int APPENDTOCLASSPATH_CALL = 13;
+    public static final int SHRINKJAVAHEAPTOMINIMUM_CALL = 14;
+    public static final int EXPANDJAVAHEAP_CALL = 15;
+
+
+    public static int[] mCalledArr = new int[16];
+    public static int[] mCalledTotalArr = new int[16];
+
+    static
+    {
+        clear();
+        for (int i = 0; i < mCalledTotalArr.length; ++i)
+        {
+            mCalledTotalArr[i] = 0;
+        }
+    }
+
+    public static Object mObj1 = null;
+    public static Object mObj2 = null;
+    public static Object mReturnObj = null;
+    public static Throwable mThrowable = null;
+
+    public static void clear()
+    {
+        for (int i = 0; i < mCalledArr.length; ++i)
+        {
+            mCalledArr[i] = 0;
+        }
+        mObj1 = null;
+        mObj2 = null;
+        mReturnObj = null;
+        mThrowable = null;
+    }
+
+    public static void resetInstance()
+    {
+        sInstance = null;
+    }
+
+    public static boolean allCalled()
+    {
+        for (int i = 0; i < mCalledTotalArr.length; ++i)
+        {
+            if (mCalledTotalArr[i] == 0)
+            {
+                StringBuffer sb = new StringBuffer();
+                for (int j = 0; j < mCalledTotalArr.length; ++j)
+                {
+                    sb.append("\n");
+                    sb.append("  " + (j + 1) + " == " + mCalledTotalArr[j]);
+                }
+                System.err.println("All calls:"+ sb.toString());
+
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static boolean checkCalls(int checkInd)
+    {
+        for (int i = 0; i < mCalledArr.length; ++i)
+        {
+            if (checkInd == i)
+            {
+                if (mCalledArr[i] != 1)
+                {
+                    return false;
+                }
+            }
+            else if (mCalledArr[i] != 0)
+            {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public static String print()
+    {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < mCalledArr.length; ++i)
+        {
+            sb.append("\n");
+            sb.append("  " + (i + 1) + " == " + mCalledArr[i]);
+        }
+        return sb.toString();
+    }
+
+    public static void setSystemPropertyImpl(Object key, Object value)
+    {
+        mPropertiesContainer.setSystemProperty(key, value);
+    }
+
+
+    public void loadSystemLibrary(String libName)
+    {
+        mCalledArr[LOADSYSTEMLIBRARY_CALL]++;
+        mCalledTotalArr[LOADSYSTEMLIBRARY_CALL]++;
+        mObj1 = libName;
+    }
+
+    public Class loadApplicationClass(String name) throws ClassNotFoundException
+    {
+        mCalledArr[LOADAPPLICATIONCLASS_CALL]++;
+        mCalledTotalArr[LOADAPPLICATIONCLASS_CALL]++;
+        if (mThrowable != null)
+        {
+            throw(ClassNotFoundException)mThrowable;
+        }
+        mObj1 = name;
+        sInstance = null;
+        return (Class)mReturnObj;
+    }
+
+    public boolean runYoungGenerationGc()
+    {
+        mCalledArr[RUNYOUNGGENERATIONGC_CALL]++;
+        mCalledTotalArr[RUNYOUNGGENERATIONGC_CALL]++;
+        return ((Boolean)mReturnObj).booleanValue();
+    }
+
+    public void setThreadAsDaemon(Thread thread,
+                                  boolean daemon)
+    throws IllegalThreadStateException, SecurityException
+    {
+        mCalledArr[SETTHREADASDAEMON_CALL]++;
+        mCalledTotalArr[SETTHREADASDAEMON_CALL]++;
+        if (mThrowable != null)
+        {
+            if (mThrowable instanceof IllegalThreadStateException)
+            {
+                throw(IllegalThreadStateException)mThrowable;
+            }
+            else
+            {
+                throw(SecurityException)mThrowable;
+
+            }
+        }
+        mObj1 = thread;
+        mObj2 = new Boolean(daemon);
+    }
+
+
+    public NativeMemoryBlock getResourceAsNativeMemory(String jarPath,
+            String resName)
+    {
+        mCalledArr[GETRESOURCEASNATIVEMEMORY_CALL]++;
+        mCalledTotalArr[GETRESOURCEASNATIVEMEMORY_CALL]++;
+        mObj1 = jarPath;
+        mObj2 = resName;
+        return (NativeMemoryBlock)mReturnObj;
+    }
+
+
+    public void disableRuntimeExit()
+    {
+        mCalledArr[DISABLERUNTIMEEXIT_CALL]++;
+        mCalledTotalArr[DISABLERUNTIMEEXIT_CALL]++;
+    }
+
+    public void enableRuntimeExit()
+    {
+        mCalledArr[ENABLERUNTIMEEXIT_CALL]++;
+        mCalledTotalArr[ENABLERUNTIMEEXIT_CALL]++;
+    }
+
+    public void exitVm(int status)
+    {
+        mCalledArr[EXITVM_CALL]++;
+        mCalledTotalArr[EXITVM_CALL]++;
+        mObj1 = new Integer(status);
+    }
+
+    public void runFinalization()
+    {
+        mCalledArr[RUNFINALIZATION_CALL]++;
+        mCalledTotalArr[RUNFINALIZATION_CALL]++;
+    }
+
+    public void enableFinalization(Class clazz)
+    {
+        mCalledArr[ENABLEFINALIZATION_CALL]++;
+        mCalledTotalArr[ENABLEFINALIZATION_CALL]++;
+        mObj1 = clazz;
+    }
+
+    public void setThreadEventListener(ThreadEventListener listener)
+    {
+        mCalledArr[SETTHREADEVENTLISTENER_CALL]++;
+        mCalledTotalArr[SETTHREADEVENTLISTENER_CALL]++;
+        mObj1 = listener;
+    }
+
+    public void addRestrictedPackagePrefixes(String[] packageNames)
+    throws SecurityException
+    {
+        mCalledArr[ADDRESTRICTEDPACKAGEPREFIXES_CALL]++;
+        mCalledTotalArr[ADDRESTRICTEDPACKAGEPREFIXES_CALL]++;
+        if (mThrowable != null)
+        {
+            throw(SecurityException)mThrowable;
+        }
+        mObj1 = packageNames;
+    }
+
+    public void addProtectedPackagePrefixes(String[] packageNames)
+    throws SecurityException
+    {
+        mCalledArr[ADDPROTECTEDPACKAGEPREFIXES_CALL]++;
+        mCalledTotalArr[ADDPROTECTEDPACKAGEPREFIXES_CALL]++;
+        if (mThrowable != null)
+        {
+            throw(SecurityException)mThrowable;
+        }
+        mObj1 = packageNames;
+    }
+
+    public void appendToClassPath(String path)
+    {
+        mCalledArr[APPENDTOCLASSPATH_CALL]++;
+        mCalledTotalArr[APPENDTOCLASSPATH_CALL]++;
+        mObj1 = path;
+    }
+
+    public int shrinkJavaHeapToMinimum()
+    {
+        mCalledArr[SHRINKJAVAHEAPTOMINIMUM_CALL]++;
+        mCalledTotalArr[SHRINKJAVAHEAPTOMINIMUM_CALL]++;
+        return ((Integer)mReturnObj).intValue();
+    }
+
+    public int expandJavaHeap(int amount)
+    {
+        mCalledArr[EXPANDJAVAHEAP_CALL]++;
+        mCalledTotalArr[EXPANDJAVAHEAP_CALL]++;
+        mObj1 = new Integer(amount);
+        return ((Integer)mReturnObj).intValue();
+    }
+
+}
--- a/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/LoggerTests.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/LoggerTests.java	Fri Oct 15 12:29:39 2010 +0300
@@ -31,6 +31,15 @@
  */
 public class LoggerTests extends TestCase implements UnitTestSuiteCreator
 {
+    static
+    {
+        if ("unexiting".equals(System.getProperty("com.nokia.jvm.port")))
+        {
+            System.out.println("NOTE!! IT IS EXPECTED THAT THIS TEST WILL " +
+                               "LEAD TO BIG AMOUNT OF TRACES.");
+        }
+
+    }
     // Create the test suite.
     public TestSuite createTestSuite(String[] args)
     {
Binary file javacommons/utils/tsrc/jvmportapp.jar has changed
Binary file javacommons/utils/tsrc/jvmportapp2.jar has changed
--- a/javacommons/utils/tsrc/localisation/javasrc/com/nokia/mj/impl/utils/LocalisationTest.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/tsrc/localisation/javasrc/com/nokia/mj/impl/utils/LocalisationTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -50,276 +50,655 @@
         com.nokia.mj.impl.utils.OmjTestRunner.run(suite());
     }
 
-
     public Test suite()
     {
         // TestSuite aSuite = new TestSuite();
         TestSuite aSuite = new TestSuite(this.getClass().getName());
 
-        aSuite.addTest(new LocalisationTest("formatterTest", new TestMethod()
+        aSuite.addTest(new LocalisationTest("testFormatDigits", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((LocalisationTest) tc).testFormatDigits();
+            }
+        }));
+
+        aSuite.addTest(new LocalisationTest("testFormatterAvkon", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((LocalisationTest) tc).testFormatterAvkon();
+            }
+        }));
+
+        aSuite.addTest(new LocalisationTest("testResourceLoaderAvkon", new TestMethod()
         {
             public void run(TestCase tc)
             {
-                ((LocalisationTest) tc).formatterTest();
+                ((LocalisationTest) tc).testResourceLoaderAvkon();
             }
         }));
 
-        aSuite.addTest(new LocalisationTest("resourceLoaderTest", new TestMethod()
+        if (ResourceLoader.getLocaleIdQt() != null)
+        {
+            aSuite.addTest(new LocalisationTest("testFormatterQt", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((LocalisationTest) tc).testFormatterQt();
+                }
+            }));
+
+            aSuite.addTest(new LocalisationTest("testResourceLoaderQt", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((LocalisationTest) tc).testResourceLoaderQt();
+                }
+            }));
+
+            aSuite.addTest(new LocalisationTest("testNumerusQt", new TestMethod()
+            {
+                public void run(TestCase tc)
+                {
+                    ((LocalisationTest) tc).testNumerusQt();
+                }
+            }));
+        }
+
+        aSuite.addTest(new LocalisationTest("testResourceLoaderCreate", new TestMethod()
         {
             public void run(TestCase tc)
             {
-                ((LocalisationTest) tc).resourceLoaderTest();
+                ((LocalisationTest) tc).testResourceLoaderCreate();
+            }
+        }));
+
+        aSuite.addTest(new LocalisationTest("testResourceLoaderDestroy", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((LocalisationTest) tc).testResourceLoaderDestroy();
             }
         }));
 
         return aSuite;
     }
 
-    void formatterTest()
+    void testFormatDigits()
+    {
+        String str = "Message from number +358101234567 received.";
+        // Test are executed with english locale,
+        // numbers should not be changed.
+        assertEquals(str, FormatterAvkon.formatDigits(str));
+        assertEquals(str, FormatterQt.formatDigits(str));
+    }
+
+    void testFormatterAvkon()
     {
         // Zero argument
         assertEquals(
             "Test",
-            new Formatter("Test").toString());
+            new FormatterAvkon("Test").toString());
 
         // One argument tests
         assertEquals(
             "Test 100",
-            new Formatter("Test %0N").arg(100).toString());
+            new FormatterAvkon("Test %0N").arg(100).toString());
 
         assertEquals(
             "Test 1",
-            new Formatter("Test %C").arg('1').toString());
+            new FormatterAvkon("Test %C").arg('1').toString());
 
         assertEquals(
             "Test A",
-            new Formatter("Test %0C").arg('A').toString());
+            new FormatterAvkon("Test %0C").arg('A').toString());
 
         // Two argument tests
         assertEquals(
             "Test test 100",
-            new Formatter("Test %1U %0N").arg(100).arg("test").toString());
+            new FormatterAvkon("Test %1U %0N").arg(100).arg("test").toString());
 
         assertEquals(
             "100 test test",
-            new Formatter("%0 test %1").arg(100).arg("test").toString());
+            new FormatterAvkon("%0 test %1").arg(100).arg("test").toString());
 
         assertEquals(
             "Test A B C",
-            new Formatter("Test %0C %1 %2C").arg('A').arg('B').arg('C').toString());
+            new FormatterAvkon("Test %0C %1 %2C").arg('A').arg('B').arg('C').toString());
 
         // Two argument tests with array
         assertEquals(
             "Test test 100",
-            new Formatter("Test %1U %0N").format(new Object[]
-                                                 {
-                                                     new Integer(100), "test"
-                                                 }));
+            new FormatterAvkon("Test %1U %0N").format(
+                new Object[]
+                {
+                    new Integer(100), "test"
+                }));
 
         assertEquals(
             "100 test test",
-            new Formatter("%0 test %1").format(new Object[]
-                                               {
-                                                   new Integer(100), "test"
-                                               }));
+            new FormatterAvkon("%0 test %1").format(
+                new Object[]
+                {
+                    new Integer(100), "test"
+                }));
 
         // Missing argument, no failure, just unreplaced parameter
         assertEquals(
             "100 test %1",
-            new Formatter("%0 test %1").arg(100).toString());
+            new FormatterAvkon("%0 test %1").arg(100).toString());
 
         // Extra argument, no failure
         assertEquals(
             "100 test",
-            new Formatter("%0 test").arg(100).arg("test").toString());
+            new FormatterAvkon("%0 test").arg(100).arg("test").toString());
 
         Date testDate = new Date(1234567890); // 15/01/1970
         // Test case assumes emulator locale is default as EDateEuropean.
-        assertEquals("15/01/1970", new Formatter("%0").arg(testDate).toString());
+        assertEquals("15/01/1970", new FormatterAvkon("%0").arg(testDate).toString());
 
         Object obj = testDate;
-        assertEquals("15/01/1970", new Formatter("%0").arg(obj).toString());
+        assertEquals("15/01/1970", new FormatterAvkon("%0").arg(obj).toString());
 
         obj = new Integer(1);
-        assertEquals("1", new Formatter("%0").arg(obj).toString());
+        assertEquals("1", new FormatterAvkon("%0").arg(obj).toString());
 
         obj = new String("me");
-        assertEquals("Test me", new Formatter("Test %0").arg(obj).toString());
+        assertEquals("Test me", new FormatterAvkon("Test %0").arg(obj).toString());
 
         // Test skip not supported type
         obj = new Boolean(false);
-        assertEquals("Test %0", new Formatter("Test %0").arg(obj).toString());
+        assertEquals("Test %0", new FormatterAvkon("Test %0").arg(obj).toString());
 
         // Test MAX %1U[08]
         assertEquals(
             "Test testMyTe 100",
-            new Formatter("Test %1U[08] %0N").arg(100).arg("testMyTest").toString());
+            new FormatterAvkon("Test %1U[08] %0N").arg(100).arg("testMyTest").toString());
 
         // Test %U[]
         assertEquals(
             "Test testMyTest",
-            new Formatter("Test %U[]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %U[]").arg("testMyTest").toString());
 
         // Test %U[08]
         assertEquals(
             "Test testMyTe",
-            new Formatter("Test %U[08]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %U[08]").arg("testMyTest").toString());
 
         // Test %0[]
         assertEquals(
             "Test testMyTest",
-            new Formatter("Test %0[]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %0[]").arg("testMyTest").toString());
 
         // Test %0[08]
         assertEquals(
             "Test testMyTe",
-            new Formatter("Test %0[08]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %0[08]").arg("testMyTest").toString());
 
         // Test %U[20  Skip
         assertEquals(
             "Test %U[20",
-            new Formatter("Test %U[20").arg("testMyTest").toString());
+            new FormatterAvkon("Test %U[20").arg("testMyTest").toString());
 
         // Test %U[300]
         assertEquals(
             "Test testMyTest",
-            new Formatter("Test %U[300]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %U[300]").arg("testMyTest").toString());
 
         // Test %U[8]
         assertEquals(
             "Test testMyTe",
-            new Formatter("Test %U[8]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %U[8]").arg("testMyTest").toString());
 
         // Test Max is higher than actual string. Expected output: whole string no padding.
         assertEquals(
             "Test testMyTest",
-            new Formatter("Test %U[80]").arg("testMyTest").toString());
+            new FormatterAvkon("Test %U[80]").arg("testMyTest").toString());
 
         // Test Max is higher than pattern and string is shorter than pattern.
         assertEquals(
             "t to",
-            new Formatter("t %U[09]").arg("to").toString());
+            new FormatterAvkon("t %U[09]").arg("to").toString());
 
         // Test 0 len Max
         assertEquals(
             "t ",
-            new Formatter("t %U[00]").arg("to").toString());
+            new FormatterAvkon("t %U[00]").arg("to").toString());
 
         // Test 1 len Max
         assertEquals(
             "t 1",
-            new Formatter("t %U[01]").arg("12").toString());
+            new FormatterAvkon("t %U[01]").arg("12").toString());
 
         // Test 0 len Max with 0 len replacement
         assertEquals(
             "t ",
-            new Formatter("t %U[00]").arg("").toString());
+            new FormatterAvkon("t %U[00]").arg("").toString());
 
         // Test 1 len Max with 1 len replacement
         assertEquals(
             "t 1",
-            new Formatter("t %U[01]").arg("1").toString());
+            new FormatterAvkon("t %U[01]").arg("1").toString());
+    }
+
+    void testFormatterQt()
+    {
+        try
+        {
+            ResourceLoaderQt res =
+                (ResourceLoaderQt)ResourceLoaderQt.getInstance(
+                    "common", "txt_common_");
+
+            // Zero argument
+            assertEquals(
+                "Test",
+                new FormatterQt(res, "Test").toString());
+
+            // One argument tests
+            assertEquals(
+                "Test 100",
+                new FormatterQt(res, "Test %1").arg(100).toString());
+
+            assertEquals(
+                "Test 100",
+                new FormatterQt(res, "Test %L1").arg(100).toString());
+
+            assertEquals(
+                "Test AAA",
+                new FormatterQt(res, "Test %1").arg("AAA").toString());
+
+            assertEquals(
+                "Test A",
+                new FormatterQt(res, "Test %1").arg('A').toString());
+
+            // Two argument tests
+            assertEquals(
+                "Test test 100",
+                new FormatterQt(res, "Test %2 %L1").arg(100).arg("test").toString());
+
+            assertEquals(
+                "100 test test",
+                new FormatterQt(res, "%1 test %2").arg(100).arg("test").toString());
+
+            assertEquals(
+                "Test A B C",
+                new FormatterQt(res, "Test %1 %2 %3").arg('A').arg('B').arg('C').toString());
+
+            // Two argument tests with array
+            assertEquals(
+                "Test test 100",
+                new FormatterQt(res, "Test %2 %L1").format(new Object[]
+                {
+                    new Integer(100), "test"
+                }));
+
+            assertEquals(
+                "100 test test",
+                new FormatterQt(res, "%1 test %2").format(new Object[]
+                {
+                    new Integer(100), "test"
+                }));
+
+            // Missing argument, no failure, just unreplaced parameter
+            assertEquals(
+                "100 test %2",
+                new FormatterQt(res, "%1 test %2").arg(100).toString());
+
+            // Extra argument, no failure
+            assertEquals(
+                "100 test",
+                new FormatterQt(res, "%1 test").arg(100).arg("test").toString());
+
+            Date testDate = new Date(1234567890); // 15/01/1970
+            assertEquals("date1 15/01/1970",
+                         new FormatterQt(res, "date1 %1").arg(testDate).toString());
+
+            Object obj = testDate;
+            assertEquals("date2 15/01/1970",
+                         new FormatterQt(res, "date2 %1").arg(obj).toString());
+
+            assertEquals("date3 15/01/1970",
+                         new FormatterQt(res, "date3 %1").format(
+                             new Object[] { obj }));
+
+            obj = new Integer(1);
+            assertEquals("1", new FormatterQt(res, "%1").arg(obj).toString());
+
+            obj = new String("me");
+            assertEquals(
+                "Test me",
+                new FormatterQt(res, "Test %1").arg(obj).toString());
+
+            // Test skip not supported type
+            obj = new Boolean(false);
+            assertEquals(
+                "Test %1",
+                new FormatterQt(res, "Test %1").arg(obj).toString());
+
+            // Test MAX %[8]2
+            //assertEquals(
+            //    "Test testMyTe 100",
+            //    new FormatterQt(res, "Test %[8]2 %1").arg(100).arg("testMyTest").toString());
+
+            // Test %[] Skip
+            assertEquals(
+                "Test %[]",
+                new FormatterQt(res, "Test %[]").arg("testMyTest").toString());
+
+            // Test %[]1 Skip
+            assertEquals(
+                "Test %[]1",
+                new FormatterQt(res, "Test %[]1").arg("testMyTest").toString());
+
+            // Test %[20  Skip
+            assertEquals(
+                "Test %[20",
+                new FormatterQt(res, "Test %[20").arg("testMyTest").toString());
+
+            // Test %[08]1
+            assertEquals(
+                "Test testMyTe\u2026",
+                new FormatterQt(res, "Test %[08]1").arg("testMyTest").toString());
+
+            // Test %[300]1
+            assertEquals(
+                "Test testMyTest",
+                new FormatterQt(res, "Test %[300]1").arg("testMyTest").toString());
+
+            // Test Max is higher than pattern and result is shorter than pattern.
+            assertEquals(
+                "t to",
+                new FormatterQt(res, "t %[09]1").arg("to").toString());
+
+            // Test 0 len Max
+            assertEquals(
+                "t \u2026",
+                new FormatterQt(res, "t %[00]1").arg("to").toString());
+
+            // Test 1 len Max
+            assertEquals(
+                "t 1\u2026",
+                new FormatterQt(res, "t %[01]1").arg("12").toString());
+
+            // Test 0 len Max with 0 len replacement
+            assertEquals(
+                "t ",
+                new FormatterQt(res, "t %[00]1").arg("").toString());
+
+            // Test 1 len Max with 1 len replacement
+            assertEquals(
+                "t 1",
+                new FormatterQt(res, "t %[01]1").arg("1").toString());
+
+            // Plurality form tests
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    void testResourceLoaderAvkon()
+    {
+        doResourceLoaderAvkonTest("testresource", "test_", "", "");
+        doResourceLoaderAvkonTest("testresource,testresource2", "test_,test2_", "", "");
+        doResourceLoaderAvkonTest("testresource2,testresource", "unknown_prefix_,test_", "", "");
+        doResourceLoaderAvkonTest("testresource2,testresource", "unknown_prefix_,test_", "dummy,", "dummy,");
+        doResourceLoaderAvkonTest("testresource", "test_,unknown_prefix_", "", "");
     }
 
-    void resourceLoaderTest()
+    private void doResourceLoaderAvkonTest(
+        String resourceFilename, String resourcePrefix,
+        String inPrefix, String outPrefix)
     {
-
-        ResourceLoader res = new ResourceLoader("testresource", "test_");
+        try
+        {
+            ResourceLoader res =
+                ResourceLoaderAvkon.getInstance(resourceFilename, resourcePrefix);
 
-        // Test existing
-        assertEquals(
-            "id1 test",
-            res.format("id_1").arg("test").toString());
-        assertEquals(
-            "id2 test2",
-            res.format("id_2").arg("test2").toString());
-        assertEquals(
-            "id3 test3",
-            res.format("id_3").arg("test3").toString());
+            // Test existing
+            assertEquals(
+                "id1 test",
+                res.format(inPrefix + "id_1").arg("test").toString());
+            assertEquals(
+                "id2 test2",
+                res.format(inPrefix + "id_2").arg("test2").toString());
+            assertEquals(
+                "id3 test3",
+                res.format(inPrefix + "id_3").arg("test3").toString());
 
-// Test full name
-        assertEquals(
-            "id1 test",
-            res.format("test_id_1").arg("test").toString());
-// Test non-existing, with prefix
-        assertEquals(
-            "test_id_notfound",
-            res.format("test_id_notfound").arg("test3").toString());
+            // Test fetching the same text again
+            assertEquals(
+                "id1 test",
+                res.format(inPrefix + "id_1").arg("test").toString());
+
+            // Test full name
+            assertEquals(
+                "id1 test",
+                res.format(inPrefix + "id_1").arg("test").toString());
 
-        // Test non-existing, without prefix
-        assertEquals(
-            "test_id_notfound",
-            res.format("id_notfound").arg("test3").toString());
+            // Test non-existing, with prefix
+            assertTrue(
+                inPrefix + "id_notfound does not result " + outPrefix + "id_notfound",
+                res.format(inPrefix + "id_notfound").arg("test3").toString().endsWith(outPrefix + "id_notfound"));
 
-        // Test array
-        assertEquals(
-            "id3 test3",
-            res.format("id_3", new Object[] {"test3"}));
+            // Test non-existing, without prefix
+            assertTrue(
+                inPrefix + "id_notfound does not result " + outPrefix + "id_notfound",
+                res.format(inPrefix + "id_notfound").arg("test3").toString().endsWith(outPrefix + "id_notfound"));
 
-        // Test enter decoding.
-        assertEquals(
-            "id4 \n test4 \n",
-            res.format("id_4").arg("test4").toString());
+            // Test array
+            assertEquals(
+                "id3 test3",
+                res.format(inPrefix + "id_3", new Object[] {"test3"}));
 
-        // Test backlash decoding.
-        assertEquals(
-            "\\id5 \\ test5",
-            res.format("id_5").arg("test5").toString());
+            // Test enter decoding.
+            assertEquals(
+                "id4 \n test4 \n",
+                res.format(inPrefix + "id_4").arg("test4").toString());
 
-        // Test double-quote decoding.
-        assertEquals(
-            "id6 \"\" test6",
-            res.format("id_6").arg("test6").toString());
+            // Test backlash decoding.
+            assertEquals(
+                "\\id5 \\ test5",
+                res.format(inPrefix + "id_5").arg("test5").toString());
 
-        // Test single-quote decoding.
-        assertEquals(
-            "id7 \' test7",
-            res.format("id_7").arg("test7").toString());
+            // Test double-quote decoding.
+            assertEquals(
+                "id6 \"\" test6",
+                res.format(inPrefix + "id_6").arg("test6").toString());
 
-        // Test tabulator decoding.
-        assertEquals(
-            "id8\ttest8",
-            res.format("id_8").arg("test8").toString());
+            // Test single-quote decoding.
+            assertEquals(
+                "id7 \' test7",
+                res.format(inPrefix + "id_7").arg("test7").toString());
+
+            // Test tabulator decoding.
+            assertEquals(
+                "id8\ttest8",
+                res.format(inPrefix + "id_8").arg("test8").toString());
 
-        // Test character code <0x20AC>
-        assertEquals(
-            "id9 It takes 800 \u20ac to win!",
-            res.format("id_9").arg(800).toString());
+            // Test character code <0x20AC>
+            assertEquals(
+                "id9 It takes 800 \u20ac to win!",
+                res.format(inPrefix + "id_9").arg(800).toString());
 
-        // Test two character codes.
-        assertEquals(
-            "id10 It takes \u20ac 800 \u20ac to win!",
-            res.format("id_10").arg(800).toString());
+            // Test two character codes.
+            assertEquals(
+                "id10 It takes \u20ac 800 \u20ac to win!",
+                res.format(inPrefix + "id_10").arg(800).toString());
 
-        // Test two character codes in a row. Test <0x20ac><0x20ac>
-        assertEquals(
-            "id11 It takes \u20ac\u20ac to win!",
-            res.format("id_11").toString());
+            // Test two character codes in a row. Test <0x20ac><0x20ac>
+            assertEquals(
+                "id11 It takes \u20ac\u20ac to win!",
+                res.format(inPrefix + "id_11").toString());
 
-        // Test only character code.
-        assertEquals(
-            "\u20ac",
-            res.format("id_12").toString());
+            // Test only character code.
+            assertEquals(
+                "\u20ac",
+                res.format(inPrefix + "id_12").toString());
 
-        // Test invalid character code.
-        assertEquals(
-            "id13 It <0x20A>to win!",
-            res.format("id_13").toString());
+            // Test invalid character code.
+            assertEquals(
+                "id13 It <0x20A>to win!",
+                res.format(inPrefix + "id_13").toString());
 
 
-        // Test character code as first character.
-        assertEquals(
-            "\u20ac id14",
-            res.format("id_14").toString());
+            // Test character code as first character.
+            assertEquals(
+                "\u20ac id14",
+                res.format(inPrefix + "id_14").toString());
+
+            // Test character code as last character.
+            assertEquals(
+                "id15 \u20ac",
+                res.format(inPrefix + "id_15").toString());
+
+            // Test invalid character.
+            assertEquals(
+                "id16 <0xG0AC>",
+                res.format(inPrefix + "id_16").toString());
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue("'" + resourceFilename + "', '" + resourcePrefix + "', '" +
+                       inPrefix + "', '" + outPrefix + "': " + t, false);
+        }
+    }
+
+    void testResourceLoaderQt()
+    {
+        try
+        {
+            ResourceLoader res =
+                ResourceLoaderQt.getInstance("common", "txt_common_");
+            assertEquals("OK", res.format("button_ok").toString());
+            // Test fetching the same text again
+            assertEquals("OK", res.format("button_ok").toString());
+
+            res = ResourceLoaderQt.getInstance("common_errors", "txt_");
+            assertEquals("Invalid installation package", res.format("error_info_installation_package_is_invalid").toString());
+            assertEquals("Unable to access server", res.format("error_info_no_server_access").toString());
+
+            res = ResourceLoaderQt.getInstance("common,javaapplicationinstaller", "txt_common_,txt_java_inst_");
+            assertEquals("Manufacturer", res.format("setlabel_cert_domain_val_manufacturer").toString());
+            // Test fetching the same text again
+            assertEquals("Manufacturer", res.format("setlabel_cert_domain_val_manufacturer").toString());
+
+            assertEquals(
+                "foo (bar)",
+                res.format("info_app_suite_name_version").arg("foo").arg("bar").toString());
+            // Test fetching the same text again
+            assertEquals(
+                "foo (bar)",
+                res.format("info_app_suite_name_version").arg("foo").arg("bar").toString());
+
+
+            assertEquals(
+                "text_not_found",
+                res.format("text_not_found").arg("foo").toString());
+            // Test fetching the same text again
+            assertEquals(
+                "text_not_found",
+                res.format("text_not_found").arg("foo").toString());
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
 
-        // Test character code as last character.
-        assertEquals(
-            "id15 \u20ac",
-            res.format("id_15").toString());
+    void testNumerusQt()
+    {
+        try
+        {
+            ResourceLoader res =
+                ResourceLoaderQt.getInstance("clock", "txt_clock_");
+            assertEquals("1 hr", res.format("dblist_daily_val_ln_hr").argn(1).toString());
+            assertEquals("5 hrs", res.format("dblist_daily_val_ln_hr").argn(5).toString());
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    void testResourceLoaderCreate()
+    {
+        try
+        {
+            // Create Avkon ResourceLoader with unknown resource.
+            ResourceLoader rl = ResourceLoader.getInstance(
+                "unknown_resource_1", "unknown_prefix", null, null);
+            ResourceLoader rl2 = ResourceLoader.getInstance(
+                "unknown_resource_1", "unknown_prefix", null, null);
+            assertTrue("1: null ResourceLoader", rl != null);
+            assertTrue("1: not Avkon ResourceLoader", rl instanceof ResourceLoaderAvkon);
+            assertTrue("1: not same ResourceLoader instance", rl == rl2);
+
+            // Create Qt ResourceLoader with known resource.
+            rl = ResourceLoader.getInstance(
+                null, null, "common", "txt_");
+            rl2 = ResourceLoader.getInstance(
+                null, null, "common", "txt_");
+            assertTrue("2: null ResourceLoader", rl != null);
+            if (ResourceLoader.getLocaleIdQt() == null)
+            {
+                assertTrue("2: not Avkon ResourceLoader", rl instanceof ResourceLoaderAvkon);
+            }
+            else
+            {
+                assertTrue("2: not Qt ResourceLoader", rl instanceof ResourceLoaderQt);
+            }
+            assertTrue("2: not same ResourceLoader instance", rl == rl2);
 
-        // Test invalid character.
-        assertEquals(
-            "id16 <0xG0AC>",
-            res.format("id_16").toString());
+            // When Qt resource is not found, Avkon ResourceLoader should
+            // be returned.
+            rl = ResourceLoader.getInstance(
+                null, null, "unknown_resource_2", "unknown_prefix");
+            rl2 = ResourceLoader.getInstance(
+                null, null, "unknown_resource_2", "unknown_prefix");
+            assertTrue("3: null ResourceLoader", rl != null);
+            assertTrue("3: not Avkon ResourceLoader", rl instanceof ResourceLoaderAvkon);
+            assertTrue("3: not same ResourceLoader instance", rl == rl2);
+
+            if (ResourceLoader.getLocaleIdQt() != null)
+            {
+                try
+                {
+                    // Check that correct exception is thrown for
+                    // unknown Qt resource.
+                    rl = ResourceLoaderQt.getInstance(
+                        "unknown_resource_3", "unknown_prefix");
+                    assertTrue("no exception for unknown Qt resource", false);
+                }
+                catch (IllegalArgumentException iae)
+                {
+                    // Expected exception
+                }
+            }
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
+    }
+
+    void testResourceLoaderDestroy()
+    {
+        try
+        {
+            ResourceLoader.destroyAll();
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace();
+            assertTrue(t.toString(), false);
+        }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/localisation/loc/testresource2.loc	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 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 is a test resource file, utf-8 encoded (also works as Latin1, as no >128 chars)
+
+#define test2_id_1 "id1 %1"
+#define   test2_id_2 "id2 %1"
+
+#define   test2_id_3   "id3 %1"
+
+#define   test2_id_4   "id4 \n %1 \n"
+
+#define   test2_id_5   "\\id5 \\ %1"
+
+#define   test2_id_6   "id6 \"\" %1"
+
+#define   test2_id_7   "id7 \' %1"
+
+#define   test2_id_8   "id8\t%1"
+
+#define   test2_id_9   "id9 It takes %1 <0x20AC> to win!"
+
+#define   test2_id_10   "id10 It takes <0x20AC> %1 <0x20AC> to win!"
+
+#define   test2_id_11   "id11 It takes <0x20AC><0x20AC> to win!"
+
+#define   test2_id_12   "<0x20AC>"
+
+#define   test2_id_13   "id13 It <0x20A>to win!"
+
+#define   test2_id_14   "<0x20AC> id14"
+
+#define   test2_id_15   "id15 <0x20AC>"
+
+#define   test2_id_16   "id16 <0xG0AC>"
--- a/javacommons/utils/tsrc/rtsupport/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-<!--
-#
-# Copyright (c) 2008-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: 
-#
--->
-
-<project name="javaruntimesupporttest" default="deploy" basedir=".">
-
-  <import file="../../../../../../build/utilities.xml"/>
-
-    <property name="bootclasspath" value="${bootclasspath.cdc}"/>
-
-    <target name="add.classes.to.collection.jar">
-    </target>
-
-    <target name="system.properties">
-      <properties>
-          test.version=2.3
-          test2.version=1.0-SUBSET
-          test3=::COLONS
-          test.dynamic=:test.Property
-          test.dynamic2=:test.Property2
-      </properties>
-    </target>
-
-</project>
--- a/javacommons/utils/tsrc/rtsupport/build/javaruntimesupporttest.pro	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# 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: 
-#
-
-TEMPLATE=lib
-TARGET=javaruntimesupporttest
-CONFIG += omj java javaonly stl
-CONFIG -= qt
-
-include(../../../../../build/omj.pri)
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/properties/test/Property.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 com.nokia.mj.impl.properties.test;
-
-import com.nokia.mj.impl.rt.support.SystemPropertyProvider;
-
-/**
- * A class for handling dynamic system properties of File API. In order to speed
- * the search all the property names are stored into two Hashtables except for
- * fileconn.dir.private and fileconn.dir.roots.names properties.
- */
-public class Property implements SystemPropertyProvider
-{
-
-
-    private static int mCounter = 0;
-
-    /* (non-Javadoc)
-     * @see com.nokia.mj.impl.rt.DynamicProperty#getProperty(com.nokia.mj.impl.rt.DynamicPropertyInfo)
-     */
-    public String getProperty(String key)
-    {
-        //Get the asked property name.
-        System.out.println("  test.Property");
-        mCounter++;
-        return key +" DynamicValue ("+mCounter+")";
-    }
-    public boolean isStatic(String key)
-    {
-        return false;
-    }
-}
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/properties/test/Property2.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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 com.nokia.mj.impl.properties.test;
-
-import com.nokia.mj.impl.rt.support.SystemPropertyProvider;
-
-/**
- * A class for handling dynamic system properties of File API. In order to speed
- * the search all the property names are stored into two Hashtables except for
- * fileconn.dir.private and fileconn.dir.roots.names properties.
- */
-public class Property2 implements SystemPropertyProvider
-{
-
-    public String getProperty(String key)
-    {
-        //Get the asked property name.
-        System.out.println("  test.Property2");
-        return key +" DynamicValue2";
-
-    }
-    public boolean isStatic(String key)
-    {
-        return true;
-    }
-}
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/midptest/ApplicationInfoImpl.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.midptest;
-
-import com.nokia.mj.impl.utils.Uid;
-import com.nokia.mj.impl.rt.support.ApplicationInfo;
-
-/**
- *
- * @author Nokia Corporation
- * @version 1.0
- */
-
-public class ApplicationInfoImpl extends ApplicationInfo
-{
-
-    /**
-     */
-    public String getRuntimeType()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getRuntimeType()");
-        return "MIDP_TEST";
-    }
-
-    /**
-     */
-    public String getProtectionDomain()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getProtectionDomain()");
-        return "TEST TTPD";
-    }
-
-    /**
-     */
-    public Uid getUid()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getUid()");
-        int tmpUid = 1234;
-        return Uid.createUid(Integer.toString(tmpUid));
-    }
-
-    /**
-     */
-    public Uid getSuiteUid()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getSuiteUid()");
-        int tmpUid = 5678;
-        return Uid.createUid(Integer.toString(tmpUid));
-    }
-
-    /**
-     */
-    public String getSuiteName()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getSuiteName()");
-        return "Test Suite";
-    }
-
-    /**
-     */
-    public String getName()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getName()");
-        return "Test Name";
-    }
-
-    /**
-     */
-    public String getVendor()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getVendor()");
-        return "Nokia Test";
-    }
-
-    /**
-     */
-    public String getVersion()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getVersion()");
-        return "1.2.3";
-    }
-
-    /**
-     */
-    public String getRootPath()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getRootPath()");
-        return "/home/";
-    }
-
-    /**
-     */
-    public String getMainClass()
-    {
-        System.out.println("(test) ApplicationInfoImpl.getMainClass()");
-        return "TestMainClass";
-    }
-
-    /**
-     */
-    public String getAttribute(String key)
-    {
-        System.out.println("(test) ApplicationInfoImpl.getAttribute()");
-        return "Test Attribute";
-    }
-}
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/midptest/ApplicationUtilsImpl.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.midptest;
-
-import java.security.Permission;
-import java.security.AccessControlException;
-
-import com.nokia.mj.impl.rt.support.ApplicationUtils;
-import com.nokia.mj.impl.rt.support.ApplicationInfo;
-import com.nokia.mj.impl.rt.support.PromptTextProvider;
-
-/**
- * @author Nokia Corporation
- * @version 1.0
- */
-public class ApplicationUtilsImpl extends ApplicationUtils
-{
-    public static void doShutdownImpl()
-    {
-//        sInstance.doShutdown();
-        ((ApplicationUtilsImpl)sInstance).doShutdown();
-    }
-
-
-    public void notifyExitCmd()
-    {
-        System.out.println("(test) ApplicationUtilsImpl.notifyExitCmd()");
-    }
-
-    public void checkPermission(Permission p)
-    throws AccessControlException,
-                NullPointerException
-    {
-        System.out.println("(test) ApplicationUtilsImpl.checkPermission()");
-    }
-
-    public void checkPermission(Permission p, String textPrompt)
-    throws AccessControlException,
-                NullPointerException
-    {
-        System.out.println("(test) ApplicationUtilsImpl.checkPermission(2)");
-        throw new AccessControlException("Denied ");
-    }
-
-    public void checkPermission(Permission p, PromptTextProvider provider)
-    throws AccessControlException,
-                NullPointerException
-    {
-        System.out.println("(test) ApplicationUtilsImpl.checkPermission(3)");
-    }
-}
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/midptest/MidpTest.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.midptest;
-
-public final class MidpTest
-{
-    public static void main(String[] args)
-    {
-        try
-        {
-            Class.forName("com.nokia.mj.impl.rt.test.TestMain").newInstance();
-        }
-        catch (Throwable th)
-        {
-        }
-        ApplicationUtilsImpl.doShutdownImpl();
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/FinalizerStatistics.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
-* 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:
-*
-*/
-package com.nokia.mj.impl.rt.test;
-
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-public class FinalizerStatistics
-{
-    private static Hashtable references;
-
-    static
-    {
-        references = new Hashtable();
-    }
-
-
-    /** Class to keep count of finalizable objects */
-    static private class Refcount
-    {
-        /** Current number of alive objects of the class */
-        int count;
-
-        /** Name of the class */
-        String clazz;
-        private Refcount(String cls)
-        {
-            count = 1;
-            clazz = cls;
-        }
-    }
-
-    public static void debugFinalizeCreated(String clazz)
-    {
-        System.out.println("Finalizable created: " + clazz);
-        // Add reference to hash
-        synchronized (references)
-        {
-            Refcount r = (Refcount)references.get(clazz);
-            if (r != null)
-            {
-                r.count++;
-            }
-            else
-            {
-                references.put(clazz, new Refcount(clazz));
-            }
-        }
-    }
-
-    public static void debugFinalize(String clazz)
-    {
-        System.out.println("Finalizable destroyed " + clazz);
-        // Reduce reference
-        synchronized (references)
-        {
-            Refcount r = (Refcount)references.get(clazz);
-            r.count--;
-        }
-    }
-
-    public static void printStatus()
-    {
-        synchronized (references)
-        {
-            StringBuffer sb = new StringBuffer();
-            sb.append("Finalizable objects\n");
-            Enumeration e = references.elements();
-            boolean empty = true;
-            while (e.hasMoreElements())
-            {
-                Refcount r = (Refcount)e.nextElement();
-
-                if (r != null)
-                {
-                    if (r.count != 0)
-                    {
-                        empty = false;
-                    }
-                    sb.append("  class=" + r.clazz +
-                              " count="  + r.count + "\n");
-                }
-            }
-            sb.append("\nStatus ");
-            if (empty)
-            {
-                sb.append("ALL FINALIZED");
-            }
-            else
-            {
-                sb.append("OBJECTS WAITING FOR FINALIZATION");
-            }
-            references = null;
-            references = new Hashtable();
-            System.out.println(sb.toString());
-        }
-    }
-}
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test1.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.test;
-
-import com.nokia.mj.impl.rt.support.*;
-
-public final class Test1
-{
-    private Finalizer mFinalizer;
-
-    static
-    {
-        if (!TestMain.useAnonymousApproach)
-        {
-            JvmInternal.enableFinalization(Test1.class);
-        }
-    }
-
-    public Test1()
-    {
-        FinalizerStatistics.debugFinalizeCreated(getClass().getName());
-        if (TestMain.useAnonymousApproach)
-        {
-            mFinalizer = new Finalizer()
-            {
-                public void finalizeImpl()
-                {
-                    doFinalize();
-                }
-            };
-        }
-    }
-
-    public void finalize()
-    {
-        doFinalize();
-    }
-    void doFinalize()
-    {
-        if (mFinalizer != null)
-        {
-            mFinalizer = null;
-            FinalizerStatistics.debugFinalize(getClass().getName());
-        }
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test2.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.test;
-
-import com.nokia.mj.impl.rt.support.*;
-
-public final class Test2
-{
-    private Finalizer mFinalizer;
-
-    static
-    {
-        if (!TestMain.useAnonymousApproach)
-        {
-            JvmInternal.enableFinalization(Test2.class);
-        }
-    }
-
-    public Test2()
-    {
-        FinalizerStatistics.debugFinalizeCreated(getClass().getName());
-        if (TestMain.useAnonymousApproach)
-        {
-            mFinalizer = new Finalizer()
-            {
-                public void finalizeImpl()
-                {
-                    doFinalize();
-                }
-            };
-        }
-    }
-
-    public void finalize()
-    {
-        doFinalize();
-    }
-    void doFinalize()
-    {
-        if (mFinalizer != null)
-        {
-            mFinalizer = null;
-            FinalizerStatistics.debugFinalize(getClass().getName());
-        }
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test3.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.test;
-
-import com.nokia.mj.impl.rt.support.*;
-
-public final class Test3
-{
-    private Finalizer mFinalizer;
-
-    static
-    {
-        if (!TestMain.useAnonymousApproach)
-        {
-            JvmInternal.enableFinalization(Test3.class);
-        }
-    }
-
-    public Test3()
-    {
-        FinalizerStatistics.debugFinalizeCreated(getClass().getName());
-        if (TestMain.useAnonymousApproach)
-        {
-            mFinalizer = new Finalizer()
-            {
-                public void finalizeImpl()
-                {
-                    doFinalize();
-                }
-            };
-        }
-    }
-
-    public void finalize()
-    {
-        doFinalize();
-    }
-    void doFinalize()
-    {
-        if (mFinalizer != null)
-        {
-            mFinalizer = null;
-            FinalizerStatistics.debugFinalize(getClass().getName());
-        }
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test4.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.test;
-
-import com.nokia.mj.impl.rt.support.*;
-
-public final class Test4
-{
-    private Finalizer mFinalizer;
-
-    static
-    {
-        if (!TestMain.useAnonymousApproach)
-        {
-            JvmInternal.enableFinalization(Test4.class);
-        }
-    }
-
-    public Test4()
-    {
-        FinalizerStatistics.debugFinalizeCreated(getClass().getName());
-        if (TestMain.useAnonymousApproach)
-        {
-            mFinalizer = new Finalizer()
-            {
-                public void finalizeImpl()
-                {
-                    doFinalize();
-                }
-            };
-        }
-    }
-
-    public void finalize()
-    {
-        doFinalize();
-    }
-    void doFinalize()
-    {
-        if (mFinalizer != null)
-        {
-            mFinalizer = null;
-            FinalizerStatistics.debugFinalize(getClass().getName());
-        }
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test5.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.test;
-
-import com.nokia.mj.impl.rt.support.*;
-
-public final class Test5
-{
-    private Finalizer mFinalizer;
-
-    static
-    {
-        if (!TestMain.useAnonymousApproach)
-        {
-            JvmInternal.enableFinalization(Test5.class);
-        }
-    }
-
-    public Test5()
-    {
-        FinalizerStatistics.debugFinalizeCreated(getClass().getName());
-        if (TestMain.useAnonymousApproach)
-        {
-            mFinalizer = new Finalizer()
-            {
-                public void finalizeImpl()
-                {
-                    doFinalize();
-                }
-            };
-        }
-    }
-
-    public void finalize()
-    {
-        doFinalize();
-    }
-    void doFinalize()
-    {
-        if (mFinalizer != null)
-        {
-            mFinalizer = null;
-            FinalizerStatistics.debugFinalize(getClass().getName());
-        }
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/Test6.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.test;
-
-import com.nokia.mj.impl.rt.support.*;
-
-public final class Test6
-{
-    private Finalizer mFinalizer = new Finalizer()
-    {
-        public void finalizeImpl()
-        {
-            doFinalize();
-        }
-    };
-
-    public Test6()
-    {
-        FinalizerStatistics.debugFinalizeCreated(getClass().getName());
-    }
-
-    public void finalize()
-    {
-        doFinalize();
-    }
-    void doFinalize()
-    {
-        if (mFinalizer != null)
-        {
-            mFinalizer = null;
-            FinalizerStatistics.debugFinalize(getClass().getName());
-        }
-    }
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/TestMain.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,231 +0,0 @@
-/*
-* 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:
-*
-*/
-package com.nokia.mj.impl.rt.test;
-
-/*
--jcl:cdc11:nokiaextcdc -Dcom.nokia.jvm.port=j9.JvmPortCdc -Dcom.nokia.rt.port=midptest -Dcom.ibm.j9.ext.dirs=c:\java\jsr\classes\ -Dno_anonymous com.nokia.mj.impl.rt.midptest.MidpTest
--jcl:cldc11:nokiaextcldc -Dcom.nokia.jvm.port=j9.JvmPortCldc -Dcom.nokia.rt.port=midptest -Dcom.ibm.j9.ext.dirs=c:\java\jsr\classes\ -Dno_anonymous com.nokia.mj.impl.rt.midptest.MidpTest
-
-java -Djava.ext.dirs=z:\epoc32\winscw\c\java\jsr\classes -Dcom.nokia.jvm.port=sun.JvmPortJ2se -Dcom.nokia.rt.port=midptest com.nokia.mj.impl.rt.midptest.MidpTest
-java -Djava.ext.dirs=${JAVA_BIN_ROOT}/jsr/classes -Dcom.nokia.jvm.port=sun.JvmPortJ2se -Dcom.nokia.rt.port=midptest com.nokia.mj.impl.rt.midptest.MidpTest
-
-
-
-AccessControllerImpl:
-
-    private void init()
-    {
-        this.MSID = MSID;
-//        grantedPermissions = null; // Read it from the storage
-        grantedPermissions = new PolicyBasedPermission[1]; // Read it from the storage
-        PolicyBasedPermissionImpl pi = new PolicyBasedPermissionImpl("com.nokia.mj.impl.rt.test.TestPermission","",null, 0);
-        grantedPermissions[0] = pi;
-        securityPromptHandler = new SecurityPromptHandler();
-    }
-
-*/
-
-import com.nokia.mj.impl.rt.support.*;
-import java.security.AccessControlException;
-
-public final class TestMain
-{
-    static boolean useAnonymousApproach = true;
-
-    public TestMain()
-    {
-        System.out.println("***TestMain()***\n");
-        System.out.println("java.version: " + System.getProperty("java.version"));
-        System.out.println("java.fullversion: " + System.getProperty("java.fullversion")+"\n");
-
-        System.out.println("Test starts ");
-
-        try
-        {
-            try
-            {
-                JvmInternal.enableRuntimeExit();
-            }
-            catch (Throwable th)
-            {
-            }
-//            Jvm.loadSystemLibrary("");
-
-            TestPermission p = new TestPermission("Test");
-            try
-            {
-                ApplicationUtils.getInstance().checkPermission(p);
-                System.out.println("TestPermission1 ACCEPTED.");
-            }
-            catch (AccessControlException a)
-            {
-                System.out.println("TestPermission1 DENIED.");
-            }
-            catch (Throwable th)
-            {
-                System.out.println("TestPermission1 FAILED: " + th);
-                th.printStackTrace();
-            }
-
-            try
-            {
-                ApplicationUtils.getInstance().checkPermission(p,
-                        new PromptTextProvider()
-                {
-                    public String[] getText()
-                    {
-                        String[] sa = new String[1];
-                        sa[0] = "The Text";
-                        return sa;
-                    }
-                    public String getText(int index)
-                    {
-                        if (index == 0)
-                        {
-                            return "The Text";
-                        }
-                        return null;
-                    }
-                }
-                                                              );
-                System.out.println("TestPermission3 ACCEPTED.");
-            }
-            catch (AccessControlException a)
-            {
-                System.out.println("TestPermission3 DENIED.");
-            }
-            catch (Throwable th)
-            {
-                System.out.println("TestPermission3 FAILED: " + th);
-                th.printStackTrace();
-            }
-
-
-            ApplicationInfo appInfo = ApplicationInfo.getInstance();
-
-            System.out.println("getRuntimeType: " + appInfo.getRuntimeType());
-            System.out.println("getProtectionDomain: " + appInfo.getProtectionDomain());
-            System.out.println("getUid: " + appInfo.getUid());
-            System.out.println("getSuiteUid: " + appInfo.getSuiteUid());
-            System.out.println("getSuiteName: " + appInfo.getSuiteName());
-            System.out.println("getName: " + appInfo.getName());
-            System.out.println("getVendor: " + appInfo.getVendor());
-            System.out.println("getVersion: " + appInfo.getVersion());
-            System.out.println("getRootPath: " + appInfo.getRootPath());
-            System.out.println("getMainClass: " + appInfo.getMainClass());
-            System.out.println("getAttribute: " + appInfo.getAttribute("MIDlet-1"));
-
-            System.out.println("no_anonymous: " + System.getProperty("no_anonymous"));
-            System.out.println("test.version: " + System.getProperty("test.version"));
-            System.out.println("test2.version: " + System.getProperty("test2.version"));
-            System.out.println("test3: " + System.getProperty("test3"));
-            System.out.println("test.dynamic: " + System.getProperty("test.dynamic"));
-            System.out.println("test.dynamic: " + System.getProperty("test.dynamic"));
-            System.out.println("test.dynamic2: " + System.getProperty("test.dynamic2"));
-            System.out.println("test.dynamic2: " + System.getProperty("test.dynamic2"));
-            try
-            {
-                System.setProperty("testColon", ":colon");
-                java.util.Properties pr = System.getProperties();
-                System.out.println("CDC test.version: " + pr.getProperty("test.version"));
-                System.out.println("CDC test.dynamic: " + pr.getProperty("test.dynamic"));
-                System.out.println("CDC test.dynamic2: " + pr.getProperty("test.dynamic2"));
-                System.out.println("CDC testColon: " + pr.getProperty("testColon"));
-//
-//                pr.list(System.out);
-//                pr.list(new java.io.PrintWriter(System.out));
-            }
-            catch (Throwable th)
-            {
-                System.out.println("Skipping CLDC "+th);
-                //th.printStackTrace();
-            }
-
-            if (System.getProperty("no_anonymous") != null)
-            {
-                useAnonymousApproach = false;
-            }
-            System.out.println("Using anonymous = " + useAnonymousApproach);
-            for (int k = 0; k< 1; k++)
-            {
-                new Test1();
-                new Test2();
-                new Test3();
-                new Test4();
-                new Test5();
-                new Test6();
-            }
-            System.gc();
-            System.gc();
-            JvmInternal.runFinalization();
-            useAnonymousApproach = false;
-            FinalizerStatistics.printStatus();
-
-            ApplicationUtils appUtils = ApplicationUtils.getInstance();
-            //Get the name of the application.
-            appUtils.addShutdownListener(new ShutdownListener()
-            {
-                public void shuttingDown()
-                {
-                    System.out.println("shuttingDown1");
-                }
-
-            });
-
-            appUtils.addShutdownListener(new ShutdownListener()
-            {
-                public void shuttingDown()
-                {
-                    System.out.println("shuttingDown2");
-                }
-
-            });
-
-            appUtils.addShutdownListener(new ShutdownListener()
-            {
-                public void shuttingDown()
-                {
-                    System.out.println("shuttingDown3");
-                }
-
-            });
-
-            appUtils.addShutdownListener(new ShutdownListener()
-            {
-                public void shuttingDown()
-                {
-                    System.out.println("shuttingDown4");
-                }
-
-            });
-
-            appUtils.notifyExitCmd();
-
-
-
-        }
-
-        catch (Throwable th)
-        {
-            System.err.println("Error in tests: "+th);
-            th.printStackTrace();
-        }
-        System.out.println("Test ends ");
-    }
-
-}
-
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/test/TestPermission.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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:
-*
-*/
-
-
-package com.nokia.mj.impl.rt.test;
-
-import java.security.Permission;
-
-public class TestPermission extends Permission
-{
-
-    public TestPermission(String permissionName)
-    {
-        super("TestPermission");
-        System.out.println("TestPermission.TestPermission()");
-    }
-
-    public boolean equals(Object obj)
-    {
-        System.out.println("TestPermission.equals");
-        return false;
-    }
-
-    public int hashCode()
-    {
-        System.out.println("TestPermission.hashCode");
-        return 0;
-    }
-
-    public String getActions()
-    {
-        System.out.println("TestPermission.getActions");
-        return "TestPermission Actions";
-    }
-
-    public boolean implies(Permission permission)
-    {
-        System.out.println("TestPermission.implies");
-        return true;
-    }
-}
--- a/javacommons/utils/tsrc/rtsupport/javasrc/com/nokia/mj/impl/rt/testvm/JvmPortTest.java	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
-* 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:
-*
-*/
-
-package com.nokia.mj.impl.rt.j9;
-
-import com.nokia.mj.impl.rt.JvmPort;
-import com.nokia.mj.impl.rt.support.ThreadEventListener;
-import com.nokia.mj.impl.rt.support.NativeMemoryBlock;
-import java.io.*;
-import java.util.Properties;
-import java.util.Enumeration;
-import com.nokia.mj.impl.rt.DynamicSystemPropertiesSun;
-
-/**
- *
- * @author Nokia Corporation
- * @version 1.0
- */
-
-public final class JvmPortTest extends JvmPort
-{
-    static
-    {
-        //The code below reads all the odc files from the location
-        //where the API jsr files are. It also enables the System
-        //property extension mechanism for Sun's J2SE vm.
-        try
-        {
-            String odcLocation = System.getProperty("java.ext.dirs");
-            // This filter only returns directories
-            File odcDir = new File(odcLocation);
-            FileFilter filter = new FileFilter()
-            {
-                public boolean accept(File f)
-                {
-                    if (f.getName().endsWith(".odc"))
-                    {
-                        return true;
-                    }
-                    return false;
-                }
-            };
-
-            File[] files = odcDir.listFiles(filter);
-            DynamicSystemPropertiesSun props = new DynamicSystemPropertiesSun();
-
-            Properties origProps = System.getProperties();
-            Enumeration keys = origProps.keys();
-            while (keys.hasMoreElements())
-            {
-                Object key = keys.nextElement();
-                props.put(key, origProps.get(key));
-            }
-
-            for (int i=0; i<files.length; i++)
-            {
-                BufferedReader input =
-                    new BufferedReader(new FileReader(files[i]));
-                try
-                {
-                    String line = null;
-                    while ((line = input.readLine()) != null)
-                    {
-                        if (line.startsWith("-D"))
-                        {
-                            String name = null;
-                            String value = null;
-                            int pos = line.indexOf("=");
-                            if (pos == -1)
-                            {
-                                name = line.substring(2);
-                                value = "";
-                            }
-                            else
-                            {
-                                name = line.substring(2,pos);
-                                value = line.substring(pos+1);
-                            }
-                            props.put(name, value);
-                        }
-                    }
-                }
-                finally
-                {
-                    input.close();
-                }
-            }
-            System.setProperties(props);
-        }
-        catch (Throwable t)
-        {
-            System.err.println("JvmPortJ2se: Exception: "+t);
-        }
-    }
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#loadSystemLibrary.
-     */
-    public final void loadSystemLibrary(String libName)
-    {
-        System.out.println("TestVm: loadSystemLibrary");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#loadApplicationClass.
-     */
-    public final Class loadApplicationClass(String name) throws ClassNotFoundException
-    {
-        System.out.println("TestVm: loadApplicationClass: "+name);
-        return null;
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#setThreadAsDaemon.
-     */
-    public final void setThreadAsDaemon(Thread thread, boolean daemon)
-    throws IllegalThreadStateException, SecurityException
-    {
-        System.out.println("TestVm: loadApplicationClass");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#runFinalization.
-     */
-    public final void runFinalization()
-    {
-        System.out.println("TestVm: runFinalization");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#enableFinalization.
-     */
-    public final void enableFinalization(Class clazz)
-    {
-        System.out.println("TestVm: enableFinalization");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#runYoungGenerationGc.
-     */
-    public final boolean runYoungGenerationGc()
-    {
-        System.out.println("TestVm: runYoungGenerationGc");
-        return false;
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#getResourceAsNativeMemory.
-     */
-    public final NativeMemoryBlock getResourceAsNativeMemory(String jarPath, String resName)
-    {
-        System.out.println("TestVm: getResourceAsNativeMemory");
-        return null;
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#disableRuntimeExit.
-     */
-    public final void disableRuntimeExit()
-    {
-        System.out.println("TestVm: disableRuntimeExit");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#enableRuntimeExit.
-     */
-    public final void enableRuntimeExit()
-    {
-        System.out.println("TestVm: enableRuntimeExit");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#exitVm.
-     */
-    public final void exitVm(int status)
-    {
-        System.out.println("TestVm: exitVm "+status);
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#setThreadEventListener.
-     */
-    public final void setThreadEventListener(ThreadEventListener listener)
-    {
-        System.out.println("TestVm: setThreadEventListener");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#addRestrictedPackagePrefixes.
-     */
-    public final void addRestrictedPackagePrefixes(String[] packageNames)
-    throws SecurityException
-    {
-        System.out.println("TestVm: addRestrictedPackagePrefixes");
-    }
-
-    /**
-     * @see com.nokia.mj.impl.runtimesupport.JvmPort#addProtectedPackagePrefixes.
-     */
-    public final void addProtectedPackagePrefixes(String[] packageNames)
-    throws SecurityException
-    {
-        System.out.println("TestVm: addProtectedPackagePrefixes");
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/tsrc/testdll/src/jvmporttest.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+#include <string>
+#include "com_nokia_mj_impl_rt_support_JvmPortTest.h"
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_rt_support_JvmPortTest__1getResource
+(JNIEnv* env, jobject, jlong ptr, jint len)
+{
+    std::string res((char*)ptr, len);
+    return env->NewStringUTF(res.c_str());
+}
+
--- a/javacommons/utils/tsrc/tst.bat	Mon Oct 04 11:29:25 2010 +0300
+++ b/javacommons/utils/tsrc/tst.bat	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,4 @@
-@rem
-@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem Copyright(c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 @rem All rights reserved.
 @rem This component and the accompanying materials are made available
 @rem under the terms of "Eclipse Public License v1.0"
@@ -13,12 +12,43 @@
 @rem
 @rem Description:
 @rem
-rem Script for running JavaCommonUtils unit tests from S60 eshell
+@rem Script for running JavaCommonUtils unit tests from S60 eshell
+cls
 javaunittester -mainclass=com.nokia.mj.impl.utils.LoggerTests
+javaunittester -Dcom.nokia.jvm.port=unexiting -mainclass=com.nokia.mj.impl.utils.LoggerTests
+javaunittester -conf=cdc -Dcom.nokia.jvm.port=unexiting -mainclass=com.nokia.mj.impl.utils.LoggerTests
 javaunittester -mainclass=com.nokia.mj.impl.utils.BufferedReaderTests
 javaunittester -mainclass=com.nokia.mj.impl.utils.concurrent.ConcurrentTests
 javaunittester -mainclass=com.nokia.mj.impl.rt.SystemPropertyTests
 javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.SystemPropertyTests
 javaunittester -conf=foundation -mainclass=com.nokia.mj.impl.rt.SystemPropertyTests
 javaunittester -mainclass=com.nokia.mj.impl.utils.DebugUtilsTests
+javaunittester -Dcom.nokia.rt.port=test -mainclass=com.nokia.mj.impl.rt.support.ApplicationUtilsTest 1111
+javaunittester -Dcom.nokia.rt.port=test -mainclass=com.nokia.mj.impl.rt.support.ApplicationUtilsTest 00001
+javaunittester -Dcom.nokia.rt.port=test -mainclass=com.nokia.mj.impl.rt.support.ApplicationUtilsTest 000001
+javaunittester -Dcom.nokia.rt.port=test -mainclass=com.nokia.mj.impl.rt.support.ApplicationUtilsTest 0000001
+javaunittester -Dcom.nokia.rt.port=test2 -mainclass=com.nokia.mj.impl.rt.support.ApplicationUtilsTest 00000001
+javaunittester -Dcom.nokia.rt.port=test -mainclass=com.nokia.mj.impl.rt.support.ApplicationInfoTest
+javaunittester -Dcom.nokia.rt.port=test2 -mainclass=com.nokia.mj.impl.rt.support.ApplicationInfoTest 1
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortBasicTest
+javaunittester -cp c:\java\jvmportapp.jar -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 1
+javaunittester -conf=cdc -cp c:\java\jvmportapp.jar -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 1
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 01
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 01
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 001
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 001
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 0001
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 0001
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 00001
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 00001
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 000001
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 000001
+javaunittester -Xmos8K -Xmns8K -Xmine4K -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 0000001
+javaunittester -conf=cdc -Xmos8K -Xmns8K -Xmine4K -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 0000001
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 00000001
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 00000001
+javaunittester -cp c:\java\jvmportapp2.jar -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 000000001
+javaunittester -conf=cdc -cp c:\java\jvmportapp.jar -mainclass=com.nokia.mj.impl.rt.support.JvmPortTest 000000001
+javaunittester -mainclass=com.nokia.mj.impl.rt.support.FinalizerTest
+javaunittester -conf=cdc -mainclass=com.nokia.mj.impl.rt.support.FinalizerTest
 testjavautils -nomemleaks
--- a/javaextensions/bluetooth/omjbluetooth/src.s60/discoveryagent.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javaextensions/bluetooth/omjbluetooth/src.s60/discoveryagent.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -371,7 +371,7 @@
     return mServiceSearchStatus;
 }
 
-int DiscoveryAgent::PopulateServiceRecordAttrValue(JNIEnv* aJni,
+int DiscoveryAgent::PopulateServiceRecordAttrValue(JNIEnv* /*aJni,*/,
         TInt64 aRemoteAddress, long aHandle,
         TPtrC16 aAttrIdsDes, jobject aServiceRecordImpl,
         java::util::Monitor* aMonitor)
--- a/javaextensions/pim/build/javapim.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javaextensions/pim/build/javapim.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 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"
@@ -14,6 +14,8 @@
 # Description: 
 #
 
+include(../../../inc/build_defines.pri)
+
 TARGET=javapim
 TEMPLATE=lib
 CONFIG += omj java stl
@@ -61,6 +63,11 @@
             -lplatformenv
             
             
+    contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
+        CONFIG += qt hb
+        TRANSLATIONS = javapim.ts
+    }
+
 # Resource files
 MMP_RULES += "SOURCEPATH ../javapimloc/data"
 MMP_RULES += "START RESOURCE pimcm.rss"
--- a/javaextensions/pim/framework/src.s60/cpimmanager.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javaextensions/pim/framework/src.s60/cpimmanager.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -572,6 +572,9 @@
     iDesCArray->AppendL(aFileName);
     CleanupStack::Pop(aCalSession);
 
+#else
+    (void )aFileName;
+    (void )aDisplayName;
     #endif
 }
 
@@ -628,7 +631,8 @@
     {
         User::Leave(KErrAccessDenied);
     }
-
+#else
+    (void) aFileName;
     #endif
 }
 
--- a/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -162,7 +162,7 @@
     TRAP(error, aMmsSrvConn->InitializeL());
     if (error != KErrNone)
     {
-        ELOG1(EWMA, "error Creating CRetrieveMobilePhoneBroadcastIdList =%d",
+        ELOG1(EWMA, "error while Initializing S60MmsServerConnection =%d",
               error);
         aMmsSrvConn->mError = error;
         (aMmsSrvConn->mOpenMonitor)->notify();
--- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp	Fri Oct 15 12:29:39 2010 +0300
@@ -29,6 +29,7 @@
 CAPABILITY      CAP_ECOM_PLUGIN
 VENDORID        VID_DEFAULT
 
+SYSTEMINCLUDE /epoc32/include/ecom
 sourcepath      ../src
 
 source          testsmartcardtokenplugin.cpp
--- a/javamanager/javainstaller/installer/build/javainstaller.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/installer/build/javainstaller.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -65,7 +65,8 @@
     contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
         CONFIG += hb
         LIBS += -lsifnotification -lxqservice
-        TRANSLATIONS = javaapplicationinstaller.ts
+        TRANSLATIONS += javaapplicationinstaller.ts
+        TRANSLATIONS += javaapplicationinstallererrors.ts
     }
 
     MMP_RULES += \
--- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -59,7 +59,7 @@
     jobjectArray aApplicationNames, jobjectArray aApplicationIcons,
     jint aComponentSize, jstring aIconDir, jstring /*aComponentIcon*/)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     HBufC *globalComponentId = CreateHBufCFromJavaStringLC(aEnv, aGlobalComponentId);
     HBufC *componentName = CreateHBufCFromJavaStringLC(aEnv, aComponentName);
     HBufC *iconDir = NULL;
@@ -125,7 +125,7 @@
     }
     CleanupStack::PopAndDestroy(componentName);
     CleanupStack::PopAndDestroy(globalComponentId);
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
 }
 
 /*
@@ -235,7 +235,7 @@
     jstring aGlobalComponentId, jint aOperation, jint aSubOperation,
     jint aCurrent, jint aTotal)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     HBufC *globalComponentId = CreateHBufCFromJavaStringLC(aEnv, aGlobalComponentId);
     CSifOperationProgressData *progressData = CSifOperationProgressData::NewLC(
                 *globalComponentId, (TSifOperationPhase)aOperation,
@@ -245,7 +245,7 @@
 
     CleanupStack::PopAndDestroy(progressData);
     CleanupStack::PopAndDestroy(globalComponentId);
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
 }
 
 /*
--- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -455,7 +455,7 @@
  jint aMediaId, jstring aMidletInfoUrl, jstring aMidletDescription,
  jstring aDownloadUrl, jstring aUpdateUrl, jobject aComponentId)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     RSoftwareComponentRegistry *pScr =
         reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
     TComponentId componentId = -1;
@@ -465,7 +465,7 @@
                                  aIsDrmProtected, aIsOriginVerified, aIsUpdate, aMediaId,
                                  aMidletInfoUrl, aMidletDescription,
                                  aDownloadUrl, aUpdateUrl));
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     if (KErrNone == err)
     {
         jclass clazz = aEnv->GetObjectClass(aComponentId);
@@ -483,7 +483,7 @@
 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1unregisterComponent
 (JNIEnv *, jclass, jint aSessionHandle, jint aComponentId)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     RSoftwareComponentRegistry *pScr =
         reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
     TInt err = KErrNone;
@@ -492,7 +492,7 @@
     {
         TRAP(err, pScr->DeleteComponentL(aComponentId));
     }
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     return err;
 }
 
@@ -507,7 +507,7 @@
     jstring aIconFilename, jint aNumberOfIcons,
     jintArray aLanguages, jobjectArray aAppNames)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     // Application Uid.
     TUid appUid = TUid::Uid(aAppUid);
 
@@ -630,7 +630,7 @@
     CleanupStack::PopAndDestroy(groupName);
     CleanupStack::PopAndDestroy(appFilename);
     CleanupStack::PopAndDestroy(caption);
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
 }
 
 /*
@@ -678,12 +678,12 @@
 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerLocalizedComponentName
 (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aComponentId, jstring aName, jstring aVendor, jint aLanguage)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     RSoftwareComponentRegistry *pScr =
         reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
     TRAPD(err, RegisterLocalizedComponentNameL(
               aEnv, pScr, aComponentId, aName, aVendor, aLanguage));
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     return err;
 }
 
@@ -701,16 +701,16 @@
         HBufC *value = CreateHBufCFromJavaStringLC(aEnv, aValue);
         if (KUnspecifiedLocale == aLanguage)
         {
-            __UHEAP_MARK;
+            //__UHEAP_MARK;
             aScr->SetComponentPropertyL(aComponentId, *name, *value);
-            __UHEAP_MARKEND;
+            //__UHEAP_MARKEND;
         }
         else
         {
-            __UHEAP_MARK;
+            //__UHEAP_MARK;
             aScr->SetComponentPropertyL(
                 aComponentId, *name, *value, (TLanguage)aLanguage);
-            __UHEAP_MARKEND;
+            //__UHEAP_MARKEND;
         }
         CleanupStack::PopAndDestroy(value);
         CleanupStack::PopAndDestroy(name);
@@ -725,12 +725,12 @@
 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1setLocalizedComponentProperty
 (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aComponentId, jstring aName, jstring aValue, jint aLanguage)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     RSoftwareComponentRegistry *pScr =
         reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
     TRAPD(err, SetLocalizedComponentPropertyL(
               aEnv, pScr, aComponentId, aName, aValue, aLanguage));
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     return err;
 }
 
@@ -756,12 +756,12 @@
 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentId
 (JNIEnv *aEnv, jclass, jint aSessionHandle, jstring aGlobalId, jobject aComponentId)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     RSoftwareComponentRegistry *pScr =
         reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
     TComponentId componentId = -1;
     TRAPD(err, componentId = GetComponentIdL(aEnv, pScr, aGlobalId));
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     if (KErrNone == err)
     {
         jclass clazz = aEnv->GetObjectClass(aComponentId);
@@ -780,13 +780,13 @@
 (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aAppUid, jobject aComponentId)
 {
     TInt err = KErrNone;
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     RSoftwareComponentRegistry *pScr =
         reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
     TUid appUid = TUid::Uid(aAppUid);
     TComponentId componentId = -1;
     TRAP(err, componentId = pScr->GetComponentIdForAppL(appUid));
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     if (KErrNone == err)
     {
         jclass clazz = aEnv->GetObjectClass(aComponentId);
@@ -823,10 +823,10 @@
 JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getUid
 (JNIEnv *aEnv, jclass, jint aCid, jobject aComponentId)
 {
-    __UHEAP_MARK;
+    //__UHEAP_MARK;
     TInt uid = 0;
     TRAPD(err, uid = GetUidL(aCid));
-    __UHEAP_MARKEND;
+    //__UHEAP_MARKEND;
     if (KErrNone == err)
     {
         jclass clazz = aEnv->GetObjectClass(aComponentId);
--- a/javamanager/javainstaller/installerui/data/javaapplicationinstaller.css	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/installerui/data/javaapplicationinstaller.css	Fri Oct 15 12:29:39 2010 +0300
@@ -35,6 +35,12 @@
 	margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
 	margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
 	margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+	margin-bottom: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QLabel#appInfoLabel {
+	/* The font size of application details; each detail is its own label */
+	font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
 }
 
 QLabel#heading {
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java	Fri Oct 15 12:29:39 2010 +0300
@@ -46,7 +46,6 @@
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.FontData;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.internal.extension.DisplayExtension;
@@ -110,8 +109,6 @@
 
     /** Hashtable for storing the loaded icons. */
     private static Hashtable iImageTable = null;
-    /** Best size for application icon. */
-    private static Point iBestImageSize = null;
 
     /** Default shell bounds. */
     private Rectangle iDefaultShellBounds = null;
@@ -191,12 +188,6 @@
                 }
             });
 
-            // Initialize best image size.
-            iBestImageSize = new Point(
-                DisplayExtension.getBestImageWidth(DisplayExtension.LIST_ELEMENT),
-                DisplayExtension.getBestImageHeight(DisplayExtension.LIST_ELEMENT));
-            log("Best image size: " + iBestImageSize);
-
             synchronized (iInitWaitObject)
             {
                 // Notify that UI is now ready.
@@ -1126,7 +1117,7 @@
             for (int i = 1; iSecurityIcon == null && resourceDir != null; i++)
             {
                 iSecurityIcon = loadImage(
-                    aDisplay, resourceDir + iconFilename, false);
+                    aDisplay, resourceDir + iconFilename, null);
                 resourceDir = ResourceUtil.getResourceDir(i);
             }
         }
@@ -1138,30 +1129,15 @@
     }
 
     /**
-     * Loads image from specified InputStream. This method scales the image
-     * to optimum size.
-     *
-     * @param aDisplay display to which the icon will be added
-     * @param aInputStream InputStream where the image is loaded
-     * @param aImageName name of the image to be loaded
-     * @return image from InputStream or null if image cannot be loaded
-     */
-    protected static Image loadImage(
-        Display aDisplay, InputStream aInputStream, String aImageName)
-    {
-        return loadImage(aDisplay, aInputStream, aImageName, true);
-    }
-
-    /**
      * Loads image from specified file.
      *
      * @param aDisplay display to which the icon will be added
      * @param aImageFilename name of the image file to be loaded
-     * @param aScaleImage flag telling if the loaded image should be scaled
+     * @param aImageSize size to which the image should be scaled, can be null
      * @return image from file or null if image cannot be loaded
      */
-    private static Image loadImage(
-        Display aDisplay, String aImageFilename, boolean aScaleImage)
+    protected static Image loadImage(
+        Display aDisplay, String aImageFilename, Point aImageSize)
     {
         Image result = null;
         InputStream imageInputStream = null;
@@ -1172,7 +1148,7 @@
             {
                 imageInputStream = imageFile.openInputStream();
                 result = loadImage(aDisplay, imageInputStream,
-                                   aImageFilename, aScaleImage);
+                                   aImageFilename, aImageSize);
             }
         }
         catch (IOException ioe)
@@ -1203,17 +1179,18 @@
      * @param aDisplay display to which the icon will be added
      * @param aInputStream InputStream where the image is loaded
      * @param aImageName name of the image to be loaded
-     * @param aScaleImage flag telling if the loaded image should be scaled
+     * @param aImageSize size to which the image should be scaled, can be null
      * @return image from InputStream or null if image cannot be loaded
      */
-    private static Image loadImage(
+    protected static Image loadImage(
         Display aDisplay, InputStream aInputStream,
-        String aImageName, boolean aScaleImage)
+        String aImageName, Point aImageSize)
     {
+        String imageTableKey = aImageName + "," + aImageSize;
         Image result = null;
         if (aImageName != null)
         {
-            result = (Image)iImageTable.get(aImageName);
+            result = (Image)iImageTable.get(imageTableKey);
         }
         if (result != null)
         {
@@ -1223,29 +1200,16 @@
         try
         {
             long startTime = System.currentTimeMillis();
-            aDisplay.setData("org.eclipse.swt.internal.image.loadSize",
-                             iBestImageSize);
-            Image image = new Image(aDisplay, aInputStream);
-            if (aScaleImage)
+            if (aImageSize != null)
             {
-                ImageData imageData = image.getImageData();
-                if (iBestImageSize.x != imageData.width ||
-                        iBestImageSize.y != imageData.height)
-                {
-                    Point oldSize =
-                        new Point(imageData.width, imageData.height);
-                    imageData = imageData.scaledTo(iBestImageSize.x, iBestImageSize.y);
-                    log("Image " + aImageName + " scaled from " +
-                        oldSize.x + "x" + oldSize.y + " to " +
-                        iBestImageSize.x + "x" + iBestImageSize.y);
-                    image = new Image(aDisplay, imageData);
-                }
+                aDisplay.setData("org.eclipse.swt.internal.image.loadSize",
+                                 aImageSize);
             }
-            result = image;
+            result = new Image(aDisplay, aInputStream);
             long endTime = System.currentTimeMillis();
             log("Loaded image " + aImageName + " (load time " +
                 (endTime - startTime) + " ms)");
-            iImageTable.put(aImageName, result);
+            iImageTable.put(imageTableKey, result);
         }
         catch (Throwable t)
         {
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java	Fri Oct 15 12:29:39 2010 +0300
@@ -68,8 +68,6 @@
     private Composite iAppInfoComposite = null;
     /** Composite to which command buttons are added. */
     private Composite iCommandComposite = null;
-    /** Application suite icon */
-    protected Image iSuiteIcon = null;
     /** InstallerUi owning this view. */
     protected InstallerUiEswt iInstallerUi = null;
     /** True if this view is visible. */
@@ -83,6 +81,15 @@
     /** Certificates for this application. */
     protected SigningCertificate[] iCertificates = null;
 
+    /** Application suite icon */
+    protected Image iSuiteIcon = null;
+    /** Label for application suite icon */
+    protected Label iSuiteIconLabel = null;
+    /** InputStream for application suite icon */
+    private InputStream iSuiteIconInputStream = null;
+    /** Path for application suite icon */
+    private String iSuiteIconPath = null;
+
     /** Constructor */
     protected ViewBase()
     {
@@ -173,9 +180,13 @@
         return iComposite;
     }
 
-    /** Returns ScrolledComposite for Composite. */
+    /** Returns ScrolledComposite for this view. */
     public ScrolledComposite getScrolledComposite()
     {
+        if (iAppInfoScrolledComposite != null)
+        {
+            return iAppInfoScrolledComposite;
+        }
         return iScrolledComposite;
     }
 
@@ -321,6 +332,15 @@
         getShell().setRedraw(false);
         // First calculate size without vertical scrollbar.
         doUpdateSize(false);
+        // After layout has been calculated, load and set the
+        // suite icon with correct size.
+        setSuiteIcon();
+        if (getScrolledComposite() != null &&
+            getScrolledComposite().getVerticalBar() != null)
+        {
+            log("updateSize: getScrolledComposite().getVerticalBar().getVisible()="
+                + getScrolledComposite().getVerticalBar().getVisible());
+        }
         if (getScrolledComposite() != null &&
                 getScrolledComposite().getVerticalBar() != null &&
                 getScrolledComposite().getVerticalBar().getVisible())
@@ -341,9 +361,20 @@
         if (getAppInfoComposite() != null)
         {
             // Recalculate the size of the app info composite.
-            getAppInfoComposite().setSize(
-                getAppInfoComposite().computeSize(
-                    SWT.DEFAULT, SWT.DEFAULT));
+            if (aVerticalScrollBarVisible)
+            {
+                int contentWidth = getAppInfoComposite().getSize().x -
+                    getScrolledComposite().getVerticalBar().getSize().x;
+                getAppInfoComposite().setSize(
+                    getAppInfoComposite().computeSize(
+                        contentWidth, SWT.DEFAULT));
+            }
+            else
+            {
+                getAppInfoComposite().setSize(
+                    getAppInfoComposite().computeSize(
+                        SWT.DEFAULT, SWT.DEFAULT));
+            }
         }
 
         int contentWidth = iDefaultContentSize.x * MAX_VIEW_WIDTH / 100;
@@ -495,30 +526,23 @@
             createSecurityLabel(iCertificates != null);
         }
 
-        // Add suite icon.
-        InputStream iconInputStream = null;
-        String iconPath = null;
+        // Init suite icon data.
         if (aInstallInfo != null)
         {
-            iconInputStream = aInstallInfo.getIconInputStream();
-            iconPath = aInstallInfo.getIconPath();
+            iSuiteIconInputStream = aInstallInfo.getIconInputStream();
+            iSuiteIconPath = aInstallInfo.getIconPath();
         }
         if (aUninstallInfo != null)
         {
-            iconInputStream = aUninstallInfo.getIconInputStream();
-            iconPath = aUninstallInfo.getIconPath();
-        }
-        if (iSuiteIcon == null && iconInputStream != null)
-        {
-            iSuiteIcon = InstallerUiEswt.loadImage(
-                             getComposite().getDisplay(), iconInputStream, iconPath);
+            iSuiteIconInputStream = aUninstallInfo.getIconInputStream();
+            iSuiteIconPath = aUninstallInfo.getIconPath();
         }
         int iconColumns = 0;
-        if (iSuiteIcon != null)
+        if (iSuiteIconInputStream != null)
         {
             iconColumns = 2;
-            Label iconLabel = createLabel(iSuiteIcon, iconColumns, SWT.NONE);
-            setCssId(iconLabel, "contentIcon");
+            iSuiteIconLabel = createLabel((Image)null, iconColumns, SWT.NONE);
+            setCssId(iSuiteIconLabel, "contentIcon");
         }
 
         // Create a Composite for displaying application info.
@@ -697,6 +721,7 @@
     protected Label createAppInfoLabel(String aText)
     {
         Label label = new Label(getAppInfoComposite(), SWT.WRAP);
+        setCssId(label, "appInfoLabel");
         label.setText(aText);
         GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
         gridData.horizontalSpan = 1;
@@ -770,6 +795,25 @@
         return button;
     }
 
+    protected void setSuiteIcon()
+    {
+        if (iSuiteIcon == null &&
+            iSuiteIconInputStream != null &&
+            iSuiteIconLabel != null)
+        {
+            //Rectangle rect = iSuiteIconLabel.getBounds();
+            //log("iSuiteIconLabel bounds: " + rect);
+            iSuiteIcon = InstallerUiEswt.loadImage(
+                getComposite().getDisplay(), iSuiteIconInputStream,
+                iSuiteIconPath, new Point(54, 54)); // new Point(rect.width, rect.height));
+        }
+        if (iSuiteIcon != null)
+        {
+            //log("iSuiteIcon bounds: " + iSuiteIcon.getBounds());
+            iSuiteIconLabel.setImage(iSuiteIcon);
+        }
+    }
+
     /**
      * Sets margins and spacing for the given layout to zero.
      */
--- a/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp	Fri Oct 15 12:29:39 2010 +0300
@@ -46,7 +46,6 @@
 
 // Sources
 SOURCEPATH      ../src
-SOURCE          asyncwaitcallback.cpp
 SOURCE          javasifplugin.cpp
 SOURCE          proxy.cpp
 SOURCE          resultsserver.cpp
@@ -57,14 +56,11 @@
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../../inc
 
-SYSTEMINCLUDE   /epoc32/include/mw/hb/hbwidgets
-
 // Libraries
 LIBRARY         apgrfx.lib
 LIBRARY         apmime.lib
 LIBRARY         ecom.lib
 LIBRARY         efsrv.lib
-LIBRARY         hbwidgets.lib
 LIBRARY         sif.lib
 LIBRARY         javacomms.lib
 LIBRARY         javaruntimestarterutils.lib
--- a/javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2005-2010 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 class implements general wait object for calling a desired
-*                callback function after asynchronous notification
-*
-*/
-
-#ifndef ASYNCWAITCALLBACK_H
-#define ASYNCWAITCALLBACK_H
-
-#include <e32base.h>
-
-namespace java
-{
-namespace installer
-{
-
-/**
- * This class implements wait object for calling a desired
- * callback function after rendezvous returns specified
- * reason code from the process that this object is listening to.
- */
-NONSHARABLE_CLASS(CAsyncWaitCallBack) : public CActive
-{
-public:  // Constructors and destructor
-
-    static CAsyncWaitCallBack* NewL(TCallBack aCallBack);
-
-    // Destructor.
-    virtual ~CAsyncWaitCallBack();
-
-public:  // From base classes
-
-    // from base class CActive
-
-    void RunL();
-
-    void DoCancel();
-
-public:
-
-    void Wait(RProcess aProcessToListen, TInt aActivatingReasonCode);
-
-private:
-
-    // Constructor.
-    CAsyncWaitCallBack();
-
-    // 2nd phase constructor.
-    void ConstructL(TCallBack aCallBack);
-
-private: //  Data
-
-    // Callback member
-    TCallBack   iCallBack;
-
-    // When request completes with this status code,
-    // callback is called.
-    TInt iActivatingReasonCode;
-
-    RProcess iProcessToListen;
-};
-
-} // installer
-} // java
-
-#endif // ASYNCWAITCALLBACK_H
--- a/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h	Fri Oct 15 12:29:39 2010 +0300
@@ -22,10 +22,8 @@
 #define JAVASIFPLUGIN_H
 
 #include <e32base.h>
-#include <hbdevicenotificationdialogsymbian.h>
 #include <usif/sif/sifplugin.h>
 
-#include "asyncwaitcallback.h"
 #include "f32file.h"
 
 class ResultsServer;
@@ -198,11 +196,6 @@
     virtual void CancelOperation();
 
 
-    /**
-     * Hides 'preparing installation' dialog.
-     */
-    void HidePrepInstDialogL();
-
 private:
 
     /**
@@ -303,11 +296,6 @@
         COpaqueNamedParams& aResults,
         TRequestStatus& aStatus);
 
-    /**
-     * Creates 'preparing installation' dialog.
-     */
-    void CreatePrepInstDialogL();
-
 private: //  Data
 
     RFs mRFs;
@@ -316,9 +304,6 @@
 
     COpaqueNamedParams* mDummyResults;
     CComponentInfo*     mDummyInfo;
-
-    CHbDeviceNotificationDialogSymbian* mPrepInstDialog;
-    CAsyncWaitCallBack* mWaitToHideDialog;
 };
 
 } // Installer
--- a/javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* Copyright (c) 2009-2010 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 class implements general wait object for calling a desired
- *                callback function after asynchronous notification
- *
-*/
-
-#include "asyncwaitcallback.h"
-#include "logger.h"
-
-using namespace java::installer;
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-CAsyncWaitCallBack* CAsyncWaitCallBack::NewL(TCallBack aCallBack)
-{
-    CAsyncWaitCallBack* self = new(ELeave) CAsyncWaitCallBack();
-    CleanupStack::PushL(self);
-    self->ConstructL(aCallBack);
-    CleanupStack::Pop(self);
-    return self;
-}
-
-CAsyncWaitCallBack::CAsyncWaitCallBack():
-        CActive(CActive::EPriorityStandard), iActivatingReasonCode(0)
-{
-}
-
-CAsyncWaitCallBack::~CAsyncWaitCallBack()
-{
-}
-
-void CAsyncWaitCallBack::ConstructL(TCallBack aCallBack)
-{
-    iCallBack = aCallBack;
-    CActiveScheduler::Add(this);
-}
-
-void CAsyncWaitCallBack::RunL()
-{
-    // Execute callback only if the request completed with correct
-    // status code
-    if (iStatus == iActivatingReasonCode)
-    {
-        ILOG1(EJavaInstaller,
-              "CAsyncWaitCallBack called with notif code %d",
-              iStatus.Int());
-        iCallBack.CallBack();
-    }
-    else
-    {
-        WLOG1(EJavaInstaller,
-              "CAsyncWaitCallBack was called with unexpected notif code %d, reactivate",
-              iStatus.Int());
-        // Reactivate wait
-        iProcessToListen.Rendezvous(iStatus);
-        SetActive();
-    }
-}
-
-void CAsyncWaitCallBack::DoCancel()
-{
-    iProcessToListen.RendezvousCancel(iStatus);
-}
-
-void CAsyncWaitCallBack::Wait(RProcess aProcessToListen, TInt aActivatingReasonCode)
-{
-    iActivatingReasonCode = aActivatingReasonCode;
-    iProcessToListen = aProcessToListen;
-    iProcessToListen.Rendezvous(iStatus);
-    SetActive();
-}
-
--- a/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -94,19 +94,6 @@
 // Java Installer is executed with same Uid as Java Runtime
 _LIT_SECURE_ID(KJavaInstallerSecureID, KJavaMidpSecureId);
 
-/**
- * This function is called to hide the 'Preparing Installation' dialog.
- */
-LOCAL_C TInt HidePrepInstDialog(TAny* aPlugin)
-{
-    CJavaSifPlugin *pPlugin = (CJavaSifPlugin *)aPlugin;
-    if (NULL != pPlugin)
-    {
-        TRAP_IGNORE(pPlugin->HidePrepInstDialogL());
-    }
-    return KErrNone;
-}
-
 // ============================ MEMBER FUNCTIONS ===============================
 
 CJavaSifPlugin* CJavaSifPlugin::NewL()
@@ -138,15 +125,6 @@
 
     delete mDummyInfo;
     mDummyInfo = NULL;
-
-    delete mPrepInstDialog;
-    mPrepInstDialog = NULL;
-
-    if (mWaitToHideDialog)
-    {
-        delete mWaitToHideDialog;
-        mWaitToHideDialog = NULL;
-    }
 }
 
 CJavaSifPlugin::CJavaSifPlugin()
@@ -160,7 +138,6 @@
     mResultsServer = NULL;
     mDummyResults = COpaqueNamedParams::NewL(); // codescanner::forgottoputptroncleanupstack
     mDummyInfo = CComponentInfo::NewL();
-    mWaitToHideDialog = NULL;
 }
 
 void CJavaSifPlugin::GetComponentInfo(
@@ -383,17 +360,6 @@
 
         commandLine.Append(KSilent);
     }
-    else
-    {
-        // Uncomment this to enable 'preparing installation' dialog.
-        //TRAP(err, CreatePrepInstDialogL());
-        //if (KErrNone != err)
-        //{
-        //    WLOG1(EJavaInstaller,
-        //          "CJavaSifPlugin::Install Creating preparing installation dialog failed, err=%d",
-        //          err);
-        //}
-    }
 
     BuildInstallCommandLine(commandLine, aArguments);
 
@@ -482,25 +448,6 @@
         return;
     }
 
-    if (!silentInstall)
-    {
-        TRAP(err, mWaitToHideDialog =
-             CAsyncWaitCallBack::NewL(TCallBack(HidePrepInstDialog, this)));
-        if (KErrNone == err)
-        {
-            // The active object will wait until JavaInstaller process calls Rendezvous.
-            // If JavaInstaller specifies reason code EJavaInstaller, then
-            // the active object will call callback function that will hide the
-            // 'Preparing installation' dialog. If reason code is not EJavaInstaller,
-            // the wait object will automatically wait for the next rendezvous.
-            mWaitToHideDialog->Wait( rJavaInstaller, EJavaInstaller );
-        }
-        else
-        {
-            ELOG1(EJavaInstaller, "CJavaSifPlugin::Install: Creating "
-                  "mWaitToHideDialog failed, err %d", err);
-        }
-    }
     rJavaInstaller.Resume();
 
     // Do NOT close rJavaInstaller now -> the caller gets notification when the
@@ -851,24 +798,32 @@
     const COpaqueNamedParams& aArguments)
 {
     // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z)
-    TInt intValue = GetPositiveIntParam(KSifInParam_Drive, aArguments);
-    // Value 0 is 'A:' drive and  value 25 is 'Z:' drive
-    if ((intValue > -1) && (intValue < 26))  // codescanner::magicnumbers
+    TInt intValue;
+    RArray<TInt> intArray;
+    TRAPD(err, intArray = aArguments.IntArrayByNameL(KSifInParam_Drive));
+    if (err == KErrNone && intArray.Count() > 0)
     {
-        aCommandLine.Append(KDrive);
-        TChar drive('A');
-        drive += intValue;
-        aCommandLine.Append(drive);
+        // Java installer supports one installation drive only, so take
+        // the first parameter which is the most preferred drive.
+        intValue = intArray[0];
+        // Value 0 is 'A:' drive and  value 25 is 'Z:' drive
+        if ((intValue > -1) && (intValue < 26))  // codescanner::magicnumbers
+        {
+            aCommandLine.Append(KDrive);
+            TChar drive('A');
+            drive += intValue;
+            aCommandLine.Append(drive);
+        }
     }
 
     // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no
     intValue = GetPositiveIntParam(KSifInParam_PerformOCSP, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KOcsp);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KOcsp);
         aCommandLine.Append(KNo);
@@ -877,12 +832,12 @@
 
     // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no
     intValue = GetPositiveIntParam(KSifInParam_IgnoreOCSPWarnings, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KIgnoreOcspWarnings);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KIgnoreOcspWarnings);
         aCommandLine.Append(KNo);
@@ -891,12 +846,12 @@
 
     // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no
     intValue = GetPositiveIntParam(KSifInParam_AllowUpgrade, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KUpgrade);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KUpgrade);
         aCommandLine.Append(KNo);
@@ -905,12 +860,12 @@
 
     // KSifInParam_AllowUpgradeData Yes/No/AskUser -> -upgrade_data=yes|no
     intValue = GetPositiveIntParam(KSifInParam_AllowUpgradeData, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KUpgradeData);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KUpgradeData);
         aCommandLine.Append(KNo);
@@ -919,12 +874,12 @@
 
     // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no
     intValue = GetPositiveIntParam(KSifInParam_AllowUntrusted, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KUntrusted);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KUntrusted);
         aCommandLine.Append(KNo);
@@ -933,12 +888,12 @@
 
     // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no
     intValue = GetPositiveIntParam(KSifInParam_AllowOverwrite, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KOverwrite);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KOverwrite);
         aCommandLine.Append(KNo);
@@ -947,12 +902,12 @@
 
     // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no
     intValue = GetPositiveIntParam(KSifInParam_AllowDownload, aArguments);
-    if (intValue == 0) // Yes
+    if (intValue == Usif::EAllowed) // Yes
     {
         aCommandLine.Append(KDownload);
         aCommandLine.Append(KYes);
     }
-    else if (intValue == 1) // No
+    else if (intValue == Usif::ENotAllowed) // No
     {
         aCommandLine.Append(KDownload);
         aCommandLine.Append(KNo);
@@ -1187,34 +1142,4 @@
     return EFalse;
 }
 
-/**
- * Creates 'preparing installation' dialog.
- */
-void CJavaSifPlugin::CreatePrepInstDialogL()
-{
-    ILOG(EJavaInstaller, "CJavaSifPlugin::CreatePrepInstDialogL creating dialog");
-    mPrepInstDialog = CHbDeviceNotificationDialogSymbian::NewL();
-    _LIT(KPrepInstText, "Preparing installation...");
-    mPrepInstDialog->SetTitleL(KPrepInstText);
-    mPrepInstDialog->SetTimeout(20*1000); // ms
-    mPrepInstDialog->ShowL();
-    ILOG(EJavaInstaller, "CJavaSifPlugin::CreatePrepInstDialogL dialog created");
-}
-
-void CJavaSifPlugin::HidePrepInstDialogL()
-{
-    ILOG(EJavaInstaller, "CJavaSifPlugin::HidePrepInstDialogL hiding dialog");
-    // Stop further timed calls
-    if (mWaitToHideDialog)
-    {
-        mWaitToHideDialog->Cancel();
-    }
-    // Close wait dialog.
-    if (mPrepInstDialog)
-    {
-        mPrepInstDialog->Close();
-    }
-    ILOG(EJavaInstaller, "CJavaSifPlugin::HidePrepInstDialogL dialog hidden");
-}
-
 //  End of File
--- a/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -164,14 +164,28 @@
 
                 if (INSTALL_OPERATION == operation)
                 {
-                    // Return the component ids of the installed Java application.
+                    // Return the component id of the installed Java application.
                     TComponentId resultComponentId = iIntPairs[L"suite-cid"];
-                    TRAP(err, mResults.AddIntL(KSifOutParam_ComponentId, resultComponentId));
+                    RArray<TInt> intArray;
+                    TRAP(err, intArray.AppendL(resultComponentId));
                     if (KErrNone != err)
                     {
                         ELOG1(EJavaInstaller,
-                              "ResultsServer::processMessage mResults.AddIntL cid error %d", err);
+                              "ResultsServer::processMessage intArray.AppendL "
+                              "error %d", err);
                     }
+                    else
+                    {
+                        TRAP(err, mResults.AddIntArrayL(
+                                 KSifOutParam_ComponentId, intArray));
+                        if (KErrNone != err)
+                        {
+                            ELOG1(EJavaInstaller,
+                                  "ResultsServer::processMessage "
+                                  "mResults.AddIntL cid error %d", err);
+                        }
+                    }
+                    intArray.Close();
                 }
                 else if (UNINSTALL_OPERATION == operation)
                 {
--- a/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 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"
@@ -75,8 +75,8 @@
 
 
 /**
- * This test case requires that you start Java Installer 
- * manually before executing this one and keep it running 
+ * This test case requires that you start Java Installer
+ * manually before executing this one and keep it running
  * this test case ends.
  *
  *
@@ -181,7 +181,7 @@
     {
         ELOG1(EJavaConverters,
               "testsifapi: sifByHandleAndArgsAndResultsInstallL: Cannot open "
-              "E:\\stopwatch10midp2.jad, err %d", err);
+              "E:\\Private\\10281e17\\SimpleRMS.jar, err %d", err);
         User::Leave(err);
     }
     CleanupClosePushL(installFile);
@@ -212,21 +212,23 @@
     arguments->AddIntL(KSifInParam_InstallSilently, 1);
 
     // drive E:
-    arguments->AddIntL(KSifInParam_Drive, 4);
-
-    // 0 is TSifPolicy::EUserAllowed == Yes
-    arguments->AddIntL(KSifInParam_PerformOCSP, 0);
-    arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 0);
+    RArray<TInt> intArray;
+    CleanupClosePushL(intArray);
+    intArray.AppendL(4);
+    arguments->AddIntArrayL(KSifInParam_Drive, intArray);
+    CleanupStack::PopAndDestroy(&intArray);
 
-    arguments->AddIntL(KSifInParam_AllowUpgrade, 0);
-    arguments->AddIntL(KSifInParam_AllowUntrusted, 0);
-    arguments->AddIntL(KSifInParam_AllowOverwrite, 0);
-    arguments->AddIntL(KSifInParam_AllowDownload, 0);
+    // TSifPolicy::EAllowed == Yes
+    arguments->AddIntL(KSifInParam_PerformOCSP, Usif::EAllowed);
+    arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, Usif::EAllowed);
 
+    arguments->AddIntL(KSifInParam_AllowUpgrade, Usif::EAllowed);
+    arguments->AddIntL(KSifInParam_AllowUntrusted, Usif::EAllowed);
+    arguments->AddIntL(KSifInParam_AllowOverwrite, Usif::EAllowed);
+    arguments->AddIntL(KSifInParam_AllowDownload, Usif::EAllowed);
 
-// TEMP TEST prevent overflow
-//    arguments->AddStringL(KSifInParam_UserName, KUserName);
-//    arguments->AddStringL(KSifInParam_Password, KPassWord);
+    arguments->AddStringL(KSifInParam_UserName, KUserName);
+    arguments->AddStringL(KSifInParam_Password, KPassWord);
 
     arguments->AddStringL(KSifInParam_SourceUrl, KSourceUrl);
 
@@ -234,7 +236,7 @@
 
     arguments->AddStringL(KSifInParam_Charset, KEmptyString);
 
-    arguments->AddStringL(KSifInParam_MimeType, KJadMimeType);
+    arguments->AddStringL(KSifInParam_MimeType, KJarMimeType);
 
 
     LOG(EJavaConverters, EInfo,
@@ -249,9 +251,10 @@
 
 
     TInt componentId = 0;
-    TBool idExisted = results->GetIntByNameL(KSifOutParam_ComponentId, componentId);
-    if ( idExisted )
+    intArray = results->IntArrayByNameL(KSifOutParam_ComponentId);
+    if (intArray.Count() > 0)
     {
+        componentId = intArray[0];
         LOG1(EJavaConverters, EInfo,
             "testsifapi: sifByHandleAndArgsAndResultsInstallL: Component id was %d", componentId);
     }
@@ -296,20 +299,23 @@
     arguments->AddIntL(KSifInParam_InstallSilently, 1);
 
     // illegal drive number 33
-    arguments->AddIntL(KSifInParam_Drive, 33);
-
-    // 1 is No
-    arguments->AddIntL(KSifInParam_PerformOCSP, 1);
-    arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 1);
+    RArray<TInt> intArray;
+    CleanupClosePushL(intArray);
+    intArray.AppendL(33);
+    arguments->AddIntArrayL(KSifInParam_Drive, intArray);
+    CleanupStack::PopAndDestroy(&intArray);
 
-    arguments->AddIntL(KSifInParam_AllowUpgrade, 1);
-    arguments->AddIntL(KSifInParam_AllowUntrusted, 1);
-    arguments->AddIntL(KSifInParam_AllowOverwrite, 1);
-    arguments->AddIntL(KSifInParam_AllowDownload, 1);
+    // Usif::ENotAllowed == No
+    arguments->AddIntL(KSifInParam_PerformOCSP, Usif::ENotAllowed);
+    arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, Usif::ENotAllowed);
 
-// TEMP TEST prevent overflow
-//    arguments->AddStringL(KSifInParam_UserName, KEmptyString);
-//    arguments->AddStringL(KSifInParam_Password, KEmptyString);
+    //arguments->AddIntL(KSifInParam_AllowUpgrade, Usif::ENotAllowed);
+    //arguments->AddIntL(KSifInParam_AllowUntrusted, Usif::ENotAllowed);
+    //arguments->AddIntL(KSifInParam_AllowOverwrite, Usif::ENotAllowed);
+    //arguments->AddIntL(KSifInParam_AllowDownload, Usif::ENotAllowed);
+
+    arguments->AddStringL(KSifInParam_UserName, KEmptyString);
+    arguments->AddStringL(KSifInParam_Password, KEmptyString);
 
     arguments->AddStringL(KSifInParam_SourceUrl, KEmptyString);
 
@@ -320,7 +326,7 @@
     arguments->AddStringL(KSifInParam_MimeType, KJarMimeType);
 
     // forcecancel argument value is ignored, forcecancel is set if the value length > 0
-    arguments->AddStringL(_L("-forcecancel"), KCharSet);
+    //arguments->AddStringL(_L("-forcecancel"), KCharSet);
 
     LOG(EJavaConverters, EInfo,
         "testsifapi: secondSifByFileAndArgsAndResultsInstallL: arguments created");
@@ -332,18 +338,18 @@
     LOG1(EJavaConverters, EInfo,
         "testsifapi: secondSifByFileAndArgsAndResultsInstallL: The return status of install operation was %d", status.Int());
 
-
     TInt componentId = 0;
-    TBool idExisted = results->GetIntByNameL(KSifOutParam_ComponentId, componentId);
-    if ( idExisted )
+    TRAP(err, intArray = results->IntArrayByNameL(KSifOutParam_ComponentId));
+    if (err == KErrNone && intArray.Count() > 0)
     {
+        componentId = intArray[0];
         LOG1(EJavaConverters, EInfo,
             "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Component id was %d", componentId);
     }
     else
     {
-        LOG(EJavaConverters, EInfo,
-            "testsifapi: secondSifByFileAndArgsAndResultsInstallL: No component id was returned");
+        LOG1(EJavaConverters, EInfo,
+             "testsifapi: secondSifByFileAndArgsAndResultsInstallL: No component id was returned, err=%d", err);
     }
 
     // free resources before returning
@@ -764,7 +770,7 @@
 
 
 
-    // This test case must be executed sepatately, while manually started 
+    // This test case must be executed sepatately, while manually started
     // Java Installer is running
     LOG(EJavaConverters, EInfo, "testsifapi: starting sifInstallerAlreadyRunningL");
     TRAP(err, sifInstallerAlreadyRunningL());
--- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/RuntimeErrorDialog.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/RuntimeErrorDialog.java	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 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"
@@ -193,11 +193,11 @@
         if (mMessageTable == null)
         {
             mMessageTable = new Hashtable();
-            mMessageTable.put(new Integer(UNHANDLED_ERROR), "runtime_error_unhandled");
-            mMessageTable.put(new Integer(START_UP_ERROR), "system_app_cannot_start");
-            mMessageTable.put(new Integer(UNHANDLED_ERROR_DETAILS), "runtime_error_unhandled_details");
-            mMessageTable.put(new Integer(START_UP_ERROR_DETAILS), "runtime_error_unhandled_details");
-            mMessageTable.put(new Integer(DRM_EXPIRED), "secur_error_drm_rights_not_valid");
+            mMessageTable.put(new Integer(UNHANDLED_ERROR), "runtime_error_unhandled,error_unhandled");
+            mMessageTable.put(new Integer(START_UP_ERROR), "system_app_cannot_start,app_cannot_start");
+            mMessageTable.put(new Integer(UNHANDLED_ERROR_DETAILS), "runtime_error_unhandled_details,error_unhandled_details");
+            mMessageTable.put(new Integer(START_UP_ERROR_DETAILS), "runtime_error_unhandled_details,error_unhandled_details");
+            mMessageTable.put(new Integer(DRM_EXPIRED), "secur_error_drm_rights_not_valid,drm_rights_not_valid");
         }
         return mMessageTable;
     }
@@ -213,8 +213,9 @@
         {
             if (mRes == null)
             {
-                mRes = ResourceLoader.getInstance("javausermessages",
-                                                  "qtn_java_");
+                mRes = ResourceLoader.getInstance(
+                    "javausermessages,javaapplicationsecuritymessages",
+                    "qtn_java_,txt_java_secur_info_");
             }
         }
         return mRes;
--- a/javauis/coreui_qt/javasrc/com/nokia/mj/impl/coreuiqt/CoreUiImpl.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/coreui_qt/javasrc/com/nokia/mj/impl/coreuiqt/CoreUiImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -22,6 +22,8 @@
 import com.nokia.mj.impl.rt.support.ApplicationInfo;
 import com.nokia.mj.impl.coreui.CoreUi;
 
+import org.eclipse.swt.internal.extension.Toolkit;
+
 
 /**
  * A gate to CoreUi Qt implementation.
@@ -92,5 +94,43 @@
         _hideApplication(!hide);
     }
 
+    /**
+     * Executes given Runnable synchronously in UI thread.
+     * <br>
+     * This method should only be used in cases where it
+     * is absolutely needed. Before using this method,
+     * consider carefully if the use case really requires
+     * code to be executed in UI thread.
+     * <br>
+     * This method is only supported in Qt based runtimes.
+     * <br>
+     * @param runnable Runnable to be executed
+     * @throws RuntimeException if execution in UI thread
+     * is not supported
+     */
+    protected void runInSyncUiThreadImpl(Runnable runnable)
+    {
+        Toolkit.getInternalDisplay().syncExec(runnable);
+    }
+
+    /**
+     * Executes given Runnable asynchronously in UI thread.
+     * <br>
+     * This method should only be used in cases where it
+     * is absolutely needed. Before using this method,
+     * consider carefully if the use case really requires
+     * code to be executed in UI thread.
+     * <br>
+     * This method is only supported in Qt based runtimes.
+     * <br>
+     * @param runnable Runnable to be executed
+     * @throws RuntimeException if execution in UI thread
+     * is not supported
+     */
+    protected void runInAsyncUiThreadImpl(Runnable runnable)
+    {
+        Toolkit.getInternalDisplay().asyncExec(runnable);
+    }
+
     private native void _hideApplication(boolean hide);
 }
--- a/javauis/eswt_qt/build/eswtqt/eswtqt.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/build/eswtqt/eswtqt.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 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 "Eclipse Public License v1.0"
@@ -14,10 +14,20 @@
 # Description: 
 #
 
+include(../../../../inc/build_defines.pri)
+
 TEMPLATE=lib
 TARGET=eswtqt
 CONFIG += omj java
 
+symbian {
+    contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
+        CONFIG += qt hb
+        TRANSLATIONS = javauitoolkits.ts
+    }
+}
+
+
 include(../../org.eclipse.swt/Eclipse_SWT_PI/qt/library/eswt_widgets.pri)
 include(../../org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.pri)
           
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/TextExtensionExtension.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/TextExtensionExtension.java	Fri Oct 15 12:29:39 2010 +0300
@@ -136,16 +136,15 @@
     }
     
     public void launchDialer(String phoneNumber) {
-        int serviceRequest = OS.XQServiceRequest_new(
-                "com.nokia.services.serviceapp.Dialer", "dial(QString, bool)",
-                false);
-        if (serviceRequest < 1) {
-            return;
-        }
-        OS.XQServiceRequest_swt_setArgumentsForDial(serviceRequest, phoneNumber,
-                false);
-        OS.XQServiceRequest_send(serviceRequest);
-        QObjectDeleteWrapper.deleteSafely(serviceRequest);
+    	int appMgr = OS.XQApplicationManager_new();
+    	int serviceRequest = OS.XQApplicationManager_create(appMgr, "logs","com.nokia.symbian.ILogsView","show(QVariantMap)",false);
+    	if (serviceRequest <= 0) {
+	    	return;
+	    }
+    	OS.XQAiwRequest_swtDialer_setArguments(serviceRequest, phoneNumber);
+    	OS.XQAiwRequest_send(serviceRequest);
+	    QObjectDeleteWrapper.deleteSafely(serviceRequest);
+	    QObjectDeleteWrapper.deleteSafely(appMgr);
      }    
 
 	/**
--- a/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/build.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/build.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -170,7 +170,8 @@
     <target name="build.jar" depends="init" description="Produces eswt-qt.jar">
         <mkdir dir="${plugin.dir}/bin"/>
         <javac destdir="${plugin.dir}/bin" source="${javac.source}" target="${javac.target}"
-            debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true">
+            debug="${javac.debug}" debuglevel="lines,vars,source" verbose="true" failonerror="true"
+            excludes="**/Toolkit.java">
             <src path="${plugin.dir}/Eclipse SWT/common/"/>
             <src path="${plugin.dir}/Eclipse SWT/common_j2${java.edition}/"/>
             <src path="${plugin.dir}/Eclipse SWT/qt/"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/emma.sh	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# This runs eSWT MTs and takes coverage measurements.
+
+# Start Xephyr and metacity window manager inside it
+Xephyr -ac -screen 1024x768x24 -dpi 96 -br -reset -terminate -host-cursor 2> /dev/null :2 &
+sleep 3
+DISPLAY=:2 xterm -geometry 0x0 -hold -iconic &
+DISPLAY=:2 metacity &
+DISPLAY=:2 setxkbmap fi &
+sleep 3
+
+# Once the environment is set up, run the tests
+DISPLAY=:2 java -Djava.library.path=./release emmarun -r txt,html -ix org.eclipse.swt*,org.eclipse.ercp.swt.mobile -cp ../nokiatests/junit-3.8.1.1.jar:eswtqt.jar:eswt-qt-tests.jar:../org.eclipse.swt/bin com.nokia.eswt.mt.AllTests 
+
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/CaptionedControl.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/CaptionedControl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -399,7 +399,7 @@
  * @see SWT#RIGHT_TO_LEFT
  */
 public CaptionedControl (Composite parent, int style) {
-    super(parent, Internal_PackageSupport.checkBits(style, SWT.HORIZONTAL, SWT.VERTICAL, 0, 0, 0, 0), 0,
+    super(parent, Internal_PackageSupport.checkBits(style, SWT.VERTICAL, SWT.HORIZONTAL, 0, 0, 0, 0), 0,
             new CaptionedControlPackageProxy(), false);
     if (parent instanceof CaptionedControl) {
         SWT.error(SWT.ERROR_INVALID_PARENT);
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/Command.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/Command.java	Fri Oct 15 12:29:39 2010 +0300
@@ -264,15 +264,15 @@
      */
     public static final int HELP = 9;
 
-
-    public Control control;
-    public int type;
+    private Control control;
+    private int type;
+    
     private int priority;
     private int accelerator;
     private String longLabel;
     private Command parent;
     private Command[] children;
-     //Holds the handle to QMenu that hold commandGroup
+     // Handle to QMenu that holds commandGroup
     private int commandgroup_handle;
 
     static final class CommandPackageProxy extends PackageProxy {
@@ -407,8 +407,7 @@
         this.control = control;
         this.type = type;
         this.priority = priority;
-        Internal_PackageSupport.createWidget(this,0);
-        Internal_PackageSupport.addCommand( control, this );
+        Internal_PackageSupport.createWidget(this, 0);
     }
 
     private void checkCommand(int type, int priority) {
@@ -454,6 +453,7 @@
         }
 
     }
+    
     /**
      * Adds the listener to the collection of listeners who will be notified
      * when the command is activated, by sending it one of the messages defined
@@ -488,11 +488,7 @@
         TypedListener typedListener = new TypedListener(listener);
         addListener (SWT.Selection,typedListener);
     }
-
-    public static Command[] internal_getCommands(Control control) {
-        return Internal_PackageSupport.getCommands(control);
-    }
-
+    
     /**
      * Returns <code>true</code> if the receiver is enabled, and
      * <code>false</code> otherwise. A disabled control is typically not
@@ -836,4 +832,12 @@
     private static final int topHandle(Widget w) {
         return Internal_PackageSupport.topHandle(w);
     }
+
+    Control control() {
+        return control;
+    }
+    
+    int type() {
+        return type;
+    }
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/HyperLink.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/HyperLink.java	Fri Oct 15 12:29:39 2010 +0300
@@ -20,6 +20,7 @@
 import org.eclipse.swt.widgets.Internal_PackageSupport;
 import org.eclipse.swt.internal.qt.OS;
 import org.eclipse.swt.internal.qt.PackageProxy;
+import org.eclipse.swt.internal.qt.QObjectDeleteWrapper;
 
 /**
  * 
@@ -163,8 +164,9 @@
         if (event.doit == true) {    
             if (extraStyle() == PHONE) {
                 if (OS.windowServer == OS.WS_SYMBIAN_S60) {
-                    // TODO: Launch S60 phone application
+                	callToNumber();
                 }
+                return;
             }
             String url = getText();
             if ((extraStyle() == EMAIL) && (!getText().trim().toLowerCase().startsWith(emailScheme)))
@@ -172,7 +174,19 @@
             OS.QDesktopServices_openUrl(url);
         }
     }
-
+    
+    void callToNumber(){
+    	int appMgr = OS.XQApplicationManager_new();
+    	int serviceRequest = OS.XQApplicationManager_create(appMgr, "phoneui","com.nokia.symbian.ICallDial","dial(QString)",false);
+    	if (serviceRequest <= 0) {
+	    	return;
+	    }
+    	OS.XQAiwRequest_setArguments(serviceRequest, getText());
+    	OS.XQAiwRequest_send(serviceRequest);
+	    QObjectDeleteWrapper.deleteSafely(serviceRequest);
+	    QObjectDeleteWrapper.deleteSafely(appMgr);
+    }
+    
     public void setText(String string) {
         checkWidget();
         if (string == null)
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/ListBox.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/ListBox.java	Fri Oct 15 12:29:39 2010 +0300
@@ -1439,7 +1439,7 @@
                 imageCount = items[i].detailIcons.length;
                 detailImageHandles = new int[imageCount];
                 for (int j = 0; j < imageCount; j++) {
-                    detailImageHandles[j] = Internal_GfxPackageSupport.getPixmapHandle(items[i].detailIcons[j]);
+                    detailImageHandles[j] = Internal_GfxPackageSupport.getImageHandle(items[i].detailIcons[j]);
                 }
             } else {
                 detailImageHandles = null;
@@ -1449,7 +1449,7 @@
                 imageCount = items[i].headingIcons.length;
                 headingImageHandles = new int[imageCount];
                 for (int j = 0; j < imageCount; j++) {
-                    headingImageHandles[j] = Internal_GfxPackageSupport.getPixmapHandle(items[i].headingIcons[j]);
+                    headingImageHandles[j] = Internal_GfxPackageSupport.getImageHandle(items[i].headingIcons[j]);
                 }
             } else {
                 headingImageHandles = null;
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/TimedMessageBox.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/TimedMessageBox.java	Fri Oct 15 12:29:39 2010 +0300
@@ -200,7 +200,8 @@
         }
         int layoutDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.QT_RIGHTTOLEFT
                 : OS.QT_LEFTTORIGHT;
-        int pixmapHandle = (image == null) ? 0 : Internal_GfxPackageSupport.getPixmapHandle(image);
+
+        int cgImageHandle = (image == null) ? 0 : Internal_GfxPackageSupport.getImageHandle(image);
 
         int icon = OS.QMESSAGEBOX_NOICON;
         if (image == null) {
@@ -211,7 +212,7 @@
 
         int parentHandle = Internal_PackageSupport.handle(getParent());
         OS.QMessageBox_swt_execTimer(icon, getText(), message, parentHandle,
-                dialogID, layoutDirection, modality, pixmapHandle);
+                dialogID, layoutDirection, modality, cgImageHandle);
 
         if (getParent() != null && !getParent().isDisposed()) {
             getParent().removeDisposeListener(listener);
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/Image.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/graphics/Image.java	Fri Oct 15 12:29:39 2010 +0300
@@ -701,7 +701,7 @@
         	OS.QIcon_delete(icon);
         }
 
-        icon = OS.QIcon_new(cgImage.getNativePixmapHandle());
+        icon = OS.QIcon_swt_new(cgImage.getHandle());
         return icon;
     }
 
@@ -725,15 +725,6 @@
         return cgImage.getHandle();
     }
 
-    /*
-     * Returns OS specific pixmap handle.
-     */
-    int getPixmapHandle() {
-        if(isDisposed())
-            SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
-        return cgImage.getNativePixmapHandle();
-    }
-
     /**
      * Invokes platform specific functionality to allocate a new GC handle.
      * <p>
@@ -758,7 +749,7 @@
         if(data == null) {
             SWT.error(SWT.ERROR_NULL_ARGUMENT);
         }
-        int paintDevice = OS.QPixmap_swt_paintDevice(cgImage.getNativePixmapHandle());
+        int paintDevice = cgImage.getQPainDeviceHandle();
         if(OS.QPaintDevice_paintingActive(paintDevice)) {
             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
         }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/ColorDialog.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/ColorDialog.java	Fri Oct 15 12:29:39 2010 +0300
@@ -104,6 +104,7 @@
 public RGB getRGB () {
     return rgb;
 }
+
 /**
  * Makes the receiver visible and brings it to the front
  * of the display.
@@ -117,43 +118,57 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public RGB open () {
-   int colorHandle = 0;
-   colorHandle = OS.QColor_new();
-   if (rgb != null ){
-       OS.QColor_setRed(colorHandle, rgb.red);
-       OS.QColor_setGreen(colorHandle, rgb.green);
-       OS.QColor_setBlue(colorHandle, rgb.blue);
-   }
-   
-   DisposeListener listener = new DisposeListener() {
-       public void widgetDisposed(DisposeEvent e) {
-           if (e.widget == parent) {
-               // Close dialogs which are opened on top of parent.
-               OS.QDialog_swt_closeDialogs(parent.handle, dialogID);
-           }
-       }
-   };
-   parent.addDisposeListener(listener);
-   int qtLayoutDirection = (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.QT_RIGHTTOLEFT
-           : OS.QT_LEFTTORIGHT;
-   
-   int color = OS.QColorDialog_getColor( colorHandle,parent.handle, dialogID, qtLayoutDirection );
-   
-   if (parent != null && !parent.isDisposed()) {
-       parent.removeDisposeListener(listener);
-   }
-   
-   OS.QColor_delete( colorHandle );
-   if (color == 0 || !OS.QColor_isValid(color) ){
-       return null;
-   }
-   int red = OS.QColor_red(color);    
-   int blue = OS.QColor_blue( color );
-   int green = OS.QColor_green( color );
-   rgb = new RGB(red,green,blue);
-   return rgb;
+public RGB open() {
+    int r = 0;
+    int g = 0;
+    int b = 0;
+    if (rgb != null) {
+        r = rgb.red;
+        g = rgb.green;
+        b = rgb.blue;
+    }
+
+    DisposeListener listener = new DisposeListener() {
+        public void widgetDisposed(DisposeEvent e) {
+            if (e.widget == parent) {
+                // Close dialogs which are opened on top of parent.
+                OS.QDialog_swt_closeDialogs(parent.handle, dialogID);
+            }
+        }
+    };
+    parent.addDisposeListener(listener);
+
+    int newColorHandle = 0;
+    try {
+        // Open the dialog
+        newColorHandle = OS.QColorDialog_getColor(r, g, b, parent.handle, dialogID, 
+            (style & SWT.RIGHT_TO_LEFT) != 0 ? OS.QT_RIGHTTOLEFT : OS.QT_LEFTTORIGHT);
+    }
+    finally {
+        if (parent != null && !parent.isDisposed()) {
+            parent.removeDisposeListener(listener);
+        }
+    }
+    
+    if (newColorHandle == 0) {
+        return null;
+    }
+    
+    try {
+        if (OS.QColor_isValid(newColorHandle)) {
+            int red = OS.QColor_red(newColorHandle);
+            int blue = OS.QColor_blue(newColorHandle);
+            int green = OS.QColor_green(newColorHandle);
+            rgb = new RGB(red, green, blue);
+        }
+    }
+    finally {
+        OS.QColor_delete(newColorHandle);
+    }
+    
+    return rgb;
 }
+
 /**
  * Sets the receiver's selected color to be the argument.
  *
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Combo.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Combo.java	Fri Oct 15 12:29:39 2010 +0300
@@ -1340,7 +1340,7 @@
             palette = OS.QWidget_swt_palette_new(view);
             int[] bkRoles = getBackgroundImageRoles();
             for(int i = 0; i < bkRoles.length; ++i) {
-                OS.QPalette_swt_setBrush(palette, bkRoles[i], Internal_GfxPackageSupport.getPixmapHandle(image));
+            	OS.QPalette_swt_setBrush(palette, bkRoles[i], Internal_GfxPackageSupport.getImageHandle(image));
             }
             OS.QWidget_setPalette(view, palette);
         } finally {
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java	Fri Oct 15 12:29:39 2010 +0300
@@ -131,7 +131,12 @@
     this.parent = parent;
     this.extraStyle = extraStyle;
     createWidget(0);
-    OS.QWidget_setParent(topHandle, parent.handle);
+    
+    // Children of Table are attached into the table itself, not the viewport.
+    int containerHandle = parent.packageProxy != null ? 
+        parent.packageProxy.handleWithChildren() : parent.handleWithChildren_pp();
+    OS.QWidget_setParent(topHandle, containerHandle);
+    
     OS.QWidget_resize(topHandle, 0, 0);
     if(isParentMirrored()) {
         Point size = OS.QWidget_size(topHandle);
@@ -146,8 +151,8 @@
 }
 
 void addCommand(final Command command) {
-    if (command.control != this)
-        return;
+    // Impossible for Command.control to be anything else than 'this'
+    // since addCommand is called from Command's register() only.
     if (commandList == null) {
         commandList = new Command[1];
         commandList[0] = command;
@@ -2217,8 +2222,8 @@
 }
 
 void removeCommand(final Command command) {
-    if (command.control != this)
-        return;
+    // Impossible for Command.control to be anything else than 'this'
+    // since removeCommand is called from Command's releaseParent() only.
     if (commandList == null || commandList.length == 0)
         return;
     if (commandList.length == 1 && command == commandList[0]) {
@@ -2998,7 +3003,7 @@
                 OS.QPalette_swt_setBrush(paletteHandle, bkRoles[j], 0);
                 backgroundImageInherited(image);
             } else {
-                OS.QPalette_swt_setBrush(paletteHandle, bkRoles[j], Internal_GfxPackageSupport.getPixmapHandle(image));
+                OS.QPalette_swt_setBrush(paletteHandle, bkRoles[j], Internal_GfxPackageSupport.getImageHandle(image));
                 if(packageProxy != null) {
                     packageProxy.backgroundImageApplied(image);
                 } else {
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Label.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Label.java	Fri Oct 15 12:29:39 2010 +0300
@@ -178,9 +178,9 @@
         } else {
             handle = OS.QLabel_new();
             /**
-             * Ampresands for keyboard shortcuts are not processed at all and
+             * Ampersands for keyboard shortcuts are not processed at all and
              * there won't be a shortcut unless buddy is set. The parent is
-             * used. Shortcut event can then be cancelled and focus moved
+             * used. Shortcut event can then be canceled and focus moved
              * manually. This way buddy doesn't ever need to be updated.
              */
             OS.QLabel_setBuddy(handle, parent.handle);
@@ -415,7 +415,7 @@
         }
         if (this.image == image)
             return;
-        OS.QLabel_setPixmap(handle, image == null ? 0 : Internal_GfxPackageSupport.getPixmapHandle(image));
+        OS.QLabel_swt_setPixmap(handle, image == null ? 0 : Internal_GfxPackageSupport.getImageHandle(image));
         this.image = image;
     }
 
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Table.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Table.java	Fri Oct 15 12:29:39 2010 +0300
@@ -2261,4 +2261,10 @@
 
         return size;
     }
+    
+    // Children of Table are attached into the table itself, not the viewport.
+    int handleWithChildren_pp() {
+        return topHandle;
+    }
+
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/qt/UIThreadHandOverManager.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.qt;
+
+import org.eclipse.swt.internal.qt.midp.UIThreadLauncher;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A class that manages the UI thread hand-over from the internal UI event 
+ * loop to the application. 
+ */
+public final class UIThreadHandOverManager {
+
+    /**
+     * Called indirectly by the application when it's requesting the UI thread. 
+     * Application will pass a Runnable as a parameter and expects it to get called
+     * in the UI thread. 
+     * 
+     * @param runnable
+     *            The Runnable to call in the UI thread.
+     * @return True if obtaining the UI thread was successful and the runnable
+     *         will be called.
+     */
+    public static boolean startInUIThread(Runnable runnable) {
+        if(!UIThreadLauncher.startInUIThread(runnable)) {
+            return false;
+        }
+        
+        return true;
+    }
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxos.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxos.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -907,14 +907,14 @@
 // Image class JNI calls
 //
 
-jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create__III
-  (JNIEnv* aJniEnv , jclass, jint aWidth , jint aHeight, jint aFillColor)
+jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create__IIII
+  (JNIEnv* aJniEnv , jclass, jint aWidth , jint aHeight, jint aFillColor, jint aType)
 {
     Image* img = NULL;
     GFX_TRY
     {
         SWT_LOG_JNI_CALL();
-        img = GraphicsFactory::createImage(aWidth, aHeight, aFillColor);
+        img = GraphicsFactory::createImage(aWidth, aHeight, aFillColor, (TImageType)aType);
     }
     GFX_CATCH
     return POINTER_TO_HANDLE(img);
@@ -934,34 +934,45 @@
     return POINTER_TO_HANDLE(newImage);
 }
 
-jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create___3IIIZ
-  (JNIEnv* aJniEnv, jclass, jintArray aRgbData, jint aWidth, jint aHeight, jboolean aHasAlpha)
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create__IIIIII
+  (JNIEnv* aJniEnv, jclass, jint aImageHandle, jint aX, jint aY, jint aWidth, jint aHeight, jint aTypeOfCopy)
+{
+    Image* newImage = NULL;
+    GFX_TRY
+    {
+        SWT_LOG_JNI_CALL();
+        HANDLE_TO_POINTER(Image*, image, aImageHandle);
+        newImage = GraphicsFactory::createImage(image, aX, aY, aWidth, aHeight, (TImageType)aTypeOfCopy);
+    }
+    GFX_CATCH
+    return POINTER_TO_HANDLE(newImage);        
+}
+
+jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create___3IIIZI
+  (JNIEnv* aJniEnv, jclass, jintArray aRgbData, jint aWidth, jint aHeight, jboolean aHasAlpha, jint aType)
 {
     Image* img = NULL;
     GFX_TRY
     {
         SWT_LOG_JNI_CALL();
-
         int length = aJniEnv->GetArrayLength(aRgbData);
-
         int* buffer = new int[length]; // might throw bad_alloc
         AutoRelease<int> release(buffer, true);
         swtApp->jniUtils().GetJavaIntArrayRegionToIntArray(aJniEnv, aRgbData, 0, length, buffer); // might throw bad_alloc
-
-        img = GraphicsFactory::createImage(buffer, aWidth, aHeight, aHasAlpha);
+        img = GraphicsFactory::createImage(buffer, aWidth, aHeight, aHasAlpha, (TImageType)aType);
     }
     GFX_CATCH
     return POINTER_TO_HANDLE(img);
 }
 
-jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create__Lorg_eclipse_swt_graphics_ImageData_2
-  (JNIEnv* aJniEnv , jclass, jobject aImageData)
+jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1create__Lorg_eclipse_swt_graphics_ImageData_2I
+  (JNIEnv* aJniEnv , jclass, jobject aImageData, jint aType)
 {
     Image* img = NULL;
     GFX_TRY
     {
         SWT_LOG_JNI_CALL();
-        img = swtApp->jniUtils().CreateImage(aJniEnv, aImageData);
+        img = swtApp->jniUtils().CreateImage(aJniEnv, aImageData, aType);
     }
     GFX_CATCH
     return POINTER_TO_HANDLE(img);
@@ -976,7 +987,7 @@
         SWT_LOG_JNI_CALL();
         HANDLE_TO_POINTER(QPixmap*, pixmap, aPixmapHandle);
         if (pixmap)
-            img = GraphicsFactory::createImage(*pixmap);
+            img = GraphicsFactory::createImage(*pixmap, EPixmap);
     }
     GFX_CATCH
     return POINTER_TO_HANDLE(img);
@@ -1010,6 +1021,34 @@
     return height;
 }
 
+jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1getQPaintDeviceHandle
+  (JNIEnv* aJniEnv, jclass, jint aImageHandle)
+    {
+        QPaintDevice* device = NULL;
+        GFX_TRY
+        {
+            SWT_LOG_JNI_CALL();
+            HANDLE_TO_POINTER(Image*, image, aImageHandle);
+            device = image->getBindable();
+        }
+        GFX_CATCH
+        return POINTER_TO_HANDLE(device);
+    }
+
+JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1getType
+  (JNIEnv* aJniEnv, jclass, jint aImageHandle)
+{
+    jint type = ENone;
+    GFX_TRY
+    {
+        SWT_LOG_JNI_CALL();
+        HANDLE_TO_POINTER(Image*, image, aImageHandle);
+        type = static_cast<jint>( image->type() );
+    }
+    GFX_CATCH
+    return type;   
+}
+
 jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1getWidth
   (JNIEnv* aJniEnv , jclass, jint aImageHandle)
 {
@@ -1037,6 +1076,7 @@
         int* buffer = new int[length]; // might throw bad_alloc
         AutoRelease<int> release(buffer, true);
         ::memset(buffer, 0, sizeof(int)*length);
+        swtApp->jniUtils().GetJavaIntArrayRegionToIntArray(aJniEnv, aRgbData, 0, length, buffer);
 
         // get the data (populated to data array)
         image->getRgb(buffer, aOffset, aScanlength, aX, aY, aWidth, aHeight);
@@ -1138,30 +1178,18 @@
     GFX_CATCH
 }
 
-jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1getPixmapHandle
-  (JNIEnv* aJniEnv , jclass, jint aImageHandle)
-{
-    jint pixmapHandle = 0;
-    GFX_TRY
-    {
-        SWT_LOG_JNI_CALL();
-        HANDLE_TO_POINTER(Image*, image, aImageHandle);
-        pixmapHandle = POINTER_TO_HANDLE(image->getPixmap());
-    }
-    GFX_CATCH
-    return pixmapHandle;
-}
-
 jboolean JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_image_1detectCollision
-  (JNIEnv* aJniEnv, jclass, jint aImage1PixmapHandle, jint aTransform1, jint aP1x, jint aP1y, jint aR1x1, jint aR1y1, jint aR1x2, jint aR1y2,
-                            jint aImage2PixmapHandle, jint aTransform2, jint aP2x, jint aP2y, jint aR2x1, jint aR2y1, jint aR2x2, jint aR2y2)
+  (JNIEnv* aJniEnv, jclass, jint aImage1Handle, jint aTransform1, jint aP1x, jint aP1y, jint aR1x1, jint aR1y1, jint aR1x2, jint aR1y2,
+                            jint aImage2Handle, jint aTransform2, jint aP2x, jint aP2y, jint aR2x1, jint aR2y1, jint aR2x2, jint aR2y2)
 {
     jboolean collides = JNI_FALSE;
     GFX_TRY
     {
           SWT_LOG_JNI_CALL();
-          collides = gfxUtils::detectCollision(aImage1PixmapHandle, aTransform1, aP1x, aP1y, aR1x1, aR1y1, aR1x2, aR1y2,
-                                               aImage2PixmapHandle, aTransform2, aP2x, aP2y, aR2x1, aR2y1, aR2x2, aR2y2);
+          HANDLE_TO_POINTER(Image*, image1, aImage1Handle);
+          HANDLE_TO_POINTER(Image*, image2, aImage2Handle);
+          collides = gfxUtils::detectCollision(image1, aTransform1, aP1x, aP1y, aR1x1, aR1y1, aR1x2, aR1y2,
+                                               image2, aTransform2, aP2x, aP2y, aR2x1, aR2y1, aR2x2, aR2y2);
     }
     GFX_CATCH
     return collides;
@@ -1214,13 +1242,13 @@
 }
 
 jint JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_imageLoader_1init
-  (JNIEnv* aJniEnv , jclass)
+  (JNIEnv* aJniEnv , jclass, jint aType)
 {
     ImageLoader* loader = NULL;
     GFX_TRY
     {
         SWT_LOG_JNI_CALL();
-        loader = GraphicsFactory::createImageLoader();
+        loader = GraphicsFactory::createImageLoader((TImageType)aType);
     }
     GFX_CATCH
     return POINTER_TO_HANDLE(loader);
@@ -1264,6 +1292,18 @@
     GFX_CATCH
 }
 
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_imageloader_1setResultImageType
+  (JNIEnv* aJniEnv, jclass, jint aHandle, jint aType)
+{
+    GFX_TRY
+    {
+        SWT_LOG_JNI_CALL();
+        HANDLE_TO_POINTER(ImageLoader*, loader, aHandle);
+        loader->setResultImageType((TImageType)aType);
+    }
+    GFX_CATCH 
+}
+
 JNIEXPORT jobject JNICALL Java_org_eclipse_swt_internal_qt_graphics_OS_imageLoader_1getImageSize
   (JNIEnv *aJniEnv, jclass, jbyteArray aData)
 {
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxutils.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxutils.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -15,6 +15,7 @@
 #include <QRect>
 #include <QImage>
 #include "gfxutils.h"
+#include "graphicscontextimpl.h"
 
 namespace Java { namespace GFX {
 
@@ -24,14 +25,62 @@
 
 #define HANDLE_TO_POINTER(type, variable, handle) type variable = reinterpret_cast<type>( handle )
 
-/*static*/ bool gfxUtils::detectCollision(int aImage1PixmapHandle, int aTransform1, int aP1x, int aP1y, int aR1x1, int aR1y1, int aR1x2, int aR1y2,
-                                          int aImage2PixmapHandle, int aTransform2, int aP2x, int aP2y, int aR2x1, int aR2y1, int aR2x2, int aR2y2)
+bool gfxUtils::detectCollision(Image* aImage1, int aTransform1, int aP1x, int aP1y, int aR1x1, int aR1y1, int aR1x2, int aR1y2,
+                               Image* aImage2, int aTransform2, int aP2x, int aP2y, int aR2x1, int aR2y1, int aR2x2, int aR2y2)
 {
+    int transform1 = getCgTransformValue(aTransform1);
+    int transform2 = getCgTransformValue(aTransform2);
+
     // Calculate the intersection of collisionRectangles:
     QRect rect1(aP1x, aP1y, aR1x2 - aR1x1, aR1y2 - aR1y1);
     QRect rect2(aP2x, aP2y, aR2x2 - aR2x1, aR2y2 - aR2y1);
+
+    if (aTransform1 & EReflectDiag)
+    {
+        int tmp = rect1.width();
+        rect1.setWidth(rect1.height());
+        rect1.setHeight(tmp);
+    }
+    if (aTransform2 & EReflectDiag)
+    {
+        int tmp = rect2.width();
+        rect2.setWidth(rect2.height());
+        rect2.setHeight(tmp);
+    }
+
     QRect rect3 = rect1.intersected(rect2);
 
+    QImage qimage1;
+
+    if(transform1 == ETransRot90)
+    {
+        GraphicsContextImpl gc;
+        // create a copy of the image and transform it, i.e. don't modify the original
+        qimage1 = gc.doTransform(aImage1->toImage(), transform1);
+    }
+    else
+    {
+        qimage1 = aImage1->toImage();
+    }
+    int totalWidth1 = qimage1.width();
+
+    QImage qimage2;
+
+    if(transform2 == ETransRot90)
+    {
+        GraphicsContextImpl gc;
+        // create a copy of the image and transform it, i.e. don't modify the original
+        qimage2 = gc.doTransform(aImage2->toImage(), transform2);
+    }
+    else
+    {
+        qimage2 = aImage2->toImage();
+    }
+    int totalWidth2 = qimage2.width();	
+        
+    const unsigned char* data1 = qimage1.bits();
+    const unsigned char* data2 = qimage2.bits();
+
     // Save intersection to collisionRectangles:
     aR1x1 += rect3.x() - aP1x;
     aR1y1 += rect3.y() - aP1y;
@@ -42,17 +91,6 @@
     aR2x2 = aR2x1 + rect3.width();
     aR2y2 = aR2y1 + rect3.height();
 
-    // Get image's pixel data:
-    HANDLE_TO_POINTER(QPixmap*, image1, aImage1PixmapHandle);
-    QImage qimage1 = image1->toImage();
-    const unsigned char* data1 = qimage1.bits();
-    int totalWidth1 = qimage1.width();
-
-    HANDLE_TO_POINTER(QPixmap*, image2, aImage2PixmapHandle);
-    QImage qimage2 = image2->toImage();
-    const unsigned char* data2 = qimage2.bits();
-    int totalWidth2 = qimage2.width();
-
     // These rectangles defines areas to be checked.
     QRect image1Rect(aR1x1, aR1y1, aR1x2 - aR1x1, aR1y2 - aR1y1);
     QRect image2Rect(aR2x1, aR2y1, aR2x2 - aR2x1, aR2y2 - aR2y1);
@@ -90,8 +128,9 @@
     int rect2XEnd = 0;
     int rect2YEnd = 0;
 
-    switch(aTransform1) {
-        case 0: // TRANS_NONE:
+    switch(transform1) 
+    {
+        case ETransNone:
             rect1XInc = 1;
             rect1YInc = 0;
             rect1XLineInc = 0;
@@ -101,7 +140,7 @@
             rect1XEnd = image1Rect.x() + image1Rect.width() - 1;
             rect1YEnd = image1Rect.y() + image1Rect.height() - 1;
             break;
-        case 5: // TRANS_ROT90:
+        case ETransRot90:
             rect1XInc = 0;
             rect1YInc = 1;
             rect1XLineInc = -1;
@@ -109,9 +148,9 @@
             rect1XStart = image1Rect.x() + image1Rect.width() -1;
             rect1YStart = image1Rect.y();
             rect1XEnd = image1Rect.x();
-            rect1YEnd = image1Rect.y() + image1Rect.width() - 1;
+            rect1YEnd = image1Rect.y() + image1Rect.height() - 1;
             break;
-        case 3: // TRANS_ROT180:
+        case ETransRot180:
             rect1XInc = -1;
             rect1YInc = 0;
             rect1XLineInc = 0;
@@ -121,7 +160,7 @@
             rect1XEnd = image1Rect.x();
             rect1YEnd = image1Rect.y();
             break;
-        case 6: // TRANS_ROT270:
+        case ETransRot270:
             rect1XInc = 0;
             rect1YInc = -1;
             rect1XLineInc = 1;
@@ -131,7 +170,7 @@
             rect1XEnd = image1Rect.x() + image1Rect.height() - 1;
             rect1YEnd = image1Rect.y();
             break;
-        case 2: // TRANS_MIRROR:
+        case ETransMirror:
             rect1XInc = -1;
             rect1YInc = 0;
             rect1XLineInc = 0;
@@ -141,7 +180,7 @@
             rect1XEnd = image1Rect.x();
             rect1YEnd = image1Rect.y() + image1Rect.height() - 1;
             break;
-        case 7: // TRANS_MIRROR_ROT90:
+        case ETransMirrorRot90:
             rect1XInc = 0;
             rect1YInc = -1;
             rect1XLineInc = -1;
@@ -151,7 +190,7 @@
             rect1XEnd = image1Rect.x();
             rect1YEnd = image1Rect.y();
             break;
-        case 1: // TRANS_MIRROR_ROT180:
+        case ETransMirrorRot180:
             rect1XInc = 1;
             rect1YInc = 0;
             rect1XLineInc = 0;
@@ -161,7 +200,7 @@
             rect1XEnd = image1Rect.x() + image1Rect.width() - 1;
             rect1YEnd = image1Rect.y();
             break;
-        case 4: // TRANS_MIRROR_ROT270:
+        case ETransMirrorRot270:
             rect1XInc = 0;
             rect1YInc = 1;
             rect1XLineInc = 1;
@@ -175,8 +214,9 @@
             break;
     }
 
-    switch(aTransform2) {
-        case 0: // TRANS_NONE:
+    switch(transform2) 
+    {
+        case ETransNone:
             rect2XInc = 1;
             rect2YInc = 0;
             rect2XLineInc = 0;
@@ -186,7 +226,7 @@
             rect2XEnd = image2Rect.x() + image2Rect.width() - 1;
             rect2YEnd = image2Rect.y() + image2Rect.height() - 1;
             break;
-        case 5: // TRANS_ROT90:
+        case ETransRot90:
             rect2XInc = 0;
             rect2YInc = 1;
             rect2XLineInc = -1;
@@ -194,9 +234,9 @@
             rect2XStart = image2Rect.x() + image2Rect.width() -1;
             rect2YStart = image2Rect.y();
             rect2XEnd = image2Rect.x();
-            rect2YEnd = image2Rect.y() + image2Rect.width() - 1;
+            rect2YEnd = image2Rect.y() + image2Rect.height() - 1;
             break;
-        case 3: // TRANS_ROT180:
+        case ETransRot180:
             rect2XInc = -1;
             rect2YInc = 0;
             rect2XLineInc = 0;
@@ -206,7 +246,7 @@
             rect2XEnd = image2Rect.x();
             rect2YEnd = image2Rect.y();
             break;
-        case 6: // TRANS_ROT270:
+        case ETransRot270:
             rect2XInc = 0;
             rect2YInc = -1;
             rect2XLineInc = 1;
@@ -216,7 +256,7 @@
             rect2XEnd = image2Rect.x() + image2Rect.height() - 1;
             rect2YEnd = image2Rect.y();
             break;
-        case 2: // TRANS_MIRROR:
+        case ETransMirror:
             rect2XInc = -1;
             rect2YInc = 0;
             rect2XLineInc = 0;
@@ -226,7 +266,7 @@
             rect2XEnd = image2Rect.x();
             rect2YEnd = image2Rect.y() + image2Rect.height() - 1;
             break;
-        case 7: // TRANS_MIRROR_ROT90:
+        case ETransMirrorRot90:
             rect2XInc = 0;
             rect2YInc = -1;
             rect2XLineInc = -1;
@@ -236,7 +276,7 @@
             rect2XEnd = image2Rect.x();
             rect2YEnd = image2Rect.y();
             break;
-        case 1: // TRANS_MIRROR_ROT180:
+        case ETransMirrorRot180:
             rect2XInc = 1;
             rect2YInc = 0;
             rect2XLineInc = 0;
@@ -246,7 +286,7 @@
             rect2XEnd = image2Rect.x() + image2Rect.width() - 1;
             rect2YEnd = image2Rect.y();
             break;
-        case 4: // TRANS_MIRROR_ROT270:
+        case ETransMirrorRot270:
             rect2XInc = 0;
             rect2YInc = 1;
             rect2XLineInc = 1;
@@ -268,41 +308,53 @@
 
     // Go through the intersection area pixel by pixel.
     // Following code assumes that format is 32-bit RGBA or 32-bit RGB.
-    while(true) {
+    while(true) 
+    {
         // Check is there hit:
-        if(data1[rect1Y * totalWidth1 * 4 + rect1X * 4 + 3]) {
-            if(data2[rect2Y * totalWidth2 * 4 + rect2X * 4 + 3]) {
+        if(data1[rect1Y * totalWidth1 * 4 + rect1X * 4 + 3])
+        {
+            if(data2[rect2Y * totalWidth2 * 4 + rect2X * 4 + 3]) 
+            {
                 return true;
             }
         }
 
-        if((rect1X == rect1XEnd) && (rect1Y == rect1YEnd)) {
+        if((rect1X == rect1XEnd) && (rect1Y == rect1YEnd))
+        {
             // Done, no hit:
             return false;
         }
 
         // Move to next line if in the end:
-        if(rect1XLineInc == 0) {
-            if(rect1X == rect1XEnd) {
+        if(rect1XLineInc == 0)
+        {
+            if(rect1X == rect1XEnd)
+            {
                 rect1X = rect1XStart - rect1XInc;
                 rect1Y += rect1YLineInc;
             }
         }
-        else {
-            if(rect1Y == rect1YEnd) {
+        else
+        {
+            if(rect1Y == rect1YEnd)
+            {
                 rect1Y = rect1YStart - rect1YInc;
                 rect1X += rect1XLineInc;
             }
         }
 
-        if(rect2XLineInc == 0) {
-            if(rect2X == rect2XEnd) {
+        if(rect2XLineInc == 0)
+        {
+            if(rect2X == rect2XEnd)
+            {
                 rect2X = rect2XStart - rect2XInc;
                 rect2Y += rect2YLineInc;
             }
         }
-        else {
-            if(rect2Y == rect2YEnd) {
+        else
+        {
+            if(rect2Y == rect2YEnd)
+            {
                 rect2Y = rect2YStart - rect2YInc;
                 rect2X += rect2XLineInc;
             }
@@ -316,6 +368,43 @@
     }
 }
 
+    /**
+     *  Maps transform constants to Common Graphics.
+     */
+	int gfxUtils::getCgTransformValue(int aTransform)
+    {
+        int retVal = ETransNone;
+        switch(aTransform)
+        {
+            case ETransNoneType:
+                retVal = ETransNone;
+                break;
+            case ETransRot90Type:
+                retVal = ETransRot90;
+                break;
+            case ETransRot180Type:
+                retVal = ETransRot180;
+                break;
+            case ETransRot270Type:
+                retVal = ETransRot270;
+                break;
+            case ETransMirrorType:
+                retVal = ETransMirror;
+                break;
+            case ETransMirrorRot90Type:
+                retVal = ETransMirrorRot90;
+                break;
+            case ETransMirrorRot180Type:
+                retVal = ETransMirrorRot180;
+                break;
+            case ETransMirrorRot270Type:
+                retVal = ETransMirrorRot270;
+                break;
+            default:
+                break;
+        }
+        return retVal;
+    }
 } // namespace GFX
 } // namespace Java
 
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxutils.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/gfxutils.h	Fri Oct 15 12:29:39 2010 +0300
@@ -26,8 +26,10 @@
     /**
      * Method for checking pixel level collision 
      */
-    static bool detectCollision(int aImage1PixmapHandle, int aTransform1, int aP1x, int aP1y, int aR1x1, int aR1y1, int aR1x2, int aR1y2,
-                                int aImage2PixmapHandle, int aTransform2, int aP2x, int aP2y, int aR2x1, int aR2y1, int aR2x2, int aR2y2);
+    static bool detectCollision(Image* aImage1, int aTransform1, int aP1x, int aP1y, int aR1x1, int aR1y1, int aR1x2, int aR1y2,
+                                Image* aImage2, int aTransform2, int aP2x, int aP2y, int aR2x1, int aR2y1, int aR2x2, int aR2y2);
+private:
+    static int getCgTransformValue(int aTransform);
 
 };
 
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.h	Fri Oct 15 12:29:39 2010 +0300
@@ -77,9 +77,9 @@
  */
 enum TImageType
 {
-    ENone    = -1,
-    EImage    = 0,
-    EPixmap    = 1
+    ENone    = -1,  // Type not defined
+    EImage   = 0,   // QImage
+    EPixmap  = 1    // QPixmap
 };
 
 /**
@@ -100,6 +100,47 @@
 };
 
 /**
+ * Supported reflections.
+ */
+enum TReflection
+{
+    /**
+     * Identity transformation.
+     */
+    EReflectNone = 0,
+    /**
+     * Vertical reflection (in horizontal line through region center).
+     */
+    EReflectVert = 1,
+    /**
+     * Horizontal reflection (in vertical line through region center).
+     */
+    EReflectHorz = 2,
+    /**
+     * Reflection in diagonal line from top left corner to bottom right corner
+     */
+    EReflectDiag = 4
+}; 
+
+/**
+ * Supported transformation are all combinations of the supported reflections.
+ * Note that two reflections make a rotation, so that this list includes pure
+ * rotations by multiples of 90 degrees.
+ */
+enum TTransformType
+{
+    ETransNoneType          = EReflectNone,
+    ETransMirrorRot180Type  = EReflectVert,
+    ETransMirrorType        = EReflectHorz,
+    ETransRot180Type        = EReflectVert | EReflectHorz,
+    ETransMirrorRot270Type  = EReflectDiag,
+    ETransRot90Type         = EReflectVert | EReflectDiag,
+    ETransRot270Type        = EReflectHorz | EReflectDiag,
+    ETransMirrorRot90Type   = EReflectVert | EReflectHorz|EReflectDiag
+};
+
+
+/**
  * Blending modes
  */
 enum TBlendingMode
@@ -1044,7 +1085,7 @@
      *
      * @return a format in which image is represented.
      */
-    virtual int getFormat() = 0;
+    virtual TImageFormat getFormat() = 0;
 
     /**
      * Gets the height of the image.
@@ -1053,13 +1094,49 @@
     virtual int getHeight() = 0;
 
     /**
-     * Returnes native QPixmap.
+     * Returnes the actual QImage wrapper by this instance.
+     * If the image in guestion is not QImage, null is returned.
+     * The actual type of the image can be queried with type() -method.
+     * Note that the caller of this method must not delete returned QImage.
+     * This variant should be used if caller needs only to read the pixels
+     * of returned image. Using const Qimage pointer ensures that the QImage.bits()
+     * variant not detaching memory is used, i.e. it ensures better perfomance.
+     * @return native QImage or null if type is not QImage
+     */
+    virtual const QImage* getConstImage() = 0;
+    
+    /**
+     * Returnes the actual QImage wrapper by this instance.
+     * If the image in guestion is not QImage, null is returned.
+     * The actual type of the image can be queried with type() -method.
+     * Note that the caller of this method must not delete returned QImage.
+     * It is recommended to use toImage() instead if possible.
+     * @return native QImage or null if type is not QImage
+     */
+    virtual QImage* getImage() = 0;
+    
+    /**
+     * Returnes the actual QPixmap wrapper by this instance.
      * If the image in guestion is not QPixmap, null is returned.
+     * The actual type of the image can be queried with type() -method.
+     * It is recommended to use this method over the non const getPixmap(), 
+     * if possible. 
+     * @return native QPixmap or null if type is not QPixmap
+     */
+    virtual const QPixmap* getConstPixmap() = 0;
+
+    /**
+     * Returnes the actual QPixmap wrapper by this instance.
+     * If the image in guestion is not QPixmap, null is returned.
+     * The actual type of the image can be queried with type() -method.
      * Note that the caller of this method must not delete returned pixmap.
+     * This method must be used with extreme caution and only if 
+     * there's no other option.
+     * It is recommended to use toPixmap() or getConstPixmap() instead if possible.
      * @return native QPixmap or null if type is not QPixmap
      */
     virtual QPixmap* getPixmap() = 0;
-
+    
     /**
      * Copies image rgb (32-bit) data of given region to given data array.
      * @param aRgbdata The array to copy the data into.
@@ -1073,7 +1150,6 @@
      */
     virtual void getRgb(int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight) = 0;
 
-
     /**
      * Copies image rgb (1-bit) data of given region to given data array.
      * @param aRgbdata The array to copy the data into.
@@ -1110,11 +1186,38 @@
     virtual int getWidth() = 0;
 
     /**
-     * Converts this image to QImage for pixel access.
+     * Converts this image to QImage for pixel access regardless
+     * of the actual image type inside. Returned instance is always
+     * a copy of the original, thus modifications to it are not
+     * reflected to state of this Image instance.
+     * It is recommended to use this variant when it's only needed to 
+     * read the pixels of the image, as usign QImage.bits() with const
+     * QImage prevents any pixeldata detaching and thus is better in
+     * performance.
      * If conversion fails a null image is returned.
      * @return QImage instance created from wrapped Qt's image type.
      */
-      virtual QImage toImage() = 0;
+    virtual const QImage toConstImage() = 0;
+    
+    /**
+     * Converts this image to QImage for pixel access regardless
+     * of the actual image type inside. Returned instance is always
+     * a copy of the original, thus modifications to it are not
+     * reflected to state of this Image instance.
+     * If conversion fails a null image is returned.
+     * @return QImage instance created from wrapped Qt's image type.
+     */
+    virtual QImage toImage() = 0;
+    
+    /**
+     * Converts this image to QPixmap regardless of the actual
+     * image type inside. Returned instance is always a copy
+     * of the original, thus modifications to it are not
+     * reflected to state of this Image instance.
+     * If conversion fails a null pixmap is returned.
+     * @return QPixmap instance created from wrapped Qt's image type.
+     */
+    virtual QPixmap toPixmap() = 0;
 
     /**
      * Transforms image with given transformation.
@@ -1197,6 +1300,12 @@
      * @param aHeight The height to scale to when the Image is loaded. 
      */
     virtual void setLoadSize(int aWidth, int aHeight) = 0;
+    
+    /**
+     * Sets the result image type.
+     * @param aType The type of the image either EImage or EPixmap
+     */
+    virtual void setResultImageType(TImageType aType) = 0;
 };
 
 /**
@@ -1650,12 +1759,14 @@
      * @param aHeight Image height
      * @param aFillColor The initial color for the image in format #00RRGGBB
      * where hight order byte, i.e. alpha is ingored
+     * @param aType The type of the image either EImage or EPixmap
      */
-    static Image* createImage(int aWidth, int aHeight, int aFillColor);
+    static Image* createImage(int aWidth, int aHeight, int aFillColor, TImageType aType);
 
     /**
      * Create a copy based on the given image.
      * If the given copy region is empty, the whole image is copied.
+     * The copy will have the same native type as the original.
      *
      * @param aImage The source image
      * @param aX The top-left x coordinate of the copy region.
@@ -1664,22 +1775,37 @@
      * @param aHeight The height of the copy region.
      * @see Image::createImage
      */
-    static Image* createImage(
-        Image* aImage, int aX = 0, int aY = 0, int aWidth = 0, int aHeight = 0);
+    static Image* createImage(Image* aImage, int aX = 0, int aY = 0, int aWidth = 0, int aHeight = 0);
+    
+    /**
+     * Create a copy based on the given image.
+     * If the given copy region is empty, the whole image is copied.
+     * The new copy will hav the native type specified by aTypeOfCopy. 
+     *
+     * @param aImage The source image
+     * @param aX The top-left x coordinate of the copy region.
+     * @param aY The top-left y coordinate of the copy region.
+     * @param aWidth The width of the copy region.
+     * @param aHeight The height of the copy region.
+     * @param aTypeOfCopy The native type of the new copy, either EImage or EPixmap
+     * @see Image::createImage
+     */
+    static Image* createImage(Image* aImage, int aX, int aY, int aWidth, 
+                                 int aHeight, TImageType aTypeOfCopy);
     
     /**
      * Create image from a QImage
      *
      * @param aImage The source QImage
      */
-    static Image* createImage(const QImage& aImage);
+    static Image* createImage(const QImage& aImage, TImageType aType);
 
     /**
      * Create image from a QPixmap.
      * 
      * @param aImage The source QPixmap
      */
-    static Image* createImage(const QPixmap& aPixmap);
+    static Image* createImage(const QPixmap& aPixmap, TImageType aType);
 
     /**
      * Creates an image based on the given ARGB data array.
@@ -1688,18 +1814,22 @@
      * @param aHeight Image height
      * @param aHasAlpha If true the rgb data has also an alpha channel,
      * otherwise all pixels are fully opaque, e.g. 0xFFRRGGBB.
+     * @param aType The type of the image either EImage or EPixmap
      */
-    static Image* createImage(int* aRgbData, int aWidth, int aHeight, bool aHasAlpha);
+    static Image* createImage(int* aRgbData, int aWidth, int aHeight, bool aHasAlpha, TImageType aType);
 
     /**
      * Creates new imageloader instance
+     * @param aType The type of the loaded image either EImage or EPixmap
      */
-    static ImageLoader* createImageLoader();
+    static ImageLoader* createImageLoader(TImageType aType);
 
     /**
-     * TODO
+     * Creates an Image instance from given image data.
+     * @param aImageDataPtr The image data 
+     * @param aType The type of the image either EImage or EPixmap 
      */
-    static Image* createImage(ImageDataWrapper* aImageDataPtr);
+    static Image* createImage(ImageDataWrapper* aImageDataPtr, TImageType aType);
 
     /**
      * TODO
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.pri	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.pri	Fri Oct 15 12:29:39 2010 +0300
@@ -20,6 +20,8 @@
               $$PWD/qt
 
 HEADERS += $$PWD/qt/surfaceimpl.h \
+    $$PWD/qt/imagebase.h \
+    $$PWD/qt/imageimpl.h \
     $$PWD/qt/pixmap.h \
     $$PWD/qt/imageloaderimpl.h \
     $$PWD/qt/imagedataimpl.h \
@@ -41,6 +43,8 @@
 }
 
 SOURCES += $$PWD/qt/surfaceimpl.cpp \
+    $$PWD/qt/imagebase.cpp \
+    $$PWD/qt/imageimpl.cpp \
     $$PWD/qt/pixmap.cpp \
     $$PWD/qt/imageloaderimpl.cpp \
     $$PWD/qt/imagedataimpl.cpp \
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphicsfactory.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphicsfactory.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -13,6 +13,7 @@
 #include "bufferimpl.h"
 #include "graphicscontextimpl.h"
 #include "pixmap.h"
+#include "imageimpl.h"
 #include "imageloaderimpl.h"
 #include "imagedataimpl.h"
 #include "palettedataimpl.h"
@@ -54,58 +55,142 @@
     return static_cast<GraphicsContext*>(gc);
 }
 
-/*static*/ Image* GraphicsFactory::createImage(int aWidth, int aHeight, int aFillColor)
+/*static*/ Image* GraphicsFactory::createImage(int aWidth, int aHeight, int aFillColor, TImageType aType)
 {
     GFX_LOG_FUNC_CALL();
-    Pixmap* pixmap = new Pixmap();
-    pixmap->createBySize(aWidth, aHeight, aFillColor ,EFormatNone /*format decided by framework*/);
-    return static_cast<Image*>(pixmap);
+    if(aType == EImage)
+        {
+        ImageImpl* image = new ImageImpl();
+        // create ARGB32 image
+        image->createBySize(aWidth, aHeight, aFillColor, EFormatARGB32); 
+        return static_cast<Image*>(image);
+        }
+    else if(aType == EPixmap)
+        {
+        Pixmap* pixmap = new Pixmap();
+        pixmap->createBySize(aWidth, aHeight, aFillColor ,EFormatNone /*format decided by framework*/);
+        return static_cast<Image*>(pixmap);
+        }
+    return NULL;
 }
 
 /*static*/ Image* GraphicsFactory::createImage(Image* aImage, int aX, int aY, int aWidth, int aHeight)
 {
     GFX_LOG_FUNC_CALL();
-    Pixmap* pixmap = new Pixmap();
-    pixmap->createFromImage(aImage, aX, aY, aWidth, aHeight);
-    return static_cast<Image*>(pixmap);
+    if(aImage->type() == EImage)
+        {
+        ImageImpl* image = new ImageImpl();
+        image->createFromImage(aImage, aX, aY, aWidth, aHeight); 
+        return static_cast<Image*>(image);    
+        }
+    else if(aImage->type() == EPixmap)
+        {
+        Pixmap* pixmap = new Pixmap();
+        pixmap->createFromImage(aImage, aX, aY, aWidth, aHeight);
+        return static_cast<Image*>(pixmap);       
+        }
+    return NULL;
 }
 
-/*static*/ Image* GraphicsFactory::createImage(const QImage& aImage)
+/*static*/ Image* GraphicsFactory::createImage(Image* aImage, int aX, int aY, int aWidth, 
+                                                  int aHeight, TImageType aTypeOfCopy)
 {
     GFX_LOG_FUNC_CALL();
-    Pixmap* pixmap = new Pixmap();
-    pixmap->createFromQImage(aImage);
-    return static_cast<Image*>(pixmap);
+    if(aTypeOfCopy == EImage)
+        {
+        ImageImpl* image = new ImageImpl();
+        image->createFromImage(aImage, aX, aY, aWidth, aHeight); 
+        return static_cast<Image*>(image);    
+        }
+    else if(aTypeOfCopy == EPixmap)
+        {
+        Pixmap* pixmap = new Pixmap();
+        pixmap->createFromImage(aImage, aX, aY, aWidth, aHeight);
+        return static_cast<Image*>(pixmap);       
+        }
+    return NULL;
 }
 
-/*static*/ Image* GraphicsFactory::createImage(const QPixmap& aPixmap)
+/*static*/ Image* GraphicsFactory::createImage(const QImage& aImage, TImageType aType)
 {
     GFX_LOG_FUNC_CALL();
-    Pixmap* pixmap = new Pixmap();
-    pixmap->createFromQPixmap(aPixmap);
-    return static_cast<Image*>(pixmap);
+    if(aType == EImage)
+         {
+         ImageImpl* image = new ImageImpl();
+         // create ARGB32 image
+         image->createFromQImage(aImage);
+         return static_cast<Image*>(image);
+         }
+     else if(aType == EPixmap)
+         {
+         Pixmap* pixmap = new Pixmap();
+         pixmap->createFromQImage(aImage);
+         return static_cast<Image*>(pixmap);
+         }
+    return NULL;
 }
 
-/*static*/ Image* GraphicsFactory::createImage(int* aRgbData, int aWidth, int aHeight, bool aHasAlpha)
+/*static*/ Image* GraphicsFactory::createImage(const QPixmap& aPixmap, TImageType aType)
 {
-    Pixmap* pixmap = new Pixmap();
-    pixmap->createFromRGB(aRgbData, aWidth, aHeight, aHasAlpha);
-    return static_cast<Image*>(pixmap);
+    GFX_LOG_FUNC_CALL();
+    if(aType == EImage)
+         {
+         ImageImpl* image = new ImageImpl();
+         // create ARGB32 image
+         image->createFromQPixmap(aPixmap);
+         return static_cast<Image*>(image);
+         }
+     else if(aType == EPixmap)
+         {
+         Pixmap* pixmap = new Pixmap();
+         pixmap->createFromQPixmap(aPixmap);
+         return static_cast<Image*>(pixmap);
+         }
+    return NULL;
 }
 
-/*static*/ ImageLoader* GraphicsFactory::createImageLoader()
+/*static*/ Image* GraphicsFactory::createImage(int* aRgbData, int aWidth, int aHeight, bool aHasAlpha, TImageType aType)
 {
     GFX_LOG_FUNC_CALL();
-    ImageloaderImpl* loader = new ImageloaderImpl();
+    if(aType == EImage)
+        {
+        ImageImpl* image = new ImageImpl();
+        image->createFromRGB(aRgbData, aWidth, aHeight, aHasAlpha); 
+        return static_cast<Image*>(image);    
+        }
+    else if(aType == EPixmap)
+        {
+        Pixmap* pixmap = new Pixmap();
+        pixmap->createFromRGB(aRgbData, aWidth, aHeight, aHasAlpha);
+        return static_cast<Image*>(pixmap);       
+        }
+    return NULL; 
+}
+
+/*static*/ ImageLoader* GraphicsFactory::createImageLoader(TImageType aType)
+{
+    GFX_LOG_FUNC_CALL();
+    ImageloaderImpl* loader = new ImageloaderImpl(aType);
     return static_cast<ImageLoader*>(loader);
 }
 
-/*static*/ Image* GraphicsFactory::createImage(ImageDataWrapper* aImageDataPtr)
+/*static*/ Image* GraphicsFactory::createImage(ImageDataWrapper* aImageDataPtr, TImageType aType)
 {
     GFX_LOG_FUNC_CALL();
-    Pixmap* pixmap = new Pixmap();
-    pixmap->createFromImageData(aImageDataPtr);
-    return static_cast<Image*>(pixmap);
+    
+    if(aType == EImage)
+         {
+         ImageImpl* image = new ImageImpl();
+         image->createFromImageData(aImageDataPtr); 
+         return static_cast<Image*>(image);    
+         }
+    else if(aType == EPixmap)
+         {
+         Pixmap* pixmap = new Pixmap();
+         pixmap->createFromImageData(aImageDataPtr);
+         return static_cast<Image*>(pixmap);       
+         }
+    return NULL;
 }
 
 /*static*/ ImageDataWrapper* GraphicsFactory::createImageData(Image* aImage)
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/graphicscontextimpl.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/graphicscontextimpl.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -188,7 +188,7 @@
  *  NOTE: This covers currently only Images
  */
 void GraphicsContextImpl::copyArea(Image* aImage, int aX, int aY)
-{
+    {
     GFX_LOG_FUNC_CALL();
 
     switch (mSurface.getType()) {
@@ -197,16 +197,16 @@
         {
             QWidget* widget = 0;
             if (mSurface.getType() == ETypeWidget)
-            {
+                {
                 widget = mSurface.getWidget();
-            }
+                }
             else // ETypeBuffer
-            {
+                {
                 widget = static_cast<QWidget*>(reinterpret_cast<QObject*>(mSurface.getBufferFlushTarget()));
-            }
+                }
 
             if (widget)
-            {
+                {
                 // Determine the smallest area needed to grab, don't grab anything we don't need
                 const int widgetGrabWidth = widget->width() - aX;
                 const int widgetGrabHeight = widget->height() - aY;
@@ -281,34 +281,60 @@
             break;
         }
         case ETypeImage:
-        {
+            {
             TImageType type = mSurface.getImageType();
-
+            QPaintDevice* target = NULL;
+            if(aImage->type() == EPixmap)
+                {
+                target = aImage->getPixmap();
+                }
+            else if(aImage->type() == EImage) 
+                {
+                target = aImage->getImage();
+                }
+            
             if (type == EPixmap)
-            {
+                {
                 QPixmap* source = mSurface.getPixmap();
-                QPixmap* target = aImage->getPixmap();
                 QRect sourceRect(aX, aY, target->width(), target->height());
                 QRect targetRect(0, 0, target->width(), target->height());
 
                 // If copying on itself then don't try to create two QPainters
                 // for the same paint device
                 if(target == source)
-                {
+                    {
                     drawPixmapCheckOverlap(*mPainter, *target, targetRect, *source, sourceRect);
-                }
+                    }
                 else
-                {
+                    {
                     QPainter painter(target);
                     drawPixmapCheckOverlap(painter, *target, targetRect, *source, sourceRect);
+                    }
                 }
-            }
+            else if(type == EImage) 
+                {
+                QImage* source = mSurface.getImage();
+                QRect sourceRect(aX, aY, target->width(), target->height());
+                QRect targetRect(0, 0, target->width(), target->height());
+
+                // If copying on itself then don't try to create two QPainters
+                // for the same paint device
+                if(target == source)
+                    {
+                    drawImageCheckOverlap(*mPainter, *target, targetRect, *source, sourceRect);
+                    }
+                else
+                    {
+                    QPainter painter(target);
+                    drawImageCheckOverlap(painter, *target, targetRect, *source, sourceRect);
+                    }
+                }
             else
-            {
+                {
                 Q_ASSERT_X(false, "Graphics", "CopyArea image type not recognized");
+                }
+            break;
             }
-            break;
-        }
         default:
             Q_ASSERT_X(false, "Graphics", "Surface type not recognized");
             break;
@@ -436,14 +462,17 @@
         {
             // first obtain native image type of current target (QPixmap/QImage)
             TImageType type = mSurface.getImageType();
-
-
+            QRect sourceRect = QRect(aSrcX, aSrcY, aWidth, aHeight);
+            QRect targetRect = QRect(aDestX, aDestY, aWidth, aHeight);
+            
             if (type == EPixmap)
             {
-                QRect sourceRect = QRect(aSrcX, aSrcY, aWidth, aHeight);
-                QRect targetRect = QRect(aDestX, aDestY, aWidth, aHeight);
                 drawPixmapCheckOverlap(*mPainter, *mSurface.getBindable(), targetRect, *mSurface.getPixmap(), sourceRect);
             }
+            else if (type == EImage)
+            {
+                drawImageCheckOverlap(*mPainter, *mSurface.getBindable(), targetRect, *mSurface.getImage(), sourceRect);
+            }
             else
             {
                 Q_ASSERT_X(false, "Graphics", "CopyArea image type not recognized");
@@ -486,7 +515,10 @@
     switch (type)
     {
         case EPixmap:
-            mPainter->drawPixmap(x, y, *(aImage->getPixmap()));
+            mPainter->drawPixmap(x, y, *(aImage->getConstPixmap()));
+            break;
+        case EImage:
+            mPainter->drawImage(QPoint(x,y), *(aImage->getConstImage()));
             break;
         default:
             Q_ASSERT_X(false, "Graphics", "Image type not recognized");
@@ -510,7 +542,10 @@
     switch (type)
     {
         case EPixmap:
-            mPainter->drawPixmap(QRect(aTx ,aTy, aTw, aTh), *(aImage->getPixmap()), QRect(aSx, aSy, aSw, aSh));
+            mPainter->drawPixmap(QRect(aTx ,aTy, aTw, aTh), *(aImage->getConstPixmap()), QRect(aSx, aSy, aSw, aSh));
+            break;
+        case EImage:
+            mPainter->drawImage(QRect(aTx ,aTy, aTw, aTh), *(aImage->getConstImage()), QRect(aSx, aSy, aSw, aSh));
             break;
         default:
             Q_ASSERT_X(false, "Graphics", "Image type not recognized");
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/graphicscontextimpl.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/graphicscontextimpl.h	Fri Oct 15 12:29:39 2010 +0300
@@ -104,6 +104,14 @@
     virtual void saveSettings();
     virtual void restoreSettings();
 
+    /**
+    * Returns trasformed image
+    *
+    * @param image image to perform transformation on
+    * @param manuplation indicates what kind of transformation is needed
+    */
+    QImage doTransform(QImage image, int manipulation);
+
 private:
 
     /**
@@ -135,14 +143,6 @@
     bool isPtrWithinRange(const int* aStartPtr, const int* aEndPtr, const int* aPrt);
 
     /**
-     * Returns trasformed image
-     *
-     * @param image image to perform transformation on
-     * @param manuplation indicates what kind of transformation is needed
-     */
-
-    QImage doTransform(QImage image, int manipulation);
-    /**
      * Performs clean for graphicsContext, i.e. deletes all allocations
      * and resets state.
      */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagebase.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,397 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include "imagebase.h"
+#include "gfxlog.h"
+
+namespace Java { namespace GFX {
+
+ImageBase::ImageBase() : mAlpha(-1), mHasMask(false)
+    {
+    }
+
+ImageBase::~ImageBase()
+    {
+    }
+
+void ImageBase::doGetRgb(QImage& image, int* aRgbdata, int aOffset, int aScanlength, 
+                         int aX, int aY, int aWidth, int aHeight)
+    {
+    GFX_LOG_FUNC_CALL();
+
+    if(aX != 0 || aY != 0 || aWidth < image.width() || aHeight < image.height())
+        {
+        image = image.copy(aX, aY, aWidth, aHeight);
+        if(image.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "copying from original image failed");
+            }
+        }
+
+    // If image is not 32bpp we need to convert it
+    if(image.format() != QImage::Format_RGB32 &&
+       image.format() != QImage::Format_ARGB32)
+        {
+        image = image.convertToFormat(QImage::Format_ARGB32);
+        if(image.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "format convertion to 32bpp failed");
+            }
+        }
+
+    // Temporary storage for pixels
+    QRgb* pixel = NULL;
+
+    // dataArray index, start from offset
+    int targetIndex = aOffset;
+    // Iterate through lines
+    for(int b = 0; b < aHeight; ++b)
+        {
+        // Obtain pointer to start of current line (y)
+        const unsigned char* lineStart = image.scanLine(b);
+        // Iterate through pixels on each line
+        for (int a = 0; a < aWidth; ++a)
+            {
+            // Set the current pixel, relative to line start
+            pixel = ((QRgb*)lineStart) + a;
+            // Move target pointer to the next slot
+            targetIndex = aOffset + a + (b * aScanlength);
+            // Shift pixels to correct places, needed for 32-bit format
+            // as the bits order in memory may vary between systems
+            aRgbdata[targetIndex] =  ((qAlpha(*pixel) & 0xff) << 24) |
+                                     ((qRed(*pixel)   & 0xff) << 16) |
+                                     ((qGreen(*pixel) & 0xff) << 8 ) |
+                                     ((qBlue(*pixel)  & 0xff));
+            }
+        }
+    }
+
+void ImageBase::doGetRgb(QImage& image, char* aRgbdata, char* aTransparencyMask,int aOffset, 
+                         int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat)
+    {
+    GFX_LOG_FUNC_CALL();
+
+    if(aX != 0 || aY != 0 || aWidth < image.width() || aHeight < image.height())
+        {
+        image = image.copy(aX, aY, aWidth, aHeight);
+        if(image.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "copying from original image failed");
+            }
+        }
+
+    if(aScanlength < 0)
+        {
+         image = image.mirrored(false, true);
+         if(image.isNull())
+             {
+             throw GfxException(EGfxErrorNoMemory, "Mirroring failed");
+             }
+        }
+
+    // If image is not monochrome we need to convert it
+    if(image.format() != QImage::Format_Mono)
+    {
+        image = image.convertToFormat(QImage::Format_Mono);
+        if(image.isNull())
+        {
+            throw GfxException(EGfxErrorNoMemory, "Format conversion to 8bpp failed");
+        }
+    }
+
+    // dataArray index, start from offset
+    int targetIndex = aOffset;
+
+    const unsigned char* imageStart = image.bits();
+    QImage mask = image.alphaChannel();
+    const unsigned char* maskStart = mask.bits();
+
+    // Find the number of full bytes
+    int fullBytes = aWidth/8;
+    int bpl = image.bytesPerLine();
+
+    if(bpl == fullBytes)
+        {
+        memcpy(aRgbdata+targetIndex, imageStart, bpl*aHeight);
+        memcpy(aTransparencyMask+targetIndex, maskStart, bpl*aHeight);
+        }
+    else
+        {
+        memcpy(aRgbdata+targetIndex, imageStart, fullBytes*aHeight + aHeight);
+        memcpy(aTransparencyMask+targetIndex, maskStart, fullBytes*aHeight + aHeight);
+        }
+    }
+
+void ImageBase::doGetRgb(QImage& image, short* aRgbdata, int aOffset, int aScanlength, 
+                         int aX, int aY, int aWidth, int aHeight, int aFormat)
+    {
+    GFX_LOG_FUNC_CALL();
+
+    // Match format to QT
+    int format;
+    switch (aFormat) {
+        case EFormatRGB555:
+            format = QImage::Format_RGB555;
+            break;
+        case EFormatRGB16:
+            format = QImage::Format_RGB16;
+            break;
+         case EFormatRGB444:
+            format = QImage::Format_RGB444;
+            break;
+         case EFormatARGB4444Premultiplied:
+            format = QImage::Format_ARGB4444_Premultiplied;
+            break;
+         default:
+            format = QImage::Format_RGB16;
+    }
+
+    if(aX != 0 || aY != 0 || aWidth < image.width() || aHeight < image.height())
+        {
+        image = image.copy(aX, aY, aWidth, aHeight);
+        if(image.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "copying from original image failed");
+            }
+        }
+
+    // If image is not format we need, convert it
+    if(image.format() != format)
+        {
+        image = image.convertToFormat((QImage::Format)format);
+        if(image.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "format convertion to 16bpp failed");
+            }
+        }
+
+    // Temporary storage for pixels
+    short* pixel = NULL;
+    // dataArray index, start from offset
+    int targetIndex = aOffset;
+
+    // Iterate through lines
+    for(int b=0; b < aHeight; b++)
+        {
+        // Obtain pointer to start of current line (y)
+        const unsigned char* lineStart = image.scanLine(b);
+        // Iterate through pixels on each line
+        for(int a=0; a < aWidth; a++)
+            {
+            // Set the current pixel, relative to line start
+            pixel = ((short*)lineStart) + a;
+            // Move target pointer to the next slot
+            targetIndex = aOffset + a + (b * aScanlength);
+            aRgbdata[targetIndex] =  *pixel;
+            }
+        }
+    }
+
+QTransform ImageBase::generateTransformMatrix(TTransform aTransform)
+    {
+    GFX_LOG_FUNC_CALL();
+
+    // In case there's both mirror and rotate is requested, the angle of rotation
+    // must be negative since when the transform is applied the z-axis is processed
+    // before y-axis, while the spec mandates reverse order. So by having negative  
+    // degrees for rotation along z-axis here, gives correct output.
+    QTransform transform;
+    switch(aTransform) 
+        {
+        case ETransNone:
+            // No transform or mirror
+            break;
+        case ETransRot90:
+            transform.rotate(90, Qt::ZAxis);
+            break;
+        case ETransRot180:
+            transform.rotate(180, Qt::ZAxis);
+            break;
+        case ETransRot270:
+            transform.rotate(270, Qt::ZAxis);
+            break;
+        case ETransMirror:
+            transform.rotate(180,Qt::YAxis);
+            break;
+        case ETransMirrorRot90:
+            transform.rotate(180, Qt::YAxis);
+            transform.rotate(-90, Qt::ZAxis);
+            break;
+        case ETransMirrorRot180:
+            transform.rotate(180, Qt::YAxis);
+            transform.rotate(-180, Qt::ZAxis);
+            break;
+        case ETransMirrorRot270:
+            transform.rotate(180, Qt::YAxis);
+            transform.rotate(-270, Qt::ZAxis);
+            break;
+        default:
+            Q_ASSERT_X(false, "Graphics", "Transform type not recognized");
+        }
+    return transform;
+    }
+
+int ImageBase::getAlpha() 
+    {
+    return mAlpha;
+    }
+
+bool ImageBase::hasMask()
+    {
+    return mHasMask;
+    }
+
+QImage ImageBase::imageDataToQImage(ImageDataWrapper* aData)
+    {
+    if(aData->getDepth() != 32)
+        {
+        // Java side always converts the ImageData to 32 bit before passing it
+        // to native side, bail out if we get something else
+        throw GfxException(EGfxErrorNoMemory, "Only 32 bit ImageData is supported in Image creation");
+        }
+
+    int bpp = 4; // bit depth = 32, 4 bytes per pixel
+    int size = aData->getWidth()*aData->getHeight()*bpp;
+    char* pixelData = aData->getData(ImageDataWrapper::EPixelData);
+
+    for(int index = 0; index < size; index += bpp)
+        {
+        int pixel = *(reinterpret_cast<int*>(pixelData+index));
+
+        pixelData[index]   = (uchar)(pixel >> 24) & 0xFF;
+        pixelData[index+1] = (uchar)(pixel >> 16) & 0xFF;
+        pixelData[index+2] = (uchar)(pixel >> 8) & 0xFF;
+        pixelData[index+3] = 0xFF; // Set alpha to opaque here, alpha channel data will be handled later
+        }
+
+    QImage image(reinterpret_cast<uchar*>(aData->getData(ImageDataWrapper::EPixelData)),
+                                              aData->getWidth(),
+                                              aData->getHeight(),
+                                              aData->getBytesPerLine(),
+                                              QImage::Format_ARGB32);
+    if(image.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image creation failed");
+        }
+
+    // Set indexed palette (if one is set)
+    if(!aData->isDirect())
+        {
+        image.setColorTable(*aData->getPaletteData()->getIndexedPalette());
+        }
+
+    mHasMask = false;
+    mAlpha = aData->getAlpha();
+
+    if(aData->getData(ImageDataWrapper::EMaskData))
+        {
+        QImage mask(reinterpret_cast<uchar*>(aData->getData(ImageDataWrapper::EMaskData)),
+                                             aData->getWidth(),
+                                             aData->getHeight(),
+                                             QImage::Format_Mono);
+        if(mask.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "Image alpha channel creation failed");
+            }
+        image.setAlphaChannel(mask);
+        mHasMask = true;
+        }
+    else if(mAlpha != -1)
+        {
+        // Global alpha is set, overrides alpha channel data
+        QImage alpha(aData->getWidth(), aData->getHeight(), QImage::Format_Indexed8);
+        if(alpha.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "Image alpha channel creation failed");
+            }
+
+        alpha.fill(aData->getAlpha());
+        image.setAlphaChannel(alpha);
+        }
+    else if(aData->getData(ImageDataWrapper::EAlphaData))
+        {
+        // Alpha channel data is set
+        const int w = aData->getWidth();
+        QImage alpha(reinterpret_cast<uchar*>(aData->getData(ImageDataWrapper::EAlphaData)),
+                                              w,
+                                              aData->getHeight(),
+                                              w,
+                                              QImage::Format_Indexed8);
+        QVector<QRgb> colors(255);
+        for(int i=0; i<255; i++)
+            {
+            colors[i] = qRgb(i, i, i);
+            }
+        alpha.setColorTable(colors);
+        colors.clear();
+
+        if(alpha.isNull())
+            {
+            throw GfxException(EGfxErrorNoMemory, "Image alpha channel creation failed");
+            }
+        image.setAlphaChannel(alpha);
+        }
+    return image;
+    }
+
+
+QImage::Format ImageBase::mapInternalFormatToQt(TImageFormat internalImageFormat)
+    {
+    switch (internalImageFormat) 
+        {
+        case EFormatARGB32:
+            return QImage::Format_ARGB32;
+        case EFormatRGB32:
+            return QImage::Format_RGB32;
+        case EFormatARGB32Premultiplied:
+            return QImage::Format_ARGB32_Premultiplied;
+         case EFormatRGB16:
+            return QImage::Format_RGB16;
+         case EFormatRGB555:
+            return QImage::Format_RGB555;
+         case EFormatRGB444:
+            return QImage::Format_RGB444;
+         case EFormatARGB4444Premultiplied:
+            return QImage::Format_ARGB4444_Premultiplied;
+         case EFormatMONO:
+            return QImage::Format_Mono;
+         default:
+            return QImage::Format_Invalid;
+        }
+    }
+
+TImageFormat ImageBase::mapQtFormatToInternal(QImage::Format qtImageFormat)
+    {
+    switch (qtImageFormat) 
+        {
+        case QImage::Format_ARGB32:
+            return EFormatARGB32;
+        case QImage::Format_RGB32:
+            return EFormatRGB32;
+        case QImage::Format_ARGB32_Premultiplied:
+            return EFormatARGB32Premultiplied;
+         case QImage::Format_RGB16:
+            return EFormatRGB16;
+         case QImage::Format_RGB555:
+            return EFormatRGB555;
+         case QImage::Format_RGB444:
+            return EFormatRGB444;
+         case QImage::Format_ARGB4444_Premultiplied:
+            return EFormatARGB4444Premultiplied;
+         case QImage::Format_Mono:
+            return EFormatMONO;
+         default:
+            return EFormatNone;
+        }
+    }
+
+} // namespace GFX
+} // namespace Java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagebase.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial API and implementation
+ *******************************************************************************/
+
+#ifndef IMAGEBASE_H_
+#define IMAGEBASE_H_
+
+#include "graphics.h"
+#include <QImage>
+#include <QTransform>
+
+namespace Java { namespace GFX {
+
+class ImageBase: public Image
+    {
+public:
+    ImageBase(); 
+    virtual ~ImageBase();
+    
+    /**
+     * from Image
+     * @see Image
+     */
+    virtual void createBySize(int aWidth, int aHeight, int aFillColor, TImageFormat aFormat) = 0;
+    virtual void createFromQImage(const QImage& aImage) = 0;
+    virtual void createFromQPixmap(const QPixmap& aPixmap) = 0;
+    virtual void createFromImage(Image* aImage, int aX, int aY, int aWidth, int aHeight) = 0;
+    virtual void createFromImageData(ImageDataWrapper* aData) = 0;
+    virtual void createFromRGB(int* aRgbdata, int aWidth, int aHeight, bool aHasAlpha) = 0;
+    virtual void dispose() = 0;
+    virtual QPaintDevice* getBindable() = 0;
+    virtual TImageFormat getFormat() = 0;
+    virtual int getHeight() = 0;
+    virtual const QImage* getConstImage() = 0;
+    virtual QImage* getImage() = 0;
+    virtual const QPixmap* getConstPixmap() = 0;
+    virtual QPixmap* getPixmap() = 0;
+    virtual void getRgb(int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight) = 0;
+    virtual void getRgb(char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat) = 0;
+    virtual void getRgb(short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat) = 0;
+    virtual int getWidth() = 0;
+    virtual const QImage toConstImage() = 0;
+    virtual QImage toImage() = 0;
+    virtual QPixmap toPixmap() = 0;
+    virtual void transform(TTransform aTransform) = 0;
+    virtual TImageType type() = 0;
+    virtual int getAlpha();
+    virtual bool hasMask();
+    virtual bool hasAlphaChannel() = 0;
+    
+protected:
+    /**
+     * Writes RGB to given int type data array.
+     */
+    void doGetRgb(QImage& image, int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, 
+                  int aWidth, int aHeight);
+    
+    /**
+     * Writes RGB to given char type data array.
+     */
+    void doGetRgb(QImage& image, char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, 
+                   int aX, int aY, int aWidth, int aHeight, int aFormat);
+    
+    /**
+     * Writes RGB to given short type data array.
+     */ 
+    void doGetRgb(QImage& image, short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, 
+                  int aWidth, int aHeight, int aFormat);
+    
+    /**
+     * Creates transform matrix for given transformation.
+     * @param aTransform the transform type to be created
+     */
+    QTransform generateTransformMatrix(TTransform aTransform);
+    
+    /**
+     * Processes image data and creates QImage with properties
+     * defined in the image data.
+     * 
+     * @param aData Image data to be processed
+     */
+    QImage imageDataToQImage(ImageDataWrapper* aData);
+    
+    /**
+     * Maps given QImage based image format to those defined in TImageFormat.
+     * @param qtImageFormat the image format in Qt defitions
+     * @return format in internal type
+     */
+    TImageFormat mapQtFormatToInternal(QImage::Format qtImageFormat);
+    
+    /**
+     * Maps given internal (TImageFormat) image format to Qt format.
+     * @param internalImageFormat the image format in internal type
+     * @return format in Qt type
+     */
+    QImage::Format mapInternalFormatToQt(TImageFormat internalImageFormat);
+    
+    /**
+     * Level of alpha
+     */
+    int      mAlpha;
+    
+    /**
+     * Mask flag
+     */
+    bool     mHasMask;
+    
+    
+    };
+
+} // namespace GFX
+} // namespace Java
+
+#endif /* IMAGEBASE_H_ */
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagedataimpl.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imagedataimpl.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -65,7 +65,7 @@
 void ImageDataWrapperImpl::setData(Image* aSrc)
 {
     GFX_LOG_FUNC_CALL();
-    QImage image = aSrc->getPixmap()->toImage();
+    const QImage image = aSrc->toConstImage();
     fillData(&image, aSrc->getAlpha(), aSrc->hasMask());
 }
 
@@ -117,16 +117,33 @@
     const uchar* data = aImage->scanLine(0);
 
     char* pixelData = mPixelData.data();
+    uchar* alphaData = 0;
+    if (mDepth == 32 && !aMask && mAlpha == -1)
+    {
+        mAlphaData.fill(0xFF, aImage->width() * aImage->height());
+        alphaData = (uchar*) mAlphaData.data();
+    }
 
     int pixel = 0;
+    int alpha = 0;
+    bool alphaInUse = false;
 
     // Create
-    for (int i = 0; i < size; i += bpp)
+    for (int i = 0, j = 0; i < size; i += bpp, j++)
     {
         switch (mDepth)
         {
         case 32:
-            pixel = (data[i] & 0xFF) << 24 | (data[i+1] & 0xFF) << 16 | (data[i+2] & 0xFF) << 8 | (data[i+3] & 0xFF);
+            alpha = data[i+3] & 0xFF;
+            pixel = (data[i] & 0xFF) << 24 | (data[i+1] & 0xFF) << 16 | (data[i+2] & 0xFF) << 8 | alpha;
+            if (!aMask && mAlpha == -1 && alpha != 0xFF)
+            {
+                *(uchar*)(alphaData + j) = alpha;
+                if (!alphaInUse)
+                {
+                    alphaInUse = true;
+                }
+            }
             *(int*)(pixelData + i) = pixel;
             break;
         case 24:
@@ -144,6 +161,13 @@
             throw GfxException(EGfxErrorIllegalArgument, "Unsupported bit depth");
         }
     }
+    
+    // According to eSWT's API, an alpha data should be present
+    // only when there are actual semi or fully transparent pixels.
+    if (!alphaInUse)
+    {
+        mAlphaData.clear();
+    }
 
     if (aMask)
     {
@@ -164,19 +188,6 @@
     {
         mAlphaData.fill(mAlpha, aImage->width()*aImage->height());
     }
-    else if (aImage->hasAlphaChannel())
-    {
-
-    QImage alphaImage = aImage->alphaChannel();
-    const int w = alphaImage.width();
-    for(int j= 0; j < alphaImage.height(); j++)
-        {
-        for(int i = 0; i < w; i++)
-            {
-            mAlphaData[j * w + i] = alphaImage.pixel(i, j) & 0xFF;
-            }
-        }
-    }
 
     // Create palette
     if (aImage->numColors() > 0)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageimpl.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial API and implementation
+ *******************************************************************************/
+
+#include <QPixmap>
+#include "imageimpl.h"
+#include "gfxlog.h"
+
+namespace Java { namespace GFX {
+
+ImageImpl::ImageImpl() : ImageBase()
+    {
+    GFX_LOG_FUNC_CALL();
+    }
+
+ImageImpl::~ImageImpl()
+    {
+    GFX_LOG_FUNC_CALL();
+    }
+
+void ImageImpl::createBySize(int aWidth, int aHeight, int aFillColor, TImageFormat aFormat)
+    {
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mImage.isNull());
+
+    mImage = QImage(aWidth, aHeight, mapInternalFormatToQt(aFormat));
+    // Check if creation was successful
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (QImage) creation failed");
+        }
+    // Finally fill with given fillColor, also clears the image mem area
+    // otherwise there might be some random coloured pixels in image
+    mImage.fill(aFillColor);
+    }
+
+
+void ImageImpl::createFromQImage(const QImage& aImage)
+    {
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mImage.isNull());
+
+    mImage = QImage(aImage);
+    // Validate allocation
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (QImage) creation failed");
+        }
+    }
+    
+void ImageImpl::createFromQPixmap(const QPixmap& aPixmap)
+    {
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mImage.isNull());
+
+    mImage = aPixmap.toImage();
+    // Validate allocation
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (QImage) creation failed");
+        }    
+    }
+
+void ImageImpl::createFromImage(Image* aImage, int aX, int aY, int aWidth, int aHeight)
+    {
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mImage.isNull());
+
+    // Check if the copy should be exactly same as the original
+    if((aImage->getWidth() == aWidth) && (aImage->getHeight() == aHeight) || 
+        QRect(aX, aY, aWidth, aHeight).isEmpty())
+        {
+        mImage = aImage->toImage();
+        }
+    // it's needed to make partial copy of the original
+    else
+        {
+        switch(aImage->type())
+            {
+            case EImage:
+                {
+                mImage = aImage->getConstImage()->copy(aX, aY, aWidth, aHeight);
+                break;
+                }
+            case EPixmap:
+                {
+                mImage = (aImage->getConstPixmap()->copy(aX, aY, aWidth, aHeight)).toImage();
+                break;
+                }
+            default:
+                throw GfxException(EGfxErrorIllegalArgument, "Unsupported source image type");
+            }
+        }
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (pixmap) creation failed");
+        }
+    }
+
+void ImageImpl::createFromImageData(ImageDataWrapper* aData)
+    {
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mImage.isNull());
+
+    mImage = imageDataToQImage(aData);
+
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (QImage) creation failed");
+        }
+    }
+
+void ImageImpl::createFromRGB(int* aRgbdata, int aWidth, int aHeight, bool aHasAlpha) 
+    {
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mImage.isNull());
+
+    // Create QImage from rgbdata 
+    mImage = QImage(reinterpret_cast<unsigned char*>(aRgbdata), aWidth, aHeight,
+        (aHasAlpha ? QImage::Format_ARGB32 : QImage::Format_RGB32));
+
+    // Validate creation
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (QImage) creation failed");
+        }
+    }
+    
+void ImageImpl::dispose()
+    {
+    GFX_LOG_FUNC_CALL();
+    delete this;
+    }
+
+QPaintDevice* ImageImpl::getBindable()
+    {
+    GFX_LOG_FUNC_CALL();
+    return static_cast<QPaintDevice*>(&mImage);
+    }
+
+TImageFormat ImageImpl::getFormat()
+    {
+    return mapQtFormatToInternal(mImage.format());
+    }
+
+int ImageImpl::getHeight()
+    {
+    GFX_LOG_FUNC_CALL();
+    return mImage.height();
+    }
+
+const QImage* ImageImpl::getConstImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return &mImage;
+    }
+        
+        
+QImage* ImageImpl::getImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return &mImage;
+    }
+
+const QPixmap* ImageImpl::getConstPixmap()
+    {
+    GFX_LOG_FUNC_CALL();
+    return NULL;
+    }
+
+QPixmap* ImageImpl::getPixmap()
+    {
+    GFX_LOG_FUNC_CALL();
+    return NULL;
+    }
+
+void ImageImpl::getRgb(int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight)
+    {
+    GFX_LOG_FUNC_CALL();
+    doGetRgb(mImage, aRgbdata, aOffset, aScanlength, aX, aY, aWidth, aHeight);
+    }
+
+void ImageImpl::getRgb(char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat)
+    {
+    GFX_LOG_FUNC_CALL();
+    doGetRgb(mImage, aRgbdata, aTransparencyMask, aOffset, aScanlength, aX, aY, aWidth, aHeight, aFormat);
+    }
+
+void ImageImpl::getRgb(short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat)
+    {
+    GFX_LOG_FUNC_CALL();
+    doGetRgb(mImage, aRgbdata, aOffset, aScanlength, aX, aY, aWidth, aHeight, aFormat);
+    }
+int ImageImpl::getWidth()
+    {
+    GFX_LOG_FUNC_CALL();
+    return mImage.width();
+    }
+
+const QImage ImageImpl::toConstImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return QImage(mImage);
+    }
+
+QImage ImageImpl::toImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return QImage(mImage);
+    }
+
+QPixmap ImageImpl::toPixmap()
+    {
+    GFX_LOG_FUNC_CALL();
+    return QPixmap::fromImage(mImage);
+    }
+
+void ImageImpl::transform(TTransform aTransform) 
+    {
+    GFX_LOG_FUNC_CALL();
+    mImage = mImage.transformed(generateTransformMatrix(aTransform), Qt::FastTransformation);
+    // Validate creation
+    if(mImage.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (QImage) creation failed");
+        }
+    }
+
+TImageType ImageImpl::type()
+    {
+    return EImage;
+    }
+
+bool ImageImpl::hasAlphaChannel()
+    {
+    GFX_LOG_FUNC_CALL();
+    return mImage.hasAlphaChannel();
+    }
+
+} // namespace GFX
+} // namespace Java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageimpl.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial API and implementation
+ *******************************************************************************/
+#ifndef IMAGEIMPL_H_
+#define IMAGEIMPL_H_
+
+#include <QImage>
+#include "imagebase.h"
+
+namespace Java { namespace GFX {
+
+class ImageImpl: public ImageBase
+    {
+public:
+    /**
+      * Ctor
+      */
+    ImageImpl();
+    
+    /**
+     * Dtor
+     */    
+    virtual ~ImageImpl();
+    
+    /**
+     * from Image
+     * @see Image
+     */
+    virtual void createBySize(int aWidth, int aHeight, int aFillColor, TImageFormat aFormat);
+    virtual void createFromQImage(const QImage& aImage);
+    virtual void createFromQPixmap(const QPixmap& aPixmap);
+    virtual void createFromImage(Image* aImage, int aX, int aY, int aWidth, int aHeight);
+    virtual void createFromImageData(ImageDataWrapper* aData);
+    virtual void createFromRGB(int* aRgbdata, int aWidth, int aHeight, bool aHasAlpha);
+    virtual void dispose();
+    virtual QPaintDevice* getBindable();
+    virtual TImageFormat getFormat();
+    virtual int getHeight();
+    virtual const QImage* getConstImage();
+    virtual QImage* getImage();
+    virtual const QPixmap* getConstPixmap();
+    virtual QPixmap* getPixmap();
+    virtual void getRgb(int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight);
+    virtual void getRgb(char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat);
+    virtual void getRgb(short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat);
+    virtual int getWidth();
+    virtual const QImage toConstImage();
+    virtual QImage toImage();
+    virtual QPixmap toPixmap();
+    virtual void transform(TTransform aTransform);
+    virtual TImageType type();
+    virtual bool hasAlphaChannel();
+    
+private:
+    QImage   mImage;
+    };
+
+} // namespace GFX
+} // namespace Java
+
+#endif /* IMAGEIMPL_H_ */
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageloaderimpl.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageloaderimpl.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -16,8 +16,8 @@
 
 namespace Java { namespace GFX {
 
-ImageloaderImpl::ImageloaderImpl()
-: mBufferData(new bufferData), loadSizeWidth(-1), loadSizeHeight(-1)
+ImageloaderImpl::ImageloaderImpl(TImageType aType)
+: mBufferData(new bufferData), loadSizeWidth(-1), loadSizeHeight(-1), mResultImageType(aType)
 {
     GFX_LOG_FUNC_CALL();
     mBufferData->buffer = NULL;
@@ -100,7 +100,7 @@
         throwError(imgReader);
     }
     
-    Image* img = GraphicsFactory::createImage(image);
+    Image* img = GraphicsFactory::createImage(image, mResultImageType);
 
     // cleanup, release buffer
     resetData();
@@ -131,7 +131,7 @@
         throwError(imgReader);
     }
 
-    return GraphicsFactory::createImage(image);
+    return GraphicsFactory::createImage(image, mResultImageType);
 }
 
 void ImageloaderImpl::setLoadSize(int aWidth, int aHeight)
@@ -140,6 +140,13 @@
     loadSizeHeight = aHeight;
 }
 
+void ImageloaderImpl::setResultImageType(TImageType aType)
+    {
+    Q_ASSERT((aType == EImage) || (aType == EPixmap));
+    mResultImageType = aType;
+    }
+
+
 // Private
 void ImageloaderImpl::growBuffer(const int aNewSize)
 {
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageloaderimpl.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/imageloaderimpl.h	Fri Oct 15 12:29:39 2010 +0300
@@ -24,7 +24,7 @@
     /**
      * Ctor
      */
-    ImageloaderImpl();
+    ImageloaderImpl(TImageType aType);
 
     /**
      * Dtor
@@ -41,6 +41,7 @@
     virtual void dispose();
     virtual Image* load(const QString& aFileName);
     virtual void setLoadSize(int aWidth, int aHeight);
+    virtual void setResultImageType(TImageType aType);
 
 private:
     /**
@@ -89,6 +90,7 @@
     bufferData* mBufferData;
     int loadSizeWidth;
     int loadSizeHeight;
+    TImageType mResultImageType;
 };
 
 } // namespace GFX
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/pixmap.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/pixmap.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -14,18 +14,18 @@
 
 namespace Java { namespace GFX {
 
-Pixmap::Pixmap() : mAlpha(-1), mHasMask(false)
-{
+Pixmap::Pixmap() : ImageBase()
+    {
     GFX_LOG_FUNC_CALL();
-}
+    }
 
 Pixmap::~Pixmap()
-{
+    {
     GFX_LOG_FUNC_CALL();
-}
+    }
 
 void Pixmap::createBySize(int aWidth, int aHeight, int aFillColor, TImageFormat /*aFormat*/)
-{
+    {
     GFX_LOG_FUNC_CALL();
     Q_ASSERT(mPixmap.isNull());
 
@@ -34,19 +34,19 @@
 
     // Check if creation was successful
     if(mPixmap.isNull())
-    {
+        {
         throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
-    }
+        }
 
     // Finally fill with given fillColor, also clears the image mem area
     // otherwise there might be some random coloured pixels in image
     QColor color;
     color.setRgb(aFillColor);
     mPixmap.fill(color);
-}
+    }
 
 void Pixmap::createFromQImage(const QImage& aImage)
-{
+    {
     GFX_LOG_FUNC_CALL();
     Q_ASSERT(mPixmap.isNull());
 
@@ -55,13 +55,13 @@
 
     // Validate allocation
     if(mPixmap.isNull())
-    {
+        {
         throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
+        }
     }
-}
 
 void Pixmap::createFromQPixmap(const QPixmap& aPixmap)
-{
+    {
     GFX_LOG_FUNC_CALL();
     Q_ASSERT(mPixmap.isNull());
 
@@ -69,150 +69,63 @@
 
     // Validate allocation
     if(mPixmap.isNull())
-    {
+        {
         throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
-    }
-}
-
-void Pixmap::createFromImage(Image* aImage, int aX, int aY, int aWidth, int aHeight)
-{
-    GFX_LOG_FUNC_CALL();
-    Q_ASSERT(mPixmap.isNull());
-
-    // Get QPixmap from original
-    QPixmap* src = aImage->getPixmap();
-    if(!src)
-    {
-        throw GfxException(EGfxErrorNoMemory, "Image (pixmap) creation failed");
+        }
     }
 
-    // If specific values were given and they represent the whole pixmap exactly
-    bool isWholePixmap = (src->size() == QSize(aWidth, aHeight)) && (aX == aY == 0);
-
-    // Also an empty area means that the whole pixmap needs to be copied
-    bool isEmptyArea = QRect(aX, aY, aWidth, aHeight).isEmpty();
-
-    if( isWholePixmap || isEmptyArea )
-    {
-        // Assign to our copy using implicit sharing
-        mPixmap = *src;
-    }
-    else
+void Pixmap::createFromImage(Image* aImage, int aX, int aY, int aWidth, int aHeight)
     {
-        // Convert to QImage, copy the pixel data area, convert back to QPixmap
-        mPixmap = src->copy(aX, aY, aWidth, aHeight);
-    }
-
-    if(mPixmap.isNull())
-    {
-        throw GfxException(EGfxErrorNoMemory, "Image (pixmap) creation failed");
-    }
-}
-
-void Pixmap::createFromImageData(ImageDataWrapper* aData)
-{
     GFX_LOG_FUNC_CALL();
     Q_ASSERT(mPixmap.isNull());
 
-    if(aData->getDepth() != 32)
-    {
-        // Java side always converts the ImageData to 32 bit before passing it
-        // to native side, bail out if we get something else
-        throw GfxException(EGfxErrorNoMemory, "Only 32 bit ImageData is supported in Image creation");
-    }
-
-    int bpp = 4; // bit depth = 32, 4 bytes per pixel
-    int size = aData->getWidth()*aData->getHeight()*bpp;
-    char* pixelData = aData->getData(ImageDataWrapper::EPixelData);
-
-    for(int index = 0; index < size; index += bpp)
-    {
-        int pixel = *(reinterpret_cast<int*>(pixelData+index));
-
-        pixelData[index]   = (uchar)(pixel >> 24) & 0xFF;
-        pixelData[index+1] = (uchar)(pixel >> 16) & 0xFF;
-        pixelData[index+2] = (uchar)(pixel >> 8) & 0xFF;
-        pixelData[index+3] = 0xFF; // Set alpha to opaque here, alpha channel data will be handled later
-    }
-
-    QImage image(reinterpret_cast<uchar*>(aData->getData(ImageDataWrapper::EPixelData)),
-                                          aData->getWidth(),
-                                          aData->getHeight(),
-                                          aData->getBytesPerLine(),
-                                          QImage::Format_ARGB32);
-    if(image.isNull())
-  {
-    throw GfxException(EGfxErrorNoMemory, "QImage (Pixmap) creation failed");
-    }
-
-    // Set indexed palette (if one is set)
-    if(!aData->isDirect())
-    {
-        image.setColorTable(*aData->getPaletteData()->getIndexedPalette());
+    // Check if the copy should be exactly same as the original
+    if((aImage->getWidth() == aWidth) && (aImage->getHeight() == aHeight) || 
+        QRect(aX, aY, aWidth, aHeight).isEmpty())
+        {
+        mPixmap = aImage->toPixmap();
+        }
+    // it's needed to make partial copy of the original
+    else
+        {
+        switch(aImage->type())
+            {
+            case EImage:
+                {
+                mPixmap = QPixmap::fromImage(aImage->getConstImage()->copy(aX, aY, aWidth, aHeight));
+                break;
+                }
+            case EPixmap:
+                {
+                mPixmap = aImage->getConstPixmap()->copy(aX, aY, aWidth, aHeight);
+                break;
+                }
+            default:
+                throw GfxException(EGfxErrorIllegalArgument, "Unsupported source image type");
+            }
+        
+        }
+    if(mPixmap.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (pixmap) creation failed");
+        }
     }
 
-    mHasMask = false;
-    mAlpha = aData->getAlpha();
-
-    if(aData->getData(ImageDataWrapper::EMaskData))
+void Pixmap::createFromImageData(ImageDataWrapper* aData)
     {
-        QImage mask(reinterpret_cast<uchar*>(aData->getData(ImageDataWrapper::EMaskData)),
-                                             aData->getWidth(),
-                                             aData->getHeight(),
-                                             QImage::Format_Mono);
-        if(mask.isNull())
-      {
-        throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) alpha channel creation failed");
-        }
-        image.setAlphaChannel(mask);
-        mHasMask = true;
-    }
-    else if(mAlpha != -1)
-    {
-        // Global alpha is set, overrides alpha channel data
-        QImage alpha(aData->getWidth(), aData->getHeight(), QImage::Format_Indexed8);
-        if(alpha.isNull())
-      {
-        throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) alpha channel creation failed");
-        }
+    GFX_LOG_FUNC_CALL();
+    Q_ASSERT(mPixmap.isNull());
 
-        alpha.fill(aData->getAlpha());
-        image.setAlphaChannel(alpha);
-    }
-    else if(aData->getData(ImageDataWrapper::EAlphaData))
-    {
-        // Alpha channel data is set
-        const int w = aData->getWidth();
-        QImage alpha(reinterpret_cast<uchar*>(aData->getData(ImageDataWrapper::EAlphaData)),
-                                              w,
-                                              aData->getHeight(),
-                                              w,
-                                              QImage::Format_Indexed8);
-        QVector<QRgb> colors(255);
-        for(int i=0; i<255; i++)
-            {
-            colors[i] = qRgb(i, i, i);
-            }
-        alpha.setColorTable(colors);
-        colors.clear();
+    mPixmap = QPixmap::fromImage(imageDataToQImage(aData));
 
-        if(alpha.isNull())
-      {
-        throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) alpha channel creation failed");
+    if(mPixmap.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
         }
-        image.setAlphaChannel(alpha);
     }
 
-    mPixmap = QPixmap::fromImage(image);
-
-    if(mPixmap.isNull())
+void Pixmap::createFromRGB(int* aRgbdata, int aWidth, int aHeight, bool aHasAlpha)
     {
-        throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
-    }
-}
-
-void Pixmap::createFromRGB(int* aRgbdata, int aWidth, int aHeight, bool aHasAlpha)
-{
     GFX_LOG_FUNC_CALL();
     Q_ASSERT(mPixmap.isNull());
 
@@ -222,96 +135,82 @@
 
     // Validate creation
     if(tmpImage.isNull())
-    {
+        {
         throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
-    }
+        }
 
     // Store as QPixmap
     mPixmap = QPixmap::fromImage(tmpImage);
 
     // Validate conversion
     if(mPixmap.isNull())
-    {
+        {
         throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
+        }
     }
-}
 
 void Pixmap::dispose()
-{
+    {
     GFX_LOG_FUNC_CALL();
     delete this;
-}
+    }
 
 QPaintDevice* Pixmap::getBindable()
-{
+    {
     GFX_LOG_FUNC_CALL();
     return static_cast<QPaintDevice*>(&mPixmap);
-}
+    }
 
-int Pixmap::getFormat()
-{
+TImageFormat Pixmap::getFormat()
+    {
     GFX_LOG_FUNC_CALL();
     QImage img = mPixmap.toImage();
     // Validate conversion
-    if(img.isNull()) {
+    if(img.isNull()) 
+        {
         throw GfxException(EGfxErrorNoMemory, "Convertion from QPixmap to QImage failed");
+        }
+    return mapQtFormatToInternal(img.format());
     }
-    int imgFormat = img.format();
-
-    switch (imgFormat) {
-        case QImage::Format_ARGB32:
-            return EFormatARGB32;
-        case QImage::Format_RGB32:
-            return EFormatRGB32;
-        case QImage::Format_ARGB32_Premultiplied:
-            return EFormatARGB32Premultiplied;
-         case QImage::Format_RGB16:
-            return EFormatRGB16;
-         case QImage::Format_RGB555:
-            return EFormatRGB555;
-         case QImage::Format_RGB444:
-            return EFormatRGB444;
-         case QImage::Format_ARGB4444_Premultiplied:
-            return EFormatARGB4444Premultiplied;
-         case QImage::Format_Mono:
-            return EFormatMONO;
-         default:
-            return EFormatNone;
-    }
-}
 
 int Pixmap::getHeight()
-{
+    {
     GFX_LOG_FUNC_CALL();
     return mPixmap.height();
-}
+    }
+
+const QImage* Pixmap::getConstImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return NULL;
+    }
+
+QImage* Pixmap::getImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return NULL;
+    }
+
+const QPixmap* Pixmap::getConstPixmap()
+    {
+    GFX_LOG_FUNC_CALL();
+    return &mPixmap;
+    }
 
 QPixmap* Pixmap::getPixmap()
-{
+    {
     GFX_LOG_FUNC_CALL();
     return &mPixmap;
-}
+    }
 
 int Pixmap::getWidth()
-{
+    {
     GFX_LOG_FUNC_CALL();
     return mPixmap.width();
-}
-
-int Pixmap::getAlpha()
-{
-    GFX_LOG_FUNC_CALL();
-    return mAlpha;
-}
-
-bool Pixmap::hasMask()
-{
-    GFX_LOG_FUNC_CALL();
-    return mHasMask;
-}
+    }
 
 void Pixmap::getRgb(int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight)
-{
+    {
     GFX_LOG_FUNC_CALL();
 
     // Convert to QImage in order to access pixels
@@ -322,61 +221,11 @@
         {
         throw GfxException(EGfxErrorNoMemory, "Convertion from QPixmap to QImage failed");
         }
-
-    if(aX != 0 || aY != 0 || aWidth < image.width() || aHeight < image.height())
-        {
-        image = image.copy(aX, aY, aWidth, aHeight);
-        if(image.isNull())
-            {
-            throw GfxException(EGfxErrorNoMemory, "copying from original image failed");
-            }
-        }
+    doGetRgb(image, aRgbdata, aOffset, aScanlength, aX, aY, aWidth, aHeight);
+    }
 
 
-    // If image is not 32bpp we need to convert it
-    if(image.format() != QImage::Format_RGB32 &&
-       image.format() != QImage::Format_ARGB32)
-        {
-        image = image.convertToFormat(QImage::Format_ARGB32);
-        if(image.isNull())
-            {
-            throw GfxException(EGfxErrorNoMemory, "format convertion to 32bpp failed");
-            }
-        }
-
-    // Temporary storage for pixels
-    QRgb* pixel = NULL;
-
-    // dataArray index, start from offset
-    int targetIndex = aOffset;
-
-    // Iterate through lines
-    for(int b = 0; b < aHeight; ++b)
-    {
-        // Obtain pointer to start of current line (y)
-        const unsigned char* lineStart = image.scanLine(b);
-
-        // Iterate through pixels on each line
-        for (int a = 0; a < aWidth; ++a)
-        {
-            // Set the current pixel, relative to line start
-            pixel = ((QRgb*)lineStart) + a;
-
-            // Move target pointer to the next slot
-            targetIndex = aOffset + a + (b * aScanlength);
-            // Shift pixels to correct places, needed for 32-bit format
-            // as the bits order in memory may vary between systems
-            aRgbdata[targetIndex] =  ((qAlpha(*pixel) & 0xff) << 24) |
-                                     ((qRed(*pixel)   & 0xff) << 16) |
-                                     ((qGreen(*pixel) & 0xff) << 8 ) |
-                                     ((qBlue(*pixel)  & 0xff));
-        }
-    }
-
-}
-
-
-void Pixmap::getRgb(char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int /*aFormat*/) {
+void Pixmap::getRgb(char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat) {
 
     GFX_LOG_FUNC_CALL();
 
@@ -384,229 +233,67 @@
     QImage image = mPixmap.toImage();
 
     // Validate conversion
-    if(image.isNull()) {
-        throw GfxException(EGfxErrorNoMemory, "Conversion from QPixmap to QImage failed");
-    }
-
-     if(aX != 0 || aY != 0 || aWidth < image.width() || aHeight < image.height())
-        {
-        image = image.copy(aX, aY, aWidth, aHeight);
-        if(image.isNull())
-            {
-            throw GfxException(EGfxErrorNoMemory, "copying from original image failed");
-            }
-        }
-
-    if(aScanlength < 0)
+    if(image.isNull()) 
         {
-         image = image.mirrored(false, true);
-         if(image.isNull())
-             {
-             throw GfxException(EGfxErrorNoMemory, "Mirroring failed");
-             }
+        throw GfxException(EGfxErrorNoMemory, "Conversion from QPixmap to QImage failed");
         }
-
-    // If image is not monochrome we need to convert it
-    if(image.format() != QImage::Format_Mono)
-    {
-        image = image.convertToFormat(QImage::Format_Mono);
-        if(image.isNull())
-        {
-            throw GfxException(EGfxErrorNoMemory, "Format conversion to 8bpp failed");
-        }
+    doGetRgb(image, aRgbdata, aTransparencyMask, aOffset, aScanlength, aX, aY, aWidth, aHeight, aFormat);
     }
 
-    // dataArray index, start from offset
-    int targetIndex = aOffset;
-
-    const unsigned char* imageStart = image.bits();
-    QImage mask = image.alphaChannel();
-    const unsigned char* maskStart = mask.bits();
-
-    // Find the number of full bytes
-    int fullBytes = aWidth/8;
-    int bpl = image.bytesPerLine();
-
-    if(bpl == fullBytes)
+void Pixmap::getRgb(short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat) 
     {
-        memcpy(aRgbdata+targetIndex, imageStart, bpl*aHeight);
-        memcpy(aTransparencyMask+targetIndex, maskStart, bpl*aHeight);
-    }
-    else
-    {
-        memcpy(aRgbdata+targetIndex, imageStart, fullBytes*aHeight + aHeight);
-        memcpy(aTransparencyMask+targetIndex, maskStart, fullBytes*aHeight + aHeight);
-    }
-
-}
-
-void Pixmap::getRgb(short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat) {
     GFX_LOG_FUNC_CALL();
 
-    // Match format to QT
-    int format;
-    switch (aFormat) {
-        case EFormatRGB555:
-            format = QImage::Format_RGB555;
-            break;
-        case EFormatRGB16:
-            format = QImage::Format_RGB16;
-            break;
-         case EFormatRGB444:
-            format = QImage::Format_RGB444;
-            break;
-         case EFormatARGB4444Premultiplied:
-            format = QImage::Format_ARGB4444_Premultiplied;
-            break;
-         default:
-            format = QImage::Format_RGB16;
-    }
     // Convert to QImage in order to access pixels
     QImage image = mPixmap.toImage();
 
     // Validate conversion
     if(image.isNull())
+        {
+        throw GfxException(EGfxErrorNoMemory, "Conversion from QPixmap to QImage failed");
+        }
+    doGetRgb(image, aRgbdata, aOffset, aScanlength, aX, aY, aWidth, aHeight, aFormat);
+    }
+
+const QImage Pixmap::toConstImage()
     {
-        throw GfxException(EGfxErrorNoMemory, "Conversion from QPixmap to QImage failed");
+    GFX_LOG_FUNC_CALL();
+    return mPixmap.toImage();
     }
 
-    if(aX != 0 || aY != 0 || aWidth < image.width() || aHeight < image.height())
-        {
-        image = image.copy(aX, aY, aWidth, aHeight);
-        if(image.isNull())
-            {
-            throw GfxException(EGfxErrorNoMemory, "copying from original image failed");
-            }
-        }
+QImage Pixmap::toImage()
+    {
+    GFX_LOG_FUNC_CALL();
+    return mPixmap.toImage();
+    }
 
-
-    // If image is not format we need, convert it
-    if(image.format() != format)
+QPixmap Pixmap::toPixmap()
     {
-        image = image.convertToFormat((QImage::Format)format);
-        if(image.isNull())
+    GFX_LOG_FUNC_CALL();
+    return QPixmap(mPixmap);
+    }
+
+void Pixmap::transform(TTransform aTransform)
+    {
+    GFX_LOG_FUNC_CALL();
+    mPixmap = mPixmap.transformed(generateTransformMatrix(aTransform), Qt::FastTransformation);
+    if(mPixmap.isNull())
         {
-            throw GfxException(EGfxErrorNoMemory, "format convertion to 16bpp failed");
+        throw GfxException(EGfxErrorNoMemory, "Image (Pixmap) creation failed");
         }
     }
 
-    // Temporary storage for pixels
-    short* pixel = NULL;
-    // dataArray index, start from offset
-    int targetIndex = aOffset;
-
-    // Iterate through lines
-    for(int b=0; b < aHeight; b++)
+TImageType Pixmap::type()
     {
-        // Obtain pointer to start of current line (y)
-        const unsigned char* lineStart = image.scanLine(b);
-        // Iterate through pixels on each line
-        for(int a=0; a < aWidth; a++)
-        {
-            // Set the current pixel, relative to line start
-            pixel = ((short*)lineStart) + a;
-            // Move target pointer to the next slot
-            targetIndex = aOffset + a + (b * aScanlength);
-            aRgbdata[targetIndex] =  *pixel;
-        }
-    }
-}
-
-QImage Pixmap::toImage()
-{
-    return mPixmap.toImage();
-}
-
-void Pixmap::transform(TTransform aTransform)
-{
     GFX_LOG_FUNC_CALL();
-
-    // For rotation along z-axis
-    QTransform imageTransform;
-    bool flip = false;
-    bool rotate = true;
-
-    switch(aTransform) {
-        case ETransNone:
-            // No transform or mirror
-            return;
-        case ETransRot90:
-            imageTransform.rotate(90, Qt::ZAxis);
-            break;
-        case ETransRot180:
-            imageTransform.rotate(180, Qt::ZAxis);
-            break;
-        case ETransRot270:
-            imageTransform.rotate(270, Qt::ZAxis);
-            break;
-        case ETransMirror:
-            flip = true;
-            rotate = false;
-            break;
-        case ETransMirrorRot90:
-            imageTransform.rotate(90, Qt::ZAxis);
-            flip = true;
-            break;
-        case ETransMirrorRot180:
-            imageTransform.rotate(180, Qt::ZAxis);
-            flip = true;
-            break;
-        case ETransMirrorRot270:
-            imageTransform.rotate(270, Qt::ZAxis);
-            flip = true;
-            break;
-        default:
-            Q_ASSERT_X(false, "Graphics", "Transform type not recognized");
-            return;
+    return EPixmap;
     }
 
-    // Mirror image first if requested
-    if(flip)
-    {
-        QTransform flipTransform;
-        flipTransform.rotate(180,Qt::YAxis);
-
-        // Create temp pixmap for flipped
-        QPixmap temp = mPixmap.transformed(flipTransform, Qt::FastTransformation);
-
-        // Validate transformation
-        if(temp.isNull())
-        {
-            throw GfxException(EGfxErrorNoMemory, "temp buffer alloc failed");
-        }
-
-        // Free original pixmap and store new
-        mPixmap = temp;
-    }
-
-    // Then rotate
-    if(rotate)
+bool Pixmap::hasAlphaChannel()
     {
-        // Create temp pixmap for rotate
-        QPixmap temp = mPixmap.transformed(imageTransform, Qt::FastTransformation);
-
-        // Validate alloc
-        if(temp.isNull())
-        {
-            throw GfxException(EGfxErrorNoMemory, "temp buffer alloc failed");
-        }
-
-        // Free original image and store new
-        mPixmap = temp;
-    }
-}
-
-TImageType Pixmap::type()
-{
-    GFX_LOG_FUNC_CALL();
-    return EPixmap;
-}
-
-bool Pixmap::hasAlphaChannel()
-{
     GFX_LOG_FUNC_CALL();
     return mPixmap.hasAlphaChannel();
-}
+    }
 
 } // namespace GFX
 } // namespace Java
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/pixmap.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/qt/pixmap.h	Fri Oct 15 12:29:39 2010 +0300
@@ -12,11 +12,11 @@
 #define PIXMAP_H_
 
 #include <QPixmap>
-#include "graphics.h"
+#include "imagebase.h"
 
 namespace Java { namespace GFX {
 
-class Pixmap: public Image
+class Pixmap: public ImageBase
 {
 public:
     /**
@@ -41,24 +41,26 @@
     virtual void createFromRGB(int* aRgbdata, int aWidth, int aHeight, bool aHasAlpha);
     virtual void dispose();
     virtual QPaintDevice* getBindable();
-    virtual int getFormat();
+    virtual TImageFormat getFormat();
     virtual int getHeight();
+    virtual const QImage* getConstImage();
+    virtual QImage* getImage();
+    virtual const QPixmap* getConstPixmap();
     virtual QPixmap* getPixmap();
     virtual void getRgb(int* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight);
     virtual void getRgb(char* aRgbdata, char* aTransparencyMask,int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat);
     virtual void getRgb(short* aRgbdata, int aOffset, int aScanlength, int aX, int aY, int aWidth, int aHeight, int aFormat);
     virtual int getWidth();
+    virtual const QImage toConstImage();
     virtual QImage toImage();
+    virtual QPixmap toPixmap();
     virtual void transform(TTransform aTransform);
     virtual TImageType type();
-    virtual int getAlpha();
-    virtual bool hasMask();
+
     virtual bool hasAlphaChannel();
 
 private:
     QPixmap  mPixmap;
-    int      mAlpha;
-    bool     mHasMask;
 };
 
 } // namespace GFX
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/jniutils.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/jniutils.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -758,7 +758,7 @@
     return result;
 }
 
-Image* JniUtils::CreateImage(JNIEnv* aEnv, jobject& aImageDataObj)
+Image* JniUtils::CreateImage(JNIEnv* aEnv, jobject& aImageDataObj, jint aType)
 {
     SWT_LOG_FUNC_CALL();
     
@@ -844,7 +844,7 @@
     fid = aEnv->GetFieldID(imageDataClazz, "palette", "Lorg/eclipse/swt/graphics/PaletteData;");
     jobject paletteData = aEnv->GetObjectField(aImageDataObj, fid);
     imageData->setPaletteData(CreatePaletteData(aEnv, paletteData));
-    result = GraphicsFactory::createImage(imageData);
+    result = GraphicsFactory::createImage(imageData, (Java::GFX::TImageType)aType);
 
     delete imageData;
     if (paletteData)
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/jniutils.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/jniutils.h	Fri Oct 15 12:29:39 2010 +0300
@@ -330,9 +330,10 @@
      * Creates a native image object based on the given image data object.
      * @param aEnv JNI environment for the thread
      * @param aJavaImageData Java side image data object
+     * @param aType The native type of the image to be created 
      * @return Native image object
      */
-    Java::GFX::Image* CreateImage(JNIEnv* aEnv, jobject& aJavaImageData);
+    Java::GFX::Image* CreateImage(JNIEnv* aEnv, jobject& aJavaImageData, jint aType);
 
     /**
      * Checks if in terms of event processing the object can be deleted. Used 
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/listdatamodel.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/listdatamodel.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -44,100 +44,100 @@
  *  ListItem
  */
 ListItem::ListItem(const QString& aText)
-	: txt( aText )
-	{
-	SWT_LOG_FUNC_CALL();
-	}
+    : txt( aText )
+    {
+    SWT_LOG_FUNC_CALL();
+    }
 
 ListItem::~ListItem()
-	{
-	SWT_LOG_FUNC_CALL();
-	} 
+    {
+    SWT_LOG_FUNC_CALL();
+    } 
 
 
 const QString& ListItem::text() const
-	{
-	return txt;
-	}
+    {
+    return txt;
+    }
 
 const QPixmap* ListItem::image() const
-	{
-	return NULL;
-	}
+    {
+    return NULL;
+    }
 
 void ListItem::setText( const QString& string )
-	{
-	txt = string;
-	}
+    {
+    txt = string;
+    }
 
 
 Qt::CheckState ListItem::checkState() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return state;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    return state;
+    }
 
 
 void ListItem::setCheckState( Qt::CheckState state )
-	{
-	SWT_LOG_FUNC_CALL();
-	this->state = state;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    this->state = state;
+    }
+    
 /**
  *  ListBoxItem
  */
 
-ListBoxItem::ListBoxItem( const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-	const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount ) 
-	: ListItem(aDetailText), headingTxt(aHeadingText)
-	{
-	SWT_LOG_FUNC_CALL();
-	for (int i = 0; i < aDetailImageCount; i++) 
-	    {
-	    detailImgs.push_back(*aDetailImages[i]);
-	    }
+ListBoxItem::ListBoxItem( const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+    const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount ) 
+    : ListItem(aDetailText), headingTxt(aHeadingText)
+    {
+    SWT_LOG_FUNC_CALL();
+    for (int i = 0; i < aDetailImageCount; i++) 
+        {
+        detailImgs.push_back(aDetailImages[i]);
+        }
     for (int i = 0; i < aHeadingImageCount; i++) 
         {
-        headingImgs.push_back(*aHeadingImages[i]);
+        headingImgs.push_back(aHeadingImages[i]);
         }
-	}
+    }
 
 
 ListBoxItem::~ListBoxItem()
-	{
-	SWT_LOG_FUNC_CALL();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    }
+    
 const QString& ListBoxItem::headingText() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return headingTxt;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return headingTxt;
+    }
+    
 const QList<QPixmap>& ListBoxItem::detailImages() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return detailImgs;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return detailImgs;
+    }
+    
 const QList<QPixmap>& ListBoxItem::headingImages() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return headingImgs;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return headingImgs;
+    }
+    
 int ListBoxItem::detailImageCount() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return detailImgs.count();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return detailImgs.count();
+    }
+    
 int ListBoxItem::headingImageCount() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return headingImgs.count();
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    return headingImgs.count();
+    }
 
 void ListBoxItem::setContentsToNull()
     {
@@ -153,332 +153,332 @@
         headingImgs.pop_back();
         }
     }
-	
+    
 /**
  *  ListModel
  */
 
 ListModel::ListModel( int type, int style, QListView *parent )
-	: QAbstractListModel( parent ),
-	listType( type ),
-	layoutStyle( style )
-	{
-	SWT_LOG_FUNC_CALL();
-	SWT_LOG_DATA_3("listType=%d layoutStyle=%x parent=%x ", style, type, reinterpret_cast<int>(parent) );
-	}
-	
+    : QAbstractListModel( parent ),
+    listType( type ),
+    layoutStyle( style )
+    {
+    SWT_LOG_FUNC_CALL();
+    SWT_LOG_DATA_3("listType=%d layoutStyle=%x parent=%x ", style, type, reinterpret_cast<int>(parent) );
+    }
+    
 ListModel::~ListModel()
-	{
-	SWT_LOG_FUNC_CALL();
-	clearList();
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    clearList();
+    }
 
 ListModel* ListModel::createDataModel( int type, int style, QListView *parent )
-	{
-	if( ( type & LISTTYPE_LISTBOX ) != 0 )
-		{
-		return new ListBoxModel( type, style, parent );
-		}
-	else
-		{
-		return new ListModel( type, style, parent );
-		}	
-	}
+    {
+    if( ( type & LISTTYPE_LISTBOX ) != 0 )
+        {
+        return new ListBoxModel( type, style, parent );
+        }
+    else
+        {
+        return new ListModel( type, style, parent );
+        }   
+    }
 
 
 void ListModel::beginInsertRows( const QModelIndex& parent, int first, int last )
-	{
-	Q_ASSERT( first >= 0 && first <= list.size() );
-	Q_ASSERT( last >= first );
-	SWT_LOG_FUNC_CALL();
-	QAbstractItemModel::beginInsertRows( parent, first, last );		
-	}
-	
-	
+    {
+    Q_ASSERT( first >= 0 && first <= list.size() );
+    Q_ASSERT( last >= first );
+    SWT_LOG_FUNC_CALL();
+    QAbstractItemModel::beginInsertRows( parent, first, last );     
+    }
+    
+    
 void ListModel::endInsertRows()
-	{
-	SWT_LOG_FUNC_CALL();
-	QAbstractItemModel::endInsertRows();
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    QAbstractItemModel::endInsertRows();
+    }
 
 void ListModel::beginRemoveRows( const QModelIndex& parent, int first, int last )
-	{
-	Q_ASSERT( first > -1 && first < list.size() );
-	Q_ASSERT( last >= first && last < list.size() );
-	SWT_LOG_FUNC_CALL();
-	QAbstractItemModel::beginRemoveRows( parent, first, last );		
-	}
-	
+    {
+    Q_ASSERT( first > -1 && first < list.size() );
+    Q_ASSERT( last >= first && last < list.size() );
+    SWT_LOG_FUNC_CALL();
+    QAbstractItemModel::beginRemoveRows( parent, first, last );     
+    }
+    
 void ListModel::endRemoveRows()
-	{
-	SWT_LOG_FUNC_CALL();
-	QAbstractItemModel::endRemoveRows();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    QAbstractItemModel::endRemoveRows();
+    }
+    
 
 void ListModel::emitLayoutAboutToBeChanged()
-	{
-	SWT_LOG_FUNC_CALL();
-	emit layoutAboutToBeChanged();
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    emit layoutAboutToBeChanged();
+    }
 
 void ListModel::emitLayoutChanged()
-	{
-	SWT_LOG_FUNC_CALL();
-	emit layoutChanged();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    emit layoutChanged();
+    }
+    
 Qt::ItemFlags ListModel::flags( const QModelIndex& index ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Qt::ItemFlags  flags = ( QAbstractItemModel::flags(index) | Qt::ItemIsEnabled | Qt::ItemIsSelectable ) & ~Qt::ItemIsUserCheckable;
-	if( ( layoutStyle & LISTBASE_SHOW_CHECKBOX ) != 0 )
-		{
-		flags |= Qt::ItemIsUserCheckable;
-		}
-	return flags;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Qt::ItemFlags  flags = ( QAbstractItemModel::flags(index) | Qt::ItemIsEnabled | Qt::ItemIsSelectable ) & ~Qt::ItemIsUserCheckable;
+    if( ( layoutStyle & LISTBASE_SHOW_CHECKBOX ) != 0 )
+        {
+        flags |= Qt::ItemIsUserCheckable;
+        }
+    return flags;
+    }
+    
 int ListModel::rowCount(const QModelIndex& /*parent*/ ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	return list.count();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return list.count();
+    }
+    
 QVariant ListModel::data(const QModelIndex &index, int role) const
-	{
-	SWT_LOG_FUNC_CALL();
-	if(!index.isValid()) 
-		{
-		SWT_LOG_DATA_1("invalid index %d", -1);
-		return QVariant();
-		}
-	Q_ASSERT( index.row() > -1  && index.row() < list.size() );
-	
-	if ( role == Qt::DisplayRole )
-		{ 
-		SWT_LOG_DATA_2("Request data on DisplayRole: row=%d col=%d", index.row(), index.column());
-		return	list[index.row()]->text();
-		}
-	else if ( role == Qt::DecorationRole )
-		{ 
-		SWT_LOG_DATA_2("Request data on DecorationRole: row=%d col=%d", index.row(), index.column());
-		const QPixmap* img = list[index.row()]->image();
-		if( img )
-			{
-			return *img;
-			}
-		}
-	else if( role == Qt::CheckStateRole && index.column()==0 ) 
-		{
-		SWT_LOG_DATA_2("Request checkState: row=%d col=%d", index.row(), index.column());
-		return list[index.row()]->checkState();
-		}
-		
-	SWT_LOG_DATA_2("Request something else: row=%d col=%d", index.row(), index.column());
-	return QVariant();
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    if(!index.isValid()) 
+        {
+        SWT_LOG_DATA_1("invalid index %d", -1);
+        return QVariant();
+        }
+    Q_ASSERT( index.row() > -1  && index.row() < list.size() );
+    
+    if ( role == Qt::DisplayRole )
+        { 
+        SWT_LOG_DATA_2("Request data on DisplayRole: row=%d col=%d", index.row(), index.column());
+        return  list[index.row()]->text();
+        }
+    else if ( role == Qt::DecorationRole )
+        { 
+        SWT_LOG_DATA_2("Request data on DecorationRole: row=%d col=%d", index.row(), index.column());
+        const QPixmap* img = list[index.row()]->image();
+        if( img )
+            {
+            return *img;
+            }
+        }
+    else if( role == Qt::CheckStateRole && index.column()==0 ) 
+        {
+        SWT_LOG_DATA_2("Request checkState: row=%d col=%d", index.row(), index.column());
+        return list[index.row()]->checkState();
+        }
+        
+    SWT_LOG_DATA_2("Request something else: row=%d col=%d", index.row(), index.column());
+    return QVariant();
+    }
 
 void ListModel::setCheckState( const QItemSelection& selection, Qt::CheckState state )
-	{
-	SWT_LOG_FUNC_CALL();
-	const QModelIndexList indexes = selection.indexes ();
-	for( int i=0; i< indexes.size(); i++)
-		{
-		list.at(indexes.at(i).row())->setCheckState( state );
-		}
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    const QModelIndexList indexes = selection.indexes ();
+    for( int i=0; i< indexes.size(); i++)
+        {
+        list.at(indexes.at(i).row())->setCheckState( state );
+        }
+    }
 
 const QString& ListModel::itemString( const int row ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return list.at(row)->text();	
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return list.at(row)->text();    
+    }
 
 
 jobjectArray ListModel::itemStrings( JNIEnv* aJniEnv )
-	{
-	SWT_LOG_FUNC_CALL();
-	
-	const int count = list.size();
-   	jclass stringClass = aJniEnv->FindClass( "java/lang/String" );
+    {
+    SWT_LOG_FUNC_CALL();
+    
+    const int count = list.size();
+    jclass stringClass = aJniEnv->FindClass( "java/lang/String" );
     jobjectArray result = aJniEnv->NewObjectArray(count, stringClass, NULL);
     if( !result )
         {
         throw std::bad_alloc();
         }
     
- 	jstring javaString;
+    jstring javaString;
     for ( int i=0; i<count; ++i ) 
-	    {
-		javaString = swtApp->jniUtils().QStringToJavaString(aJniEnv, list.at(i)->text() );
-	    aJniEnv->SetObjectArrayElement( result, i, javaString ); 
-	    aJniEnv->DeleteLocalRef( javaString );
-	    }
-	aJniEnv->DeleteLocalRef( stringClass );
+        {
+        javaString = swtApp->jniUtils().QStringToJavaString(aJniEnv, list.at(i)->text() );
+        aJniEnv->SetObjectArrayElement( result, i, javaString ); 
+        aJniEnv->DeleteLocalRef( javaString );
+        }
+    aJniEnv->DeleteLocalRef( stringClass );
         
     return result;
-	}
+    }
 
 int ListModel::indexOf(const QString& string, const int start ) const
-	{
-	SWT_LOG_FUNC_CALL();
- 	Q_ASSERT(start > -1 && start < list.size());
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(start > -1 && start < list.size());
     QStringMatcher matcher(string, Qt::CaseSensitive);
     for (int i = start; i < list.size(); ++i) 
-    	{
+        {
         const QString & str = list.at(i)->text();
         if (string.length() == str.length() && matcher.indexIn(str) == 0)
             return i;
-    	}
+        }
     return -1;
-	}
+    }
 
 int ListModel::itemHeight()
-	{
-	SWT_LOG_FUNC_CALL();
-	const QListView* listView = static_cast<const QListView*>( static_cast<QObject*>(this)->parent() );
+    {
+    SWT_LOG_FUNC_CALL();
+    const QListView* listView = static_cast<const QListView*>( static_cast<QObject*>(this)->parent() );
 
-	if(list.size() > 0 ) 
-		{
-		return listView->sizeHintForRow(0);
-		}
-		
-	return listView->fontMetrics().height();
-	}
+    if(list.size() > 0 ) 
+        {
+        return listView->sizeHintForRow(0);
+        }
+        
+    return listView->fontMetrics().height();
+    }
 
 int ListModel::insertPosition(const QString& string, bool ascent )
-	{
-	SWT_LOG_FUNC_CALL();
-	if( listType != LISTTYPE_SORTEDLIST )
-		{
-		throw std::bad_exception();
-		}
-		
-	int pos = 0;	
-	for(int i = list.size() -1; i > -1; i--)
-		{
-		if( ascent )
-			{
-			if( string < list.at(i)->text() )
-			continue;
-			}
-		else
-			{
-			if( string > list.at(i)->text() )
-			continue;
-			}	
-		pos = i + 1;
-		break;
-		}
-	return pos;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    if( listType != LISTTYPE_SORTEDLIST )
+        {
+        throw std::bad_exception();
+        }
+        
+    int pos = 0;    
+    for(int i = list.size() -1; i > -1; i--)
+        {
+        if( ascent )
+            {
+            if( string < list.at(i)->text() )
+            continue;
+            }
+        else
+            {
+            if( string > list.at(i)->text() )
+            continue;
+            }   
+        pos = i + 1;
+        break;
+        }
+    return pos;
+    }
 
 
 void ListModel::remove( const int row )
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	ListItem* item = list.takeAt(row);
-	delete item;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    ListItem* item = list.takeAt(row);
+    delete item;
+    }
 
 
 void ListModel::clearList()
-	{
-	SWT_LOG_FUNC_CALL();
-	qDeleteAll(list.begin(), list.end());
-	list.clear();
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    qDeleteAll(list.begin(), list.end());
+    list.clear();
+    }
 
 
 void ListModel::appendItem( const QString& string )
-	{
-	SWT_LOG_FUNC_CALL();
-	ListItem* item = createItem( string );
-	list.append(item);
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    ListItem* item = createItem( string );
+    list.append(item);
+    }
+    
 void ListModel::appendItem(const QString& string, const QPixmap* pixmap )
-	{
-	SWT_LOG_FUNC_CALL();
-	ListItem* item = createItem( string, pixmap );
-	list.append(item);
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    ListItem* item = createItem( string, pixmap );
+    list.append(item);
+    }
 
-	
-void ListModel::appendItem(const QString& /*aDetailText*/, const QPixmap** /*aDetailImages*/, const int /*aDetailImageCount*/,  
-	const QString& /*aHeadingText*/, const QPixmap** /*aHeadingImages*/, const int /*aHeadingImageCount*/ )
-	{
-	Q_ASSERT( false );	
-	}
+    
+void ListModel::appendItem(const QString& /*aDetailText*/, const QPixmap* /*aDetailImages*/, const int /*aDetailImageCount*/,  
+    const QString& /*aHeadingText*/, const QPixmap* /*aHeadingImages*/, const int /*aHeadingImageCount*/ )
+    {
+    Q_ASSERT( false );  
+    }
 
 void ListModel::insertItem( const int row, const QString& string )
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row <= list.size());
-	ListItem* item = createItem( string );
-	if( row == list.size() )
-		{
-		list.append(item);
-		}
-	else
-		{
-		list.insert( row, item );
-		}
-	} 
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row <= list.size());
+    ListItem* item = createItem( string );
+    if( row == list.size() )
+        {
+        list.append(item);
+        }
+    else
+        {
+        list.insert( row, item );
+        }
+    } 
 
 void ListModel::insertItem( const int row, const QString& string, const QPixmap* pixmap )
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row <= list.size());
-	ListItem* item = createItem( string, pixmap );
-	if( row == list.size() )
-		{
-		list.append(item);
-		}
-	else
-		{
-		list.insert( row, item );
-		}
-	} 
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row <= list.size());
+    ListItem* item = createItem( string, pixmap );
+    if( row == list.size() )
+        {
+        list.append(item);
+        }
+    else
+        {
+        list.insert( row, item );
+        }
+    } 
 
 
 int ListModel::style() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return layoutStyle;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return layoutStyle;
+    }
+    
 
-	
+    
 ListItem* ListModel::createItem( const QString& string )
-	{
-	SWT_LOG_FUNC_CALL();
-	ListItem* item =  new ListItem(string);
-	if( !item )
-		{	
-       	throw std::bad_alloc();
-		}
-	return item;	
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    ListItem* item =  new ListItem(string);
+    if( !item )
+        {   
+        throw std::bad_alloc();
+        }
+    return item;    
+    }
 
 
 ListItem* ListModel::createItem( const QString& /*string*/, const QPixmap* /*pixmap*/ )
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT( false );	
-	return NULL;
-	}
-	
-ListItem* ListModel::createItem(const QString& /*aDetailText*/, const QPixmap** /*aDetailImages*/, const int /*aDetailImageCount*/,  
-	const QString& /*aHeadingText*/, const QPixmap** /*aHeadingImages*/, const int /*aHeadingImageCount*/ )
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT( false );	
-	return NULL;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT( false );  
+    return NULL;
+    }
+    
+ListItem* ListModel::createItem(const QString& /*aDetailText*/, const QPixmap* /*aDetailImages*/, const int /*aDetailImageCount*/,  
+    const QString& /*aHeadingText*/, const QPixmap* /*aHeadingImages*/, const int /*aHeadingImageCount*/ )
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT( false );  
+    return NULL;
+    }
 
 void ListModel::setItemContentsToNull( const int /*row*/ )
     {
@@ -489,333 +489,333 @@
 // ListBoxModel
 
 ListBoxModel::ListBoxModel( int type, int style, QListView *parent )
-	: ListModel(type, style, parent ),
-	detailTxtIndex(-1),
-	headingTxtIndex(-1),
-	detailTxtSize(QPoint(0, 0)),
-	headingTxtSize(QPoint(0, 0)),
-	detailImgCount(0),
-	headingImgCount(0),
-	imgHeight(0),
-	detailImgWidths(NULL),
-	headingImgWidths(NULL),
-	rowHeights(NULL),
-	detailImgWidth(0),
-	headingImgWidth(0)
-	{
-	SWT_LOG_FUNC_CALL();
-	}
-	
+    : ListModel(type, style, parent ),
+    detailTxtIndex(-1),
+    headingTxtIndex(-1),
+    detailTxtSize(QPoint(0, 0)),
+    headingTxtSize(QPoint(0, 0)),
+    detailImgCount(0),
+    headingImgCount(0),
+    imgHeight(0),
+    detailImgWidths(NULL),
+    headingImgWidths(NULL),
+    rowHeights(NULL),
+    detailImgWidth(0),
+    headingImgWidth(0)
+    {
+    SWT_LOG_FUNC_CALL();
+    }
+    
 ListBoxModel::~ListBoxModel()
-	{
-	SWT_LOG_FUNC_CALL();
+    {
+    SWT_LOG_FUNC_CALL();
 
-	delete detailImgWidths;
-	delete headingImgWidths;
-	delete rowHeights;
-	}
+    delete detailImgWidths;
+    delete headingImgWidths;
+    delete rowHeights;
+    }
 
-	
+    
 void ListBoxModel::clearList()
-	{
-	SWT_LOG_FUNC_CALL();
-	ListModel::clearList();
-	detailTxtIndex = -1;
-	headingTxtIndex = -1;
-	detailTxtSize = QPoint(0, 0);
-	headingTxtSize = QPoint(0, 0);
-	detailImgCount = 0;
-	headingImgCount = 0;
-	imgHeight = 0;
-	delete detailImgWidths;
-	detailImgWidths = NULL;
-	delete headingImgWidths;
-	headingImgWidths = NULL;
-	delete rowHeights;
-	rowHeights = NULL;
-	detailImgWidth = 0;
-	headingImgWidth = 0;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    ListModel::clearList();
+    detailTxtIndex = -1;
+    headingTxtIndex = -1;
+    detailTxtSize = QPoint(0, 0);
+    headingTxtSize = QPoint(0, 0);
+    detailImgCount = 0;
+    headingImgCount = 0;
+    imgHeight = 0;
+    delete detailImgWidths;
+    detailImgWidths = NULL;
+    delete headingImgWidths;
+    headingImgWidths = NULL;
+    delete rowHeights;
+    rowHeights = NULL;
+    detailImgWidth = 0;
+    headingImgWidth = 0;
+    }
 
-void ListBoxModel::appendItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-	const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount )
-	{
-	SWT_LOG_FUNC_CALL();
-	ListItem* item = createItem( aDetailText, aDetailImages,  aDetailImageCount,  
-		aHeadingText, aHeadingImages, aHeadingImageCount );
-	list.append(item);
+void ListBoxModel::appendItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+    const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount )
+    {
+    SWT_LOG_FUNC_CALL();
+    ListItem* item = createItem( aDetailText, aDetailImages,  aDetailImageCount,  
+        aHeadingText, aHeadingImages, aHeadingImageCount );
+    list.append(item);
 
-	// remember the index of the item, which has the longest detail text
-	const QListView* listView = static_cast<const QListView*>( static_cast<QObject*>(this)->parent() );
-	if(!aDetailText.isNull())
-		{
-		int textWidth = listView->fontMetrics().boundingRect(aDetailText).width();	
-		if( detailTxtSize.x() < textWidth )
-			{
-			detailTxtSize.rx() = textWidth;
-			detailTxtIndex = list.size() - 1;
-			}
-		}
-	
-	// remember the index of the item, which has the longest heading text
-	if( (layoutStyle | LB_STYLE_1LINE_ITEM) != 0 || (layoutStyle | LB_STYLE_2LINE_ITEM) != 0 )
-		{
-		if(!aHeadingText.isNull())
-			{
-			int textWidth = listView->fontMetrics().boundingRect(aHeadingText).width();	
-			if( headingTxtSize.x() < textWidth )
-				{
-				headingTxtSize.rx() = textWidth;
-				headingTxtIndex = list.size() - 1;
-				}
-			}
-		}
-	
-	// remember the maximum detail image count
-	// and remember the maximum widths for every columns of detail images
-	if( (layoutStyle | LB_MOD_SHOW_DETAIL_ICONS) != 0 )	
-		{
-		if( detailImgCount < aDetailImageCount )
-			{
-			int* alloc =  new int[aDetailImageCount];
-			memset(alloc, '\0', sizeof(int)*aDetailImageCount);
-			if( !alloc )
-				{	
-		       	throw std::bad_alloc();
-				}
-			for(int i = 0; i < detailImgCount; i++)
-				{
-				alloc[i] =  detailImgWidths[i];
-				}
-			delete 	detailImgWidths;
-			detailImgWidths = alloc;
-			detailImgCount = aDetailImageCount;
-			}	
-		for(int i = 0; i < aDetailImageCount; i++)
-			{
-			if( aDetailImages[i] )
-				{
-				QSize size = aDetailImages[i]->size();
-				if(detailImgWidths[i] < size.width())
-					{
-					detailImgWidths[i] = size.width();
-					}
-				if(imgHeight < size.height())
-					{
-					imgHeight = size.height();
-					}
-				}	
-			}	
-		}
-		
-	// remember the maximum detail image count
-	// and remember the maximum widths for every columns of heading images
-	if( (layoutStyle | LB_MOD_SHOW_HEADING_ICONS) != 0 )	
-		{
-		if( headingImgCount < aHeadingImageCount )
-			{
-			int* alloc =  new int[aHeadingImageCount ];
-			memset(alloc, '\0', sizeof(int)*aHeadingImageCount);
-			if( !alloc )
-				{	
-		       	throw std::bad_alloc();
-				}
-			for(int i = 0; i < headingImgCount; i++)
-				{
-				alloc[i] =  headingImgWidths[i];
-				}
-			delete 	headingImgWidths;
-			headingImgWidths = alloc;
-			headingImgCount = aHeadingImageCount;
-			}	
-		for(int i = 0; i < aHeadingImageCount; i++)
-			{
-			if( aHeadingImages[i] )
-				{
-				QSize size = aHeadingImages[i]->size();
-				if(headingImgWidths[i] < size.width())
-					{
-					headingImgWidths[i] = size.width();
-					}
-				if(imgHeight < size.height())
-					{
-					imgHeight = size.height();
-					}
-				}	
-			}	
-		}
-	}
-	
-	
+    // remember the index of the item, which has the longest detail text
+    const QListView* listView = static_cast<const QListView*>( static_cast<QObject*>(this)->parent() );
+    if(!aDetailText.isNull())
+        {
+        int textWidth = listView->fontMetrics().boundingRect(aDetailText).width();  
+        if( detailTxtSize.x() < textWidth )
+            {
+            detailTxtSize.rx() = textWidth;
+            detailTxtIndex = list.size() - 1;
+            }
+        }
+    
+    // remember the index of the item, which has the longest heading text
+    if( (layoutStyle | LB_STYLE_1LINE_ITEM) != 0 || (layoutStyle | LB_STYLE_2LINE_ITEM) != 0 )
+        {
+        if(!aHeadingText.isNull())
+            {
+            int textWidth = listView->fontMetrics().boundingRect(aHeadingText).width(); 
+            if( headingTxtSize.x() < textWidth )
+                {
+                headingTxtSize.rx() = textWidth;
+                headingTxtIndex = list.size() - 1;
+                }
+            }
+        }
+    
+    // remember the maximum detail image count
+    // and remember the maximum widths for every columns of detail images
+    if( (layoutStyle | LB_MOD_SHOW_DETAIL_ICONS) != 0 ) 
+        {
+        if( detailImgCount < aDetailImageCount )
+            {
+            int* alloc =  new int[aDetailImageCount];
+            memset(alloc, '\0', sizeof(int)*aDetailImageCount);
+            if( !alloc )
+                {   
+                throw std::bad_alloc();
+                }
+            for(int i = 0; i < detailImgCount; i++)
+                {
+                alloc[i] =  detailImgWidths[i];
+                }
+            delete  detailImgWidths;
+            detailImgWidths = alloc;
+            detailImgCount = aDetailImageCount;
+            }   
+        for(int i = 0; i < aDetailImageCount; i++)
+            {
+            if( !aDetailImages[i].isNull() )
+                {
+                QSize size = aDetailImages[i].size();
+                if(detailImgWidths[i] < size.width())
+                    {
+                    detailImgWidths[i] = size.width();
+                    }
+                if(imgHeight < size.height())
+                    {
+                    imgHeight = size.height();
+                    }
+                }   
+            }   
+        }
+        
+    // remember the maximum detail image count
+    // and remember the maximum widths for every columns of heading images
+    if( (layoutStyle | LB_MOD_SHOW_HEADING_ICONS) != 0 )    
+        {
+        if( headingImgCount < aHeadingImageCount )
+            {
+            int* alloc =  new int[aHeadingImageCount ];
+            memset(alloc, '\0', sizeof(int)*aHeadingImageCount);
+            if( !alloc )
+                {   
+                throw std::bad_alloc();
+                }
+            for(int i = 0; i < headingImgCount; i++)
+                {
+                alloc[i] =  headingImgWidths[i];
+                }
+            delete  headingImgWidths;
+            headingImgWidths = alloc;
+            headingImgCount = aHeadingImageCount;
+            }   
+        for(int i = 0; i < aHeadingImageCount; i++)
+            {
+            if( !aHeadingImages[i].isNull() )
+                {
+                QSize size = aHeadingImages[i].size();
+                if(headingImgWidths[i] < size.width())
+                    {
+                    headingImgWidths[i] = size.width();
+                    }
+                if(imgHeight < size.height())
+                    {
+                    imgHeight = size.height();
+                    }
+                }   
+            }   
+        }
+    }
+    
+    
 void ListBoxModel::updateLayoutData( const int row, const int rowHeight, const QPoint detailTxtSize, 
-		const QPoint headingTxtSize, const int detailImgWidth, const int headingImgWidth ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	
-	if(!rowHeights)
-		{
-		int count = list.size();
-		rowHeights =  new int[count];
-		if( !rowHeights )
-			{	
-	       	throw std::bad_alloc();
-			}
-		memset(rowHeights, '\0', sizeof(int)*count);
-		}
-		
-	rowHeights[row] = rowHeight;
+        const QPoint headingTxtSize, const int detailImgWidth, const int headingImgWidth ) const
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    
+    if(!rowHeights)
+        {
+        int count = list.size();
+        rowHeights =  new int[count];
+        if( !rowHeights )
+            {   
+            throw std::bad_alloc();
+            }
+        memset(rowHeights, '\0', sizeof(int)*count);
+        }
+        
+    rowHeights[row] = rowHeight;
     this->detailTxtSize = detailTxtSize;
     this->headingTxtSize = headingTxtSize;
     this->detailImgWidth = detailImgWidth;
     this->headingImgWidth = headingImgWidth;
-	}	
+    }   
 
 const QString& ListBoxModel::headingText( const int row ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return static_cast<ListBoxItem*>(list.at(row))->headingText();
-	}
-	
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return static_cast<ListBoxItem*>(list.at(row))->headingText();
+    }
+    
+    
 int ListBoxModel::detailImageCount() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return detailImgCount;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return detailImgCount;
+    }
+    
 int ListBoxModel::headingImageCount() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return headingImgCount;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    return headingImgCount;
+    }
 
 const int& ListBoxModel::detailImageWidth(const int index) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(index > -1 && index < detailImgCount);
-	return detailImgWidths[index];
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(index > -1 && index < detailImgCount);
+    return detailImgWidths[index];
+    }
+    
 const int& ListBoxModel::headingImageWidth(const int index) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(index > -1 && index < headingImgCount);
-	return headingImgWidths[index];
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(index > -1 && index < headingImgCount);
+    return headingImgWidths[index];
+    }
 
-	
+    
 int ListBoxModel::detailImageCount( const int row ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return static_cast<ListBoxItem*>(list.at(row))->detailImageCount();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return static_cast<ListBoxItem*>(list.at(row))->detailImageCount();
+    }
+    
 int ListBoxModel::headingImageCount( const int row ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return static_cast<ListBoxItem*>(list.at(row))->headingImageCount();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return static_cast<ListBoxItem*>(list.at(row))->headingImageCount();
+    }
+    
 const QList<QPixmap>& ListBoxModel::detailImages(const int row ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return static_cast<ListBoxItem*>(list.at(row))->detailImages();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return static_cast<ListBoxItem*>(list.at(row))->detailImages();
+    }
+    
 const QList<QPixmap>& ListBoxModel::headingImages( const int row ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return static_cast<ListBoxItem*>(list.at(row))->headingImages();
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return static_cast<ListBoxItem*>(list.at(row))->headingImages();
+    }
+    
 QPoint ListBoxModel::detailTextSize() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return detailTxtSize;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return detailTxtSize;
+    }
+    
 QPoint ListBoxModel::headingTextSize() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return headingTxtSize;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return headingTxtSize;
+    }
+    
 QPoint ListBoxModel::detailImageSize(const int row) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return QPoint(detailImgWidth, rowHeights[row]);
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return QPoint(detailImgWidth, rowHeights[row]);
+    }
+    
 QPoint ListBoxModel::headingImageSize(const int row) const
-	{
-	SWT_LOG_FUNC_CALL();
-	Q_ASSERT(row > -1 && row < list.size());
-	return QPoint(headingImgWidth, rowHeights[row]);
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    Q_ASSERT(row > -1 && row < list.size());
+    return QPoint(headingImgWidth, rowHeights[row]);
+    }
+    
 int ListBoxModel::rowWithMaxDetailTextSize() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return detailTxtIndex;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    return detailTxtIndex;
+    }
+    
 int ListBoxModel::rowWithMaxHeadingTextSize() const
-	{
-	SWT_LOG_FUNC_CALL();
-	return headingTxtIndex;
-	}
+    {
+    SWT_LOG_FUNC_CALL();
+    return headingTxtIndex;
+    }
 
 void ListBoxModel::setItemContentsToNull( const int row )
     {
     SWT_LOG_FUNC_CALL();
     Q_ASSERT(row > -1 && row < list.size());
     static_cast<ListBoxItem*>(list.at(row))->setContentsToNull( );
-    }	
-	
-ListItem* ListBoxModel::createItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-	const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount )
-	{
-	SWT_LOG_FUNC_CALL();
-	
-	ListItem* item =  new ListBoxItem( aDetailText, aDetailImages, aDetailImageCount, aHeadingText, aHeadingImages, aHeadingImageCount );
-	if( !item )
-		{	
-       	throw std::bad_alloc();
-		}
-		
-	return item;	
-	}
+    }   
+    
+ListItem* ListBoxModel::createItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+    const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount )
+    {
+    SWT_LOG_FUNC_CALL();
+    
+    ListItem* item =  new ListBoxItem( aDetailText, aDetailImages, aDetailImageCount, aHeadingText, aHeadingImages, aHeadingImageCount );
+    if( !item )
+        {   
+        throw std::bad_alloc();
+        }
+        
+    return item;    
+    }
 
 
 
-	
+    
 /**
  *  ListItemDelegate
- */	
+ */ 
 
 ListBoxItemDelegate::ListBoxItemDelegate( QObject * parent ) 
-	: QItemDelegate( parent ),
-	headingFont( NULL )
-	{
-	SWT_LOG_FUNC_CALL();
-	QListView* listView = static_cast< QListView* >( parent );
-	dataModel = static_cast < ListBoxModel* > ( listView->model() );
-	}
-	
+    : QItemDelegate( parent ),
+    headingFont( NULL )
+    {
+    SWT_LOG_FUNC_CALL();
+    QListView* listView = static_cast< QListView* >( parent );
+    dataModel = static_cast < ListBoxModel* > ( listView->model() );
+    }
+    
 void ListBoxItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
-	{
-	SWT_LOG_FUNC_CALL();
+    {
+    SWT_LOG_FUNC_CALL();
 
     Q_ASSERT(index.isValid());
 
-	// setup option
+    // setup option
     QStyleOptionViewItemV3 opt = setOptions(index, option);
     const QStyleOptionViewItemV2* v2 = qstyleoption_cast<const QStyleOptionViewItemV2 *>(&option);
     opt.features = v2 ? v2->features : QStyleOptionViewItemV2::ViewItemFeatures(QStyleOptionViewItemV2::None);
@@ -829,183 +829,183 @@
     
     // retrieve cached layout data from data model
     const int row = index.row();
-	QRect headingImageRect(QPoint(0, 0), dataModel->headingImageSize(row));
-	QRect detailImageRect(QPoint(0, 0),  dataModel->detailImageSize(row));
-	QRect headingTextRect(QPoint(0, 0),  dataModel->headingTextSize());
-	QRect detailTextRect(QPoint(0, 0),  dataModel->detailTextSize());
-	
-	// get check rectangle
-	Qt::CheckState checkState = static_cast<Qt::CheckState>(dataModel->data(index, Qt::CheckStateRole).toInt());
-	QRect checkRect = (dataModel->flags(index) & Qt::ItemIsUserCheckable) != 0  ? check( opt, opt.rect, checkState ) : QRect();
-	if(checkRect.isValid())
-		{
-		checkRect.setRight(checkRect.right() + 2 * margin(opt));	
-		}
-		
-	doLayout( option, &checkRect, &headingImageRect, &detailImageRect, & headingTextRect, &detailTextRect );
+    QRect headingImageRect(QPoint(0, 0), dataModel->headingImageSize(row));
+    QRect detailImageRect(QPoint(0, 0),  dataModel->detailImageSize(row));
+    QRect headingTextRect(QPoint(0, 0),  dataModel->headingTextSize());
+    QRect detailTextRect(QPoint(0, 0),  dataModel->detailTextSize());
+    
+    // get check rectangle
+    Qt::CheckState checkState = static_cast<Qt::CheckState>(dataModel->data(index, Qt::CheckStateRole).toInt());
+    QRect checkRect = (dataModel->flags(index) & Qt::ItemIsUserCheckable) != 0  ? check( opt, opt.rect, checkState ) : QRect();
+    if(checkRect.isValid())
+        {
+        checkRect.setRight(checkRect.right() + 2 * margin(opt));    
+        }
+        
+    doLayout( option, &checkRect, &headingImageRect, &detailImageRect, & headingTextRect, &detailTextRect );
 
-	const int layoutStyle = dataModel->style();
-	
+    const int layoutStyle = dataModel->style();
+    
     drawBackground(painter, opt, index);
     
     if(checkRect.isValid())
-	    {
-	    drawCheck( painter, opt, checkRect, checkState );
-	    }
+        {
+        drawCheck( painter, opt, checkRect, checkState );
+        }
     
     // draw heading images
-	if ( ( layoutStyle & LB_MOD_SHOW_HEADING_ICONS ) != 0 && dataModel->headingImageCount(row) > 0 )
-		{
-		drawImages( painter, opt, headingImageRect, dataModel->headingImages(row), &(dataModel->headingImageWidth(0)), dataModel->headingImageCount(row) );
-		}
-		
-	// draw detail images	
-	if ( ( layoutStyle & LB_MOD_SHOW_DETAIL_ICONS ) != 0 && dataModel->detailImageCount(row) > 0 )
-		{
-		drawImages( painter, opt, detailImageRect, dataModel->detailImages(row), &(dataModel->detailImageWidth(0)), dataModel->detailImageCount(row) );
-		}
-		
-	// draw detail text	
-	if(detailTextRect.isValid())
-		{
-		SWT_LOG_DATA_4("Draw detail text; size=(%d, %d); topleft=(%d, %d)", detailTextRect.width(), detailTextRect.height(), detailTextRect.left(), detailTextRect.top() );   
-	    drawDisplay( painter, opt, detailTextRect, dataModel->data(index, Qt::DisplayRole).toString() );
-	    drawFocus( painter, opt, detailTextRect);
-		}
+    if ( ( layoutStyle & LB_MOD_SHOW_HEADING_ICONS ) != 0 && dataModel->headingImageCount(row) > 0 )
+        {
+        drawImages( painter, opt, headingImageRect, dataModel->headingImages(row), &(dataModel->headingImageWidth(0)), dataModel->headingImageCount(row) );
+        }
+        
+    // draw detail images   
+    if ( ( layoutStyle & LB_MOD_SHOW_DETAIL_ICONS ) != 0 && dataModel->detailImageCount(row) > 0 )
+        {
+        drawImages( painter, opt, detailImageRect, dataModel->detailImages(row), &(dataModel->detailImageWidth(0)), dataModel->detailImageCount(row) );
+        }
+        
+    // draw detail text 
+    if(detailTextRect.isValid())
+        {
+        SWT_LOG_DATA_4("Draw detail text; size=(%d, %d); topleft=(%d, %d)", detailTextRect.width(), detailTextRect.height(), detailTextRect.left(), detailTextRect.top() );   
+        drawDisplay( painter, opt, detailTextRect, dataModel->data(index, Qt::DisplayRole).toString() );
+        drawFocus( painter, opt, detailTextRect);
+        }
     
-	// draw heading text
-	if ( headingTextRect.isValid() && ( ( layoutStyle & LB_STYLE_1LINE_ITEM ) != 0 ||  ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0  ))
-		{
-	    if ( headingFont != NULL)
-	    	{
-	        opt.font = *headingFont;
-	        opt.fontMetrics = QFontMetrics( *headingFont );
-	    	}
-			
-		SWT_LOG_DATA_4("Draw heading text; size=(%d, %d); topleft=(%d, %d)", headingTextRect.width(), headingTextRect.height(), headingTextRect.right(), headingTextRect.top() );   
-		drawDisplay(painter, opt, headingTextRect, dataModel->headingText(row) );
-    	drawFocus(painter, opt, headingTextRect);
-		}
-		
+    // draw heading text
+    if ( headingTextRect.isValid() && ( ( layoutStyle & LB_STYLE_1LINE_ITEM ) != 0 ||  ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0  ))
+        {
+        if ( headingFont != NULL)
+            {
+            opt.font = *headingFont;
+            opt.fontMetrics = QFontMetrics( *headingFont );
+            }
+            
+        SWT_LOG_DATA_4("Draw heading text; size=(%d, %d); topleft=(%d, %d)", headingTextRect.width(), headingTextRect.height(), headingTextRect.right(), headingTextRect.top() );   
+        drawDisplay(painter, opt, headingTextRect, dataModel->headingText(row) );
+        drawFocus(painter, opt, headingTextRect);
+        }
+        
     painter->restore();
     
-	}
+    }
 
 void ListBoxItemDelegate::computeSizes( const QModelIndex& index, const QStyleOptionViewItem& option, QSize* checkSize, 
-	QSize *headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize ) const
- 	{
- 	SWT_LOG_FUNC_CALL();
-	const int layoutStyle = dataModel->style();
-	
-	 int imageMargin = margin(option);
-	 // go through every columns of heading images to get width of entire heading image area
-	 // go through every heading images in the row to get the height of entire heading image area
+    QSize *headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize ) const
+    {
+    SWT_LOG_FUNC_CALL();
+    const int layoutStyle = dataModel->style();
+    
+     int imageMargin = margin(option);
+     // go through every columns of heading images to get width of entire heading image area
+     // go through every heading images in the row to get the height of entire heading image area
      if ( ( layoutStyle & LB_MOD_SHOW_HEADING_ICONS ) != 0 && dataModel->headingImageCount() > 0 ) 
-		{
-		int width = 0;	
-		int height = 0;
-		int headingImageCount = dataModel->headingImageCount();
-		int itemHeadingImageCount = dataModel->headingImageCount(index.row());
-		const QPixmap* pixmap;
-		for( int i = 0; i < headingImageCount; i++)   
-			{
-			width += dataModel->headingImageWidth(i);
-			pixmap = &(dataModel->headingImages(index.row())[i]);
-			if(i <  itemHeadingImageCount && pixmap)
-				{
-				if( pixmap->size().height() > height )
-					{
-					height = pixmap->size().height();
-					}
-				}
-			}
-		width += (headingImageCount - 1) * imageMargin;	
-		*headingImageSize = QSize( width, height );
- 		SWT_LOG_DATA_3("heading image rect row=%d; size=(%d, %d);", index.row(), headingImageSize->width(), headingImageSize->height() );   
-		} 
+        {
+        int width = 0;  
+        int height = 0;
+        int headingImageCount = dataModel->headingImageCount();
+        int itemHeadingImageCount = dataModel->headingImageCount(index.row());
+        const QPixmap* pixmap;
+        for( int i = 0; i < headingImageCount; i++)   
+            {
+            width += dataModel->headingImageWidth(i);
+            pixmap = &(dataModel->headingImages(index.row())[i]);
+            if(i <  itemHeadingImageCount && pixmap)
+                {
+                if( pixmap->size().height() > height )
+                    {
+                    height = pixmap->size().height();
+                    }
+                }
+            }
+        width += (headingImageCount - 1) * imageMargin; 
+        *headingImageSize = QSize( width, height );
+        SWT_LOG_DATA_3("heading image rect row=%d; size=(%d, %d);", index.row(), headingImageSize->width(), headingImageSize->height() );   
+        } 
      else
-		{
-		*headingImageSize = QSize();
-		}	
+        {
+        *headingImageSize = QSize();
+        }   
 
-	 // go through every columns of detail images to get width of entire detail image area
-	 // go through every detail images in the row to get height of entire detial image area
+     // go through every columns of detail images to get width of entire detail image area
+     // go through every detail images in the row to get height of entire detial image area
      if ( ( layoutStyle & LB_MOD_SHOW_DETAIL_ICONS ) != 0 && dataModel->detailImageCount() > 0 ) 
-    	{
-		int width = 0;	
-		int height = 0;
-		int detailImageCount = dataModel->detailImageCount();
-		int itemDetailImageCount = dataModel->detailImageCount(index.row());
-		const QPixmap* pixmap;
-		for( int i = 0; i < detailImageCount; i++)   
-			{
-			width += dataModel->detailImageWidth(i);
-			pixmap = &(dataModel->detailImages(index.row())[i]);
-			if(i <  itemDetailImageCount && pixmap)
-				{
-				if( pixmap->size().height() > height )
-					{
-					height = pixmap->size().height();
-					}
-				}
-			}
-		width += (detailImageCount - 1) * imageMargin;	
-		*detailImageSize = QSize( width, height );
- 		SWT_LOG_DATA_3("detail image rect row=%d; size=(%d, %d);", index.row(), detailImageSize->width(), detailImageSize->height() );   
-    	}
-    else	 
-    	{
-    	*detailImageSize = QSize();
-    	}
+        {
+        int width = 0;  
+        int height = 0;
+        int detailImageCount = dataModel->detailImageCount();
+        int itemDetailImageCount = dataModel->detailImageCount(index.row());
+        const QPixmap* pixmap;
+        for( int i = 0; i < detailImageCount; i++)   
+            {
+            width += dataModel->detailImageWidth(i);
+            pixmap = &(dataModel->detailImages(index.row())[i]);
+            if(i <  itemDetailImageCount && pixmap)
+                {
+                if( pixmap->size().height() > height )
+                    {
+                    height = pixmap->size().height();
+                    }
+                }
+            }
+        width += (detailImageCount - 1) * imageMargin;  
+        *detailImageSize = QSize( width, height );
+        SWT_LOG_DATA_3("detail image rect row=%d; size=(%d, %d);", index.row(), detailImageSize->width(), detailImageSize->height() );   
+        }
+    else     
+        {
+        *detailImageSize = QSize();
+        }
 
-	const QStyleOptionViewItemV2* v2 = qstyleoption_cast< const QStyleOptionViewItemV2* >(&option);
+    const QStyleOptionViewItemV2* v2 = qstyleoption_cast< const QStyleOptionViewItemV2* >(&option);
     const bool wrapText = v2->features & QStyleOptionViewItemV2::WrapText;
     const int width = wrapText && option.rect.isValid() ? option.rect.width() : 0xffff;
-	
-	// compute width of heading text upon the item which has the longest heading text
-	int row;
-	if ( ( layoutStyle & LB_STYLE_1LINE_ITEM ) != 0  || ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0 ) 
-		{
-		row = dataModel->rowWithMaxHeadingTextSize();
-		if( row > -1)
-			{
-			const QString& text = dataModel->headingText( row );
-			if( !text.isNull() )
-				{
-				const QFont& font = headingFont ? *headingFont : option.font;
-				*headingTextSize = textRectangle( width, font, text ).size();
-				}
-			}
-		}
-	else
-		{
-		*headingTextSize = QSize();
-		}
-	    
-	// compute width of detail text upon the item which has the longest detail text
-	row = dataModel->rowWithMaxDetailTextSize();
-	if( row > -1)
-		{
-		const QString& text = dataModel->data( index, Qt::DisplayRole).toString();
-		if( !text.isNull() )
-			{
-			*detailTextSize = textRectangle( width, option.font, text ).size();
-			}
-		}
-	else
-		{
-		*detailTextSize = QSize();
-		}
-		
+    
+    // compute width of heading text upon the item which has the longest heading text
+    int row;
+    if ( ( layoutStyle & LB_STYLE_1LINE_ITEM ) != 0  || ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0 ) 
+        {
+        row = dataModel->rowWithMaxHeadingTextSize();
+        if( row > -1)
+            {
+            const QString& text = dataModel->headingText( row );
+            if( !text.isNull() )
+                {
+                const QFont& font = headingFont ? *headingFont : option.font;
+                *headingTextSize = textRectangle( width, font, text ).size();
+                }
+            }
+        }
+    else
+        {
+        *headingTextSize = QSize();
+        }
+        
+    // compute width of detail text upon the item which has the longest detail text
+    row = dataModel->rowWithMaxDetailTextSize();
+    if( row > -1)
+        {
+        const QString& text = dataModel->data( index, Qt::DisplayRole).toString();
+        if( !text.isNull() )
+            {
+            *detailTextSize = textRectangle( width, option.font, text ).size();
+            }
+        }
+    else
+        {
+        *detailTextSize = QSize();
+        }
+        
 
     *checkSize = check( option, option.rect, Qt::Unchecked ).size();
   }
 
 void ListBoxItemDelegate::addMargins( const QStyleOptionViewItem &option, QSize* checkSize, 
-	QSize* headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize ) const
-	{
- 	SWT_LOG_FUNC_CALL();
- 	
+    QSize* headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize ) const
+    {
+    SWT_LOG_FUNC_CALL();
+    
     const bool hasCheck = checkSize->isValid();
     const bool hasHeadingImage = headingImageSize->isValid();
     const bool hasDetailImage = detailImageSize->isValid();
@@ -1017,372 +1017,372 @@
     
     // set height for text if text height is 0 and there is no image
     if ( detailTextSize->height() == 0 && !hasHeadingImage && !hasDetailImage  )
-    	{
+        {
         detailTextSize->setHeight( option.fontMetrics.height() );
-     	}
- 	if ( headingTextSize->height() == 0 && !hasHeadingImage && !hasDetailImage )
-    	{
-	    if ( headingFont )
-		    {
-	        headingTextSize->setHeight( QFontMetrics( *headingFont ).height() );
-		    }
-		else
-			{
-			headingTextSize->setHeight( detailTextSize->height() );	
-			}	    
-	    }
+        }
+    if ( headingTextSize->height() == 0 && !hasHeadingImage && !hasDetailImage )
+        {
+        if ( headingFont )
+            {
+            headingTextSize->setHeight( QFontMetrics( *headingFont ).height() );
+            }
+        else
+            {
+            headingTextSize->setHeight( detailTextSize->height() ); 
+            }       
+        }
 
 
     if ( hasHeadingImage ) 
-    	{
-  	    headingImageSize->rwidth() += pixmapMargin * 2;
-    	}
+        {
+        headingImageSize->rwidth() += pixmapMargin * 2;
+        }
     
     if ( hasDetailImage ) 
-    	{
-  	    detailImageSize->rwidth() += pixmapMargin * 2;
-     	}
-    	
+        {
+        detailImageSize->rwidth() += pixmapMargin * 2;
+        }
+        
     if ( hasCheck ) 
-    	{
-  	    checkSize->rwidth() += checkMargin * 2;
-    	}
-	}
+        {
+        checkSize->rwidth() += checkMargin * 2;
+        }
+    }
 
 QSize ListBoxItemDelegate::computeSize(  const QStyleOptionViewItem &option, const QSize& check, const QSize& headingImage, 
-	const QSize& detailImage, const QSize& headingText, const QSize& detailText ) const
-	{
-	SWT_LOG_FUNC_CALL();
- 	const int layoutStyle = dataModel->style();
- 	int h, w;
+    const QSize& detailImage, const QSize& headingText, const QSize& detailText ) const
+    {
+    SWT_LOG_FUNC_CALL();
+    const int layoutStyle = dataModel->style();
+    int h, w;
     if ( ( layoutStyle &  LB_STYLE_2LINE_ITEM ) != 0 ) 
         {
-		const int textWidth = qMax( headingText.width(),  detailText.width() );	
-    	const int textMargin = margin(option);
+        const int textWidth = qMax( headingText.width(),  detailText.width() ); 
+        const int textMargin = margin(option);
         h = qMax( check.height(), qMax( headingText.height() + detailText.height() + textMargin,
-        	qMax( headingImage.height(), detailImage.height() ) ) );
+            qMax( headingImage.height(), detailImage.height() ) ) );
         w = check.width() + textWidth + headingImage.width() + detailImage.width();
         }
     else 
-    	{
+        {
         h = qMax( check.height(), qMax( qMax( headingText.height(), detailText.height() ),
-        	qMax( headingImage.height(), detailImage.height() ) ) );
+            qMax( headingImage.height(), detailImage.height() ) ) );
         w = check.width() + headingText.width() + detailText.width() + headingImage.width() + detailImage.width();
-    	}
-    	
-    return QSize( w, h );	
-	}
+        }
+        
+    return QSize( w, h );   
+    }
 
 
 void ListBoxItemDelegate::layoutRects( const QStyleOptionViewItem &option, QRect* check, QRect *headingImage, 
-	QRect* detailImage, QRect* headingText, QRect* detailText, bool hint ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	
-	const int layoutStyle = dataModel->style();
- 	int h, w; 
- 	int textWidth;
- 	if( ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0 )
-	 	{
- 		textWidth = qMax( headingText->width(),  detailText->width() );
-	 	}
- 	else
-	 	{
- 		textWidth = headingText->width() + detailText->width();
-	 	}
- 	
+    QRect* detailImage, QRect* headingText, QRect* detailText, bool hint ) const
+    {
+    SWT_LOG_FUNC_CALL();
+    
+    const int layoutStyle = dataModel->style();
+    int h, w; 
+    int textWidth;
+    if( ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0 )
+        {
+        textWidth = qMax( headingText->width(),  detailText->width() );
+        }
+    else
+        {
+        textWidth = headingText->width() + detailText->width();
+        }
+    
     if ( hint )
-	    {
-		QSize size = computeSize( option, check->size(), headingImage->size(), detailImage->size(), headingText->size(), detailText->size() );
-		h = size.height();
-		w = size.width();
-	    }
-	else
-		{
+        {
+        QSize size = computeSize( option, check->size(), headingImage->size(), detailImage->size(), headingText->size(), detailText->size() );
+        h = size.height();
+        w = size.width();
+        }
+    else
+        {
         w = option.rect.width();
         h = option.rect.height();
-		} 
-	const int x = option.rect.left(), y = option.rect.top();   
-	SWT_LOG_DATA_4("space for layout: size=(%d, %d); topleft=(%d, %d)", w, h, x, y );   
-	
-    int leftX = x, rightX = x + w;	
-	if ( option.direction == Qt::RightToLeft ) 
-     	{
-     	if ( check->isValid() )	
-         	{
+        } 
+    const int x = option.rect.left(), y = option.rect.top();   
+    SWT_LOG_DATA_4("space for layout: size=(%d, %d); topleft=(%d, %d)", w, h, x, y );   
+    
+    int leftX = x, rightX = x + w;  
+    if ( option.direction == Qt::RightToLeft ) 
+        {
+        if ( check->isValid() ) 
+            {
             check->setRect( qMax( rightX - check->width(), leftX ) , y, qMin( check->width(), rightX - leftX ), h );
             rightX = check->left();
-         	}
-         	
+            }
+            
         if ( headingImage->isValid() )
-        	{
-        	if ( rightX > leftX )
-            	{	
-            	headingImage->setRect( qMax( rightX - headingImage->width(), leftX ), y, qMin( headingImage->width(), rightX - leftX  ) , h );
-            	rightX = headingImage->left();
-            	}
-        	else
-            	{
-            	*headingImage = QRect();
-            	}
-        	} 
-        	
+            {
+            if ( rightX > leftX )
+                {   
+                headingImage->setRect( qMax( rightX - headingImage->width(), leftX ), y, qMin( headingImage->width(), rightX - leftX  ) , h );
+                rightX = headingImage->left();
+                }
+            else
+                {
+                *headingImage = QRect();
+                }
+            } 
+            
         if ( detailImage->isValid() )
-        	{
-        	if (  rightX > leftX  )
-            	{
-            	int detailImageX = leftX;
-            	int detailImageWidth = detailImage->width();
-            	if( (rightX -leftX) >= (textWidth + detailImageWidth) )
-	            	{
-	            	detailImageX = rightX - textWidth - detailImageWidth;
-	            	}
-            	else
-	            	{
-	            	detailImageX = qMin( rightX, leftX + detailImageWidth );
-	             	}
-           		detailImage->setRect( detailImageX, y, qMin( detailImageWidth, rightX - detailImageX ), h );
-            	leftX = detailImage->right();
-            	}
-        	else
-            	{
-            	*detailImage = QRect();
-            	}
-        	}
-        	
+            {
+            if (  rightX > leftX  )
+                {
+                int detailImageX = leftX;
+                int detailImageWidth = detailImage->width();
+                if( (rightX -leftX) >= (textWidth + detailImageWidth) )
+                    {
+                    detailImageX = rightX - textWidth - detailImageWidth;
+                    }
+                else
+                    {
+                    detailImageX = qMin( rightX, leftX + detailImageWidth );
+                    }
+                detailImage->setRect( detailImageX, y, qMin( detailImageWidth, rightX - detailImageX ), h );
+                leftX = detailImage->right();
+                }
+            else
+                {
+                *detailImage = QRect();
+                }
+            }
+            
         if (  ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0 )
             {
-            if ( rightX > leftX )	
-	            {
-		    	const int textMargin = margin(option);
-    			headingText->setRect( qMax( leftX, rightX - textWidth ), y, qMin( textWidth, rightX - leftX ), headingText->height() );
-    			detailText->setRect( headingText->left(), headingText->bottom() + textMargin, headingText->width(), detailText->height() );
-	            }
-	        else
-		        {
-		        *headingText = QRect();	
-		        *detailText = QRect();	
-		        }    
+            if ( rightX > leftX )   
+                {
+                const int textMargin = margin(option);
+                headingText->setRect( qMax( leftX, rightX - textWidth ), y, qMin( textWidth, rightX - leftX ), headingText->height() );
+                detailText->setRect( headingText->left(), headingText->bottom() + textMargin, headingText->width(), detailText->height() );
+                }
+            else
+                {
+                *headingText = QRect(); 
+                *detailText = QRect();  
+                }    
             }
         else
-	        {
-            if ( headingText->isValid() )	
-	            {
-	            if ( rightX > leftX )
-		            {
-	            	headingText->setRect( qMax( rightX - headingText->width(), leftX ), y, qMin( headingText->width(), rightX - leftX  ) , h );
-	            	rightX = headingText->left();
-		            }
-		        else 
-		        	{
-			        *headingText = QRect();	
-		        	}
-	            }  
-	              
-            if ( detailText->isValid() )	
-	            {
-	            if ( rightX > leftX )
-		            {
-	            	detailText->setRect( qMax( rightX - detailText->width(), leftX ), y, qMin( detailText->width(), rightX - leftX  ) , h );
-		            }
-		        else 
-		        	{
-			        *detailText = QRect();	
-		        	}
-	            }    
-	        }  
-     	}
- 	else // left to right
-     	{
-     	if (check->isValid() )	
-         	{
+            {
+            if ( headingText->isValid() )   
+                {
+                if ( rightX > leftX )
+                    {
+                    headingText->setRect( qMax( rightX - headingText->width(), leftX ), y, qMin( headingText->width(), rightX - leftX  ) , h );
+                    rightX = headingText->left();
+                    }
+                else 
+                    {
+                    *headingText = QRect(); 
+                    }
+                }  
+                  
+            if ( detailText->isValid() )    
+                {
+                if ( rightX > leftX )
+                    {
+                    detailText->setRect( qMax( rightX - detailText->width(), leftX ), y, qMin( detailText->width(), rightX - leftX  ) , h );
+                    }
+                else 
+                    {
+                    *detailText = QRect();  
+                    }
+                }    
+            }  
+        }
+    else // left to right
+        {
+        if (check->isValid() )  
+            {
             check->setRect( leftX, y, qMin( check->width(), rightX - leftX ), h );
             leftX = check->right();
-         	}
-         	
+            }
+            
         if ( headingImage->isValid() )
-        	{
-        	if ( rightX > leftX )
-            	{	
-            	headingImage->setRect( leftX, y, qMin( headingImage->width(), rightX - leftX  ) , h );
-            	leftX = headingImage->right();
-            	}
-        	else
-            	{
-            	*headingImage = QRect();
-            	}
-        	} 
-        	
+            {
+            if ( rightX > leftX )
+                {   
+                headingImage->setRect( leftX, y, qMin( headingImage->width(), rightX - leftX  ) , h );
+                leftX = headingImage->right();
+                }
+            else
+                {
+                *headingImage = QRect();
+                }
+            } 
+            
         if ( detailImage->isValid() )
-        	{
-        	if (  rightX > leftX  )
-            	{
-            	int detailImageX = leftX;
-            	int detailImageWidth = detailImage->width();
-            	if( (rightX -leftX) >= (textWidth + detailImageWidth) )
-	            	{
-	            	detailImageX = leftX + textWidth;
-	            	}
-            	else
-	            	{
-	            	detailImageX = qMax( leftX, rightX - detailImageWidth );
-	             	}
-           		detailImage->setRect( detailImageX, y, qMin( detailImageWidth, rightX - detailImageX ), h );
-            	rightX = detailImage->left();
-            	}
-        	else
-            	{
-            	*detailImage = QRect();
-            	}
-        	}
-        	
+            {
+            if (  rightX > leftX  )
+                {
+                int detailImageX = leftX;
+                int detailImageWidth = detailImage->width();
+                if( (rightX -leftX) >= (textWidth + detailImageWidth) )
+                    {
+                    detailImageX = leftX + textWidth;
+                    }
+                else
+                    {
+                    detailImageX = qMax( leftX, rightX - detailImageWidth );
+                    }
+                detailImage->setRect( detailImageX, y, qMin( detailImageWidth, rightX - detailImageX ), h );
+                rightX = detailImage->left();
+                }
+            else
+                {
+                *detailImage = QRect();
+                }
+            }
+            
         if (  ( layoutStyle & LB_STYLE_2LINE_ITEM ) != 0 )
             {
-            if ( rightX > leftX )	
-	            {
-				const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const QStyleOptionViewItemV3 *>(&option);
-				const QWidget* widget = v3 ? v3->widget : NULL;
-			    QStyle* style = widget ? widget->style() : QApplication::style();
-		    	const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1;
-    			headingText->setRect( leftX , y,  qMin( textWidth, rightX - leftX ), headingText->height() );
-    			detailText->setRect( headingText->left(), headingText->bottom() + textMargin, headingText->width(), detailText->height() );
-	            }
-	        else
-		        {
-		        *headingText = QRect();	
-		        *detailText = QRect();	
-		        }    
+            if ( rightX > leftX )   
+                {
+                const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const QStyleOptionViewItemV3 *>(&option);
+                const QWidget* widget = v3 ? v3->widget : NULL;
+                QStyle* style = widget ? widget->style() : QApplication::style();
+                const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1;
+                headingText->setRect( leftX , y,  qMin( textWidth, rightX - leftX ), headingText->height() );
+                detailText->setRect( headingText->left(), headingText->bottom() + textMargin, headingText->width(), detailText->height() );
+                }
+            else
+                {
+                *headingText = QRect(); 
+                *detailText = QRect();  
+                }    
             }
         else
-	        {
-            if ( headingText->isValid() )	
-	            {
-	            if ( rightX > leftX )
-		            {
-	            	headingText->setRect( leftX, y, qMin( headingText->width(), rightX - leftX  ) , h );
-	            	leftX = headingText->right();
-		            }
-		        else 
-		        	{
-			        *headingText = QRect();	
-		        	}
-	            }  
-	              
-            if ( detailText->isValid() )	
-	            {
-	            if ( rightX > leftX )
-		            {
-	            	detailText->setRect( leftX, y, qMin( detailText->width(), rightX - leftX  ) , h );
-		            }
-		        else 
-		        	{
-			        *detailText = QRect();	
-		        	}
-	            }    
-	        }  
-    	} 
-	SWT_LOG_DATA_4("check rect: size=(%d, %d); topleft=(%d, %d)", check->width(), check->height(), check->left(), check->top() );   
-	SWT_LOG_DATA_4("heading image rect: size=(%d, %d); topleft=(%d, %d)", headingImage->width(), headingImage->height(), headingImage->left(), headingImage->top() );   
-	SWT_LOG_DATA_4("detail image rect: size=(%d, %d); topleft=(%d, %d)", detailImage->width(), detailImage->height(), detailImage->left(), detailImage->top() );   
-	SWT_LOG_DATA_4("heading text rect: size=(%d, %d); topleft=(%d, %d)", headingText->width(), headingText->height(), headingText->left(), headingText->top() );   
-	SWT_LOG_DATA_4("detail text rect: size=(%d, %d); topleft=(%d, %d)", detailText->width(), detailText->height(), detailText->left(), detailText->top() );   
-    	 
- 	}
+            {
+            if ( headingText->isValid() )   
+                {
+                if ( rightX > leftX )
+                    {
+                    headingText->setRect( leftX, y, qMin( headingText->width(), rightX - leftX  ) , h );
+                    leftX = headingText->right();
+                    }
+                else 
+                    {
+                    *headingText = QRect(); 
+                    }
+                }  
+                  
+            if ( detailText->isValid() )    
+                {
+                if ( rightX > leftX )
+                    {
+                    detailText->setRect( leftX, y, qMin( detailText->width(), rightX - leftX  ) , h );
+                    }
+                else 
+                    {
+                    *detailText = QRect();  
+                    }
+                }    
+            }  
+        } 
+    SWT_LOG_DATA_4("check rect: size=(%d, %d); topleft=(%d, %d)", check->width(), check->height(), check->left(), check->top() );   
+    SWT_LOG_DATA_4("heading image rect: size=(%d, %d); topleft=(%d, %d)", headingImage->width(), headingImage->height(), headingImage->left(), headingImage->top() );   
+    SWT_LOG_DATA_4("detail image rect: size=(%d, %d); topleft=(%d, %d)", detailImage->width(), detailImage->height(), detailImage->left(), detailImage->top() );   
+    SWT_LOG_DATA_4("heading text rect: size=(%d, %d); topleft=(%d, %d)", headingText->width(), headingText->height(), headingText->left(), headingText->top() );   
+    SWT_LOG_DATA_4("detail text rect: size=(%d, %d); topleft=(%d, %d)", detailText->width(), detailText->height(), detailText->left(), detailText->top() );   
+         
+    }
 
 
 void ListBoxItemDelegate::doLayout( const QStyleOptionViewItem &option, QRect* checkRect, QRect* headingImageRect,
-	QRect* detailImageRect, QRect* headingTextRect, QRect* detailTextRect ) const
-	{
+    QRect* detailImageRect, QRect* headingTextRect, QRect* detailTextRect ) const
+    {
     Q_ASSERT( checkRect && headingImageRect && detailImageRect && headingTextRect && detailTextRect );
     
     // duplicate rects
- 	QRect check = *checkRect;
- 	QRect headingImage = *headingImageRect;
- 	QRect detailImage = *detailImageRect;
- 	QRect headingText = *headingTextRect;
- 	QRect detailText = *detailTextRect;
- 	
-    // layout duplicated rects	
-	layoutRects( option, &check, &headingImage, &detailImage, &headingText, &detailText, false );
-	
+    QRect check = *checkRect;
+    QRect headingImage = *headingImageRect;
+    QRect detailImage = *detailImageRect;
+    QRect headingText = *headingTextRect;
+    QRect detailText = *detailTextRect;
+    
+    // layout duplicated rects  
+    layoutRects( option, &check, &headingImage, &detailImage, &headingText, &detailText, false );
+    
 
-	// remove margins
-	const int mg = margin(option);
-	if( checkRect->isValid() )
-		{
-	 	checkRect->setRight( checkRect->right() - 2 * mg );
-		}
-	if( headingImageRect->isValid() )
-		{
-	 	headingImageRect->setRight( headingImageRect->right() - 2 * mg );
-		}
-	if( detailImageRect->isValid() )
-		{
-	 	detailImageRect->setRight( detailImageRect->right() - 2 * mg );
-		}
-	
-	// adust rectangles	
+    // remove margins
+    const int mg = margin(option);
+    if( checkRect->isValid() )
+        {
+        checkRect->setRight( checkRect->right() - 2 * mg );
+        }
+    if( headingImageRect->isValid() )
+        {
+        headingImageRect->setRight( headingImageRect->right() - 2 * mg );
+        }
+    if( detailImageRect->isValid() )
+        {
+        detailImageRect->setRight( detailImageRect->right() - 2 * mg );
+        }
+    
+    // adust rectangles 
     *checkRect = QStyle::alignedRect( option.direction, Qt::AlignCenter, checkRect->size(), check );
     *headingImageRect = QStyle::alignedRect( option.direction, option.decorationAlignment, headingImageRect->size(), headingImage );
     *detailImageRect = QStyle::alignedRect( option.direction, option.decorationAlignment, detailImageRect->size().boundedTo(detailImage.size()), detailImage );
      if (option.showDecorationSelected)
-    	{
-    	// take up entire space	
+        {
+        // take up entire space 
         *headingTextRect = headingText;
         *detailTextRect = detailText;
-    	}
+        }
     else
-    	{
-    	// aligne to the space
+        {
+        // aligne to the space
         *headingTextRect = QStyle::alignedRect( option.direction, option.displayAlignment, 
-        	headingTextRect->size().boundedTo(headingText.size()), headingText );
+            headingTextRect->size().boundedTo(headingText.size()), headingText );
         *detailTextRect = QStyle::alignedRect( option.direction, option.displayAlignment, 
-        	detailTextRect->size().boundedTo(detailText.size()), detailText );
-    	}
-	}
+            detailTextRect->size().boundedTo(detailText.size()), detailText );
+        }
+    }
 
 QSize ListBoxItemDelegate::sizeHint(const QStyleOptionViewItem &option,
-	const QModelIndex &index) const
-	{
- 	SWT_LOG_FUNC_CALL();
-   	
- 	QSize checkSize;
- 	QSize headingImageSize;
- 	QSize detailImageSize;
- 	QSize headingTextSize;
- 	QSize detailTextSize;
+    const QModelIndex &index) const
+    {
+    SWT_LOG_FUNC_CALL();
+    
+    QSize checkSize;
+    QSize headingImageSize;
+    QSize detailImageSize;
+    QSize headingTextSize;
+    QSize detailTextSize;
 
-	computeSizes( index, option, &checkSize, &headingImageSize, &detailImageSize, &headingTextSize, &detailTextSize ); 
-	addMargins( option, &checkSize, &headingImageSize, &detailImageSize, &headingTextSize, &detailTextSize ); 
-	SWT_LOG_DATA_2("check size=(%d, %d) ", checkSize.width(), checkSize.height() );   
-	SWT_LOG_DATA_2("heading image size=(%d, %d) ", headingImageSize.width(), headingImageSize.height() );   
-	SWT_LOG_DATA_2("detail imageSize size=(%d, %d) ", detailImageSize.width(), detailImageSize.height() );   
-	SWT_LOG_DATA_2("headingText size=(%d, %d) ", headingTextSize.width(), headingTextSize.height() );   
-	SWT_LOG_DATA_2("detail text size=(%d, %d) ", detailTextSize.width(), detailTextSize.height() );   
-	QSize size = computeSize( option, checkSize, headingImageSize, detailImageSize, headingTextSize, detailTextSize );
-	SWT_LOG_DATA_2("hint size=(%d, %d) ", size.width(), size.height() ); 
-	dataModel->updateLayoutData( index.row(), size.height(), 
-		QPoint( detailTextSize.width(), detailTextSize.height() ), 
-		QPoint( headingTextSize.width(), headingTextSize.height() ), 
-		detailImageSize.width(), headingImageSize.width() );
+    computeSizes( index, option, &checkSize, &headingImageSize, &detailImageSize, &headingTextSize, &detailTextSize ); 
+    addMargins( option, &checkSize, &headingImageSize, &detailImageSize, &headingTextSize, &detailTextSize ); 
+    SWT_LOG_DATA_2("check size=(%d, %d) ", checkSize.width(), checkSize.height() );   
+    SWT_LOG_DATA_2("heading image size=(%d, %d) ", headingImageSize.width(), headingImageSize.height() );   
+    SWT_LOG_DATA_2("detail imageSize size=(%d, %d) ", detailImageSize.width(), detailImageSize.height() );   
+    SWT_LOG_DATA_2("headingText size=(%d, %d) ", headingTextSize.width(), headingTextSize.height() );   
+    SWT_LOG_DATA_2("detail text size=(%d, %d) ", detailTextSize.width(), detailTextSize.height() );   
+    QSize size = computeSize( option, checkSize, headingImageSize, detailImageSize, headingTextSize, detailTextSize );
+    SWT_LOG_DATA_2("hint size=(%d, %d) ", size.width(), size.height() ); 
+    dataModel->updateLayoutData( index.row(), size.height(), 
+        QPoint( detailTextSize.width(), detailTextSize.height() ), 
+        QPoint( headingTextSize.width(), headingTextSize.height() ), 
+        detailImageSize.width(), headingImageSize.width() );
     return size;
-	}
-	
+    }
+    
 void ListBoxItemDelegate::setHeadingFont( QFont* font )
-	{
- 	SWT_LOG_FUNC_CALL();
-	headingFont = font;
-	}
-	
+    {
+    SWT_LOG_FUNC_CALL();
+    headingFont = font;
+    }
+    
 
 QStyleOptionViewItem ListBoxItemDelegate::setOptions(const QModelIndex &index,
-	const QStyleOptionViewItem &option) const
-	{
-	SWT_LOG_FUNC_CALL();
+    const QStyleOptionViewItem &option) const
+    {
+    SWT_LOG_FUNC_CALL();
     QStyleOptionViewItem opt = option;
     
-	// ask data modle for font, alignment and brush, then set them
-	
+    // ask data modle for font, alignment and brush, then set them
+    
    // set font
     QVariant value = index.data(Qt::FontRole);
     if (value.isValid()){
@@ -1401,11 +1401,11 @@
         opt.palette.setBrush(QPalette::Text, qvariant_cast<QBrush>(value));
         
     return opt;
-	}
+    }
 
 QRect ListBoxItemDelegate::textRectangle( const int width, const QFont &font, const QString &text) const
-	{
- 	SWT_LOG_FUNC_CALL();
+    {
+    SWT_LOG_FUNC_CALL();
     QTextOption textOption;
     textOption.setWrapMode(QTextOption::WordWrap);
     textLayout.setTextOption( textOption );
@@ -1415,83 +1415,83 @@
     QString replaceText = text;
     const QChar nl = QLatin1Char('\n');
     for (int i = 0; i < text.count(); ++i)
-    	{
+        {
         if (replaceText.at(i) == nl)
             replaceText[i] = QChar::LineSeparator;
-    	}
+        }
     textLayout.setText( replaceText );
     
     qreal height = 0;
     qreal widthUsed = 0;
     textLayout.beginLayout();
     while (true) 
-    	{
+        {
         QTextLine line = textLayout.createLine();
         if  ( !line.isValid() )
-        	{
+            {
             break;
-        	}
+            }
         line.setLineWidth( width );
         line.setPosition( QPointF( 0, height ) );
         height += line.height();
         widthUsed = qMax( widthUsed, line.naturalTextWidth() );
-    	}
+        }
     textLayout.endLayout();
     QSize size =  QSizeF(widthUsed, height).toSize();
     
     const int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
     return QRect(0, 0, size.width() + 2 * textMargin, size.height());
-	}
+    }
 
 int ListBoxItemDelegate::margin( const QStyleOptionViewItem &option ) const
-	{
-	const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const QStyleOptionViewItemV3 *>(&option);
-	const QWidget* widget = v3 ? v3->widget : NULL;
+    {
+    const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const QStyleOptionViewItemV3 *>(&option);
+    const QWidget* widget = v3 ? v3->widget : NULL;
     QStyle* style = widget ? widget->style() : QApplication::style();
-	return style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1;
-	}
+    return style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1;
+    }
 
 void ListBoxItemDelegate::drawImages( QPainter* painter, const QStyleOptionViewItem &option, 
-	const QRect imageRect, const QList<QPixmap>& images, const int* imageWidths, const int imageCount ) const
-	{
-	SWT_LOG_FUNC_CALL();
-	SWT_LOG_DATA_4( "Heading image rect, row=%d: size=(%d, %d); topleft=(%d, %d)", imageRect.width(), imageRect.height(), imageRect.left(), imageRect.top() );
-	const int imageMargin = margin(option);
-	const int top = imageRect.top();
-	const int height = imageRect.height();
-	int left = imageRect.left();
-	int right = left;
-	QRect rect;
-	if( option.direction == Qt::RightToLeft )
-		{
-		right = imageRect.right();
-		left=right;
-		for( int i = 0; i < imageCount; i++)   
-			{
-			left -= imageWidths[i];
-			rect = QRect( left, top, right - left, height );
-			if( !rect.isValid() )break;
-	   		rect = QStyle::alignedRect( option.direction, option.decorationAlignment, images[i].size(), rect );
-		    drawDecoration( painter, option, rect, images[i] );
-			SWT_LOG_DATA_5("Image No.%d, size=(%d, %d); topleft=(%d, %d)", i, right - left, height, left, top );
-			right = left - imageMargin;
-			left = right;
-			}
-		}
-	else
-		{
-		for( int i = 0; i < imageCount; i++)   
-			{
-			right += imageWidths[i];
-			rect = QRect( left, top, right - left, height );
-			if( !rect.isValid() )break;
-	   		rect = QStyle::alignedRect( option.direction, option.decorationAlignment, images[i].size(), rect );
-		    drawDecoration( painter, option, rect, images[i] );
-			SWT_LOG_DATA_5("Image No.%d, size=(%d, %d); topleft=(%d, %d)", i, right - left, height, left, top );
-			left = right + imageMargin;
-			right = left;
-			}
-		}	
-	}
+    const QRect imageRect, const QList<QPixmap>& images, const int* imageWidths, const int imageCount ) const
+    {
+    SWT_LOG_FUNC_CALL();
+    SWT_LOG_DATA_4( "Heading image rect, row=%d: size=(%d, %d); topleft=(%d, %d)", imageRect.width(), imageRect.height(), imageRect.left(), imageRect.top() );
+    const int imageMargin = margin(option);
+    const int top = imageRect.top();
+    const int height = imageRect.height();
+    int left = imageRect.left();
+    int right = left;
+    QRect rect;
+    if( option.direction == Qt::RightToLeft )
+        {
+        right = imageRect.right();
+        left=right;
+        for( int i = 0; i < imageCount; i++)   
+            {
+            left -= imageWidths[i];
+            rect = QRect( left, top, right - left, height );
+            if( !rect.isValid() )break;
+            rect = QStyle::alignedRect( option.direction, option.decorationAlignment, images[i].size(), rect );
+            drawDecoration( painter, option, rect, images[i] );
+            SWT_LOG_DATA_5("Image No.%d, size=(%d, %d); topleft=(%d, %d)", i, right - left, height, left, top );
+            right = left - imageMargin;
+            left = right;
+            }
+        }
+    else
+        {
+        for( int i = 0; i < imageCount; i++)   
+            {
+            right += imageWidths[i];
+            rect = QRect( left, top, right - left, height );
+            if( !rect.isValid() )break;
+            rect = QStyle::alignedRect( option.direction, option.decorationAlignment, images[i].size(), rect );
+            drawDecoration( painter, option, rect, images[i] );
+            SWT_LOG_DATA_5("Image No.%d, size=(%d, %d); topleft=(%d, %d)", i, right - left, height, left, top );
+            left = right + imageMargin;
+            right = left;
+            }
+        }   
+    }
 
 
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/listdatamodel.h	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/listdatamodel.h	Fri Oct 15 12:29:39 2010 +0300
@@ -24,46 +24,46 @@
 class QListView;
  
 namespace Java { namespace eSWT {
-	
+    
  
 class ListItem 
- 	{
+    {
 public:
-	ListItem( const QString& aText );
-	virtual ~ListItem();
-	const QString& text() const;
-	virtual const QPixmap* image() const;
-	void setText(const QString& string);
-	Qt::CheckState checkState() const;
-	void setCheckState( Qt::CheckState state );	
-	
+    ListItem( const QString& aText );
+    virtual ~ListItem();
+    const QString& text() const;
+    virtual const QPixmap* image() const;
+    void setText(const QString& string);
+    Qt::CheckState checkState() const;
+    void setCheckState( Qt::CheckState state ); 
+    
 protected:
-	Qt::CheckState state;
-	QString txt;
- 	};
+    Qt::CheckState state;
+    QString txt;
+    };
 
 class ListBoxItem : public ListItem
-	{
+    {
 public:
-	ListBoxItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-		const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount );
-	~ListBoxItem();
-	const QString& headingText() const;
-	const QList<QPixmap>& detailImages() const ;
-	const QList<QPixmap>& headingImages() const;
-	int detailImageCount() const;
-	int headingImageCount() const;
-	void setContentsToNull();
-	
-	
+    ListBoxItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+        const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount );
+    ~ListBoxItem();
+    const QString& headingText() const;
+    const QList<QPixmap>& detailImages() const ;
+    const QList<QPixmap>& headingImages() const;
+    int detailImageCount() const;
+    int headingImageCount() const;
+    void setContentsToNull();
+    
+    
 private:
-	QString headingTxt;
-	QList<QPixmap> detailImgs;
-	QList<QPixmap> headingImgs;
-	};	
+    QString headingTxt;
+    QList<QPixmap> detailImgs;
+    QList<QPixmap> headingImgs;
+    };  
 
 class ListModel : public QAbstractListModel
-	{
+    {
 public:
 
      ListModel( int type, int style, QListView *parent );
@@ -71,245 +71,245 @@
       
      
     /** 
-	 * from QAbstractListModel
-	 */
-	int rowCount(const QModelIndex& parent) const;
-   	QVariant data(const QModelIndex& index, int role) const;
-	Qt::ItemFlags flags ( const QModelIndex& index ) const;
+     * from QAbstractListModel
+     */
+    int rowCount(const QModelIndex& parent) const;
+    QVariant data(const QModelIndex& index, int role) const;
+    Qt::ItemFlags flags ( const QModelIndex& index ) const;
  
- 	/**
- 	 * called by JNI, these calls are delegated to protected methods from QAbstractListModel
- 	 */
- 	void beginInsertRows( const QModelIndex& parent, int first, int last );
-	void endInsertRows(); 
-	void beginRemoveRows( const QModelIndex& parent, int first, int last );
-	void endRemoveRows(); 
-	void emitLayoutAboutToBeChanged();
-	void emitLayoutChanged();
+    /**
+     * called by JNI, these calls are delegated to protected methods from QAbstractListModel
+     */
+    void beginInsertRows( const QModelIndex& parent, int first, int last );
+    void endInsertRows(); 
+    void beginRemoveRows( const QModelIndex& parent, int first, int last );
+    void endRemoveRows(); 
+    void emitLayoutAboutToBeChanged();
+    void emitLayoutChanged();
 
- 	/**
- 	 * called by JNI
- 	 */
+    /**
+     * called by JNI
+     */
     static ListModel* createDataModel( int type, int style, QListView *parent );
-	const QString& itemString( const int row ) const;
-	jobjectArray itemStrings( JNIEnv* aJniEnv );
-	int indexOf( const QString& string, const int start ) const;
-	int insertPosition(const QString& string, const bool ascent = true );
-	void setCheckState( const QItemSelection& selection, Qt::CheckState state );
-	void remove( const int row );
-	void appendItem( const QString& string );
-	void appendItem( const QString& string, const QPixmap* pixmap );
-	void insertItem( const int row, const QString& string );
-	void insertItem( const int row, const QString& string, const QPixmap* pixmap );
-	virtual void appendItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-		const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount );
-	virtual int itemHeight();
-	virtual void clearList();
-	virtual void setItemContentsToNull( const int row );
-	
- 	/**
- 	 * called by other native classes
- 	 */
-	int style() const;
-	
+    const QString& itemString( const int row ) const;
+    jobjectArray itemStrings( JNIEnv* aJniEnv );
+    int indexOf( const QString& string, const int start ) const;
+    int insertPosition(const QString& string, const bool ascent = true );
+    void setCheckState( const QItemSelection& selection, Qt::CheckState state );
+    void remove( const int row );
+    void appendItem( const QString& string );
+    void appendItem( const QString& string, const QPixmap* pixmap );
+    void insertItem( const int row, const QString& string );
+    void insertItem( const int row, const QString& string, const QPixmap* pixmap );
+    virtual void appendItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+        const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount );
+    virtual int itemHeight();
+    virtual void clearList();
+    virtual void setItemContentsToNull( const int row );
+    
+    /**
+     * called by other native classes
+     */
+    int style() const;
+    
 protected:
- 	virtual ListItem* createItem( const QString& string );
- 	virtual ListItem* createItem( const QString& string, const QPixmap* pixmap );
-	virtual ListItem* createItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-		const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount );
+    virtual ListItem* createItem( const QString& string );
+    virtual ListItem* createItem( const QString& string, const QPixmap* pixmap );
+    virtual ListItem* createItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+        const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount );
 
 protected:
-	const int listType;
-	const int layoutStyle;
- 	/**
- 	 * data body
- 	 */
-	QList<ListItem*> list;
-	};	
+    const int listType;
+    const int layoutStyle;
+    /**
+     * data body
+     */
+    QList<ListItem*> list;
+    };  
 
 
 class ListBoxModel : public ListModel
-	{
+    {
 public:
-	ListBoxModel( int type, int style, QListView *parent );
-	~ListBoxModel();
-	
- 	/**
- 	 * from ListModel
- 	 */
-	void clearList();
-	void appendItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-		const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount );
+    ListBoxModel( int type, int style, QListView *parent );
+    ~ListBoxModel();
+    
+    /**
+     * from ListModel
+     */
+    void clearList();
+    void appendItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+        const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount );
 
- 	/**
- 	 * Below 5 methods provide item data
-  	 */
-	const QString& headingText(const int row) const;
-	int detailImageCount( const int row ) const;
-	int headingImageCount( const int row ) const;	
-	const QList<QPixmap>& detailImages(const int row ) const;
-	const QList<QPixmap>& headingImages( const int row ) const;
-		
- 	/**
- 	 * called by ListBoxDelegate to save cached layout data to ListModel
- 	 * so that the ListBoxDelegate does not have to compute layout data from scratch
- 	 * whenever drawing a list item.
- 	 */
-	void updateLayoutData( const int row, const int rowHeight, const QPoint detailTxtSize, 
-		const QPoint headingTxtSize, const int detailImgWidth, const int headingImgWidth ) const;
-	
- 	/**
- 	 * Below 10 methods provide cached layout data 
-  	 */
-	const int& detailImageWidth(const int index ) const;
-	const int& headingImageWidth(const int index ) const;
-	QPoint detailTextSize() const;
-	QPoint headingTextSize() const;
-	int detailImageCount() const;
-	int headingImageCount() const;
-	QPoint detailImageSize(const int row) const;
-	QPoint headingImageSize(const int row) const;
-	int rowWithMaxDetailTextSize() const;
-	int rowWithMaxHeadingTextSize() const;
-	void setItemContentsToNull( const int row );
-	
-protected:	
- 	/**
- 	 * from ListModel
-  	 */
-	ListItem* createItem(const QString& aDetailText, const QPixmap** aDetailImages, const int aDetailImageCount,  
-		const QString& aHeadingText, const QPixmap** aHeadingImages, const int aHeadingImageCount );
+    /**
+     * Below 5 methods provide item data
+     */
+    const QString& headingText(const int row) const;
+    int detailImageCount( const int row ) const;
+    int headingImageCount( const int row ) const;   
+    const QList<QPixmap>& detailImages(const int row ) const;
+    const QList<QPixmap>& headingImages( const int row ) const;
+        
+    /**
+     * called by ListBoxDelegate to save cached layout data to ListModel
+     * so that the ListBoxDelegate does not have to compute layout data from scratch
+     * whenever drawing a list item.
+     */
+    void updateLayoutData( const int row, const int rowHeight, const QPoint detailTxtSize, 
+        const QPoint headingTxtSize, const int detailImgWidth, const int headingImgWidth ) const;
+    
+    /**
+     * Below 10 methods provide cached layout data 
+     */
+    const int& detailImageWidth(const int index ) const;
+    const int& headingImageWidth(const int index ) const;
+    QPoint detailTextSize() const;
+    QPoint headingTextSize() const;
+    int detailImageCount() const;
+    int headingImageCount() const;
+    QPoint detailImageSize(const int row) const;
+    QPoint headingImageSize(const int row) const;
+    int rowWithMaxDetailTextSize() const;
+    int rowWithMaxHeadingTextSize() const;
+    void setItemContentsToNull( const int row );
+    
+protected:  
+    /**
+     * from ListModel
+     */
+    ListItem* createItem(const QString& aDetailText, const QPixmap* aDetailImages, const int aDetailImageCount,  
+        const QString& aHeadingText, const QPixmap* aHeadingImages, const int aHeadingImageCount );
 private:
- 	/**
- 	 * layout data
-  	 */
-  	 
- 	/**
- 	 * holds the index which item has the largest detail text size
-  	 */
-	int detailTxtIndex;
-	
- 	/**
- 	 * holds the index which item has the largest heading text size
-  	 */
-	int headingTxtIndex;
-	
- 	/**
- 	 * holds the largest  detail text size
-  	 */
-	mutable QPoint detailTxtSize;
-	
- 	/**
- 	 * holds the largest  heading text size
-  	 */
-	mutable QPoint headingTxtSize;
-	
- 	/**
- 	 * holds the amount of columns for detail images
-  	 */
-	int detailImgCount;
-	
- 	/**
- 	 * holds the amount of columns for heading images
-  	 */
-	int headingImgCount;
-	
- 	/**
- 	 * holds maximum height of images 
-  	 */
-	int imgHeight;
-	
- 	/**
- 	 * holds widths for every detail image columns 
-  	 */
-	int* detailImgWidths;
-	
- 	/**
- 	 * holds widths for every heading image columns 
-  	 */
-	int* headingImgWidths;
-	
- 	/**
- 	 * holds heights for every rows
-  	 */
-	mutable int* rowHeights;
-	
- 	/**
- 	 * holds entire width for all of detail images.
-  	 */
-	mutable int detailImgWidth;
-	
- 	/**
- 	 * holds entire width for all of heading images.
-  	 */
-	mutable int headingImgWidth;
-	};
+    /**
+     * layout data
+     */
+     
+    /**
+     * holds the index which item has the largest detail text size
+     */
+    int detailTxtIndex;
+    
+    /**
+     * holds the index which item has the largest heading text size
+     */
+    int headingTxtIndex;
+    
+    /**
+     * holds the largest  detail text size
+     */
+    mutable QPoint detailTxtSize;
+    
+    /**
+     * holds the largest  heading text size
+     */
+    mutable QPoint headingTxtSize;
+    
+    /**
+     * holds the amount of columns for detail images
+     */
+    int detailImgCount;
+    
+    /**
+     * holds the amount of columns for heading images
+     */
+    int headingImgCount;
+    
+    /**
+     * holds maximum height of images 
+     */
+    int imgHeight;
+    
+    /**
+     * holds widths for every detail image columns 
+     */
+    int* detailImgWidths;
+    
+    /**
+     * holds widths for every heading image columns 
+     */
+    int* headingImgWidths;
+    
+    /**
+     * holds heights for every rows
+     */
+    mutable int* rowHeights;
+    
+    /**
+     * holds entire width for all of detail images.
+     */
+    mutable int detailImgWidth;
+    
+    /**
+     * holds entire width for all of heading images.
+     */
+    mutable int headingImgWidth;
+    };
 
  
  class ListBoxItemDelegate : public QItemDelegate
-	{
-	Q_OBJECT
+    {
+    Q_OBJECT
 public:
-	ListBoxItemDelegate( QObject* parent );
-	
-	// from QItemDelegate
-	void paint(QPainter * painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;	
+    ListBoxItemDelegate( QObject* parent );
+    
+    // from QItemDelegate
+    void paint(QPainter * painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;    
     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
     
     // called from JNI
-	void setHeadingFont( QFont* font );
+    void setHeadingFont( QFont* font );
 
 private:
 
- 	/**
- 	 * compute sizes of checkbox, detailtext, headingtext, detailImage and  headingImage.
-  	 */
-	void computeSizes( const QModelIndex& index, const QStyleOptionViewItem& option, QSize* checkSize, 
-	QSize *headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize) const;
-	
- 	/**
- 	 * add margins to checkbox, detailtext, headingtext, detailImage and  headingImage.
-  	 */
-	void addMargins( const QStyleOptionViewItem &option, QSize* checkSize, 
-		QSize* headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize ) const;
-		
-	/**	
-	 * compute item entire size	for the item
-	 */
-	QSize computeSize(  const QStyleOptionViewItem &option, const QSize& check, const QSize& headingImage, 
-		const QSize& detailImage, const QSize& headingText, const QSize& detailText ) const;
-		
-	/**	
-	 * layout checkbox, detailtext, headingtext, detailImage and headingImage within a given rectangle
-	 * and adjust sizes and positions according to alignments from option	
-	 */
-	void layoutRects( const QStyleOptionViewItem &option, QRect* check, QRect *headingImage, 
-		QRect* detailImage, QRect* headingText, QRect* detailText, bool hint ) const;
-	
-	/**	
-	 * layout checkbox, detailtext, headingtext, detailImage and  headingImage within a given rectangle
-	 */
-	void doLayout( const QStyleOptionViewItem &option, QRect* checkRect, QRect* headingImageRect,
-		QRect* detailImageRect, QRect* headingTextRect, QRect* detailTextRect ) const;
-    	QStyleOptionViewItem setOptions(const QModelIndex &index, const QStyleOptionViewItem &option) const;
+    /**
+     * compute sizes of checkbox, detailtext, headingtext, detailImage and  headingImage.
+     */
+    void computeSizes( const QModelIndex& index, const QStyleOptionViewItem& option, QSize* checkSize, 
+    QSize *headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize) const;
     
-	QRect textRectangle(const int width, const QFont &font, const QString &text) const;
-	
-	int margin( const QStyleOptionViewItem &option ) const;
+    /**
+     * add margins to checkbox, detailtext, headingtext, detailImage and  headingImage.
+     */
+    void addMargins( const QStyleOptionViewItem &option, QSize* checkSize, 
+        QSize* headingImageSize, QSize* detailImageSize, QSize* headingTextSize, QSize* detailTextSize ) const;
+        
+    /** 
+     * compute item entire size for the item
+     */
+    QSize computeSize(  const QStyleOptionViewItem &option, const QSize& check, const QSize& headingImage, 
+        const QSize& detailImage, const QSize& headingText, const QSize& detailText ) const;
+        
+    /** 
+     * layout checkbox, detailtext, headingtext, detailImage and headingImage within a given rectangle
+     * and adjust sizes and positions according to alignments from option   
+     */
+    void layoutRects( const QStyleOptionViewItem &option, QRect* check, QRect *headingImage, 
+        QRect* detailImage, QRect* headingText, QRect* detailText, bool hint ) const;
+    
+    /** 
+     * layout checkbox, detailtext, headingtext, detailImage and  headingImage within a given rectangle
+     */
+    void doLayout( const QStyleOptionViewItem &option, QRect* checkRect, QRect* headingImageRect,
+        QRect* detailImageRect, QRect* headingTextRect, QRect* detailTextRect ) const;
+        QStyleOptionViewItem setOptions(const QModelIndex &index, const QStyleOptionViewItem &option) const;
+    
+    QRect textRectangle(const int width, const QFont &font, const QString &text) const;
+    
+    int margin( const QStyleOptionViewItem &option ) const;
 
 private:
     void drawImages( QPainter* painter, const QStyleOptionViewItem &option, 
             const QRect imageRect, const QList<QPixmap>& images, const int* imageWidths, const int imageCount ) const;
-	
-private:	
+    
+private:    
 
-	/**	
-	 * not own
-	 */
-	const ListBoxModel* dataModel;
+    /** 
+     * not own
+     */
+    const ListBoxModel* dataModel;
     mutable QTextLayout textLayout;
     QFont* headingFont;
-	};
-	
+    };
+    
  }}
 #endif // SWT_LISTDATAMODEL_H
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/os.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/os.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -87,6 +87,9 @@
 #include <qnetworkconfiguration.h>
 #include <hbinputsettingproxy.h>
 #include <hbicon.h>
+#include <XQAiwRequest.h>
+#include <xqappmgr.h>
+#include <xqaiwdecl.h>
 #endif
 
 #include <org_eclipse_swt_internal_qt_OS.h>
@@ -104,6 +107,7 @@
 #include "swtapplication.h"
 #include "qswttabwidget.h"
 #include "autorelease.h"
+#include "graphics.h"
 
 #ifdef __SYMBIAN32__
 #include "swts60.h"
@@ -3092,7 +3096,28 @@
 }
 
 JNIEXPORT void JNICALL OS_NATIVE( QLabel_1setPixmap)
-  (JNIEnv* aJniEnv , jclass, jint aHandle, jint aImageHandle)
+  (JNIEnv* aJniEnv , jclass, jint aHandle, jint aPixmapHandle)
+    {
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        SWT_LOG_DATA_2("handle=%x pixmapHandle=%x", aHandle, aPixmapHandle );
+        HANDLE_TO_POINTER( QLabel*, label, aHandle );
+        if(aPixmapHandle == 0 )
+            {
+            label->setPixmap(QPixmap());
+            }
+        else
+            {
+            QPixmap* image = static_cast< QPixmap* >( reinterpret_cast< QPaintDevice* >( aPixmapHandle ) );
+            label->setPixmap( *image );
+            }
+        }
+    SWT_CATCH
+    }
+
+JNIEXPORT void JNICALL OS_NATIVE( QLabel_1swt_1setPixmap )
+  ( JNIEnv* aJniEnv, jclass, jint aHandle, jint aImageHandle)
     {
     SWT_TRY
         {
@@ -3105,8 +3130,8 @@
             }
         else
             {
-            QPixmap* image = static_cast< QPixmap* >( reinterpret_cast< QPaintDevice* >( aImageHandle ) );
-            label->setPixmap( *image );
+            Java::GFX::Image* image = reinterpret_cast< Java::GFX::Image* >( aImageHandle );
+            label->setPixmap( image->toPixmap() );
             }
         }
     SWT_CATCH
@@ -4535,20 +4560,6 @@
 
     }
 
-JNIEXPORT jint JNICALL OS_NATIVE( QPixmap_1swt_1paintDevice )
-  (JNIEnv* aJniEnv, jclass, jint aHandle)
-    {
-    QPaintDevice* result = NULL;
-    SWT_TRY
-        {
-        SWT_LOG_JNI_CALL();
-        SWT_LOG_DATA_1("handle=%x", aHandle);
-        result = static_cast<QPaintDevice*>( reinterpret_cast<QPixmap*>( static_cast<int>( aHandle ) ) );
-        }
-    SWT_CATCH
-    return reinterpret_cast<jint>( result );
-    }
-
 //
 // QPalette
 //
@@ -4618,17 +4629,17 @@
     }
 
 JNIEXPORT void JNICALL OS_NATIVE( QPalette_1swt_1setBrush )
-   (JNIEnv* aJniEnv , jclass, jint aHandle, jint aRole, jint aPixmap)
-    {
-    SWT_TRY
-        {
-        SWT_LOG_JNI_CALL();
-        SWT_LOG_DATA_3( "handle=%x role=%x pixmap=%x", aHandle, aRole, aPixmap );
-        QPixmap* pixmap = reinterpret_cast<QPixmap*>(aPixmap);
+   (JNIEnv* aJniEnv , jclass, jint aHandle, jint aRole, jint aCgImage)
+    {
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        SWT_LOG_DATA_3( "handle=%x role=%x cgImage=%x", aHandle, aRole, aCgImage );
+        Java::GFX::Image* image = reinterpret_cast<Java::GFX::Image*>(aCgImage);
         QPalette* palette = reinterpret_cast< QPalette* > ( aHandle );
-        if(pixmap)
-            {
-            palette->setBrush( static_cast< QPalette::ColorRole> ( aRole ), QBrush( *pixmap ) );
+        if(aCgImage)
+            {
+            palette->setBrush( static_cast< QPalette::ColorRole> ( aRole ), QBrush( image->toPixmap() ) );
             }
         else
             {
@@ -5333,7 +5344,7 @@
         jboolean isCopy;
         jint* imagesHandles = NULL;
 
-        QPixmap** detailImages = new QPixmap*[aDetailImageCount];
+        QPixmap* detailImages = new QPixmap[aDetailImageCount];
         if( !detailImages )
             {
             throw std::bad_alloc();
@@ -5348,12 +5359,12 @@
                 }
             for(int i = 0; i < aDetailImageCount; i++)
                 {
-                detailImages[i] = reinterpret_cast< QPixmap* >( imagesHandles[i] );
+                detailImages[i] = (reinterpret_cast< Java::GFX::Image* >( imagesHandles[i] ))->toPixmap();
                 }
             aJniEnv->ReleaseIntArrayElements(aDetailImageHandles, imagesHandles, JNI_ABORT);
             }
 
-        QPixmap** headingImages = new QPixmap*[aHeadingImageCount];
+        QPixmap* headingImages = new QPixmap[aHeadingImageCount];
         if( !headingImages )
             {
             delete [] detailImages; // allocated earlier
@@ -5370,16 +5381,16 @@
                 }
             for(int i = 0; i < aHeadingImageCount; i++)
                 {
-                headingImages[i] = reinterpret_cast< QPixmap* >( imagesHandles[i] );
+                headingImages[i] = (reinterpret_cast< Java::GFX::Image* >( imagesHandles[i] ))->toPixmap();
                 }
             aJniEnv->ReleaseIntArrayElements(aHeadingImageHandles, imagesHandles, JNI_ABORT);
             }
 
         ListModel* listDataModel = reinterpret_cast< ListModel* > ( aHandle );
         listDataModel->appendItem( swtApp->jniUtils().JavaStringToQString( aJniEnv, aDetailText ), 
-            const_cast<const QPixmap**>(detailImages), aDetailImageCount,
+            const_cast<const QPixmap*>(detailImages), aDetailImageCount,
             swtApp->jniUtils().JavaStringToQString( aJniEnv, aHeadingText ), 
-            const_cast<const QPixmap**>(headingImages), aHeadingImageCount );
+            const_cast<const QPixmap*>(headingImages), aHeadingImageCount );
         }
     SWT_CATCH
     }
@@ -6286,22 +6297,22 @@
 //
 //QIcon
 //
-JNIEXPORT jint JNICALL OS_NATIVE( QIcon_1new__I )
-    ( JNIEnv* aJniEnv , jclass, jint aPixmap )
+JNIEXPORT jint JNICALL OS_NATIVE( QIcon_1swt_1new )
+    ( JNIEnv* aJniEnv , jclass, jint aImageHandle )
     {
     QIcon* icon = NULL;
     SWT_TRY
         {
         SWT_LOG_JNI_CALL();
-        SWT_LOG_DATA_1("aPixmap=%x", aPixmap);
-        QPixmap* pixmap = reinterpret_cast< QPixmap* >( aPixmap );
-        icon = new QIcon( *pixmap );
+        SWT_LOG_DATA_1("image=%x", aImageHandle);
+        Java::GFX::Image* image = reinterpret_cast< Java::GFX::Image* >( aImageHandle );
+        icon = new QIcon(image->toPixmap());
         }
     SWT_CATCH
     return reinterpret_cast< jint >( static_cast< QIcon* >( icon ) );
     }
 
-JNIEXPORT jint JNICALL OS_NATIVE ( QIcon_1new__ )
+JNIEXPORT jint JNICALL OS_NATIVE ( QIcon_1new )
     (JNIEnv* aJniEnv , jclass)
     {
     QIcon* icon = NULL;
@@ -6740,23 +6751,22 @@
 //QColorDialog
 //
 JNIEXPORT jint JNICALL OS_NATIVE( QColorDialog_1getColor )
-    (JNIEnv* aJniEnv , jclass, jint aColorHandle, jint aParentHandle, jstring aDialogID, jint aLayoutDirection )
+    (JNIEnv* aJniEnv , jclass, jint aRed, jint aGreen, jint aBlue, jint aParentHandle, jstring aDialogID, jint aLayoutDirection)
     {
     QColor* color = NULL;
     SWT_TRY
         {
         SWT_LOG_JNI_CALL();
-        SWT_LOG_DATA_3("colorHandle=%x parentHandle=%x layoutDirection=%d", aColorHandle, aParentHandle, aLayoutDirection);
-        HANDLE_TO_QCOLOR( initialColor, aColorHandle );
-        HANDLE_TO_POINTER( QWidget*, parent, aParentHandle );
-        QColorDialog dialog( *initialColor, parent );
-        dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID) );
-        dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) );
+        SWT_LOG_DATA_2("parentHandle=%x layoutDirection=%d", aParentHandle, aLayoutDirection);
+        HANDLE_TO_POINTER(QWidget*, parent, aParentHandle);
+        QColorDialog dialog(QColor(aRed, aGreen, aBlue), parent);
+        dialog.setObjectName(swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID));
+        dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection));
         AutoPopExecStack stackExec(&dialog);
         int code = dialog.exec();
-        if( code == QDialog::Accepted )
-            {
-            color = new QColor( dialog.selectedColor() );
+        if (code == QDialog::Accepted)
+            {
+            color = new QColor(dialog.selectedColor());
             }
         }
     SWT_CATCH
@@ -9966,7 +9976,7 @@
 
 JNIEXPORT void JNICALL OS_NATIVE(QMessageBox_1swt_1execTimer)
    (JNIEnv* aJniEnv , jclass, jint aIcon, jstring aTitle, jstring aText,
-    jint aParent, jstring aDialogID, jint aLayoutDirection, jint aModality, jint aPixmapHandle)
+    jint aParent, jstring aDialogID, jint aLayoutDirection, jint aModality, jint aCgImageHandle)
     {
     SWT_TRY
         {
@@ -10003,7 +10013,7 @@
 
 
         SWT_LOG_JNI_CALL();
-        SWT_LOG_DATA_5("dialogID=%s, parent=%x icon=%d, pixmap=%x, modality=%d", aDialogID, aParent, aIcon, aPixmapHandle, aModality);
+        SWT_LOG_DATA_5("dialogID=%s, parent=%x icon=%d, cgImage=%x, modality=%d", aDialogID, aParent, aIcon, aCgImageHandle, aModality);
         HANDLE_TO_POINTER(QWidget*, parent, aParent);
 
         QMessageBox msgBox( static_cast<QMessageBox::Icon>(aIcon),
@@ -10018,9 +10028,15 @@
         msgBox.setWindowModality( static_cast<Qt::WindowModality>(aModality) );
         msgBox.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) );
 
-        if (aPixmapHandle) {
-            msgBox.setIconPixmap( *reinterpret_cast<QPixmap*>(aPixmapHandle) );
-        }
+        Java::GFX::Image* image = reinterpret_cast<Java::GFX::Image*>(aCgImageHandle);
+        if(image)
+            {
+            QPixmap pixmap = image->toPixmap();
+            if (!pixmap.isNull()) 
+                {
+                msgBox.setIconPixmap( pixmap );
+                }
+            }
 
         TimedMsgBoxEventFilter filter(msgBox);
         QTimer::singleShot(KTimedMessageBoxTimeout, &msgBox, SLOT(reject()));
@@ -10418,7 +10434,7 @@
         QFileDialog dialog( parent,
             aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(),
             aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(),
-            aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(0 ) );
+            aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(static_cast<const char*>(0)) );
         dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) );
         dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) );
         dialog.setFileMode(QFileDialog::ExistingFile);
@@ -10452,7 +10468,7 @@
         QFileDialog dialog( parent,
             aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(),
             aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(),
-            aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(0 ) );
+            aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(static_cast<const char*>(0)) );
         dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) );
         dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) );
         dialog.setFileMode(QFileDialog::ExistingFiles);
@@ -10486,7 +10502,7 @@
         QFileDialog dialog( parent,
             aTitle != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aTitle) : QString(),
             aDirectory != NULL ?swtApp->jniUtils().JavaStringToQString(aJniEnv, aDirectory) : QString(),
-            aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(0 ) );
+            aFilter != NULL ? swtApp->jniUtils().JavaStringToQString(aJniEnv, aFilter) : QString(static_cast<const char*>(0)) );
         dialog.setObjectName( swtApp->jniUtils().JavaStringToQString(aJniEnv, aDialogID ) );
         dialog.setLayoutDirection( static_cast<Qt::LayoutDirection>(aLayoutDirection) );
         dialog.setAcceptMode( static_cast<QFileDialog::AcceptMode>(QFileDialog::AcceptSave) );
@@ -11274,19 +11290,6 @@
     SWT_CATCH
     }
 
-JNIEXPORT jint JNICALL OS_NATIVE( QImage_1swt_1paintDevice )
-  (JNIEnv* aJniEnv, jclass, jint aHandle)
-    {
-    QPaintDevice* result = NULL;
-    SWT_TRY
-        {
-        SWT_LOG_JNI_CALL();
-        SWT_LOG_DATA_1("handle=%x", aHandle);
-        result = static_cast<QPaintDevice*>( reinterpret_cast<QImage*>( static_cast<int>( aHandle ) ) );
-        }
-    SWT_CATCH
-    return reinterpret_cast<jint>( result );
-    }
 //
 // QChar
 //
@@ -11527,6 +11530,138 @@
 #endif    
     }
 
+//
+// XQApplicationManager
+//
+
+JNIEXPORT jint JNICALL OS_NATIVE( XQApplicationManager_1new )
+#ifdef __SYMBIAN32__
+(JNIEnv* aJniEnv, jclass)
+#else
+(JNIEnv* aJniEnv, jclass)
+#endif
+    {
+#ifdef __SYMBIAN32__    
+    XQApplicationManager* aiwMgr = NULL;
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        aiwMgr = new XQApplicationManager();
+        }
+    SWT_CATCH
+    return reinterpret_cast<jint>(aiwMgr);
+#else
+    return NULL;
+#endif    
+    }
+
+JNIEXPORT jint JNICALL OS_NATIVE( XQApplicationManager_1create )
+#ifdef __SYMBIAN32__
+  (JNIEnv * aJniEnv, jclass,jint aHandle, jstring aService, jstring aInterface, jstring aOperation, jboolean aSynchronous)
+#else
+(JNIEnv *, jclass, jint, jstring, jstring, jstring, jboolean)
+#endif
+    {
+#ifdef __SYMBIAN32__
+    XQAiwRequest* request = NULL;
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        XQApplicationManager* aiwmgr = reinterpret_cast<XQApplicationManager*>(aHandle);
+        request = aiwmgr->create(swtApp->jniUtils().JavaStringToQString(aJniEnv, aService),
+                swtApp->jniUtils().JavaStringToQString(aJniEnv, aInterface), 
+                swtApp->jniUtils().JavaStringToQString(aJniEnv, aOperation), 
+                aSynchronous  == JNI_TRUE ? true : false);
+        }
+    SWT_CATCH
+    return reinterpret_cast<jint>(request);
+#else
+return NULL;
+#endif
+    }
+
+//
+// XQAiwRequest
+//
+JNIEXPORT void JNICALL OS_NATIVE( XQAiwRequest_1setArguments )
+#ifdef __SYMBIAN32__
+(JNIEnv* aJniEnv, jclass, jint aHandle, jstring aNumber)
+#else
+(JNIEnv* aJniEnv, jclass, jint, jstring)
+#endif
+    {
+#ifdef __SYMBIAN32__    
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        SWT_LOG_DATA_1( "handle=%x", aHandle );
+        XQAiwRequest* request = reinterpret_cast<XQAiwRequest*>(aHandle);
+        if (request)
+            {
+            QList<QVariant> args;
+            args << swtApp->jniUtils().JavaStringToQString(aJniEnv,
+                    aNumber);
+            request->setArguments(args);
+            }
+        }
+    SWT_CATCH
+#endif    
+    }
+
+JNIEXPORT void JNICALL OS_NATIVE( XQAiwRequest_1swtDialer_1setArguments )
+#ifdef __SYMBIAN32__
+(JNIEnv* aJniEnv, jclass, jint aHandle, jstring aNumber)
+#else
+(JNIEnv* aJniEnv, jclass, jint, jstring)
+#endif
+    {
+#ifdef __SYMBIAN32__    
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        SWT_LOG_DATA_1( "handle=%x", aHandle );
+        XQAiwRequest* request = reinterpret_cast<XQAiwRequest*>(aHandle);
+        if (request)
+            {
+            QList<QVariant> args;
+            QVariantMap map;
+            map.insert(XQLOGS_VIEW_INDEX, QVariant(int(XQService::LogsViewAll)));
+            map.insert(XQLOGS_SHOW_DIALPAD, QVariant(true));
+            map.insert(XQLOGS_DIALPAD_TEXT, QVariant(swtApp->jniUtils().JavaStringToQString(aJniEnv,
+                    aNumber)));
+            args.append(QVariant(map));
+            request->setArguments(args);
+            }
+        }
+    SWT_CATCH
+#endif    
+    }
+
+JNIEXPORT jboolean JNICALL OS_NATIVE( XQAiwRequest_1send )
+#ifdef __SYMBIAN32__
+(JNIEnv* aJniEnv, jclass, jint aHandle)
+#else
+(JNIEnv* aJniEnv, jclass, jint)
+#endif
+    {
+#ifdef __SYMBIAN32__    
+    bool result = false;
+    SWT_TRY
+        {
+        SWT_LOG_JNI_CALL();
+        SWT_LOG_DATA_1( "handle=%x", aHandle );
+        XQAiwRequest* request= reinterpret_cast<XQAiwRequest*>(aHandle);
+        if (request)
+            {
+            result = request->send();
+            }
+        }
+    SWT_CATCH
+    return result ? JNI_TRUE : JNI_FALSE;
+#else
+    return JNI_FALSE;
+#endif    
+    }
 
 //
 // CntServicesContactList
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swts60.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/swts60.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -217,7 +217,14 @@
         {
         SwtTlsData* data = reinterpret_cast<SwtTlsData*>(Dll::Tls());
         wgn->SetAppUid(TUid::Uid(static_cast<TInt>(data->uid)));
-        TRAP_IGNORE(wgn->SetCaptionL(*buffer));
+        if (buffer != NULL)
+        {
+            TRAP_IGNORE(wgn->SetCaptionL(*buffer));
+        }
+        else
+        {
+            TRAP_IGNORE(wgn->SetCaptionL(KNullDesC));
+        }
         wgn->SetWindowGroupName(coe->RootWin());
         delete wgn;
         }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/ercp/swt/mobile/Internal_MobilePackageSupport.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/ercp/swt/mobile/Internal_MobilePackageSupport.java	Fri Oct 15 12:29:39 2010 +0300
@@ -10,6 +10,8 @@
  *******************************************************************************/
 package org.eclipse.ercp.swt.mobile;
 
+import org.eclipse.swt.widgets.Control;
+
 /**
  * <p>
  * <b>IMPORTANT:</b> This class is <em>not</em> part of the SWT public API. It
@@ -44,5 +46,11 @@
 	mobileDevice.internal_dispose();
 }
 
+public static Control control(Command command){
+    return command.control();
+}
 
+public static int type(Command command){
+    return command.type();
 }
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/graphics/Internal_GfxPackageSupport.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/graphics/Internal_GfxPackageSupport.java	Fri Oct 15 12:29:39 2010 +0300
@@ -46,10 +46,6 @@
     return i.getImageHandle();
 }
 
-public static int getPixmapHandle(Image i) {
-    return i.getPixmapHandle();
-}
-
 public static Image createImageWithoutSecurityCheck(Device device,
         String filename) {
     return Image.createImageWithoutSecurityCheck(device, filename);
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandArranger.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandArranger.java	Fri Oct 15 12:29:39 2010 +0300
@@ -11,6 +11,7 @@
 package org.eclipse.swt.internal.qt;
 
 import org.eclipse.ercp.swt.mobile.Command;
+import org.eclipse.ercp.swt.mobile.Internal_MobilePackageSupport;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Decorations;
 import org.eclipse.swt.widgets.Display;
@@ -31,17 +32,19 @@
  * @see CommandCollection
  * @see CommandPresentationStrategy
  */
-public class CommandArranger {
+public class CommandArranger
+{
 
 /**
- * A helper for keeping an ordered list of {@link Command}s in the current focus
- * context. The Commands are ordered according to their proximity to the
- * currently focused control. The ordered list starts with Commands from the
- * currently focused Control if any and ends with the active Shell and includes
- * all the Commands in between. If a Control has more than one Command they are
- * ordered among themselves according to creation order.
+ * A helper for keeping an ordered list of {@link Command}s in the current
+ * focus context. The Commands are ordered according to their proximity to
+ * the currently focused control. The ordered list starts with Commands from
+ * the currently focused Control if any and ends with the active Shell and
+ * includes all the Commands in between. If a Control has more than one
+ * Command they are ordered among themselves according to creation order.
  */
-public class CommandCollection {
+public class CommandCollection
+{
 
 private Command[] fCommands;
 
@@ -50,8 +53,8 @@
 }
 
 /**
- * Adds the command to the collection. Warning: This does not make duplicate
- * control.
+ * Adds the command to the collection. Warning: This does not make
+ * duplicate control.
  * 
  * @param command
  */
@@ -70,14 +73,15 @@
     Shell activeShell = display.getActiveShell();
     Control ctrl = display.getFocusControl();
     while (ctrl != null && ctrl != activeShell) {
-        if (ctrl == command.control) {
+        if (ctrl == Internal_MobilePackageSupport.control(command)) {
             // Adding a command to focused control increment by one.
             // adding Command.internal_getCommands(ctrl).length will
             // just duplicate the count for Commands already in array.
             insertPoint++;
             break;
         }
-        insertPoint += Command.internal_getCommands(ctrl).length;
+
+        insertPoint += Internal_PackageSupport.getCommands(ctrl).length;
         ctrl = ctrl.getParent();
     }
     System.arraycopy(fCommands, 0, newList, 0, insertPoint);
@@ -145,9 +149,10 @@
 }
 
 /**
- * Retrieves the Commands of the types indicated by the commandTypes array. The
- * order of the commandTypes array has no significance. Passing a null parameter
- * or an empty array retrieves all the available Commands.
+ * Retrieves the Commands of the types indicated by the commandTypes
+ * array. The order of the commandTypes array has no significance.
+ * Passing a null parameter or an empty array retrieves all the
+ * available Commands.
  * 
  * @param commandTypes
  * @return Command list
@@ -161,7 +166,7 @@
     int index = 0;
     for (int i = 0; i < fCommands.length; i++) {
         for (int j = 0; j < commandTypes.length; j++) {
-            if (fCommands[i].type == commandTypes[j]) {
+            if (Internal_MobilePackageSupport.type(fCommands[i]) == commandTypes[j]) {
                 filteredCommands[index] = fCommands[i];
                 index++;
                 break;
@@ -186,7 +191,6 @@
 private Command[] positiveKeyCommands;
 private Command negativeKeyCommand;
 
-
 public CommandArranger(Display display) {
     super();
     this.display = display;
@@ -194,9 +198,10 @@
 }
 
 /**
- * Called when the application changes the QMenuBar. This method does not handle
- * the cases when the QMenuBar may change when the active top-level Shell
- * changes. Since this does not cause a menu bar change on all platforms.
+ * Called when the application changes the QMenuBar. This method does not
+ * handle the cases when the QMenuBar may change when the active top-level
+ * Shell changes. Since this does not cause a menu bar change on all
+ * platforms.
  * 
  * @see org.eclipse.swt.widgets.Decorations#setMenuBar(Menu)
  * 
@@ -227,19 +232,19 @@
     }
 
     Shell activeShell = display.getActiveShell();
-    
+
     if (activeShell == lastKnownActiveShell) {
         return;
     }
     lastKnownActiveShell = activeShell;
-    
+
     cleanPositiveCommands();
     cleanNegativeCommand();
-    
+
     currentCommands = new CommandCollection();
 
-    if (activeShell != null && Command.internal_getCommands(activeShell).length > 0) {
-        currentCommands.addCommand(Command.internal_getCommands(activeShell));
+    if (activeShell != null && Internal_PackageSupport.getCommands(activeShell).length > 0) {
+        currentCommands.addCommand(Internal_PackageSupport.getCommands(activeShell));
     }
 
     // Determine where the commands go
@@ -257,7 +262,7 @@
  * @param command
  */
 public void commandAdded(Command command) {
-    if (isInFocusContext(command.control)) {
+    if (isInFocusContext(Internal_MobilePackageSupport.control(command))) {
         currentCommands.addCommand(command);
         handleCommandListChange(command, null, currentCommands);
     }
@@ -271,7 +276,7 @@
 public void commandRemoved(Command command) {
     if (command == defaultCommand)
         defaultCommand = null;
-    if (isInFocusContext(command.control)) {
+    if (isInFocusContext(Internal_MobilePackageSupport.control(command))) {
         currentCommands.removeCommand(command);
         handleCommandListChange(null, command, currentCommands);
     }
@@ -297,7 +302,7 @@
  */
 public void setDefaultCommand(Command command) {
     defaultCommand = command;
-    if (isInFocusContext(command.control)) {
+    if (isInFocusContext(Internal_MobilePackageSupport.control(command))) {
         handleDefaultCommandChange(command);
     }
 }
@@ -312,7 +317,6 @@
     return defaultCommand;
 }
 
-
 private boolean isInFocusContext(Control control) {
     Display display = control.getDisplay();
     Shell activeShell = display.getActiveShell();
@@ -342,14 +346,16 @@
             defaultCommand = cmd;
             continue;
         }
-        if (CommandUtils.isNegativeType(cmd.type)) {
+        if (CommandUtils.isNegativeType(Internal_MobilePackageSupport.type(cmd))) {
             if (negativeKeyCommand == null || negativeKeyCommand.isDisposed()) {
                 negativeKeyCommand = cmd;
-            } else if (negativeKeyCommand.getPriority() <= cmd.getPriority()) {
+            }
+            else if (negativeKeyCommand.getPriority() <= cmd.getPriority()) {
                 positiveKeyCommands[positiveKeyIndex] = negativeKeyCommand;
                 positiveKeyIndex++;
                 negativeKeyCommand = cmd;
-            } else {
+            }
+            else {
                 positiveKeyCommands[positiveKeyIndex] = cmd;
                 positiveKeyIndex++;
             }
@@ -372,25 +378,32 @@
         useBar = true;
     }
     if (defaultCommand != null && !defaultCommand.isDisposed()
-        && !defaultCommand.control.isDisposed()) {
+        && !Internal_MobilePackageSupport.control(defaultCommand).isDisposed()) {
         if (useBar) {
-            OS.QWidget_removeAction(defaultCommand.control.getShell().internal_getOwnMenuBar(),
+            OS.QWidget_removeAction(Internal_MobilePackageSupport.control(defaultCommand)
+                .getShell().internal_getOwnMenuBar(), topHandle(defaultCommand));
+        }
+        else {
+            OS.QWidget_removeAction(
+                topHandle(Internal_MobilePackageSupport.control(defaultCommand)),
                 topHandle(defaultCommand));
-        } else {
-            OS.QWidget_removeAction(topHandle(defaultCommand.control), topHandle(defaultCommand));
         }
     }
     if (positiveKeyCommands != null) {
         for (int i = 0; i < positiveKeyCommands.length; i++) {
             Command cmd = positiveKeyCommands[i];
-            if (cmd == null || cmd.isDisposed() || cmd.control.isDisposed()) {
+            if (cmd == null || cmd.isDisposed()
+                || Internal_MobilePackageSupport.control(cmd).isDisposed()) {
                 continue;
             }
             int handle = 0;
             if (useBar) {
-                handle = cmd.control.getShell().internal_getOwnMenuBar();
-            } else {
-                handle = topHandle(positiveKeyCommands[0].control);
+                handle = Internal_MobilePackageSupport.control(cmd).getShell()
+                    .internal_getOwnMenuBar();
+            }
+            else {
+                handle = topHandle(Internal_MobilePackageSupport
+                    .control(positiveKeyCommands[0]));
             }
             OS.QWidget_removeAction(handle, topHandle(cmd));
 
@@ -400,16 +413,17 @@
 
 private void cleanNegativeCommand() {
     if (negativeKeyCommand != null && !negativeKeyCommand.isDisposed()
-        && !negativeKeyCommand.control.isDisposed()) {
-        OS.QWidget_removeAction(topHandle(negativeKeyCommand.control),
+        && !Internal_MobilePackageSupport.control(negativeKeyCommand).isDisposed()) {
+        OS.QWidget_removeAction(
+            topHandle(Internal_MobilePackageSupport.control(negativeKeyCommand)),
             topHandle(negativeKeyCommand));
     }
 }
 
 private void placeNegativeCommand() {
     if (negativeKeyCommand != null) {
-        OS.QWidget_addAction(Internal_PackageSupport.topHandle(negativeKeyCommand.control),
-            topHandle(negativeKeyCommand));
+        OS.QWidget_addAction(Internal_PackageSupport.topHandle(Internal_MobilePackageSupport
+            .control(negativeKeyCommand)), topHandle(negativeKeyCommand));
     }
 }
 
@@ -417,22 +431,27 @@
     if (defaultCommand != null) {
         int defaultCmdHandle = topHandle(defaultCommand);
         if (positiveKeyCommands != null) {
-            OS.QMenuBar_addAction(defaultCommand.control.getShell().internal_getOwnMenuBar(),
-                defaultCmdHandle);
-        } else {
-            OS.QWidget_addAction(Internal_PackageSupport.topHandle(defaultCommand.control),
+            OS.QMenuBar_addAction(Internal_MobilePackageSupport.control(defaultCommand)
+                .getShell().internal_getOwnMenuBar(), defaultCmdHandle);
+        }
+        else {
+            OS.QWidget_addAction(Internal_PackageSupport
+                .topHandle(Internal_MobilePackageSupport.control(defaultCommand)),
                 defaultCmdHandle);
         }
     }
     if (positiveKeyCommands != null) {
         if (positiveKeyCommands.length == 1 && defaultCommand == null) {
-            OS.QWidget_addAction(Internal_PackageSupport.topHandle(positiveKeyCommands[0].control),
+            OS.QWidget_addAction(Internal_PackageSupport
+                .topHandle(Internal_MobilePackageSupport.control(positiveKeyCommands[0])),
                 topHandle(positiveKeyCommands[0]));
-        } else {
+        }
+        else {
             CommandUtils.sort(positiveKeyCommands);
             for (int i = 0; i < positiveKeyCommands.length; i++) {
-                OS.QMenuBar_addAction(positiveKeyCommands[i].control.getShell()
-                    .internal_getOwnMenuBar(), topHandle(positiveKeyCommands[i]));
+                OS.QMenuBar_addAction(
+                    Internal_MobilePackageSupport.control(positiveKeyCommands[i]).getShell()
+                        .internal_getOwnMenuBar(), topHandle(positiveKeyCommands[i]));
             }
         }
     }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/OS.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/OS.java	Fri Oct 15 12:29:39 2010 +0300
@@ -869,7 +869,8 @@
     public static final native void QLabel_setText( int handle, String text );
     public static final native void QLabel_setAlignment ( int handle, int alignment );
     public static final native void QLabel_setWordWrap ( int handle, boolean wrap );
-    public static final native void QLabel_setPixmap ( int handle, int imageHandle );
+    public static final native void QLabel_setPixmap ( int handle, int pixmapHandle );
+    public static final native void QLabel_swt_setPixmap ( int handle, int imageHandle );
     public static final native int QLabel_new();
     public static final native void QLabel_setBuddy(int handle, int buddy);
     public static final native void QLabel_setTextInteractionFlags(int handle, int flags);
@@ -989,7 +990,7 @@
     public static final native boolean QPixmap_load( int handle, String fileName );
     public static final native int QPixmap_new();
     public static final native void QPixmap_delete(int handle);
-    public static final native int QPixmap_swt_paintDevice(int handle);
+
 
     //
     // QPalette
@@ -998,7 +999,7 @@
     public static final native void QPalette_setColor ( int handle, int role, int red, int green, int blue );
     public static final native int[] QPalette_color ( int handle, int group, int role );
     public static final native void QPalette_delete( int handle );
-    public static final native void QPalette_swt_setBrush(int handle, int role, int pixmap);
+    public static final native void QPalette_swt_setBrush(int handle, int role, int cgImage);
     public static final native void QPalette_swt_copyBrushFromPalette(int handle, int sourceHandle, int role);
 
     //
@@ -1057,7 +1058,7 @@
     //
     // QIcon
     //
-    public static final native int QIcon_new(int pixmap);
+    public static final native int QIcon_swt_new(int cgImage);
     public static final native int QIcon_new();
     public static final native void QIcon_delete(int handle);
     public static final native int QIcon_pixmap(int handle, int w, int h);
@@ -1201,7 +1202,7 @@
     //
     // QColorDialog
     //
-    public static final native int QColorDialog_getColor(int initialColor, int parentHandle, String dialogId, int layoutDirection) ;
+    public static final native int QColorDialog_getColor(int r, int g, int b, int parentHandle, String dialogId, int layoutDirection);
 
     //
     // QTableWidget
@@ -1500,7 +1501,7 @@
     public static final native int QMessageBox_swt_exec(int icon, String title, String text,
             int buttons, int parentHandle, int modality, String dialogID, int layoutDirection);
     public static final native void QMessageBox_swt_execTimer(int aIcon, String title, String text,
-            int parentHandle, String aDialogID, int aLayoutDirection, int modality, int pixmapHandle);
+            int parentHandle, String aDialogID, int aLayoutDirection, int modality, int cgImageHandle);
 
     //
     // QInputDialog
@@ -1620,11 +1621,6 @@
     public static final native void QLocale_delete(int handle);
 
     //
-    // QImage
-    //
-    public static final native int QImage_swt_paintDevice(int handle);
-
-    //
     // QChar
     //
     public static final native int QChar_direction(char c);
@@ -1710,6 +1706,19 @@
     public static final native void XQServiceRequest_swt_setArgumentsForDial(int handle, String number, boolean asyncAnswer); 
     
     //
+    //XQApplicationManager
+    //
+    public static final native int XQApplicationManager_new();
+    public static final native int XQApplicationManager_create(int handle, String service, String Interface, String operation, boolean synchronous);
+    
+    //
+    //XQAiwRequest
+    //
+    public static final native void XQAiwRequest_setArguments(int handle, String number);
+    public static final native void XQAiwRequest_swtDialer_setArguments(int handle, String number);
+    public static final native boolean XQAiwRequest_send(int handle);
+    
+    //
     // CntServicesContactList
     //
     public static final native String[] CntServicesContactList_swt_contacts(int handle);
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Config.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Config.java	Fri Oct 15 12:29:39 2010 +0300
@@ -23,4 +23,10 @@
 	 * Default fill color for images. Used when fill color is not specified as an argument in Image constructor.
 	 */
 	static final int IMAGE_DEFAULT_FILL_COLOR = 0xffffffff;
+	
+	/**
+	 * Default type for images. Used when image type is not specified as an argument in Image constructor.
+	 * This setting is also used for ImageLoader output Images (default), if no explicit target Image type is specified.
+	 */
+	static final int IMAGE_DEFAULT_TYPE = Image.IMAGE_TYPE_QIMAGE;
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Image.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Image.java	Fri Oct 15 12:29:39 2010 +0300
@@ -111,6 +111,22 @@
      */
     public static final int FORMAT_IMG_MONO = 8;
 
+    /**
+     * Specifies native image type QImage. This type
+     * is recommended when the image is modified frequently
+     * and especially if it's pixels need to be accessed.
+     */
+    public static final int IMAGE_TYPE_QIMAGE = 0;
+    
+    /**
+     * Specifies native image type QPixmap. This type is 
+     * recommended if the image is not modified at all
+     * or rarely, i.e. optimal for immutable images.
+     */
+    public static final int IMAGE_TYPE_QPIXMAP = 1;
+    
+    
+    
     // Native image handle
     int handle;
     // Handle of native QPixmap wrapped by image
@@ -160,7 +176,8 @@
 
     /**
      * Constructs new image filled with default fill color with specified width and height.
-     *
+     * Image will have the default type defined by Config.IMAGE_DEFAULT_TYPE.
+     * 
      * @param width The width of new image
      * @param height The height of new image
      * @throws IllegalArgumetException if width or height is equal or less than zero
@@ -174,38 +191,38 @@
         }
 
         // Construct image in native side and store the handle
-        handle = OS.image_create(width, height, Config.IMAGE_DEFAULT_FILL_COLOR);     // may throw outOfMemoryError
+        handle = OS.image_create(width, height, Config.IMAGE_DEFAULT_FILL_COLOR, Config.IMAGE_DEFAULT_TYPE ); 
         // set dimensions
         updateSize();
     }
 
     /**
-     * Constructs new image with specified width, height and fill color.
-     * The RGB values passed in is interpreted with the least significant eight bits giving the blue
-     * component, the next eight more significant bits giving the green component, and the next eight
-     * bits giving the red component. The high order byte of this value, i.e. alpha, is ignored.
+     * Constructs new image with specified width, height and type. 
      *
      * @param width The width of new image
      * @param height The height of new image
-     * @param fillColor The initial fill color for the image in format #00RRGGBB.
      * @throws IllegalArgumetException if width or height is equal or less than zero
+     * @throws IllegalArgumetException if type is not either IMAGE_TYPE_QIMAGE or IMAGE_TYPE_QPIXMAP
      * @throws OutOfMemoryError if memory allocation for new image fails
      */
-    public Image(int width, int height, int fillColor) {
+    public Image(int width, int height, int type) {
         Utils.validateUiThread();
-        // check width and height
         if (width <= 0 || height <= 0) {
             throw new IllegalArgumentException("width or height is equal or less than 0");
         }
+        if((type != IMAGE_TYPE_QIMAGE) && (type != IMAGE_TYPE_QPIXMAP)) {
+        	throw new IllegalArgumentException("Invalid type");
+        }
 
         // Construct image in native side and store the handle
-        handle = OS.image_create(width, height, fillColor);     // may throw outOfMemoryError
+        handle = OS.image_create(width, height, Config.IMAGE_DEFAULT_FILL_COLOR, type);     // may throw outOfMemoryError
         // set dimensions
         updateSize();
     }
 
     /**
      * Constructs a new instance of this class based on given image.
+     * The new instance will have the same type as the original.
      *
      * @param sourceImage The image used as source
      * @throws NullPointerException if sourceImage is null
@@ -217,7 +234,22 @@
 
     /**
      * Constructs a new instance of this class based on given image.
+     * The new instance will have the type specified by the typeOfCopy.
+     *
+     * @param sourceImage The image used as source
+     * @param typeOfCopy The native type of the copy, either IMAGE_TYPE_QIMAGE or IMAGE_TYPE_QPIXMAP
+     * @throws NullPointerException if sourceImage is null
+     * @throws IllegalArgumetException if type is not either IMAGE_TYPE_QIMAGE or IMAGE_TYPE_QPIXMAP
+     * @throws OutOfMemoryError if memory allocation for new image fails
+     */
+    public Image(Image sourceImage, int typeOfCopy) {
+    	this(sourceImage, 0, 0, 0, 0, typeOfCopy);
+    }
+    
+    /**
+     * Constructs a new instance of this class based on given image.
      * If the given copy region is empty, the whole image is copied.
+     * The new instance will have the same native type as the original.
      *
      * @param sourceImage The image used as source
      * @param x The top-left x coordinate of the copy region.
@@ -229,13 +261,40 @@
     public Image(Image sourceImage, int x, int y, int width, int height) {
         // validate sourceImage
         if (sourceImage == null) {
-            throw new NullPointerException("img is null");
+            throw new NullPointerException("sourceImage is null");
         }
         createCopy(sourceImage, x, y, width, height);
     }
 
     /**
-     * Creates a new image from given ImageData
+     * Constructs a new instance of this class based on given image.
+     * If the given copy region is empty, the whole image is copied.
+     * The new instance will have the native type speficied by typeOfCopy.
+     *
+     * @param sourceImage The image used as source
+     * @param x The top-left x coordinate of the copy region.
+     * @param y The top-left y coordinate of the copy region.
+     * @param width The width of the copy region.
+     * @param height The height of the copy region.
+     * @param typeOfCopy The native type of the copy, either IMAGE_TYPE_QIMAGE or IMAGE_TYPE_QPIXMAP
+     * @throws NullPointerException if sourceImage is null
+     * @throws IllegalArgumetException if type is not either IMAGE_TYPE_QIMAGE or IMAGE_TYPE_QPIXMAP
+     */
+    public Image(Image sourceImage, int x, int y, int width, int height, int typeOfCopy) {
+        // validate sourceImage
+        if (sourceImage == null) {
+            throw new NullPointerException("sourceImage is null");
+        }
+        if((typeOfCopy != IMAGE_TYPE_QIMAGE) && (typeOfCopy != IMAGE_TYPE_QPIXMAP)) {
+        	throw new IllegalArgumentException("Invalid typeOfCopy");
+        }
+        handle = OS.image_create(sourceImage.handle, x, y, width, height, typeOfCopy);
+        updateSize();
+    }
+    
+    /**
+     * Creates a new image from given ImageData.
+     * Image will have the default type defined by Config.IMAGE_DEFAULT_TYPE.
      * @param imageData
      * @throws NullPointerException if imageData is null
      */
@@ -243,13 +302,14 @@
         if (imageData == null) {
             throw new NullPointerException("imageData is null");
         }
-        handle = OS.image_create(imageData);
+        handle = OS.image_create(imageData, Config.IMAGE_DEFAULT_TYPE);
         // set dimensions
         updateSize();
     }
 
     /**
      * Constructs a new instance of this class based on the given rgb data.
+     * Image will have the type IMAGE_TYPE_QPIXMAP.
      *
      * @param argbData a RGB data array where one pixel is specified as 0xAARRGGBB.
      * @param width The width of the image
@@ -264,8 +324,8 @@
         if(argbData == null) {
             throw new NullPointerException("argbData is null");
         }
-        // Construct an ge in native side and store the handle
-        handle = OS.image_create(argbData, width, height, hasAlpha);
+        // Construct image in native side and store the handle
+        handle = OS.image_create(argbData, width, height, hasAlpha, IMAGE_TYPE_QPIXMAP);
         // set dimensions
         updateSize();
     }
@@ -315,6 +375,15 @@
     }
 
     /**
+     * Gets the default Image native type, that is used when native type
+     * is not explicitly defined.
+     * @return The default native type, either IMAGE_TYPE_QIMAGE or IMAGE_TYPE_QPIXMAP
+     */
+    static public int getDefaultNativeType() {
+    	return Config.IMAGE_DEFAULT_TYPE;
+    }
+    
+    /**
      * Gets the format of the image.
      *
      * @return image format
@@ -401,12 +470,9 @@
         if((scanlength > 0 ? scanlength : -scanlength) < width) {
             throw new IllegalArgumentException("scanlength is less than width");
         }
-
-
         OS.image_getRGB(handle, argbData, offset, scanlength, x, y, width, height);
     }
 
-
     /**TODO: change comments
      * Copies image data to given integer array from rectangle specified
      * by x, y, width and height.
@@ -470,8 +536,6 @@
         if((scanlength > 0 ? scanlength : -scanlength) < width) {
             throw new IllegalArgumentException("scanlength is less than width");
         }
-
-
         OS.image_getRGB(handle, argbData, transparencyMask,offset, scanlength, x, y, width, height, format);
     }
 
@@ -530,8 +594,6 @@
         if((scanlength > 0 ? scanlength : -scanlength) < width) {
             throw new IllegalArgumentException("scanlength is less than width");
         }
-
-
         OS.image_getRGB(handle, argbData, offset, scanlength, x, y, width, height, format);
     }
 
@@ -540,10 +602,9 @@
      */
     public static boolean detectCollision(Image image1, int transform1, int p1x, int p1y, int r1x1, int r1y1, int r1x2, int r1y2,
                                           Image image2, int transform2, int p2x, int p2y, int r2x1, int r2y1, int r2x2, int r2y2) {
-
         return OS.image_detectCollision(
-                image1.getNativePixmapHandle(), transform1, p1x, p1y, r1x1, r1y1, r1x2, r1y2,
-                image2.getNativePixmapHandle(), transform2, p2x, p2y, r2x1, r2y1, r2x2, r2y2);
+                image1.getHandle(), transform1, p1x, p1y, r1x1, r1y1, r1x2, r1y2,
+                image2.getHandle(), transform2, p2x, p2y, r2x1, r2y1, r2x2, r2y2);
     }
 
     /**
@@ -603,32 +664,12 @@
      * Returns native side handle.
      * @return the native handle.
      */
-    public int getHandle()
-    {
+    public int getHandle() {
         checkState();
         return handle;
     }
 
     /**
-     * Returns native side QPixmap handle.
-     * @return the native QPixmap handle.
-     */
-    synchronized public int getNativePixmapHandle()
-    {
-        checkState();
-        if(pixmapHandle == 0)
-        {
-            // In the current implementation this will return
-            // pointer to the already existing QPixmap (which
-            // will be destroyed with the object), so the
-            // handle does not need to be released manually.
-            pixmapHandle = OS.image_getPixmapHandle(handle);
-        }
-        return pixmapHandle;
-    }
-
-    /**
-    /**
      * Creates <code>ImageData</code> objects
      * @return New object
      */
@@ -638,6 +679,25 @@
     }
 
     /**
+     * Gets the native type of this Image instance.
+     * @return Either Image.IMAGE_TYPE_QIMAGE or Image.IMAGE_TYPE_QPIXMAP
+     */
+    public int getNativeType() {
+    	checkState();
+    	return OS.image_getType(handle);
+    }
+    
+    /**
+     * Gets the handle of the QPaintDevice of contained 
+     * QImage or QPixmap instance.
+     * @return handle to native QPaintDevice
+     */
+    public int getQPainDeviceHandle() {
+    	checkState();
+    	return OS.image_getQPaintDeviceHandle(handle);
+    }
+    
+    /**
      * Private helper to check the state of the current instance.
      */
     private void checkState() {
@@ -654,26 +714,12 @@
         w = OS.image_getWidth(handle);
         h = OS.image_getHeight(handle);
     }
-
-    /**
-     * Contructs an instance of Image based on the given <code>imageData</code>.
-     *
-     * @param imageData Image data @see org.eclipse.swt.graphics.ImageData
-     * @return Instance of loaded image
-     * @throws IllegalArgumentException if <code>imageData</code> is null.
-     */
-    public static Image createImage(ImageData imageData) {
-        if (imageData == null) {
-            throw new IllegalArgumentException("imageData is null");
-        }
-        int imageHandle = OS.image_create(imageData);
-        return new Image(imageHandle);
-    }
     
     /**
      * Constructs new image with given native QPixmap handle.
+     * The native type if new image instance will be IMAGE_TYPE_QPIXMAP.
      * @param pixmapHandle Handle of native QPixmap.
-     * @return Instance of loaded image.
+     * @return new image instance
      */
     public static Image createImageFromPixmap(int pixmapHandle) {
         // input validation
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/ImageLoader.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/ImageLoader.java	Fri Oct 15 12:29:39 2010 +0300
@@ -46,14 +46,20 @@
      * Status of native peer
      */
     private boolean disposed;
+    
+    /**
+     * Default native type of loaded images
+     */
+    private int nativeImageType = Config.IMAGE_DEFAULT_TYPE;
 
     /**
      * Creates an instance of this class and initializes native
-     * image loader.
+     * image loader. Type of native image created is set to 
+     * the default type defined Config.IMAGE_DEFAULT_TYPE;
      */
     public ImageLoader() {
-    	Utils.validateUiThread();
-        handle = OS.imageLoader_init();
+        Utils.validateUiThread();
+        handle = OS.imageLoader_init(nativeImageType);
         if (handle == 0) {
             throw new OutOfMemoryError();
         }
@@ -61,10 +67,30 @@
     }
 
     /**
+     * Creates an instance of this class and initializes native
+     * image loader with specified target image type. 
+     * @param resultImageType The native type of image for loaded images,
+     *                        either Image.IMAGE_TYPE_QIMAGE or Image.IMAGE_TYPE_QPIXMAP.
+     */
+    public ImageLoader(int resultImageType) {
+        Utils.validateUiThread();
+        if((resultImageType != Image.IMAGE_TYPE_QIMAGE) &&
+           (resultImageType != Image.IMAGE_TYPE_QPIXMAP)) {
+            throw new IllegalArgumentException("Illegal resultImageType");
+        }
+        nativeImageType = resultImageType;
+        handle = OS.imageLoader_init(nativeImageType);
+        if (handle == 0) {
+            throw new OutOfMemoryError();
+        }
+        disposed = false;
+    }
+    
+    /**
      * Disposes native image, i.e. frees resources.
      */
     public void dispose() {
-    	Utils.validateUiThread();
+        Utils.validateUiThread();
         if (disposed) {
             return;
         } else {
@@ -75,6 +101,14 @@
     }
 
     /**
+     * Returns current result native image type.
+     * @return Native image type, either Image.IMAGE_TYPE_QIMAGE or Image.IMAGE_TYPE_QPIXMAP
+     */
+    public int getResultImageType() {
+        return nativeImageType;
+    }
+    
+    /**
      * Gets the status of this image loader.
      *
      * @return True if this instance has been already disposed otherwise false
@@ -114,14 +148,14 @@
      * Loads image from given byte array.
      *
      * @param data The array containing image data
-     * @param offset The offset from beginnig of data where image data starts
+     * @param offset The offset from beginning of data where image data starts
      * @param length The length of data beginning form offset
      * @return Instance of loaded image
      * @throws NullPointerException if data is null
      * @throws IllegalArgumentException if offset is less than 0
      * @throws IllegalArgumentException if length is equal or less than 0
      * @throws ArrayIndexOutOfBoundsException if offset and length define an invalid range
-     * @throws IOException if image cannot be loaded or it is unsupported format
+     * @throws IllegalArgumentException if image cannot be loaded or it is unsupported format
      * @throws OutOfMemoryError if native buffer allocation fails
      */
     public Image loadImage(byte[] data, int offset, int length) throws IOException {
@@ -147,14 +181,14 @@
         return new Image(OS.imageLoader_endStream(handle));
     }
 
-	/**
-	 * Loads image from file directly using the native APIs. Note that Java
-	 * security checks are not done.
-	 *
-	 * @param filename The filename to pass to the native APIs.
-	 * @return Image The loaded image.
-	 * @throws IOException
-	 */
+    /**
+     * Loads image from file directly using the native APIs. Note that Java
+     * security checks are not done.
+     *
+     * @param filename The filename to pass to the native APIs.
+     * @return Image The loaded image.
+     * @throws IOException
+     */
     public Image nativelyLoadImageFromFileNoSecurity(String filename) throws IOException {
         checkState();
         if (filename == null) {
@@ -164,12 +198,12 @@
     }
 
     /**
-     * Contructs an instance of Image by reading image data from given InputStream.
+     * Constructs an instance of Image by reading image data from given InputStream.
      *
      * @param is The InputStream from where to read the image data from
      * @return Instance of loaded image
      * @throws NullPointerException if InputStream is is null
-     * @throws IOException if image cannot be loaded
+     * @throws IllegalArgumentException if image cannot be loaded
      * @throws OutOfMemoryError if allocation of native buffer of image creation fails
      * @throws IllegalStateException if image data is invalid
      * @throws IllegalArgumentException if image format is not supported
@@ -227,10 +261,28 @@
      * @param height The height to scale to
      */
     public void setLoadSize(int width, int height) {
-    	OS.imageLoader_setLoadSize(handle, width, height);
+        OS.imageLoader_setLoadSize(handle, width, height);
     }
 
     /**
+     * Sets the result image type, i.e. the native type for the images
+     * loaded. 
+     * 
+     * @param resultImageType The type of loaded image, either Image.IMAGE_TYPE_QIMAGE or 
+     *                  Image.IMAGE_TYPE_QPIXMAP 
+     * @throws IllegalArgumentException if imageType is not one of Image.
+     *                                  IMAGE_TYPE_QIMAGE or Image.IMAGE_TYPE QPIXMAP
+     */
+    public void setResultImageType(int resultImageType) {
+        if((resultImageType != Image.IMAGE_TYPE_QIMAGE) && 
+           (resultImageType != Image.IMAGE_TYPE_QPIXMAP)) {
+            throw new IllegalArgumentException("Illegal resultImageType");
+        }
+        nativeImageType = resultImageType;
+        OS.imageloader_setResultImageType(handle, nativeImageType);
+    }
+    
+    /**
      * Returns the bounds of an Image without creating an actual Image instance.
      *
      * @param is The InputStream from where to read the image data from
@@ -261,7 +313,7 @@
      * Private helper to check the state of the current instance.
      */
     private void checkState() {
-    	Utils.validateUiThread();
+        Utils.validateUiThread();
         if (disposed) {
             throw new IllegalStateException("Image loader already disposed");
         }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/OS.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/OS.java	Fri Oct 15 12:29:39 2010 +0300
@@ -79,10 +79,11 @@
     static final native void graphicsContext_restoreSettings(int handle);
 
     // Image
-    static final native int image_create(int width, int height, int fillColor); 
+    static final native int image_create(int width, int height, int fillColor, int type);
     static final native int image_create(int imageHandle, int x, int y, int width, int height);
-    static final native int image_create(ImageData imageData);
-    static final native int image_create(int[] argbData, int width, int height, boolean hasAlpha);
+    static final native int image_create(int imageHandle, int x, int y, int width, int height, int typeOfCopy);
+    static final native int image_create(ImageData imageData, int type);
+    static final native int image_create(int[] argbData, int width, int height, boolean hasAlpha, int type);
     static final native int image_create(int pixmapHandle);
     static final native int image_getFormat(int handle);
     static final native int image_getHeight(int handle);
@@ -91,9 +92,10 @@
     static final native void image_getRGB(int handle, byte[] argbData, byte[] transparencyMask, int offset, int scanlength,int x, int y, int width, int height, int format);
     static final native void image_getRGB(int handle, short[] argbData, int offset, int scanlength,int x, int y, int width, int height, int format);
     static final native ImageData image_getImageData(int imageHandle);
+    static final native int image_getType(int imageHandle);
+    static final native int image_getQPaintDeviceHandle(int imageHandle);
     static final native void image_transform(int handle, int transform);
     static final native void image_dispose(int handle);
-    static final native int image_getPixmapHandle(int handle);
     static final native boolean image_detectCollision(int image1Handle, int transform1, int p1x, int p1y, int r1x1, int r1y1, int r1x2, int r1y2,
                                                       int image2Handle, int transform2, int p2x, int p2y, int r2x1, int r2y1, int r2x2, int r2y2);
 
@@ -101,10 +103,11 @@
     static final native void imageLoader_append(int handle, int length, int offset, byte[] data);
     static final native void imageLoader_beginStream(int handle, int bufferSize);
     static final native int imageLoader_endStream(int handle);
-    static final native int imageLoader_init();
+    static final native int imageLoader_init(int resultImageType);
     static final native void imageLoader_dispose(int handle);
     static final native int imageLoader_load(int handle, String fileName);
     static final native void imageLoader_setLoadSize(int handle, int width, int height);
+    static final native void imageloader_setResultImageType(int handle, int imageType);
     static final native Point imageLoader_getImageSize(byte[] data);
     
     // FontUtils
--- a/javauis/javauis.pro	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/javauis.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -22,6 +22,7 @@
 SUBDIRS += mmapi_qt/build/javamobilemedia.pro 
 SUBDIRS += amms_qt/build/javaamms.pro 
 SUBDIRS += m3g_qt/build/javam3g.pro 
+SUBDIRS += m2g_qt/build/javam2g.pro 
 SUBDIRS += nokiauiapi_qt/build 
 BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"coreui/build/bld.inf\""  
 BLD_INF_RULES.prj_extensions += "prj_extensions" 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_qt/build.linux.j2se/emma.sh	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# This runs LCDUI MTs and takes coverage measurements.
+
+# Start Xephyr and metacity window manager inside it
+Xephyr -ac -screen 1024x768x24 -dpi 96 -br -reset -terminate -host-cursor 2> /dev/null :2 &
+sleep 3
+DISPLAY=:2 xterm -geometry 0x0 -hold -iconic &
+DISPLAY=:2 metacity &
+DISPLAY=:2 setxkbmap fi &
+sleep 3
+
+# Once the environment is set up, run the tests
+DISPLAY=:2 java -Djava.library.path=../../eswt_qt/org.eclipse.swt.qt.linux.x86.se/release emmarun -r txt,html -ix javax.microedition*,com.nokia.mid.ui* -cp ../../eswt_qt/nokiatests/junit-3.8.1.1.jar:../../eswt_qt/org.eclipse.swt.qt.linux.x86.se/eswtqt.jar:../../eswt_qt/org.eclipse.swt.qt.linux.x86.se/eswt-qt-tests.jar:openlcdui.jar:openlcdui_tests.jar:../../eswt_qt/org.eclipse.swt/bin com.nokia.openlcdui.mt.AllTests
+
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/Font.java	Fri Oct 15 12:29:39 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009,2010 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"
@@ -30,8 +30,13 @@
  */
 public final class Font
 {
+	/*
+	 * Point size value for the Medium LCDUI fonts. All
+	 * font sizes are relative to this value;
+	 */
+    private static final int MEDIUM_FONT_POINT_SIZE = 8;
 
-    /**
+	/**
      * System font face.
      *
      * @value for FACE_SYSTEM is 0.
@@ -241,6 +246,7 @@
             font.style |= Font.STYLE_UNDERLINED;
         }
         return font;
+
     }
 
     /**
@@ -459,11 +465,11 @@
      */
     public int charsWidth(char[] c, int offset, int length)
     {
-        try 
+        try
         {
            final String string = new String(c, offset, length);
            return stringWidth(string);
-        }catch (StringIndexOutOfBoundsException ex) 
+        }catch (StringIndexOutOfBoundsException ex)
         {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -681,25 +687,18 @@
      */
     private static int mapSizeToHeight(int size)
     {
-        //retreive the system default height
-        int defHeight = getSystemFontData().getHeight();
-
-        if(size == Font.SIZE_SMALL)
-        {
-            //calculate the small size height as a ratio of system default medium size and round off the value to an integer
-            return (int)Math.floor((defHeight * (3f/4)) + 0.5f);
-        }
-        else if(size == Font.SIZE_LARGE)
-        {
-            //calculate the large height as a ratio of system default medium size and round off the value to an integer
-            return (int)Math.floor((defHeight * (4.5f/4)) + 0.5f);
-        }
-        else
-        {
-            //return the system default height for medium size which is generally 12 but 7 in symbian for qt
-            return defHeight;
-        }
-    }
+    	//maps relative to the medium font size
+    	//This is a static value on LCDUI because
+    	// Qt value was static and very small.
+    	switch(size){
+    		case Font.SIZE_SMALL:
+    			return MEDIUM_FONT_POINT_SIZE - 1;
+    		case Font.SIZE_LARGE:
+    			return MEDIUM_FONT_POINT_SIZE + 1;
+    		default:
+    			return MEDIUM_FONT_POINT_SIZE;
+    	}
+      }
 
     /**
      * Get LCDUI size from eSWT font height
@@ -709,12 +708,11 @@
      */
     private static int mapHeightToSize(int height)
     {
-        int defHeight = getSystemFontData().getHeight();
-        if(height < defHeight)
+        if(height < MEDIUM_FONT_POINT_SIZE)
         {
             return Font.SIZE_SMALL;
         }
-        else if(height > defHeight)
+        else if(height > MEDIUM_FONT_POINT_SIZE)
         {
             return Font.SIZE_LARGE;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_qt/src_j2se/com/nokia/mj/impl/fileutils/FileUtility.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,947 @@
+/*
+* 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:
+*
+*/
+
+package com.nokia.mj.impl.fileutils;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.IllegalArgumentException;
+import java.lang.SecurityException;
+import java.util.Enumeration;
+import java.util.Random;
+import java.util.Vector;
+/*
+import javax.microedition.io.Connector;
+
+import com.nokia.mj.impl.rt.support.Finalizer;
+import com.nokia.mj.impl.rt.support.Jvm;
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.utils.Tokenizer;*/
+
+/**
+ * FileUtility provides File handling APIs for internal use in OMJ.
+ *
+ * <p>
+ * <strong>Creating FileUtility</strong>
+ * <p>
+ * The pathname used to create the FileUtility object must always be abolute. An
+ * absolute pathname is complete in that no other information is required in
+ * order to locate the file that it denotes. A relative pathname, in contrast,
+ * must be interpreted in terms of information taken from some other pathname.
+ * Relative paths cannot be passed to the constructor of FileUtility.
+ * FileUtility.getCanonicalPath() can be used to resolve relative paths to
+ * absolute path.
+ * <p>
+ * File URL can also be used to create FileUtility object. The format of the
+ * input string used to access a FileUtility must follow the format of a
+ * fully-qualified, absolute path file name as described by the file URL format
+ * in IETF RFCs 1738 & 2396.
+ *
+ * <p>
+ * <strong>FileUtility Behavior</strong>
+ * <p>
+ * FileUtility can be created immeterial of whether the intended iTarget exists
+ * or not. This behavior allows the creation of new files and directories on a
+ * file system. For example, the following code snippet can be used to create a
+ * file on the file system.
+ *
+ * <pre>
+ * try
+ * {
+ *     FileUtility fileTarget = new FileUtility(&quot;/home/user1/newFile.txt&quot;);
+ *     // If no exception is thrown, URI is valid, but file may or may not exist
+ *
+ *     if (!fileTarget.exists())
+ *     {
+ *         fileTarget.createNewFile();
+ *     }
+ *
+ *     fileTarget = null;
+ * }
+ * catch (IOException ex)
+ * {
+ * }
+ * </pre>
+ *
+ * Developers should always check for the file's or directory's existence after
+ * a construction to determine if the file or directory actually exists.
+ * Similarly, files or directories can be deleted using the delete() method.
+ *
+ * <p>
+ * <strong>Streams in FileUtility</strong>
+ * <p>
+ * Input and output streams may be opened and closed multiple times on a
+ * FileUtility instance.<br/>
+ *
+ * All FileUtility instances have one underlying InputStream and one
+ * OutputStream. Opening a DataInputStream counts as opening an InputStream, and
+ * opening a DataOutputStream counts as opening an OutputStream. A FileUtility
+ * instance can have only one InputStream and one OutputStream open at any one
+ * time. Trying to open more than one InputStream or more than one OutputStream
+ * from a StreamConnection causes an IOException. Further detials can be found
+ * in Common Streams.
+ * <p>
+ * Instances of the FileUtility class are immutable; that is, once created, the
+ * pathname represented by a FileUtility object will never change.
+ *
+ */
+public final class FileUtility
+{
+    /**
+     * File name passed here should be absolute path.
+     *
+     * @param aFilePath
+     *            file/directory that FileUtility must work on.
+     */
+    public FileUtility(String aFilePath)
+    {
+    }
+
+    /**
+     * Constructs a FileUtility with given parameters. This is to be used when
+     * trying to access DRM protected content.
+     *
+     * @param aFilePath
+     *            absolute path of the file/directory.
+     * @param aDrmIntent
+     *            intent with which the user wants to open the file. The DRM
+     *            intent specified must be one of the values present in
+     *            FileDRMContentHandler
+     * @param aExecuteIntent
+     *            specifies whether to execute the intent when an InputStream is
+     *            opened on the file.
+     * @see FileDRMContentHandler
+     */
+    public FileUtility(String aFilePath, int aDrmIntent, boolean aExecuteIntent)
+    {
+    }
+
+
+    /**
+     * Creates a new empty file in the specified directory, using the given
+     * prefix and suffix strings to generate its name. If this method returns
+     * successfully then it is guaranteed that:
+     * <ol>
+     * <li>The file denoted by the returned abstract pathname did not exist
+     * before this method was invoked, and</li>
+     * <li>Neither this method nor any of its variants will return the same
+     * abstract pathname again in the current invocation of the virtual machine.
+     * </li>
+     * </ol>
+     * <p>
+     * The prefix argument must be at least three characters long. It is
+     * recommended that the prefix be a short, meaningful string such as "hjb"
+     * or "mail".<br/>
+     * The suffix argument may be null, in which case the suffix ".tmp" will be
+     * used. <br/>
+     * The directory argument should not be null and must provide a directory to
+     * which the file has to be created.
+     * <p>
+     * New file will be generated by concatenating the prefix, five or more
+     * internally-generated characters, and the suffix.
+     *
+     * @param aPrefix
+     *            The prefix string to be used in generating the file's name
+     *            must be at least three characters long
+     * @param aSuffix
+     *            The suffix string to be used in generating the file's name may
+     *            be null, in which case the suffix ".tmp" will be used
+     * @param aDirectory
+     *            The directory in which the file is to be created
+     * @return A new FileUtility instance denoting the newly created file.
+     * @throws IOException
+     *             if the file could not be created or the directory does not
+     *             exist
+     * @throws IllegalArgumentException
+     *             if the prefix is fewer than three characters or directory
+     *             parameter is null
+     * @throws SecurityException
+     *             if access was not allowed to create a file in the directory
+     *             specified
+     */
+    public static FileUtility createTempFile(String aPrefix, String aSuffix,
+            FileUtility aDirectory) throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Resolves incomplete path by prefixing the path with one of the roots of
+     * the file system.
+     * <p>
+     *
+     * <pre>
+     * Example of S60:
+     *     String resolved = FileUtility.resolve(&quot;\\data\\images\\existingFile&quot;);
+     *     // resolved will be C:\data\images\existingFile
+     * </pre>
+     *
+     * @param aPath
+     *            incomplete path that does not contain drive information.
+     * @return resolved path or null if not found
+     */
+    public static String resolveDrive(String aPath)
+    {
+        return null;
+    }
+
+    /**
+     * A canonical pathname is both absolute and unique. The precise definition
+     * of canonical form is system-dependent. This method first converts this
+     * pathname to absolute form if necessary, and then maps it to its unique
+     * form in a system-dependent way. This typically involves removing
+     * redundant names such as "." and ".." from the pathname, resolving
+     * symbolic links (on UNIX platforms), and converting drive letters to a
+     * standard case (on Microsoft Windows platforms).
+     * <p>
+     * Every pathname that denotes an existing file or directory has a unique
+     * canonical form. Every pathname that denotes a nonexistent file or
+     * directory also has a unique canonical form.
+     *
+     * @param aPath
+     * @return The canonical pathname string denoting the same file or
+     *         directory.
+     * @throws IOException
+     *             If an I/O error occurs, which is possible because the
+     *             construction of the canonical pathname may require filesystem
+     *             queries
+     *
+     */
+    public static String getCanonicalPath(String aPath) throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Get file Content ID. Only DRM protected files have content Id.
+     *
+     * @param full
+     *            path to file.
+     * @return Content ID. Null if cannot be read or does not exists.
+     */
+    public static String getContentId(String aPath)
+    {
+        return null;
+    }
+
+
+    /**
+     * Open and return an input stream for a connection. The connection's
+     * iTarget must already exist and be accessible for the input stream to be
+     * created.
+     *
+     * @return An open input stream
+     * @throws IOException
+     *             if an I/O error occurs, if the method is invoked on a
+     *             directory, if the connection's iTarget does not yet exist, or
+     *             the connection's iTarget is not accessible.
+     */
+    public InputStream openInputStream() throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Open and return a data input stream for a connection. The connection's
+     * iTarget must already exist and be accessible for the input stream to be
+     * created.
+     *
+     * @return An open input stream
+     * @throws IOException
+     *             If an I/O error occurs, if the method is invoked on a
+     *             directory, if the connection's iTarget does not yet exist, or
+     *             the connection's iTarget is not accessible.
+     */
+    public DataInputStream openDataInputStream() throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Open and return an output stream for a connection. The output stream is
+     * positioned at the start of the file. Writing data to the output stream
+     * overwrites the contents of the files (i.e. does not insert data). Writing
+     * data to output streams beyond the current end of file automatically
+     * extends the file size. The connection's iTarget must already exist and be
+     * accessible for the output stream to be created. openOutputStream(long)
+     * should be used to position an output stream to a different position in
+     * the file.
+     * <p>
+     * Changes made to a file through an output stream may not be immediately
+     * made to the actual file residing on the file system because platform and
+     * implementation specific use of caching and buffering of the data. Stream
+     * contents and file length extensions are not necessarily visible outside
+     * of the application immediately unless flush() is called on the stream.
+     * The returned output stream is automatically and synchronously flushed
+     * when it is closed.
+     *
+     * @return An open output stream
+     * @throws IOException
+     *             If an I/O error occurs, if the method is invoked on a
+     *             directory, the file does not yet exist, or the connection's
+     *             iTarget is not accessible.
+     */
+    public OutputStream openOutputStream() throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Open and return a data output stream for a connection. The output stream
+     * is positioned at the start of the file. Writing data to the output stream
+     * overwrites the contents of the files (i.e. does not insert data). Writing
+     * data to output streams beyond the current end of file automatically
+     * extends the file size. The connection's iTarget must already exist and be
+     * accessible for the output stream to be created. openOutputStream(long)
+     * should be used to position an output stream to a different position in
+     * the file.
+     * <p>
+     * Changes made to a file through an output stream may not be immediately
+     * made to the actual file residing on the file system because platform and
+     * implementation specific use of caching and buffering of the data. Stream
+     * contents and file length extensions are not necessarily visible outside
+     * of the application immediately unless flush() is called on the stream.
+     * The returned output stream is automatically and synchronously flushed
+     * when it is closed.
+     *
+     * @return An open output stream
+     * @throws IOException
+     *             If an I/O error occurs, if the method is invoked on a
+     *             directory, the file does not yet exist, or the connection's
+     *             iTarget is not accessible.
+     */
+    public DataOutputStream openDataOutputStream() throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * This method opens an output stream and positions it at the indicated byte
+     * offset in the file. Data written to the returned output stream at that
+     * position overwrites any existing data until EOF is reached, and then
+     * additional data is appended. The connection's iTarget must already exist
+     * and be accessible for the output stream to be created.
+     * <p>
+     * Changes made to a file through an output stream may not be immediately
+     * made to the actual file residing on the file system because platform and
+     * implementation specific use of caching and buffering of the data. Stream
+     * contents and file length extensions are not necessarily visible outside
+     * of the application immediately unless flush() is called on the stream.
+     * The returned output stream is automatically and synchronously flushed
+     * when it is closed.
+     *
+     * @param aByteOffset
+     *            number of bytes to skip over from the beginning of the file
+     *            when positioning the start of the OutputStream. If the
+     *            provided offset is larger than or equal to the current file
+     *            size, the OutputStream is positioned at the current end of the
+     *            file for appending.
+     * @return an open OutputStream positioned at the byte offset in the file,
+     *         or the end of the file if the offset is greater than the size of
+     *         the file.
+     * @throws IOException
+     *             If an I/O error occurs, if the method is invoked on a
+     *             directory, the file does not yet exist, or the connection's
+     *             iTarget is not accessible.
+     */
+    public OutputStream openOutputStream(long aByteOffset) throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Checks to see if current FileUtility is pointing to a File.
+     *
+     * @return true if the current iTarget is a file. false in case the iTarget
+     *         is not a file or is not accessible.
+     */
+    public boolean isFile()
+    {
+        return false;
+    }
+
+    /**
+     * Checks to see if the current FileUtility is pointing to a Directory.
+     *
+     * @return true if the current iTarget is a directory. false in case the
+     *         iTarget is not a directory or is not accessbile.
+     */
+    public boolean isDirectory()
+    {
+        return false;
+    }
+
+    /**
+     * Checks to see if the current FileUtility iTarget exists.
+     *
+     * @return true if the current iTarget exists. false in case the iTarget did
+     *         not exist or there was a fault while reading or accessing the
+     *         file.
+     */
+    public boolean exists()
+    {
+        return false;
+    }
+
+    /**
+     * Checks to see if the current FileUtility iTarget can be read from the
+     * current application.
+     *
+     * @return true if read access is allowed to the file. false if read access
+     *         is not allowed or if there was error reading the file.
+     */
+    public boolean canRead()
+    {
+        return false;
+    }
+
+    /**
+     * Checks to see if the current FileUtility iTarget can be written to from
+     * the current application.
+     *
+     * @return true if write access is allowed to the file. false if write
+     *         access is not allowed or if there was error reading the file.
+     */
+    public boolean canWrite()
+    {
+        return false;
+    }
+
+    /**
+     * Tests whether the file named by pathname is a hidden file.
+     * <p>
+     * The exact definition of hidden is system-dependent. On UNIX systems, a
+     * file is considered to be hidden if its name begins with a period
+     * character ('.'). On Microsoft Windows systems, a file is considered to be
+     * hidden if it has been marked as such in the filesystem.
+     * <p>
+     * NOTE: There is no method provided to hide a file/directory.
+     *
+     * @return true if the file exists, is accessible, and is hidden, otherwise
+     *         false.
+     *
+     */
+    public boolean isHidden(String aPath)
+    {
+        return false;
+    }
+
+    /**
+     * Tests whether the file named by pathname is a hidden file.
+     * <p>
+     * The exact definition of hidden is system-dependent. On UNIX systems, a
+     * file is considered to be hidden if its name begins with a period
+     * character ('.'). On Microsoft Windows systems, a file is considered to be
+     * hidden if it has been marked as such in the filesystem.
+     * <p>
+     * NOTE: There is no method provided to hide a file/directory.
+     *
+     * @return true if the file exists, is accessible, and is hidden, otherwise
+     *         false.
+     */
+    public boolean isHidden()
+    {
+        return false;
+    }
+
+    /**
+     * Sets the file or directory readable attribute to the indicated value. The
+     * readable attribute for the file on the actual file system is set
+     * immediately upon invocation of this method.
+     *
+     * @param aReadable
+     *            The new state of the readable flag of the selected file.
+     * @throws IOException
+     *             if the connection's iTarget does not exist or is not
+     *             accessible.
+     */
+    public void setReadable(boolean aReadable) throws IOException
+    {
+    }
+
+    /**
+     * Sets the selected file or directory writable attribute to the indicated
+     * value. The writable attribute for the file on the actual file system is
+     * set immediately upon invocation of the method.
+     *
+     * @param aWritable
+     *            The new state of the writable flag of the selected file.
+     * @throws IOException
+     *             if the connection's iTarget does not exist or is not
+     *             accessible.
+     */
+    public void setWritable(boolean aWritable) throws IOException
+    {
+    }
+
+    /**
+     * Sets the hidden attribute of the selected file to the value provided. The
+     * attribute is applied to the file on the actual file system immediately
+     * upon invocation of this method if the file system and platform support
+     * it.
+     * <p>
+     * If the file system doesn't support a hidden attribute, this method is
+     * ignored and isHidden() always returns false. Since the exact definition
+     * of hidden is system-dependent, this method only works on file systems
+     * that support a settable file attribute.
+     * <p>
+     * For example, on Win32 and FAT file systems, a file may be considered
+     * hidden if it has been marked as such in the file's attributes; therefore
+     * this method is applicable.<br/>
+     * However on UNIX systems a file may be considered to be hidden if its name
+     * begins with a period character ('.'). In the UNIX case, this method may
+     * be ignored and the method to make a file hidden may be the rename()
+     * method.
+     *
+     * @param aHidden
+     *            The new state of the hidden flag of the selected file.
+     * @throws IOException
+     *             if the connection's iTarget does not exist or is not
+     *             accessible.
+     */
+    public void setHidden(boolean aHidden) throws IOException
+    {
+    }
+
+    /**
+     * Retrieves the size of the file.
+     *
+     * @return size of file in bytes or -1 if the file did not exist
+     * @throws IOException
+     *             in case there was any error retrieving the file size.
+     */
+    public long fileSize() throws IOException
+    {
+        return 0;
+    }
+
+    /**
+     * Determines the size in bytes on a file system of all of the files that
+     * are contained in a directory.
+     *
+     * @param aIncludeSubDirs
+     *            specifies if dir size has to be taken recursively
+     * @return The size in bytes occupied by the files included in the
+     *         directory, \ or -1 if the directory does not exist or is not
+     *         accessible.
+     *
+     * @throws IOException
+     *             if the method is invoked on a file.
+     *
+     * @throws SecurityException
+     *             if the security of the application does not have read access
+     *             to the file.
+     */
+    public long directorySize(boolean aIncludeSubDirs) throws IOException
+    {
+        return 0;
+    }
+
+    /**
+     * Determines the total size of the file system the iTarget resides on.
+     *
+     * @return The total size of the file system in bytes, or -1 if the file
+     *         system is not accessible.
+     */
+    public long totalSize()
+    {
+        return 0;
+    }
+
+    /**
+     * Determines the free memory that is available on the file system the file
+     * or directory resides on. This may only be an estimate and may vary based
+     * on platform-specific file system blocking and metadata information.
+     *
+     * @return The available size in bytes on a file system, or -1 if the file
+     *         system is not accessible.
+     */
+    public long availableSize()
+    {
+        return 0;
+    }
+
+    /**
+     * Determines the used memory of a file system the connection's iTarget
+     * resides on. This may only be an estimate and may vary based on
+     * platform-specific file system blocking and metadata information.
+     *
+     * @return The used size of bytes on a file system, or -1 if the file system
+     *         is not accessible.
+     */
+    public long usedSize()
+    {
+        return 0;
+    }
+
+    /**
+     * Returns the time that the FileUtility currently points to was last
+     * modified.
+     *
+     * @return A long value representing the time the file was last modified,
+     *         measured in milliseconds, 0L if an I/O error occurs. If
+     *         modification date is not supported by the underlying platform
+     *         and/or file system, then 0L is also returned. If the connection's
+     *         iTarget does not exist or is not accessible, 0L is returned.
+     */
+    public long lastModified()
+    {
+        return 0;
+    }
+
+    /**
+     * Fetches the name of the iTarget currently pointed to by FileUtility. If
+     * the iTarget is a file, the result is of the form <file.extention> else if
+     * it is a directory it has a trailing "/" of the form <directory/>
+     *
+     * @return name of the iTarget currently pointed to.
+     */
+    public String getName()
+    {
+        return null;
+    }
+
+    /**
+     * Fetches the path to the iTarget currently pointed to by FileUtility.
+     * Return value is of the form /<root>/<directory>/
+     *
+     * @return path to the iTarget currently pointed to.
+     */
+    public String getPath()
+    {
+        return null;
+    }
+
+    /**
+     * Returns FileUtility object that points to the parent of the current
+     * iTarget.
+     *
+     * @return The parent directory named by this FileUtility, or null if this
+     *         pathname does not name a parent
+     */
+    public FileUtility getParentFile()
+    {
+        return null;
+    }
+
+    /**
+     * Returns the absolute path traced from the root of the file system.
+     *
+     * @return the absolute path of the file
+     */
+    public String getAbsolutePath()
+    {
+        return null;
+    }
+
+    /**
+     * Returns the full file URL including the scheme, host, and path from where
+     * the file or directory specified in the Connector.open() method is opened.
+     * The string returned is in an escaped ASCII format as defined by RFC 2396.
+     * The resulting String looks as follows:
+     *
+     * <pre>
+     * file://&lt;host&gt;/&lt;root&gt;/&lt;directory&gt;/&lt;filename&gt;
+     * </pre>
+     *
+     * @return The URL of a file or directory in the format specified above.
+     */
+    public String getURL()
+    {
+        return null;
+    }
+
+    /**
+     * Creates a file corresponding to the file string provided constructor of
+     * this FileUtility. The file is created immediately on the actual file
+     * system upon invocation of this method. Files are created with zero length
+     * and data can be put into the file through output streams opened on the
+     * file. This method does not create any directories specified in the file's
+     * path.
+     *
+     * @return true if the file did not exist and was successfully created;
+     *         false if the file already existed.
+     * @throws IOException
+     *             in case an error occured; or if the URL/Path given during
+     *             construction had a trailing "/"(or "\\") to indicate that it
+     *             is a directory.
+     * @throws SecurityException
+     *             in case the access was denied to create the file
+     */
+    public boolean createNewFile() throws IOException, SecurityException
+    {
+        return false;
+    }
+
+    /**
+     * Creates the directory named by this pathname. Directories in the
+     * specified path are not recursively created and must be explicitly created
+     * before sub directories can be created.
+     *
+     * @return true if and only if the directory was created; false if the
+     *         directory already existed.
+     * @throws IOException
+     *             in case an error occurred; or if the URL/Path given during
+     *             construction did not have trailing "/"(or "\\") to indicating
+     *             that it is not supposed to be a directory.
+     * @throws SecurityException
+     *             in case the access was denied to create the directory
+     */
+    public boolean mkdir() throws IOException, SecurityException
+    {
+        return false;
+    }
+
+    /**
+     * Creates the directory named by this pathname, including any necessary but
+     * nonexistent parent directories. Note that if this operation fails it may
+     * have succeeded in creating some of the necessary parent directories.
+     *
+     * @return true if and only if the directory was created, along with all
+     *         necessary parent directories; false otherwise
+     * @throws IOException
+     *             in case an error occurred
+     * @throws SecurityException
+     */
+    public boolean mkdirs() throws IOException, SecurityException
+    {
+
+        return false;
+    }
+
+    /**
+     * Deletes the file or directory denoted by this pathname. If this pathname
+     * denotes a directory, then the directory must be empty in order to be
+     * deleted.
+     * <p>
+     * All open input and output streams are automatically flushed and closed.
+     * Attempts to further use those streams result in an IOException. The
+     * FileUtility instance object remains available for use.
+     *
+     * @return true if and only if the file or directory is successfully
+     *         deleted; false otherwise
+     * @throws SecurityException
+     *             if access was denied to the file/directory
+     */
+    public boolean delete() throws SecurityException
+    {
+        return false;
+    }
+    
+    /**
+     * Deletes the file or directory denoted by this pathname. If this pathname
+     * denotes a directory, then the directory must be empty in order to be
+     * deleted. Deletes the file or directory even if it is marked as read-only.
+     * <p>
+     * All open input and output streams are automatically flushed and closed.
+     * Attempts to further use those streams result in an IOException. The
+     * FileUtility instance object remains available for use.
+     *
+     * @return true if and only if the file or directory is successfully
+     *         deleted; false otherwise
+     * @throws SecurityException
+     *             if access was denied to the file/directory
+     */    
+    public boolean forceDelete() throws SecurityException
+    {
+        return false;
+    }
+
+    /**
+     * Renames the selected file or directory to a new name in the same
+     * directory. The file or directory is renamed immediately on the actual
+     * file system upon invocation of this method. No file or directory by the
+     * original name exists after this method call.
+     * <p>
+     * All previously open input and output streams are automatically flushed
+     * and closed. Attempts to further use those streams result in an
+     * IOException. The FileUtility instance object remains open and available
+     * for use, referring now to the file or directory by its new name.
+     *
+     * @param aNewName
+     *            new name to which the current iTarget has to be renamed
+     * @return true if rename succeeded, false otherwise
+     * @throws IOException
+     *             if the connection's iTarget does not exist, the connection's
+     *             iTarget is not accessible, a file or directory already exists
+     *             by the newName, or newName is an invalid filename for the
+     *             platform (e.g. contains characters invalid in a filename on
+     *             the platform)
+     * @throws SecurityException
+     *             if access/permission was denied to rename file
+     * @throws IllegalArgumentException
+     *             if newName contains any path specification.
+     */
+    public boolean rename(String aNewName) throws IOException,
+                SecurityException
+    {
+        return false;
+    }
+
+    /**
+     * Renames the iTarget to new file. Similar to rename, but allows us to
+     * rename files to different paths in the file system. Allows for faster
+     * move within a file system.
+     *
+     * @param aNewName
+     *            new path to which it has to be moved. Note that the newName
+     *            should be absolute path.
+     * @return true in case rename was successful, false otherwise
+     * @throws IOException
+     *             in case some unexpected error occured.
+     */
+    public boolean renameTo(String aNewName) throws IOException
+    {
+        return false;
+    }
+
+    public String[] listFileArray(boolean aIncludeHidden) throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Gets a filtered list of files and directories contained in a directory
+     *
+     * @param filter
+     *            String against which all files and directories are matched for
+     *            retrieval. includeHidden: boolean indicating whether files
+     *            marked as hidden should be included or not in the list of
+     *            files and directories returned.
+     *
+     * @return Vector of strings, denoting the files and directories in the
+     *         directory
+     *
+     * @throws IOException
+     *             if invoked on a file, the directory does not exist, the
+     *             directory is not accessible, or an I/O error occurs.
+     *
+     * @throws SecurityException
+     *             if the security of the application does not have read access
+     *             for the connection's iTarget.
+     *
+     * @throws IllegalModeException
+     *             If application does have read access to the file but has
+     *             opened the connection in Connector.WRITE mode.
+     * @throws ConnectionClosedException
+     *             If Connection is closed.
+     */
+    public Vector listFiles(String aFilter, boolean aIncludeHidden)
+    throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Gets a filtered list of files and directories contained in a directory
+     *
+     * @param aFilter
+     *            String against which all files and directories are matched for
+     *            retrieval. includeHidden: boolean indicating whether files
+     *            marked as hidden should be included or not in the list of
+     *            files and directories returned.
+     *
+     * @return Enumeration of strings, denoting the files and directories in the
+     *         directory
+     *
+     * @throws IOException
+     *             if invoked on a file, the directory does not exist, the
+     *             directory is not accessible, or an I/O error occurs.
+     *             SecurityException: if the security of the application does
+     *             not have read access for the connection's iTarget.
+     *             IllegalModeException: If application does have read access to
+     *             the file but has opened the connection in Connector.WRITE
+     *             mode. ConnectionClosedException: If Connection is closed.
+     */
+    public Enumeration list(String aFilter, boolean aIncludeHidden)
+    throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Gets a list of all visible files and directories contained in a
+     * directory. The directory is the connection's iTarget as specified in
+     * constructor.
+     * <p>
+     * Any hidden files and directories in the directory are not included in the
+     * returned list. Any current directory indication (".") and any parent
+     * directory indication ("..") is not included in the list of files and
+     * directories returned.
+     *
+     * @return An Enumeration of strings, denoting the files and directories in
+     *         the directory. The string returned contain only the file or
+     *         directory name and does not contain any path prefix (to get a
+     *         complete path for each file or directory, prepend getPath()).
+     *         Directories are denoted with a trailing slash "/" in their
+     *         returned name. The Enumeration has zero length if the directory
+     *         is empty.
+     * @throws IOException
+     */
+    public Enumeration list() throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Gets a list of all visible files and directories contained in a
+     * directory. The directory is the connection's iTarget as specified in
+     * constructor.
+     * <p>
+     * Any hidden files and directories in the directory are not included in the
+     * returned list. Any current directory indication (".") and any parent
+     * directory indication ("..") is not included in the list of files and
+     * directories returned.
+     *
+     * @return An list of FileUtility objects, denoting the files and
+     *         directories in the directory.
+     * @throws IOException
+     */
+    public FileUtility[] listFiles() throws IOException
+    {
+        return null;
+    }
+
+    /**
+     * Truncates the file, discarding all data from the given byte offset to the
+     * current end of the file
+     *
+     * @param aByteOffset
+     *            Offset into the file from which truncation occurs.
+     *
+     * @throws java.io.IOException
+     *             if invoked on a directory or the file does not exist or is
+     *             not accessible.
+     * @throws SecurityException
+     *             if the security of the application does not have write access
+     *             for the connection's iTarget.
+     * @throws IllegalArgumentException
+     *             if byteOffset is less than zero.
+     */
+    public void truncate(long aByteOffset) throws java.io.IOException
+    {
+    }
+
+
+    public String toString()
+    {
+        return null;
+    }
+}
--- a/javauis/lcdui_qt/src_j2se/com/nokia/mj/impl/rt/support/ApplicationInfo.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/lcdui_qt/src_j2se/com/nokia/mj/impl/rt/support/ApplicationInfo.java	Fri Oct 15 12:29:39 2010 +0300
@@ -324,7 +324,10 @@
      * found.
      * @return application root path as String
      */
-    //public abstract String getRootPath();
+    public String getRootPath()
+    {
+        return "";
+    }
 
     /**
      * Returns the main class of the application. The main class concept might
--- a/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/CollisionDetectionTest.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/CollisionDetectionTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -375,14 +375,14 @@
         sprite1.setTransform(Sprite.TRANS_ROT180);
         sprite1.setPosition(0, 0);
         assertTrue("sprite-tiledlayer fail 26.", sprite1.collidesWith(tiledLayer, false));
-        assertTrue("sprite-tiledlayer fail 27.", !sprite1.collidesWith(tiledLayer, true));
+        assertTrue("sprite-tiledlayer fail 27.", sprite1.collidesWith(tiledLayer, true));
 
         // Test collision rectangle in transformed sprite:
         sprite1.setTransform(Sprite.TRANS_NONE);
         sprite1.defineCollisionRectangle(0, 0, 50, 50);
         sprite1.setTransform(Sprite.TRANS_ROT90);
         sprite1.setPosition(0, 0);
-        assertTrue("sprite-tiledlayer fail 28.", sprite1.collidesWith(tiledLayer, false));
+        assertTrue("sprite-tiledlayer fail 28.", !sprite1.collidesWith(tiledLayer, false));
         assertTrue("sprite-tiledlayer fail 29.", !sprite1.collidesWith(tiledLayer, true));
 
     }
--- a/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/image/ImageTest.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/image/ImageTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -431,7 +431,6 @@
     public void testCreateFromDataBuffer()
     {
 
-        DISABLE_TEST();
         Image testImage = null;
         String imgFile = "/image1.jpg";
         int dataLen = 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/.cproject	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+<storageModule buildFromInf="true" buildingTestComps="true" cleanLevel="0" concurrentBuildJobs="4" defaultMMPChangedAction="0" extraSBSv2Args="" infBuildComponents="" infFileLocation="build\bld.inf" macrosFile="" makeEngineToUse="make" manageDependencies="true" moduleId="com.nokia.carbide.cdt.builder.carbideCPPBuilder" overrideMakeEngine="false" overrideWorkspaceSettings="false" promptForMMPChangedAction="true" useConcurrentBuilding="true" useDebugMode="false" useIncrementalBuilder="false" useKeepGoing="false" useMMPMacros="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="Emulator Debug (WINSCW) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Debug (WINSCW) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Debug (WINSCW) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;RD_JAVA_HTTP_EMC_ENABLED;__WINSCW__;RD_JAVA_UI_QT;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__CW32__;UNICODE;RD_JAVA_S60_RELEASE_10_1;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;QT_USE_MATH_H_FLOATS;__S60_3X__;__WINS__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;_DEBUG;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586007160" useMmpMacrosCache="true"/>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+<cconfiguration id="Emulator Release (WINSCW) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Emulator Release (WINSCW) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Emulator Release (WINSCW) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MWCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;NDEBUG;RD_JAVA_HTTP_EMC_ENABLED;__WINSCW__;RD_JAVA_UI_QT;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__CW32__;UNICODE;RD_JAVA_S60_RELEASE_10_1;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;QT_USE_MATH_H_FLOATS;__S60_3X__;__WINS__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586008004" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV5) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV5) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV5) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;__ARMCC_2_2__;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__GENERIC_MARM__;UNICODE;RD_JAVA_S60_RELEASE_10_1;__EABI__;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;__MARM_ARMV5__;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;__ARMCC__;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;__MARM__;QT_USE_MATH_H_FLOATS;__S60_3X__;__ARMCC_2__;__EPOC32__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;_DEBUG;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586008441" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV5) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV5) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV5) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;NDEBUG;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;__ARMCC_2_2__;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__GENERIC_MARM__;UNICODE;RD_JAVA_S60_RELEASE_10_1;__EABI__;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;__MARM_ARMV5__;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;__ARMCC__;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;__MARM__;QT_USE_MATH_H_FLOATS;__S60_3X__;__ARMCC_2__;__EPOC32__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586049270" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV6) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV6) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV6) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;__ARMCC_2_2__;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__GENERIC_MARM__;__ARMV6__;UNICODE;RD_JAVA_S60_RELEASE_10_1;__EABI__;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;__MARM_ARMV5__;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;__ARMCC__;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;__MARM__;QT_USE_MATH_H_FLOATS;__S60_3X__;__ARMCC_2__;__EPOC32__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;_DEBUG;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586049864" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV6) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV6) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV6) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;NDEBUG;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;__ARMCC_2_2__;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__GENERIC_MARM__;__ARMV6__;UNICODE;RD_JAVA_S60_RELEASE_10_1;__EABI__;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;__MARM_ARMV5__;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;__ARMCC__;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;__MARM__;QT_USE_MATH_H_FLOATS;__S60_3X__;__ARMCC_2__;__EPOC32__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586050380" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV7) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV7) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV7) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;__ARMV7__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;__ARMCC_2_2__;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__GENERIC_MARM__;UNICODE;RD_JAVA_S60_RELEASE_10_1;__EABI__;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;__MARM_ARMV5__;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;__ARMCC__;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;__MARM__;QT_USE_MATH_H_FLOATS;__S60_3X__;__ARMCC_2__;__EPOC32__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;_DEBUG;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586051427" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV7) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV7) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV7) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;__ARMV7__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;NDEBUG;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;__ARMCC_2_2__;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_S60_RELEASE_5_0_ONWARDS;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;__GENERIC_MARM__;UNICODE;RD_JAVA_S60_RELEASE_10_1;__EABI__;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;__MARM_ARMV5__;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_STDCPPV5;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;__ARMCC__;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_NGA_ENABLED;RD_JAVA_S60_RELEASE_9_2_ONWARDS;__MARM__;QT_USE_MATH_H_FLOATS;__S60_3X__;__ARMCC_2__;__EPOC32__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586051833" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Debug (ARMV9E) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Debug (ARMV9E) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Debug (ARMV9E) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;RD_JAVA_S60_RELEASE_5_0_ONWARDS;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;UNICODE;RD_JAVA_S60_RELEASE_10_1;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_STDCPPV5;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_S60_RELEASE_9_2_ONWARDS;RD_JAVA_NGA_ENABLED;QT_USE_MATH_H_FLOATS;__S60_3X__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;_DEBUG;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586052239" useMmpMacrosCache="true"/>
+</cconfiguration>
+<cconfiguration id="Phone Release (ARMV9E) [mcl_wk_26]">
+<storageModule buildSystemId="com.nokia.carbide.cdt.builder.CarbideConfigurationDataProvider" id="Phone Release (ARMV9E) [mcl_wk_26]" moduleId="org.eclipse.cdt.core.settings" name="Phone Release (ARMV9E) [mcl_wk_26]">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.cdt.debug.cw.symbian.SymbianE32" point="org.eclipse.cdt.core.BinaryParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.CarbideMakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.SBSv2ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.Elf2E32ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RCOMPErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.MakeDefErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="com.nokia.carbide.cdt.builder.RVCTCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="CarbideConfigurationDataProvider">
+<ENV_VAR_DATA_ID/>
+<ARGUMENTS_DATA_ID ABLDFREEZEARGSSTORAGE="-r"/>
+<ROM_BUILDER_DATA_ID ROMBUILDWORKINGDIRECTORYSTORAGE="T:\epoc32\rom\"/>
+</storageModule>
+<storageModule filesCache="T:\epoc32\include\platform_paths.hrh;T:\sf\app\jrt\javauis\m2g_qt\build\javam2g_0x2002DCBD.mmp;T:\sf\app\jrt\javauis\m2g_qt\build\bld.inf;" includesCache="T:/sf/app/jrt/javauis/m2g_qt/build[LOCAL];T:/epoc32/include/mw/QtCore;T:/epoc32/include/mw/QtGui;T:/epoc32/include/mw;T:/sf/mw/qt/mkspecs/common/symbian;T:/epoc32/include;T:/epoc32/include/stdapis;T:/epoc32/include/stdapis/sys;T:/epoc32/include/platform/mw;T:/epoc32/include/platform;T:/epoc32/include/platform/loc;T:/epoc32/include/platform/mw/loc;T:/epoc32/include/platform/loc/sc;T:/epoc32/include/platform/mw/loc/sc;T:/epoc32/include/app;T:/epoc32/include/platform/app;T:/epoc32/include/platform/app/loc;T:/epoc32/include/platform/app/loc/sc;T:/epoc32/include/stdapis/openssl;T:/sf/app/jrt/javauis/m2g_qt/inc;T:/sf/app/jrt/javauis/inc;T:/sf/app/jrt/inc;T:/sf/app/jrt/javauis/m2g_qt/src;T:/sf/app/jrt/javauis/m2g_qt/src/jni;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.ercp.swt.s60/native/inc;T:/sf/app/jrt/javauis/lcdui_qt/lcdgr/inc;T:/sf/app/jrt/javauis/lcdui_qt/javalcdui/inc;T:/sf/app/jrt/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics;T:/epoc32/include/stdapis/stlportv5;T:/sf/app/jrt/javauis/m2g_qt/build;T:/epoc32/build/jrt/javabuild/inc.javah;" macrosCache="QT_CORE_LIB;__DLL__;RD_JAVA_APPLICATION_SETTINGS_QT;RD_JAVA_OPENLCDUI_ENABLED;NDEBUG;RD_JAVA_HTTP_EMC_ENABLED;RD_JAVA_UI_QT;RD_JAVA_S60_RELEASE_5_0_ONWARDS;SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK;RD_JAVA_SYMBIAN_TARGET;__SERIES60_3X__;__S60_5X__;UNICODE;RD_JAVA_S60_RELEASE_10_1;J9EPOC32;_UNICODE;RD_JAVA_EPOCALLOWDLLDATA_FIX;RD_JAVA_PREWARM;__SUPPORT_CPP_EXCEPTIONS__;RD_JAVA_INSTALLERUI_ENABLED;RD_JAVA_S60_RELEASE_10_1_ONWARDS;RD_JAVA_STDCPPV5;RD_JAVA_PROXIMITY_LISTENER_ENABLED;RD_JAVA_ADVANCED_TACTILE_FEEDBACK;OPENLCDUI_ENABLED;__SYMBIAN32__;QT_KEYPAD_NAVIGATION;RD_JAVA_OPENC_BETA_PATCH;RD_JAVA_S60_RELEASE_9_2_ONWARDS;RD_JAVA_NGA_ENABLED;QT_USE_MATH_H_FLOATS;__S60_3X__;QT_GUI_LIB;RD_JAVA_MIDPRMS_DB;QT_SOFTKEYS_ENABLED;__S60_50__;" moduleId="configDataCache" sourcesCache="/javam2g_0x2002DCBD/build;/javam2g_0x2002DCBD/inc;/javam2g_0x2002DCBD/src;/javam2g_0x2002DCBD/src/jni;" timestampCache="1278586052645" useMmpMacrosCache="true"/>
+</cconfiguration>
+</storageModule>
+</cproject>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/.project	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>javam2g_0x2002DCBD</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.nokia.carbide.cdt.builder.carbideCPPBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>com.nokia.carbide.cdt.builder.carbideCPPBuilderNature</nature>
+		<nature>com.nokia.carbide.cdt.builder.carbideSBSv2BuilderNature</nature>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/build/build.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,64 @@
+<!--
+#
+# Copyright (c) 2008-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: 
+#
+-->
+
+<project name="javam2g" default="deploy" basedir=".">
+
+  <import file="../../../build/utilities.xml"/>
+
+  <!-- Needed by the utilities.xml. See the description form the utilities.xml
+       file 
+
+  <target name="compile">
+    <omj.javac classpath="${classpath}:${impl.cldc.jar}"/>
+  </target>-->
+
+
+  <!-- Needed by the utilities.xml. See the description form the utilities.xml
+       file -->
+
+  <property name="javah.classnames" 
+            value="com.nokia.microedition.m2g.M2GDocument,
+                   com.nokia.microedition.m2g.M2GSVGPath,
+                   com.nokia.microedition.m2g.M2GSVGSVGElement,
+                   com.nokia.microedition.m2g.M2GManager,
+                   com.nokia.microedition.m2g.M2GScalableGraphics,
+                   com.nokia.microedition.m2g.M2GSVGAnimationElement,
+                   com.nokia.microedition.m2g.M2GSVGElement,
+                   com.nokia.microedition.m2g.M2GSVGImage,
+				   				 com.nokia.microedition.m2g.M2GRunnableQt"/>
+
+  <target name="system.properties">
+    <properties>
+        microedition.m2g.svg.baseProfile=tiny
+        microedition.m2g.svg.version=1.1
+        microedition.m2g.version=1.1
+    </properties>
+  </target>
+  
+  <target name="create.public.api.jar">
+  <omj.public.apis includes="javax/microedition/m2g/ExternalResourceHandler.class,
+                                 javax/microedition/m2g/ScalableGraphics.class,
+                                 javax/microedition/m2g/ScalableImage.class,
+                                 javax/microedition/m2g/SVGAnimator.class,
+                                 javax/microedition/m2g/SVGEventListener.class,
+                                 javax/microedition/m2g/SVGImage.class"/>
+  </target>
+
+
+</project>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/build/bwins/javam2gu.def	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/build/eabi/javam2gu.def	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,13 @@
+EXPORTS
+	_Z10jni_lookupPKc @ 1 NONAME
+	_ZTI12CM2GSVGProxy @ 2 NONAME
+	_ZTI14TM2GBitmapLock @ 3 NONAME
+	_ZTI14TM2GRenderRect @ 4 NONAME
+	_ZTI16CSynchronization @ 5 NONAME
+	_ZTI17CM2GRenderContext @ 6 NONAME
+	_ZTV12CM2GSVGProxy @ 7 NONAME
+	_ZTV14TM2GBitmapLock @ 8 NONAME
+	_ZTV14TM2GRenderRect @ 9 NONAME
+	_ZTV16CSynchronization @ 10 NONAME
+	_ZTV17CM2GRenderContext @ 11 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/build/javam2g.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,45 @@
+#
+# 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: 
+#
+
+TEMPLATE=lib
+TARGET=javam2g
+CONFIG += omj java stl
+#CONFIG -= qt
+
+SOURCES += ../src/*.cpp
+SOURCES += ../src/jni/*.cpp
+
+LIBS += -lavkon \
+        -lbitgdi \
+        -lcharconv \
+        -lcone \
+        -leikcore \
+        -eswtqt \
+        -lfbscli \
+        -lgdi \
+        -lSVGEngineJI	\
+        -lopenlcdui		\
+        -lefsrv			\
+        -lfbscli		\
+        -limageconversion
+
+include(../../../build/omj.pri )
+
+INCLUDEPATH +=  ../../eswt_qt/org.eclipse.ercp.swt.s60/native/inc/
+INCLUDEPATH +=  ../../lcdui_qt/lcdgr/inc/
+INCLUDEPATH +=  ../../lcdui_qt/javalcdui/inc/
+INCLUDEPATH +=  ../../eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/library/graphics/graphics.h
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/CM2GRenderContext.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,252 @@
+/*
+* Copyright (c) 2005-2006 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:  Render context
+*
+*/
+
+#ifndef CM2GRENDERCONTEXT_H
+#define CM2GRENDERCONTEXT_H
+
+//  INCLUDES
+#include <fbs.h>
+#include "MM2GRenderContext.h"
+#include <graphics.h>
+
+class CSvgtBitmap;
+
+M2G_NS_START
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class MM2GSVGProxy;
+class CBitmapContext;
+#ifdef RD_JAVA_NGA_ENABLED
+class MMIDCanvas;
+#endif // RD_JAVA_NGA_ENABLED
+
+// CLASS DECLARATION
+/**
+ * Render context
+ */
+
+
+class CM2GRenderContext : public CBase, public MM2GRenderContext
+{
+private: // METHODS
+    /**
+     * C++ default constructor.
+     */
+    CM2GRenderContext();
+
+    /**
+     * C++ copy constructor
+     */
+    CM2GRenderContext(const CM2GRenderContext&);
+
+    /**
+     * C++ assignment operator
+     */
+    CM2GRenderContext& operator=(const CM2GRenderContext&);
+
+    /**
+     * Initialization
+     */
+    void ConstructL(MM2GSVGProxy* aProxy);
+
+public: // METHODS
+    /**
+     * Two-phased constructor.
+     */
+    static CM2GRenderContext* NewL(MM2GSVGProxy* aProxy);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CM2GRenderContext();
+
+    /**
+     * @see MM2GRenderContext::BindL()
+     */
+    virtual void BindL(TInt& aGraphicsHandle);
+
+    /**
+     * @see MM2GRenderContext::InitImageBitmapL()
+     */
+    virtual void InitImageBitmapL();
+
+    /**
+     * @see MM2GRenderContext::BlitToL()
+     */
+    virtual void ReleaseL();
+
+    /**
+     * @see MM2GRenderContext::RenderL()
+     */
+    virtual void RenderLCDUIL(
+        TM2GSvgDocumentHandle& aSvgDocumentHandle,
+        const TReal32 aCurrentTime,
+        TInt aSvgW, TInt aSvgH,
+        TM2GRenderRect& aRect);
+    virtual void RenderESWTL(
+        TM2GSvgDocumentHandle& aSvgDocHandle,
+        const TReal32 aCurrentTime,
+        TInt aSvgW, TInt aSvgH,
+        TM2GRenderRect& aRect,       
+        TBool aUseNativeClear,
+        TInt* aReturnData);
+
+    /**
+     * @see MM2GRenderContext::SetRenderingQualityL()
+     */
+    virtual void SetRenderingQualityL(TInt aMode);
+
+    /**
+     * @see MM2GRenderContext::SetTransparency()
+     */
+    virtual void SetTransparency(TReal32 aAlpha);
+
+    
+    TInt SaveBitmapL(const CFbsBitmap& aNVGBitmap, const TFileName& aFileName);
+protected: // METHODS
+    /**
+     * Get the image's bitmap handle
+     *
+     * @return Svg surface handle.
+     * @throws Exception if not ok.
+     */
+    TM2GBitmapHandle GetImgHandleL() const;
+
+private:
+    /**
+     * Prepare viewbox and anchor
+     *
+     * @param aRr clip area information
+     * @return aViewbox render rectangle area
+     * @return aAnchor recalculated anchor point
+     */
+    void PrepareViewbox(
+        TM2GRenderRect& aRr,
+        TInt aSvgW, TInt aSvgH,
+        TRect& aViewbox, TPoint& aAnchor);
+
+    /**
+     * Renders a SVG document at a current time.
+     *
+     * <p> The rendering is done in 2 steps:
+     * <li> render the document on an internal SVG buffer (iSvg)
+     * <li> alpha-blend it with the bound graphics target (iGraphicsBitmap)
+     *
+     * @note if transparency factor is not set, iSvg is simply blitted onto iGraphicsTarget
+     *
+     * @param aSvgDocumentHandle handle to SVG document
+     * @param aCurrentTime       the current time of the animation
+     * @param aSvgW              Svg image viewport width
+     * @param aSvgH              Svg image viewport height
+     * @param aRect              contains position about the rendered area
+     * @param aAnchor            anchor point
+     *
+     * @since S60 3.1
+     */
+    void RenderLCDUIL(
+        TM2GSvgDocumentHandle& aSvgDocumentHandle,
+        const TReal32 aCurrentTime,
+        const TRect& aViewbox,
+        const TPoint& aAnchor);
+
+    void RenderESWTL(
+        TM2GSvgDocumentHandle& aSvgDocHandle,
+        TReal32 aCurrentTime,
+        const TRect& aViewbox,
+        const TPoint& aAnchor,
+        TBool aUseNativeClear,
+        TInt* aReturnData);
+
+    /**
+     * Clear the bitmap with 0
+     * Fills all pixel with 0 value
+     *
+     * @param aBmp the bitmap to be filled
+     */
+    void CM2GRenderContext::ClearBitmapL(CFbsBitmap* aBmp);
+
+    /**
+     * Fills all the pixels of a bitmap with a specific byte
+     *
+     * @param aBmp the bitmap to be filled
+     * @param aChar the character(byte) to fill with
+     */
+    void FillBitmapL(CFbsBitmap* aBmp, const TUint8& aChar);
+
+
+private: // VARIABLES
+    
+    //For WindowsSurface CFbsBitmap || Qimage 
+    Java::GFX::WindowSurface*   iWindowSurface;
+    
+    
+    MM2GSVGProxy*       iProxy;
+
+    TM2GSvgEngineHandle iEngineHandle;
+
+    TReal32             iAlpha;
+    TUint8              iScaledAlpha;
+    
+//for eswt compatibility
+    CFbsBitmap*         iImgBmp;
+    RFbsSession         iFbsSession;
+    
+    
+// Temporary buffer ( offscreen ) for QImage support
+    QImage*                         iOffScreenQImage;
+    CFbsBitmap*                     iOffScreenBitmap;
+            
+    QImage*                         iTargetQImage;
+
+    Java::GFX::WindowSurfaceType    wSurfaceType;
+    CSvgtBitmap * targetBitmap;
+    
+    CFbsBitmap* tempBitmapForMask ;
+
+protected:
+    TM2GSvgBitmapHandle GetBufferHandleL() const;
+    void InitializeQImageOffscreenBufferL(TSize aScreenSize,QImage* aQimage);
+    void InitializeCFbsBitmapOffscreenBufferL(TSize aScreenSize,CFbsBitmap* aBitmap);
+    void ClearSurfaceL(TM2GSvgBitmapHandle aSvgtBmpHandle);
+private:
+    
+};
+/*-----------------------------------------------------------
+class  : CFbsBitmapHack
+purpose: Class is provided as a solution for double render
+         issue in eSWT
+*-----------------------------------------------------------*/
+class CFbsBitmapHack : public CFbsBitmap
+{
+public:
+    TInt GetMyHandle()
+    {
+        return iHandle;
+    }
+};
+
+
+M2G_NS_END
+#endif // CM2GRENDERCONTEXT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/CM2GSVGProxy.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,585 @@
+/*
+* Copyright (c) 2005-2006 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:  SVGTopt proxy
+*
+*/
+
+#ifndef CM2GSVGPROXY_H
+#define CM2GSVGPROXY_H
+
+//  INCLUDES
+#include "MM2GSVGProxy.h"
+
+M2G_NS_START
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CSvgJavaInterfaceImpl;
+
+// CLASS DECLARATION
+/**
+ *
+ */
+class CM2GSVGProxy : public CBase, public MM2GSVGProxy
+{
+public: // METHODS
+    /**
+     * Two-phased constructor.
+     * @return Reference counted proxy wrapper
+     */
+    static CM2GSVGProxy* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CM2GSVGProxy();
+
+    /**
+     * @see MM2GSVGProxy::AddCloseL
+     */
+    virtual void AddCloseL(const TM2GSvgPathHandle& aPathHandle);
+
+    /**
+     * @see MM2GSVGProxy::AddCurveToL
+     */
+    virtual void AddCurveToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TM2GPathCurveData& aPathCurveData);
+
+    /**
+     * @see MM2GSVGProxy::AddLineToL
+     */
+    virtual void AddLineToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TReal32& aX, const TReal32& aY);
+
+    /**
+     * @see MM2GSVGProxy::AddMoveToL
+     */
+    virtual void AddMoveToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TReal32& aX, const TReal32& aY);
+
+    /**
+     * @see MM2GSVGProxy::AddQuadToL
+     */
+    virtual void AddQuadToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TReal32& aX1, const TReal32& aY1,
+        const TReal32& aX2, const TReal32& aY2);
+
+    /**
+     * @see MM2GSVGProxy::AppendChildL
+     */
+    virtual void AppendChildL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgElementHandle& aChildElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::BeginElementAtL
+     */
+    virtual void BeginElementAtL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle,
+        const TReal32& aOffset);
+
+    /**
+     * @see MM2GSVGProxy::CheckRemoveableL
+     */
+    virtual void CheckRemoveableL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aRemoveable);
+
+    /**
+     * @see MM2GSVGProxy::ClearSvgSurfaceL
+     */
+    virtual void ClearSvgSurfaceL(const TM2GBitmapHandle& aSurfaceHandle);
+
+    /**
+     * @see MM2GSVGProxy::CreateDocumentL
+     */
+    virtual void CreateDocumentL(
+        const TPtrC16& aData,
+        TM2GSvgDocumentHandle& aDocumentHandle);
+
+    /**
+     * @see MM2GSVGProxy::CreateElementNsL
+     */
+    virtual void CreateElementNsL(
+        const TM2GSvgAttrType& aType,
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TM2GSvgElementHandle& aElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::CreatePathL
+     */
+    virtual void CreatePathL(TM2GSvgPathHandle& aPathHandle);
+
+
+    /**
+     * @see MM2GSVGProxy::CreateSvgEngineL
+     */
+    virtual void CreateSvgEngineL(TM2GSvgEngineHandle& aEngineHandle);
+
+
+    /**
+     * @see MM2GSVGProxy::TSvgSurfaceHandleL
+     */
+    virtual TM2GBitmapHandle CreateSvgSurfaceL(TInt aWidth, TInt aHeight);
+
+    /**
+     * @see MM2GSVGProxy::DeleteDocumentL
+     */
+    virtual void DeleteDocumentL(const TM2GSvgDocumentHandle& aDocumentHandle);
+
+    /**
+     * @see MM2GSVGProxy::DeleteSvgEngineL
+     */
+    virtual void DeleteSvgEngineL(const TM2GSvgEngineHandle& aEngineHandle);
+
+    /**
+     * @see MM2GSVGProxy::DeleteSvgSurfaceL
+     */
+    virtual void DeleteSvgSurfaceL(const TM2GBitmapHandle& aSurfaceHandle);
+
+    /**
+     * @see MM2GSVGProxy::DestroyPathL
+     */
+    virtual void DestroyPathL(const TM2GSvgPathHandle& aPathHandle);
+
+    /**
+     * @see MM2GSVGProxy::DispatchMouseEventL
+     */
+    virtual void DispatchMouseEventL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aX, TInt aY, TM2GSvgElementHandle& aElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::EndElementAtL
+     */
+    virtual void EndElementAtL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle,
+        const TReal32& aOffset);
+
+    /**
+     * @see MM2GSVGProxy::FocusOnL
+     */
+    virtual void FocusOnL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::FocusOutL
+     */
+    virtual void FocusOutL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetBBoxL
+     */
+    virtual void GetBBoxL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GRectData& aRectData, TInt& aResult);
+
+    /**
+     * @see MM2GSVGProxy::GetColorTraitL
+     */
+    virtual void GetColorTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GColorData& aColor,
+        TInt& aResult);
+
+    /**
+     * @see MM2GSVGProxy::GetElementByIdL
+     */
+    virtual void GetElementByIdL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TPtrC16& aId,
+        TM2GSvgElementHandle& aElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetElementTypeIdL
+     */
+    virtual void GetElementTypeIdL(const TM2GSvgElementHandle& aElementHandle, TInt16& aId);
+
+    /**
+     * @see MM2GSVGProxy::GetEnumAttributeL
+     */
+    virtual void GetEnumTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TInt16& aEnumTrait);
+
+    /**
+     * @see MM2GSVGProxy::GetExternalItemL
+     */
+    virtual TInt GetExternalListItemL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aIndex,
+        TPtrC16& aItem);
+
+    /**
+     * @see MM2GSVGProxy::GetExternalListSizeL
+     */
+    virtual void GetExternalListSizeL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt& aListSz);
+
+    /**
+     * @see MM2GSVGProxy::GetFirstElementChildL
+     */
+    virtual void GetFirstElementChildL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aChildHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetFloatTraitL
+     */
+    virtual void GetFloatTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TReal32& aFloatTrait);
+
+    /**
+     * @see MM2GSVGProxy::GetMatrixTraitL
+     */
+    virtual void GetMatrixTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GMatrixData& aMatrix, TInt& aResult);
+
+    /**
+     * @see MM2GSVGProxy::GetMediaTimeL
+     */
+    virtual void GetMediaTimeL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TReal32& aSeconds);
+
+    /**
+     * @see MM2GSVGProxy::GetNextElementSiblingL
+     */
+    virtual void GetNextElementSiblingL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aSiblingElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetNumberOfSegmentsL
+     */
+    virtual void GetNumberOfSegmentsL(
+        const TM2GSvgPathHandle& aPathHandle,
+        TInt& aNumberOfSegments);
+
+    /**
+     * @see MM2GSVGProxy::GetParentL
+     */
+    virtual void GetParentL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aParentElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetPathTraitL
+     */
+    virtual void GetPathTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TInt& aPathTrait);
+
+    /**
+     * @see MM2GSVGProxy::GetRectTraitL
+     */
+    virtual void GetRectTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GRectData& aRectData, TInt& aResult);
+
+    /**
+     * @see MM2GSVGProxy::GetRootElementL
+     */
+    virtual void GetRootElementL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TM2GSvgElementHandle& aRootElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetScreenBBoxL
+     */
+    virtual void GetScreenBBoxL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GScreenBBoxData& aScreenBBoxData);
+
+    /**
+     * @see MM2GSVGProxy::GetSegmentParameterL
+     */
+    virtual void GetSegmentParameterL(
+        const TM2GSvgPathHandle& aPathHandle,
+        TInt aSegmentIndex, TInt aParamIndex,
+        TReal32& aSegmentParam);
+
+    /**
+     * @see MM2GSVGProxy::GetSegmentTypeL
+     */
+    virtual void GetSegmentTypeL(
+        const TM2GSvgPathHandle& aPathHandle,
+        TInt aSegmentIndex,
+        TInt16& aSegmentType);
+
+    /**
+     * @see MM2GSVGProxy::GetStringTraitL
+     */
+    virtual TInt GetStringTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TPtrC16& aStr);
+
+
+    /**
+     * @see MM2GSVGProxy::GetSvgSurfaceHeightL
+     */
+    virtual TInt GetSvgSurfaceHeightL(const TM2GBitmapHandle& aSurfaceHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetSvgSurfaceWidthL
+     */
+    virtual TInt GetSvgSurfaceWidthL(const TM2GBitmapHandle& aSurfaceHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetUsedFromElement
+     */
+    virtual void GetUsedFromElementL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aHandle);
+
+    /**
+     * @see MM2GSVGProxy::GetViewportHeightL
+     */
+    virtual void GetViewportHeightL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt& aHeight);
+
+    /**
+     * @see MM2GSVGProxy::GetViewportWidthL
+     */
+    virtual void GetViewportWidthL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt& aWidth);
+
+    /**
+     * @see MM2GSVGProxy::InitViewportL
+     */
+    virtual void InitViewportL(
+        const TM2GSvgDocumentHandle& aDocumentHandle);
+
+    /**
+     * @see MM2GSVGProxy::InsertBeforeL
+     */
+    virtual void InsertBeforeL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgElementHandle& aNewChildElementHandle,
+        const TM2GSvgElementHandle& aReferenceElementHandle);
+
+    /**
+     * @see MM2GSVGProxy::IsActiveL
+     */
+    virtual void IsActiveL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aActive);
+
+    /**
+     * @see MM2GSVGProxy::IsElementInDomL
+     */
+    virtual void IsElementInDomL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aIsElementInDom);
+
+    /**
+     * @see MM2GSVGProxy::IsUsedL
+     */
+    virtual void IsUsedL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aResult);
+
+    /**
+     * @see MM2GSVGProxy::RemoveChildL
+     */
+    virtual void RemoveChildL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgElementHandle& aChildElementHandle,
+        TM2GSvgElementHandle& aHandle);
+
+    /**
+     * @see MM2GSVGProxy::RenderDocumentL
+     */
+    virtual void RenderDocumentL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GBitmapHandle& aSurfaceHandle,
+        TM2GBitmapHandle aSurfaceMaskHandle,
+        TReal32 aCurrentTime);
+
+//    pankaj Qimage related changes TODO following Changes done 
+    virtual void RenderDocumentL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgBitmapHandle& aSurfaceHandle,
+        TM2GSvgBitmapHandle aSurfaceMaskHandle,
+        TReal32 aCurrentTime);
+     /**
+     * @see MM2GSVGProxy::RenderQualityL
+     */
+    virtual void RenderQualityL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        TInt aQuality);
+    /**
+     * @see MM2GSVGProxy::RequestCompletedL
+     */
+    virtual void RequestCompletedL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TPtrC16& aURI,
+        const TPtrC8& aResourceData,
+        TInt& aCompleted);
+
+    /**
+     * @see MM2GSVGProxy::SetColorTraitL
+     */
+    virtual void SetColorTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GColorData& aColor);
+
+    /**
+     * @see MM2GSVGProxy::SetEnumTraitL
+     */
+    virtual void SetEnumTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TInt16 aValue);
+
+    /**
+     * @see MM2GSVGProxy::SetFloatTraitL
+     */
+    virtual void SetFloatTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TReal32& aValue);
+
+    /**
+     * @see MM2GSVGProxy::SetMatrixTraitL
+     */
+    virtual void SetMatrixTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GMatrixData& aMatrix);
+
+    /**
+     * @see MM2GSVGProxy::SetMediaTimeL
+     */
+    virtual void SetMediaTimeL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TReal32& aSeconds);
+
+    /**
+     * @see MM2GSVGProxy::SetPathTraitL
+     */
+    virtual void SetPathTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GSvgPathHandle& aPathHandle);
+
+    /**
+     * @see MM2GSVGProxy::SetRectTraitL
+     */
+    virtual void SetRectTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GRectData& aRect);
+
+    /**
+     * @see MM2GSVGProxy::SetRenderingQualityL
+     */
+    virtual void SetRenderingQualityL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        TInt aMode);
+
+    /**
+     * @see MM2GSVGProxy::SetStringTraitL
+     */
+    virtual void SetStringTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeTypeId,
+        const TPtrC16& aStr);
+
+    /**
+     * @see MM2GSVGProxy::SetViewportHeightL
+     */
+    virtual void SetViewportHeightL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aHeight);
+
+
+    /**
+     * @see MM2GSVGProxy::SetViewportWidthL
+     */
+    virtual void SetViewportWidthL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aWidth);
+
+protected: // METHODS
+    /**
+     * Close engine & document containers
+     */
+    virtual void CloseContainers();
+
+private: // METHODS
+    /**
+     * C++ default constructor.
+     */
+    CM2GSVGProxy();
+
+    /**
+     * Initialization.
+     */
+    void ConstructL();
+
+    /**
+     * C++ copy constructor
+     */
+    CM2GSVGProxy(const CM2GSVGProxy&);
+
+    /**
+     * C++ assignment operator
+     */
+    CM2GSVGProxy& operator=(const CM2GSVGProxy&);
+
+private: // VARIABLES
+    CSvgJavaInterfaceImpl* iNative;
+    RArray<TM2GSvgEngineHandle> iSvgEngines;
+    RArray<TM2GSvgDocumentHandle> iSvgDocuments;
+};
+
+M2G_NS_END
+
+#endif // CM2GSVGPROXY_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/CSynchronization.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2005-2006 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:  M3GCore function call serialization and synchronization
+*
+*/
+
+#ifndef CSYNCHRONIZATION_H
+#define CSYNCHRONIZATION_H
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <e32base.h>
+
+// CLASS DECLARATION
+/**
+ * @class CSynchronization
+ */
+class CSynchronization : public CBase
+{
+public:
+    /**
+     * Two-phased constructor.
+         */
+    static CSynchronization* InstanceL();
+
+    /**
+         * Dtor
+         */
+    ~CSynchronization();
+
+    /**
+       * Locks the semaphore
+       */
+    void Lock();
+
+    /**
+       * Unlocks the semaphore
+       */
+    void Unlock();
+
+    /**
+    * Sets error code for error occured during lock period
+    */
+    void SetErrorCode(TInt aCode);
+
+    /**
+    * Returns error string set with SetErrorString
+    */
+    TInt GetErrorCode();
+
+private: // METHODS
+    /**
+      * Constructor
+      */
+    CSynchronization();
+
+    /**
+    * Two-phased constructor.
+    * @return New object
+    */
+    static CSynchronization* NewL();
+
+    /**
+     * Constructor
+     */
+    void ConstructL();
+
+private: // MEMBER VARIABLES
+    static CSynchronization* iSelf;
+    RCriticalSection iGuard;
+    TInt iErrorCode;
+};
+
+#endif // CSYNCHRONIZATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/JcfAutoPtr.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* 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:
+*
+*/
+
+#ifndef JCFAUTOPTR_H
+#define JCFAUTOPTR_H
+
+#include <e32base.h>
+
+/**
+ * Functionality of this auto ptr class is same as stl's auto_ptr class
+ * except this works with cleanup stack.
+ * Implementation of the example operation with "traditional" way:
+ * void bar()
+ *   {
+ *   CFoo* myFoo = CFoo::NewL();
+ *   CleanupStack::PushL(myFoo);
+ *   myFoo->DoSomeThingL();
+ *   CleanupStack::PopAndDestroy(1); //myFoo
+ *   }
+ * Implementation of the same function with auto pointer class:
+ * void bar()
+ *   {
+ *   jcfcommon::auto_ptr<CFoo> myFoo(CFoo::NewL());
+ *   myFoo->DoSomeThingL();
+ *   }
+ *
+ */
+namespace jcfcommon
+{
+
+template<class X> class auto_ptr
+{
+public:
+    typedef X element_type;
+
+    auto_ptr(X* aPtr = 0): iPtr(aPtr),iCloseCalledFlag(EFalse)
+    {
+        CleanupStack::PushL(TCleanupItem(Close, (void*)this));
+    }
+
+    /**
+     * Copy constructor was commented out because current
+     * implementation doesn't support situation where auto_ptr
+     * is returned as return value of the function. Problem is that
+     * orig. auto_ptr is deleted when getBar() operation has been
+     * executed and this deleted local reference has been stored to the
+     * cleanup stack.
+     * E.g:
+     * void foo()
+     *   {
+     *   auto_ptr<bar> barObj = getBar();
+     *       .
+     *       .
+     *       .
+     *   User::Leave(KErrNotFound);
+     *   }
+     */
+    /*auto_ptr(auto_ptr& aPtr): iPtr(aPtr.release())
+    {
+      CleanupStack::PushL(TCleanupItem(Close, (void*)this));
+    }*/
+
+    auto_ptr<X>& operator=(auto_ptr<X>& aRhs)
+    {
+        if (&aRhs != this)
+        {
+            delete iPtr;
+            iPtr = aRhs.release();
+        }
+        return (*this);
+    }
+
+    ~auto_ptr()
+    {
+        if (!iCloseCalledFlag)
+        {
+            CleanupStack::Pop();
+            delete iPtr;
+        }
+    }
+
+    X& operator *() const
+    {
+        return *iPtr;
+    }
+    X* operator ->() const
+    {
+        return iPtr;
+    }
+
+    X* get() const
+    {
+        return iPtr;
+    }
+
+    X* release()
+    {
+        X* result = iPtr;
+        iPtr = 0;
+        return result;
+    }
+
+    void reset(X* aPtr = 0)
+    {
+        if (aPtr != iPtr)
+        {
+            delete iPtr;
+            iPtr = aPtr;
+        }
+    }
+
+private:
+    static void Close(void* aPtr)
+    {
+        auto_ptr<X>* self = (auto_ptr<X>*)aPtr;
+        delete self->iPtr;
+        self->iPtr = 0;
+        self->iCloseCalledFlag = ETrue;
+    }
+
+    //Not implemented.
+    auto_ptr(auto_ptr& aPtr);
+
+private:
+    X* iPtr;
+    TBool iCloseCalledFlag;
+};
+
+}//end jcfcommon
+
+#endif // JCFAUTOPTR_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/M2GGeneral.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,465 @@
+/*
+* Copyright (c) 2005-2006 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:  General definitions
+*
+*/
+
+#ifndef M2GGENERAL_H
+#define M2GGENERAL_H
+
+#include <e32base.h>
+#include "jstringutils.h"
+#include "jni.h"
+//#include <jutils.h>
+
+#if defined ( _DEBUG )
+#if defined ( __WINSCW__ )
+// #define M2G_DEBUG
+#endif // __WINSCW__
+#endif  // _DEBUG
+
+#ifdef M2G_DEBUG
+// #define M2G_INFO_POPUP
+#define M2G_STATISTIC_DEBUG
+#include <flogger.h>
+#include <jdebug.h>
+#ifdef M2G_STATISTIC_DEBUG
+#include <HAL.h>
+#include <hal_data.h>
+#endif // M2G_STATISTIC_DEBUG
+#endif // M2G_DEBUG
+
+#include "JcfAutoPtr.h"// cfcommon::auto_ptr<>
+#include "M2GNamespace.h"
+
+//#if defined( __cplusplus )
+//extern "C" {
+//#endif
+
+M2G_NS_START
+
+// CONSTANTS
+// == ALPHA BLEND CONSTANTS ==
+const TUint8 KFullOpaque = 0xFF;
+const TUint8 KFullTransparent = 0x00;
+
+// == ERROR TEXT CONSTANTS ==
+_LIT8(KM2GEmptyString8, "");
+_LIT(KM2GEmptyString, "");
+_LIT(KGraphicsContextErrText, "Invalid M2G graphics context");
+_LIT(KOffscreenErrText, "Invalid M2G offscreen bitmap");
+_LIT(KSvgProxyPointerErrText, "Invalid SVG proxy pointer");
+_LIT(KSvgEnginePointerErrText, "Invalid SVG engine pointer");
+_LIT(KSvgTargetGraphicsPointerErrText, "Invalid target graphics pointer");
+_LIT(KNotSupportedErrText, "Not supported");
+
+// == ERROR CODE CONSTANTS ==
+const TInt KM2GOk = KErrNone;
+const TInt KM2GNotOk = KErrGeneral;
+const TInt KM2GHandleNotOk = KErrBadHandle;
+const TInt KM2GArgNotOk = KErrArgument;
+const TInt KM2GSupportedNotOk = KErrNotSupported;
+const TInt KM2GMemoryNotOk = KErrNoMemory;
+
+// Own error codes
+const TInt KM2GIOException = -10;
+
+// Java exception class names
+_LIT8(KJavaExceptionClass, "java/lang/Exception");
+_LIT8(KJavaIOExceptionClass, "java/io/IOException");
+_LIT8(KJavaOutOfMemoryErrorClass, "java/lang/OutOfMemoryError");
+_LIT8(KJavaNullPointerException, "java/lang/NullPointerException");
+
+// == SVG CONSTANTS ==
+const TInt KM2GRestartAttribute = 114; // M2GSVGConstants.AT_RESTART
+const TInt KM2GRestartNever = 471; // M2GSVGConstants.RESTART_NEVER
+const TInt KM2GRestartWhenNotActive = 472; // M2GSVGConstants.RESTART_WHENNOTACTIVE
+
+// == HANDLE MACROS ==
+#define M2G_INVALID_HANDLE /**/ 0
+
+// FORWARD DECLARATIONS
+class RWriteStream;
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+/**
+ * General static methods
+ * @lib -
+ * @series Series S60 3.0
+ */
+class M2GGeneral
+{
+public: // STATIC METHODS
+    /**
+     * Check if a handle is valid
+     * @since Series S60 3.0
+     * @param aHandle
+     * @return ETrue if a handle is valid.
+     */
+    template<typename T>
+    inline static TBool IsHandleValid(const T& aHandle)
+    {
+        return ((aHandle == M2G_INVALID_HANDLE) ? EFalse : ETrue);
+    }
+
+    /**
+     * Returns min
+     * @since Series S60 3.0
+     * @param a Left parameter
+     * @param b Right parameter
+     * @return Returns min
+     */
+    template<typename T>
+    inline static T Min(const T& a, const T& b)
+    {
+        return ((a) <= (b) ? (a) : (b));
+    }
+
+
+    /**
+     * Returns max
+     * @since Series S60 3.0
+     * @param a Left parameter
+     * @param b Right parameter
+     * @return Returns max
+     */
+    template<typename T>
+    inline static T Max(const T& a, const T& b)
+    {
+        return ((a) >= (b) ? (a) : (b));
+    }
+    /**
+     * Instantiates an Java exception object with the message specified by
+     * message, and causes that exception to be thrown in Java side. A thrown
+     * exception will be pending in the current thread, but does not
+     * immediately disrupt native code execution.
+     * @param aEnv pointer to JNI environment
+     * @param aName The name of a java.lang.Throwable class.
+     * @param aMsg The message used to construct the java.lang.Throwable object.
+     */
+    static void RaiseException(
+        JNIEnv* aEnv,
+        const TDesC8& aName,
+        const TUint8* aMsg = (STATIC_CAST(const TDesC8&, KM2GEmptyString8)).Ptr());
+
+    /**
+     * Instantiates an Java exception object specified by error code,
+     * and causes that exception to be thrown in Java side.
+     * @param aEnv pointer to JNI environment
+     * @param aErrorCode Error code.
+     * @return Value passed in is returned if not an error.
+     */
+    static TInt CheckErrorCode(JNIEnv* aEnv, TInt aErrorCode);
+
+    /**
+     * If handle is invalid instantiates an Java exception object,
+     * and causes that exception to be thrown in Java side.
+     * @param aEnv pointer to JNI environment
+     * @param aHandle Handle.
+     * @return Handle passed in is returned if it is not invalid.
+     */
+    static TInt CheckHandle(JNIEnv* aEnv, TInt aHandle);
+
+    /**
+     * If handle is invalid or error code matches instantiates an
+     * Java exception object, and causes that exception to be thrown in Java side.
+     * @param aEnv pointer to JNI environment
+     * @param aErrorCode
+     * @param aHandle Handle.
+     * @param aErrorResult Result that is returned if error.
+     * @return Handle passed in is returned if no error otherwise the
+     * .aErrorResult is returned.
+     */
+    static TInt CheckErrorCodeAndHandle(
+        JNIEnv* aEnv, TInt aErrorCode, TInt aHandle, TInt aErrorResult);
+
+    /**
+     * Shows pop up dialog on the emulator
+     * @since Series S60 3.1
+     * @param aLine1
+     * @param aLine2
+    */
+#ifdef M2G_INFO_POPUP
+    static void PopupInfo(
+        const TDesC& aLine1,
+        const TDesC& aLine2);
+#endif // M2G_INFO_POPUP
+
+
+    /**
+    * Data array wrapper.
+    * @series Series S60 3.1
+    */
+    template <typename T>
+    class TDataArrayPtr
+    {
+
+    public: // METHODS
+        /**
+         * Ctor
+         */
+        TDataArrayPtr(T* aData = 0, TInt aSize = 0) : iData(aData), iSize(aSize) {}
+
+        /**
+         * Return pointer to a data
+         * @return Pointer
+         */
+        inline T* Begin()
+        {
+            return iData;
+        }
+
+        /**
+         * Check if data is valid
+         * @return ETrue if ok
+         */
+        inline TBool IsValid()
+        {
+            return (((iData != NULL) && (iSize > 0)) ? ETrue : EFalse);
+        }
+
+        /**
+         * Return data size
+         * @return Length
+         */
+        inline TInt Length()
+        {
+            return iSize;
+        }
+
+        /**
+         * Operator [] const
+         */
+        inline const T& operator[](TInt aIndex) const
+        {
+            return iData[ aIndex ];
+        }
+
+        /**
+         * Operator []
+         */
+        inline T& operator[](TInt aIndex)
+        {
+            return iData[ aIndex ];
+        }
+
+    private: // METHODS
+
+        /**
+         * Copy ctor
+         * @param aRhs Right side array
+         */
+        TDataArrayPtr(const TDataArrayPtr& aRhs);
+
+        /**
+         * Assignment operator
+         * @param aRhs Right side array
+         * @return Array object
+         */
+        TDataArrayPtr& operator=(const TDataArrayPtr& aRhs);
+
+    public: // VARIABLES
+        T* iData;
+        TInt iSize;
+    };
+
+
+    /**
+     * Statistic info
+     * @series Series S60 3.1
+     */
+#ifdef M2G_STATISTIC_DEBUG
+    class TM2GStatistic
+    {
+    public: // METHODS
+        /**
+         * Ctor
+         */
+        TM2GStatistic();
+
+        /**
+         * Reset
+         */
+        void Reset();
+
+        /**
+         * Print
+         * @param aPrintElapsedTime Print also en elapsed time
+         */
+        void Print(TBool aPrintElapsedTime = EFalse);
+
+        /**
+         * Print
+         * @param aStream
+         */
+        void Print(RWriteStream& aStream);
+
+    public: // STATIC METHODS
+        static void Log();
+
+    private: // METHODS
+        /**
+         * Copy ctor
+         */
+        TM2GStatistic(const TM2GStatistic&);
+
+        /**
+         * Assignment operator
+         */
+        TM2GStatistic& operator=(const TM2GStatistic&);
+
+    private: // VARIABLES
+        TTime iStartTime;
+        TTime iEndTime;
+        TThreadId iId;
+        TName iThreadName;
+    };
+#endif // M2G_STATISTIC_DEBUG
+
+private: // METHODS
+    /**
+     * Default constructor
+     */
+    M2GGeneral() {};
+
+    /**
+     * Copy constructor
+     */
+    M2GGeneral(const M2GGeneral&);
+
+    /**
+     * Assignment operator
+     */
+    M2GGeneral& operator=(const M2GGeneral&);
+};
+
+// MACROS
+// == TOOL MACROS ==
+#define M2G_MIN( a, b ) ( ( a ) <= ( b ) ? ( a ) : ( b ) )
+#define M2G_MAX( a, b ) ( ( a ) >= ( b ) ? ( a ) : ( b ) )
+
+// == SWITCHES ==
+#define M2G_NO_EXCEPTION_SWITCH
+// #define M2G_NO_NULL_POINTER_EXCEPTION_SWITCH
+
+#if defined( M2G_DEBUG )
+#define M2G_TRACE
+#endif
+
+// == EXCEPTION MACROS ==
+// Common exception handling
+#ifndef M2G_NO_EXCEPTION_SWITCH
+#define M2G_THROW( ERR_CODE ) /**/ User::Leave( ( ERR_CODE ) )
+#define M2G_THROW2( ERR_TEXT, ERR_CODE ) /**/ M2G_DEBUG_0( ERR_TEXT ); User::Leave( ( ERR_CODE ) )
+#else
+#define M2G_THROW( ERR_CODE ) /**/
+#define M2G_THROW2( ERR_TEXT, ERR_CODE ) /**/
+#endif // !M2G_NO_EXCEPTION_SWITCH
+
+// Null pointer exception handling
+#ifndef M2G_NO_NULL_POINTER_EXCEPTION_SWITCH
+#define M2G_CHECK_NULL_POINTER( JNI, POINTER ) /**/ M2GGeneral::CheckHandle( ( JNI, POINTER ) )
+#else
+#define M2G_CHECK_NULL_POINTER( JNI, POINTER ) /**/
+#endif // !M2G_NO_NULL_POINTER_EXCEPTION_SWITCH
+
+
+// == STATIC LOG MACROS ==
+#if defined( M2G_STATISTIC_DEBUG )
+#define M2G_STATISTIC_LOG /**/ M2GGeneral::TM2GStatistic::Log()
+#else // M2G_STATISTIC_DEBUG
+#define M2G_STATISTIC_LOG /**/
+#endif // !M2G_STATISTIC_DEBUG
+
+// == POPUP MACROS ==
+#if defined( M2G_INFO_POPUP )
+#define M2G_POPUP( LINE1, LINE2 ) /**/ M2GGeneral::PopupInfo( LINE1, LINE2 );
+#else // !M2G_INFO_POPUP
+#define M2G_POPUP( LINE1, LINE2 ) /**/
+#endif // M2G_INFO_POPUP
+
+// == TRACE MACROS ==
+#if defined( M2G_TRACE )
+#define M2G_DEBUG_0( TEXT ) /**/ \
+        RFileLogger::Write( KLogDirectory, KLogFileName, EFileLoggingModeAppend, _L( TEXT ) )
+
+#define M2G_DEBUG_1( TEXT, VAL1 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1 )
+
+#define M2G_DEBUG_2( TEXT, VAL1, VAL2 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1, VAL2 )
+
+#define M2G_DEBUG_3( TEXT, VAL1, VAL2, VAL3 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1, VAL2, VAL3 )
+
+#define M2G_DEBUG_4( TEXT, VAL1, VAL2, VAL3, VAL4 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1, VAL2, VAL3, VAL4 )
+
+#define M2G_DEBUG_5( TEXT, VAL1, VAL2, VAL3, VAL4, VAL5 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1, VAL2, VAL3, VAL4, VAL5 )
+
+#define M2G_DEBUG_6( TEXT, VAL1, VAL2, VAL3, VAL4, VAL5, VAL6 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1, VAL2, VAL3, VAL4, VAL5, VAL6 )
+
+#define M2G_DEBUG_7( TEXT, VAL1, VAL2, VAL3, VAL4, VAL5, VAL6, VAL7 ) /**/ \
+        RFileLogger::WriteFormat( KLogDirectory, KLogFileName, EFileLoggingModeAppend, /**/ \
+        _L( TEXT ), VAL1, VAL2, VAL3, VAL4, VAL5, VAL6, VAL7 )
+#else // !M2G_TRACE
+#define M2G_POPUP( LINE1, LINE2 ) /**/
+
+#define M2G_DEBUG_0( TEXT ) /**/
+#define M2G_DEBUG_1( TEXT, VAL1 ) /**/
+#define M2G_DEBUG_2( TEXT, VAL1, VAL2 ) /**/
+#define M2G_DEBUG_3( TEXT, VAL1, VAL2, VAL3 ) /**/
+#define M2G_DEBUG_4( TEXT, VAL1, VAL2, VAL3, VAL4 ) /**/
+#define M2G_DEBUG_5( TEXT, VAL1, VAL2, VAL3, VAL4, VAL5 ) /**/
+#define M2G_DEBUG_6( TEXT, VAL1, VAL2, VAL3, VAL4, VAL5, VAL6 ) /**/
+#define M2G_DEBUG_7( TEXT, VAL1, VAL2, VAL3, VAL4, VAL5, VAL6, VAL7 ) /**/
+#endif // M2G_TRACE
+
+// DATA TYPES
+typedef TInt TM2GSvgEngineHandle;
+typedef TInt TM2GSvgDocumentHandle;
+typedef TInt TM2GSvgElementHandle;
+typedef TInt TM2GBitmapHandle;
+typedef TInt TM2GSvgPathHandle;
+typedef TInt16 TM2GSvgAttrType;
+typedef TUint8 TM2GPixelComponent;
+
+//For Qimage related changes
+typedef TUint TM2GSvgBitmapHandle;
+
+typedef TFixedArray<TInt, 3> TM2GColorData;
+typedef TFixedArray<TReal32, 6> TM2GMatrixData;
+typedef M2GGeneral::TDataArrayPtr<TReal32> TM2GMatrixData2;
+typedef TFixedArray<TReal32, 4> TM2GRectData;
+typedef TFixedArray<TReal32, 4> TM2GScreenBBoxData;
+typedef TFixedArray<TReal32, 6> TM2GPathCurveData;
+
+
+M2G_NS_END
+
+//#if defined( __cplusplus )
+//} // extern "C"
+//#endif
+
+#endif // M2GGENERAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/M2GNamespace.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2005-2006 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:  Namespace definitions
+*
+*/
+
+#ifndef M2GNAMESPACE_H
+#define M2GNAMESPACE_H
+// INCLUDES
+
+// CONSTANTS
+
+// MACROS
+
+#define M2G_NO_NAMESPACE_SWITCH
+#ifndef M2G_NO_NAMESPACE_SWITCH
+#define M2G_NS_ /**/ m2g_namespace
+#define M2G_NS_START  /**/ namespace M2G_NS_ {
+#define M2G_NS_END /**/ }
+#define M2G_NS(X) /**/ ::M2G_NS_::X
+#define USING_WHOLE_M2G_NS /**/ using namespace ::M2G_NS_;
+#define USING_M2G_NS(X) /**/ using ::M2G_NS_::X;
+#else
+#define M2G_NS_ /**/
+#define M2G_NS_START  /**/
+#define M2G_NS_END /**/
+#define M2G_NS(X) /**/
+#define USING_WHOLE_M2G_NS /**/
+#define USING_M2G_NS(X) /**/
+#endif // !M2G_NO_NAMESPACE_SWITCH
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+#endif // M2GNAMESPACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/M2GUtils.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,463 @@
+/*
+* Copyright (c) 2005-2006 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:  General functions
+*
+*/
+
+#ifndef M2GUTILS_H
+#define M2GUTILS_H
+
+// INCLUDE FILES
+#include <gdi.h> // DisplayMode, Draw, BitBlt
+#include <fbs.h> // CFbsBitmap
+#include "M2GGeneral.h"
+#include <QPixmap>
+#include <jni.h>
+M2G_NS_START
+
+// CONSTANTS
+
+// DATA TYPES
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CFbsBitmapDevice;
+class CFbsBitGc;
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+
+//For UI Thread Execution.
+#include "CSynchronization.h"
+
+#define M2G_DO_LOCK CSynchronization::InstanceL()->Lock();
+
+
+//TODO Have to Raise Exception in case we find any error.
+#define M2G_DO_UNLOCK(aEnv) {\
+                    TInt errorCode = CSynchronization::InstanceL()->GetErrorCode();\
+                    CSynchronization::InstanceL()->Unlock();\
+                    }\
+
+/**
+ * @class M2GBitmapUtils
+ * @brief Static methods for alpha blending and bitmaps
+ */
+
+class M2GBitmapUtils
+{
+public: // STATIC METHODS
+    /**
+     * Blits two bitmap
+     * @since Series S60 3.0
+     * @param aTarget Target bitmap.
+     * @param aSource Source bitmap.
+     * @param aPoint Position for the top left corner of the bitmap.
+     * @param aRect  Rectangle defining the piece of the bitmap to be drawn.
+     * @param aSourceMask Mask.
+     * @return M2G_OK if ok
+     */
+    static TInt BitBlt(CFbsBitmap& aTarget,
+                       const CFbsBitmap& aSource,
+                       const TPoint& aPoint,
+                       const TRect* aRect = NULL,
+                       const CFbsBitmap* aSourceMask = NULL);
+
+    static TInt BitBlt(CBitmapContext& aTargetContext,
+                       const CFbsBitmap& aSource,
+                       const TPoint& aPoint,
+                       const TRect* aRect,
+                       const CFbsBitmap* aSourceMask,
+                       /*MSwtClient* aClientHandle,*/
+                       TBool aUseNativeClear = EFalse);
+    
+    static TInt BitQBlt(QImage& aTargetQimage,
+                                const QImage& aSourceQimage,
+                                const TPoint& aPoint,
+                                const TRect* aRect,
+                                const CFbsBitmap* aSourceMask);
+    
+    /**
+     * Checks if two bitmap are equal.
+     * @since Series S60 3.0
+     * @param aLhs Left side bitmap
+     * @param aRhs Right side bitmap
+     * @return ETrue if bitmaps are equal.
+     */
+    inline static TBool Equals(const CFbsBitmap& aLhs, const CFbsBitmap& aRhs)
+    {
+        return (aLhs.SizeInPixels() == aRhs.SizeInPixels());
+    }
+
+    /**
+     * Checks if a bitmap has same values as given values.
+     * @since Series S60 3.0
+     * @param aBitmap Bitmap
+     * @param aSz Size in pixels.
+     * @param aMode Display mode.
+     * @return ETrue if bitmaps are equal.
+     */
+    inline static TBool Equals(
+        const CFbsBitmap& aBitmap,
+        const TSize& aSz,
+        const TDisplayMode* aMode)
+    {
+        return (((aBitmap.SizeInPixels() == aSz) &&
+                 ((aMode == NULL) || (aBitmap.DisplayMode() == *aMode))
+                ) ? ETrue : EFalse);
+    }
+
+    /**
+     * Return byte per pixel
+     * @since Series S60 3.1
+     * @param aBitmap
+     * @param aRhs Right side bitmap
+     * @return ETrue if bitmaps are equal.
+     */
+    inline static TInt BytesPerPixel(const CFbsBitmap& aBitmap)
+    {
+        switch (aBitmap.DisplayMode())
+        {
+        case EGray256 :
+        case EColor256 :
+            return 1;
+        case EColor64K :
+            return 2;
+        case EColor16M :
+        case EColor16MU :
+        case EColor16MA :
+            return 4;
+        default :
+            return 0;
+        }
+    }
+
+};
+
+
+//-----------------------------------------------------------------------------
+// Creating integer 'handles' from C++ objects for referencing them inside Java
+// The shift garauntees a positive integer, so object creation native methods
+// can overload the return value to be a handle or an error code
+//
+// Unhanding the integer requires the destination type to be known, so is
+// implemented as a template function, it should be invoked as
+//
+//      CXyz* xyz=JavaUnhand(aHandle);
+//
+const TInt KJavaHandleShift=2;
+
+inline TInt JavaMakeHandle(const TAny* aObject)
+{
+    return reinterpret_cast<TUint>(aObject)>>KJavaHandleShift;
+}
+
+template <typename T>
+inline T* JavaUnhand(TInt aHandle)
+{
+    return reinterpret_cast<T*>(aHandle<<KJavaHandleShift);
+}
+
+//----------------------------------------------------------------------------
+/* Takes an EPOC string and returns a Java JNI string */
+inline jstring CreateJavaString(JNIEnv& aJni, const TDesC16& aString)
+{
+    const jchar* stringPtr = aString.Ptr();
+    const jsize stringLength = aString.Length();
+    jstring jniString = aJni.NewString(stringPtr, stringLength);
+    return jniString;
+}
+
+
+
+/**
+ * @class TM2GRenderRect
+ * @brief Class for handling rendering rectangle
+ */
+class TM2GRenderRect : public TRect
+{
+private:
+    // NOTE ELength should be always the last one and indexing
+    // should start from 0
+    enum TArrayIndexes
+    {
+        EAnchorX = 0,
+        EAnchorY = 1,
+        EClipX = 2,
+        EClipY = 3,
+        EClipW = 4,
+        EClipH = 5,
+        ELength
+    };
+
+public: // METHODS
+    /**
+     * Ctor
+     * @since Series S60 3.0
+     * @param aAnchorX X anchor
+     * @param aAnchorY Y anchor
+     * @param aClipX Clip x
+     * @param aClipY Clip y
+     * @param aClipWidth Clip width
+     * @param aClipHeight Clip height
+     */
+    TM2GRenderRect(
+        TInt aAnchorX, TInt aAnchorY,
+        TInt aClipX, TInt aClipY,
+        TInt aClipW, TInt aClipH);
+
+    /**
+     * Ctor
+     * @since Series S60 3.0
+     * @param aDimensions Dimensions. @see TArrayIndexes.
+     * @param aLength Array length
+     */
+    TM2GRenderRect(TInt* aDimensions, TInt aLength);
+
+    /**
+     * Copy ctor
+     * @since Series S60 3.0
+     * @param aRd
+     */
+    TM2GRenderRect(const TM2GRenderRect& aRd);
+
+    /**
+     * Assignment operator
+     * @since Series S60 3.0
+     * @param aRd
+     * @return TM2GRenderRect
+     */
+    TM2GRenderRect& operator=(const TM2GRenderRect& aRd);
+
+    /**
+     * Dtor
+     * @since Series S60 3.0
+     */
+    virtual ~TM2GRenderRect();
+
+    /**
+     * Returns x anchor
+     * @since Series S60 3.0
+     * @return X anchor
+     */
+    inline TInt GetAnchorX()
+    {
+        return iAnchorX;
+    }
+
+    /**
+     * Returns y anchor
+     * @since Series S60 3.0
+     * @return Y anchor
+     */
+    inline TInt GetAnchorY()
+    {
+        return iAnchorY;
+    }
+
+    /**
+     * Returns clip height
+     * @since Series S60 3.0
+     * @return Clip height
+     */
+    inline TInt GetClipH()
+    {
+        return Height();
+    }
+
+    /**
+     * Returns x clip
+     * @since Series S60 3.0
+     * @return X clip
+     */
+    inline TInt GetClipX()
+    {
+        return iTl.iX;
+    }
+
+    /**
+     * Returns y clip
+     * @since Series S60 3.0
+     * @return Y clip
+     */
+    inline TInt GetClipY()
+    {
+        return iTl.iY;
+    }
+
+    /**
+     * Returns clip width
+     * @since Series S60 3.0
+     * @return Clip width
+     */
+    inline TInt GetClipW()
+    {
+        return Width();
+    }
+
+    /**
+     * Sets x anchor
+     * @since Series S60 3.0
+     * @param aX X anchor
+     */
+    inline void SetAnchorX(TInt aX)
+    {
+        iAnchorX = aX;
+    }
+
+    /**
+     * Sets y anchor
+     * @since Series S60 3.0
+     * @param aY Y anchor
+     */
+    inline void SetAnchorY(TInt aY)
+    {
+        iAnchorY = aY;
+    }
+
+    /**
+     * Sets clip height
+     * @since Series S60 3.0
+     * @param aH Clip height
+     */
+    inline void SetClipH(TInt aH)
+    {
+        SetHeight(aH);
+    }
+
+    /**
+     * Sets x clip
+     * @since Series S60 3.0
+     * @param aX X clip
+     */
+    inline void SetClipX(TInt aX)
+    {
+        iTl.iX = aX;
+    }
+
+    /**
+     * Sets y clip
+     * @since Series S60 3.0
+     * @param aY Y clip
+     */
+    inline void SetClipY(TInt aY)
+    {
+        iTl.iY = aY;
+    }
+
+    /**
+     * Sets clip width
+     * @since Series S60 3.0
+     * @param aW Clip width
+     */
+    inline void SetClipW(TInt aW)
+    {
+        SetWidth(aW);
+    }
+
+public: // STATIC METHODS
+    /**
+     * Gets region size
+     * @since Series S60 3.0
+     * @param aRect Render dimensions
+     * @param aSz Source surface size
+     * @return Region size to be paint
+     */
+    static TSize GetRegionSizeInPixels(
+        TM2GRenderRect& aRect,
+        const TSize& aSz);
+
+public: // VARIABLES
+    TInt iAnchorX;
+    TInt iAnchorY;
+};
+
+
+/**
+ * @class TM2GBitmapLock
+ * @brief Bitmap autolocker
+ */
+class TM2GBitmapLock
+{
+public: // METHODS
+    /**
+     * Ctor
+     * @param aBitmap Bitmap
+     * @param aLock If ETrue then bitmap is locked by ctor.
+     */
+    TM2GBitmapLock(const CFbsBitmap* aBitmap, TBool aLock = ETrue);
+
+    /**
+     * Dtor
+     * @since Series S60 3.0
+     */
+    virtual ~TM2GBitmapLock();
+
+    /**
+     * Locks bitmap heap
+     * @since Series S60 3.0
+     */
+    void Lock();
+
+    /**
+     * Unlocks bitmap heap
+     * @since Series S60 3.0
+     */
+    void Unlock();
+
+protected: // METHODS
+    /**
+     * Copy ctor
+     * @since Series S60 3.0
+     * @param aRd
+     */
+    TM2GBitmapLock(const TM2GBitmapLock& aRd);
+
+    /**
+     * Assignment operator
+     * @since Series S60 3.0
+     * @param aRd
+     * @return TM2GBitmapLock
+     */
+    TM2GBitmapLock& operator=(const TM2GBitmapLock& aRd);
+
+public: // VARIABLES
+    const CFbsBitmap* iBitmap;
+    TBool iIsLocked;
+};
+class TSWTBitBlt/*: public MSwtFunctor*/
+{
+public:
+    TSWTBitBlt(CBitmapContext& aTargetContext,
+               const TPoint& aPoint,
+               const CFbsBitmap* aBitmap,
+               const TRect* aSourceRect,
+               const CFbsBitmap* aMaskBitmap,
+               TBool aUseNativeClear);
+
+    void operator()() const;
+    CBitmapContext& iTargetContext;
+    const TPoint iPoint;
+    const CFbsBitmap* iBitmap;
+    const TRect* iRect;
+    const CFbsBitmap* iMaskBitmap;
+    TBool iUseNativeClear;
+};
+M2G_NS_END
+
+
+#endif // M2GUTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/MM2GRenderContext.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2005-2006 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:  Render context interface
+*
+*/
+
+#ifndef MM2GRENDERCONTEXT_H
+#define MM2GRENDERCONTEXT_H
+
+//  INCLUDES
+#include <gdi.h> // TDisplayMode
+#include "M2GUtils.h"
+
+M2G_NS_START
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+ * Interface class
+ */
+class MM2GRenderContext
+{
+public: // STATIC CONSTANTS
+    static const TReal32        KFullOpaque;
+    static const TReal32        KFullTransparency;
+    static const TUint8         KMaxAlphaValue;
+    static const TDisplayMode   KDefaultDisplayMode;
+    static const TDisplayMode   KMaskDisplayMode;
+
+public: // METHODS
+
+    /**
+     * Dtor
+     */
+    virtual ~MM2GRenderContext() {};
+
+    /**
+     * Binds device's bitmap.
+     * @since Series S60 3.1
+     * @param aGraphicsHandle Target graphics handle
+     * @throws exception if not ok
+     */
+    virtual void BindL(TInt& aGraphicsHandle) = 0;
+
+    /**
+     * SVG image bitmap is (re)created if needed.
+     * @since Series S60 3.1
+     * @see MM2GRenderContext::SetRefreshModeL()
+     * @throws exception if not ok
+     */
+    virtual void InitImageBitmapL() = 0;
+
+    /**
+     * Blits an svg and a device bitmaps
+     * @since Series S60 3.1
+     * @throws M2G_OK if ok
+     * @throws exception if not ok
+     */
+    virtual void ReleaseL() = 0;
+
+    /**
+     * Renders a SVG document at a current time.
+     *
+     * <p> The rendering is done in 2 steps:
+     * <li> render the document on an internal SVG buffer (iSvg)
+     * <li> alpha-blend it with the bound graphics target (iGraphicsBitmap)
+     *
+     * @note if transparency factor is not set, iSvg is simply blitted onto iGraphicsTarget
+     *
+     * @param aSvgDocumentHandle handle to SVG document
+     * @param aCurrentTime       the current time of the animation
+     * @param aSvgW              Svg image viewport width
+     * @param aSvgH              Svg image viewport height
+     * @param aRect              contains position about the rendered area
+     * @since S60 3.1
+     */
+
+
+    virtual void  RenderLCDUIL(
+        TM2GSvgDocumentHandle& aSvgDocHandle,
+        const TReal32 aCurrentTime,
+        TInt aSvgW,
+        TInt aSvgH,
+        TM2GRenderRect& aRect) = 0 ;
+
+    virtual void RenderESWTL(
+        TM2GSvgDocumentHandle& aSvgDocHandle,
+        const TReal32 aCurrentTime,
+        TInt aSvgW,
+        TInt aSvgH,
+        TM2GRenderRect& aRect,        
+        TBool aUseNativeClear,
+        TInt* aReturnData) = 0;
+
+    /**
+     * Sets render quality
+     * @since Series S60 3.1
+     * @param aMode Mode
+     * @throws exception if not ok
+     */
+    virtual void SetRenderingQualityL(TInt aMode) = 0;
+
+    /**
+     * Sets transparency
+     * @since Series S60 3.1
+     * @param aAlpha Alpha factor
+     * @throws exception if not ok
+     */
+    virtual void SetTransparency(TReal32 aAlpha) = 0;
+
+};
+
+M2G_NS_END
+#endif // MM2GRENDERCONTEXT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/inc/MM2GSVGProxy.h	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,854 @@
+/*
+* Copyright (c) 2005-2006 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:  SVGTopt proxy interface
+*
+*/
+
+#ifndef MM2GSVGPROXY_H
+#define MM2GSVGPROXY_H
+
+//  INCLUDES
+#include "M2GUtils.h"
+
+M2G_NS_START
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+/**
+ * Interface class
+ */
+class MM2GSVGProxy
+{
+public: // METHODS
+
+    /**
+     * Dtor
+     */
+    virtual ~MM2GSVGProxy() {};
+
+    /**
+     * Add close to the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @throws exception if not ok
+     */
+    virtual void AddCloseL(const TM2GSvgPathHandle& aPathHandle) = 0;
+
+    /**
+     * Add curve to the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aPathCurveData Curve data
+     * @throws exception if not ok
+     */
+    virtual void AddCurveToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TM2GPathCurveData& aPathCurveData) = 0;
+
+    /**
+     * Add line to the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aX -
+     * @param aY -
+     * @throws exception if not ok
+     */
+    virtual void AddLineToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TReal32& aX, const TReal32& aY) = 0;
+    /**
+     * Add move to the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aX -
+     * @param aY -
+     * @throws exception if not ok
+     */
+    virtual void AddMoveToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TReal32& aX, const TReal32& aY) = 0;
+
+    /**
+     * Add quad to the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aX1 -
+     * @param aY1 -
+     * @param aX2 -
+     * @param aY2 -
+     * @throws exception if not ok
+     */
+    virtual void AddQuadToL(
+        const TM2GSvgPathHandle& aPathHandle,
+        const TReal32& aX1, const TReal32& aY1,
+        const TReal32& aX2, const TReal32& aY2) = 0;
+
+    /**
+     * Append child
+     * @since Series S60 3.1
+     * @param aElementHandle
+     * @param aChildElementHandle
+     * @throws exception if not ok
+     */
+    virtual void AppendChildL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgElementHandle& aChildElementHandle) = 0;
+
+    /**
+     * Set the begin animation time for the given element.
+     * @since Series S60 3.1
+     * @param aDocumentHandle
+     * @param aElementHandle
+     * @param aOffset
+     * @throws exception if not ok
+     */
+    virtual void BeginElementAtL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle,
+        const TReal32& aOffset) = 0;
+
+    /**
+     * Check if element is removable
+     * @since Series S60 3.1
+     * @param aSurfaceHandle
+     * @param aRemoveable Result
+     * @throws exception if not ok
+     */
+    virtual void CheckRemoveableL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aRemoveable) = 0;
+
+
+    /**
+     * Clear svg surface
+     * @since Series S60 3.1
+     * @param aSurfaceHandle Surface handle
+     * @throws exception if not ok
+     */
+    virtual void ClearSvgSurfaceL(const TM2GSvgDocumentHandle& aSurfaceHandle) = 0;
+
+    /**
+     * Create document
+     * @since Series S60 3.1
+     * @param aData Document content
+     * @param aDocumentHandle Document handle to be returned
+     * @throws exception if not ok
+     */
+    virtual void CreateDocumentL(
+        const TPtrC16& aData,
+        TM2GSvgDocumentHandle& aDocumentHandle) = 0;
+
+    /**
+     * Create svg engine
+     * @since Series S60 3.1
+     * @param aEngineHandle Svg engine handle
+     * @throws exception if not ok
+     */
+    virtual void CreateSvgEngineL(TM2GSvgEngineHandle& aEngineHandle) = 0;
+
+    /**
+     * Create path
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle to be returned
+     * @throws exception if not ok
+     */
+    virtual void CreatePathL(TM2GSvgPathHandle& aPathHandle) = 0;
+
+    /**
+     * Create svg surface
+     * @since Series S60 3.1
+     * @param aWidth Surface width
+     * @param aHeight Surface height
+     * @return Svg surface
+     * @throws exception if not ok
+     */
+    virtual TM2GBitmapHandle CreateSvgSurfaceL(TInt aWidth, TInt aHeight) = 0;
+
+    /**
+     * Create new element
+     * @since Series S60 3.1
+     * @param aType Element type id
+     * @param aParentHandle Parent of the new element.
+     * Note: Can be '0' if element is not added to DOM.
+     * @param aDocumentHandle Document handle.
+     * @param aRootHandle Root element handle.
+     * @param aEngineHandle Element handle to be returned
+     * @throws exception if not ok
+     */
+    virtual void CreateElementNsL(
+        const TM2GSvgAttrType& aType,
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TM2GSvgElementHandle& aEngineHandle) = 0;
+
+    /**
+     * Delete document
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle
+     * @throws exception if not ok
+     */
+    virtual void DeleteDocumentL(const TM2GSvgDocumentHandle& aDocumentHandle) = 0;
+
+    /**
+     * Delete svg engine
+     * @since Series S60 3.1
+     * @param aEngineHandle Engine handle
+     * @throws exception if not ok
+     */
+    virtual void DeleteSvgEngineL(const TM2GSvgEngineHandle& aEngineHandle) = 0;
+
+    /**
+     * Deletes svg surface
+     * @since Series S60 3.1
+     * @param aSurfaceHandle Surface handle
+     * @throws exception if not ok
+     */
+    virtual void DeleteSvgSurfaceL(const TM2GSvgDocumentHandle& aSurfaceHandle) = 0;
+
+    /**
+     * Delete path
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle
+     * @throws exception if not ok
+     */
+    virtual void DestroyPathL(const TM2GSvgPathHandle& aPathHandle) = 0;
+
+    /**
+     * Dispatches a mouse event
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aX X coordinate.
+     * @param aY Y coordinate
+     * @param aElementHandle Target element handle
+     * @throws exception if not ok
+     */
+    virtual void DispatchMouseEventL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aX, TInt aY, TM2GSvgElementHandle& aElementHandle) = 0;
+
+    /**
+     * Set the end animation time for the given element.
+     * @since Series S60 3.1
+     * @param aDocumentHandle
+     * @param aElementHandle
+     * @param aOffset
+     * @throws exception if not ok
+     */
+    virtual void EndElementAtL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle,
+        const TReal32& aOffset) = 0;
+
+
+    /**
+     * Set focus on.
+     * @since Series S60 3.1
+     * @param aDocumentHandle
+     * @param aElementHandle
+     * @throws exception if not ok
+     */
+    virtual void FocusOnL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle) = 0;
+
+    /**
+     * Set focus out.
+     * @since Series S60 3.1
+     * @param aDocumentHandle
+     * @param aElementHandle
+     * @throws exception if not ok
+     */
+    virtual void FocusOutL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle) = 0;
+
+    /**
+     * Get a bounding box
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aRectData Rect components are saved to this parameter
+     * @param aResult Result
+     * @throws exception if not ok
+     */
+    virtual void GetBBoxL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GRectData& aRectData, TInt& aResult) = 0;
+
+    /**
+     * Get colors
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle
+     * @param aAttributeType Attribute type
+     * @param aColor Result
+     * @param aResult Extra result info
+     * @throws exception if not ok
+     */
+    virtual void GetColorTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GColorData& aColor,
+        TInt& aResult) = 0;
+
+    /**
+     * Get element by id
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aId Element id
+     * @param aElementHandle Element handle to be returned
+     * @throws exception if not ok
+     */
+    virtual void GetElementByIdL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TPtrC16& aId,
+        TM2GSvgElementHandle& aElementHandle) = 0;
+
+    /**
+     * Get element by id
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aId Result element type id.
+     * @throws exception if not ok
+     */
+    virtual void GetElementTypeIdL(const TM2GSvgElementHandle& aElementHandle, TInt16& aId) = 0;
+
+    /**
+     * Get an enumeration value of the specified attribute.
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aEnumTraiT Enum attribute.
+     * @throws exception if not ok
+     */
+    virtual void GetEnumTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TInt16& aEnumTrait) = 0;
+
+    /**
+     * Get external list item
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aIndex Index.
+     * @param aItem Returns external item according to a given index
+     * @return KErrNone if no error
+     * @throws Exception if not ok
+     */
+    virtual TInt GetExternalListItemL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aIndex,
+        TPtrC16& aItem) = 0;
+
+    /**
+     * Get external list size
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aListSz Size.
+     * @throws exception if not ok
+     */
+    virtual void GetExternalListSizeL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt& aListSz) = 0;
+
+    /**
+     * Get a first chlid element
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aChildHandle Returns child element handle.
+     * @throws exception if not ok
+     */
+    virtual void GetFirstElementChildL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aChildHandle) = 0;
+
+    /**
+     * Get a float trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param Float trait
+     * @throws exception if not ok
+     */
+    virtual void GetFloatTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TReal32& aFloatTrait) = 0;
+
+    /**
+     * Get a matrix trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aMatrix Matrix trait
+     * @param aResult
+     * @throws exception if not ok
+     */
+    virtual void GetMatrixTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GMatrixData& aMatrix, TInt& aResult) = 0;
+
+    /**
+     * Get a media time
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aSeconds Media time to be returned
+     * @throws exception if not ok
+     */
+    virtual void GetMediaTimeL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TReal32& aSeconds) = 0;
+
+    /**
+     * Get a next element sibling
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aSiblingElementHandle Sibling handle
+     * @throws exception if not ok
+     */
+    virtual void GetNextElementSiblingL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aSiblingElementHandle) = 0;
+
+    /**
+     * Get the segment count for the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aNumberOfSegments Segment count
+     * @throws exception if not ok
+     */
+    virtual void GetNumberOfSegmentsL(
+        const TM2GSvgPathHandle& aPathHandle,
+        TInt& aNumberOfSegments) = 0;
+
+    /**
+     * Get a parent
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aParentElementHandle Parent Element handle
+     * @throws exception if not ok
+     */
+    virtual void GetParentL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aParentElementHandle) = 0;
+
+    /**
+     * Get a path trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aPathTrait Path trait
+     * @throws exception if not ok
+     */
+    virtual void GetPathTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TInt& aPathTrait) = 0;
+
+    /**
+     * Get a rect trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aRectData Rect components are saved to this parameter
+     * @param aResult Result
+     * @throws exception if not ok
+     */
+    virtual void GetRectTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TM2GRectData& aRectData, TInt& aResult) = 0;
+
+    /**
+     * Get a root element
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aRootElementHandle Root element handle
+     * @throws exception if not ok
+     */
+    virtual void GetRootElementL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TM2GSvgElementHandle& aRootElementHandle) = 0;
+
+    /**
+     * Get screen b box
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle
+     * @param aScreenBBoxData Screen box data out
+     * @throws exception if not ok
+     */
+    virtual void GetScreenBBoxL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GScreenBBoxData& aScreenBBoxData) = 0;
+
+    /**
+     * Get the segment parameter for the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aSegmentIndex -
+     * @param aParamIndex -
+     * @param aSegmentParam Segment parameter to be returned.
+     * @throws exception if not ok
+     */
+    virtual void GetSegmentParameterL(
+        const TM2GSvgPathHandle& aPathHandle,
+        TInt aSegmentIndex, TInt aParamIndex,
+        TReal32& aSegmentParam) = 0;
+
+    /**
+     * Get the segment type for the given path.
+     * @since Series S60 3.1
+     * @param aPathHandle Path handle.
+     * @param aSegmentIndex -
+     * @param aSegmentType Segment type
+     * @throws exception if not ok
+     */
+    virtual void GetSegmentTypeL(
+        const TM2GSvgPathHandle& aPathHandle,
+        TInt aSegmentIndex,
+        TInt16& aSegmentType) = 0;
+
+    /**
+     * Get a string trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type.
+     * @param aStr Returns a string attribute
+
+     * @throws exception if not ok
+     */
+    virtual TInt GetStringTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TPtrC16& aStr) = 0;
+    /**
+     * Get a svg surface height
+     * @since Series S60 3.1
+     * @param aSurfaceHandle Surface handle.
+     * @return Svg surface height
+     * @throws exception if not ok
+     */
+    virtual TInt GetSvgSurfaceHeightL(const TM2GBitmapHandle& aSurfaceHandle) = 0;
+
+    /**
+     * Get a svg surface width
+     * @since Series S60 3.1
+     * @param aSurfaceHandle Surface handle.
+     * @return Svg surface width
+     * @throws exception if not ok
+     */
+    virtual TInt GetSvgSurfaceWidthL(const TM2GBitmapHandle& aSurfaceHandle) = 0;
+
+    /**
+     * Finds handle to the actual cloned element
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aHandle Element handle to be returned
+     * @throws exception if not ok
+     */
+    virtual void GetUsedFromElementL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TM2GSvgElementHandle& aHandle) = 0;
+
+    /**
+     * Viewport height.
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aHeight Wieport height to be returned.
+     * @throws exception if not ok
+     */
+    virtual void GetViewportHeightL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt& aHeight) = 0;
+
+    /**
+     * Viewport width.
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aWidth Viewport width.
+     * @throws exception if not ok
+     */
+    virtual void GetViewportWidthL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt& aWidth) = 0;
+
+    /**
+     * Init native engine & document
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle
+     * @throws exception if not ok
+     */
+    virtual void InitViewportL(
+        const TM2GSvgDocumentHandle& aDocumentHandle) = 0;
+
+    /**
+     * Add given child element to the given element before
+     * the given reference element.
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aNewChildElementHandle Child element handle.
+     * @param aReferenceElementHandle Child element handle.
+     * @throws exception if not ok
+     */
+    virtual void InsertBeforeL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgElementHandle& aNewChildElementHandle,
+        const TM2GSvgElementHandle& aReferenceElementHandle) = 0;
+
+    /**
+     * Check if element is active.
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aActive Return "1" if active
+     * @throws exception if not ok
+     */
+    virtual void IsActiveL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aActive) = 0;
+
+    /**
+     * Checks if an element in DOM.
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aElementHandle Element handle.
+     * @param aIsElementInDom Result.
+     * @throws exception if not ok
+     */
+    virtual void IsElementInDomL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aIsElementInDom) = 0;
+
+    /**
+     * Checks whether this element is child of a use element
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aResult Return "1" if used otherwise returns "0"
+     * @throws exception if not ok
+     */
+    virtual void IsUsedL(
+        const TM2GSvgElementHandle& aElementHandle,
+        TInt& aResult) = 0;
+
+    /**
+     * Remove child
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aURI Uri
+     * @param aResourceData Resource
+     * @param aHandle Removed element handle
+     * @throws exception if not ok
+     */
+    virtual void RemoveChildL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgElementHandle& aChildElementHandle,
+        TM2GSvgElementHandle& aHandle) = 0;
+    /**
+     * Render document
+     * @since Series S60 3.1
+     * @param aEngineHandle Engine handle.
+     * @param aDocumentHandle Document handle.
+     * @param aSurfaceHandle Surface.
+     * @param aSurfaceMaskHandle Mask.
+     * @throws exception if not ok
+     */
+    virtual void RenderDocumentL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GBitmapHandle& aSurfaceHandle,
+        TM2GBitmapHandle aSurfaceMaskHandle,
+        TReal32 aCurrentTime) = 0;
+
+//    pankaj Qimage related changes TODO following Changes done 
+    virtual void RenderDocumentL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TM2GSvgBitmapHandle& aSurfaceHandle,
+        TM2GSvgBitmapHandle aSurfaceMaskHandle,
+        TReal32 aCurrentTime)=0;
+    
+    /**
+     * Sets render quality
+     * @since Series S60 3.1
+     * @param aEngineHandle Engine handle.
+     * @param aQuality Quality.
+     * @throws exception if not ok
+     */
+    virtual void RenderQualityL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        TInt aQuality) = 0;
+
+    /**
+     * Request completed
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aURI -
+     * @param aResourceData -
+     * @param aCompeleted Result
+     * @throws exception if not ok
+     */
+    virtual void RequestCompletedL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TPtrC16& aURI,
+        const TPtrC8& aResourceData,
+        TInt& aCompleted) = 0;
+
+    /**
+     * Set color trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aColor Color components: RGB
+     * @throws exception if not ok
+     */
+    virtual void SetColorTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GColorData& aColor) = 0;
+
+    /**
+     * Set enum trait
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aValue Value
+     * @throws exception if not ok
+     */
+    virtual void SetEnumTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        TInt16 aValue) = 0;
+
+    /**
+     * Set float attribute
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aValue Value
+     * @throws exception if not ok
+     */
+    virtual void SetFloatTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TReal32& aValue) = 0;
+
+    /**
+     * Set matrix attribute
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aMatrix -
+     * @throws exception if not ok
+     */
+    virtual void SetMatrixTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GMatrixData& aMatrix) = 0;
+
+    /**
+     * Set media time
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document handle.
+     * @param aSeconds Media time
+     * @throws exception if not ok
+     */
+    virtual void SetMediaTimeL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        const TReal32& aSeconds) = 0;
+
+    /**
+     * Set path attribute
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aPathHandle -
+     * @throws exception if not ok
+     */
+    virtual void SetPathTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GSvgPathHandle& aPathHandle) = 0;
+
+    /**
+     * Set rect attribute
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aRect Rect trait to be set
+     * @throws exception if not ok
+     */
+    virtual void SetRectTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeType,
+        const TM2GRectData& aRect) = 0;
+
+    /**
+     * Set render quality
+     * @since Series S60 3.1
+     * @param aEngineHandle Engine handle.
+     * @param aMode
+     * @throws exception if not ok
+     */
+    virtual void SetRenderingQualityL(
+        const TM2GSvgEngineHandle& aEngineHandle,
+        TInt aMode) = 0;
+
+    /**
+     * Set string attribute
+     * @since Series S60 3.1
+     * @param aElementHandle Element handle.
+     * @param aAttributeType Attribute type
+     * @param aStr String trait to be set
+     * @throws exception if not ok
+     */
+    virtual void SetStringTraitL(
+        const TM2GSvgElementHandle& aElementHandle,
+        const TM2GSvgAttrType& aAttributeTypeId,
+        const TPtrC16& aStr) = 0;
+
+    /**
+     * Set viewport height
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document
+     * @param aWidth Width
+     * @throws exception if not ok
+     */
+    virtual void SetViewportHeightL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aHeight) = 0;
+
+    /**
+     * Set viewport width
+     * @since Series S60 3.1
+     * @param aDocumentHandle Document
+     * @param aWidth Width
+     * @throws exception if not ok
+     */
+    virtual void SetViewportWidthL(
+        const TM2GSvgDocumentHandle& aDocumentHandle,
+        TInt aWidth) = 0;
+};
+
+M2G_NS_END
+
+#endif // MM2GSVGPROXY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/ESWTScalableGraphics.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import javax.microedition.m2g.ScalableGraphics;
+import javax.microedition.m2g.ScalableImage;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.*;
+
+public class ESWTScalableGraphics
+{
+    Display iDisplay = null;
+    Rectangle iCanvasBounds = null;
+    ScalableGraphics iSg = null;
+    GC iBufferGC = null;
+    GC iRealGC = null;
+    Image iBufferedImage = null;
+
+    public ESWTScalableGraphics(Display display)
+    {
+				
+				
+        iSg = ScalableGraphics.createInstance();
+        iDisplay = display;
+    }
+
+    public ESWTScalableGraphics(Display display, Rectangle canvasBounds)
+    {
+				
+        iSg = ScalableGraphics.createInstance();
+        iDisplay = display;
+        iCanvasBounds = canvasBounds;
+    }
+
+    public void setBounds(Rectangle canvasBounds)
+    {
+        iCanvasBounds = canvasBounds;
+    }
+
+    public void bindTarget(GC gc)
+    {
+				
+        iRealGC = gc;
+        iBufferedImage = new Image(iDisplay, iCanvasBounds);
+        iBufferGC = new GC(iBufferedImage);
+        iSg.bindTarget(iBufferGC);
+    }
+
+    public void releaseTarget()
+    {
+    		
+
+        iSg.releaseTarget();
+        iBufferedImage.dispose();
+        iBufferGC.dispose();
+        /* iRealGC is disposed in paintControl */
+        iRealGC = null;
+    }
+
+    public void render(int x, int y, ScalableImage image)
+    {
+    		
+        iSg.render(x,y, image);
+        iRealGC.drawImage(iBufferedImage, x, y);
+    }
+
+    public void setRenderingQuality(int mode)
+    {
+    		
+        iSg.setRenderingQuality(mode);
+    }
+
+    public void setTransparency(float alpha)
+    {
+    		
+        iSg.setTransparency(alpha);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GDOMChangeObserver.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2005-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 com.nokia.microedition.m2g;
+
+/**
+ * Anyone implementing this interface will receive notifications
+ * about changes in DOM.
+ * <br>
+ * Subject              = M2GDocument
+ * Observer/listener    = M2GSVGCanvas
+ * <br>
+ * M2GSVGCanvas from M2GSVGAnimator implements this in order to be notified
+ * about changes in DOM, so that SVGImage updates
+ * (via the API, e.g. setTrait(), insertBefore()) will be rendered
+ * while Animator is in pause state.
+ * <br>
+ * M2GSVGElement informs M2GDocument about changes in DOM
+ * (e.g. adding/removing nodes, changing traits),
+ * and then M2GDocument informs M2GSVGCanvas.
+ * <br>
+ * @since S60 3.2
+ */
+public interface M2GDOMChangeObserver
+{
+    /**
+     * Notifies about any change in DOM
+     */
+    public void notifyDOMChange();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GDestroyable.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+//import com.nokia.mj.impl.rt.legacy.ToolkitInvoker;
+//import com.nokia.mj.impl.rt.legacy.ToolkitObserver;
+
+/**
+ * Interface
+ */
+public interface M2GDestroyable
+{
+    /**
+     * Finalization
+     */
+    void doDestroy();
+}
+
+//--------------------------------------------------
+// OTHER CLASSES
+//--------------------------------------------------
+/**
+ * M2GDestroyer implements the ToolkitObserver interface.
+ */
+class M2GDestroyer
+{
+    private M2GDestroyable iDestroyable;
+
+    /**
+     * Ctor
+     * @param aDestroyable Destroy target
+     */
+    M2GDestroyer(M2GDestroyable aDestroyable)
+    {
+        if (aDestroyable != null)
+        {
+            iDestroyable = aDestroyable;
+        }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GDocument.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1339 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.*;
+import org.w3c.dom.events.*;
+import org.w3c.dom.svg.SVGElement;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.lang.ref.WeakReference;
+import java.util.Vector;
+import java.util.Enumeration;
+import javax.microedition.m2g.*;
+import com.nokia.microedition.m2g.connection.*;
+import com.nokia.mj.impl.utils.Logger;
+
+public class M2GDocument extends M2GObject
+        implements Document, M2GConnectionPolicyHandler
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    // Error constants
+    /* Optimization: static finals changed to local variables
+    public static final String UNSUPORTED_ELEMENT_TYPE_ESTR =
+      "The type of element is not supported by the implementation.";
+    public static final String UNSUPORTED_NAMESPACE_ESTR =
+      "The URI is not the SVG namespace URI.";
+    public static final String ID_IS_NULL_ESTR =
+      "The ID is null.";
+    public static final String NAMESPACE_URI_IS_NULL_ESTR =
+      "The namespace URI is null.";
+    public static final String QUALIFIED_NAME_IS_NULL_ESTR =
+      "The qualifiedName is null.";
+    public static final String CANNOT_APPEND_CHILD_ESTR =
+      "Cannot appendChild to a Document node.";
+    public static final String CANNOT_INSERT_BEFORE_ESTR =
+      "Cannot insertBefore a Document node.";
+    public static final String CANNOT_REMOVE_CHILD_ESTR =
+      "Cannot removeChild from a Document node.";
+    public static final String DOCUMENT_IS_ILLEGAL_ESTR =
+      "The SVG document does not conform to the XML 1.0 specification.";
+    public static final String HEIGHT_IS_ILLEGAL_ESTR =
+      "The height is negative.";
+    public static final String WIDTH_IS_ILLEGAL_ESTR =
+      "The width is negative.";
+    */
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GEventDispatcher iEventDispatcher = null;
+    private ExternalResourceHandler iResourceHandler = null;
+    private M2GSVGImage iImage = null;
+    private M2GSVGSVGElement iRootElement = null;
+    private final M2GLiveElements iLiveElements = new M2GLiveElements(true);
+    private M2GConnectionPolicy iConnectionPolicy =
+        M2GConnectionFactory.getDefaultPolicy();
+    boolean iConnectionRight = true;
+    Vector iExternalResources = new Vector();
+
+    /** A base url from where a document was downloaded */
+    String iBaseUrl;
+
+    /** The suffix of the url from where the document was open*/
+    String iSuffixUrl;
+
+    /**
+       * Observer to be notified about changes in DOM
+       * @see M2GDOMChangeObserver.notifyDOMChange()
+       */
+    private M2GDOMChangeObserver  iDOMChangeObserver = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Creates new document object. If aData is null or empty then
+     * an empty document is create.
+     * @param aImage Svg image
+    * @param aBaseUrl A base url from where a document is downloaded.
+     * @param aSuffixUrl A suffix url from where a document is downloaded
+     * @param aData Plain text svg data
+     */
+    public M2GDocument(M2GSVGImage aImage, String aBaseUrl, String aSuffixUrl,
+                       String aData)
+    {
+        super();
+        
+     		
+        iImage      = aImage;
+        iBaseUrl    = aBaseUrl;
+        iSuffixUrl  = aSuffixUrl;
+
+        setHandle(_createDocument(
+                      getNativeSVGProxyHandle(),
+                      aData)
+                 );
+
+        doConstruct();
+    }
+
+    /**
+    * @see org.w3c.dom.Node#appendChild()
+     */
+    public Node appendChild(Node newChild) throws DOMException
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "appendChild() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        Logger.ELOG(Logger.EJavaUI, "appendChild() - exception: "
+                    + /*SF*/"Cannot appendChild to a Document node."/*SF*/);
+        throw new DOMException(
+            DOMException.HIERARCHY_REQUEST_ERR,
+            /*SF*/"Cannot appendChild to a Document node."/*SF*/);
+    }
+
+    /**
+     * Appends external resource uri to internal container
+     * @param aUri External resource uri
+     * @return true if succeeds
+       */
+    boolean appendExternalResourceURI(String aUri)
+    {
+        boolean result = false;
+        if (aUri != null && !aUri.equals(""))
+        {
+            synchronized (iExternalResources)
+            {
+                if (!iExternalResources.contains(aUri))
+                {
+                    iExternalResources.addElement(aUri);
+                    result = true;
+                }
+            }
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "appendExternalResourceURI() uri=" +
+                   ((aUri != null) ? aUri : "null") + ", result=" + result + " - end");
+        return result;
+    }
+
+    /**
+     * Checks if document contains the element
+     * @param id
+     * @return true if document contains the element
+     */
+    public boolean containsElement(String id)
+    {
+        if (id == null || id.equals(""))
+        {
+            return false;
+        }
+        int handle = _getElementById(
+                         getNativeSVGProxyHandle(),
+                         getHandle(), id);
+        return M2GObject.checkHandle(handle);
+    }
+
+    /**
+     * Check if external resource uri exists in internal container
+     * @param aUri External resource uri
+     * @return true if uri exists in container
+     */
+    boolean containsExternalResourceURI(String aUri)
+    {
+        boolean result = false;
+        if (aUri != null && !aUri.equals(""))
+        {
+            synchronized (iExternalResources)
+            {
+                result = iExternalResources.contains(aUri);
+            }
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "containsExternalResourceURI() uri=" +
+                   ((aUri != null) ? aUri : "null") + ", result=" + result + " - end");
+        return result;
+    }
+
+
+    /**
+     * @see org.w3c.dom.Document#createElementNS()
+     */
+    public Element createElementNS(String namespaceURI, String qualifiedName)
+    {
+        if (namespaceURI == null || namespaceURI.equals(""))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "createElementNS() exception because namespace is null. qualifiedName="
+                        + qualifiedName);
+            throw new NullPointerException(/*SF*/"The namespace URI is null."/*SF*/);
+        }
+        if (qualifiedName == null || qualifiedName.equals(""))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "createElementNS() exception - " + namespaceURI + ", "
+                        + qualifiedName);
+            throw new NullPointerException(/*SF*/"The qualifiedName is null."/*SF*/);
+        }
+        // Checks element validity
+        if (!M2GSVGConstants.isQualifiedElement(qualifiedName))
+        {
+            Logger.ELOG(Logger.EJavaUI, "createElementNS() exception - "
+                        + namespaceURI + ", " + qualifiedName);
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"The type of element is not supported by the implementation."/*SF*/);
+        }
+        // Checks namespace validity
+        if (!namespaceURI.equals(M2GSVGConstants.SVG_NAMESPACE_URI))
+        {
+            Logger.ELOG(Logger.EJavaUI, "createElementNS() exception - "
+                        + namespaceURI + ", " + qualifiedName);
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"The URI is not the SVG namespace URI."/*SF*/);
+        }
+        // Creates native element. A native document owns the new element.
+        // NOTE: The element is NOT located in the DOM tree yet.
+        int elementHandle = _createElementNS(
+                                getNativeSVGProxyHandle(),
+                                M2GSVGConstants.parseElementTypeId(qualifiedName),
+                                getHandle());
+        M2GSVGLocatableElement element = null;
+        // Checks native handle validity
+        if (M2GObject.checkHandle(elementHandle))
+        {
+            // Creates java element object
+            element = new M2GSVGLocatableElement(elementHandle, this);
+            registerLiveElement(element, new Integer(elementHandle));
+        }
+        else
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "createElementNS(): " + qualifiedName + " - end, NOK!!!");
+        }
+        return element;
+    }
+
+    /**
+     * Checks document validity.
+     * @return true if valid
+     */
+    public boolean doCheckValidity() throws IOException
+    {
+        boolean result = false;
+        if (isHandleValid())
+        {
+            M2GSVGSVGElement root = getRootElement();
+            if (root != null)
+            {
+                // Check svg version and base profile
+                root.checkVersionAndProfile();
+                result = true;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Cleanup
+     * @see com.nokia.microedition.m2g.M2GObject#doCleanup()
+     */
+    public void doCleanup()
+    {
+        if (isHandleValid())
+        {
+            _deleteDocument(
+                getNativeSVGProxyHandle(),
+                getHandle());
+        }
+        iImage = null;
+        if (iEventDispatcher != null)
+        {
+            iEventDispatcher.clear();
+            iEventDispatcher = null;
+        }
+        resetHandles();
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doConstruct()
+     */
+    protected void doConstruct()
+    {
+        super.doConstruct();
+        iEventDispatcher = new M2GEventDispatcher();
+    }
+
+    /**
+     * Find an element from the handle-to-element map.
+     * @see M2GLiveElements#findElement()
+     */
+    public SVGElement findLiveElement(Integer aElementHandle)
+    {
+        return iLiveElements.findElement(aElementHandle);
+    }
+
+    /**
+     * Get connection policy
+     * @see M2GConnectionListener#getConnectionPolicy()
+     */
+    public M2GConnectionPolicy getConnectionPolicy()
+    {
+        return iConnectionPolicy;
+    }
+
+    /**
+     * @see org.w3c.dom.Document#getDocumentElement()
+       */
+    public Element getDocumentElement()
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getDocumentElement() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return getRootElement();
+    }
+
+    /**
+    * @see org.w3c.dom.Document#getElementById()
+     */
+    public Element getElementById(String id)
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "getElementById() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        if (id == null || id.equals(""))
+        {
+            Logger.ELOG(Logger.EJavaUI, "getElementById() - exception");
+            throw new NullPointerException(/*SF*/"The ID is null."/*SF*/);
+        }
+        int elementHandle = _getElementById(
+                                getNativeSVGProxyHandle(),
+                                getHandle(),
+                                id );
+        return M2GSVGElement.buildElement(elementHandle, this);
+    }
+
+    /**
+     * Returns the image
+     */
+    public M2GSVGImage getImage()
+    {
+        return iImage;
+    }
+
+    /**
+     * @see org.w3c.dom.Node#getLocalName()
+     */
+    public String getLocalName()
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "getLocalName() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return null;
+    }
+
+    /**
+    * @see org.w3c.dom.Node#getNamespaceURI()
+     */
+    public String getNamespaceURI()
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "getNamespaceURI() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return null;
+    }
+
+    /**
+     * @see org.w3c.dom.Node#getParentNode()
+     */
+    public Node getParentNode()
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getParentNode() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return null;
+    }
+
+    /**
+     * Get root element
+     * @return M2GSVGSVGElement
+       */
+    public M2GSVGSVGElement getRootElement()
+    {
+        if (iRootElement == null)
+        {
+            iRootElement = M2GSVGSVGElement.buildRootElement(this);
+        }
+        return iRootElement;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#getViewportHeight()
+     */
+    public int getViewportHeight()
+    {
+        return _getViewportHeight(
+                   getNativeSVGProxyHandle(),
+                   getHandle());
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#getViewportWidth()
+     */
+    public int getViewportWidth()
+    {
+        return _getViewportWidth(
+                   getNativeSVGProxyHandle(),
+                   getHandle() );
+    }
+
+
+    /**
+     * Called by SVGImage upon creating an Event instance
+     * Calls the handleEvent() of all the listeners of the event
+     */
+    public void handleEvent(Event aEvent)
+    {
+        iEventDispatcher.handleEvent(aEvent);
+    }
+
+    /**
+    * @see org.w3c.dom.Node#insertBefore()
+     */
+    public Node insertBefore(Node newChild, Node refChild)
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "insertBefore() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+
+        Logger.ELOG(Logger.EJavaUI, "insertBefore() DOMException");
+        throw new DOMException(
+            DOMException.HIERARCHY_REQUEST_ERR,
+            /*SF*/"Cannot insertBefore a Document node."/*SF*/);
+    }
+
+    /**
+     * Checks if element is in DOM
+     * @param aElementHandle -
+     * @return true if element is in DOM
+     */
+    public boolean isElementInDOM(int aElementHandle)
+    {
+        if (!M2GObject.checkHandle(aElementHandle))
+        {
+            return false;
+        }
+        return (_isElementInDOM(
+                    getNativeSVGProxyHandle(),
+                    getHandle(),
+                    aElementHandle) > 0 ? true : false);
+    }
+
+    /**
+     * The external resource handler is invoked
+     * for any external resource referenced in the document.
+     * @param aUri External resource referenced in the document
+     */
+    public void invokeResourceHandler(String aUri)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "invokeResourceHandler() - URI="
+                   + aUri + " - begin");
+
+        if ((iImage != null) && (iResourceHandler != null) &&
+                (aUri != null) && (aUri.length() > 4))
+        {
+            StringBuffer urlBuf = new StringBuffer();
+            // The uri format for external resource must include the base url
+            // from which the document was loaded. It's also checked that the
+            // url read from svg doesn't contain already the base part.
+            if ((iBaseUrl != null) &&
+                    !iBaseUrl.equals("") &&
+                    (aUri.indexOf(iBaseUrl) == -1))
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "invokeResourceHandler() append base url=" + iBaseUrl);
+                urlBuf.append(iBaseUrl);
+            }
+
+            urlBuf.append(aUri);
+
+            // append the url suffix in case of drm open mode
+            if (iSuffixUrl != null && !iSuffixUrl.equals(""))
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "invokeResourceHandler() append suffix url=" + iSuffixUrl);
+                urlBuf.append(iSuffixUrl);
+            }
+
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "invokeResourceHandler() handler uri=" + urlBuf.toString());
+
+            iResourceHandler.requestResource(iImage, urlBuf.toString());
+            appendExternalResourceURI(aUri);
+        }
+
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "invokeResourceHandler() - URI:" + aUri + " - end");
+    }
+
+    /**
+     * Registers an event target and an event listener.
+     * @param aTarget Target element
+     * @param aType Event type
+     * @param aListener Event listener
+     */
+    void register(EventTarget aTarget, String aType, EventListener aListener)
+    {
+        iEventDispatcher.register(aTarget, aType, aListener);
+    }
+
+    /**
+     * Register element
+     * @see M2GLiveElements#registerElement()
+     */
+    public void registerLiveElement(SVGElement aElement, Integer aElementHandle)
+    {
+        iLiveElements.registerElement(aElement, aElementHandle);
+    }
+
+    /**
+     * @see org.w3c.dom.Node#removeChild()
+     */
+    public Node removeChild(Node oldChild) throws DOMException
+    {
+        // Optimization: if(!getConnectionPolicy().getAccessRight())
+        if (!iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "removeChild() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        Logger.ELOG(Logger.EJavaUI, "removeChild() DOMException");
+        throw new DOMException(
+            DOMException.NOT_SUPPORTED_ERR,
+            /*SF*/"Cannot removeChild from a Document node."/*SF*/);
+    }
+
+    /**
+     * Removes external resource uri from internal container
+     * @param aUri External resource uri
+     * @return true if succeeds
+     */
+    boolean removeExternalResourceURI(String aUri)
+    {
+        boolean result = false;
+        if (aUri != null && !aUri.equals(""))
+        {
+            synchronized (iExternalResources)
+            {
+                result = iExternalResources.removeElement(aUri);
+            }
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "removeExternalResourceURI() uri="
+                   + ((aUri != null) ? aUri : "null") + ", result=" + result + " - end");
+        return result;
+    }
+
+    /*
+     * @see com.nokia.microedition.m2g.M2GSVGImage#requestCompleted()
+     */
+    public int requestCompleted(String aUri, byte[] aResourceData)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "requestCompleted() uri=" + aUri + " - begin");
+        // If the aUri contains a base part it will be cut off
+        if (!aUri.equals("") &&
+                (iBaseUrl != null) &&
+                !containsExternalResourceURI(aUri) &&
+                (aUri.indexOf(iBaseUrl, 0) != -1))
+        {
+            aUri = aUri.substring(iBaseUrl.length(), aUri.length());
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "requestCompleted() uri when base part is cut off=" + aUri);
+        }
+
+        // Execute tha request command.
+        int status = _requestCompleted(
+                         getNativeSVGProxyHandle(),
+                         getHandle(), aUri, aResourceData);
+        if ((status == 0) || aUri.equals(""))
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "requestCompleted() remove URI=" + aUri);
+            removeExternalResourceURI(aUri);
+        }
+        return status;
+    }
+
+    /**
+     * Set connection policy
+     * @see M2GConnectionListener#setConnectionPolicy()
+     */
+    public void setConnectionPolicy(M2GConnectionPolicy aConnectionPolicy)
+    {
+        iConnectionPolicy = aConnectionPolicy;
+        if (iConnectionPolicy != null)
+        {
+            iConnectionRight = iConnectionPolicy.getAccessRight();
+        }
+        else
+        {
+            iConnectionRight = true;
+        }
+    }
+
+    /**
+     * Set image
+     * @param aImage Image
+     */
+    public void setImage(M2GSVGImage aImage)
+    {
+        iImage = aImage;
+    }
+
+    /**
+     * Set external resource handler
+     * @param aHandler External resource handler
+     */
+    public void setResourceHandler(ExternalResourceHandler aHandler)
+    {
+        iResourceHandler = aHandler;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#setViewportHeight()
+     */
+    public void setViewportHeight(int height)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "setViewportHeight():" + height + " - begin");
+        if (height < 0)
+        {
+            Logger.ELOG(Logger.EJavaUI, "setViewportHeight():"
+                        + height + " - IllegalArgumentException is thrown");
+            throw new IllegalArgumentException(/*SF*/"The height is negative."/*SF*/);
+        }
+        _setViewportHeight(
+            getNativeSVGProxyHandle(),
+            getHandle(),
+            height);
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "setViewportHeight():" + height + " - end");
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#setViewportWidth()
+     */
+    public void setViewportWidth(int width)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "setViewportWidth:" + width + " - begin");
+        if (width < 0)
+        {
+            Logger.ELOG(Logger.EJavaUI, "setViewportWidth():"
+                        + width + " - IllegalArgumentException is thrown");
+            throw new IllegalArgumentException(/*SF*/"The width is negative."/*SF*/);
+        }
+        _setViewportWidth(
+            getNativeSVGProxyHandle(),
+            getHandle(),
+            width );
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "setViewportWidth:" + width + " - end");
+    }
+
+    /**
+     * Unregister event listener
+     * @param aTarget Target element
+     * @param aType Event type
+     * @param aListener Event listener
+     */
+    void unregister(EventTarget aTarget, String aType, EventListener aListener)
+    {
+        iEventDispatcher.unregister(aTarget, aType, aListener);
+    }
+
+    /**
+     * Unregister an element from the handle-to-element map
+     * @see M2GLiveElements#unregisterElement()
+     */
+    public void unregisterLiveElement(Integer aElementHandle)
+    {
+        iLiveElements.unregisterElement(aElementHandle);
+    }
+
+    //--------------------------------------------------
+    // INNER CLASSES
+    //--------------------------------------------------
+    /**
+     * M2GLiveElements
+     */
+    class M2GLiveElements
+    {
+        private Hashtable iLiveElements = new Hashtable();
+        private boolean iUseWeakReference;
+
+        /**
+         * Constructor
+         */
+        public M2GLiveElements(boolean aUseWeakReference)
+        {
+            iUseWeakReference = aUseWeakReference;
+        }
+
+        /**
+        * Find an element from the handle-to-element map.
+        * @param aElementHandle Handle
+        * @return SVGElement. Null if not found
+        */
+        public SVGElement findElement(Integer aElementHandle)
+        {
+            SVGElement element = null;
+            Object weakObject = null;
+            Object object = null;
+
+            synchronized (this)
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "** findElement() handle: " + aElementHandle + " - begin **");
+                object = iLiveElements.get(aElementHandle);
+                if (object != null)
+                {
+                    if (iUseWeakReference)
+                    {
+                        weakObject = ((WeakReference)object).get();
+                        if (weakObject == null)
+                        {
+                            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                                       "** findElement() handle: " + aElementHandle
+                                       + " is garbage collected. **");
+                            iLiveElements.remove(aElementHandle);
+                        }
+                        else
+                        {
+                            element = (SVGElement)weakObject;
+                        }
+                    }
+                    else
+                    {
+                        element = (SVGElement)object;
+                    }
+                }
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,"** findElement() handle: " + aElementHandle
+                           + ((element != null) ? " FOUND" : " NOT FOUND") + " - end **");
+            }
+            return element;
+        }
+
+        /**
+         * Register element
+         * @param aElement Element
+         * @param aElementHandle Handle
+         */
+        public void registerElement(SVGElement aElement, Integer aElementHandle)
+        {
+            if (aElement == null)
+            {
+                return;
+            }
+            synchronized (this)
+            {
+                if (iUseWeakReference)
+                {
+                    iLiveElements.put(aElementHandle, new WeakReference(aElement));
+                }
+                else
+                {
+                    iLiveElements.put(aElementHandle, aElement);
+                }
+            }
+        }
+
+        /**
+         * Unregister an element from the handle-to-element map
+         * @param aElementHandle Handle
+         */
+        public void unregisterElement(Integer aElementHandle)
+        {
+            synchronized (this)
+            {
+                iLiveElements.remove(aElementHandle);
+            }
+        }
+    }
+
+
+    /**
+     * M2GEventDispatcher
+     */
+    protected class M2GEventDispatcher
+    {
+        static public final int INDEX_UNDEFINED = -1;
+        static public final int INDEX_CLICK = 0;
+        static public final int INDEX_ACTIVATE = 1;
+        static public final int INDEX_FOCUS_IN = 2;
+        static public final int INDEX_FOCUS_OUT = 3;
+
+        Hashtable[] iEventTypes;
+        int iCurrentIndex;
+        Hashtable iDelayedRegistrations = new Hashtable();
+        M2GEventData iCurrentEventData = new M2GEventData();
+
+        /**
+         * Constructor
+         */
+        public M2GEventDispatcher()
+        {
+            iEventTypes = new Hashtable[4];
+            iCurrentIndex = INDEX_UNDEFINED;
+        }
+
+        /**
+         * Clear all
+         */
+        public void clear()
+        {
+            synchronized (this)
+            {
+                for (int index = 0; index < iEventTypes.length; index++)
+                {
+                    if (iEventTypes[index] != null)
+                    {
+                        iEventTypes[index].clear();
+                        iEventTypes[index] = null;
+                    }
+                }
+            }
+        }
+
+        /**
+         * Execute delayed registration
+         * If an EventListener is added to an EventTarget while it is
+         * processing an event, it will not be triggered by the current actions.
+         */
+        private void doDelayedRegistration()
+        {
+            try
+            {
+                Enumeration registrations = iDelayedRegistrations.elements();
+                while (registrations.hasMoreElements())
+                {
+                    M2GEventData eventData =
+                        (M2GEventData)registrations.nextElement();
+                    register(
+                        eventData.iTarget, eventData.iType, eventData.iListener);
+                }
+            }
+            catch (NullPointerException e)
+            {
+            }
+            iDelayedRegistrations.clear();
+        }
+
+
+        /**
+         * Handle event
+         * @param aEvent Event
+         */
+        public void handleEvent(Event aEvent)
+        {
+            synchronized (this)
+            {
+                if ((aEvent == null) || !prepare(aEvent.getType()))
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "handleEvent() FAILED - event invalid");
+                    return;
+                }
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "handleEvent(): " + aEvent.getType() + " - begin");
+                EventTarget target = aEvent.getCurrentTarget();
+                if (target == null)
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "handleEvent() FAILED - event's target is null");
+                    return;
+                }
+                // Check if wrapped event target
+                if (target instanceof M2GSVGElementWrapper)
+                {
+                    target = ((M2GSVGElementWrapper)target).getWrappedTarget();
+                    if (target == null)
+                    {
+                        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                                   "handleEvent() FAILED - wrapped event's target is null");
+                        return;
+                    }
+                }
+                if (iEventTypes[iCurrentIndex].containsKey(target))
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "handleEvent() - target handling begin");
+                    iCurrentEventData.set(target, aEvent.getType(), null);
+                    Vector listeners =
+                        (Vector)iEventTypes[iCurrentIndex].get(iCurrentEventData.iTarget);
+
+                    if (listeners != null)
+                    {
+                        Enumeration index = listeners.elements();
+                        while (index.hasMoreElements())
+                        {
+                            Object listener = index.nextElement();
+                            if ((listener != null) && (listener instanceof EventListener))
+                            {
+                                ((EventListener)listener).handleEvent(aEvent);
+                            }
+                            else
+                            {
+                                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                                           "handleEvent(): listener is null!");
+                            }
+                        }
+                    }
+                    else
+                    {
+                        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                                   "handleEvent(): listeners is null!");
+                    }
+                    iCurrentEventData.clear();
+                }
+                else
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "handleEvent(): target not found");
+                }
+                // Execute the delayed registration.
+                doDelayedRegistration();
+            }
+        }
+
+        /**
+         * Check is event targets are equal
+         * @param aLhs Left hand side
+         * @param aRhs Right hand side
+         * @return True if equal
+         */
+        private boolean isEquals(EventTarget aLhs, EventTarget aRhs)
+        {
+            int lhsHandle = M2GObject.INVALID_NATIVE_HANDLE;
+            int rhsHandle = M2GObject.INVALID_NATIVE_HANDLE;
+            if (aLhs instanceof M2GSVGElement)
+            {
+                lhsHandle = ((M2GSVGElement)aLhs).getHandle();
+            }
+            if (aRhs instanceof M2GSVGElement)
+            {
+                rhsHandle = ((M2GSVGElement)aRhs).getHandle();
+            }
+            if ((lhsHandle == rhsHandle) && (lhsHandle != M2GObject.INVALID_NATIVE_HANDLE))
+            {
+                return true;
+            }
+            return false;
+        }
+
+        /**
+         * Set an index that points to an event type hash table.
+         * The hash table is created if needed.
+         * @param aType Type
+         */
+        private boolean prepare(String aType)
+        {
+            if (!setIndex(aType))
+            {
+                return false;
+            }
+            if (iEventTypes[iCurrentIndex] == null)
+            {
+                iEventTypes[iCurrentIndex] = new Hashtable();
+            }
+            return true;
+        }
+
+        /**
+         * Register an event target and an event listener pair
+         * @param aTarget Target
+         * @param aType Type
+         * @param aListener Listener
+         */
+        public void register(EventTarget aTarget,
+                             String aType,
+                             EventListener aListener)
+        {
+            // NOTE: no need to check validity of aTarget & aListener. It's
+            // already done.
+            synchronized (this)
+            {
+                if (!prepare(aType))
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "register() - failed: " + aType);
+                    return;
+                }
+                // Check if delayed registration is needed
+                // If an EventListener is added to an EventTarget while it is
+                // processing an event, it will not be triggered by
+                // the current actions.
+                if ((iCurrentEventData.iType == aType) &&
+                        isEquals(iCurrentEventData.iTarget, aTarget))
+                {
+                    try
+                    {
+                        iDelayedRegistrations.put(
+                            aListener,
+                            new M2GEventData(aTarget, aType, aListener));
+                    }
+                    catch (NullPointerException e)
+                    {
+                    }
+                    return;
+                }
+                Vector listeners = null;
+                if (iEventTypes[iCurrentIndex].containsKey(aTarget))
+                {
+                    listeners = (Vector)iEventTypes[iCurrentIndex].get(aTarget);
+                }
+                else
+                {
+                    listeners = new Vector();
+                    iEventTypes[iCurrentIndex].put(aTarget, listeners);
+                }
+                // Don't add if the event target already contains the same listener
+                // for the same event.
+                if (!listeners.contains(aListener))
+                {
+                    listeners.addElement(aListener);
+                }
+            }
+        }
+
+        /**
+         * Set an event type container index
+         * @param aType Type
+         * @return False if the type is invalid
+         */
+        private boolean setIndex(String aType)
+        {
+            if (aType.equals(M2GSVGConstants.EVENT_ACTIVATE))
+            {
+                iCurrentIndex = INDEX_ACTIVATE;
+            }
+            else if (aType.equals(M2GSVGConstants.EVENT_CLICK))
+            {
+                iCurrentIndex = INDEX_CLICK;
+            }
+            else if (aType.equals(M2GSVGConstants.EVENT_FOCUS_IN))
+            {
+                iCurrentIndex = INDEX_FOCUS_IN;
+            }
+            else if (aType.equals(M2GSVGConstants.EVENT_FOCUS_OUT))
+            {
+                iCurrentIndex = INDEX_FOCUS_OUT;
+            }
+            else
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "setIndex() type:" + aType + " FALSE - end");
+                // Wrong event type
+                iCurrentIndex = INDEX_UNDEFINED;
+                return false;
+            }
+            return true;
+        }
+
+        /**
+         * Unregister an event target and an event listener pair
+         * @param aTarget Target
+         * @param aType Type
+         * @param aListener Listener
+         */
+        public void unregister(EventTarget aTarget,
+                               String aType,
+                               EventListener aListener)
+        {
+            synchronized (this)
+            {
+                if (!prepare(aType))
+                {
+                    return;
+                }
+                // Remove delayed registration
+                iDelayedRegistrations.remove(aListener);
+                // Remove real registration
+                Vector listeners = (Vector)iEventTypes[iCurrentIndex].get(aTarget);
+                boolean removed = false;
+                if (listeners != null)
+                {
+                    removed = listeners.removeElement(aListener);
+                    if (listeners.isEmpty())
+                    {
+                        iEventTypes[iCurrentIndex].remove(aTarget);
+                    }
+                }
+                if (removed)
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "unregister() ok - end");
+                }
+                else
+                {
+                    Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                               "unregister() failed - end");
+                }
+            }
+        }
+
+        /**
+         * Helper class for handling delayed registration
+         */
+        class M2GEventData
+        {
+            public EventTarget iTarget = null;
+            public String iType = null;
+            public EventListener iListener = null;
+
+            /**
+             * Ctor
+             */
+            public M2GEventData()
+            {
+            }
+
+            /**
+             * Ctor
+             * @param aTarget Target
+             * @param aType Event type
+             * @param aListener Event listener
+             */
+            public M2GEventData(
+                EventTarget aTarget,
+                String aType,
+                EventListener aListener)
+            {
+                set(aTarget, aType, aListener);
+            }
+
+            /**
+             * Clearing
+             */
+            public void clear()
+            {
+                iTarget = null;
+                iType = null;
+                iListener = null;
+            }
+
+            /**
+             * Setter
+             * @param aTarget Target
+             * @param aType Event type
+             * @param aListener Event listener
+             */
+            public void set(EventTarget aTarget,
+                            String aType,
+                            EventListener aListener)
+            {
+                iTarget = aTarget;
+                iType = aType;
+                iListener = aListener;
+            }
+        }
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+
+    /**
+     * Creates an empty SVG document. The document contains a
+     * root <svg> element with default viewport size of 100x100.
+       * @param aImage -
+       * @param aHander -
+       * @return document object
+       * @throws IllegalArgumentException
+       * @throws IOException
+       */
+    static public M2GDocument buildEmptyDocument(M2GSVGImage aImage,
+            ExternalResourceHandler aHandler)
+    throws IllegalArgumentException, IOException
+    {
+        return M2GDocument.buildDocument(
+                   aImage,
+                   null,
+                   null,
+                   M2GSVGConstants.getInstance().iEmptySvgDocument,
+                   aHandler);
+    }
+
+    /**
+     * Builds document
+     * @param aImage Svg image
+    * @param aBaseUrl A base url from where a document is downloaded.
+    * @param aSuffixUrl The suffix url from where a document is downloaded.
+     * @param aData Plain text svg data
+     * @param aHandler Resource handler. If null the default resource handler is
+     * used.
+     * @return document object
+     * @throws IllegalArgumentException
+     * @throws IOException
+     */
+    static public M2GDocument buildDocument(M2GSVGImage aImage,
+                                            String aBaseUrl,
+                                            String aSuffixUrl,
+                                            String aData,
+                                            ExternalResourceHandler aHandler)
+    throws IOException
+    {
+    		
+        if ((aData == null) || (aData.equals("")))
+        {
+        		
+            throw new IOException(
+                /*SF*/"The SVG document does not conform to the XML 1.0 specification."/*SF*/);
+        }
+
+        M2GDocument document = new M2GDocument(aImage, aBaseUrl, aSuffixUrl, aData);
+
+        if (document.doCheckValidity())
+        {
+            document.setResourceHandler(aHandler);
+            return document;
+        }
+        throw new IOException(
+            /*SF*/"The SVG document does not conform to the XML 1.0 specification."/*SF*/);
+    }
+
+    /**
+     * Registers an observer to any DOM change
+     * @since S60 3.2
+     */
+    public void registerDOMChangeObserver(M2GDOMChangeObserver aDOMChangeObserver)
+    {
+        iDOMChangeObserver = aDOMChangeObserver;
+    }
+
+    /**
+     * Notify the observer about any change in DOM
+     * SVGSVGElement is always part of DOM
+     * @since S60 3.2
+     */
+    public void notifyDOMChangeObserver()
+    {
+        if (iDOMChangeObserver != null)
+        {
+            iDOMChangeObserver.notifyDOMChange();
+        }
+    }
+
+    /**
+     * Notify the observer about any change in DOM only if the node is in DOM
+     * @param aNativeHandle the handle of a node
+     * @since S60 3.2
+     */
+    public void notifyDOMChangeObserver(int aNativeHandle)
+    {
+        if (iDOMChangeObserver != null && isElementInDOM(aNativeHandle))
+        {
+            iDOMChangeObserver.notifyDOMChange();
+        }
+    }
+
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private native static int _createDocument(
+        int aSvgProxyHandle, String aString);
+
+    private native static int _createElementNS(
+        int aSvgProxyHandle, short aType,
+        int aDocumentHandle);
+
+    private native static void _deleteDocument(
+        int aSvgProxyHandle, int aDocumentHandle);
+
+    private native static int _getElementById(
+        int aSvgProxyHandle, int aDocumentHandle,
+        String aId);
+
+    private static native int _getViewportHeight(
+         int aSvgProxyHandle, int aDocumentHandle);
+
+    private static native int _getViewportWidth(
+         int aSvgProxyHandle, int aDocumentHandle);
+
+    private native static int _isElementInDOM(
+         int aSvgProxyHandle, int aDocumentHandle,
+        int aElementHandle);
+
+    private static native int _requestCompleted(
+        int aSvgProxyHandle, int aDocumentHandle,
+        String aUri, byte[] aResourceData);
+
+    private static native void _setViewportHeight(
+        int aSvgProxyHandle, int aDocumentHandle, int aHeight);
+
+    private static native void _setViewportWidth(
+        int aSvgProxyHandle, int aDocumentHandle, int aWidth);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GEvent.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.events.*;
+import org.w3c.dom.svg.SVGElement;
+
+/**
+ * The Event interface is used to provide contextual information about an event to the handler
+ * processing the event. An object which implements the Event interface is passed as the first
+ * parameter to the {@link org.w3c.dom.events.EventListener#handleEvent handleEvent} call.
+ */
+public class M2GEvent implements Event
+{
+    public static final boolean EVENT_TARGET = false;
+    public static final boolean WRAPPED_EVENT_TARGET = true;
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private String iEventType;
+    private EventTarget iTarget;
+    private boolean iWrappedTarget;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aEventType Type
+     * @param aTarget Target
+     * @param aWrappedTarget If WRAPPED_EVENT_TARGET then <code>getCurrentTarget</code>
+     * method returns a wrapped event target (which base class is NOT <code>Node</code>.
+     * Otherwise normal event target (which base class is <code>Node</code>) is returned.
+     */
+    public M2GEvent(String aEventType, EventTarget aTarget, boolean aWrappedTarget)
+    {
+        iEventType = aEventType;
+        iTarget = aTarget;
+        iWrappedTarget = aWrappedTarget;
+    }
+
+    /**
+     * @see org.w3c.dom.events.Event#getCurrentTarget()
+     * @see M2GEvent()
+     */
+    public EventTarget getCurrentTarget()
+    {
+        if (iWrappedTarget)
+        {
+            if ((iTarget != null) && (iTarget instanceof M2GSVGElement))
+            {
+                return new M2GSVGElementWrapper((M2GSVGElement)iTarget);
+            }
+            return null;
+        }
+        return iTarget;
+    }
+
+    /**
+     * @see org.w3c.dom.events.Event#getType()
+     */
+    public String getType()
+    {
+        return iEventType;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GManager.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import java.lang.ref.WeakReference;
+//import com.nokia.mj.impl.rt.legacy.MIDEventServer;
+import java.util.Hashtable;
+//import com.nokia.mj.impl.rt.legacy.MemoryUtil;
+import java.util.Enumeration;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.*;
+
+
+public final class M2GManager implements  Listener
+{
+    //--------------------------------------------------
+    // STATIC VARIABLES
+    //--------------------------------------------------
+
+    private static WeakReference sWeakManagerProxy = null;
+    static Object sQuard = new Object();
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private Hashtable iLiveObjects = new Hashtable();
+    private M2GWeakManager iWeakManager = null;
+    private int iSVGProxyHandle = M2GObject.INVALID_NATIVE_HANDLE;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    /**
+     * Constructor
+     */
+    private M2GManager()
+    {
+        super();
+				
+				
+				//As Display is created in Thread only.. So no need to handle display over here.
+				//scom.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javam2g");      
+        /*// setup the finalization via eswt's Display
+        Display display = Display.getCurrent();
+        if (display == null)
+        {
+            return;  // ?
+        }
+        display.addListener(SWT.Dispose, (Listener)this); */
+        
+				
+		// Execute in UI thread     
+        	Platform.executeInUIThread(
+                new M2GRunnableQt() {
+                    public void doRun() {
+    															    	iSVGProxyHandle = _createSvgProxy();
+    															  		}
+    															  });
+        M2GManager.heuristicGC();
+    }
+
+    /**
+     * Impelements 'handleEvent' from Listener
+     */
+    public void handleEvent(Event e)
+    {
+        if (e.type == SWT.Dispose)
+        {
+            doCleanup();
+        }
+    }
+
+    /**
+     * Does the cleanuping
+     */
+    protected void doCleanup()
+    {
+        finalizeObjects();
+        synchronized (sQuard)
+        {
+            _deleteSvgProxy(iSVGProxyHandle);
+            iSVGProxyHandle = M2GObject.INVALID_NATIVE_HANDLE;
+            sWeakManagerProxy = null;
+            iLiveObjects = null;
+        }
+    }
+
+
+    /**
+     * Find an element from the handle-to-element map.
+     * @param aElementHandle Handle
+     * @return SVGElement. Null if not found
+     */
+    synchronized private void finalizeObjects()
+    {
+        Enumeration objects = iLiveObjects.elements();
+        while (objects.hasMoreElements())
+        {
+            Object weakObject = ((WeakReference)objects.nextElement()).get();
+            if (weakObject != null)
+            {
+                ((M2GObject)weakObject).registeredFinalize();
+            }
+        }
+        // Clear table
+        iLiveObjects.clear();
+    }
+
+
+    /**
+     * Gets native SVG proxy handle
+     * @return SVG proxy handle
+     */
+    public int getSVGProxyHandle()
+    {
+        synchronized (sQuard)
+        {
+            return iSVGProxyHandle;
+        }
+    }
+
+    /**
+     * Gets native SVG proxy handle
+     * @return SVG proxy handle
+     */
+    void init(M2GWeakManager aWeakManager)
+    {
+        iWeakManager = aWeakManager;
+    }
+
+    /**
+     * Register an object
+     * @param aObject Object
+     */
+    synchronized public void register(M2GObject aObject)
+    {
+        if (aObject == null)
+        {
+            return;
+        }
+        iLiveObjects.put(new Integer(aObject.getHandle()), new WeakReference(aObject));
+    }
+
+    /**
+     * Unregister an object
+     * @param aHandle Object's native handle
+     */
+    synchronized public void unregister(Integer aHandle)
+    {
+        iLiveObjects.remove(aHandle);
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+
+    /**
+     * Gets instance of singleton manager object
+     * @return manager object reference
+     */
+    static public M2GManager getInstance()
+    {
+        M2GWeakManager weakManager = null;
+        synchronized (sQuard)
+        {
+            if (sWeakManagerProxy != null)
+            {
+      		    	
+                weakManager = (M2GWeakManager)sWeakManagerProxy.get();
+            }
+            // Check if object null
+            if (weakManager == null)
+            {
+                // Create a new object and put it into the static member variable
+                
+                weakManager = new M2GWeakManager(new M2GManager());
+                sWeakManagerProxy = new WeakReference(weakManager);
+            }
+            return weakManager.getInstance();
+        }
+    }
+
+    /**
+     * Trigger GC every N objects
+     */
+    static final void heuristicGC()
+    {
+        //MemoryUtil.ensureMinFreeRAM();
+    }
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private static native int _createSvgEngine(int aSvgProxyHandle );
+
+    private static native int _createSvgProxy();
+
+    private static native void _deleteSvgEngine(int aSvgProxyHandle, int aSvgEngineHandle);
+
+    private static native void _deleteSvgProxy( int aSvgProxyHandle);
+
+
+}
+
+//--------------------------------------------------
+// OTHER CLASSES
+//--------------------------------------------------
+
+/*
+ * M2GWeakManager takes care of carbage colletion of an M2GManager object
+ */
+class M2GWeakManager
+{
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    M2GManager iManager;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    /**
+     * Constructor
+     * @param aManager Manager object
+     */
+    public M2GWeakManager(M2GManager aManager)
+    {
+        reset(aManager);
+    }
+
+    /**
+     * Return a reference to the manager
+     * @return a reference to the manager
+     */
+    M2GManager getInstance()
+    {
+        return iManager;
+    }
+
+    /**
+     * Reset
+     * @param aManager
+     */
+    void reset(M2GManager aManager)
+    {
+        iManager = aManager;
+        if (iManager != null)
+        {
+            iManager.init(this);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GObject.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import java.io.IOException;
+
+import com.nokia.microedition.m2g.NativeError;
+import com.nokia.mj.impl.rt.support.Finalizer;
+import com.nokia.mj.impl.utils.Logger;
+
+
+/**
+ * Base class
+ */
+abstract class M2GObject 
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final int INVALID_NATIVE_HANDLE = 0;
+   // static final String ESWT_PACKAGE              =   "org.eclipse.swt.widgets.Display" ;
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    int iNativeHandle;
+    M2GManager iManager;
+    private Finalizer mFinalizer;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor.
+     */
+    M2GObject()
+    {
+        this(INVALID_NATIVE_HANDLE);
+        
+    }
+
+    /**
+     * Constructor.
+     * @param a native handle
+     */
+    M2GObject(int aHandle)
+    {
+				
+        iNativeHandle = aHandle;
+        
+        iManager = M2GManager.getInstance();
+        
+    }
+
+    /**
+     * Checks handle validity.
+     * @return true if valid
+     */
+    boolean doCheckValidity() throws IOException
+    {
+        return isHandleValid();
+    }
+
+    /**
+     * Cleanup operations.
+     */
+    abstract void doCleanup();
+
+    /**
+     * Construct operations. Registration for finalization is done here.
+     */
+    void doConstruct()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "doConstruct(), register for finalization: "
+                   + this.getClass().getName());
+        M2GManager.heuristicGC();
+        mFinalizer = new Finalizer()
+        {
+            public void finalizeImpl()
+            {
+                doFinalize();
+            }
+        };
+    }
+
+    /**
+     * Create destroyer.
+     */
+    void createDestroyer()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "createDestroyer(): " + this.getClass().getName());
+        
+    }
+
+    /**
+     * Gets native handle
+     * @return native handle
+     */
+    int getHandle()
+    {
+        return iNativeHandle;
+    }
+
+    /**
+     * Gets native proxy handle
+     * @return native handle
+     */
+    int getNativeSVGProxyHandle()
+    {
+        return iManager.getSVGProxyHandle();
+    }
+
+    /**
+     * Checks if native handle is valid.
+     */
+    boolean isHandleValid()
+    {
+        M2GObject.checkNativeError(iNativeHandle);
+        return M2GObject.checkHandle(iNativeHandle);
+    }
+
+    /**
+     * Register an object
+     * @param aObject Object
+     */
+    void register(M2GObject aObject)
+    {
+        iManager.register(aObject);
+    }
+
+    /**
+     * @see ObjectExtensions#registerForFinalization()
+     */
+    private void doFinalize()
+    {
+        if (mFinalizer != null)
+        {
+            registeredFinalize();
+            mFinalizer = null;
+        }
+    }
+
+    synchronized final void registeredFinalize()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "registeredFinalize() begin - doCleanup() is called");
+        doCleanup();
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "registeredFinalize() end");
+    }
+
+    /**
+     * This method is called in Toolkit's destroyNotify call.
+     * This will release convenient native resources. All native resource
+     * will be deleted in registeredFinalize() method.
+     */
+    synchronized final void release()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "release()");
+    }
+
+    /**
+     * Initializes native handles.
+     */
+    void resetHandles()
+    {
+        iNativeHandle = INVALID_NATIVE_HANDLE;
+    }
+
+    /**
+     * Sets a native handle.
+     */
+    void setHandle(int aNativeHandle)
+    {
+        iNativeHandle = aNativeHandle;
+    }
+
+    /**
+     * Unregister an object
+     * @param aHandle Object's native handle
+     */
+    void unregister(Integer aHandle)
+    {
+        iManager.unregister(aHandle);
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+    /**
+     * Checks that the handle is valid.
+     * @param a native handle
+     * @return true if handle is valid.
+     */
+    static boolean checkHandle(int aHandle)
+    {
+        return (aHandle > INVALID_NATIVE_HANDLE ? true : false);
+    }
+
+    /**
+     * Checks for basic native error codes that maps to
+     * standard Java exceptions and throws the exception if the error
+     * code matches. Otherwise throws basic Error class.
+     * @param aErrorCode Error code
+     * @return Value passed in is returned if not an error
+     * @throws Error if error
+     */
+    static int checkNativeError(int aErrorCode)
+    {
+        return NativeError.check(aErrorCode);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GRunnableQt.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2003 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 com.nokia.microedition.m2g;
+
+/**
+ * Class that wraps runnable in order to catch and forward
+ * exceptions that occured when executing in UI thread.
+ * This class is used only for running native methods in UI thread.
+ */
+abstract class M2GRunnableQt implements Runnable
+{
+    private Throwable e = null;
+
+    /**
+     * From Runnable interface
+     */
+    public void run()
+    {
+        try
+        {
+            doRun();
+        }
+        catch (Throwable t)
+        {
+            e = t;
+        }
+    }
+
+    /**
+     * Checks for possible exceptions and errors and throws them forward.
+     * Only unchecked exceptions and errors are thrown as only checked
+     * exception that m3gcore may throw comes from loader which is not
+     * executed in UI thread
+     *
+     * @throws RuntimeException
+     * @throws Error
+     */
+    public void checkAndThrow()
+    {
+        if (e == null)
+        {
+            return;
+        }
+        if (e instanceof RuntimeException)
+        {
+            throw(RuntimeException)e;
+        }
+        else if (e instanceof Error)
+        {
+            throw(Error)e;
+        }
+    }
+
+    /**
+     * Method to be implemented for the UI thead execution
+     */
+    abstract void doRun();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGAnimationElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+import com.nokia.mj.impl.utils.Logger;
+
+
+/**
+ * This interface represents an Animation element,
+ * which contains methods to control the timing of
+ * animations.
+ */
+public class M2GSVGAnimationElement
+        extends M2GSVGElement
+        implements SVGAnimationElement
+{
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aElemnetHandle -
+     * @param aDocument -
+     */
+    public M2GSVGAnimationElement(int aElementHandle, M2GDocument aDocument)
+    {
+        super(aElementHandle, aDocument);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGAnimationElement#beginElementAt()
+     */
+    public void beginElementAt(float offset)
+    {
+        _beginElementAt(
+            getNativeSVGProxyHandle(),
+            getDocument().getHandle(), getHandle(), offset,
+            getDocument().getRootElement().getCurrentTime() );
+    }
+
+    /**
+     * Same as the beginElementAt with offset 0.0f
+     * @see org.w3c.dom.svg.SVGAnimationElement#beginElementAt()
+     */
+    public void beginElement()
+    {
+        beginElementAt(0.0f);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGAnimationElement#endElementAt()
+     */
+    public void endElementAt(float offset)
+    {
+        short endAttribute = _getEnumTrait(
+                                 getNativeSVGProxyHandle(),
+                                 getHandle(), M2GSVGConstants.AT_END );
+        // NOTE Native SVG engine checks that element is active so
+        // java side doesn't have to do that
+        if (endAttribute == M2GSVGConstants.ANIM_INDEFINITE)
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "endElementAt() - Cannot stop this animation, indefinite attribute");
+        }
+        else
+        {
+            _endElementAt(
+                getNativeSVGProxyHandle(),
+                getDocument().getHandle(), getHandle(),
+                (offset + getDocument().getRootElement().getCurrentTime())    );
+        }
+    }
+
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private native void _beginElementAt(
+        int aSvgProxyHandle, int aDocumentHandle,
+        int aElementHandle, float aOffset, float aCurrentTime);
+
+    private native void _endElementAt(
+        int aSvgProxyHandle, int aDocumentHandle,
+        int aElementHandle, float aOffset);
+
+    private native boolean _isActive(
+        int aSvgProxyHandle, int aElementHandle);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGAnimator.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,765 @@
+/*
+* Copyright (c) 2005-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 com.nokia.microedition.m2g;
+
+import javax.microedition.m2g.*;
+import java.util.*;
+import javax.microedition.lcdui.*;
+import javax.microedition.lcdui.game.GameCanvas;
+import java.lang.ref.WeakReference;
+import com.nokia.mj.impl.rt.support.Finalizer;
+import com.nokia.mj.impl.utils.Logger;
+
+
+public class M2GSVGAnimator extends SVGAnimator 
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    private static final String ANIMATOR_CANVAS_BASE_CLASS =
+        "javax.microedition.lcdui.Canvas";
+    // Exception text
+    /* Optimization: static finals changed to local variables
+    private static final String COMPONENT_BASE_CLASS_NOT_SUPPORTED_ESTR =
+    "The requested componentBaseClass is not supported by the implementation.";
+    private static final String ILLEGAL_TIME_INCREMENT_ESTR =
+    "The timeIncrement is less than or equal to zero.";
+    private static final String ANIMATOR_PLAY_ESTR =
+    "The animator is not currently in the stopped or paused state.";
+    private static final String ANIMATOR_PAUSE_ESTR =
+    "The animator is not in the playing  state.";
+    private static final String ANIMATOR_STOP_ESTR =
+    "The animator is not in the playing or paused state.";
+    private static final String INVALID_RUNNABLE_ESTR =
+    "The runnable is null.";
+    private static final String ANIMATOR_IS_STOPPED_ESTR =
+    "The animator is in the stopped state.";
+    private static final String RUNNABLE_IS_NULL_ESTR =
+    "The runnable is null.";
+    private static final String ANIMATOR_INVOKE_ESTR =
+    "The animator is in the stopped state.";
+    */
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GSVGCanvas    iSVGCanvas      = null;
+    private Finalizer mFinalizer;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aImage
+     */
+    protected M2GSVGAnimator(SVGImage aImage)
+    {
+				
+        iSVGCanvas = new M2GSVGCanvas(false, aImage);
+        mFinalizer = new Finalizer()
+        {	
+            public void finalizeImpl()
+            {
+            		
+                doFinalize();
+            }
+        };
+				
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#getTargetComponent()
+     */
+    public Object getTargetComponent()
+    {
+        return iSVGCanvas;
+    }
+
+    /**
+    * @see javax.microedition.m2g.SVGAnimator#getTimeIncrement()
+    */
+    public float getTimeIncrement()
+    {
+        return iSVGCanvas.getTimeIncrement();
+    }
+
+    /**
+    * @see javax.microedition.m2g.SVGAnimator#invokeAndWait()
+    */
+    public void invokeAndWait(java.lang.Runnable runnable)
+    {
+        if (runnable == null)
+        {
+            throw new NullPointerException(
+                /*SF*/"The runnable is null."/*SF*/);
+        }
+        if (iSVGCanvas.isStopped())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is in the stopped state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "invokeAndWait()");
+        runnable.run();
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#invokeLater()
+     */
+    public void invokeLater(java.lang.Runnable runnable)
+    {
+        if (runnable == null)
+        {
+            throw new NullPointerException(
+                /*SF*/"The runnable is null."/*SF*/);
+        }
+        if (iSVGCanvas.isStopped())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is in the stopped state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "invokeLater()");
+        Thread thread = new Thread(runnable);
+        thread.start();
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#pause()
+     */
+    public void pause()
+    {
+        if (!iSVGCanvas.isPlaying())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is not in the playing or paused state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "pause()");
+        iSVGCanvas.pause();
+    }
+
+    /**
+    * @see javax.microedition.m2g.SVGAnimator#play()
+    */
+    public void play()
+    {
+				
+        if (iSVGCanvas.isPlaying())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is not currently in the stopped or paused state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "play()");
+        
+        iSVGCanvas.play();
+    }
+
+    private void doFinalize()
+    {
+        if (mFinalizer != null)
+        {
+						
+            registeredFinalize();
+            mFinalizer = null;
+        }
+    }
+
+    /**
+     * Finalize
+     */
+    synchronized void registeredFinalize()
+    {
+        iSVGCanvas.cancel();
+        iSVGCanvas = null;
+    }
+
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setSVGEventListener()
+     */
+    public void setSVGEventListener(SVGEventListener svgEventListener)
+    {
+        iSVGCanvas.setEventListener(svgEventListener);
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setTimeIncrement()
+     */
+    public void setTimeIncrement(float timeIncrement)
+    {
+    		
+        if (timeIncrement <= 0)
+        {
+            throw new IllegalArgumentException(
+                /*SF*/"The time increment is less than or equal to zero."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "setTimeIncrement() - "
+                   + timeIncrement);
+        iSVGCanvas.setTimeIncrement(timeIncrement);
+        
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#stop()
+     */
+    public void stop()
+    {
+    		
+        if (iSVGCanvas.isStopped())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is not in the playing or paused state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "stop()");
+
+        iSVGCanvas.stop();
+        
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+    /**
+     * Builds animator
+     * @param svgImage -
+     * @return SVGAnimator
+     * @see javax.microedition.m2g.SVGAnimator#createAnimator()
+     */
+    public static SVGAnimator buildAnimator(SVGImage svgImage)
+    {
+	   		
+        if (svgImage == null)
+        {
+        		
+            throw new NullPointerException();
+        }
+        
+        return new M2GSVGAnimator(svgImage);
+    }
+
+    /**
+     * Builds animator
+     * @param svgImage -
+     * @param componentBaseClass -
+     * @return SVGAnimator
+     * @see javax.microedition.m2g.SVGAnimator#createAnimator()
+     */
+    public static SVGAnimator buildAnimator(
+        SVGImage svgImage, String componentBaseClass)
+    {
+        if (svgImage == null)
+        {
+            throw new NullPointerException();
+        }
+        if ((componentBaseClass != null) &&
+                (!componentBaseClass.equals(ANIMATOR_CANVAS_BASE_CLASS)))
+        {
+            throw new IllegalArgumentException(
+                /*SF*/"The requested componentBaseClass is not supported by the implementation."/*SF*/);
+        }
+        return buildAnimator(svgImage);
+    }
+}
+
+//--------------------------------------------------
+// OTHER CLASSES
+//--------------------------------------------------
+
+/**
+ * Canvas
+ */
+class M2GSVGCanvas extends GameCanvas implements M2GDOMChangeObserver
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final int STATE_STOPPED = 1;
+    public static final int STATE_PLAYING = 2;
+    public static final int STATE_PAUSED  = 3;
+    public static final float DEFAULT_DELTA_TIME = 0.1f;  // (10fps) - defined by specs
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private int                 iState;
+    private SVGImage            iSVGImage;
+    private ScalableGraphics    iSg;
+    private Graphics            iOffscreen      = null;
+    private M2GSVGSVGElement    iRootElement    = null;
+
+    private float               iDeltaTime;
+    private Timer               iTimer          = null;
+    private SVGCanvasTask       iTask           = null;
+
+    private SVGEventListener    iEventListener  = null;
+
+    /**
+     * True if the GameCanvas is in background or false otherwise
+     */
+    private boolean iWasPlaying                 = false;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * @see javax.microedition.lcdui.game.GameCanvas#GameCanvas()
+     */
+    public M2GSVGCanvas(boolean aSuppressKeyEvents, SVGImage aSVGImage)
+    {					
+
+        super(aSuppressKeyEvents);
+				
+        // get the instance to the Graphics of the offscreen buffer
+        iOffscreen = getGraphics();
+
+        iSVGImage     = aSVGImage;
+
+        // down-casting to M2GDocument/M2GSVGSVGElement to have access to internal methods
+        M2GDocument doc = (M2GDocument)iSVGImage.getDocument();
+        iRootElement  = (M2GSVGSVGElement)iSVGImage.getDocument().getDocumentElement();
+        
+				
+        iState = STATE_STOPPED;
+        // Create render context
+        iSg = ScalableGraphics.createInstance();
+        iSg.setRenderingQuality(ScalableGraphics.RENDERING_QUALITY_HIGH);
+        iDeltaTime = DEFAULT_DELTA_TIME;
+
+        doc.registerDOMChangeObserver(this);
+        
+        
+        
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "Ctor - delta time:"
+                   + iDeltaTime + ", state:" + iState);
+    }
+
+    /**
+     * Handles any change in DOM.
+     * <br>
+     * While in PAUSE state, SVGAnimator must repaint any changes in SVGImage
+     * done via the API (e.g. setTrait(), insertBefore())
+     * <br>
+     * @see M2GDOMChangeObserver.notifyDOMChange()
+     * @since S60 3.2
+     */
+    public void notifyDOMChange()
+    {
+        if (isPaused())
+        {
+            repaint();
+        }
+    }
+
+    /**
+     * Cancel a timed task
+     */
+    public void cancel()
+    {
+        if (iTimer != null)
+        {
+            iTimer.cancel();
+        }
+        if (iTask != null)
+        {
+            iTask.cancel();
+        }
+        iTask = null;
+        iTimer = null;
+    }
+
+    /**
+     * Returns event listener
+     * @return event listener
+     */
+    public synchronized SVGEventListener getEventListener()
+    {
+        return iEventListener;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#getTimeIncrement()
+     */
+    public synchronized float getTimeIncrement()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "getTimeIncrement() - "
+                   + iDeltaTime);
+        return iDeltaTime;
+    }
+
+    /**
+     * Increases the increment time of the SVGImage.
+     * Increment is done only if the playing state is active.
+     * @see javax.microedition.m2g.SVGImage#incrementTime()
+     */
+    public synchronized void increaseCurrentTime(float time)
+    {
+        if (iState == STATE_PLAYING)
+        {
+            // update the time only in java side
+            // the time in engine side is updated during rendering
+            iRootElement.incrementTimeNoUpdate(time);
+        }
+    }
+
+    /**
+    * Checks if playing
+    * @return true if playing
+    */
+    public synchronized boolean isPlaying()
+    {
+        return iState == STATE_PLAYING;
+    }
+
+    /**
+     * Checks if paused
+     * @return true if paused
+     */
+    public synchronized boolean isPaused()
+    {
+        return iState == STATE_PAUSED;
+    }
+
+    /**
+     * Checks if stopped
+     * @return true if stopped
+     */
+    public synchronized boolean isStopped()
+    {
+        return iState == STATE_STOPPED;
+    }
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#keyPressed()
+     */
+    protected synchronized void keyPressed(int keyCode)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "keyPressed() - " + keyCode);
+        if (iEventListener != null)
+        {
+            iEventListener.keyPressed(keyCode);
+        }
+    }
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#keyReleased()
+     */
+    protected synchronized void keyReleased(int keyCode)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "keyReleased() - " + keyCode);
+        if (iEventListener != null)
+        {
+            iEventListener.keyReleased(keyCode);
+        }
+    }
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#pointerPressed()
+     * @see javax.microedition.m2g.SVGEventListener#pointerPressed()
+     */
+    protected synchronized void pointerPressed(int x, int y)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "pointerPressed() - x:" + x + ", y:" + y);
+        if (iEventListener != null)
+        {
+            iEventListener.pointerPressed(x, y);
+        }
+    }
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#pointerReleased()
+     * @see javax.microedition.m2g.SVGEventListener#pointerReleased()
+     */
+    protected synchronized void pointerReleased(int x, int y)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "pointerReleased() - x:" + x + ", y:" + y);
+        if (iEventListener != null)
+        {
+            iEventListener.pointerReleased(x, y);
+        }
+    }
+
+    /**
+     * @see javax.microedition.lcdui.game.GameCanvas#paint()
+     */
+    public void paint(Graphics g)
+    {
+        // Clears bitmap
+        
+        g.setColor(255, 255, 255);
+        g.fillRect(0, 0, getWidth(), getHeight());
+
+        try
+        {
+        		
+            iSg.bindTarget(g);
+
+						
+            // NOTE: Source is defaultly fully opaque
+            iSg.render(0, 0, iSVGImage);
+            
+        }
+        finally
+        {
+        		
+            iSg.releaseTarget();
+            
+        }
+    }
+
+    /**
+     * Paints a frame to the offscreen of this GameCanvas
+     * @note GameCanvas.getGraphics() is not used since it always creates a new instance of Graphics
+     */
+    public void paintToOffscreen()
+    {
+        paint(iOffscreen);
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setSVGEventListener()
+     */
+    public synchronized void setEventListener(SVGEventListener eventListener)
+    {
+        iEventListener = eventListener;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setTimeIncrement()
+     */
+    public synchronized void setTimeIncrement(float aDeltaTime)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "setTimeIncrement() - "
+                   + aDeltaTime);
+
+        iDeltaTime = aDeltaTime;
+    }
+
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#showNotify()
+     * @see javax.microedition.m2g.SVGEventListener#showNotify()
+     */
+    protected synchronized void showNotify()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "showNotify()");
+
+        if (iEventListener != null)
+        {
+            iEventListener.showNotify();
+        }
+
+        // A common use-case could be that the developer plays the animation by themselves
+        // in SVGEventListener.showNotify().
+        // Therefore we play the animation only if the developer didn't resume it already.
+        if (iWasPlaying)
+        {
+            iWasPlaying = false;
+            play();
+        }
+    }
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#hideNotify()
+     * @see javax.microedition.m2g.SVGEventListener#hideNotify()
+     */
+    protected synchronized void hideNotify()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "hideNotify()");
+
+        if (iEventListener != null)
+        {
+            iEventListener.hideNotify();
+        }
+
+        // A common use-case could be that developer pause the animation by themselves
+        // in SVGEventListener.hideNotify().
+        // Therefore we pause the animation only if the developer didn't pause it already.
+        if (isPlaying())
+        {
+            pause();
+            iWasPlaying = true;
+        }
+    }
+
+
+    /**
+     * @see javax.microedition.lcdui.Canvas#sizeChanged()
+     * @see javax.microedition.m2g.SVGEventListener#sizeChanged()
+     */
+    protected synchronized void sizeChanged(int w, int h)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "sizeChanged() - w:"
+                   + w + ", h:" + h);
+
+        // get a new instance of offscreen Graphics since the Graphics object
+        // does not update its size or clipping area.
+        // If not updating this, the GameCanvas is clipped when it is switched
+        // to full-screen
+        if (iOffscreen != null)
+        {
+            // sizeChanged() is called twice when the Canvas is set as Displayable.
+            // If we try to get the Graphics object (first time), the Graphics object is not
+            // fully initialized, so GameCanvas.getGraphics() will throw a NullPointerException
+            iOffscreen = getGraphics();
+        }
+
+        if (iSVGImage != null)
+        {
+            iSVGImage.setViewportWidth(w);
+            iSVGImage.setViewportHeight(h);
+        }
+
+        if (iEventListener != null)
+        {
+            iEventListener.sizeChanged(w, h);
+        }
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#play()
+     */
+    public synchronized void play()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "play()");
+				
+        if (iState == STATE_PLAYING)
+        {
+            // don't do anything if animation is already playing
+            return;
+        }
+
+        if ((iState == STATE_PAUSED)||(iState == STATE_STOPPED))
+        {
+            iTask = new SVGCanvasTask(this);
+            iTimer = new Timer();
+        }
+        iState = STATE_PLAYING;
+        if (iTimer != null && iTask != null)
+        {
+
+            iTimer.schedule(iTask,0,(long)(iDeltaTime*1000.0f));
+
+        }
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#pause()
+     */
+    public synchronized void pause()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "pause()");
+
+        if (iState == STATE_PLAYING)
+        {
+            iTask.cancel();
+            iTask = null;
+            iTimer.cancel();
+            iTimer = null;
+        }
+        iState = STATE_PAUSED;
+
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#stop()
+     */
+    public synchronized void stop()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "stop()");
+        if (iState == STATE_PLAYING)
+        {
+            iTask.cancel();
+            iTask = null;
+            iTimer.cancel();
+            iTimer = null;
+        }
+        iState = STATE_STOPPED;
+    }
+}
+
+/**
+ * Timer task for rendering frames
+ */
+class SVGCanvasTask extends TimerTask
+{
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    // private WeakReference   iWeakCanvas;
+
+    private M2GSVGCanvas    iCanvas                 = null;
+    private long           iPrevTime        = 0;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aCanvas SVG canvas
+     */
+    public SVGCanvasTask(M2GSVGCanvas aCanvas)
+    {
+        // iWeakCanvas = new WeakReference(aCanvas);
+        // iCanvas = (M2GSVGCanvas)iWeakCanvas.get();
+
+        iCanvas = aCanvas;
+        iPrevTime = System.currentTimeMillis();
+    }
+    /**
+        * Updates the animation time and generates frames which get flushed to the screen
+        * <br>
+        * * @note The timing for the next frame is decided upon the max(iDeltaTime*1000, elapsedTime)
+          * iDeltaTime:  FrameTime set by client.
+          * elapsedTime: Actual Time taken for rendering
+              the  max(iDeltaTime*1000, elapsedTime) will be incremented on the SVGElement
+        * @note rendering will be done only in PLAY state.
+        * @note While in PAUSE state, SVGAnimator will repaint any changes done
+        * to SVGImage via <code>M2GDOMChangeObserver.notifyDOMChange()</code>
+        */
+    public void run()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "SVGCanvasTask: run() - begin");
+
+        if (iCanvas == null)
+        {
+            return;
+        }
+
+        try
+        {
+            synchronized (iCanvas)
+            {
+                long elapsedTime = System.currentTimeMillis()- iPrevTime;
+                if (elapsedTime > 0)
+                    iCanvas.increaseCurrentTime((float)(elapsedTime/ 1000.));
+                iPrevTime = System.currentTimeMillis();
+                iCanvas.paintToOffscreen();
+                iCanvas.flushGraphics();
+            }
+        }
+        catch (Exception e)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "SVGCanvasTask: run() - exception: " + e.toString());
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "SVGCanvasTask: run() - end");
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGConstants.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1893 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import java.util.Hashtable;
+import java.util.Enumeration;
+import java.util.Vector;
+import org.w3c.dom.svg.SVGPath;
+
+/*
+ * General constants
+ */
+public class M2GSVGConstants
+{
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - General exception messages
+    //--------------------------------------------------
+    public static final String ACCESS_RIGHTS_ESTR =
+        "Not necessary privilege rights to access this (SVG) content.";
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    static final String SVG_NAMESPACE_URI =
+        "http://www.w3.org/2000/svg";
+    static final String XLINK_NAMESPACE_URI =
+        "http://www.w3.org/1999/xlink";
+    static final String ROOT_SVG_ELEMENT_NAME =
+        "svg";
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Supported event types
+    //--------------------------------------------------
+    static final String EVENT_ACTIVATE = "DOMActivate";
+    static final String EVENT_CLICK = "click";
+    static final String EVENT_FOCUS_IN = "DOMFocusIn";
+    static final String EVENT_FOCUS_OUT = "DOMFocusOut";
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - SVGT element ids
+    //--------------------------------------------------
+    static final short EL_UNDEFINED = -1;
+    static final short EL_A = 0;
+    static final short EL_ANIMATE = 1;
+    static final short EL_ANIMATECOLOR = 2;
+    static final short EL_ANIMATEMOTION = 3;
+    static final short EL_ANIMATETRANSFORM = 4;
+    static final short EL_CIRCLE = 5;
+    static final short EL_DEFS = 6;
+    static final short EL_DESC = 7;
+    static final short EL_ELLIPSE = 8;
+    static final short EL_FONT = 9;
+    static final short EL_FONTFACE = 10;
+    static final short EL_FONTFACENAME = 11;
+    static final short EL_FONTFACESRC = 12;
+    static final short EL_FOREIGNOBJECT = 13;
+    static final short EL_G = 14;
+    static final short EL_GLYPH = 15;
+    static final short EL_HKERN = 16;
+    static final short EL_IMAGE = 17;
+    static final short EL_LINE = 18;
+    static final short EL_METADATA = 19;
+    static final short EL_MISSINGGLYPH = 20;
+    static final short EL_MPATH = 21;
+    static final short EL_PATH = 22;
+    static final short EL_POLYGON = 23;
+    static final short EL_POLYLINE = 24;
+    static final short EL_RECT = 25;
+    static final short EL_SET = 26;
+    static final short EL_SVG = 27;
+    static final short EL_SWITCH = 28;
+    static final short EL_TEXT = 29;
+    static final short EL_TITLE = 30;
+    static final short EL_USE = 31;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - SVGT Attribute ids
+    //--------------------------------------------------
+    static final short AT_UNDEFINED = -1;
+    static final short AT_ACCENTHEIGHT = 50;
+    static final short AT_ACCUMULATE = 51;
+    static final short AT_ADDITIVE = 52;
+    static final short AT_ALPHABETIC = 53;
+    static final short AT_ARABICFORM = 54;
+    static final short AT_ASCENT = 55;
+    static final short AT_ATTRIBUTENAME = 56;
+    static final short AT_ATTRIBUTETYPE = 57;
+    static final short AT_BASEPROFILE = 58;
+    static final short AT_BBOX = 59;
+    static final short AT_BEGIN = 60;
+    static final short AT_BY = 61;
+    static final short AT_CALCMODE = 62;
+    static final short AT_CAPHEIGHT = 63;
+    static final short AT_COLOR = 64;
+    static final short AT_COLORRENDERING = 65;
+    // static final short AT_CONTENT = 66;
+    static final short AT_CX = 67;
+    static final short AT_CY = 68;
+    static final short AT_D = 69;
+    static final short AT_DESCENT = 70;
+    static final short AT_DISPLAY = 71;
+    static final short AT_DUR = 72;
+    static final short AT_END = 73;
+    static final short AT_FILL = 74;
+    static final short AT_FILLRULE = 75;
+    static final short AT_FONTFAMILY = 76;
+    static final short AT_FONTSIZE = 77;
+    static final short AT_FONTSTRETCH = 78;
+    static final short AT_FONTSTYLE = 79;
+    static final short AT_FONTVARIANT = 80;
+    static final short AT_FONTWEIGHT = 81;
+    static final short AT_FROM = 82;
+    static final short AT_G1 = 83;
+    static final short AT_G2 = 84;
+    static final short AT_GLYPHNAME = 85;
+    static final short AT_HANGING = 86;
+    static final short AT_HEIGHT = 87;
+    static final short AT_HORIZADVX = 88;
+    static final short AT_HORIZORIGINX = 89;
+    static final short AT_ID = 90;
+    static final short AT_IDEOGRAPHIC = 91;
+    static final short AT_K = 92;
+    static final short AT_KEYPOINTS = 93;
+    static final short AT_KEYSPLINES = 94;
+    static final short AT_KEYTIMES = 95;
+    static final short AT_LANG = 96;
+    static final short AT_MATHEMATICAL = 97;
+    static final short AT_MAX = 98;
+    static final short AT_MIN = 99;
+    static final short AT_NAME = 100;
+    static final short AT_ORIGIN = 101;
+    static final short AT_OVERLINEPOSITION = 102;
+    static final short AT_OVERLINETHICKNESS = 103;
+    static final short AT_PANOSE1 = 104;
+    static final short AT_PATH = 105;
+    static final short AT_PATHLENGTH = 106;
+    static final short AT_POINTS = 107;
+    static final short AT_PRESERVEASPECTRATIO = 108;
+    static final short AT_R = 109;
+    static final short AT_REPEATCOUNT = 110;
+    static final short AT_REPEATDUR = 111;
+    static final short AT_REQUIREDEXTENSIONS = 112;
+    static final short AT_REQUIREDFEATURES = 113;
+    static final short AT_RESTART = 114;
+    static final short AT_ROTATE = 115;
+    static final short AT_RX = 116;
+    static final short AT_RY = 117;
+    static final short AT_SLOPE = 118;
+    static final short AT_STEMH = 119;
+    static final short AT_STEMV = 120;
+    static final short AT_STRIKETHROUGHPOSITION = 121;
+    static final short AT_STRIKETHROUGHTHICKNESS = 122;
+    static final short AT_STROKE = 123;
+    static final short AT_STROKEDASHARRAY = 124;
+    static final short AT_STROKEDASHOFFSET = 125;
+    static final short AT_STROKELINECAP = 126;
+    static final short AT_STROKELINEJOIN = 127;
+    static final short AT_STROKEMITERLIMIT = 128;
+    static final short AT_STROKEWIDTH = 129;
+    static final short AT_STYLE = 130;
+    static final short AT_SYSTEMLANGUAGE = 131;
+    static final short AT_TARGET = 132;
+    static final short AT_TEXTANCHOR = 133;
+    static final short AT_TO = 134;
+    static final short AT_TRANSFORM = 135;
+    static final short AT_TYPE = 136;
+    static final short AT_U1 = 137;
+    static final short AT_U2 = 138;
+    static final short AT_UNDERLINEPOSITION = 139;
+    static final short AT_UNDERLINETHICKNESS = 140;
+    static final short AT_UNICODE = 141;
+    static final short AT_UNICODERANGE = 142;
+    static final short AT_UNITSPEREM = 143;
+    static final short AT_VALUES = 144;
+    static final short AT_VERSION = 145;
+    static final short AT_VIEWBOX = 146;
+    static final short AT_VISIBILITY = 147;
+    static final short AT_WIDTH = 148;
+    static final short AT_WIDTHS = 149;
+    static final short AT_X = 150;
+    static final short AT_XHEIGHT = 151;
+    static final short AT_X1 = 152;
+    static final short AT_X2 = 153;
+    static final short AT_XLINKACTUATE = 154;
+    static final short AT_XLINKARCROLE = 155;
+    static final short AT_XLINKHREF = 156;
+    static final short AT_XLINKROLE = 157;
+    static final short AT_XLINKSHOW = 158;
+    static final short AT_XLINKTITLE = 159;
+    static final short AT_XLINKTYPE = 160;
+    static final short AT_XMLBASE = 161;
+    static final short AT_XMLLANG = 162;
+    static final short AT_XMLSPACE = 163;
+    static final short AT_Y = 164;
+    static final short AT_Y1 = 165;
+    static final short AT_Y2 = 166;
+    static final short AT_ZOOMANDPAN = 167;
+    // not in the spec but used to correctly implement animateMotion
+    static final short AT_MOTIONTRANSFORM = 168;
+    // not actually an attribute, but needed for desc, title, and text
+    static final short AT_STRING = 169;
+    static final short AT_TEXTDECORATION = 170;
+    static final short AT_HORIZORIGINY = 171;
+    static final short AT_MOUSEEVENT = 172;
+    static final short AT_USERBBOX = 173;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Error flags
+    //--------------------------------------------------
+    static final short DEFAULT_INHERIT = -2; // = null on native engine;
+    static final short SVG_ERROR = -1;
+    static final short TEXT_NOT_SHORT = -3;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - A constant for each type of value
+    //--------------------------------------------------
+    static final short VAL_EVENT = 200;
+    static final short VAL_INTEGER = 201;
+    static final short VAL_PAINT = 202;
+    static final short VAL_POINT = 203;
+    static final short VAL_REAL = 204;
+    static final short VAL_STRING = 205;
+    static final short VAL_TIME = 206;
+    static final short VAL_TRANSFORM = 207;
+    static final short VAL_VECTOR = 208;
+    // These are used for animation purposes
+    static final short VAL_VECTOR_POINT = 215;
+    static final short VAL_VECTOR_REAL = 216;
+    static final short VAL_VECTOR_STRING = 217;
+    static final short VAL_VECTOR_PATH = 218;
+    // VAL_VECTOR_X + VECTOR_TO_VAL = VAL_X
+    static final short VECTOR_TO_VAL = -12;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Constants for "choices"
+    //--------------------------------------------------
+    // Preserve aspect ratio constants
+    static final short PAR_NONE = 310;
+    static final short PAR_XMIDYMID = 311;
+    // Zoom and pan constants
+    static final short ZPN_MAGNIFY = 320;
+    static final short ZPN_DISABLE = 321;
+    // Paint
+    static final short PAINT_NONE = 325;
+    static final short PAINT_CURRENT = 326;
+    static final short PAINT_COLOR = 327;
+    static final short PAINT_INHERIT = 328;
+    // Fonts
+    static final short FONT_ALL = 330;
+    static final short FONT_NORMAL = 331;
+    static final short FONT_STYLE_ITALIC = 332;
+    static final short FONT_STYLE_OBLIQUE = 333;
+    static final short FONT_VARIANT_SMALLCAPS = 334;
+    static final short FONT_WEIGHT_BOLD = 335;
+    static final short FONT_WEIGHT_BOLDER = 336;
+    static final short FONT_WEIGHT_LIGHTER = 337;
+    static final short FONT_WEIGHT_100 = 338;
+    static final short FONT_WEIGHT_200 = 339;
+    static final short FONT_WEIGHT_300 = 340;
+    static final short FONT_WEIGHT_400 = 341;
+    static final short FONT_WEIGHT_500 = 342;
+    static final short FONT_WEIGHT_600 = 343;
+    static final short FONT_WEIGHT_700 = 344;
+    static final short FONT_WEIGHT_800 = 345;
+    static final short FONT_WEIGHT_900 = 346;
+    static final short FONT_STRETCH_WIDER = 347;
+    static final short FONT_STRETCH_NARROWER = 348;
+    static final short FONT_STRETCH_ULTRA_COND = 349;
+    static final short FONT_STRETCH_EXTRA_COND = 350;
+    static final short FONT_STRETCH_COND = 351;
+    static final short FONT_STRETCH_SEMI_COND = 352;
+    static final short FONT_STRETCH_SEMI_EXPD = 353;
+    static final short FONT_STRETCH_EXPD = 354;
+    static final short FONT_STRETCH_EXTRA_EXPD = 355;
+    static final short FONT_STRETCH_ULTRA_EXPD = 356;
+    // Text
+    static final short TEXT_ANCHOR_START = 360;
+    static final short TEXT_ANCHOR_MIDDLE = 361;
+    static final short TEXT_ANCHOR_END = 362;
+    static final short TEXT_UNDER_LINE = 363;
+    static final short TEXT_OVER_LINE = 364;
+    static final short TEXT_LINE_THROUGH = 365;
+    // These are actual sizes in 8:8 fixed point, not "choices"
+    static final int FONT_SIZE_XXSMALL = 0x20000;
+    static final int FONT_SIZE_XSMALL = 0x40000;
+    static final int FONT_SIZE_SMALL = 0x60000;
+    static final int FONT_SIZE_MEDIUM = 0xa0000;
+    static final int FONT_SIZE_LARGE = 0x100000;
+    static final int FONT_SIZE_XLARGE = 0x140000;
+    static final int FONT_SIZE_XXLARGE = 0x180000;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Styles
+    //--------------------------------------------------
+    // Fill
+    static final short FILL_RULE_EVENODD = 375;
+    static final short FILL_RULE_NONZERO = 376;
+    // Display
+    static final short DISPLAY_NONE = 380;
+    static final short DISPLAY_OTHER = 381;
+    // Visibility
+    static final short VISIBILITY_VISIBLE = 385;
+    static final short VISIBILITY_OTHER = 386;
+    // Color-rendering
+    static final short COLOR_RENDERING_AUTO = 390;
+    static final short COLOR_RENDERING_SPEED = 391;
+    static final short COLOR_RENDERING_QUALITY = 392;
+    // Strokes
+    // MUST PRESERVE ORDER!!
+    static final short STROKE_LINECAP_BUTT = 395;
+    static final short STROKE_LINECAP_ROUND = 396;
+    static final short STROKE_LINECAP_SQUARE = 397;
+    static final short STROKE_LINEJOIN_MITER = 400;
+    static final short STROKE_LINEJOIN_ROUND = 401;
+    static final short STROKE_LINEJOIN_BEVEL = 402;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Animation
+    //--------------------------------------------------
+    static final short ANIM_INDEFINITE = 445;
+    static final short ACCUMULATE_NONE = 450;
+    static final short ACCUMULATE_SUM = 451;
+    static final short ADDITIVE_REPLACE = 455;
+    static final short ADDITIVE_SUM = 456;
+    static final short CALC_MODE_DISCRETE = 460;
+    static final short CALC_MODE_LINEAR = 461;
+    static final short CALC_MODE_PACED = 462;
+    static final short CALC_MODE_SPLINE = 463;
+    static final short FILL_REMOVE = 465;
+    static final short FILL_FREEZE = 466;
+    static final short RESTART_ALWAYS = 470;
+    static final short RESTART_NEVER = 471;
+    static final short RESTART_WHENNOTACTIVE = 472;
+    static final short TYPE_TRANSLATE = 475;
+    static final short TYPE_SCALE = 476;
+    static final short TYPE_ROTATE = 477;
+    static final short TYPE_SKEWX = 478;
+    static final short TYPE_SKEWY = 479;
+    static final short ATTR_TYPE_CSS = 485;
+    static final short ATTR_TYPE_XML = 486;
+    static final short ATTR_TYPE_AUTO = 487;
+    static final short ROTATE_AUTO = 490;
+    static final short ROTATE_AUTOREVERSE = 491;
+    static final short ANIM_FROM_TO = 500;
+    static final short ANIM_FROM_BY = 501;
+    static final short ANIM_BY = 502;
+    static final short ANIM_TO = 503;
+    static final short ANIM_VALUES = 504;
+    static final short ANIM_PATH = 505;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Path Commands
+    //--------------------------------------------------
+    static final short PATH_COMMAND_M = 600;
+    static final short PATH_COMMAND_m = 601;
+    static final short PATH_COMMAND_Z = 602;
+    static final short PATH_COMMAND_L = 603;
+    static final short PATH_COMMAND_l = 604;
+    static final short PATH_COMMAND_H = 605;
+    static final short PATH_COMMAND_h = 606;
+    static final short PATH_COMMAND_V = 607;
+    static final short PATH_COMMAND_v = 608;
+    static final short PATH_COMMAND_C = 609;
+    static final short PATH_COMMAND_c = 610;
+    static final short PATH_COMMAND_S = 611;
+    static final short PATH_COMMAND_s = 612;
+    static final short PATH_COMMAND_Q = 613;
+    static final short PATH_COMMAND_q = 614;
+    static final short PATH_COMMAND_T = 615;
+    static final short PATH_COMMAND_t = 616;
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS - Events
+    //--------------------------------------------------
+    // Indicates that the animation has started
+    static final short EVENT_BEGIN = 650;
+    // Indicates that the animation has finished
+    static final short EVENT_END = 651;
+    // Indicates that the animation has repeated
+    static final short EVENT_REPEAT = 652;
+    static final short EVENT_BEGIN_EL = 653;
+    static final short EVENT_END_EL = 654;
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private static M2GSVGConstants sInstance = null;
+
+    String iEmptySvgDocument = null;
+    String iSvgBaseProfileName = null;
+    String iSvgBaseProfileVersion = null;
+    Hashtable iAllElements = null;
+    Hashtable iAllAttributes = null;
+    Vector iQualifiedElements = null;
+    Vector iAnimatableElements = null;
+    Vector iReadOnlyElements = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     */
+    private M2GSVGConstants()
+    {
+        // Profile name
+        iSvgBaseProfileName = System.getProperty("microedition.m2g.svg.baseProfile");
+        // Profile version
+        iSvgBaseProfileVersion = System.getProperty("microedition.m2g.svg.version");
+
+        // Empty svg document
+        // "<svg version=\"1.1\" baseProfile=\"tiny\" width=\"100\" height=\"100\"></svg>";
+        StringBuffer buf = new StringBuffer();
+        buf.append("<svg version=\"").append(iSvgBaseProfileVersion);
+        buf.append("\" baseProfile=\"").append(iSvgBaseProfileName);
+        buf.append("\" width=\"100\" height=\"100\"></svg>");
+        iEmptySvgDocument = buf.toString();
+
+        // Elements
+        iAllElements = new Hashtable(32);
+        iAllElements.put(new Short(EL_A), "a"); // 1
+        iAllElements.put(new Short(EL_ANIMATE), "animate"); // 2
+        iAllElements.put(new Short(EL_ANIMATECOLOR), "animateColor"); // 3
+        iAllElements.put(new Short(EL_ANIMATEMOTION), "animateMotion"); // 4
+        iAllElements.put(new Short(EL_ANIMATETRANSFORM), "animateTransform"); // 5
+        iAllElements.put(new Short(EL_CIRCLE), "circle"); // 6
+        iAllElements.put(new Short(EL_DEFS), "defs"); // 7
+        iAllElements.put(new Short(EL_DESC), "desc"); // 8
+        iAllElements.put(new Short(EL_ELLIPSE), "ellipse"); // 9
+        iAllElements.put(new Short(EL_FONT), "font"); // 10
+        iAllElements.put(new Short(EL_FONTFACE), "font-face"); // 11
+        iAllElements.put(new Short(EL_FONTFACENAME), "font-face-name"); // 12
+        iAllElements.put(new Short(EL_FONTFACESRC), "font-face-src"); // 13
+        iAllElements.put(new Short(EL_FOREIGNOBJECT), "foreignObject"); // 14
+        iAllElements.put(new Short(EL_G), "g"); // 15
+        iAllElements.put(new Short(EL_GLYPH), "glyph"); // 16
+        iAllElements.put(new Short(EL_HKERN), "hkern"); // 17
+        iAllElements.put(new Short(EL_IMAGE), "image"); // 18
+        iAllElements.put(new Short(EL_LINE), "line"); // 19
+        iAllElements.put(new Short(EL_METADATA), "metadata"); // 20
+        iAllElements.put(new Short(EL_MISSINGGLYPH), "missing-glyph"); // 21
+        iAllElements.put(new Short(EL_MPATH), "mpath"); // 22
+        iAllElements.put(new Short(EL_PATH), "path"); // 23
+        iAllElements.put(new Short(EL_POLYGON), "polygon"); // 24
+        iAllElements.put(new Short(EL_POLYLINE), "polyline"); // 25
+        iAllElements.put(new Short(EL_RECT), "rect"); // 26
+        iAllElements.put(new Short(EL_SET), "set"); // 27
+        iAllElements.put(new Short(EL_SVG), "svg"); // 28
+        iAllElements.put(new Short(EL_SWITCH), "switch"); // 29
+        iAllElements.put(new Short(EL_TEXT), "text"); // 30
+        iAllElements.put(new Short(EL_TITLE), "title"); // 31
+        iAllElements.put(new Short(EL_USE), "use"); // 32
+
+        // Attributes
+        iAllAttributes = new Hashtable(118);
+        iAllAttributes.put(new Short(AT_STRING), "#text"); // 1
+        iAllAttributes.put(new Short(AT_ACCENTHEIGHT), "accent-heigh"); // 2
+        iAllAttributes.put(new Short(AT_ACCUMULATE), "accumulate"); // 3
+        iAllAttributes.put(new Short(AT_ADDITIVE), "additive"); // 4
+        iAllAttributes.put(new Short(AT_ALPHABETIC), "alphabetic"); // 5
+        iAllAttributes.put(new Short(AT_ARABICFORM), "arabic-form"); // 6
+        iAllAttributes.put(new Short(AT_ASCENT), "ascent"); // 7
+        iAllAttributes.put(new Short(AT_ATTRIBUTENAME), "attributeName"); // 8
+        iAllAttributes.put(new Short(AT_ATTRIBUTETYPE), "attributeType"); // 9
+        iAllAttributes.put(new Short(AT_BASEPROFILE), "baseProfile"); // 10
+        iAllAttributes.put(new Short(AT_BBOX), "bbox"); // 11
+        iAllAttributes.put(new Short(AT_BEGIN), "begin"); // 12
+        iAllAttributes.put(new Short(AT_BY), "by"); // 13
+        iAllAttributes.put(new Short(AT_CALCMODE), "calcMode"); // 14
+        iAllAttributes.put(new Short(AT_CAPHEIGHT), "cap-height"); // 15
+        iAllAttributes.put(new Short(AT_COLOR), "color"); // 16
+        iAllAttributes.put(new Short(AT_COLORRENDERING), "color-rendering"); // 17
+        iAllAttributes.put(new Short(AT_CX), "cx"); // 18
+        iAllAttributes.put(new Short(AT_CY), "cy"); // 19
+        iAllAttributes.put(new Short(AT_D), "d"); // 20
+        iAllAttributes.put(new Short(AT_DESCENT), "descent"); // 21
+        iAllAttributes.put(new Short(AT_DISPLAY), "display"); // 22
+        iAllAttributes.put(new Short(AT_DUR), "dur"); // 23
+        iAllAttributes.put(new Short(AT_END), "end"); // 24
+        iAllAttributes.put(new Short(AT_FILL), "fill"); // 25
+        iAllAttributes.put(new Short(AT_FILLRULE), "fill-rule"); // 26
+        iAllAttributes.put(new Short(AT_FONTFAMILY), "font-family"); // 27
+        iAllAttributes.put(new Short(AT_FONTSIZE), "font-size"); // 28
+        iAllAttributes.put(new Short(AT_FONTSTRETCH), "font-stretch"); // 29
+        iAllAttributes.put(new Short(AT_FONTSTYLE), "font-style"); // 30
+        iAllAttributes.put(new Short(AT_FONTVARIANT), "font-variant"); // 31
+        iAllAttributes.put(new Short(AT_FONTWEIGHT), "font-weight"); // 32
+        iAllAttributes.put(new Short(AT_FROM), "from"); // 33
+        iAllAttributes.put(new Short(AT_G1), "g1"); // 34
+        iAllAttributes.put(new Short(AT_G2), "g2"); // 35
+        iAllAttributes.put(new Short(AT_GLYPHNAME), "glyph-name"); // 36
+        iAllAttributes.put(new Short(AT_HANGING), "hanging"); // 37
+        iAllAttributes.put(new Short(AT_HEIGHT), "height"); // 38
+        iAllAttributes.put(new Short(AT_HORIZADVX), "horiz-adv-x"); // 39
+        iAllAttributes.put(new Short(AT_HORIZORIGINX), "horiz-origin-x"); // 40
+        iAllAttributes.put(new Short(AT_ID), "id"); // 41
+        iAllAttributes.put(new Short(AT_IDEOGRAPHIC), "ideographic"); // 42
+        iAllAttributes.put(new Short(AT_K), "k"); // 43
+        iAllAttributes.put(new Short(AT_KEYPOINTS), "keyPoints"); // 44
+        iAllAttributes.put(new Short(AT_KEYSPLINES), "keySplines"); // 45
+        iAllAttributes.put(new Short(AT_KEYTIMES), "keyTimes"); // 46
+        iAllAttributes.put(new Short(AT_LANG), "lang"); // 47
+        iAllAttributes.put(new Short(AT_MATHEMATICAL), "mathematical"); // 48
+        iAllAttributes.put(new Short(AT_MAX), "max"); // 49
+        iAllAttributes.put(new Short(AT_MIN), "min"); // 50
+        iAllAttributes.put(new Short(AT_NAME), "name"); // 51
+        iAllAttributes.put(new Short(AT_ORIGIN), "origin"); // 52
+        iAllAttributes.put(new Short(AT_OVERLINEPOSITION), "overline-position"); // 53
+        iAllAttributes.put(new Short(AT_OVERLINETHICKNESS), "overline-thickness"); // 54
+        iAllAttributes.put(new Short(AT_PANOSE1), "panose-1"); // 55
+        iAllAttributes.put(new Short(AT_PATH), "path"); // 56
+        iAllAttributes.put(new Short(AT_PATHLENGTH), "pathLength"); // 57
+        iAllAttributes.put(new Short(AT_POINTS), "points"); // 58
+        iAllAttributes.put(new Short(AT_PRESERVEASPECTRATIO), "preserveAspectRatio"); // 59
+        iAllAttributes.put(new Short(AT_R), "r"); // 60
+        iAllAttributes.put(new Short(AT_REPEATCOUNT), "repeatCount"); // 61
+        iAllAttributes.put(new Short(AT_REPEATDUR), "repeatDur"); // 62
+        iAllAttributes.put(new Short(AT_REQUIREDEXTENSIONS), "requiredExtensions"); // 63
+        iAllAttributes.put(new Short(AT_REQUIREDFEATURES), "requiredFeatures"); // 64
+        iAllAttributes.put(new Short(AT_RESTART), "restart"); // 65
+        iAllAttributes.put(new Short(AT_ROTATE), "rotate"); // 66
+        iAllAttributes.put(new Short(AT_RX), "rx"); // 67
+        iAllAttributes.put(new Short(AT_RY), "ry"); // 68
+        iAllAttributes.put(new Short(AT_SLOPE), "slope"); // 69
+        iAllAttributes.put(new Short(AT_STEMH), "stemh"); // 70
+        iAllAttributes.put(new Short(AT_STEMV), "stemv"); // 71
+        iAllAttributes.put(new Short(AT_STRIKETHROUGHPOSITION), "strikethrough-position"); // 72
+        iAllAttributes.put(new Short(AT_STRIKETHROUGHTHICKNESS), "strikethrough-thickness"); // 73
+        iAllAttributes.put(new Short(AT_STROKE), "stroke"); // 74
+        iAllAttributes.put(new Short(AT_STROKEDASHARRAY), "stroke-dasharray"); // 75
+        iAllAttributes.put(new Short(AT_STROKEDASHOFFSET), "stroke-dashoffset"); // 76
+        iAllAttributes.put(new Short(AT_STROKELINECAP), "stroke-linecap"); // 77
+        iAllAttributes.put(new Short(AT_STROKELINEJOIN), "stroke-linejoin"); // 78
+        iAllAttributes.put(new Short(AT_STROKEMITERLIMIT), "stroke-miterlimit"); // 79
+        iAllAttributes.put(new Short(AT_STROKEWIDTH), "stroke-width"); // 80
+        iAllAttributes.put(new Short(AT_STYLE), "style"); // 81
+        iAllAttributes.put(new Short(AT_SYSTEMLANGUAGE), "systemLanguage"); // 82
+        iAllAttributes.put(new Short(AT_TARGET), "target"); // 83
+        iAllAttributes.put(new Short(AT_TEXTANCHOR), "text-anchor"); // 84
+        iAllAttributes.put(new Short(AT_TO), "to"); // 85
+        iAllAttributes.put(new Short(AT_TRANSFORM), "transform"); // 86
+        iAllAttributes.put(new Short(AT_TYPE), "type"); // 87
+        iAllAttributes.put(new Short(AT_U1), "u1"); // 88
+        iAllAttributes.put(new Short(AT_U2), "u2"); // 89
+        iAllAttributes.put(new Short(AT_UNDERLINEPOSITION), "underline-position"); // 90
+        iAllAttributes.put(new Short(AT_UNDERLINETHICKNESS), "underline-thickness"); // 91
+        iAllAttributes.put(new Short(AT_UNICODE), "unicode"); // 92
+        iAllAttributes.put(new Short(AT_UNICODERANGE), "unicode-range"); // 93
+        iAllAttributes.put(new Short(AT_UNITSPEREM), "units-per-em"); // 94
+        iAllAttributes.put(new Short(AT_VALUES), "values"); // 95
+        iAllAttributes.put(new Short(AT_VERSION), "version"); // 96
+        iAllAttributes.put(new Short(AT_VIEWBOX), "viewBox"); // 97
+        iAllAttributes.put(new Short(AT_VISIBILITY), "visibility"); // 98
+        iAllAttributes.put(new Short(AT_WIDTH), "width"); // 99
+        iAllAttributes.put(new Short(AT_WIDTHS), "widths"); // 100
+        iAllAttributes.put(new Short(AT_X), "x"); // 101
+        iAllAttributes.put(new Short(AT_XHEIGHT), "xheight"); // 102
+        iAllAttributes.put(new Short(AT_X1), "x1"); // 103
+        iAllAttributes.put(new Short(AT_X2), "x2"); // 104
+        iAllAttributes.put(new Short(AT_XLINKACTUATE), "xlink:actuate"); // 105
+        iAllAttributes.put(new Short(AT_XLINKARCROLE), "xlink:arcrole"); // 106
+        iAllAttributes.put(new Short(AT_XMLBASE), "xlink:base"); // 107
+        iAllAttributes.put(new Short(AT_XLINKHREF), "xlink:href"); // 108
+        iAllAttributes.put(new Short(AT_XLINKROLE), "xlink:role"); // 109
+        iAllAttributes.put(new Short(AT_XLINKSHOW), "xlink:show"); // 110
+        iAllAttributes.put(new Short(AT_XLINKTITLE), "xlink:title"); // 111
+        iAllAttributes.put(new Short(AT_XLINKTYPE), "xlink:type"); // 112
+        iAllAttributes.put(new Short(AT_XMLLANG), "xml:lang"); // 113
+        iAllAttributes.put(new Short(AT_XMLSPACE), "xml:space"); // 114
+        iAllAttributes.put(new Short(AT_Y), "y"); // 115
+        iAllAttributes.put(new Short(AT_Y1), "y1"); // 116
+        iAllAttributes.put(new Short(AT_Y2), "y2"); // 117
+        iAllAttributes.put(new Short(AT_ZOOMANDPAN), "zoomAndPan"); // 118
+
+        // Qualified elements
+        iQualifiedElements = new Vector(10);
+        iQualifiedElements.addElement("a"); // 1
+        iQualifiedElements.addElement("circle"); // 2
+        iQualifiedElements.addElement("ellipse"); // 3
+        iQualifiedElements.addElement("g"); // 4
+        iQualifiedElements.addElement("image"); // 5
+        iQualifiedElements.addElement("line"); // 6
+        iQualifiedElements.addElement("path"); // 7
+        iQualifiedElements.addElement("rect"); // 8
+        iQualifiedElements.addElement("text"); // 9
+        iQualifiedElements.addElement("use"); // 10
+
+        // Animatable elements
+        iAnimatableElements = new Vector(6);
+        iAnimatableElements.addElement("animate"); // 1
+        iAnimatableElements.addElement("animateColor"); // 2
+        iAnimatableElements.addElement("animateMotion"); // 3
+        iAnimatableElements.addElement("animateTransform"); // 4
+        iAnimatableElements.addElement("mpath"); // 5
+        iAnimatableElements.addElement("set"); // 6
+
+        // Read only elements
+        iReadOnlyElements = new Vector(19);
+        iReadOnlyElements.addElement("animateColor"); // 1
+        iReadOnlyElements.addElement("animateMotion"); // 2
+        iReadOnlyElements.addElement("animateTransform"); // 3
+        iReadOnlyElements.addElement("defs"); // 4
+        iReadOnlyElements.addElement("desc"); // 5
+        iReadOnlyElements.addElement("font"); // 6
+        iReadOnlyElements.addElement("font-face"); // 7
+        iReadOnlyElements.addElement("font-face-name"); // 8
+        iReadOnlyElements.addElement("font-face-src"); // 9
+        iReadOnlyElements.addElement("foreignObject"); // 10
+        iReadOnlyElements.addElement("glyph"); // 11
+        iReadOnlyElements.addElement("hkern"); // 12
+        iReadOnlyElements.addElement("metadata"); // 13
+        iReadOnlyElements.addElement("missing-glyph"); // 14
+        iReadOnlyElements.addElement("mpath"); // 15
+        iReadOnlyElements.addElement("polygon"); // 16
+        iReadOnlyElements.addElement("polyline"); // 17
+        iReadOnlyElements.addElement("set"); // 18
+        iReadOnlyElements.addElement("switch"); // 19
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+    /**
+     * Determines if the specified parentElement can have the specified childElement.
+     * This method works for only the element types that can be added in JSR-226.
+     */
+    static final boolean checkElementAsChild(short aParentElement, short aChildElement)
+    {
+        switch (aParentElement)
+        {
+        case EL_A:
+            switch (aChildElement)
+            {
+            case EL_A:
+            case EL_CIRCLE:
+            case EL_ELLIPSE:
+            case EL_G:
+            case EL_IMAGE:
+            case EL_LINE:
+            case EL_PATH:
+            case EL_RECT:
+            case EL_TEXT:
+            case EL_USE:
+                return true;
+            default:
+                return false;
+            }
+
+        case EL_ANIMATE:
+        case EL_ANIMATECOLOR:
+        case EL_ANIMATEMOTION:
+        case EL_ANIMATETRANSFORM:
+        case EL_CIRCLE:
+            return false;
+
+        case EL_DEFS:
+            switch (aChildElement)
+            {
+            case EL_A:
+            case EL_CIRCLE:
+            case EL_ELLIPSE:
+            case EL_G:
+            case EL_IMAGE:
+            case EL_LINE:
+            case EL_PATH:
+            case EL_RECT:
+            case EL_TEXT:
+            case EL_USE:
+                return true;
+            default:
+                return false;
+            }
+
+        case EL_DESC:
+        case EL_ELLIPSE:
+        case EL_FONT:
+        case EL_FONTFACE:
+        case EL_FONTFACENAME:
+        case EL_FONTFACESRC:
+        case EL_FOREIGNOBJECT:
+            return false;
+
+        case EL_G:
+            switch (aChildElement)
+            {
+            case EL_A:
+            case EL_CIRCLE:
+            case EL_ELLIPSE:
+            case EL_G:
+            case EL_IMAGE:
+            case EL_LINE:
+            case EL_PATH:
+            case EL_RECT:
+            case EL_TEXT:
+            case EL_USE:
+                return true;
+            default:
+                return false;
+            }
+
+        case EL_GLYPH:
+        case EL_HKERN:
+        case EL_IMAGE:
+        case EL_LINE:
+        case EL_METADATA:
+        case EL_MISSINGGLYPH:
+        case EL_MPATH:
+        case EL_PATH:
+        case EL_POLYGON:
+        case EL_POLYLINE:
+        case EL_RECT:
+        case EL_SET:
+            return false;
+
+        case EL_SVG:
+        case EL_SWITCH:
+            switch (aChildElement)
+            {
+            case EL_A:
+            case EL_CIRCLE:
+            case EL_ELLIPSE:
+            case EL_G:
+            case EL_IMAGE:
+            case EL_LINE:
+            case EL_PATH:
+            case EL_RECT:
+            case EL_TEXT:
+            case EL_USE:
+                return true;
+            default:
+                return false;
+            }
+
+        case EL_TEXT:
+            switch (aChildElement)
+            {
+            case EL_A:
+                return true;
+            default:
+                return false;
+            }
+
+        case EL_TITLE:
+        case EL_USE:
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Determines if the specified attribute type can be set on the specified element type.
+     * @param aAttribute
+     * @param aElement
+     * @return true if ok
+     */
+    static final boolean checkElementAttribute(short aAttribute, short aElement)
+    {
+        switch (aElement)
+        {
+        case EL_A:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_FONTFAMILY:
+            case AT_FONTSIZE:
+            case AT_FONTSTYLE:
+            case AT_FONTWEIGHT:
+            case AT_TEXTANCHOR:
+            case AT_TRANSFORM:
+            case AT_TARGET:
+            case AT_XLINKHREF:
+                return true;
+            default:
+                return false;
+            }
+        case EL_CIRCLE:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_TRANSFORM:
+            case AT_CX:
+            case AT_CY:
+            case AT_R:
+                return true;
+            default:
+                return false;
+            }
+        case EL_ELLIPSE:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_TRANSFORM:
+            case AT_CX:
+            case AT_CY:
+            case AT_RX:
+            case AT_RY:
+                return true;
+            default:
+                return false;
+            }
+        case EL_G:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_FONTFAMILY:
+            case AT_FONTSIZE:
+            case AT_FONTSTYLE:
+            case AT_FONTWEIGHT:
+            case AT_TEXTANCHOR:
+            case AT_TRANSFORM:
+                return true;
+            default:
+                return false;
+            }
+        case EL_IMAGE:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_TRANSFORM:
+            case AT_X:
+            case AT_Y:
+            case AT_WIDTH:
+            case AT_HEIGHT:
+            case AT_XLINKHREF:
+                return true;
+            default:
+                return false;
+            }
+        case EL_LINE:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_TRANSFORM:
+            case AT_X1:
+            case AT_X2:
+            case AT_Y1:
+            case AT_Y2:
+                return true;
+            default:
+                return false;
+            }
+        case EL_PATH:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_TRANSFORM:
+            case AT_D:
+                return true;
+            default:
+                return false;
+            }
+        case EL_RECT:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_TRANSFORM:
+            case AT_HEIGHT:
+            case AT_WIDTH:
+            case AT_X:
+            case AT_Y:
+            case AT_RX:
+            case AT_RY:
+                return true;
+            default:
+                return false;
+            }
+        case EL_SVG:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_FONTFAMILY:
+            case AT_FONTSIZE:
+            case AT_FONTSTYLE:
+            case AT_FONTWEIGHT:
+            case AT_TEXTANCHOR:
+            case AT_VERSION:
+            case AT_BASEPROFILE:
+            case AT_VIEWBOX:
+            case AT_ZOOMANDPAN:
+                return true;
+            default:
+                return false;
+            }
+        case EL_TEXT:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_FONTFAMILY:
+            case AT_FONTSIZE:
+            case AT_FONTSTYLE:
+            case AT_FONTWEIGHT:
+            case AT_TEXTANCHOR:
+            case AT_TRANSFORM:
+            case AT_X:
+            case AT_Y:
+            case AT_STRING:
+                return true;
+            default:
+                return false;
+            }
+        case EL_USE:
+            switch (aAttribute)
+            {
+            case AT_COLOR:
+            case AT_DISPLAY:
+            case AT_FILL:
+            case AT_FILLRULE:
+            case AT_STROKE:
+            case AT_STROKEDASHOFFSET:
+            case AT_STROKELINECAP:
+            case AT_STROKELINEJOIN:
+            case AT_STROKEMITERLIMIT:
+            case AT_STROKEWIDTH:
+            case AT_VISIBILITY:
+            case AT_FONTFAMILY:
+            case AT_FONTSIZE:
+            case AT_FONTSTYLE:
+            case AT_FONTWEIGHT:
+            case AT_TEXTANCHOR:
+            case AT_TRANSFORM:
+            case AT_X:
+            case AT_Y:
+            case AT_XLINKHREF:
+                return true;
+            default:
+                return false;
+            }
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if the attribute name needs prefix
+     * @param aAttributeTypeName
+     * @return Attribute name
+     */
+    static final String checkPrefixNeed(String aAttributeTypeName)
+    {
+        if (aAttributeTypeName.equals("actuate")) return  "xlink:actuate";
+
+        else if (aAttributeTypeName.equals("arcrole")) return  "xlink:arcrole";
+
+        else if (aAttributeTypeName.equals("href")) return  "xlink:href";
+
+        else if (aAttributeTypeName.equals("role")) return  "xlink:role";
+
+        else if (aAttributeTypeName.equals("show")) return  "xlink:show";
+
+        else if (aAttributeTypeName.equals("title")) return  "xlink:title";
+
+        else if (aAttributeTypeName.equals("type")) return  "xlink:type";
+
+        else if (aAttributeTypeName.equals("base")) return  "xml:base";
+
+        else if (aAttributeTypeName.equals("lang")) return  "xml:lang";
+
+        else if (aAttributeTypeName.equals("space")) return  "xml:space";
+
+        else return aAttributeTypeName;
+    }
+
+    /**
+     * Get internal data containers
+     * @return Data containers
+     */
+    static M2GSVGConstants getInstance()
+    {
+        if (sInstance == null)
+        {
+
+            sInstance = new M2GSVGConstants();
+        }
+        return sInstance;
+    }
+
+    /**
+     * Checks if element can be inserted.
+     * @param aElementTypeId -
+     * @return true if ok
+     */
+    static final boolean isAllowedToInsertElement(short aElementTypeId)
+    {
+        switch (aElementTypeId)
+        {
+        case EL_A:
+        case EL_CIRCLE:
+        case EL_ELLIPSE:
+        case EL_G:
+        case EL_IMAGE:
+        case EL_LINE:
+        case EL_PATH:
+        case EL_RECT:
+        case EL_TEXT:
+        case EL_USE:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks if element can be removed.
+     * @param aElementTypeId -
+     * @return true if ok
+     */
+    static final boolean isAllowedToRemoveElement(short aElementTypeId)
+    {
+        switch (aElementTypeId)
+        {
+        case EL_A:
+        case EL_CIRCLE:
+        case EL_ELLIPSE:
+        case EL_G:
+        case EL_IMAGE:
+        case EL_LINE:
+        case EL_PATH:
+        case EL_RECT:
+        case EL_TEXT:
+        case EL_USE:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+       * Checks if element is animatable
+       * @param aElementTypeName
+       * @return true if element is animatable
+       */
+    static boolean isAnimatableElement(String aElementTypeName)
+    {
+        if (getInstance().iAnimatableElements.contains(
+                    aElementTypeName))
+        {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Checks that float trait is allowed to get
+     * @param aAttributeTypeId
+     * @return true if float trait is allowed to get
+     */
+    static final boolean isGetFloatTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_STROKEDASHOFFSET:
+        case AT_STROKEMITERLIMIT:
+        case AT_STROKEWIDTH:
+        case AT_FONTSIZE:
+        case AT_HEIGHT:
+        case AT_WIDTH:
+        case AT_X:
+        case AT_Y:
+        case AT_RX:
+        case AT_RY:
+        case AT_CX:
+        case AT_CY:
+        case AT_R:
+        case AT_X1:
+        case AT_X2:
+        case AT_Y1:
+        case AT_Y2:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that matrix trait is allowed to set
+     * @param aAttributeTypeId
+     * @return true if matrix trait is allowed to set
+     */
+    static final boolean isGetMatrixTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_TRANSFORM:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that path trait is allowed to get
+     * @param aAttributeTypeId
+     * @return true if path trait is allowed to get
+     */
+    static final boolean isGetPathTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_D:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that rect trait is allowed to get
+     * @param aAttributeTypeId
+     * @return true if rect trait is allowed to get
+     */
+    static final boolean isGetRectTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_VIEWBOX:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that RGB trait is allowed to get.
+     * @param aAttributeTypeId
+     * @return true if RGB trait is allowed to get.
+     */
+    static final boolean isGetRgbColorTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_COLOR:
+        case AT_FILL:
+        case AT_STROKE:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that trait that can be obtained as a string is allowed to get.
+     * In SVG Tiny only certain traits can be obtained as a String value.
+     * @param aAttributeTypeId
+     * @return true if ok
+     */
+    static final boolean isGetTraitNSStringAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_DISPLAY:
+        case AT_FILLRULE:
+        case AT_STROKELINECAP:
+        case AT_STROKELINEJOIN:
+        case AT_VISIBILITY:
+        case AT_FONTFAMILY:
+        case AT_FONTSTYLE:
+        case AT_FONTWEIGHT:
+        case AT_TEXTANCHOR:
+        case AT_TARGET:
+        case AT_STRING: // not an SVG aTrait, but represents the contents of <text>
+        case AT_VERSION:
+        case AT_BASEPROFILE:
+        case AT_XLINKHREF:
+        case AT_ZOOMANDPAN:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+
+    /**
+     * Check trait
+     * @param aAttributeTypeId
+     * @return
+     */
+    static final boolean isGetTraitNSAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_XLINKHREF:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that an element is locatable
+     * @param aElementTypeName
+     * @return true if the element is locatable
+     */
+    static boolean isLocatableElement(String aElementTypeName)
+    {
+        if (isRootElement(aElementTypeName))
+        {
+            return true;
+        }
+        if (getInstance().iQualifiedElements.contains(
+                    aElementTypeName))
+        {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Checks that an element is qualified
+     * @param aElementTypeName
+     * @return true if the element is qualified
+     */
+    static boolean isQualifiedElement(String aElementTypeName)
+    {
+        if (getInstance().iQualifiedElements.contains(
+                    aElementTypeName))
+        {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Checks if element is read only
+     * @param aElementTypeName
+     * @return true if the element is read only
+     */
+    static boolean isElementReadOnly(String aElementTypeName)
+    {
+        if (aElementTypeName != null)
+        {
+            return getInstance().iReadOnlyElements.contains(
+                       aElementTypeName);
+        }
+        return false;
+    }
+
+    /**
+     * Checks that an element is a root element
+     * @param aElementTypeName
+     * @return true if the element is a root element
+     */
+    static boolean isRootElement(String aElementTypeName)
+    {
+        return ROOT_SVG_ELEMENT_NAME.equals(aElementTypeName);
+    }
+
+    /**
+     * Checks that float trait is allowed to set
+     * @param aAttributeTypeId
+     * @return true if float trait is allowed to set
+     */
+    static final boolean isSetFloatTraitAllowed(short aAttributeTypeId)
+    {
+        return isGetFloatTraitAllowed(aAttributeTypeId);
+    }
+
+    /**
+     * Checks that matrix trait is allowed to set
+     * @param aAttributeTypeId
+     * @return true if matrix trait is allowed to set
+     */
+    static final boolean isSetMatrixTraitAllowed(short aAttributeTypeId)
+    {
+        return isGetMatrixTraitAllowed(aAttributeTypeId);
+    }
+
+
+    /**
+     * Checks that path trait is allowed to set
+     * @param aAttributeTypeId
+     * @return true if path trait is allowed to set
+     */
+    static final boolean isSetPathTraitAllowed(short aAttributeTypeId)
+    {
+        return isGetPathTraitAllowed(aAttributeTypeId);
+    }
+
+    /**
+     * Checks that rect trait is allowed to set
+     * @param aAttributeTypeId
+     * @return true if rect trait is allowed to set
+     */
+    static final boolean isSetRectTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_VIEWBOX:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that RGB trait is allowed to set.
+     * @param aAttributeTypeId
+     * @return true if RGB trait is allowed to set.
+     */
+    static final boolean isSetRgbColorTraitAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_COLOR:
+        case AT_FILL:
+        case AT_STROKE:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Checks that trait that can be obtained as a string is allowed to set.
+     * In SVG Tiny only certain traits can be obtained as a String value.
+     * @param aAttributeTypeId
+     * @return true if ok
+     */
+    static final boolean isSetTraitNSStringAllowed(short aAttributeTypeId)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_COLOR:
+        case AT_DISPLAY:
+        case AT_FILL:
+        case AT_FILLRULE:
+        case AT_STROKE:
+        case AT_STROKEDASHOFFSET:
+        case AT_STROKELINECAP:
+        case AT_STROKELINEJOIN:
+        case AT_STROKEMITERLIMIT:
+        case AT_STROKEWIDTH:
+        case AT_VISIBILITY:
+        case AT_FONTFAMILY:
+        case AT_FONTSIZE:
+        case AT_FONTSTYLE:
+        case AT_FONTWEIGHT:
+        case AT_TEXTANCHOR:
+        case AT_TARGET:
+        case AT_STRING: // not an SVG trait, but represents the contents of <text>
+        case AT_XLINKHREF:
+        case AT_ZOOMANDPAN:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    /**
+     * Check trait
+     * @param aAttributeTypeId
+     * @return
+     */
+    static final boolean isSetTraitNSAllowed(short aAttributeTypeId)
+    {
+        return isGetTraitNSAllowed(aAttributeTypeId);
+    }
+
+    /**
+     * Converts a string trait name to the appropriate short constant.
+       * This method covers all of SVGT 1.1 and not just JSR-226.
+       * @param aAttributeTypeName
+       * @return Attribute's type id
+     */
+    static final short parseAttributeTypeId(String aAttributeTypeName)
+    {
+        String name = checkPrefixNeed(aAttributeTypeName);
+        Enumeration keys = getInstance().iAllAttributes.keys();
+        while (keys.hasMoreElements())
+        {
+            Object id = keys.nextElement();
+            try
+            {
+                if (((String)getInstance().iAllAttributes.get(
+                            id)).equals(name))
+                {
+                    return ((Short)id).shortValue();
+                }
+            }
+            catch (Exception e)
+            {
+            }
+
+        }
+        return SVG_ERROR;
+    }
+
+    /**
+     * Converts a short constant to the string representation of a SVGT 1.1 trait name.
+       * This method covers all of SVGT 1.1 and not just JSR-226.
+       * @param aAttributeTypeId
+       * @return Attribute's type name
+     */
+    static final String parseAttributeTypeName(short aAttributeTypeId)
+    {
+
+        Object attributeName = getInstance().iAllAttributes.get(
+                                   new Short(aAttributeTypeId));
+        if (attributeName != null)
+        {
+            return (String)attributeName;
+        }
+        return "";
+    }
+
+    /**
+     * Converts a string element name to the appropriate short constant.
+       * This method covers all of SVGT 1.1 and not just JSR-226.
+       * @param aElementTypeName
+       * @return Element's type id
+     */
+    static final short parseElementTypeId(String aElementTypeName)
+    {
+        Enumeration keys = getInstance().iAllElements.keys();
+        while (keys.hasMoreElements())
+        {
+            Object id = keys.nextElement();
+            try
+            {
+                if (((String)getInstance().iAllElements.get(
+                            id)).equals(aElementTypeName))
+                {
+                    return ((Short)id).shortValue();
+                }
+            }
+            catch (Exception e)
+            {
+            }
+        }
+        return SVG_ERROR;
+    }
+
+    /**
+     * Converts a short constant to the string representation of a SVGT 1.1 element name.
+       * This method covers all of SVGT 1.1 and not just JSR-226.
+       * @param aElementTypeId
+       * @return Element's type name
+     */
+    static final String parseElementTypeName(short aElementTypeId)
+    {
+        Object elementName = getInstance().iAllElements.get(
+                                 new Short(aElementTypeId));
+        if (elementName != null)
+        {
+            return (String)elementName;
+        }
+        return "";
+    }
+
+    /**
+     * Converts a string trait value to the appropriate short constant.
+     * NOTE: This method only handles traits that can be set as a string in JSR-226.
+     * @param aAttributeTypeId
+     * @param aValue
+     * @return Value's id
+     */
+    static final short parseAttributeValueNameId(short aAttributeTypeId, String aValue)
+    {
+        switch (aAttributeTypeId)
+        {
+        case AT_STRING: // element content (i.e. <text>, etc.)
+            return TEXT_NOT_SHORT;
+
+        case AT_COLOR: // inherit
+            if (aValue.equals("inherit")) return PAINT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_DISPLAY: // inline | none | inherit
+            if (aValue.equals("none")) return DISPLAY_NONE;
+            else if (aValue.equals("inline")) return DISPLAY_OTHER;
+            else if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_FILL: // none | currentColor | inherit
+            if (aValue.equals("none")) return  PAINT_NONE;
+            else if (aValue.equals("currentColor")) return PAINT_CURRENT;
+            else if (aValue.equals("inherit")) return PAINT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_FILLRULE: // nonzero | evenodd | inherit
+            if (aValue.equals("evenodd")) return  FILL_RULE_EVENODD;
+            else if (aValue.equals("nonzero")) return FILL_RULE_NONZERO;
+            else if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_FONTFAMILY: // same syntax as font-family attribute
+            if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return TEXT_NOT_SHORT;
+
+        case AT_FONTSIZE: // inherit
+            if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_FONTSTYLE: // normal | italic | oblique | inherit
+            if (aValue.equals("normal")) return  FONT_NORMAL;
+            else if (aValue.equals("italic")) return  FONT_STYLE_ITALIC;
+            else if (aValue.equals("oblique")) return  FONT_STYLE_OBLIQUE;
+            else if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_FONTWEIGHT: // normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit
+            if (aValue.equals("normal")) return FONT_NORMAL;
+            else if (aValue.equals("bold")) return  FONT_WEIGHT_BOLD;
+            else if (aValue.equals("bolder")) return  FONT_WEIGHT_BOLDER;
+            else if (aValue.equals("lighter")) return  FONT_WEIGHT_LIGHTER;
+            else if (aValue.equals("100")) return  FONT_WEIGHT_100;
+            else if (aValue.equals("200")) return  FONT_WEIGHT_200;
+            else if (aValue.equals("300")) return  FONT_WEIGHT_300;
+            else if (aValue.equals("400")) return  FONT_WEIGHT_400;
+            else if (aValue.equals("500")) return  FONT_WEIGHT_500;
+            else if (aValue.equals("600")) return  FONT_WEIGHT_600;
+            else if (aValue.equals("700")) return  FONT_WEIGHT_700;
+            else if (aValue.equals("800")) return  FONT_WEIGHT_800;
+            else if (aValue.equals("900")) return  FONT_WEIGHT_900;
+            else if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_STROKE: // none | currentColor | inherit
+            if (aValue.equals("none")) return  PAINT_NONE;
+            else if (aValue.equals("currentColor")) return  PAINT_CURRENT;
+            else if (aValue.equals("inherit")) return  PAINT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_STROKEDASHOFFSET: // inherit
+            if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_STROKELINECAP: // butt | round | square | inherit
+            if (aValue.equals("butt")) return  STROKE_LINECAP_BUTT;
+            else if (aValue.equals("round")) return  STROKE_LINECAP_ROUND;
+            else if (aValue.equals("square")) return  STROKE_LINECAP_SQUARE;
+            else if (aValue.equals("inherit")) return  DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_STROKELINEJOIN: // miter | round | bevel | inherit
+            if (aValue.equals("miter")) return  STROKE_LINEJOIN_MITER;
+            else if (aValue.equals("round")) return  STROKE_LINEJOIN_ROUND;
+            else if (aValue.equals("bevel")) return  STROKE_LINEJOIN_BEVEL;
+            else if (aValue.equals("inherit")) return  DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_STROKEMITERLIMIT: // inherit
+            if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_STROKEWIDTH: // inherit
+            if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_TARGET: // string
+            return TEXT_NOT_SHORT;
+
+        case AT_TEXTANCHOR: // start | middle | end | inherit
+            if (aValue.equals("start")) return  TEXT_ANCHOR_START;
+            else if (aValue.equals("middle")) return  TEXT_ANCHOR_MIDDLE;
+            else if (aValue.equals("end")) return  TEXT_ANCHOR_END;
+            else if (aValue.equals("inherit")) return  DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_VISIBILITY: // visible | hidden | inherit
+            if (aValue.equals("visible")) return  VISIBILITY_VISIBLE;
+            else if (aValue.equals("hidden")) return  VISIBILITY_OTHER;
+            else if (aValue.equals("inherit")) return DEFAULT_INHERIT;
+            else return SVG_ERROR;
+
+        case AT_XLINKHREF: // URI aValue
+            return TEXT_NOT_SHORT;
+
+        case AT_ZOOMANDPAN: // disable | magnify
+            if (aValue.equals("magnify")) return  ZPN_MAGNIFY;
+            else if (aValue.equals("disable")) return  ZPN_DISABLE;
+            else return SVG_ERROR;
+
+        default:
+            return SVG_ERROR;
+        }
+    }
+
+    /**
+     * Parse attribute
+       * @param aValueId
+     * @return Value's name
+     */
+    static final String parseAttributeValueName(short aAttributeTypeId, short aValueId)
+    {
+        if (aValueId == 0)
+        {
+            return "";
+        }
+        if (aAttributeTypeId == AT_FONTWEIGHT && aValueId == FONT_WEIGHT_LIGHTER)
+        {
+            return "300";
+        }
+        else if (aAttributeTypeId == AT_FONTWEIGHT && aValueId == FONT_NORMAL)
+        {
+            return "400";
+        }
+        else if (aAttributeTypeId == AT_FONTWEIGHT && aValueId == FONT_WEIGHT_BOLD)
+        {
+            return "700";
+        }
+        else if (aAttributeTypeId == AT_FONTWEIGHT && aValueId == FONT_WEIGHT_BOLDER)
+        {
+            return "800";
+        }
+        else
+        {
+            return parseAttributeValueName(aValueId);
+        }
+    }
+
+    /**
+     * Converts a short constant to the string representation of a
+     * SVGT 1.1 attribute value literal.
+       * This method covers all of SVGT 1.1 and not just JSR-226.
+       * @param aValueId
+     * @return Value's name
+     */
+    static final String parseAttributeValueName(short aValueId)
+    {
+
+        switch (aValueId)
+        {
+        case TEXT_NOT_SHORT:
+            return "#text";
+
+        case DEFAULT_INHERIT:
+        case PAINT_INHERIT:
+            return "inherit";
+
+        case DISPLAY_NONE:
+        case PAINT_NONE:
+            return "none";
+
+        case DISPLAY_OTHER:
+            return "inline";
+
+        case PAINT_CURRENT:
+            return "currentColor";
+
+        case FILL_RULE_NONZERO:
+            return "nonzero";
+
+        case FILL_RULE_EVENODD:
+            return "evenodd";
+
+        case FONT_NORMAL:
+            return "normal";
+
+        case FONT_STYLE_ITALIC:
+            return "italic";
+
+        case FONT_STYLE_OBLIQUE:
+            return "oblique";
+
+        case FONT_WEIGHT_BOLD:
+            return "bold";
+
+        case FONT_WEIGHT_BOLDER:
+            return "bolder";
+
+        case FONT_WEIGHT_LIGHTER:
+            return "lighter";
+
+        case FONT_WEIGHT_100:
+            return "100";
+
+        case FONT_WEIGHT_200:
+            return "200";
+
+        case FONT_WEIGHT_300:
+            return "300";
+
+        case FONT_WEIGHT_400:
+            return "400";
+
+        case FONT_WEIGHT_500:
+            return "500";
+
+        case FONT_WEIGHT_600:
+            return "600";
+
+        case FONT_WEIGHT_700:
+            return "700";
+
+        case FONT_WEIGHT_800:
+            return "800";
+
+        case FONT_WEIGHT_900:
+            return "900";
+
+        case STROKE_LINECAP_BUTT:
+            return "butt";
+
+        case STROKE_LINECAP_ROUND:
+        case STROKE_LINEJOIN_ROUND:
+            return "round";
+
+        case STROKE_LINECAP_SQUARE:
+            return "square";
+
+        case STROKE_LINEJOIN_MITER:
+            return "miter";
+
+        case STROKE_LINEJOIN_BEVEL:
+            return "bevel";
+
+        case TEXT_ANCHOR_START:
+            return "start";
+
+        case TEXT_ANCHOR_MIDDLE:
+            return "middle";
+
+        case TEXT_ANCHOR_END:
+            return "end";
+
+        case VISIBILITY_VISIBLE:
+            return "visible";
+
+        case VISIBILITY_OTHER:
+            return "hidden";
+
+        case ZPN_MAGNIFY:
+            return "magnify";
+
+        case ZPN_DISABLE:
+            return "disable";
+
+        default:
+            return "";
+        }
+    }
+
+    /*
+     * Parses path command
+     * @param aPathCommandIndex
+     * @return path command
+     */
+    static short parsePathCommand(short aPathCommandIndex)
+    {
+        short command = SVG_ERROR;
+        switch (aPathCommandIndex)
+        {
+        case PATH_COMMAND_m:
+        case PATH_COMMAND_M:
+            command = SVGPath.MOVE_TO;
+            break;
+        case PATH_COMMAND_Z:
+            command = SVGPath.CLOSE;
+            break;
+        case PATH_COMMAND_h:
+        case PATH_COMMAND_v:
+        case PATH_COMMAND_l:
+        case PATH_COMMAND_H:
+        case PATH_COMMAND_V:
+        case PATH_COMMAND_L:
+            command = SVGPath.LINE_TO;
+            break;
+        case PATH_COMMAND_s:
+        case PATH_COMMAND_c:
+        case PATH_COMMAND_S:
+        case PATH_COMMAND_C:
+            command = SVGPath.CURVE_TO;
+            break;
+        case PATH_COMMAND_t:
+        case PATH_COMMAND_q:
+        case PATH_COMMAND_T:
+        case PATH_COMMAND_Q:
+            command = SVGPath.QUAD_TO;
+            break;
+        default:
+            command = SVG_ERROR;
+            break;
+        }
+        return command;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1477 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.*;
+import org.w3c.dom.svg.*;
+import org.w3c.dom.events.*;
+//import com.nokia.mj.impl.rt.legacy.ToolkitInvoker;
+import java.io.IOException;
+import org.eclipse.swt.widgets.*;
+//import org.eclipse.swt.widgets.Display;
+import com.nokia.mj.impl.utils.Logger;
+
+public class M2GSVGElement extends M2GObject implements SVGElement
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    // Error constants
+    static final String TYPE_IS_NULL_ESTR =
+        "The type is null.";
+    static final String LISTENER_IS_NULL_ESTR =
+        "The listener is null.";
+    static final String CAPTURE_NOT_SUPPORTED_ESTR =
+        "The capture phase is not supported in SVG Tiny.";
+    //static final String ESWT_PACKAGE =
+       // "org.eclipse.swt.widgets.Display" ;
+
+    /* Optimization: static finals changed to local variables
+    static final String TRAIT_IS_NULL_ESTR =
+      "The trait is null.";
+    static final String TRAIT_NOT_SUPPORTED_ON_ELEM_ESTR =
+      "The trait is not supported on this element.";
+    static final String TRAIT_NOT_SUPPORTED_IN_NS_ESTR =
+      "The trait is not supported in this namespace.";
+    static final String GET_FLOAT_MISMATCH_ESTR =
+      "Trait's computed value cannot be converted to a float.";
+    static final String SET_FLOAT_MISMATCH_ESTR =
+      "Trait's value cannot be specified as a float.";
+    static final String GET_MATRIX_MISMATCH_ESTR =
+      "Trait's computed value cannot be converted to a SVGMatrix.";
+    static final String SET_MATRIX_MISMATCH_ESTR =
+      "Trait's value cannot be specified as a SVGMatrix.";
+    static final String GET_PATH_MISMATCH_ESTR =
+      "Trait's computed value cannot be converted to a SVGPath.";
+    static final String SET_PATH_MISMATCH_ESTR =
+      "Trait's value cannot be specified as a SVGPath.";
+    static final String GET_RECT_MISMATCH_ESTR =
+      "Trait's computed value cannot be converted to a SVGRect.";
+    static final String SET_RECT_MISMATCH_ESTR =
+      "Trait's value cannot be specified as a SVGRect.";
+    static final String GET_RGB_MISMATCH_ESTR =
+      "Trait's computed value cannot be converted to a SVGRGBColor.";
+    static final String SET_RGB_MISMATCH_ESTR =
+      "Trait's value cannot be specified as a SVGRGBColor.";
+    static final String NS_NOT_SUPPORTED_ESTR =
+      "The namespace is not supported.";
+    static final String GET_TRAIT_NS_STRING_MISMATCH_ESTR =
+      "Trait's computed value cannot be converted to a String.";
+    static final String SET_TRAIT_NS_STRING_MISMATCH_ESTR =
+      "Trait's value cannot be specified as a String.";
+    static final String ID_IS_NULL_ESTR =
+      "The id is null.";
+    static final String EXISTING_ELEM_ID_CHANGE_ESTR =
+      "Existing element id cannot be changed.";
+    static final String ELEM_ID_EXIST_IN_DOCUMENT_ESTR =
+      "Element id already exists in the document.";
+    static final String INVALID_INPUT_VALUE_ESTR =
+      "The input value is an invalid value for the given trait.";
+    static final String VALUE_IS_NULL_ESTR =
+      "Value cannot be set to null.";
+    static final String SET_READONLY_MISMATCH_ESTR =
+      "Attempt to change readonly trait.";
+    static final String INVALID_VALUE_ESTR =
+      "The value is invalid.";
+    static final String INVALID_USE_ELEMENT_ESTR =
+      "The <use> element is hooked into the document tree and the the value of xlink:href is set invalid.";
+    static final String CANNOT_REMOVE_NODE_ESTR =
+      "Cannot remove this type of node.";
+    static final String CANNOT_REMOVE_NOT_CHILD_ESTR =
+      "Not a child of this node.";
+    static final String CANNOT_REMOVE_NON_NULL_ID_ESTR =
+      "The element being removed or one of its decendants have non-null id.";
+    static final String INSERT_NODE_OF_THAT_TYPE_ESTR =
+      "Cannot insert node of that type.";
+    static final String APPEND_DOCUMENT_ESTR =
+      "Cannot append Document elements.";
+    static final String DOCUMENT_HIERARCHY_ESTR =
+      "Hierarchy request error in Document.";
+    static final String CHILD_IS_WRONG_TYPE_ESTR =
+      "Child is wrong type (Document).";
+    static final String CHILD_BELONG_TO_DIFFERENT_DOCUMENT_ESTR =
+      "Child belongs to different document.";
+    static final String CHILD_NOT_FOUND_ESTR =
+      "The child to insert before doesn't exist in this current node.";
+    static final String INVALID_ELEMENT_ID_VALUE =
+      "Invalid element id value.";
+    */
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    protected M2GDocument iDocument;
+    protected short iElementTypeId;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aHandle is native element handle
+     * @param aDocument is a reference to a document that owns this element.
+     */
+    M2GSVGElement(int aElementHandle, M2GDocument aDocument)
+    {
+        super(aElementHandle);
+        iDocument = aDocument;
+        doConstruct();
+    }
+
+
+    /**
+     * @see org.w3c.dom.events.EventTarget#addEventListener()
+     */
+    public void addEventListener(String type, EventListener listener, boolean useCapture)
+    {
+        if (type == null || type.equals(""))
+        {
+            throw new NullPointerException(TYPE_IS_NULL_ESTR);
+        }
+        if (listener == null)
+        {
+            throw new NullPointerException(LISTENER_IS_NULL_ESTR);
+        }
+        if (useCapture == true)
+        {
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                CAPTURE_NOT_SUPPORTED_ESTR);
+        }
+        iDocument.register(this, type, listener);
+    }
+
+    /**
+     * @see org.w3c.dom.Node#appendChild()
+     */
+    public Node appendChild(Node newChild)
+    {
+        // If refChild is null, newChild is inserted at the end of the list
+        return insertBefore(newChild, null);  // will inform about DOM changes
+    }
+
+    /**
+     * Checks attribute validity
+     * @param aAttributeTypeName
+     * @return attribute's type id
+     * @throws DOMException
+     */
+    protected short check(String aAttributeTypeName) throws DOMException
+    {
+        short attributeTypeId = M2GSVGConstants.AT_UNDEFINED;
+        if (aAttributeTypeName == null || aAttributeTypeName.equals(""))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "check() exception: " + /*SF*/"The trait is null."/*SF*/);
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"The trait is null."/*SF*/);
+        }
+        // Converts attribute's name
+        attributeTypeId = M2GSVGConstants.parseAttributeTypeId(aAttributeTypeName);
+        // Checks that element has this attribute
+        if (!M2GSVGConstants.checkElementAttribute(attributeTypeId, iElementTypeId))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "check() exception: " + /*SF*/"The trait is not supported on this element."/*SF*/);
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"The trait is not supported on this element."/*SF*/);
+        }
+        return attributeTypeId;
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doCheckValidity()
+     */
+    public boolean doCheckValidity()
+    {
+        try
+        {
+            if (super.doCheckValidity() &&
+                    (iDocument != null) &&
+                    (iElementTypeId != M2GSVGConstants.EL_UNDEFINED))
+            {
+                return true;
+            }
+        }
+        catch (IOException e)
+        {
+        }
+        return false;
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doCleanup()
+     */
+    protected void doCleanup()
+    {
+        iDocument = null;
+        iElementTypeId = M2GSVGConstants.EL_UNDEFINED;
+        resetHandles();
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doConstruct()
+     */
+    public void doConstruct()
+    {
+        // No need to register for finalization
+        // super.doConstruct();
+        iElementTypeId = _getElementTypeId(
+                             getNativeSVGProxyHandle(), getHandle());
+    }
+
+    /**
+     * Returns a document
+     */
+    public M2GDocument getDocument()
+    {
+        return iDocument;
+    }
+
+    /*
+     * Retuns element's type id
+     * @return  element's type id
+     */
+    public short getElementTypeId()
+    {
+        return iElementTypeId;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getFirstElementChild()
+     */
+    public Element getFirstElementChild() throws DOMException
+    {
+        // Get child element's handle
+        int childHandle = _getFirstElementChild(
+                               getNativeSVGProxyHandle(), getHandle());
+        if (M2GObject.checkHandle(childHandle))
+        {
+            return (Element)M2GSVGElement.buildElement(childHandle, iDocument);
+        }
+        return null;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getFloatTrait()
+     */
+    public float getFloatTrait(String name) throws DOMException
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "getFloatTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short attributeTypeId = check(name);
+        if (!M2GSVGConstants.isGetFloatTraitAllowed(attributeTypeId))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's computed value cannot be converted to a float."/*SF*/);
+        }
+        return _getFloatTrait(
+                   getNativeSVGProxyHandle(), getHandle(), attributeTypeId);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getId()
+     */
+    public String getId()
+    {
+        return _getStringTrait(
+                   getNativeSVGProxyHandle(), getHandle(), M2GSVGConstants.AT_ID);
+    }
+
+    /**
+     * @see org.w3c.dom.Node#getLocalName()
+     */
+    public String getLocalName()
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getLocalName() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return M2GSVGConstants.parseElementTypeName(iElementTypeId);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getMatrixTrait()
+     */
+    public SVGMatrix getMatrixTrait(String name)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getMatrixTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short attributeTypeId = check(name);
+        if (!M2GSVGConstants.isGetMatrixTraitAllowed(attributeTypeId))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's computed value cannot be converted to a SVGMatrix."/*SF*/);
+        }
+        M2GSVGMatrix matrix = new M2GSVGMatrix();
+        // If an error is occurred, then no values are put in the
+        // matrix array by the native method
+        _getMatrixTrait(
+            getNativeSVGProxyHandle(),
+            getHandle(),
+            attributeTypeId,
+            matrix.getComponents());
+        return matrix;
+    }
+
+    /**
+     * @see org.w3c.dom.Node#getNamespaceURI()
+     */
+    public String getNamespaceURI()
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getNamespaceURI() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return M2GSVGConstants.SVG_NAMESPACE_URI;
+        /*
+          return _getStringTrait(
+                getNativeSVGProxyHandle(),
+                getHandle(),
+                id);
+        */
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getNextElementSibling()
+     */
+    public Element getNextElementSibling()
+    {
+        int elementHandle = _getNextElementSibling(
+                                 getNativeSVGProxyHandle(), getHandle());
+        if (M2GObject.checkHandle(elementHandle))
+        {
+            return M2GSVGElement.buildElement(elementHandle, iDocument);
+        }
+        return null;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getParentNode()
+     */
+    public Node getParentNode()
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getParentNode() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        int parentHandle = _getParent(
+                                getNativeSVGProxyHandle(), getHandle());
+        if (M2GObject.checkHandle(parentHandle))
+        {
+            return M2GSVGElement.buildElement(parentHandle, iDocument);
+        }
+        return null;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getPathTrait()
+     */
+    public SVGPath getPathTrait(String name)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getPathTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short attributeTypeId = check(name);
+        if (!M2GSVGConstants.isGetPathTraitAllowed(attributeTypeId))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's computed value cannot be converted to a SVGPath."/*SF*/);
+        }
+        int pathHandle = _getPathTrait(
+                             getNativeSVGProxyHandle(),
+                             getHandle(),
+                             attributeTypeId);
+        if (pathHandle != 0)
+        {
+            // Path doesn't own the native object
+            return new M2GSVGPath(pathHandle);
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getRectTrait()
+     */
+    public SVGRect getRectTrait(String name)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getRectTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short attributeTypeId = check(name);
+        if (!M2GSVGConstants.isGetRectTraitAllowed(attributeTypeId))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's computed value cannot be converted to a SVGRect."/*SF*/);
+        }
+        M2GSVGRect rect = new M2GSVGRect();
+        if (_getRectTrait(
+                    getNativeSVGProxyHandle(),
+                    getHandle(),
+                    attributeTypeId,
+                    rect.getComponents()) == -1)
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "getRectTrait() - returns null!!");
+            return null;
+        }
+        else
+        {
+            return rect;
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#getRGBColorTrait()
+     */
+    public SVGRGBColor getRGBColorTrait(String name)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getRGBColorTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+
+        short attributeTypeId = check(name);
+        if (!M2GSVGConstants.isGetRgbColorTraitAllowed(attributeTypeId))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's computed value cannot be converted to a SVGRGBColor."/*SF*/);
+        }
+        M2GSVGRGBColor rgb = new M2GSVGRGBColor(0, 0, 0);
+        int result = _getColorTrait(
+                         getNativeSVGProxyHandle(),
+                         getHandle(),
+                         attributeTypeId,
+                         rgb.getComponents());
+        if (result == -1)
+        {
+            if ((attributeTypeId == M2GSVGConstants.AT_FILL) ||
+                    (attributeTypeId == M2GSVGConstants.AT_COLOR))
+            {
+                return new M2GSVGRGBColor(0, 0, 0);
+            }
+            else
+            {
+                return null;
+            }
+        }
+        else if (result == 0)
+        {
+            return null;
+        }
+        return rgb;
+    }
+
+    /**
+     * Get trait
+     * @see org.w3c.dom.svg.SVGElement#getTrait()
+     */
+    public String getTrait(String name)
+    {
+        return getTraitNS(null, name);
+    }
+
+    /**
+     * Get trait
+     * @see org.w3c.dom.svg.SVGElement#getTraitNS()
+     */
+    public String getTraitNS(String namespaceURI, String name)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getTraitNS() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+
+        // Checks name validity
+        short id = check(name);
+        String value = null;
+
+        // SVG traits are in the so-called element's 'per-element type partitions namespaces'
+        // namespace must be always null
+        // except for HREF traits which are from XLINK namespace?
+
+        // XLINK_NAMESPACE
+        if (namespaceURI != null &&
+                namespaceURI.equals(M2GSVGConstants.XLINK_NAMESPACE_URI))
+        {
+            if (!M2GSVGConstants.isGetTraitNSAllowed(id))
+            {
+                Logger.ELOG(Logger.EJavaUI, "getTraitNS() XLINK eception: " +
+                            "Trait's computed value cannot be converted to a String.");
+                throw new DOMException(
+                    DOMException.TYPE_MISMATCH_ERR,
+                    "Trait's computed value cannot be converted to a String.");
+            }
+
+            value = _getStringTrait(
+                        getNativeSVGProxyHandle(),
+                        getHandle(),
+                        id);
+
+            if (value == null)
+            {
+                value = "";
+            }
+
+            return value;
+        }
+
+        // Checks namespace validity: namespace must be null
+        if (namespaceURI != null)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "getTraitNS() - namespace IS NOT xlink but something else.");
+            Logger.ELOG(Logger.EJavaUI,
+                        "getTraitNS() exception: " + /*SF*/"The namespace is not supported."/*SF*/);
+
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                "The namespace is not supported.");
+        }
+
+        // Checks that attribute is obtaineable as a string
+        if (!M2GSVGConstants.isGetTraitNSStringAllowed(id))
+        {
+            Logger.ELOG(Logger.EJavaUI, "getTraitNS() exception: " +
+                        "Trait's computed value cannot be converted to a String.");
+
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                "Trait's computed value cannot be converted to a String.");
+        }
+
+        if (id == M2GSVGConstants.AT_XLINKHREF)
+        {
+            Logger.ELOG(Logger.EJavaUI, "getTraitNS() exception: "
+                        + "The trait is not supported in this namespace.");
+
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                "The trait is not supported in this namespace.");
+        }
+
+        // Checks if attribute is in string format
+        if ((id == M2GSVGConstants.AT_STRING) ||
+                (id == M2GSVGConstants.AT_VERSION) ||
+                (id == M2GSVGConstants.AT_BASEPROFILE) ||
+                (id == M2GSVGConstants.AT_TARGET) ||
+                (id == M2GSVGConstants.AT_FONTFAMILY))
+        {
+            value = _getStringTrait(
+                        getNativeSVGProxyHandle(),
+                        getHandle(),
+                        id);
+        }
+        // Reads enum attribute
+        else
+        {
+            short valueId = _getEnumTrait(
+                                getNativeSVGProxyHandle(),
+                                getHandle(),
+                                id);
+
+            // Convert value id to string
+            value = M2GSVGConstants.parseAttributeValueName(id, valueId);
+        }
+
+        if (value == null)
+        {
+            value = "";
+        }
+        return value;
+    }
+
+    /*
+     * Get element used from this element
+     * @return Element.
+     */
+    public SVGElement getUsedFromElement()
+    {
+        int elementHandle = _getUsedFromElement(
+                                getNativeSVGProxyHandle(),
+                                getHandle());
+        if (M2GObject.checkHandle(elementHandle))
+        {
+            return M2GSVGElement.buildElement(elementHandle, iDocument);
+        }
+        return null;
+    }
+
+
+    /**
+     * @see org.w3c.dom.Node#insertBefore
+     */
+    public Node insertBefore(Node newChild, Node refChild)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+
+        if (newChild == null)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - new child is null");
+            throw new NullPointerException();
+        }
+        if (newChild instanceof M2GDocument)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - child is document");
+            throw new DOMException(
+                DOMException.HIERARCHY_REQUEST_ERR,
+                /*SF*/"Child is wrong type (Document)."/*SF*/);
+        }
+
+        if (!M2GSVGConstants.isAllowedToInsertElement(((M2GSVGElement)newChild).iElementTypeId))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - cannot insert this node type");
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"Cannot insert node of that type."/*SF*/);
+        }
+
+        if (!M2GSVGConstants.checkElementAsChild(
+                    iElementTypeId, ((M2GSVGElement)newChild).iElementTypeId))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - invalid parent-child relation");
+            throw new DOMException(
+                DOMException.HIERARCHY_REQUEST_ERR,
+                /*SF*/"Cannot insert node of that type."/*SF*/);
+        }
+        // Ensure that the new child candidate wouldn't be an ancestor of this element
+        if (IsAncestor(newChild, this))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - is ancestor");
+            throw new DOMException(
+                DOMException.HIERARCHY_REQUEST_ERR,
+                /*SF*/"Hierarchy request error in Document."/*SF*/);
+        }
+        // Check that the child and this element belong to the same Document
+        if (((M2GSVGElement)newChild).getDocument().getHandle() != iDocument.getHandle())
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - document is not the same");
+            throw new DOMException(
+                DOMException.WRONG_DOCUMENT_ERR,
+                /*SF*/"Child belongs to different document."/*SF*/);
+        }
+        if ((refChild != null) &&
+                (((M2GSVGElement)refChild.getParentNode()).getHandle() != getHandle()))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "insertBefore() exception - ref child is not found");
+            throw new DOMException(
+                DOMException.NOT_FOUND_ERR,
+                /*SF*/"The child to insert before doesn't exist in this current node."/*SF*/);
+        }
+        // check that if <use> then xlink:href is an existing element id
+        if (((M2GSVGElement)newChild).iElementTypeId == M2GSVGConstants.EL_USE)
+        {
+            String value = ((M2GSVGElement)newChild).getTraitNS(
+                               M2GSVGConstants.XLINK_NAMESPACE_URI, "href");
+            if (value.length() != 0)
+            {
+                if (!value.startsWith("#") ||
+                        ((M2GSVGElement)newChild).iDocument.getElementById(value.substring(1)) == null)
+                {
+                    Logger.ELOG(Logger.EJavaUI,
+                                "insertBefore() exception - \"href\" trait value="
+                                + value + " is invalid");
+                    throw new DOMException(
+                        DOMException.INVALID_STATE_ERR,
+                        /*SF*/"Invalid element id value."/*SF*/);
+                }
+            }
+        }
+        if (refChild == null)
+        {
+            _appendChild(
+                getNativeSVGProxyHandle(),
+                getHandle(),
+                ((M2GSVGElement)newChild).getHandle());
+        }
+        else
+        {
+            _insertBefore(
+                getNativeSVGProxyHandle(),
+                getHandle(),
+                ((M2GSVGElement)newChild).getHandle(),
+                ((M2GSVGElement) refChild).getHandle());
+        }
+        String href = _getStringTrait(
+                          getNativeSVGProxyHandle(),
+                          ((M2GSVGElement)newChild).getHandle(),
+                          M2GSVGConstants.AT_XLINKHREF);
+        // Need to call resource handler if element is elementindom, image,
+        // and if it has an href attribute
+        if ((href != null) &&
+                (((M2GSVGElement)newChild).iElementTypeId == M2GSVGConstants.EL_IMAGE) &&
+                iDocument.isElementInDOM(((M2GSVGElement)newChild).getHandle()))
+        {
+            // Call resource handler here
+            iDocument.invokeResourceHandler(href);
+        }
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+
+        return newChild;
+    }
+
+    /*
+     * Check if used
+     * @return True if used.
+     */
+    public boolean isUsed()
+    {
+        return (_isUsed(
+                    getNativeSVGProxyHandle(),
+                    getHandle()) > 0 ? true : false);
+    }
+
+    /**
+     * @see org.w3c.dom.events.EventTarget#removeEventListener()
+     */
+    public void removeEventListener(String type, EventListener listener, boolean useCapture)
+    {
+        if (type == null || type.equals("") || listener == null)
+        {
+            throw new NullPointerException();
+        }
+        if (useCapture == true)
+        {
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                CAPTURE_NOT_SUPPORTED_ESTR);
+        }
+        iDocument.unregister(this, type, listener);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setId()
+     */
+    public void setId(String id) throws DOMException
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setId() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        if (id == null)
+        {
+            throw new NullPointerException(/*SF*/"The id is null."/*SF*/);
+        }
+        if (getId() != null)
+        {
+            throw new DOMException(
+                DOMException.NO_MODIFICATION_ALLOWED_ERR,
+                /*SF*/"Existing element id cannot be changed."/*SF*/);
+        }
+        if (iDocument.containsElement(id))
+        {
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"Element id already exists in the document."/*SF*/);
+        }
+        else
+        {
+            _setStringTrait(
+                getNativeSVGProxyHandle(),
+                getHandle(), M2GSVGConstants.AT_ID, id);
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setFloatTrait()
+     */
+    public void setFloatTrait(String name, float value)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setFloatTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+
+        short id = check(name);
+        if (!M2GSVGConstants.isSetFloatTraitAllowed(id))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setFloatTrait() exception - set float (id=" + id + ") not allowed");
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's value cannot be specified as a float."/*SF*/);
+        }
+        if ((Float.isNaN(value)) ||
+                // value must be >= 1
+                (value < 1 && (id == M2GSVGConstants.AT_STROKEMITERLIMIT)) ||
+                // value must be >= 0
+                (value < 0 && (id == M2GSVGConstants.AT_FONTSIZE ||
+                               id == M2GSVGConstants.AT_STROKEWIDTH ||
+                               id == M2GSVGConstants.AT_HEIGHT ||
+                               id == M2GSVGConstants.AT_WIDTH ||
+                               id == M2GSVGConstants.AT_RX ||
+                               id == M2GSVGConstants.AT_RY ||
+                               id == M2GSVGConstants.AT_R)))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setFloatTrait() exception - invalid value=" + value);
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The input value is an invalid value for the given trait."/*SF*/);
+        }
+        _setFloatTrait(getNativeSVGProxyHandle(),
+                       getHandle(), id, value);
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setMatrixTrait()
+     */
+    public void setMatrixTrait(String name, SVGMatrix matrix)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setMatrixTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short id = check(name);
+        if (!M2GSVGConstants.isSetMatrixTraitAllowed(id))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's value cannot be specified as a SVGMatrix."/*SF*/);
+        }
+        if ((matrix == null) ||
+                !(matrix instanceof M2GSVGMatrix))
+        {
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The input value is an invalid value for the given trait."/*SF*/);
+        }
+
+        _setMatrixTrait(getNativeSVGProxyHandle(),
+                        getHandle(), id,
+                        ((M2GSVGMatrix)matrix).getComponents());
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setPathTrait()
+     */
+    public void setPathTrait(String name, SVGPath path)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setPathTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short id = check(name);
+        if (!M2GSVGConstants.isSetPathTraitAllowed(id))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's value cannot be specified as a SVGPath."/*SF*/);
+        }
+        if ((path == null) ||
+                !(path instanceof M2GSVGPath) ||
+                !((M2GSVGPath)path).doCheckValidity())
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setPathTrait() - exception M2GSVGPath not valid");
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The input value is an invalid value for the given trait."/*SF*/);
+        }
+
+        _setPathTrait( getNativeSVGProxyHandle(),
+                      getHandle(), id, ((M2GSVGPath)path).getHandle());
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+    }
+
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setPathTrait()
+     */
+    public void setRectTrait(String name, SVGRect rect)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setRectTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short id = check(name);
+        if (!M2GSVGConstants.isSetRectTraitAllowed(id))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's value cannot be specified as a SVGRect."/*SF*/);
+        }
+        if ((rect == null) ||
+                (rect.getWidth() < 0 || rect.getHeight() < 0))
+        {
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The input value is an invalid value for the given trait."/*SF*/);
+        }
+
+        _setRectTrait(
+            getNativeSVGProxyHandle(), getHandle(), id,
+            rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight());
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setRGBColorTrait()
+     */
+    public void setRGBColorTrait(String name, SVGRGBColor color)
+    {
+
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setRGBColorTrait() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        short id = check(name);
+        if (!M2GSVGConstants.isSetRgbColorTraitAllowed(id))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setRGBColorTrait() - exception: " + DOMException.TYPE_MISMATCH_ERR);
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's value cannot be specified as a SVGRGBColor."/*SF*/);
+        }
+        if (color == null)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setRGBColorTrait() - exception: " + DOMException.INVALID_ACCESS_ERR);
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The trait is null."/*SF*/);
+        }
+
+        _setColorTrait(
+            getNativeSVGProxyHandle(), getHandle(), id,
+            color.getRed(), color.getGreen(), color.getBlue());
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setTrait()
+     */
+    public void setTrait(String name, String value)
+    {
+        setTraitNS(null, name, value);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGElement#setTraitNS()
+     */
+    public void setTraitNS(String namespaceURI, String name, String value)
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setTraitNS() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        if (value == null)
+        {
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"Value cannot be set to null."/*SF*/);
+        }
+
+        short id = check(name);
+
+        // SVG traits are in the so-called element's 'per-element type partitions namespaces'
+        // namespace must be always null
+        // except for HREF traits which are from XLINK namespace?
+
+        if (namespaceURI != null &&
+                namespaceURI.equals(M2GSVGConstants.XLINK_NAMESPACE_URI))
+        {
+            if (!M2GSVGConstants.isGetTraitNSAllowed(id))
+            {
+                throw new DOMException(
+                    DOMException.TYPE_MISMATCH_ERR,
+                    "Trait's value cannot be specified as a String.");
+            }
+
+            // check that if <use> then xlink:href is an existing element id
+            if ((iElementTypeId == M2GSVGConstants.EL_USE) &&
+                    (iDocument.isElementInDOM(getHandle())))
+            {
+                if ((value.length() <= 1) ||
+                        !value.startsWith("#") ||
+                        (iDocument.getElementById(value.substring(1)) == null))
+                {
+                    Logger.ELOG(Logger.EJavaUI,
+                                "setTraitNS() - DOMException");
+                    throw new DOMException(
+                        DOMException.INVALID_ACCESS_ERR,
+                        /*SF*/"The <use> element is hooked into the document tree and the the value of xlink:href is set invalid."/*SF*/);
+                }
+            }
+
+            _setStringTrait(
+                getNativeSVGProxyHandle(), getHandle(), id, value);
+
+            // inform observer about changes in DOM only if element is in DOM
+            iDocument.notifyDOMChangeObserver(iNativeHandle);
+
+            // Check if element is in DOM and in that case invokes
+            // resource handler
+            if ((iElementTypeId == M2GSVGConstants.EL_IMAGE) &&
+                    (id == M2GSVGConstants.AT_XLINKHREF) &&
+                    (iDocument.isElementInDOM(getHandle())))
+            {
+                if (!iDocument.containsExternalResourceURI(value))
+                {
+                    iDocument.invokeResourceHandler(value);
+                }
+            }
+
+            return;
+        } // namespaceURI != null &&  namespaceURI.equals(M2GSVGConstants.XLINK_NAMESPACE_URI)
+
+        // all traits except HREF must have no namespace
+        if (namespaceURI != null)
+        {
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                "The namespace is not supported.");
+        }
+
+        if ((id == M2GSVGConstants.AT_VERSION) ||
+                (id == M2GSVGConstants.AT_BASEPROFILE))
+        {
+            throw new DOMException(
+                DOMException.NO_MODIFICATION_ALLOWED_ERR,
+                /*SF*/"Attempt to change readonly trait."/*SF*/);
+        }
+
+        if (id == M2GSVGConstants.AT_XLINKHREF)
+        {
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"The trait is not supported in this namespace."/*SF*/);
+        }
+
+        if (!M2GSVGConstants.isSetTraitNSStringAllowed(id))
+        {
+            throw new DOMException(
+                DOMException.TYPE_MISMATCH_ERR,
+                /*SF*/"Trait's value cannot be specified as a String."/*SF*/);
+        }
+
+        short valueId = M2GSVGConstants.parseAttributeValueNameId(id, value);
+
+        if (valueId == M2GSVGConstants.SVG_ERROR)
+        {
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The value is invalid."/*SF*/);
+        }
+        else if (valueId == M2GSVGConstants.TEXT_NOT_SHORT)
+        {
+            _setStringTrait(
+                getNativeSVGProxyHandle(), getHandle(), id, value);
+        }
+        else
+        {
+            _setEnumTrait(
+                getNativeSVGProxyHandle(), getHandle(), id, valueId);
+        }
+
+        // inform observer about changes in DOM only if element is in DOM
+        iDocument.notifyDOMChangeObserver(iNativeHandle);
+    }
+
+    /**
+     * @see org.w3c.dom.Node#removeChild
+     */
+    public Node removeChild(Node oldChild) throws DOMException
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "removeChild() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        if (oldChild == null)
+        {
+            throw new NullPointerException();
+        }
+        if (oldChild instanceof M2GDocument)
+        {
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"Cannot remove this type of node."/*SF*/);
+        }
+
+        M2GSVGElement removableChild = (M2GSVGElement)oldChild;
+
+        if (!M2GSVGConstants.isAllowedToRemoveElement(
+                    removableChild.iElementTypeId))
+        {
+            throw new DOMException(
+                DOMException.NOT_SUPPORTED_ERR,
+                /*SF*/"Cannot remove this type of node."/*SF*/);
+        }
+        M2GSVGElement parent = (M2GSVGElement)removableChild.getParentNode();
+        if ((parent == null) ||
+                (parent.getHandle() != getHandle()))
+        {
+            throw new DOMException(
+                DOMException.NOT_FOUND_ERR,
+                /*SF*/"Not a child of this node."/*SF*/);
+        }
+        // Check if removable
+        int result = _checkRemoveable(
+                         getNativeSVGProxyHandle(),
+                         removableChild.getHandle());
+        if (result <= 0)
+        {
+            throw new DOMException(
+                DOMException.INVALID_ACCESS_ERR,
+                /*SF*/"The element being removed or one of its decendants have non-null id."/*SF*/);
+        }
+        // The removedChildHandle handle should be same as the removableChild handle
+        int removedChildHandle  = removedChildHandle = _removeChild(
+                                      getNativeSVGProxyHandle(),
+                                      getHandle(), removableChild.getHandle());
+        // Remove the element from the live elements
+        removableChild.getDocument().unregisterLiveElement(
+            new Integer(removableChild.getHandle()));
+
+        iDocument.notifyDOMChangeObserver(getHandle());
+
+        return removableChild;
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+
+    /**
+     * Creates SVGElement instance according to the element type.
+     * Possible element types are: SVGElement, SVGLocatableElement,
+     * SVGSVGElement, SVGAnimationElement
+     */
+    public static SVGElement buildElement(int aElementHandle, M2GDocument aDocument)
+    {
+        // Check native handle
+        if (!M2GObject.checkHandle(aElementHandle) || (aDocument == null))
+        {
+            return null;
+        }
+
+        // Check if the element already exists
+        SVGElement svgElement = aDocument.findLiveElement(new Integer(aElementHandle));
+        if (svgElement != null)
+        {
+            return svgElement;
+        }
+
+        String typeName = M2GSVGElement.getElementTypeName(aElementHandle, aDocument);
+
+        if (M2GSVGConstants.isRootElement(typeName))
+        {
+            svgElement = M2GSVGSVGElement.buildRootElement(aDocument);
+        }
+        else if (M2GSVGConstants.isLocatableElement(typeName))
+        {
+            svgElement = new M2GSVGLocatableElement(aElementHandle, aDocument);
+        }
+        else if (M2GSVGConstants.isAnimatableElement(typeName))
+        {
+            svgElement = new M2GSVGAnimationElement(aElementHandle, aDocument);
+        }
+        else
+        {
+
+            String id = M2GSVGElement._getStringTrait(
+                            M2GManager.getInstance().getSVGProxyHandle(),
+                            aElementHandle,
+                            M2GSVGConstants.AT_ID );
+            if ((id != null) && id.equals("text_use_svg_default_font"))
+            {
+                return buildElement(
+                           M2GSVGElement._getNextElementSibling(
+                               aDocument.getNativeSVGProxyHandle(), aElementHandle),
+                           aDocument);
+            }
+            else
+            {
+                svgElement = new M2GSVGElement(aElementHandle, aDocument);
+            }
+        }
+        aDocument.registerLiveElement(svgElement, new Integer(aElementHandle));
+        return svgElement;
+    }
+
+    /**
+     * Helper function for appendChild and insertBefore
+     * returns true if "ancestor" is the same node as "child" or
+     * if "ancestor" is parent/ancestor of "child" else returns false
+     */
+    private static final boolean IsAncestor(Node aAncestor, Node aChild) throws DOMException
+    {
+        boolean result = false;
+        if (aAncestor != null && aChild != null)
+        {
+            if (aChild instanceof M2GDocument)
+            {
+                throw new DOMException(
+                    DOMException.HIERARCHY_REQUEST_ERR,
+                    /*SF*/"Cannot append Document elements."/*SF*/);
+            }
+            if ((aChild instanceof M2GSVGElement) && (aAncestor instanceof M2GSVGElement))
+            {
+                // Should check all types or just parent type???
+                if (((M2GSVGElement)aAncestor).getHandle() == ((M2GSVGElement)aChild).getHandle())
+                {
+                    result = true;
+                }
+                else
+                {
+                    result = IsAncestor(aAncestor, aChild.getParentNode());
+                }
+            }
+        }
+        return result;
+    }
+
+
+    /**
+     * Helper function for removeChild.
+     * @returns false if the node "child" and all its children have non-null ids
+     * else returns true
+     */
+    private static final boolean IsReadOnly(Node aChild)
+    {
+        if (aChild != null)
+        {
+            // Should check all types or just parent type???
+            if ((aChild instanceof M2GSVGElement) ||
+                    (aChild instanceof SVGLocatableElement) ||
+                    (aChild instanceof SVGSVGElement))
+            {
+                if (M2GSVGConstants.isElementReadOnly(((M2GSVGElement)aChild).getLocalName()))
+                {
+                    return true;
+                }
+                return IsReadOnly(aChild.getParentNode());
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Get element's type name
+     * @param aElementHandle
+     * @param aDocument
+     * @return element's type name
+     */
+    public static String getElementTypeName(int aElementHandle, M2GDocument aDocument)
+    {
+        short elemenTypeId = M2GSVGConstants.EL_UNDEFINED;
+        if (aDocument != null)
+        {
+            elemenTypeId = M2GSVGElement._getElementTypeId(
+                               aDocument.getNativeSVGProxyHandle(),
+                               aElementHandle);
+        }
+        else
+        {
+            elemenTypeId = M2GSVGElement._getElementTypeId(
+                               M2GManager.getInstance().getSVGProxyHandle(),
+                               aElementHandle);
+        }
+
+        return M2GSVGConstants.parseElementTypeName(elemenTypeId);
+    }
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private static native void _appendChild(
+        int aSvgProxyHandle, int aElementHandle, int aNewChild);
+
+    private static native int _checkRemoveable(
+        int aSvgProxyHandle, int aElementHandle);
+
+    static native int _getBBox(
+        int aSvgProxyHandle, int aElementHandle,
+        short aAttributeTypeId, float[] aComponents);
+
+    private static native int _getColorTrait(
+        int aSvgProxyHandle, int aElementHandle,
+        short aAttributeTypeId, int[] aColorComponents);
+
+    private static native short _getElementTypeId(
+        int aSvgProxyHandle, int aElementHandle);
+
+    static native short _getEnumTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId);
+
+    private static native int _getFirstElementChild(
+        int aSvgProxyHandle, int aElementHandle);
+
+    private static native float _getFloatTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId);
+
+    static native int _getMatrixTrait(
+        int aSvgProxyHandle, int aElementHandle,
+        short aAttributeTypeId, float[] aComponents);
+
+    private static native int _getNextElementSibling(
+        int aSvgProxyHandle, int aElementHandle);
+
+    private static native int _getParent(
+        int aSvgProxyHandle, int aElementHandle);
+
+    private static native int _getPathTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId);
+
+    static native int _getRectTrait(
+        int aSvgProxyHandle, int aElementHandle,
+        short aAttributeTypeId, float[] aComponents);
+
+    native static int _getRootElement(
+        int aSvgProxyHandle, int aDocumentHandle);
+
+    static native void _getScreenBBox(
+        int aSvgProxyHandle, int aElementHandle, float[] aComponents);
+
+    protected static native String _getStringTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId);
+
+    private static native int _getUsedFromElement(
+        int aSvgProxyHandle, int aElementHandle);
+
+    private static native void _insertBefore(
+        int aSvgProxyHandle, int aElementHandle,
+        int aChildElementHandle, int aReferenceElementHandle);
+
+    private static native int _isUsed(
+        int aSvgProxyHandle, int aElementHandle);
+
+    private static native int _removeChild(
+        int aSvgProxyHandle, int aElementHandle, int aChildElementHandle);
+
+    private static native void _setColorTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId,
+        int aRed, int aGreen, int aBlue);
+
+    private static native void _setEnumTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId,
+        short aValue);
+
+    private static native void _setFloatTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId, float aValue);
+
+    static native void _setMatrixTrait(
+        int aSvgProxyHandle, int aElementHandle,
+        short aAttributeTypeId, float[] aComponents);
+
+    private static native void _setPathTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId, int aPathHandle);
+
+    private static native void _setRectTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId,
+        float aX, float aY, float aWidth, float aHeight);
+
+    private static native void _setStringTrait(
+        int aSvgProxyHandle, int aElementHandle, short aAttributeTypeId, String aValue);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGElementWrapper.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.events.*;
+import org.w3c.dom.DOMException;
+import com.nokia.mj.impl.utils.Logger;
+
+public class M2GSVGElementWrapper extends M2GObject implements EventTarget
+{
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GSVGElement iElement;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aElement Element to be wrapped
+     */
+    M2GSVGElementWrapper(M2GSVGElement aElement)
+    {
+        super();
+        iElement = aElement;
+    }
+
+    /**
+     * Cleanup operations.
+     */
+    void doCleanup()
+    {
+    }
+
+    /**
+     * Construct operations.
+     */
+    void doConstruct()
+    {
+        if (iElement != null)
+        {
+            setHandle(iElement.getHandle());
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.events.EventTarget#addEventListener()
+     */
+    public void addEventListener(String type, EventListener listener, boolean useCapture)
+    {
+        if (type == null || type.equals(""))
+        {
+            throw new NullPointerException(M2GSVGElement.TYPE_IS_NULL_ESTR);
+        }
+        if (listener == null)
+        {
+            throw new NullPointerException(M2GSVGElement.LISTENER_IS_NULL_ESTR);
+        }
+        if (useCapture == true)
+        {
+            throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
+                                   M2GSVGElement.CAPTURE_NOT_SUPPORTED_ESTR);
+        }
+        try
+        {
+            iElement.getDocument().register(iElement, type, listener);
+        }
+        catch (Exception e)
+        {
+            Logger.ELOG(Logger.EJavaUI, "addEventListener() exception:" + e.toString());
+        }
+    }
+
+    /**
+     * Get wrapped target element
+     * @return Event target
+     */
+    public EventTarget getWrappedTarget()
+    {
+        return iElement;
+    }
+
+    /**
+     * @see org.w3c.dom.events.EventTarget#removeEventListener()
+     */
+    public void removeEventListener(String type, EventListener listener, boolean useCapture)
+    {
+        if (type == null || type.equals(""))
+        {
+            throw new NullPointerException(M2GSVGElement.TYPE_IS_NULL_ESTR);
+        }
+        if (listener == null)
+        {
+            throw new NullPointerException(M2GSVGElement.LISTENER_IS_NULL_ESTR);
+        }
+        if (useCapture == true)
+        {
+            throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
+                                   M2GSVGElement.CAPTURE_NOT_SUPPORTED_ESTR);
+        }
+        try
+        {
+            iElement.getDocument().unregister(iElement, type, listener);
+        }
+        catch (Exception e)
+        {
+            Logger.ELOG(Logger.EJavaUI, "removeEventListener() exception:" + e.toString());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGImage.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,477 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.microedition.m2g.ExternalResourceHandler;
+import javax.microedition.m2g.SVGImage;
+import org.w3c.dom.Document;
+import org.w3c.dom.svg.SVGElement;
+import org.w3c.dom.DOMException;
+import com.nokia.microedition.m2g.connection.*;
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.utils.StreamUtils;
+
+
+/*
+ * Image implementation
+ */
+public class M2GSVGImage
+        extends SVGImage
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    /* Optimization: static finals changed to local variables
+    private static final String NULL_TYPE_ESTR =
+      "The type is null.";
+    private static final String ILLEGAL_VALUS_ESTR =
+      "The x or y values are negative.";
+    private static final String EVENT_TYPE_NOT_SUPPORTED_ESTR =
+      "The event type is not supported.";
+    private static final String INVALID_ELEMENT_ESTR =
+      "Invalid element.";
+    public static final String URI_IS_NULL_ESTR =
+      "The URI is null.";
+    */
+
+    //--------------------------------------------------
+    //  VARIABLES
+    //--------------------------------------------------
+    M2GDocument iDocument = null;
+    private SVGElement iFocusedNode = null;
+
+    //--------------------------------------------------
+    //  METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     */
+    M2GSVGImage()
+    {
+        super();
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGImage#activate()
+     */
+    public void activate()
+    {
+        SVGElement node = iFocusedNode;
+        while (node != null)
+        {
+            ((M2GDocument)getDocument()).handleEvent(new M2GEvent(
+                        M2GSVGConstants.EVENT_ACTIVATE,
+                        node,
+                        M2GEvent.EVENT_TARGET));
+            node = (SVGElement)node.getParentNode();
+        }
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGImage#dispatchMouseEvent()
+     */
+    public void dispatchMouseEvent(String type, int x, int y)
+    {
+        if (type == null || type.equals(""))
+        {
+            Logger.ELOG(Logger.EJavaUI, "dispatchMouseEvent() NullPointerException");
+            throw new NullPointerException(/*SF*/"The type is null."/*SF*/);
+        }
+        if (x < 0 || y < 0)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "dispatchMouseEvent() IllegalArgumentException");
+            throw new IllegalArgumentException(/*SF*/"The x or y values are negative."/*SF*/);
+        }
+        if (!type.equals(M2GSVGConstants.EVENT_CLICK))
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "dispatchMouseEvent() DOMException - only click event is supported");
+            throw new DOMException(DOMException.NOT_SUPPORTED_ERR, /*SF*/"The event type is not supported."/*SF*/);
+        }
+        int elementHandle = _dispatchMouseEvent(
+                                iDocument.getNativeSVGProxyHandle(),
+                                iDocument.getHandle(), x, y);
+
+        SVGElement targetElement = M2GSVGElement.buildElement(elementHandle, iDocument);
+        SVGElement usedFromElement = null;
+        if ((targetElement != null) && ((M2GSVGElement)targetElement).isUsed())
+        {
+            usedFromElement = ((M2GSVGElement)((M2GSVGElement)targetElement).getUsedFromElement());
+        }
+        if (targetElement instanceof M2GSVGElement)
+        {
+            iFocusedNode = targetElement;
+        }
+        while (targetElement != null)
+        {
+            // click event
+            iDocument.handleEvent(new M2GEvent(
+                                      M2GSVGConstants.EVENT_CLICK, targetElement, M2GEvent.EVENT_TARGET));
+            // DOMActivate event
+            iDocument.handleEvent(new M2GEvent(
+                                      M2GSVGConstants.EVENT_ACTIVATE, targetElement, M2GEvent.EVENT_TARGET));
+            // Gets parent node
+            targetElement = (SVGElement)targetElement.getParentNode();
+        }
+        // The "target element" is only a clone. The "used from element" is the actual element.
+        if (usedFromElement != null)
+        {
+            iDocument.handleEvent(new M2GEvent(
+                                      M2GSVGConstants.EVENT_CLICK, usedFromElement, M2GEvent.WRAPPED_EVENT_TARGET));
+            iDocument.handleEvent(new M2GEvent(
+                                      M2GSVGConstants.EVENT_ACTIVATE, usedFromElement, M2GEvent.WRAPPED_EVENT_TARGET));
+        }
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGImage#focusOn()
+     */
+    public void focusOn(SVGElement element)
+    {
+        SVGElement tempNode = element;
+        // If focusOn is called on the same element, do not focus out.
+        boolean callFocusOut =
+            (((iFocusedNode != null) && (iFocusedNode == element ? false : true)) || ((iFocusedNode != null) && (element == null)));
+        //Checking to see if the element is hooked into the tree.
+        if (element != null)
+        {
+            tempNode = element;
+            while (tempNode != null)
+            {
+                if ((tempNode.getLocalName()).equals(M2GSVGConstants.ROOT_SVG_ELEMENT_NAME))
+                {
+                    // Breaks if tempNode is root svg
+                    break;
+                }
+                tempNode = (SVGElement)tempNode.getParentNode();
+            }
+            // This indicates that the element does not contain a root element,
+            // therefore does not belong to the document.
+            if (tempNode == null)
+            {
+                Logger.ELOG(Logger.EJavaUI, "focusOn() - DOMException invalid element");
+                throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, /*SF*/"Invalid element."/*SF*/);
+            }
+        }
+        // Focus out from the current focused node and its parents
+        if (callFocusOut)
+        {
+            if (iFocusedNode instanceof M2GSVGElement)
+            {
+                _focusOut(
+                    ((M2GSVGElement)iFocusedNode).getNativeSVGProxyHandle(),
+                    ((M2GSVGElement)iFocusedNode).getDocument().getHandle(),
+                    ((M2GSVGElement)iFocusedNode).getHandle());
+            }
+
+            // Focus out the current focused node and its parents
+            tempNode = iFocusedNode;
+            while (tempNode != null)
+            {
+                iDocument.handleEvent(new M2GEvent(
+                                          M2GSVGConstants.EVENT_FOCUS_OUT, tempNode, M2GEvent.EVENT_TARGET));
+                tempNode = (SVGElement)tempNode.getParentNode();
+            }
+        }
+        //focus in for element and its parents
+        if ((element != null) && (element instanceof M2GSVGElement))
+        {
+            _focusOn(
+                ((M2GSVGElement)element).getNativeSVGProxyHandle(),
+                ((M2GSVGElement)element).getDocument().getHandle(),
+                ((M2GSVGElement)element).getHandle() );
+        }
+        tempNode = element;
+        while (tempNode != null)
+        {
+            iDocument.handleEvent(new M2GEvent(
+                                      M2GSVGConstants.EVENT_FOCUS_IN, tempNode, M2GEvent.EVENT_TARGET));
+            tempNode = (SVGElement)tempNode.getParentNode();
+        }
+        // Sets the new focus
+        iFocusedNode = element;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGImage#getDocument()
+     */
+    public Document getDocument()
+    {
+        return iDocument;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#getViewportHeight()
+     */
+    public synchronized int getViewportHeight()
+    {
+        return iDocument.getViewportHeight();
+    }
+
+
+    /*
+     * @see javax.microedition.m2g.ScalableImage#getViewportWidth()
+     */
+    public synchronized int getViewportWidth()
+    {
+        return iDocument.getViewportWidth();
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGImage#incrementTime()
+     */
+    public void incrementTime(float seconds)
+    {
+        ((M2GSVGSVGElement)iDocument.getDocumentElement()).incrementTime(seconds);
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#requestCompleted()
+     */
+    public void requestCompleted(String uri, InputStream resourceData) throws IOException
+    {
+        if (uri == null)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "requestCompleted() throw NullPointerException");
+            throw new NullPointerException(/*SF*/"The URI is null."/*SF*/);
+        }
+
+        if (resourceData != null)
+        {
+            byte receiveData[] = StreamUtils.readBytesFromStream(resourceData, -1);
+            iDocument.requestCompleted(uri, receiveData);
+        }
+        else
+        {
+            // Indicates that the requested resource could not be
+            // fetched by the ResourceHandler or application,
+            // and in this event the SVG engine will not make further attempts
+            // to load this resource.
+            // Pass the null to the native side so it can delete the image
+            iDocument.requestCompleted(uri, null);
+        }
+    }
+
+    /**
+     * Set document
+     * @param aDocument -
+     */
+    public void setDocument(M2GDocument aDocument)
+    {
+        iDocument = aDocument;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#setViewportHeight()
+     */
+    public synchronized void setViewportHeight(int height)
+    {
+        iDocument.setViewportHeight(height);
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#setViewportWidth()
+     */
+    public synchronized void setViewportWidth(int width)
+    {
+        iDocument.setViewportWidth(width);
+    }
+
+    //--------------------------------------------------
+    //  STATIC METHODS
+    //--------------------------------------------------
+    /*
+     * @see javax.microedition.m2g.SVGImage#createEmptyImage()
+     */
+    public static M2GSVGImage buildEmptyImage(ExternalResourceHandler handler)
+    {
+        try
+        {
+            return M2GSVGImage.buildImage(
+                       new ByteArrayInputStream(
+                           M2GSVGConstants.getInstance().iEmptySvgDocument.getBytes()),
+                       handler, null, null);
+        }
+        catch (IOException e)
+        {
+            Logger.ELOG(Logger.EJavaUI, "M2GSVGImage: buildEmptyImage - IOEception: " + e.toString());
+        }
+        return null;
+    }
+
+    /**
+     * Build svg image
+     * @see javax.microedition.m2g.ScalableImage#createImage()
+     * @param stream Plain text stream that contains svg data
+     * @param handler External resource handler. If null then default
+     * external resource handler is used.
+     * @param baseUrl A base url from where a document is downloaded.
+     * @param suffixUrl The suffix url according to the DRM opening mode of the SVG file
+     * Null if it's not known.
+     */
+    public static M2GSVGImage buildImage(
+        InputStream stream,
+        ExternalResourceHandler handler,
+        String baseUrl,
+        String suffixUrl) throws IOException
+    {
+        if (stream == null)
+        {
+            throw new NullPointerException();
+        }
+				
+
+        String strData = new String(StreamUtils.readBytesFromStream(stream, -1));
+
+        // Default handler is used if the specified handler is null
+        if (handler == null)
+        {
+            handler = M2GConnectionFactory.getExternalResourceHandler(null);
+        }
+
+        // Creates and setups svg image
+        M2GSVGImage image = new M2GSVGImage();
+        
+        M2GDocument document = M2GDocument.buildDocument(
+                                   image,
+                                   baseUrl,
+                                   suffixUrl,
+                                   strData,
+                                   handler);
+        // Checks document validity
+				
+        image.setDocument(document);
+        
+        if (handler != null)
+        {
+            // Gets size of external resources
+            int itemCount = _getExternalListSize(
+                                document.getNativeSVGProxyHandle(),
+                                document.getHandle());
+
+            // Loops through external items
+            for (int index = 0; index < itemCount; index++)
+            {
+                String url = _getExternalListItem(
+                                 document.getNativeSVGProxyHandle(),
+                                 document.getHandle(),
+                                 index);
+                // Calls an external implementation of the resource handler
+                if ((url != null) && !(url.equals("")))
+                {
+                    document.invokeResourceHandler(url);
+                }
+            }
+        }
+        
+        // initialise the viewport
+        _initViewport(document.getNativeSVGProxyHandle(),
+                      document.getHandle());
+        
+
+        return image;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage#createImage()
+     */
+    public static M2GSVGImage buildImage(
+        String url, ExternalResourceHandler handler) throws IOException
+    {
+        // Checks passed parameters
+        if (url == null)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "M2GSVGImage: 2 buildImage() - url is null");
+            throw new NullPointerException();
+        }
+        if (url.length() == 0)
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "M2GSVGImage: 2 buildImage() - url is empty");
+            throw new IllegalArgumentException();
+        }
+        // Default handler is used if the specified handler is null
+        if (handler == null)
+        {
+            handler = M2GConnectionFactory.getExternalResourceHandler(url);
+        }
+
+        // Open the url and get input stream
+        M2GSVGImage image = null;
+        M2GConnectionProxy connectionProxy = null;
+        try
+        {
+            connectionProxy = M2GConnectionFactory.create(url);
+            image = M2GSVGImage.buildImage(
+                        connectionProxy.getInputStream(),
+                        handler,
+                        connectionProxy.getBaseUrl(),
+                        connectionProxy.getSuffixUrl());
+            // Set connection policy
+            if (image != null)
+            {
+                Document doc = image.getDocument();
+                if (doc != null)
+                {
+                    ((M2GDocument)doc).setConnectionPolicy(
+                        connectionProxy.getConnectionPolicy());
+                }
+            }
+            return image;
+        }
+        finally
+        {
+            if (connectionProxy != null)
+            {
+                connectionProxy.close();
+                connectionProxy = null;
+            }
+        }
+    }
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private native static int _dispatchMouseEvent(
+        int aSvgProxyHandle,int aDocumentHandle, 
+        int aX, int aY);
+
+    private native static void _focusOn(
+        int aSvgProxyHandle,int aDocumentHandle, 
+        int aSvgElementHandle);
+
+    private native static void _focusOut(
+        int aSvgProxyHandle,int aDocumentHandle, 
+        int aSvgElementHandle);
+
+    native static int _getExternalListSize(
+         int aSvgProxyHandle, int aDocumentHandle);
+
+    native static String _getExternalListItem(
+        int aSvgProxyHandle, int aDocumentHandle,
+        int aIndex);
+
+    private native static void _initViewport(
+        int aSvgProxyHandle, int aDocumentHandle);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGLocatableElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+
+public class M2GSVGLocatableElement
+        extends M2GSVGElement
+        implements SVGLocatableElement
+{
+    //------------------------------------------------------------------
+    // METHODS
+    //------------------------------------------------------------------
+
+    /**
+     * Constructor
+     * @param aHandle -
+     * @param aDocument -
+     */
+    public M2GSVGLocatableElement(int aHandle, M2GDocument aDocument)
+    {
+        super(aHandle, aDocument);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGLocatableElement#getBBox()
+     */
+    public SVGRect getBBox()
+    {
+        M2GSVGRect bbox = new M2GSVGRect();
+        M2GSVGElement._getBBox(getNativeSVGProxyHandle(), getHandle(),
+            M2GSVGConstants.AT_BBOX, bbox.getComponents());
+        // Checks element's type
+        if ((iElementTypeId == M2GSVGConstants.EL_G) ||
+                (iElementTypeId == M2GSVGConstants.EL_PATH) ||
+                (iElementTypeId == M2GSVGConstants.EL_SVG))
+        {
+            if (bbox.isZero())
+            {
+                bbox = null;
+            }
+        }
+        else if (iElementTypeId == M2GSVGConstants.EL_TEXT)
+        {
+            if ((bbox.getHeight()) == 0 && (bbox.getWidth() == 0))
+            {
+                bbox = null;
+            }
+        }
+        return bbox;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGLocatableElement#getScreenBBox()
+     */
+    public SVGRect getScreenBBox()
+    {
+        // Checks if this element is in DOM
+        if (getDocument().isElementInDOM(getHandle()))
+        {
+            M2GSVGRect bbox = new M2GSVGRect();
+            // Initializes M2GSVGRect components
+            M2GSVGElement._getScreenBBox(
+                getNativeSVGProxyHandle(),
+                getHandle(),
+                bbox.getComponents());
+            return bbox;
+        }
+        return null;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGLocatableElement#getScreenCTM()
+     */
+    public SVGMatrix getScreenCTM()
+    {
+        if (getDocument().isElementInDOM(getHandle()))
+        {
+            M2GSVGMatrix matrix = new M2GSVGMatrix();
+            _getMatrixTrait(getNativeSVGProxyHandle(),
+                            getHandle(),
+                            M2GSVGConstants.EL_SVG, matrix.getComponents());
+            return matrix;
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGMatrix.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,342 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+import org.w3c.dom.DOMException;
+
+/**
+ * This interface represents an "SVGMatrix" datatype, identified by an affine transform.
+ * It can be used to read and modify the values of transform attribute as per SVG specification.
+ *
+ * The transformation can be represented using matrix math on a 3x3 array.
+ * Given (x,y), the transformation (x',y') can be found by:
+ * [ x']   [ m00 m01 m02 ] [ x ]   [ m00*x + m01*y + m02 ]
+ * [ y'] = [ m10 m11 m12 ] [ y ] = [ m10*x + m11*y + m12 ]
+ * [ 1 ]   [  0   0   1  ] [ 1 ]   [          1          ]
+ *
+ * The bottom row of the matrix is constant, so a transform can be uniquely
+ * represented by "[[m00, m01, m02], [m10, m11, m12]]".
+ */
+public class M2GSVGMatrix implements SVGMatrix
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    /* Optimization: static finals changed to local variables
+    static private final String INVALID_INDEX_ESTR =
+    "The index is invalid.";
+    static private final String DET_IS_ZERO_ESTR =
+    "The determinant of this matrix is zero.";
+    */
+    static final int ARRAY_SIZE = 6;
+    // Array index
+    static private final int M00 = 0;
+    static private final int M10 = 1;
+    static private final int M01 = 2;
+    static private final int M11 = 3;
+    static private final int M02 = 4;
+    static private final int M12 = 5;
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private float iComponents[];
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Construct a matrix with the following components:
+     * <pre>
+     * [1 0 0]
+     * [0 1 0]
+     * </pre>
+     */
+    protected M2GSVGMatrix()
+    {
+        iComponents = new float[ARRAY_SIZE];
+        iComponents[M00] = iComponents[M11] = 1;
+    }
+
+    /**
+    /**
+     * Construct a matrix with the following components:
+     * <pre>
+     * [aM00 aM01 aM02]
+     * [aM10 aM11 aM12]
+     * </pre>
+     * @param aM00 the x scaling component
+     * @param aM10 the y shearing component
+     * @param aM01 the x shearing component
+     * @param aM11 the y scaling component
+     * @param aM02 the x translation component
+     * @param aM12 the y translation component
+     */
+    protected M2GSVGMatrix(float aM00, float aM10, float aM01,
+                           float aM11, float aM02, float aM12)
+    {
+        iComponents = new float[ARRAY_SIZE];
+        iComponents[M00] = aM00;
+        iComponents[M01] = aM01;
+        iComponents[M02] = aM02;
+        iComponents[M10] = aM10;
+        iComponents[M11] = aM11;
+        iComponents[M12] = aM12;
+    }
+
+    /**
+     * Constructor
+     * Create a new matrix by coping the given one.
+     * @param aMatrix the matrix to copy
+     * @throws NullPointerException if aMatrix is null
+     * @throws DOMException if index sizes are not same
+     */
+    protected M2GSVGMatrix(M2GSVGMatrix aMatrix)
+    {
+        if (aMatrix == null)
+        {
+            throw new NullPointerException();
+        }
+        iComponents = new float[aMatrix.iComponents.length];
+        for (int index = 0; index < iComponents.length; index++)
+        {
+            iComponents[index] = aMatrix.iComponents[index];
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGMatrix#getComponent()
+     */
+    public float getComponent(int index) throws DOMException
+    {
+        if ((index < 0) || (index >= iComponents.length))
+        {
+            throw new DOMException(
+                DOMException.INDEX_SIZE_ERR,
+                /*SF*/"The index is invalid."/*SF*/);
+        }
+        return iComponents[index];
+    }
+
+    /**
+     * Return the matrix of components used in this transform. The resulting
+     * values are:
+     * <pre>
+     * [array[0] array[2] array[4]]
+     * [array[1] array[3] array[5]]
+     * </pre>
+     * @return array that contains the matrix components.
+     */
+    float[] getComponents()
+    {
+        return iComponents;
+    }
+
+    /**
+     * Get the matrix of components used in this transform. The resulting
+     * values are:
+     * <pre>
+     * [aComponents[0] aComponents[2] aComponents[4]]
+     * [aComponents[1] aComponents[3] aComponents[5]]
+     * </pre>
+     * @param aComponents Float array for matrix components
+     */
+    void getComponentsToArray(float[] aComponents)
+    {
+        if (aComponents == null)
+        {
+            return;
+        }
+        for (int index = 0; index < aComponents.length; index++)
+        {
+            aComponents[index] = iComponents[index];
+        }
+    }
+
+    /**
+     * Return the determinant of this transform matrix. If the determinant is
+     * non-zero, the transform is invertible.
+     * The determinant is calculated as:
+     * <pre>
+     * [m00 m01 m02]
+     * [m10 m11 m12] = m00 * m11 - m01 * m10
+     * [ 0   0   1 ]
+     * </pre>
+     * @return the determinant
+     */
+    public float getDeterminant()
+    {
+        return ((iComponents[M00] * iComponents[M11]) -
+                (iComponents[M01] * iComponents[M10]));
+    }
+
+    /**
+    * The inverse is calculated as:
+     * <pre>
+     *     [m00 m01 m02]
+     *  M= [m10 m11 m12]
+     *     [ 0   0   1 ]
+     *
+     *              1                 [ m11/det  -m01/det   (m01*m12-m02*m11)/det]
+     * inverse(M)= --- x adjoint(M) = [-m10/det   m00/det   (m10*m02-m00*m12)/det]
+     *             det                [    0         0               1           ]
+     * </pre>
+     * @see org.w3c.dom.svg.SVGMatrix#inverse()
+     */
+    public SVGMatrix inverse() throws SVGException
+    {
+        // The inversion is useful for undoing transformations.
+        float det = getDeterminant();
+        if (det == 0)
+        {
+            throw new SVGException(
+                SVGException.SVG_MATRIX_NOT_INVERTABLE,
+                /*SF*/"The determinant of this matrix is zero."/*SF*/);
+        }
+        return new M2GSVGMatrix(
+                   iComponents[M11] / det, // iMtx[M00]
+                   (-iComponents[M10]) / det, // iMtx[M10]
+                   (-iComponents[M01]) / det, // iMtx[M01]
+                   iComponents[M00] / det, // iMtx[M11]
+                   ((iComponents[M01] * iComponents[M12]) - (iComponents[M02] * iComponents[M11])) / det, // iMtx[M02]
+                   ((iComponents[M10] * iComponents[M02]) - (iComponents[M00] * iComponents[M12])) / det); // iMtx[M12]
+    }
+
+    /**
+     * The multiply is calculated as:
+     * <pre>
+     *       [a00 a01 a02]   [b00 b01 b02]
+     *  this=[a10 a11 a12] B=[b10 b11 b12]
+     *       [ 0   0   1 ]   [ 0   0   1 ]
+     *
+     *                       [(a00*b00+a01*b10) (a00*b01+a01*b11) (a00*b02+a01*b12+a02)]
+     * [this] = [this]x[B] = [(a10*b00+a11*b10) (a10*b01+a11*b11) (a10*b02+a11*b12+a12)]
+     *                       [       0                   0                     1       ]
+     * </pre>
+     * @see org.w3c.dom.svg.SVGMatrix#mMultiply()
+     */
+    public SVGMatrix mMultiply(SVGMatrix secondMatrix)
+    {
+        if (secondMatrix == null)
+        {
+            throw new NullPointerException();
+        }
+        M2GSVGMatrix b = (M2GSVGMatrix)secondMatrix;
+        float a00 = iComponents[M00]; // a
+        float a10 = iComponents[M10]; // b
+        float a01 = iComponents[M01]; // c
+        float a11 = iComponents[M11]; // d
+        float a02 = iComponents[M02]; // e
+        float a12 = iComponents[M12]; // f
+        iComponents[M00] = (a00 * b.iComponents[M00]) + (a01 * b.iComponents[M10]); // a
+        iComponents[M10] = (a10 * b.iComponents[M00]) + (a11 * b.iComponents[M10]); // b
+        iComponents[M01] = (a00 * b.iComponents[M01]) + (a01 * b.iComponents[M11]); // c
+        iComponents[M11] = (a10 * b.iComponents[M01]) + (a11 * b.iComponents[M11]); // d
+        iComponents[M02] = (a00 * b.iComponents[M02]) + (a01 * b.iComponents[M12]) + a02; // e
+        iComponents[M12] = (a10 * b.iComponents[M02]) + (a11 * b.iComponents[M12]) + a12; // f
+        return this;
+    }
+
+    /**
+     * The rotation is calculated as:
+     * <pre>
+     *          [ cos(angle) -sin(angle) 0 ]
+     * [this] x [ sin(angle)  cos(angle) 0 ]
+     *          [     0           0      1 ]
+     * </pre>
+     * @see org.w3c.dom.svg.SVGMatrix#mRotate()
+     */
+    public SVGMatrix mRotate(float angle)
+    {
+        if (angle % 360 == 0)
+        {
+            return this;
+        }
+        // must convert degrees to radians since java.lang.Math expects radians
+        angle = angle * (float)Math.PI / 180.0f;
+        float c = (float)Math.cos(angle);
+        float s = (float)Math.sin(angle);
+        float m00 = iComponents[M00];
+        float m10 = iComponents[M10];
+        float m01 = iComponents[M01];
+        float m11 = iComponents[M11];
+        iComponents[M00] = m00 * c + m01 * s;
+        iComponents[M10] = m10 * c + m11 * s;
+        iComponents[M01] = m01 * c - m00 * s;
+        iComponents[M11] = m11 * c - m10 * s;
+        return this;
+    }
+
+    /**
+     * The multiply is calculated as:
+     * <pre>
+     *       [m00 m01 m02]   [scaleFactor      0      0]
+     *  this=[m10 m11 m12] B=[    0       scaleFactor 0]
+     *       [ 0   0   1 ]   [    0            0      1]
+     *
+     *                       [(a00*scaleFactor) (a01*scaleFactor) a02]
+     * [this] = [this]x[B] = [(a10*scaleFactor) (a11*scaleFactor) a12]
+     *                       [       0                   0         1 ]
+     * </pre>
+     * @see org.w3c.dom.svg.SVGMatrix#mScale()
+     */
+    public SVGMatrix mScale(float scaleFactor)
+    {
+        if (scaleFactor == 1)
+        {
+            return this;
+        }
+        iComponents[M00] *= scaleFactor;
+        iComponents[M01] *= scaleFactor;
+        iComponents[M10] *= scaleFactor;
+        iComponents[M11] *= scaleFactor;
+        return this;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGMatrix#mTranslate()
+     */
+    public SVGMatrix mTranslate(float x, float y)
+    {
+        if (x == 0 && y == 0)
+        {
+            return this;
+        }
+        iComponents[M02] += (iComponents[M00] * x) + (iComponents[M01] * y);
+        iComponents[M12] += (iComponents[M10] * x) + (iComponents[M11] * y);
+        return this;
+    }
+
+    /**
+     * To string
+     */
+    static String toString(float aComponents[])
+    {
+        if ((aComponents == null) || (M2GSVGMatrix.ARRAY_SIZE != aComponents.length))
+        {
+            return "";
+        }
+        StringBuffer buf = new StringBuffer();
+        buf.append("[00]:").append(aComponents[M00]).append(", [10]:").append(aComponents[M10]);
+        buf.append(", [01]:").append(aComponents[M01]).append(", [11]:").append(aComponents[M11]);
+        buf.append(", [02]:").append(aComponents[M02]).append(", [12]:").append(aComponents[M12]);
+        return buf.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGPath.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+import org.w3c.dom.DOMException;
+import java.io.IOException;
+import com.nokia.mj.impl.utils.Logger;
+
+/**
+ * This interface represents an "SVGPath" datatype used to define the path geometry.
+ * Corresponds to SVG path specification or the "d" attribute.
+ */
+public class M2GSVGPath extends M2GObject implements SVGPath
+{
+    //--------------------------------------------------
+    // STATIC CONTANTS
+    //--------------------------------------------------
+    /* Optimization: static finals changed to local variables
+    private static final String SEGMENT_INDEX_SIZE_ESTR =
+    "The segment index is out of bounds.";
+    private static final String PARAMETER_INDEX_SIZE_ESTR =
+    "The parameter index is out of bounds for this segment's type.";
+    */
+    private static final int CLOSE_PARAMETER_COUNT = 0;
+    private static final int MOVE_TO_PARAMETER_COUNT = 2;
+    private static final int LINE_TO_PARAMETER_COUNT = 2;
+    private static final int CURVE_TO_PARAMETER_COUNT = 6;
+    private static final int QUAD_TO_PARAMETER_COUNT = 4;
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    /**
+     * Constructor
+     * @param aHandle - native path object handle
+     * @param aDoCleanup - true if the native object needed to be deleted
+     */
+    protected M2GSVGPath(int aHandle)
+    {
+        super();
+        setHandle(aHandle);
+        doConstruct();
+    }
+
+    /**
+    * @see com.nokia.microedition.m2g.M2GObject#doCheckValidity()
+     */
+    public boolean doCheckValidity()
+    {
+        // SVGPath is invalid if it begins with any segment other
+        // than MOVE_TO segment. Note that an empty SVGPath is still a valid value.
+        try
+        {
+            if (!super.doCheckValidity() ||
+                    ((getNumberOfSegments() != 0) && (getSegment(0) != MOVE_TO)))
+            {
+                return false;
+            }
+        }
+        catch (IOException e)
+        {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doCleanup()
+     */
+    protected void doCleanup()
+    {
+        _destroyPath(getNativeSVGProxyHandle(),
+            getHandle());
+        resetHandles();
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doConstruct()
+     */
+    protected void doConstruct()
+    {
+        super.doConstruct();
+        register(this);
+    }
+
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#getNumberOfSegments()
+     */
+    public int getNumberOfSegments()
+    {
+        return _getNumberOfSegments(getNativeSVGProxyHandle(),
+                                    getHandle() );
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#getSegment()
+     */
+    public short getSegment(int index) throws DOMException
+    {
+        if ((index < 0) ||
+                (index >= getNumberOfSegments()))
+        {
+            Logger.ELOG(Logger.EJavaUI, "getSegment() - exception:"
+                        + /*SF*/"The segment index is out of bounds."/*SF*/);
+            throw new DOMException(
+                DOMException.INDEX_SIZE_ERR,
+                /*SF*/"The segment index is out of bounds."/*SF*/);
+        }
+        return M2GSVGConstants.parsePathCommand(
+                   _getSegmentType(getNativeSVGProxyHandle(),
+                                   getHandle(),
+                                   index)
+               );
+    }
+
+    /**
+     * Checks that parameter index is valid
+     * @param aCommand -
+     * @param aParameterIndex -
+     */
+    protected void checkParameterIndex(int aCommand, int aParameterIndex) throws DOMException
+    {
+        if ((aCommand == CLOSE && aParameterIndex >= CLOSE_PARAMETER_COUNT) ||
+                (aCommand == MOVE_TO && aParameterIndex >= MOVE_TO_PARAMETER_COUNT)
+                || (aCommand == LINE_TO && aParameterIndex >= LINE_TO_PARAMETER_COUNT)
+                || (aCommand == CURVE_TO && aParameterIndex >= CURVE_TO_PARAMETER_COUNT)
+                || (aCommand == QUAD_TO && aParameterIndex >= QUAD_TO_PARAMETER_COUNT))
+        {
+            throw new DOMException(
+                DOMException.INDEX_SIZE_ERR,
+                /*SF*/"The parameter index is out of bounds for this segment's type."/*SF*/);
+        }
+    }
+
+    /**
+    * @see org.w3c.dom.svg.SVGPath#close()
+     */
+    public void close()
+    {
+        _addClose(getNativeSVGProxyHandle(), getHandle());
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#curveTo()
+     */
+    public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
+    {
+        _addCurveTo(getNativeSVGProxyHandle(),
+            getHandle(), x1, y1, x2, y2, x3, y3);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#getSegmentParam()
+     */
+    public float getSegmentParam(int cmdIndex, int paramIndex)
+    {
+        if ((cmdIndex >= getNumberOfSegments()) ||
+                (cmdIndex < 0) ||
+                (paramIndex < 0))
+        {
+            Logger.ELOG(Logger.EJavaUI, "getSegmentParam() - end, exception:"
+                        + /*SF*/"The segment index is out of bounds."/*SF*/);
+            throw new DOMException(
+                DOMException.INDEX_SIZE_ERR,
+                /*SF*/"The segment index is out of bounds."/*SF*/);
+        }
+        short command = getSegment(cmdIndex);
+        // Checks the validity of the parameter index.
+        checkParameterIndex(command, paramIndex);
+        return _getSegmentParameter(getNativeSVGProxyHandle(),
+                                    getHandle(),
+                                    cmdIndex,
+                                    paramIndex
+                                   );
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#lineTo()
+     */
+    public void lineTo(float x, float y)
+    {
+        _addLineTo(getNativeSVGProxyHandle(), getHandle(), x, y);
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#moveTo()
+     */
+    public void moveTo(float x, float y)
+    {
+        _addMoveTo(getNativeSVGProxyHandle(), getHandle(), x, y );
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#quadTo()
+     */
+    public void quadTo(float x1, float y1, float x2, float y2)
+    {
+        _addQuadTo(getNativeSVGProxyHandle(),
+                   getHandle(),
+                   x1,
+                   y1,
+                   x2,
+                   y2 );
+    }
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private static native void _addClose(
+        int aSVGProxyHandle, int aPathHandle);
+
+    private static native void _addCurveTo(
+        int aSVGProxyHandle, int aPathHandle,
+        float aX1, float aY1, float aX2, float aY2, float aX3, float aY3);
+
+    private static native void _addLineTo(
+        int aSVGProxyHandle, int aPathHandle, float aX, float aY);
+
+    private static native void _addMoveTo(
+        int aSVGProxyHandle, int aPathHandle, float aX, float aY);
+
+    private static native void _addQuadTo(
+        int aSVGProxyHandle, int aPathHandle,
+        float aX1, float aY1, float aX2, float aY2);
+
+    static native int _createPath(
+        int aSVGProxyHandle);
+
+    private static native void _destroyPath(
+        int aSVGProxyHandle, int aPathHandle);
+
+    private static native int _getNumberOfSegments(
+        int aSVGProxyHandle, int aPathHandle);
+
+    private static native float _getSegmentParameter(
+        int aSVGProxyHandle, int aPathHandle, int aCmdIndex, int aParamIndex);
+
+    private static native short _getSegmentType(
+        int aSVGProxyHandle, int aPathHandle, int aIndex);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGPoint.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+
+/**
+ * This interface represents an "SVGPoint" datatype,
+ * identified by its x and y components.
+ */
+public class M2GSVGPoint implements SVGPoint
+{
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GSVGSVGElement iElement;
+    private float iX;
+    private float iY;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+    * Constructor
+    * @param aRootElement
+     */
+    protected M2GSVGPoint(M2GSVGSVGElement aElement)
+    {
+        iElement = aElement;
+        iX = 0;
+        iY = 0;
+    }
+
+    /**
+     * Check set validity
+     * @param aValue Value
+     * @return true if setting can be done
+     */
+    protected boolean check(float aValue)
+    {
+        if (Float.isNaN(aValue))
+        {
+            // throw IllegalArgumentException();
+            return false;
+        }
+        if (iElement != null)
+        {
+            String zoomAndPan = iElement.getTrait("zoomAndPan");
+            if ((zoomAndPan != null) && zoomAndPan.equals("disable"))
+            {
+                return false;
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#getX()
+     */
+    public float getX()
+    {
+        synchronized (this)
+        {
+            return iX;
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#getX()
+     */
+    public float getY()
+    {
+        synchronized (this)
+        {
+            return iY;
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#setX()
+     */
+    public void setX(float value)
+    {
+        synchronized (this)
+        {
+            if (check(value))
+            {
+                iX = value;
+                if (iElement != null)
+                {
+                    iElement.updateTransformMatrix();
+                }
+            }
+        }
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGPath#setY()
+     */
+    public void setY(float value)
+    {
+        synchronized (this)
+        {
+            if (check(value))
+            {
+                iY = value;
+                if (iElement != null)
+                {
+                    iElement.updateTransformMatrix();
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGRGBColor.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+
+public class M2GSVGRGBColor implements SVGRGBColor
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    private static final int R = 0;
+    private static final int G = 1;
+    private static final int B = 2;
+    // Exception text
+    private static final String OUT_OF_RANGE_ESTR =
+        "Color values out of range.";
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private int[] iComponents;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    /**
+     * Constructor. Defualt color is black.
+    v    */
+    public M2GSVGRGBColor()
+    {
+        iComponents = new int[3];
+        iComponents[R] = 0;
+        iComponents[G] = 0;
+        iComponents[B] = 0;
+    }
+
+    /**
+     * Constructor
+     * @param aR -
+    v    * @param aG -
+    v    * @param aB -
+    v    */
+    public M2GSVGRGBColor(int aR, int aG, int aB) throws SVGException
+    {
+        checkValues(aR, aG, aB);
+        iComponents = new int[3];
+        iComponents[R] = aR;
+        iComponents[G] = aG;
+        iComponents[B] = aB;
+    }
+
+    /**
+     * Checks value range
+     * @param aR
+     * @param aG
+     * @param aB
+     */
+    protected void checkValues(int aR, int aG, int aB) throws SVGException
+    {
+        if (((aR > 255) || (aR < 0)) ||
+                ((aG > 255) || (aG < 0)) ||
+                ((aB > 255) || (aB < 0)))
+        {
+            throw new SVGException(
+                SVGException.SVG_INVALID_VALUE_ERR, OUT_OF_RANGE_ESTR);
+        }
+    }
+
+    /**
+     * Gets components
+     * @return components
+     */
+    int[] getComponents()
+    {
+        return iComponents;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRGBColor#getRed()
+     */
+    public int getRed()
+    {
+        return iComponents[R];
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRGBColor#getGreen()
+     */
+    public int getGreen()
+    {
+        return iComponents[G];
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRGBColor#getBlue()
+     */
+    public int getBlue()
+    {
+        return iComponents[B];
+    }
+
+    public String toString()
+    {
+        return "SVGRGBColor( r = " + iComponents[R] + ", g = " +
+               iComponents[G] + ", b = " + iComponents[B] + " )";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGRect.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.svg.*;
+
+/**
+ * This interface represents an "SVGRect" datatype, consisting of a minimum X, minimum Y, width
+ * and height values.
+ */
+public class M2GSVGRect implements SVGRect
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    private static final int X = 0;
+    private static final int Y = 1;
+    private static final int W = 2;
+    private static final int H = 3;
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private float[] iComponents;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Contructor
+     */
+    protected M2GSVGRect()
+    {
+        iComponents = new float[4];
+        iComponents[X] = 0;
+        iComponents[Y] = 0;
+        iComponents[W] = 0;
+        iComponents[H] = 0;
+    }
+
+    /**
+     * Contructor
+     * @param aX -
+     * @param aY -
+     * @param aWidth -
+     * @param aHeight -
+     */
+    protected M2GSVGRect(float aX, float aY, float aWidth, float aHeight)
+    {
+        iComponents = new float[4];
+        iComponents[X] = aX;
+        iComponents[Y] = aY;
+        iComponents[W] = aWidth;
+        iComponents[H] = aHeight;
+    }
+
+    /**
+     * Returns reference to a components
+     * @return components
+     */
+    float[] getComponents()
+    {
+        return iComponents;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#getX()
+     */
+    public float getX()
+    {
+        return iComponents[X];
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#getY()
+     */
+    public float getY()
+    {
+        return iComponents[Y];
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#getWidth()
+     */
+    public float getWidth()
+    {
+        return iComponents[W];
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#getHeight()
+     */
+    public float getHeight()
+    {
+        return iComponents[H];
+    }
+
+    /**
+     * Checks if all components are zero
+     * @returns true is every component is zero
+     */
+    public boolean isZero()
+    {
+        for (int index = 0; index < iComponents.length; index++)
+        {
+            if (iComponents[index] != 0)
+            {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#setX()
+     */
+    public void setX(float value)
+    {
+        iComponents[X] = value;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#setY()
+     */
+    public void setY(float value)
+    {
+        iComponents[Y] = value;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#setWidth()
+     */
+    public void setWidth(float value)
+    {
+        iComponents[W] = value;
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGRect#setHeight()
+     */
+    public void setHeight(float value)
+    {
+        iComponents[H] = value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGSVGElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,406 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import org.w3c.dom.*;
+import org.w3c.dom.svg.*;
+import java.io.IOException;
+import com.nokia.mj.impl.utils.Logger;
+
+public class M2GSVGSVGElement extends M2GSVGLocatableElement implements SVGSVGElement
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    /* Optimization: static finals changed to local variables
+    public static final String INVALID_SVG_VERSION_ESTR =
+      "Invalid version.";
+    public static final String INVALID_SVG_BASE_PROFILE_ESTR =
+      "Invalid base profile.";
+    */
+
+    //------------------------------------------------------------------
+    // VARIABLES
+    //------------------------------------------------------------------
+    // Exception text
+    public static final String SCALE_BY_ZERO =
+        "Cannot scale by 0.";
+
+    //------------------------------------------------------------------
+    // VARIABLES
+    //------------------------------------------------------------------
+    private Object iTimeGuard;
+    private M2GSVGMatrix iMatrix;
+    private M2GSVGPoint iCurrentTranslatePoint;
+    private float iCurrentRotate;
+    private float iCurrentScale;
+    private float iCurrentTimeInSeconds;
+
+    //------------------------------------------------------------------
+    // METHODS
+    //------------------------------------------------------------------
+    /**
+     * Constructor
+     * @param aHandle -
+     * @param aDocument -
+     */
+    protected M2GSVGSVGElement(int aHandle, M2GDocument aDocument)
+    {
+        super(aHandle, aDocument);
+        iTimeGuard = new Object();
+        iMatrix = (M2GSVGMatrix)createSVGMatrixComponents(1f, 0f, 0f, 1f, 0f, 0f);
+        iCurrentTranslatePoint = new M2GSVGPoint(this);
+        iCurrentRotate = 0.0f;
+        iCurrentScale = 1.0f;
+        iCurrentTimeInSeconds = 0.0f;
+        refreshMatrix();
+    }
+
+    /**
+     * @see org.w3c.dom.svg.SVGSVGElement#createSVGMatrixComponents()
+     */
+    public SVGMatrix createSVGMatrixComponents(
+        float a, float b, float c, float d, float e, float f)
+    {
+        return new M2GSVGMatrix(a, b, c, d, e, f);
+    }
+
+    /**
+       * @see org.w3c.dom.svg.SVGSVGElement#createSVGMatrixComponents()
+     */
+    public SVGPath createSVGPath()
+    {
+        return new M2GSVGPath(
+                   M2GSVGPath._createPath(getNativeSVGProxyHandle()));
+    }
+
+    /**
+       * @see org.w3c.dom.svg.SVGSVGElement#createSVGRect()
+     */
+    public SVGRect createSVGRect()
+    {
+        return new M2GSVGRect();
+    }
+
+    /**
+       * @see org.w3c.dom.svg.SVGSVGElement#SVGRGBColor()
+     */
+    public SVGRGBColor createSVGRGBColor(int red, int green, int blue)
+    {
+        return new M2GSVGRGBColor(red, green, blue);
+    }
+
+    /**
+       * @see com.nokia.microedition.m2g.M2GObject#doCleanup()
+     */
+    protected void doCleanup()
+    {
+        // Note this method is not automatically called if
+        // doConstruct() method is not first called
+        super.doCleanup();
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#getCurrentRotate()
+     */
+    public float getCurrentRotate()
+    {
+        synchronized (this)
+        {
+            return iCurrentRotate;
+        }
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#getCurrentScale()
+     */
+    public float getCurrentScale()
+    {
+        synchronized (this)
+        {
+            return iCurrentScale;
+        }
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#getCurrentTime()
+     */
+    public float getCurrentTime()
+    {
+        synchronized (iTimeGuard)
+        {
+            return iCurrentTimeInSeconds;
+        }
+    }
+
+    /**
+       * @see com.nokia.microedition.m2g.M2GObject#getCurrentTranslate()
+     */
+    public SVGPoint getCurrentTranslate()
+    {
+        return iCurrentTranslatePoint;
+    }
+
+    /**
+     * @org.w3c.dom.Node#getParentNode()
+    */
+    public Node getParentNode()
+    {
+        // Optimization: if(!getDocument().getConnectionPolicy().getAccessRight())
+        if (!iDocument.iConnectionRight)
+        {
+            Logger.ELOG(Logger.EJavaUI, "getParentNode() - access rights failure");
+            throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+        }
+        return null;
+    }
+
+    /**
+     * Check svg version and base profile
+     * @throws IOException If version or profile is invalid
+    */
+    public void checkVersionAndProfile() throws IOException
+    {
+        // Check version
+        String trait = _getStringTrait(
+                           getNativeSVGProxyHandle(),
+                           getHandle(),
+                           M2GSVGConstants.AT_VERSION);
+        if (trait != null && (!trait.equals(
+                                  M2GSVGConstants.getInstance().iSvgBaseProfileVersion)))
+        {
+            Logger.ELOG(Logger.EJavaUI, "doCheckValidity() - excption: svg version");
+            throw new IOException(/*SF*/"Invalid version."/*SF*/);
+        }
+        // Check profile
+        trait = _getStringTrait(
+                    getNativeSVGProxyHandle(),
+                    getHandle(),
+                    M2GSVGConstants.AT_BASEPROFILE);
+        if (trait != null && (!trait.equals(
+                                  M2GSVGConstants.getInstance().iSvgBaseProfileName)))
+        {
+            Logger.ELOG(Logger.EJavaUI, "doCheckValidity() - excption: svg base profile");
+            throw new IOException(/*SF*/"Invalid base profile."/*SF*/);
+        }
+    }
+
+    /**
+     * @javax.microedition.m2g.SVGImage#incrementTime()
+     */
+    public void incrementTime(float seconds)
+    {
+        incrementTimeNoUpdate(seconds);
+        // update the media time to SVG engine
+        updateTime();
+    }
+
+    /**
+     * Increments the animation or media timeline for this SVGImage (in seconds)
+     * but it does not update it to the SVG engine
+     *
+     * @note the time is updated to the engine during M2GScalableGraphics.RenderFrame()
+     * @param seconds the value of time to increment in seconds
+     *
+     * @since S60 3.1
+     */
+    public void incrementTimeNoUpdate(float seconds)
+    {
+        if (seconds < 0)
+        {
+            throw new IllegalArgumentException();
+        }
+
+        if (Float.isNaN(iCurrentTimeInSeconds + seconds))
+        {
+            throw new IllegalArgumentException();
+        }
+
+        synchronized (iTimeGuard)
+        {
+            iCurrentTimeInSeconds += seconds;
+        }
+    }
+
+    /**
+     * Sets matrix trait
+     */
+    protected void refreshMatrix()
+    {
+        float matrixComponents[] = new float[M2GSVGMatrix.ARRAY_SIZE];
+
+        synchronized (this)
+        {
+            iMatrix.getComponentsToArray(matrixComponents);
+        }
+
+        M2GSVGElement._setMatrixTrait(
+             getNativeSVGProxyHandle(), getHandle(),
+            M2GSVGConstants.AT_TRANSFORM, matrixComponents);
+
+        // inform observer about changes in DOM
+        iDocument.notifyDOMChangeObserver();
+    }
+
+    /**
+     * Updates the time to engine
+     */
+    private void updateTime()
+    {
+        float currentTimeInSeconds = 0.0f;
+
+        synchronized (iTimeGuard)
+        {
+            currentTimeInSeconds = iCurrentTimeInSeconds;
+        }
+
+        _setMediaTime(getNativeSVGProxyHandle(),
+                      getDocument().getHandle(), currentTimeInSeconds);
+
+        // inform observer about changes in DOM
+        iDocument.notifyDOMChangeObserver();
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#setCurrentRotate()
+     */
+    public void setCurrentRotate(float value)
+    {
+        String zoomAndPan = getTrait("zoomAndPan");
+        if ((zoomAndPan != null) && zoomAndPan.equals("disable"))
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "setCurrentRotate() - zoomAndPan:" + zoomAndPan + ", fail");
+            return;
+        }
+        synchronized (this)
+        {
+            iCurrentRotate = value;
+            updateTransformMatrix();
+        }
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#setCurrentScale()
+     */
+    public void setCurrentScale(float value)
+    {
+        String zoomAndPan = getTrait("zoomAndPan");
+        if ((zoomAndPan != null) && zoomAndPan.equals("disable"))
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "setCurrentScale() - zoomAndPan:" + zoomAndPan + ", fail");
+            return;
+        }
+        if (value == 0)
+        {
+            throw new DOMException(DOMException.INVALID_ACCESS_ERR, SCALE_BY_ZERO);
+        }
+        synchronized (this)
+        {
+            iCurrentScale = value;
+            updateTransformMatrix();
+        }
+    }
+
+    /**
+       * @see org.w3c.dom.svg.SVGSVGElement#setCurrentTime()
+       * @note no support for setting the time backwards except for setting it to zero
+       * @note engine resets the animation if current time is zero
+     */
+    public void setCurrentTime(float newSeconds)
+    {
+        synchronized (iTimeGuard)
+        {
+            if (newSeconds <= iCurrentTimeInSeconds && newSeconds != 0)
+            {
+                // only forward time or zero time is accepted
+                return;
+            }
+
+            iCurrentTimeInSeconds = newSeconds;
+        }
+
+        updateTime();
+    }
+
+    /**
+     * <pre>
+     *  [currentScale      0       currentTranslate.x]   [cos(currentRotate) -sin(currentRotate 0]
+     *  [     0      currentScale  currentTranslate.y] x [sin(currentRotate) cos(currentRotate) 0]
+     *  [     0            0               1         ]   [         0                  0         1]
+     * </pre>
+     */
+    public void updateTransformMatrix()
+    {
+        synchronized (this)
+        {
+            M2GSVGMatrix a = new M2GSVGMatrix(
+                iCurrentScale, 0f, 0f, iCurrentScale,
+                iCurrentTranslatePoint.getX(), iCurrentTranslatePoint.getY());
+            M2GSVGMatrix b = new M2GSVGMatrix(
+                (float)Math.cos(iCurrentRotate *(float)Math.PI / 180.0f),
+                (float)Math.sin(iCurrentRotate *(float)Math.PI / 180.0f),
+                -(float)Math.sin(iCurrentRotate *(float)Math.PI / 180.0f),
+                (float)Math.cos(iCurrentRotate *(float)Math.PI / 180.0f),
+                0f, 0f);
+            iMatrix = (M2GSVGMatrix)(a.mMultiply(b));
+            refreshMatrix();
+        }
+    }
+
+    //------------------------------------------------------------------
+    // STATIC METHODS
+    //------------------------------------------------------------------
+    /**
+     * Builds root element according to a document
+     * @param aDocument
+     * @return root element
+     */
+    public static M2GSVGSVGElement buildRootElement(M2GDocument aDocument)
+    {
+        // Get native handle
+        int elementHandle = M2GSVGElement._getRootElement(
+                                aDocument.getNativeSVGProxyHandle(),
+                                aDocument.getHandle());
+        // Check native handle
+        if (!M2GObject.checkHandle(elementHandle))
+        {
+            return null;
+        }
+        // Create object
+        M2GSVGSVGElement rootElement =
+            new M2GSVGSVGElement(elementHandle, aDocument);
+        if (rootElement != null)
+        {
+            // Register element
+            aDocument.registerLiveElement(rootElement, new Integer(elementHandle));
+        }
+        return rootElement;
+    }
+
+    //------------------------------------------------------------------
+    // NATIVE METHODS
+    //------------------------------------------------------------------
+    protected native static float _getMediaTime(
+         int aSvgProxyHandle, int aDocumentHandle);
+    private native static void _setMediaTime(
+        int aSvgProxyHandle, int aDocumentHandle,
+        float aSeconds );
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GSVGeSWTAnimator.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,261 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import javax.microedition.m2g.*;
+import org.eclipse.swt.widgets.SVGAnimatorControl;
+import com.nokia.mj.impl.rt.support.Finalizer;
+import com.nokia.mj.impl.utils.Logger;
+
+public class M2GSVGeSWTAnimator extends SVGAnimator
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    private static final String ANIMATOR_CONTROL_BASE_CLASS =
+        "org.eclipse.swt.widgets.Canvas";
+
+    // Exception text
+    /* Optimization: static finals changed to local variables
+    private static final String COMPONENT_BASE_CLASS_NOT_SUPPORTED_ESTR =
+    "The requested componentBaseClass is not supported by the implementation.";
+    private static final String ILLEGAL_TIME_INCREMENT_ESTR =
+    "The timeIncrement is less than or equal to zero.";
+    private static final String ANIMATOR_PLAY_ESTR =
+    "The animator is not currently in the stopped or paused state.";
+    private static final String ANIMATOR_PAUSE_ESTR =
+    "The animator is not in the playing  state.";
+    private static final String ANIMATOR_STOP_ESTR =
+    "The animator is not in the playing or paused state.";
+    private static final String INVALID_RUNNABLE_ESTR =
+    "The runnable is null.";
+    private static final String ANIMATOR_IS_STOPPED_ESTR =
+    "The animator is in the stopped state.";
+    private static final String RUNNABLE_IS_NULL_ESTR =
+    "The runnable is null.";
+    private static final String ANIMATOR_INVOKE_ESTR =
+    "The animator is in the stopped state.";
+    */
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private SVGAnimatorControl iAnimatorControl;
+
+    private Finalizer mFinalizer = new Finalizer()
+    {
+        public void finalizeImpl()
+        {
+            doFinalize();
+        }
+    };
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     * @param aImage
+     */
+    protected M2GSVGeSWTAnimator(SVGImage aImage)
+    {
+        iAnimatorControl = new SVGAnimatorControl(/*false,*/ aImage);
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#getTargetComponent()
+     */
+    public Object getTargetComponent()
+    {
+        return iAnimatorControl;
+    }
+
+    /**
+    * @see javax.microedition.m2g.SVGAnimator#getTimeIncrement()
+    */
+    public float getTimeIncrement()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "getTimeIncrement() " + iAnimatorControl.getTimeIncrement());
+        return iAnimatorControl.getTimeIncrement();
+    }
+
+    /**
+    * @see javax.microedition.m2g.SVGAnimator#invokeAndWait()
+    */
+    public void invokeAndWait(java.lang.Runnable runnable)
+    {
+        if (runnable == null)
+        {
+            throw new NullPointerException(
+                /*SF*/"The runnable is null."/*SF*/);
+        }
+        if (iAnimatorControl.isStopped())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is in the stopped state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "invokeAndWait()");
+
+        runnable.run();
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#invokeLater()
+     */
+    public void invokeLater(java.lang.Runnable runnable)
+    {
+        if (runnable == null)
+        {
+            throw new NullPointerException(
+                /*SF*/"The runnable is null."/*SF*/);
+        }
+        if (iAnimatorControl.isStopped())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is in the stopped state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "invokeLater()");
+        Thread thread = new Thread(runnable);
+        thread.start();
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#pause()
+     */
+    public void pause()
+    {
+        if (!iAnimatorControl.isPlaying())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is not in the playing or paused state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "pause()");
+        iAnimatorControl.pause();
+    }
+
+    /**
+    * @see javax.microedition.m2g.SVGAnimator#play()
+    */
+    public void play()
+    {
+        if (iAnimatorControl.isPlaying())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is not currently in the stopped or paused state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "play()");
+        iAnimatorControl.play();
+    }
+
+    private void doFinalize()
+    {
+        if (mFinalizer != null)
+        {
+            registeredFinalize();
+            mFinalizer = null;
+        }
+    }
+
+    /**
+     * Finalize
+     */
+    synchronized void registeredFinalize()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "registeredFinalize()");
+        iAnimatorControl = null;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setSVGEventListener()
+     */
+    public void setSVGEventListener(SVGEventListener svgEventListener)
+    {
+        iAnimatorControl.setEventListener(svgEventListener);
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setTimeIncrement()
+     */
+    public void setTimeIncrement(float timeIncrement)
+    {
+        if (timeIncrement <= 0)
+        {
+            throw new IllegalArgumentException(
+                /*SF*/"The time increment is less than or equal to zero."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "setTimeIncrement() - " + timeIncrement);
+        iAnimatorControl.setTimeIncrement(timeIncrement);
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#stop()
+     */
+    public void stop()
+    {
+        if (iAnimatorControl.isStopped())
+        {
+            throw new IllegalStateException(
+                /*SF*/"The animator is not in the playing or paused state."/*SF*/);
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo, "stop()");
+        iAnimatorControl.stop();
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+    /**
+     * Builds animator
+     * @param svgImage -
+     * @return SVGAnimator
+     * @see javax.microedition.m2g.SVGAnimator#createAnimator()
+     */
+    public static SVGAnimator buildAnimator(SVGImage svgImage)
+    {
+        if (svgImage == null)
+        {
+            throw new NullPointerException();
+        }
+        return new M2GSVGeSWTAnimator(svgImage);
+    }
+
+    /**
+     * Builds animator
+     * @param svgImage -
+     * @param componentBaseClass -
+     * @return SVGAnimator
+     * @see javax.microedition.m2g.SVGAnimator#createAnimator()
+     */
+    public static SVGAnimator buildAnimator(
+        SVGImage svgImage, String componentBaseClass)
+    {
+        if (svgImage == null)
+        {
+            throw new NullPointerException();
+        }
+        if ((componentBaseClass != null) &&
+                (!componentBaseClass.equals(ANIMATOR_CONTROL_BASE_CLASS)))
+        {
+            throw new IllegalArgumentException(
+                /*SF*/"The requested componentBaseClass is not supported by the implementation."/*SF*/);
+        }
+
+        return buildAnimator(svgImage);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/M2GScalableGraphics.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,476 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g;
+
+import com.nokia.microedition.m2g.M2GRunnableQt;
+import javax.microedition.m2g.*;
+import javax.microedition.m2g.ScalableGraphics;
+import javax.microedition.lcdui.Graphics;
+import java.lang.StringBuffer;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.nokialcdui.LCDUIInvoker;
+import org.eclipse.swt.internal.qt.GCData;
+import org.eclipse.swt.internal.qt.graphics.GraphicsContext;
+import org.eclipse.swt.internal.extension.GraphicsUtil; 
+
+/*
+ * ScalableGraphics
+ */
+public class M2GScalableGraphics
+        extends M2GObject
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    // Exception text
+    /* Optimization: static finals changed to local variables
+    private static final String ALPHA_OUT_OF_RANGE_ESTR =
+        "The alpha is out of range";
+    private static final String INVALID_TARGET_ESTR =
+        "The target is invalid";
+    private static final String MODE_INVALID_ESTR =
+        "The mode is invalid";
+    private static final String NULL_IMAGE_ESTR =
+        "The image is null";
+    private static final String NULL_TARGET_ESTR =
+        "The target is null";
+    private static final String TARGET_ALREADY_BOUND_ESTR =
+        "Target is already bound";
+    private static final String TARGET_NOT_BOUND_ESTR =
+        "Target is not bound";
+    */
+    // Transparency alpha max and min limits
+    private static final float MAX_TRANSPARENCY_ALPHA = 1.0f;
+    private static final float MIN_TRANSPARENCY_ALPHA = 0.0f;
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private GC        iTargetGC      = null;
+    private int iUseNativeClear = 0;
+    private Graphics iTargetGraphics;
+    private Rectangle iSurfaceRectangle;
+    private Rectangle iFinalESWTSurfaceRectangle;
+    
+     int iSurfaceHandle;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Constructor
+     */
+    public M2GScalableGraphics()
+    {
+        super();
+        
+        doConstruct();
+    }
+    /**
+     * @see javax.microedition.m2g.ScalableGraphics#bindTarget()
+     */
+    public synchronized void bindTarget(Object target)
+    {
+    	
+    	if (target == null )
+    	{
+    		throw new NullPointerException(/*SF*/"The target is null"/*SF*/);
+    	}
+    	
+    	if (target instanceof org.eclipse.swt.graphics.GC)
+        	{
+    		
+			final GC finalGc = (GC)target;
+
+        	// Execute in UI thread     
+        	Platform.executeInUIThread(
+                new M2GRunnableQt() {
+                    public void doRun() {
+                    	iFinalESWTSurfaceRectangle = GraphicsUtil.startExternalRendering(finalGc);
+                    	
+                    	// Get GCData from GC
+                    	/*TODO check for this cahnge GCData gcData = ((org.eclipse.swt.graphics.GC)finalGc).getGCData();    
+                    	// Get internalGC (Graphicscontext), WindowSurface and the WindowSurface handle for native access
+                        iSurfaceHandle = gcData.internalGc.getWindowSurface().getHandle();*/
+                    	iSurfaceHandle = GraphicsUtil.getWindowSurface(finalGc).getHandle();
+                        
+                        _bind(getHandle(), iSurfaceHandle);
+                        
+                      }
+                      });
+                    //  currentTarget = target;
+        		iTargetGC = (GC)finalGc;
+		    // Handling for LCDUI Graphics
+		    //
+		    }
+//Change accordingly to M3G not as site content.		    
+		    else if (target instanceof javax.microedition.lcdui.Graphics)
+		    {
+		    	Graphics g = (Graphics)target;
+		    	final Graphics finalG = g;
+		    	iSurfaceRectangle = LCDUIInvoker.startExternalRendering( finalG );
+		    	 // Execute in UI thread     
+			        Platform.executeInUIThread(
+			                new M2GRunnableQt() {
+			                    public void doRun() {
+														
+			                    	  
+			                    	
+                        		iSurfaceHandle = LCDUIInvoker.getWindowSurface(finalG).getHandle();
+                        		
+                        		// Flush Canvas
+								            //M2GManager.flushDisplayBuffer();
+		                        _bind(getHandle(), iSurfaceHandle);
+		                        
+
+			                    }
+			                  });
+			                  
+			                  iTargetGraphics  = (Graphics)finalG;
+		    	}
+			         
+	         else {
+			        throw new IllegalArgumentException();
+			    }
+    	
+    	//TODO Check for : when to give this exception java.lang.IllegalStateException - if target is already bound.
+    
+  }
+    	
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doConstruct()
+     */
+    public void doConstruct()
+    {
+      super.doConstruct();
+      
+    	 // Execute in UI thread     
+	    Platform.executeInUIThread(
+            new M2GRunnableQt() {
+                public void doRun() {
+										        setHandle(_createRenderContext(
+										                      getNativeSVGProxyHandle() ));
+										        // Add object to the live objects container
+										      }
+										    });
+        register(this);
+    }
+
+    /**
+     * @see com.nokia.microedition.m2g.M2GObject#doCleanup()
+     */
+    public synchronized void doCleanup()
+    {
+    	
+ 		    	 // Execute in UI thread     
+			        Platform.executeInUIThread(
+			                new M2GRunnableQt() {
+			                    public void doRun() {  	
+																			        _deleteRenderContext(
+																			            getHandle() );
+																			          }
+																			       }
+																			    );      
+        resetHandles();
+        iTargetGC = null;
+        iTargetGraphics = null;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableGraphics#releaseTarget()
+     */
+    public synchronized void releaseTarget()
+    {
+    	
+      if (iTargetGC != null)
+      {
+      
+			Platform.executeInUIThread(
+            new M2GRunnableQt() {
+             public void doRun() {
+            	 						   GraphicsUtil.endExternalRendering(iTargetGC);
+            	      				      _release(iSurfaceHandle, getHandle());
+            	      				    }
+            	      				  });
+            iTargetGC = null;
+        }
+			else if (iTargetGraphics != null )
+		    {
+				
+				
+				final Graphics finalG = iTargetGraphics;
+				Platform.executeInUIThread(
+	            new M2GRunnableQt() {
+	             public void doRun() {
+	            			_release(iSurfaceHandle, getHandle());
+	            		}
+	            	});
+				LCDUIInvoker.endExternalRendering( iTargetGraphics );
+				
+        iTargetGraphics = null;
+        }
+      else 
+      	{
+  			
+  		   // check for invalid Graphics TODO this exception is getting trough when we trying to bind.s
+            throw new IllegalStateException(/*SF*/"Target is not bound"/*SF*/);
+      	}
+
+    }
+    public synchronized void render(
+        int x, int y, ScalableImage image, boolean aUseNativeClear)
+    {
+				
+
+        iUseNativeClear = aUseNativeClear ? 1 : 0;
+        render(x, y, image);
+        iUseNativeClear = 0;
+        
+        
+        
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableGraphics#render()
+     */
+    public synchronized void render(int x, int y, ScalableImage image)
+    {
+    		
+        if (image == null)
+        {
+            Logger.ELOG(Logger.EJavaUI, "render() - exception: "
+                        + /*SF*/"The target is null"/*SF*/);
+            throw new NullPointerException(/*SF*/"The target is null"/*SF*/);
+        }
+       if (iTargetGC != null)
+        {
+            final M2GDocument finalDoc = (M2GDocument)((SVGImage)image).getDocument();
+            // Get synchronized svg image data
+            final int finalSvgW  = image.getViewportWidth();
+            final int finalSvgH = image.getViewportHeight();
+            if ((finalSvgW == 0) || (finalSvgW == 0))
+            {
+                return;
+            }
+            // Calculate clip dimensions TODO check the new clipping rect provided from StartExternalRendering API.s
+            //Rectangle clipRect = iTargetGC.getClipping();
+            Rectangle clipRect = iFinalESWTSurfaceRectangle;
+            
+            final int finalClipX = clipRect.x;
+            final int finalClipY = clipRect.y;
+            final int finalClipW = clipRect.width;
+            final int finalClipH = clipRect.height;
+            
+            
+            // if none of the svg image is visible due to clipping then don't
+            // bother to call render
+            if ((x >= (finalClipX + finalClipW)) || (y >= (finalClipY + finalClipH)))
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "render() - svg image isn't visible due to clipping");
+                return;
+            }
+            if (((x + finalSvgW) < finalClipX) || ((y + finalSvgW) < finalClipY))
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "render() - svg image isn't visible due to clipping");
+                return;
+            }
+            
+
+						final int finalX = x;            
+						final int finalY = y; 
+						         
+        		    	 // Execute in UI thread   
+	        Platform.executeInUIThread(
+	                new M2GRunnableQt() {
+	                    public void doRun() {         
+	                    	
+	                    								
+	                    									
+																			final int[] finalData = _renderESWT(getHandle(),
+											                                     finalDoc.getHandle(), finalX, finalY,
+											                                     finalClipX, finalClipY, finalClipW, finalClipH, finalSvgW, finalSvgW,
+											                                     finalDoc.getRootElement().getCurrentTime(),
+											                                     iUseNativeClear);
+																									                                     
+																				int[] bitmapHandles;
+														            bitmapHandles = new int[4];
+														            for (int i = 0; i < 4; i++)
+														            {
+														                bitmapHandles[i] = finalData[i];
+														            }
+														            int[] renderData;
+														            renderData = new int[6];
+														            for (int i = 0; i < 6; i++)
+														            {
+														                renderData[i] = finalData[i+4];
+														            }
+														            //iTargetGC.internal_drawM2GImage(bitmapHandles, renderData, iUseNativeClear);
+
+																					}});											                                     
+            
+        }//if(true)
+		else if (iTargetGraphics != null)
+		    {
+		    	
+   	    		
+            final M2GDocument finalDoc = (M2GDocument)((SVGImage)image).getDocument();
+            // Get synchronized svg image data
+            final int finalSvgW  = image.getViewportWidth();
+            final int finalSvgH = image.getViewportHeight();
+            if ((finalSvgW == 0) || (finalSvgH == 0))
+            {	
+            	
+                return;
+            }
+            
+            
+            //TODO as we are using Surface rectangle provided by StartExternalRendering as Clip Rectangle.
+            final int finalClipX = iSurfaceRectangle.x;
+            final int finalClipY = iSurfaceRectangle.y;
+            final int finalClipW  = iSurfaceRectangle.width;
+            final int finalClipH = iSurfaceRectangle.height;
+
+            // Calculate clip dimensions
+            /*final int finalClipX = iTargetGraphics.getClipX() + iTargetGraphics.getTranslateX();
+            final int finalClipY = iTargetGraphics.getClipY() + iTargetGraphics.getTranslateY();
+            final int finalClipW  = iTargetGraphics.getClipWidth();
+            final int finalClipH = iTargetGraphics.getClipHeight();*/
+            // if none of the svg image is visible due to clipping then don't
+            // bother to call render
+            if ((x >= (finalClipX + finalClipW)) || (y >= (finalClipY + finalClipH)))
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "render() - svg image isn't visible due to clipping");
+                return;
+            }
+            if (((x + finalSvgW) < finalClipX) || ((y + finalSvgH) < finalClipY))
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "render() - svg image isn't visible due to clipping");
+                return;
+            }
+            
+				final int finalX = x;            
+				final int finalY = y;
+				
+				
+
+      		    	 // Execute in UI thread     
+        Platform.executeInUIThread(
+                new M2GRunnableQt() {
+                    public void doRun() {
+								            _renderLCDUI(getHandle(), finalDoc.getHandle(), finalX, finalY,
+								                         finalClipX, finalClipY, finalClipW, finalClipH, finalSvgW, finalSvgH,
+								                         finalDoc.getRootElement().getCurrentTime());
+								                       }});
+								                       
+				
+        }
+
+       else 
+        	{
+                Logger.ELOG(Logger.EJavaUI, "render() - exception: "
+                + /*SF*/"Target is not bound"/*SF*/);//TODO for time being commented.s
+                throw new IllegalStateException(/*SF*/"Target is not bound"/*SF*/);
+        	}
+        	
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableGraphics#setRenderingQuality(int)
+     */
+    public synchronized void setRenderingQuality(int mode)
+    {
+        if ((mode == ScalableGraphics.RENDERING_QUALITY_LOW) ||
+                (mode == ScalableGraphics.RENDERING_QUALITY_HIGH))
+        {
+        	final int finalMode = mode;
+        			    	 // Execute in UI thread     
+			        Platform.executeInUIThread(
+			                new M2GRunnableQt() {
+			                    public void doRun() {
+											            _setRenderingQuality(getHandle(), finalMode);
+											          }
+											        });
+        }
+        else
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setRenderingQuality() - exception: " + /*SF*/"The mode is invalid"/*SF*/);
+            throw new IllegalArgumentException(/*SF*/"The mode is invalid"/*SF*/);
+        }
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableGraphics#setTransparency(float)
+     */
+    public synchronized void setTransparency(float alpha)
+    {
+        if (alpha >= MIN_TRANSPARENCY_ALPHA && alpha <= MAX_TRANSPARENCY_ALPHA)
+        {
+        	final float finalAlpha = alpha;
+        			    	 // Execute in UI thread     
+			        Platform.executeInUIThread(
+			                new M2GRunnableQt() {
+			                    public void doRun() {
+            															_setTransparency(getHandle(), finalAlpha);
+            														}
+            													}
+            													);
+        }
+        else
+        {
+            Logger.ELOG(Logger.EJavaUI,
+                        "setTransparency() - exception: " + /*SF*/"The alpha is out of range"/*SF*/);
+            throw new IllegalArgumentException(/*SF*/"The alpha is out of range"/*SF*/);
+        }
+    }
+
+
+    //--------------------------------------------------
+    // NATIVE METHODS
+    //--------------------------------------------------
+    private native int _bind(
+        int aRenderContextHandle, int aTargetHandle);
+    private native int _createRenderContext(
+        int aSVGProxyHandle);
+    private native void _deleteRenderContext(
+        int aRenderContextHandle);
+    private native int _release(
+       int aSurfaceHandle ,int aRenderContextHandle);
+    private native int _renderLCDUI(
+       int aRenderContextHandle, int aDocumentHandle,
+        int aX, int aY, int aClipX, int aClipY, int aClipW, int aClipH,
+        int aSvgW, int aSvgH, float aCurrentTime);
+    private native int[] _renderESWT(
+       int aRenderContextHandle, int aDocumentHandle,
+        int aX, int aY, int aClipX, int aClipY, int aClipW, int aClipH,
+        int aSvgW, int aSvgH, float aCurrentTime, int iUseNativeClear);
+    private native void _setRenderingQuality(
+       int aRenderContextHandle, int aMode);
+    private native void _setTransparency(
+       int aRenderContextHandle, float aAlpha);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/NativeError.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,256 @@
+/*
+* Copyright (c) 2002-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: Native Error Descriptions for M2G Component.
+*
+*/
+
+
+package com.nokia.microedition.m2g;
+
+import java.io.IOException;
+
+/**
+ * A utility class for declaring and handling native SymbianOS error codes.
+ * All error codes that are used in Java from native code should be
+ * declared here and referenced from this class. Also if a new error code
+ * is added, it should be added to the list of compile-time asserts in
+ * NativeError.cpp.
+ */
+public final class NativeError
+{
+    public static final String NATIVE_ERROR_MESSAGE = "SymbianOS error = ";
+    private static final int BUFFER_SIZE = 256;
+
+    // SymbianOS error codes
+    public static final int KErrNone = 0;
+    public static final int KErrNotFound = -1;
+    public static final int KErrGeneral = -2;
+    public static final int KErrCancel = -3;
+    public static final int KErrNoMemory = -4;
+    public static final int KErrNotSupported = -5;
+    public static final int KErrArgument = -6;
+    public static final int KErrOverflow = -9;
+    public static final int KErrAlreadyExists = -11;
+    public static final int KErrPathNotFound = -12;
+    public static final int KErrDied = -13;
+    public static final int KErrNotReady = -18;
+    public static final int KErrCorrupt = -20;
+    public static final int KErrAccessDenied = -21;
+    public static final int KErrWrite = -23;
+    public static final int KErrEof = -25;
+    public static final int KErrDiskFull = -26;
+    public static final int KErrBadName = -28;
+    public static final int KErrCommsLineFail = -29;
+    public static final int KErrTimedOut = -33;
+    public static final int KErrDisconnected = -36;
+    public static final int KErrTooBig = -40;
+    public static final int KErrDivideByZero = -41;
+    public static final int KErrHardwareNotAvailable = -44;
+
+
+    // Not intended to be constructed
+    private NativeError()
+    {
+    }
+
+
+
+    /**
+     * Checks for basic native error codes that map to standard Java
+     * exceptions and throws the exception if the error code matches.
+     * Otherwise just returns the error.
+     *
+     * @param aError Possible error code.
+     * @return Value passed in is returned if not an error.
+     * @throws OutOfMemoryError If aError equals KErrNoMemory.
+     * @throws IllegalArgumentException If aError equals KErrArgument
+     * @throws ArithmeticException If aError equals KErrDivideByZero
+     */
+    public static int checkExplicitOnly(int aError)
+    {
+        if (aError < KErrNone)
+        {
+            switch (aError)
+            {
+            case KErrNoMemory:
+                throw new OutOfMemoryError();
+                // KErrArgument must throw IllegalArgumentException
+                // otherwise lcdui will break, so don't change this.
+            case KErrArgument:
+                throw new IllegalArgumentException();
+            case KErrDivideByZero:
+                throw new ArithmeticException();
+            default:
+                // Do nothing
+            }
+        }
+        return aError;
+    }
+
+
+
+    /**
+     * Checks for basic native error codes that map to standard Java
+     * exceptions and throws the exception if the error code matches.
+     * Otherwise throws basic Error class.
+     *
+     * @param aError Possible error code.
+     * @param aThrowAlways Determines whether a default exception is thrown
+     * if the error code is not recognised.
+     * @return Value passed in is returned if not an error.
+     * @throws Error If the error code does not match any exception thrown
+     * in checkExplicitOnly, a default exception is thrown here.
+     */
+    public static int check(int aError)
+    {
+        if (aError < KErrNone)
+        {
+            checkExplicitOnly(aError);
+            throw new Error(errorMessage(aError));
+        }
+        return aError;
+    }
+
+
+
+    /**
+     * Version of check that uses a long rather than an int.
+     */
+    public static long check(long aError)
+    {
+        check((int)aError);
+        return aError;
+    }
+
+
+
+    /**
+     * Checks for basic native error codes that map to standard Java
+     * exceptions and throws the exception if the error code matches.
+     * Otherwise throws an IOException.
+     *
+     * @param aError Possible error code.
+     * @return Value passed in is returned if not an error.
+     */
+    public static int checkIO(int aError)
+    throws IOException
+    {
+        if (aError < KErrNone)
+        {
+            checkExplicitOnly(aError);
+            throw new IOException(errorMessage(aError));
+        }
+        return aError;
+    }
+
+
+
+    /**
+     * Checks if the error code represents out of memory, and throws Java Error
+     * if true. Otherwise throws basic Error class.
+     *
+     * @param aError Possible error code.
+     * @return Value passed in is returned if not an error.
+     */
+    public static int checkOOM(int aError)
+    {
+        if (aError < KErrNone)
+        {
+            if (aError == KErrNoMemory)
+            {
+                throw new OutOfMemoryError();
+            }
+            throw new Error(errorMessage(aError));
+        }
+        return aError;
+    }
+
+
+
+    /**
+     * Checks if the object is a null reference, and throws OutOfMemoryError
+     * if this is the case. Useful for checking for OOM when Java objects
+     * returned from a native method.
+     *
+     * @param aObject Object that may be null.
+     * @return Value passed in is returned if not an error.
+     */
+    public static Object checkOOM(Object aObject)
+    {
+        if (aObject == null)
+        {
+            throw new OutOfMemoryError();
+        }
+        return aObject;
+    }
+
+
+
+    /**
+     * Checks if the error code represents out of memory, and throws Java Error
+     * if true. Does not throw anything otherwise.
+     *
+     * @param aError Possible error code.
+     * @return Value passed in is returned if not an out of memory error.
+     */
+    public static int checkOOMOnly(int aError)
+    {
+        if (aError == KErrNoMemory)
+        {
+            throw new OutOfMemoryError();
+        }
+        return aError;
+    }
+
+
+
+    /**
+     * Returns a string formatted with generic text to indicate where the error
+     * code comes from and the error code given.
+     *
+     * @param A native error code.
+     * @return A string containing the error code and explanatory text.
+     */
+    public static String errorMessage(int aError)
+    {
+        final String message = _getNativeErrorMessage(aError);
+        String result = NATIVE_ERROR_MESSAGE.concat(Integer.toString(aError));
+        if (message != null &&  message.length() > 0)
+            result = result.concat(" : ").concat(message);
+        return result;
+    }
+
+    /**
+     * Returns a string formatted with generic text to indicate where the error
+     * code comes from and the error code given.
+     *
+     * @param A native error code.
+     * @param An extra text message for more information.
+     * @return A string containing the error code and explanatory text.
+     */
+    public static String errorMessage(int aError, String aExtraText)
+    {
+        final StringBuffer messageBuf = new StringBuffer(BUFFER_SIZE);   // use native max as base
+        messageBuf.append(aExtraText);
+        messageBuf.append(", ");
+        messageBuf.append(errorMessage(aError));
+        return messageBuf.toString();
+    }
+
+
+    private static native String _getNativeErrorMessage(int aError);
+
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/Platform.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,253 @@
+/*
+* 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:
+*
+*/
+/**
+ * \file
+ * \brief Target platform dependent Java module for Symbian.
+ *
+ */
+
+package com.nokia.microedition.m2g;
+import javax.microedition.lcdui.Graphics;
+import javax.microedition.lcdui.Image;
+import org.eclipse.swt.widgets.Display;
+
+import com.nokia.mj.impl.nokialcdui.LCDUIInvoker;
+import org.eclipse.swt.internal.extension.DisplayExtension;
+import org.eclipse.swt.internal.extension.Toolkit;
+
+/**
+ * Implements platform-dependent functionality. At the moment, this
+ * includes native finalization and some helper methods for
+ * synchronizing 2D and 3D rendering.
+ */
+class Platform
+{
+    /**
+     * eSWT display for ui thread access
+     */
+    private static Display display = null;
+    private static boolean libraryLoaded = false;
+
+    //------------------------------------------------------------------
+    // Package private methods
+    //------------------------------------------------------------------
+
+    /**
+     * Executes given runnable in UI thread if caller thread is not UI thread
+     */
+    static void executeInUIThread(M2GRunnableQt obj)
+    {
+        if (display == null)
+        {
+            if (!uiThreadAvailable())
+            {
+                throw new Error("Ui thread not available");
+            }
+        }
+        if (display.isDisposed())
+        {
+            throw new Error("Display already disposed");
+        }
+
+        if (obj != null)
+        {
+            // If we are not in UI thread use display
+            if (Thread.currentThread() != display.getThread())
+            {
+                display.syncExec(obj);
+            }
+            else
+            {
+                // In this case we are in UI thread so just execute directly
+                obj.run();
+            }
+            // Check if any exceptions occured in execution
+            // and throw forward in caller thread
+            obj.checkAndThrow();
+        }
+    }
+
+    /**
+     * Check the UI thread / toolkit init status and store display if it is available
+     * @return true if either lcdui or eswt toolkit is initialized and ui thread is accessible
+     *              otherwise false
+     */
+    static boolean uiThreadAvailable()
+    {
+        if (display != null)
+        {
+            return true;
+        }
+        else
+        {
+            //display = DisplayExtension.getDisplayInstance();
+        	//As now the thread is always available we are taking it from Toolkit.
+        	display  = Toolkit. getInternalDisplay();
+        	
+			
+			if (display == null)
+            {
+				
+                return false;
+            }
+            else
+            {
+            		
+                // UI thread is available, so load native library if not already loaded
+                if (!libraryLoaded)
+                {
+                		
+                    com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javam2g");
+                    libraryLoaded = true;
+                }
+                return true;
+            }
+        }
+    }
+    
+    /**
+     * Load Library if not already loaded
+     * 
+     
+    static void loadLibarary()
+    {
+    	if (!libraryLoaded)
+        {
+    		
+            com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javam2g");
+            libraryLoaded = true;
+        }
+    }*/
+
+    /**
+     * Registers an Object3D in the global handle-to-object map. The
+     * handle of the object must already be set at this point!
+     */
+//    static final void registerFinalizer(Object3D obj)
+//    {
+//        //heuristicGC();
+//    }
+//
+//    /**
+//     * Registers a Graphics3D object (not derived from Object3D) for
+//     * finalization.
+//     */
+//    static final void registerFinalizer(Graphics3D g3d)
+//    {
+//        //heuristicGC();
+//    }
+//
+//    /**
+//     * Registers an Interface object for finalization
+//     */
+//    static final void registerFinalizer(Interface m2G)
+//    {
+//    }
+//
+//    /**
+//     * Registers a Loader object for finalization
+//     */
+//    static final void registerFinalizer(Loader loader)
+//    {
+//    }
+//
+//    /**
+//     * Flushes all pending rendering to a Graphics context and blocks
+//     * until finished
+//     */
+//    static final void sync(Graphics g)
+//    {
+//        //ToolkitInvoker invoker = ToolkitInvoker.getToolkitInvoker();
+//        //invoker.toolkitSync(invoker.getToolkit());
+//    }
+//
+//    /**
+//     * Flushes all pending rendering to an Image object
+//     */
+//    static final void sync(Image img)
+//    {
+//        //ToolkitInvoker invoker = ToolkitInvoker.getToolkitInvoker();
+//        //invoker.toolkitSync(invoker.getToolkit());
+//    }
+//
+//    /**
+//     * Finalizes the native peer of an interface
+//     */
+//    static final native void finalizeInterface(int handle);
+//
+//    /**
+//     * Finalizes the native peer of an object
+//     * JCF: added this wrapper method so we could pass the toolkit handle to the native method.
+//     */
+    static final void finalizeObject(int handle)
+    {
+        try
+        {
+            final int finalHandle = handle;
+            executeInUIThread(
+                new M2GRunnableQt()
+            {
+                void doRun()
+                {
+                    _finalizeObject(finalHandle);
+                }
+            });
+        }
+        catch (Exception e)
+        {
+            // do nothing
+        }
+    }
+
+    /**
+     * Finalizes the native peer of an object associated with
+     * given Interface instance
+     */
+//    static final void finalizeObject(int handle, Interface aInterface)
+//    {
+//        try
+//        {
+//            final int finalHandle = handle;
+//            executeInUIThread(
+//                new M2GRunnableQt()
+//            {
+//                public void doRun()
+//                {
+//                    _finalizeObject(finalHandle);
+//                }
+//            });
+//        }
+//        catch (Exception e)
+//        {
+//            // do nothing
+//        }
+//    }
+
+
+    //------------------------------------------------------------------
+    // Private methods
+    //------------------------------------------------------------------
+
+    /**
+     * Trigger GC if minimum free memory limit has been exceeded in the native side
+     */
+    static final void heuristicGC()
+    {
+    }
+    private static final native void _finalizeObject(int handle);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionFactory.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection;
+
+import java.io.IOException;
+import javax.microedition.m2g.ExternalResourceHandler;
+import com.nokia.microedition.m2g.connection.common.M2GConnectionPolicyImpl;
+
+/**
+ * Connection factory
+ */
+public class M2GConnectionFactory
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final String COMMON_PROTOCOL =
+        "common";
+    public static final String FILE_PROTOCOL =
+        "file";
+    public static final String CONNECTION_BASE_PACKAGE =
+        "com.nokia.microedition.m2g.connection.";
+    public static final String CONNECTION_PROXY_CLASS_NAME =
+        ".M2GConnectionProxyImpl";
+
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Ctor
+     */
+    private M2GConnectionFactory()
+    {
+    }
+
+    /**
+     * Create a connection proxy.
+     * If a url is not absolute or if it's beginig with
+     * the slash mark then a resource is considered to be opened from a jar file.
+     * @param aUrl Locator
+     * @return Connection proxy
+       * @throws IOException if an io error occurs
+       * @throws NullPointerException if the locator is null.
+       * @throws IllegalArgumentException if the locator is of unsupported type.
+     */
+    public static M2GConnectionProxy create(String aUrl) throws IOException
+    {
+        try
+        {
+            M2GConnectionProxy proxy = null;
+            M2GUrlTokenizer tokenizer = new M2GUrlTokenizer(aUrl);
+
+            // If a url begins with the slash mark then
+            // a resource is tryed to open from a jar file.
+            if (!M2GUrlTokenizer.isAbsolutURL(aUrl) ||
+                    tokenizer.beginWithSlash())
+            {
+                proxy = new M2GConnectionProxy();
+            }
+            else
+            {
+                Class proxyClass =
+                    Class.forName(parseClassName(tokenizer.getProtocol()));
+                proxy = (M2GConnectionProxy)proxyClass.newInstance();
+            }
+            proxy.open(tokenizer);
+            return proxy;
+        }
+        catch (InstantiationException e)
+        {
+            throw new IllegalArgumentException("Internal error: " + e.getMessage());
+        }
+        catch (IllegalAccessException e)
+        {
+            throw new IllegalArgumentException("Internal error: " + e.getMessage());
+        }
+        catch (ClassNotFoundException e)
+        {
+            throw new IllegalArgumentException("Internal error: " + e.getMessage());
+        }
+    }
+
+    /**
+     * Get default external resource handler
+     * @param aUrl URL
+     * @return external resource handler
+     */
+    public static ExternalResourceHandler getExternalResourceHandler(String aUrl)
+    {
+        return new M2GDefaultExternalResourceHandler(aUrl);
+    }
+
+    /**
+     * Resolve external resource URL
+     * @param aTokenizer Tokenizer
+     * @param aUrl URL
+     * @return connection proxy
+     * @throws IOException
+     */
+    public static M2GConnectionProxy resolveExternalResourceUrl(
+        M2GUrlTokenizer aTokenizer, String aUrl) throws IOException
+    {
+        // Check if the URL is relative.
+        if (!M2GUrlTokenizer.isAbsolutURL(aUrl))
+        {
+            if (aTokenizer.getBaseUrl() != null)
+            {
+                aUrl = aTokenizer.resolveUrl(aUrl);
+            }
+        }
+
+        return M2GConnectionFactory.create(aUrl);
+    }
+
+    /**
+     * Get default policy
+     * @return Connection policy
+     */
+    public static M2GConnectionPolicy getDefaultPolicy()
+    {
+        return new M2GConnectionPolicyImpl();
+    }
+
+    /**
+       * Parses a connection proxy class name.
+       * @param aProtocol Protocol
+       * @return Connection proxy class name
+       */
+    private static String parseClassName(String aProtocol)
+    {
+        if (aProtocol.equals(FILE_PROTOCOL))
+        {
+            return
+                CONNECTION_BASE_PACKAGE + FILE_PROTOCOL + CONNECTION_PROXY_CLASS_NAME;
+        }
+        else
+        {
+            return
+                CONNECTION_BASE_PACKAGE + COMMON_PROTOCOL + CONNECTION_PROXY_CLASS_NAME;
+
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionPolicy.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection;
+
+/**
+ * Connection policy
+ */
+public interface M2GConnectionPolicy
+{
+    /**
+     * Get access right
+     * @return Rights
+     */
+    public boolean getAccessRight();
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionPolicyHandler.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection;
+
+/**
+ * Interface for connection policy handler
+ */
+public interface M2GConnectionPolicyHandler
+{
+    /**
+     * Get connection policy
+     * @return Policy
+     */
+    public M2GConnectionPolicy getConnectionPolicy();
+
+    /**
+     * Set connection policy
+     * @param aConnectionPolicy Policy
+     */
+    public void setConnectionPolicy(M2GConnectionPolicy aConnectionPolicy);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GConnectionProxy.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection;
+
+import java.io.IOException;
+import java.io.InputStream;
+import javax.microedition.io.StreamConnection;
+import com.nokia.mj.impl.utils.Logger;
+
+
+/**
+ * Base connection proxy class
+ */
+public class M2GConnectionProxy
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    // Error constants
+    static final String RESOURCE_NOT_FOUND_ESTR =
+        "Given resource is not found.";
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    protected String iBaseUrl             = null;
+    protected String iSuffixUrl           = null;
+    protected InputStream iInputStream        = null;
+    protected StreamConnection iConnection      = null;
+    protected M2GConnectionPolicy iConnectionPolicy = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    /**
+     * Ctor.
+     */
+    public M2GConnectionProxy()
+    {
+    }
+
+
+    /**
+     * Close the connection.
+     * When a connection has been closed, access to any of its
+     * methods that involve an I/O operation will cause an
+     * IOException  to be thrown.
+     * Closing an already closed connection has no effect.
+     */
+    public void close() throws IOException
+    {
+        if (iInputStream != null)
+        {
+            iInputStream.close();
+            iInputStream = null;
+        }
+        if (iConnection != null)
+        {
+            iConnection.close();
+            iConnection = null;
+        }
+        iConnectionPolicy = null;
+    }
+
+    /**
+     * Get base url
+     * @return Base url
+     */
+    public String getBaseUrl()
+    {
+        return iBaseUrl;
+    }
+
+    /**
+     * Get the suffix url
+     * @note The suffix is calculated in m2g.connection.file.M2GConnectionProxyImpl.open()
+     * @return Suffix url including '?' if there is a suffix, and null otherwise
+     */
+    public String getSuffixUrl()
+    {
+        return iSuffixUrl;
+    }
+
+    /**
+     * Get an input stream for a connection.
+     * @return An input stream
+       * @throws IOException If the input stream is null.
+     */
+    public InputStream getInputStream() throws IOException
+    {
+        if (iInputStream == null)
+        {
+            throw new IOException();
+        }
+        return iInputStream;
+    }
+
+    /**
+     * Get a connection policy.
+     * @return A connection policy
+       * @throws IOException If the connection policy is null.
+     */
+    public M2GConnectionPolicy getConnectionPolicy() throws IOException
+    {
+        if (iConnectionPolicy == null)
+        {
+            throw new IOException();
+        }
+        return iConnectionPolicy;
+    }
+
+
+    /**
+     * Open a connection to a file located in a jar file..
+     * @param aTokenizer Url tokenizer
+       * @throws IOException If an error occurs while loading a content.
+       * @throws IllegalArgumentException If no resource is found according to an URL.
+       */
+    public void open(M2GUrlTokenizer aTokenizer) throws IOException
+    {
+        iBaseUrl    = aTokenizer.getBaseUrl();
+        iSuffixUrl  = null; // can't have DRM mode within a JAR
+
+        iInputStream =
+            Runtime.getRuntime().getClass().getResourceAsStream(aTokenizer.getUrl());
+
+        if (iInputStream == null)
+        {
+            Logger.ELOG(Logger.EJavaUI, RESOURCE_NOT_FOUND_ESTR);
+            throw new IllegalArgumentException(RESOURCE_NOT_FOUND_ESTR);
+        }
+        iConnectionPolicy = M2GConnectionFactory.getDefaultPolicy();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GDefaultExternalResourceHandler.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection;
+
+
+import java.io.*;
+import javax.microedition.io.*;
+import javax.microedition.m2g.ExternalResourceHandler;
+import javax.microedition.m2g.*;
+
+
+/**
+* <p>This private class is the default resource handler
+* used to load external resources that are referenced
+* within a ScalableImage, namely within a SVG document in the case of SVG.
+* The default resource handler will be used by the platform in the following cases:
+*   - if the MIDlet has not explicitly set its own handler to load external resources
+*   - if the resource handler specified by the MIDlet is not able to load the
+*     external resources (i.e. the MIDlet's SVGResourceHandle.getExternalResource()
+*     returns null).</p>
+* @see javax.microedition.m2g.ExternalResourceHandler
+*/
+public class M2GDefaultExternalResourceHandler implements ExternalResourceHandler
+{
+
+    /*
+     * According to RFC 2396, the rules for determening the base URI can be summarized
+     * as follows (highest priority to lowest):
+     * 1.The base URI is embedded in the document's content.
+     * 2.The base URI is that of the encapsulating document.
+     * 3.The base URI is the URI used to retrieve  the entity.
+     * 4.The base URI is defined by the context of the application
+     *
+     * Note that in the case of the M2GDefaultExternalResourceHandler  4. is not
+     * applicable.
+     */
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GUrlTokenizer iTokenizer = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * This constructor is used to create a default resource handler that can
+     * load resources from absolute URLs and from URLs that are relative
+     * to the aUrl.
+     * NOTE: This handler will not be allowed to load resources from the application's
+     * jar file.
+     *
+     * @param aUrl The already validated url used to load the svg document
+     */
+    M2GDefaultExternalResourceHandler(String aUrl)
+    {
+        if (aUrl == null || aUrl.equals(""))
+        {
+            iTokenizer = new M2GUrlTokenizer();
+        }
+        else
+        {
+            iTokenizer = new M2GUrlTokenizer(aUrl);
+        }
+    }
+
+    /**
+     * This constructor is used to create a default resource handler that can
+     * load external resources from fully qualified URLs ONLY. Any relative URL
+     * will be considered to be a link to a resource within the application's jar file.
+     */
+    M2GDefaultExternalResourceHandler()
+    {
+        this(null);
+    }
+
+    /**
+      * This method is invoked when an external resource is required by the underlying implementation.
+      * When the request is completed by the implementation of this handler, a notification
+      * must be sent to the SVG engine through the requestCompleted() method of <code>ScalableImage</code>.
+      * To get a synchronous behaviour, requestCompleted() can be called in the implementation
+      * of requestResource. If called later, rendering the document before
+      * completing all the requests will just display the currently available content.
+      * Once the request is completed, the image will have to be redrawn to reflect the newly
+      * available data.
+      * For more details on required resources, please refer to the <code>externalResourcesRequired</code>
+      * attribute description in the SVG specification.
+      *
+      * @param image image that originated the external data request
+      * @param URL the an absolute or a relative URL for the external resource + drm mode
+      */
+    public void requestResource(ScalableImage aImage, String aUrl)
+    {
+        M2GConnectionProxy proxy = null;
+
+        /* IMPLEMENTATION NOTE:
+         * The default resource handler assumes that if there is an embedded base URL within the
+         * document then is upon the svg engine to provide the absolute URL.
+         * If the given URL is a relative URL then this handler will attempt to use as a base URL
+         * to retrieve the containing svg document. However, if the document's base
+         * URL is null then this handler will assume the given relative URL to be a file name
+         * within the application's jar file.
+         */
+        try
+        {
+            // NOTE: if exception is thrown during the resolveExternalResourceUrl() call then
+            // the requestCompleted should be called again with a null input stream.
+            proxy = M2GConnectionFactory.resolveExternalResourceUrl(iTokenizer, aUrl);
+            aImage.requestCompleted(aUrl, proxy.getInputStream());
+        }
+        catch (Exception e)
+        {
+            // e.printStackTrace();
+            // The requestCompleted() failed
+            try
+            {
+                aImage.requestCompleted(aUrl, null);
+            }
+            catch (Exception ee)
+            {
+                // ee.printStackTrace();
+            }
+        }
+        // Close streams
+        finally
+        {
+            try
+            {
+                if (proxy != null)
+                {
+                    proxy.close();
+                }
+            }
+            catch (Exception e)
+            {
+                // e.printStackTrace();
+            }
+        }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/M2GUrlTokenizer.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,280 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection;
+
+import java.io.IOException;
+import java.lang.NullPointerException;
+import java.lang.IllegalArgumentException;
+import com.nokia.mj.impl.utils.Logger;
+
+/**
+ * Connection policy
+ */
+public class M2GUrlTokenizer
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final String PROTOCOL_SEPARATOR =
+        "://";
+    public static final char PARAMETER_SEPARATOR =
+        '?';
+    public static final char SEPARATOR =
+        '/';
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private String iUrl = null;
+    private String iBaseUrl = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Ctor
+     */
+    public M2GUrlTokenizer()
+    {
+    }
+
+    /**
+     * Ctor
+     * @param aUrl Locator
+       * @throws NullPointerException if the locator is null.
+       * @throws IllegalArgumentException if the locator is of unsupported type.
+     */
+    public M2GUrlTokenizer(String aUrl)
+    {
+        setUrl(aUrl);
+    }
+
+    /**
+     * Check if the url begin with slash ('/')
+     * @return true is the url begin with slash
+       */
+    public boolean beginWithSlash()
+    {
+        if ((iUrl != null) &&
+                (iUrl.indexOf(SEPARATOR) == 0))
+        {
+            return true;
+        }
+        return false;
+    }
+
+
+    /**
+     * Parses the base part of the locator
+     * @return parsed base part
+       */
+    public String getBasePart()
+    {
+        if (iUrl == null)
+        {
+            return null;
+        }
+        int pos = iUrl.indexOf(PARAMETER_SEPARATOR);
+        if (pos == -1)
+        {
+            pos = iUrl.length();
+        }
+        return iUrl.substring(0, pos);
+    }
+
+    /**
+     * Parses the base url
+     * @return parsed base url
+       */
+    public String getBaseUrl()
+    {
+        return iBaseUrl;
+    }
+
+    /**
+     * Parses the end part of the locator
+     * @return parsed end part
+     * @throws IllegalArgumentException if base part cannot
+     *       be parsed from the locator
+       */
+    public String getEndPart()
+    {
+        if (iUrl == null)
+        {
+            return null;
+        }
+        int pos = iUrl.lastIndexOf(SEPARATOR);
+        if (pos == -1)
+        {
+            return iUrl;
+        }
+        return iUrl.substring(pos, iUrl.length());
+    }
+
+    /**
+     * Parses the middle part of the locator
+     * @return parsed middle part
+     * @throws IllegalArgumentException if middle part cannot
+     *       be parsed from the locator
+       */
+    public String getMiddlePart()
+    {
+        if (iUrl == null)
+        {
+            return null;
+        }
+        int pos = iUrl.indexOf(PARAMETER_SEPARATOR);
+        if (pos == -1)
+        {
+            pos = iUrl.length();
+        }
+        return iUrl.substring(
+                   getProtocol().length() + PROTOCOL_SEPARATOR.length(), pos);
+    }
+
+    /**
+     * Parses possible parameters of the locator
+     * @return Parsed parameters or null if there are not parameters
+     */
+    public String getParameters()
+    {
+        if (iUrl == null)
+        {
+            return null;
+        }
+        int pos = iUrl.indexOf(PARAMETER_SEPARATOR);
+        String parameters = null;
+        if (pos != -1)
+        {
+            parameters = iUrl.substring(pos + 1);
+        }
+        return parameters;
+    }
+
+    /**
+       * Parses the protocol part of the locator.
+       * @see M2GUrlTokenizer#isAbsolutURL()
+       * @return Protocol
+       * @throws IllegalArgumentException If the locator is of
+       * unsupported type.
+       */
+    public String getProtocol()
+    {
+        int pos = -1;
+        if ((iUrl == null) || ((pos = iUrl.indexOf(PROTOCOL_SEPARATOR)) == -1))
+        {
+            throw new IllegalArgumentException("Unable to parse protocol");
+        }
+        return iUrl.substring(0, pos);
+    }
+
+    /**
+     * Returns a whole locator string
+     * @return Locator used to create this instance
+     */
+    public String getUrl()
+    {
+        return iUrl;
+    }
+
+    /**
+     * Resolve URL according to existing base url and
+     * the given relative url
+     * TODO: Should be resolved by using RFC 2396
+     * @aRelativeUrl Relative URL.
+     * @return Resolved URL
+     */
+    public String resolveUrl(String aRelativeUrl)
+    {
+        check(aRelativeUrl);
+        if (iBaseUrl != null)
+        {
+            return (iBaseUrl + aRelativeUrl);
+        }
+        else
+        {
+            return aRelativeUrl;
+        }
+    }
+
+
+    /**
+     * Set a locator string
+     * @param aUrl Locator
+       * @throws NullPointerException if the locator is null.
+       * @throws IllegalArgumentException if the locator is of unsupported type.
+     */
+    public void setUrl(String aUrl)
+    {
+        check(aUrl);
+        iUrl = aUrl;
+        int pos = iUrl.lastIndexOf(SEPARATOR);
+        if (pos == -1)
+        {
+            iBaseUrl = null;
+        }
+        else
+        {
+            iBaseUrl = iUrl.substring(0, (pos + 1));
+        }
+    }
+
+    /**
+     * Check url
+     * @param aUrl Locator
+       * @throws NullPointerException if the locator is null.
+       * @throws IllegalArgumentException if the locator is of unsupported type.
+     */
+    private void check(String aUrl)
+    {
+        if (aUrl == null)
+        {
+            Logger.ELOG(Logger.EJavaUI, "setUrl() - url is null");
+            throw new NullPointerException();
+        }
+        if (aUrl.length() == 0)
+        {
+            Logger.ELOG(Logger.EJavaUI, "setUrl() - url is illegal");
+            throw new IllegalArgumentException();
+        }
+    }
+
+    //--------------------------------------------------
+    // STATIC METHODS
+    //--------------------------------------------------
+    /**
+       * Check if contains protocol.
+       * An absolute URL contains the name of the scheme being used (<scheme>)
+       * followed by a colon (":") and then a string (the <scheme-specific-
+       * // part>) whose interpretation depends on the scheme.
+       * Also if the URL begins with a slash character "/" then the URL is treated
+       * as absolute.
+       * @param aUrl URL
+       * @return true if URL contains a protocol
+       */
+    static public boolean isAbsolutURL(String aUrl)
+    {
+        if ((aUrl == null) ||
+                ((aUrl.indexOf(PROTOCOL_SEPARATOR) == -1) &&
+                 (aUrl.indexOf(SEPARATOR) != 0)))
+        {
+            return false;
+        }
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/common/M2GConnectionPolicyImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection.common;
+
+import com.nokia.microedition.m2g.connection.M2GConnectionPolicy;
+
+/**
+ * Connection policy
+ */
+public class M2GConnectionPolicyImpl implements M2GConnectionPolicy
+{
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Ctor
+     */
+    public M2GConnectionPolicyImpl()
+    {
+    }
+
+    /**
+     * Get access rights
+     * @see M2GConnectionPolicy#getAccessRight()
+     */
+    public boolean getAccessRight()
+    {
+        return true;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/common/M2GConnectionProxyImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection.common;
+
+import javax.microedition.io.Connector;
+import javax.microedition.io.StreamConnection;
+import javax.microedition.io.ConnectionNotFoundException;
+import java.io.IOException;
+import java.lang.IllegalArgumentException;
+import com.nokia.microedition.m2g.connection.*;
+
+/**
+ * Connection proxy class
+ */
+public class M2GConnectionProxyImpl extends M2GConnectionProxy
+
+{
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Ctor.
+     */
+    public M2GConnectionProxyImpl()
+    {
+    }
+
+    /**
+     * Open a connection.
+     * @see M2GConnectionProxy#open()
+       */
+    public void open(M2GUrlTokenizer aTokenizer) throws IOException
+    {
+        iBaseUrl   = aTokenizer.getBaseUrl();
+        iSuffixUrl = null; // can't have DRM suffix when opening from stream
+        iConnectionPolicy = new M2GConnectionPolicyImpl();
+        try
+        {
+            iConnection = (StreamConnection)Connector.open(
+                              aTokenizer.getUrl());
+            iInputStream = iConnection.openInputStream();
+        }
+        catch (ConnectionNotFoundException e)
+        {
+            throw new IllegalArgumentException(e.getMessage());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/file/M2GConnectionPolicyImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,302 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection.file;
+
+import java.io.IOException;
+import java.lang.NullPointerException;
+import java.lang.IllegalArgumentException;
+import java.lang.SecurityException;
+import com.nokia.microedition.m2g.connection.*;
+import com.nokia.microedition.m2g.M2GSVGConstants;
+import com.nokia.mj.impl.utils.Logger;
+
+/**
+ * Connection policy
+ * <b>DRM - DECRYPTED MODE</b>
+ * <p>
+ * <b>Description</b>
+ * <br>
+ * When a MIDlet tries to open a file using a URL that starts with file:// and
+ * ends either with ?drm=dec+display or with ?drm=dec+display+preview,
+ * this is interpreted as a request to open the file for reading of the
+ * content in the plaintext form.
+ * Example URLs:
+ * file:///E:/foo.svg?drm=dec+display
+ * file:///E:/foo.svg?drm=dec+display+preview
+ * <br>
+ * Supported only if the midlet belongs to MANUFACTURER DOMAIN otherwise
+ * java.lang.SecurityException is thrown.
+ * </p>
+ * <br>
+ * <br>
+ * <b>DRM - ENCRYPTED MODE</b>
+ * <p>
+ * <b>Description</b>
+ * <br>
+ * When a MIDlet tries to open a file using a URL that starts with file:// and
+ * ends with ?drm=enc, this is interpreted as a request to open the
+ * file for reading of the content in the encrypted form.
+ * Example URLs:
+ * file:///E:/foo.svg?drm=enc
+ * <br>
+ * Not supported, java.lang.IllegalArgumentException is thrown always.
+ * </p>
+ * <br>
+ * <br>
+ * <b>DRM - DEFAULT MODE</b>
+ * <p>
+ * <b>Description</b>
+ * <br>
+ * When a MIDlet tries to open a file using either a normal file URL or a
+ * file URL that ends with ?drm=preview, this is interpreted as a request to open the
+ * file for reading of the content in the decrypted form.
+ * NOTE: Preview mechanism is not available to MIDlets that don't
+ * belong to MANUFACTURER DOMAIN.
+ * Example URLs:
+ * file:///E:/foo.svg
+ * file:///E:/foo.svg?drm=preview
+ * <br>
+ * Access to SVG document via DOM API is NOT allowed, i.e. only rendering of the
+ * content is allowed if a MIDlet uses a default mode URL.
+ * If it's tryed to access to SVG document via DOM API then
+ * java.lang.SecurityException is thrown.
+ * </p>
+ */
+public class M2GConnectionPolicyImpl implements M2GConnectionPolicy
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final String ENC_NOT_SUPPORTED_ESTR =
+        "A URL with an encrypted mode is not supported.";
+    public static final String DRM_PARAMETER =
+        "drm";
+    public static final String DECRYPTED_MODE =
+        "dec";
+    public static final String ENCRYPTED_MODE =
+        "enc";
+    public static final String DEFAULT_MODE =
+        "def";
+    public static final String DEFAULT_PREVIEW_MODE =
+        "def_preview";
+    public static final String DRM_PREVIEW_ATTRIBUTE =
+        "preview";
+    public static final String DRM_DEFAULT_VALUES =
+        "?drm=dec+display";
+    public static final String DRM_DEFAULT_VALUES_AND_PREVIEW =
+        "?drm=dec+display+preview";
+    public static final String DRM_FILE_SUFFIX =
+        "dcf";
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GUrlTokenizer iTokenizer;
+    private boolean iAccessRight = true;
+    private String iMode = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Ctor
+     */
+    public M2GConnectionPolicyImpl(M2GUrlTokenizer aTokenizer)
+    {
+        iTokenizer = aTokenizer;
+    }
+
+    /**
+     * Check domain
+     * @throws SecurityException if not access rights
+     */
+    public void checkDomain(boolean isManufacturerDomain) throws SecurityException
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "checkDomain(): manufacturer domain=" + isManufacturerDomain
+                   + ", mode=" + iMode + ", access right=" + iAccessRight + " - begin");
+
+        // If drm mode then
+        if (iMode != null)
+        {
+            // If dec mode and not manufacturer domain
+            if (iMode.equals(DECRYPTED_MODE))
+            {
+                if (!isManufacturerDomain)
+                {
+                    Logger.ELOG(Logger.EJavaUI,
+                                "checkDomain() - Not manufacturer and dec: SecurityException");
+                    throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+                }
+            }
+            // If default + preview mode
+            else if (iMode.equals(DEFAULT_PREVIEW_MODE))
+            {
+                if (!isManufacturerDomain)
+                {
+                    Logger.ELOG(Logger.EJavaUI,
+                                "checkDomain() - Not manufacturer and def+preview: SecurityException");
+                    throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+                }
+            }
+            // If not default mode
+            else if (!iMode.equals(DEFAULT_MODE))
+            {
+                Logger.ELOG(Logger.EJavaUI,
+                            "checkDomain() - Not def nor dec: SecurityException");
+                throw new SecurityException(M2GSVGConstants.ACCESS_RIGHTS_ESTR);
+            }
+        }
+    }
+
+    /**
+     * Check protection type
+     * @param aType If type is null then file is not drm protected.
+     */
+    public void checkProtectionType(String aType)
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "checkProtectionType() type=" + aType + ", mode=" + iMode +
+                   ", access right=" + iAccessRight + " - begin");
+
+        if ((aType != null) && (!aType.equals("")))
+        {
+            if (iMode == null)
+            {
+                iMode = DEFAULT_MODE;
+                iAccessRight = false;
+            }
+        }
+
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "checkProtectionType() mode=" + iMode + ", access right=" +
+                   iAccessRight + " - end");
+    }
+
+    /**
+       * Get access rights
+       * @see M2GConnectionPolicy#getAccessRight()
+       */
+    public boolean getAccessRight()
+    {
+        return iAccessRight;
+    }
+
+    /**
+       * Initialize
+       * @param aTokenizer Tokenizer
+       * @throws IllegalArgumentException if drm with encrypted mode
+     */
+    public void initialize(M2GUrlTokenizer aTokenizer)
+    {
+        iAccessRight = true;
+        iMode = null; // no DRM at all
+        iTokenizer = aTokenizer;
+        String parameters = iTokenizer.getParameters();
+        int pos = -1;
+        // Check if a url is something more than just a normal url.
+        // Is the drm parameter within the parameters?
+        if ((parameters != null) && (pos = parameters.indexOf(DRM_PARAMETER)) != 1)
+        {
+            pos += DRM_PARAMETER.length();
+            // Encrypted mode?
+            if (parameters.indexOf(ENCRYPTED_MODE, pos) != -1)
+            {
+                Logger.ELOG(Logger.EJavaUI, "initialize(): drm - encrypted mode");
+                iAccessRight = false;
+                iMode = ENCRYPTED_MODE;
+                throw new IllegalArgumentException(ENC_NOT_SUPPORTED_ESTR);
+            }
+            // Decrypted mode?
+            else if (parameters.indexOf(DECRYPTED_MODE, pos) != -1)
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "initialize(): drm - decrypted mode");
+                iAccessRight = true;
+                iMode = DECRYPTED_MODE;
+            }
+            // Default + preview mode?
+            else if (parameters.indexOf(DRM_PREVIEW_ATTRIBUTE, pos) != -1)
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "initialize(): drm - decrypted mode");
+                iAccessRight = false;
+                iMode = DEFAULT_PREVIEW_MODE;
+            }
+            // Default mode
+            else
+            {
+                Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                           "initialize(): drm - default mode");
+                iAccessRight = false;
+                iMode = DEFAULT_MODE;
+            }
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "initialize() mode=" + iMode + ", access right="
+                   + iAccessRight + " - end");
+    }
+
+    /**
+     * Get drm mode
+     * @return mode. Null if no drm
+     */
+    public String getMode()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "getMode(): " + iMode + "- begin");
+        return iMode;
+    }
+
+    /**
+     * Get url
+     * @return File url
+     */
+    public String getUrl()
+    {
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "getUrl() mode=" + iMode + ", access right=" + iAccessRight + " - begin");
+
+        String url = iTokenizer.getUrl();
+        String parameters = iTokenizer.getParameters();
+        // If normal url or default drm url
+        if ((iMode == null) ||
+                (iMode.equals(DEFAULT_MODE)) ||
+                (iMode.equals(DEFAULT_PREVIEW_MODE)))
+        {
+            Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                       "getUrl() parse default url");
+            // Url with preview attribute?
+            if ((parameters != null) &&
+                    (parameters.indexOf(DRM_PREVIEW_ATTRIBUTE) != -1))
+            {
+                url = (iTokenizer.getBasePart() + DRM_DEFAULT_VALUES_AND_PREVIEW);
+            }
+            // Normal file url?
+            else
+            {
+                // File API is able to open normal file without drm protection even
+                // when the url contains the drm parameter
+                url = (iTokenizer.getBasePart() + DRM_DEFAULT_VALUES);
+            }
+        }
+        Logger.LOG(Logger.EJavaUI, Logger.EInfo,
+                   "getUrl(): " + url + " - end");
+        return url;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/com/nokia/microedition/m2g/connection/file/M2GConnectionProxyImpl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2005 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 com.nokia.microedition.m2g.connection.file;
+
+import javax.microedition.io.file.FileConnection;
+import javax.microedition.io.Connector;
+import java.io.IOException;
+import com.nokia.microedition.m2g.connection.*;
+import com.nokia.mj.impl.utils.Logger;
+
+/**
+ * File connection proxy class
+ */
+public class M2GConnectionProxyImpl extends M2GConnectionProxy
+{
+
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final String READ_PERMISSION =
+        "javax.microedition.io.Connector.file.read";
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+    /**
+     * Ctor.
+     */
+    public M2GConnectionProxyImpl()
+    {
+        super();
+    }
+
+    /**
+     * Open a connection.
+     * @see connection.common.M2GConnectionProxy#open()
+     */
+    public void open(M2GUrlTokenizer aTokenizer) throws IOException
+    {
+        boolean openingStream = false;
+        FileConnection connection = null;
+        try
+        {
+            iBaseUrl = aTokenizer.getBaseUrl();
+
+            // extract the suffix url from the initial url used to open the
+            // file, and not the constructed (altered in default mode) url by
+            // M2GConnectionPolicyImpl.
+            // This suffix is passed to the external resource handler later
+            iSuffixUrl = aTokenizer.getParameters();
+            if (iSuffixUrl != null)
+            {
+                iSuffixUrl = M2GUrlTokenizer.PARAMETER_SEPARATOR + iSuffixUrl;
+            }
+
+            Logger.LOG(
+                Logger.EJavaUI,
+                Logger.EInfo,
+                "file open(), suffix URI: "
+                + (iSuffixUrl != null ? iSuffixUrl.toString() : "null")
+                + ", create file connection - 0");
+
+            M2GConnectionPolicyImpl connectionPolicy =
+                new M2GConnectionPolicyImpl(aTokenizer);
+
+            String uri = aTokenizer.getUrl();
+
+            Logger.LOG(
+                Logger.EJavaUI,
+                Logger.EInfo,
+                "file open(), URI: " + uri
+                + ", create file connection - 2");
+
+            connection = (FileConnection) Connector.open(uri,
+                         Connector.READ);
+            openingStream = true;
+            iInputStream = connection.openInputStream();
+            openingStream = false;
+            iConnection = connection;
+            iConnectionPolicy = connectionPolicy;
+        }
+        finally
+        {
+            if ((true == openingStream) && (null != connection))
+            {
+                connection.close();
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/eclipse/swt/widgets/SVGAnimatorControl.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,441 @@
+/*
+* 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:
+*
+*/
+package org.eclipse.swt.widgets;
+
+// this package is removed from Qt import org.eclipse.swt.internal.symbian.
+/*import org.eclipse.swt.internal.symbian.*;*/
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.widgets.Control;
+import javax.microedition.m2g.*;
+import com.nokia.microedition.m2g.*;
+import java.util.*;
+import java.lang.ref.WeakReference;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.events.*;
+import com.nokia.mj.impl.utils.Logger;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+import org.eclipse.swt.graphics.Internal_GfxPackageSupport; 
+
+
+
+/**
+ * Control
+ */
+public class SVGAnimatorControl extends Canvas
+        implements ControlListener,
+        KeyListener,
+        MouseListener,
+        DisposeListener,
+        ShellListener,
+        PaintListener
+{
+    //--------------------------------------------------
+    // STATIC CONSTANTS
+    //--------------------------------------------------
+    public static final int STATE_STOPPED = 1;
+    public static final int STATE_PLAYING = 2;
+    public static final int STATE_PAUSED  = 3;
+    public static final float DEFAULT_DELTA_TIME = 0.1f;
+
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private int iState;
+    private SVGImage iSVGImage;
+    private M2GScalableGraphics iSg;
+    private float iDeltaTime;
+    private SVGAnimatorRunnable iTask = null;
+    private SVGEventListener iEventListener = null;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    /**
+     * @see
+     */
+    public SVGAnimatorControl(SVGImage aSVGImage)
+    {
+				
+
+        iSVGImage = aSVGImage;
+        iState = STATE_STOPPED;
+        // Create render context, use M2GScalableGraphics
+        // directly to get access to render method with native
+        // side clearing parameter
+        iSg = new M2GScalableGraphics();
+        iSg.setRenderingQuality(ScalableGraphics.RENDERING_QUALITY_HIGH);
+        iDeltaTime = DEFAULT_DELTA_TIME;
+        iTask = new SVGAnimatorRunnable(this);
+    }
+
+    /**
+     * @see org.eclipse.swt.widgets.Control#setParent()
+     */
+    public boolean setParent(Composite aParent)
+    {
+        parent = aParent;
+        display = aParent.display;
+
+        // Init widget after parent and display are known
+        //Have to create Widget.
+//Workaround for Qt changes this method is now in with one int argument.L:\sf\app\jrt\javauis\eswt_qt\org.eclipse.swt\Eclipse SWT\qt\org\eclipse\swt\widgets\Control.java        
+//        int i =10;
+//        createWidget(i);
+//				internal_createWidget();
+
+        // Add this to necessary listeners
+        addControlListener(this);
+        addKeyListener(this);
+        addMouseListener(this);
+        addDisposeListener(this);
+        parent.getShell().addShellListener(this);
+        addPaintListener(this);
+
+        return true;
+    }
+
+    /**
+     * @see org.eclipse.swt.widgets.Control#paint()
+     */
+        public void paintControl(PaintEvent e) {
+        GC gc = e.gc;
+				
+        // Render image
+        try
+        {
+            iSg.bindTarget(gc);
+            // Parameter true to use native side clearing
+            // -> animator background is always white
+            iSg.render(0, 0, iSVGImage, true);
+        }
+        finally
+        {
+        		
+            iSg.releaseTarget();
+        }
+    }
+
+    /**
+     * Returns event listener
+     * @return event listener
+     */
+    public synchronized SVGEventListener getEventListener()
+    {
+        return iEventListener;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#getTimeIncrement()
+     */
+    public synchronized float getTimeIncrement()
+    {
+        return iDeltaTime;
+    }
+
+    /**
+     * Increases the increment time of the SVGImage.
+     * Increment is done only if the playing state is active.
+     * @see javax.microedition.m2g.SVGImage#incrementTime()
+     */
+    public synchronized void increaseCurrentTime()
+    {
+        if (iState == STATE_PLAYING)
+        {
+            iSVGImage.incrementTime(iDeltaTime);
+        }
+    }
+
+    /**
+     * Checks if playing
+     * @return true if playing
+     */
+    public synchronized boolean isPlaying()
+    {
+        return iState == STATE_PLAYING;
+    }
+
+    /**
+     * Checks if paused
+     * @return true if paused
+     */
+    public synchronized boolean isPaused()
+    {
+        return iState == STATE_PAUSED;
+    }
+
+    /**
+     * Checks if stopped
+     * @return true if stopped
+     */
+    public synchronized boolean isStopped()
+    {
+        return iState == STATE_STOPPED;
+    }
+
+    /**
+     * @see org.eclipse.swt.events.DisposeListener#widgetDisposed()
+     * @see javax.microedition.m2g.SVGEventListener#hideNotify()
+     */
+    public synchronized void widgetDisposed(DisposeEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.hideNotify();
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ShellListener#shellActivated()
+     * @see javax.microedition.m2g.SVGEventListener#showNotify()
+     */
+    public synchronized void shellActivated(ShellEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.showNotify();
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ShellListener#shellClosed()
+     * @see javax.microedition.m2g.SVGEventListener#hideNotify()
+     */
+    public synchronized void shellClosed(ShellEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.hideNotify();
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ShellListener#shellDeactivated()
+     * @see javax.microedition.m2g.SVGEventListener#hideNotify()
+     */
+    public synchronized void shellDeactivated(ShellEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.hideNotify();
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ShellListener#shellDeiconified()
+     * @see javax.microedition.m2g.SVGEventListener#hideNotify()
+     */
+    public synchronized void shellDeiconified(ShellEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.hideNotify();
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ShellListener#shellIconified()
+     * @see javax.microedition.m2g.SVGEventListener#showNotify()
+     */
+    public synchronized void shellIconified(ShellEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.showNotify();
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.KeyListener#keyPressed()
+     * @see javax.microedition.m2g.SVGEventListener#keyPressed()
+     */
+    public synchronized void keyPressed(KeyEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.keyPressed(e.keyCode);
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.KeyListener#keyReleased()
+     * @see javax.microedition.m2g.SVGEventListener#keyPReleased()
+     */
+    public synchronized void keyReleased(KeyEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.keyReleased(e.keyCode);
+        }
+    }
+
+    /**
+    * @see org.eclipse.swt.events.MouseListener#mouseDown()
+    * @see javax.microedition.m2g.SVGEventListener#pointerPressed()
+    */
+    public synchronized void mouseDown(MouseEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.pointerPressed(e.x, e.y);
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.MouseListener#mouseUp()
+     * @see javax.microedition.m2g.SVGEventListener#pointerReleased()
+     */
+    public synchronized void mouseUp(MouseEvent e)
+    {
+        if (iEventListener != null)
+        {
+            iEventListener.pointerReleased(e.x, e.y);
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick()
+     */
+    public synchronized void mouseDoubleClick(MouseEvent e)
+    {
+        // No implementation needed
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ControlListener#controlResized()
+     * @see javax.microedition.m2g.SVGEventListener#sizeChanged()
+     */
+    public synchronized void controlResized(ControlEvent e)
+    {
+        Rectangle bounds = getBounds();
+        if (iEventListener != null)
+        {
+            iEventListener.sizeChanged(bounds.width, bounds.height);
+        }
+    }
+
+    /**
+     * @see org.eclipse.swt.events.ControlListener#controlMoved()
+     */
+    public synchronized void controlMoved(ControlEvent e)
+    {
+        // No implementation needed
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#pause()
+     */
+    public synchronized void pause()
+    {
+        iState = STATE_PAUSED;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#play()
+     */
+    public synchronized void play()
+    {
+        if (iState == STATE_STOPPED)
+        {
+            // Set runnable to be run in UI thread
+            display.asyncExec(iTask);
+        }
+        iState = STATE_PLAYING;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setSVGEventListener()
+     */
+    public synchronized void setEventListener(SVGEventListener eventListener)
+    {
+        iEventListener = eventListener;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#setTimeIncrement()
+     */
+    public synchronized void setTimeIncrement(float aDeltaTime)
+    {
+        iDeltaTime = aDeltaTime;
+    }
+
+    /**
+     * @see javax.microedition.m2g.SVGAnimator#stop()
+     */
+    public synchronized void stop()
+    {
+        iState = STATE_STOPPED;
+    }
+}
+
+/**
+ * SVGAnimatorRunnable
+ * Runnable class to perform control redrawing.
+ */
+class SVGAnimatorRunnable implements Runnable
+{
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+
+    private WeakReference iWeakControl;
+
+    //--------------------------------------------------
+    // METHODS
+    //--------------------------------------------------
+
+    public SVGAnimatorRunnable(SVGAnimatorControl aControl)
+    {
+        iWeakControl = new WeakReference(aControl);
+    }
+    /*
+     * @see java.lang.Runnable#run()
+     */
+    public void run()
+    {
+        SVGAnimatorControl control = (SVGAnimatorControl)iWeakControl.get();
+        if (control != null && !control.isDisposed())
+        {
+            try
+            {
+                synchronized (control)
+                {
+                    if (control.isPlaying())
+                    {
+                        // Playing: increase time
+                        control.increaseCurrentTime();
+                    }
+                    if (!control.isStopped())
+                    {
+                        // Playing or paused: request repainting and new run
+                        // If animator has been stopped no new run is requested
+                        control.redraw();
+                        control.getDisplay().timerExec(
+                            (int)(control.getTimeIncrement() * 1000),
+                            this);
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                Logger.ELOG(Logger.EJavaUI, "SVGAnimatorRunnable: run() - exception: "
+                            + e.toString());
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/javax/microedition/m2g/ExternalResourceHandler.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2004 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 javax.microedition.m2g;
+
+
+/**
+* <p>This interface is used to load external resources that are referenced
+* within a ScalableImage, namely within an SVG document in the case of SVG.
+* In SVGT 1.1, these resources are not required for displaying the SVG document.
+* If no ExternalResourceHandler is registered when creating the image,
+* the engine will retrieve these resources using its own implementation
+* of the requestResource method.</p>
+*<p>
+* The default engine behaviour can be overwritten by passing to {@link javax.microedition.m2g.ScalableImage#createImage createImage}
+* an implementation of this interface as paramater when the default implementation
+* is insufficient. For example, if the SVGImage is loaded from within a
+* Jar file, the implementation will not be able to load images that
+* have relative URIs (e.g., &lt;image xlink:href="myImage.png" /&gt;).
+* All the external resources are requested by the engine at the time of
+* the <code>createImage</code> call. Note that SVGT 1.1 does
+* not contain external references to SVG files, therefore an external
+* resource can not contain subsequent external resources. </p>
+*
+* @see      javax.microedition.m2g.ScalableImage
+*/
+public interface ExternalResourceHandler
+{
+
+    /**
+     * This method is invoked when an external resource is required by the underlying implementation.
+     * When the request is completed by the implementation of this handler, a notification
+     * must be sent to the SVG engine through the requestCompleted() method of <code>ScalableImage</code>.
+     * To get a synchronous behaviour, requestCompleted() can be called in the implementation
+     * of requestResource. If called later, rendering the document before
+     * completing all the requests will just display the currently available content.
+     * Once the request is completed, the image will have to be redrawn to reflect the newly
+     * available data.
+     * For more details on required resources, please refer to the <code>externalResourcesRequired</code>
+     * attribute description in the SVG specification.
+     *
+     * @param image image that originated the external data request
+     * @param URI the URI for the external resource.
+     */
+    public void requestResource(ScalableImage image, String URI);
+
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/javax/microedition/m2g/SVGAnimator.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,350 @@
+/*
+* Copyright (c) 2004 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 javax.microedition.m2g;
+
+import com.nokia.microedition.m2g.M2GSVGAnimator;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Display;
+import com.nokia.microedition.m2g.M2GSVGeSWTAnimator;
+/**
+ * The <code>SVGAnimator</code> class handles automatic rendering of updates and
+ * animations in an <code>SVGImage</code> to a target user interface (UI) component.
+ *
+ * The target component type depends on the Java profile this specification is
+ * implemented on, as described in the <code>createAnimator</code> and
+ * <code>getTargetComponent</code> methods documentation.
+ *
+ * There are two types of rendering updates the <code>SVGAnimator</code> handles:
+ *
+ * <ul>
+ *   <li><b>Animation Updates.</b> The <code>SVGAnimator</code> can run animations
+ *       and automatically and periodically refreshes its rendering to
+ *       reflect the effect of animations.</li>
+ *   <li><b>SVGImage Updates.</b> The <code>SVGAnimator</code> updates its rendering
+ *       following alterations of the associated <code>SVGImage</code>,
+ *       for example if the position of one of the graphical elements is
+ *       modified by an API call.</li>
+ * </ul>
+ *
+ * An <code>SVGAnimator</code> instance can be in one of the following states:
+ * <ul>
+ *   <li><b>Stopped</b>. This is the initial state. The <code>SVGAnimator</code>
+ *       performs no rendering updates. <br/>
+ *       Possible transitions:
+ *       <ul>
+ *          <li>To the <i>playing</i> state, with the <code>play</code> method.</li>
+ *       </ul>
+ *       </li>
+ *
+ *   <li><b>Playing</b>. This is the typical state for an
+ *   <code>SVGAnimator</code>.  In that state, the <code>SVGAnimator</code>
+ *   performs both Animation and SVGImage updates.
+ *
+ *   While there are active animations,
+ *   the animator updates the rendering at a rate not faster than the one
+ *   defined by the <code>setTimeIncrement</code> method. If SVGImage updates are made
+ *   (e.g., with calls to the <code>SVGElement</code>
+ *   <code>setTrait</code> method, see examples), the rendering is updated at the time of
+ *   the next animation rendering.<br />
+ *
+ *   When there are no active animations, the animator will update the rendering
+ *   after each <code>Runnable</code> passed to the <code>invokeLater</code> or
+ *   <code>invokeAndWait</code> methods has finished executing.
+ *   <br/>
+ *       Possible transitions:
+ *       <ul>
+ *          <li>To the <i>stopped</i> state, with the <code>stop</code> method.</li>
+ *          <li>To the <i>paused</i> state, with the <code>pause</code> method.</li>
+ *       </ul>
+ *   </li>
+ *
+ *   <li><b>Paused</b>. When in that state, the <code>SVGAnimator</code> only
+ *   performs SVGImage updates rendering. The animator no longer automatically
+ *   advances the SVG document's current time, so rendering reflects the animation
+ *   at the document's current time. Note that a change to the document's current
+ *   time while in the <i>paused</i> state will trigger a new rendering for the
+ *   new current time.
+ *   <br/>
+ *       Possible transitions:
+ *       <ul>
+ *          <li>To the <i>stopped</i> state, with the <code>stop</code> method.</li>
+ *          <li>To the <i>playing</i> state, with the <code>play</code> method.</li>
+ *       </ul>
+ *   </li>
+ * </ul>
+ *
+ * <b>Code example:</b><br />
+ * <pre>
+ * // Create an SVGAnimator
+ * SVGImage map = ...; // See the SVGImage documentation.
+ *
+ * SVGAnimator svgAnimator = SVGAnimator.createAnimator(map);
+ *
+ * // Display the associated SVGAnimator component.
+ * // Depends on the platform.
+ *
+ * // =============== AWT Example ===============
+ * Panel panel = ....;
+ * panel.add((Component) svgAnimator.getTargetComponent());
+ * ...
+ *
+ * // =============== MIDP Example ===============
+ * Canvas svgCanvas = (Canvas) svgAnimator.getTargetComponent());
+ * ...
+ *
+ * // Start rendering animations.
+ * svgAnimator.play();
+ * ....
+ * class MapRunnable implements Runnable {
+ *    public void run() {
+ *        // Perform map updates based on current
+ *        // traffic information.
+ *        SVGElement statusRect
+ *             = map.getDocument().getElementById("statusRect");
+ *
+ *        // Reflect that traffic status.
+ *        statusRect.setRGBTrait(...); // See setRGBTrait documentation.
+ *    }
+ * }
+ *
+ * Runnable mapUpdates = new MapRunnable();
+ * ....
+ *
+ * while (someLoopCondition) {
+ *     if(hasMapUpdate) {
+ *         svgAnimator.invokeAndWait(mapUpdates);
+ *     }
+ * }
+ * </pre>
+ */
+public abstract class SVGAnimator
+{
+    /**
+     * This method creates a new <code>SVGAnimator</code> for the specified SVGImage.
+     *
+     * @param svgImage the <code>SVGImage</code> this animator should render.
+     * @return a new <code>SVGAnimator</code> instance.
+     * @throws NullPointerException if <code>svgImage</code> is null.
+     */
+	
+	public static SVGAnimator createAnimator(SVGImage svgImage)
+	{
+		SVGAnimator tempAnimator = null;
+		
+		
+		
+		tempAnimator=M2GSVGAnimator.buildAnimator(svgImage);
+		
+		
+
+		return tempAnimator;
+	}
+	
+	
+	
+	public static SVGAnimator createAnimator(SVGImage svgImage,java.lang.String componentBaseClass)
+	{
+		SVGAnimator tempAnimator = null;
+		
+		if (componentBaseClass == "org.eclipse.swt.widgets.Control")
+		{
+			
+			tempAnimator=M2GSVGeSWTAnimator.buildAnimator(svgImage);
+			
+		}
+		else
+		{
+			
+			tempAnimator=M2GSVGAnimator.buildAnimator(svgImage);
+			
+		}
+		return tempAnimator;
+	}
+	
+   /* public static SVGAnimator createAnimator(SVGImage svgImage)
+    {
+        SVGAnimator tempAnimator = null;
+        
+    		
+    		
+        tempAnimator=M2GSVGeSWTAnimator.buildAnimator(svgImage);
+        
+				
+
+        //tempAnimator=M2GSVGAnimator.buildAnimator(svgImage);
+        
+        return tempAnimator;
+    }*/
+
+    /**
+     * This method creates a new <code>SVGAnimator</code> for the specified SVGImage.
+     *
+     * The following components types must be supported:
+     *
+     * <ul>
+     * <li> "javax.microedition.lcdui.Canvas" on profiles supporting LCDUI</li>
+     * <li> "java.awt.Component" on profiles supporting AWT</li>
+     * </ul>
+     *
+     * On platforms that support the Swing UI component framework, the
+     * "javax.swing.JComponent" string may be used to request a Swing component.
+     *
+     * @param svgImage the <code>SVGImage</code> this animator should render.
+     * @param componentBaseClass the desired base class for the component associated
+     *        with the animator. This is used when the platform this specification
+     *        is implemented on supports multiple UI component frameworks. If
+     *        componentBaseClass is null, this is equivalent to invoking the
+     *        <code>createAnimator</code> method with the svgImage parameter only.
+     * @return a new <code>SVGAnimator</code> instance.
+     * @throws NullPointerException if <code>svgImage</code> is null.
+     * @throws IllegalArgumentException if the requested
+     *         <code>componentBaseClass</code> is not supported by the
+     *         implementation.
+     */
+//	
+//	public static SVGAnimator createAnimator(SVGImage svgImage, String componentBaseClass)
+//		{
+//			SVGAnimator tempAnimator = null;
+//			
+//			tempAnimator=M2GSVGAnimator.buildAnimator(svgImage, componentBaseClass);
+//			
+//	        return tempAnimator;
+//
+//		}
+	
+	
+	
+/*    public static SVGAnimator createAnimator(
+        SVGImage svgImage, String componentBaseClass)
+    {
+				
+
+        SVGAnimator tempAnimator = null;
+            tempAnimator=M2GSVGeSWTAnimator.buildAnimator(svgImage);
+// TODO Check for the toolkit?? tempAnimator=M2GSVGAnimator.buildAnimator(svgImage, componentBaseClass);
+        return tempAnimator;
+    }*/
+
+    /**
+     * The type of target component associated with the animator depends on the
+     * Java profile this specification is implemented on:
+     *
+     * <ul>
+     * <li> javax.microedition.lcdui.Canvas on profiles supporting LCDUI</li>
+     * <li> java.awt.Component on profiles supporting AWT</li>
+     * </ul>
+     * @return target the target component associated with the animator.
+     * @see #createAnimator
+     */
+    public abstract Object getTargetComponent();
+
+    /**
+     * Returns the current time increment used for animation rendering. The
+     * SVGAnimator increments the SVG document's current time by this amount
+     * between each rendering.
+     *
+     * @return the current time increment used for animation rendering. The default
+     *         value is 0.1 (100 milliseconds)
+     * @see #setTimeIncrement
+     */
+    public abstract float getTimeIncrement();
+
+    /**
+     * Invoke the input Runnable in the Document update thread and return after
+     * the Runnable has completed.
+     *
+     * @param runnable the new Runnable to invoke.
+     * @throws java.lang.InterruptedException if the current thread is waiting,
+     * sleeping, or otherwise paused for a long time and another thread
+     * interrupts it.
+     * @throws NullPointerException if <code>runnable</code> is null.
+     * @throws IllegalStateException if the animator is in the <i>stopped</i> state.
+     */
+    public abstract void invokeAndWait(
+        Runnable runnable) throws InterruptedException;
+
+    /**
+     * Schedule the input Runnable for execution in the update thread at a later time.
+     *
+     * @param runnable the new Runnable to execute in the Document's update
+     * thread when time permits.
+     * @throws NullPointerException if <code>runnable</code> is null.
+     * @throws IllegalStateException if the animator is in the <i>stopped</i> state.
+     */
+    public abstract void invokeLater(java.lang.Runnable runnable);
+
+    /**
+     * Transitions this <code>SVGAnimator</code> to the <i>paused</i> state.
+     * The <code>SVGAnimator</code> stops advancing the document's current time
+     * automatically (see the SVGDocument's setCurrentTime method). As a result,
+     * animations are paused until another call to the <code>play</code> method
+     * is made, at which points animations resume from the document's current
+     * time. SVGImage updates (through API calls) trigger a rendering update
+     * while the <code>SVGAnimator</code> is in the <i>paused</i> state.
+     *
+     * @throws IllegalStateException if the animator is not in the <i>playing</i>
+     *         state.
+     */
+    public abstract void pause();
+
+    /**
+     * Transitions this <code>SVGAnimator</code> to the <i>playing</i>
+     * state. While in the <i>playing</i> state, both Animation and SVGImage
+     * updates trigger rendering updates. Note that a change to the document's
+     * current time while in the playing state will cause the animator to seek
+     * to the new time, and continue to play animations forward.
+     *
+     * @throws IllegalStateException if the animator is not currently in
+     *         the <i>stopped</i> or <i>paused</i> state.
+     */
+    public abstract void play();
+
+    /**
+     * Sets the time increment to use for animation rendering.
+     *
+     * @param timeIncrement the minimal time that should ellapse between frame
+     * rendering. In seconds. Should be greater than zero.
+     * @throws IllegalArgumentException if timeIncrement is less than or equal to
+     *         zero.
+     * @see #getTimeIncrement
+     */
+    public abstract void setTimeIncrement(float timeIncrement);
+
+    /**
+     * Sets the <code>SVGEventListener</code> associated with this
+     * <code>SVGAnimator</code>.
+     *
+     * @param svgEventListener the new SVGEventListener which will receive
+     *        events forwarded by this <code>SVGAnimator</code>. May be null,
+     *        in which case events are not forwarded by the <code>SVGAnimator</code>.
+     */
+    public abstract void setSVGEventListener(SVGEventListener svgEventListener);
+
+    /**
+     * Transitions this <code>SVGAnimator</code> to the <i>stopped</i> state.
+     * This causes the <code>SVGAnimator</code> to stop advancing the document's
+     * current time automatically, and no rendering updates are performed while
+     * in <i>stopped</i> state. A call to the <i>play</i> method will cause
+     * the animations to resume from the document's current time.
+     *
+     * @throws IllegalStateException if the animator is not in the <i>playing</i>
+     *         or <i>paused</i> state.
+     */
+    public abstract void stop();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/javax/microedition/m2g/SVGEventListener.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2004 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 javax.microedition.m2g;
+
+/**
+ * The <code>SVGEventListener</code> is used to forward platform specific events
+ * to an application. The application can implement this interface and, in
+ * response, dispatch SVG events on an <code>SVGImage</code> object.
+ * <br />
+ * <br>
+ * <br>
+ * <b>Code example:</b>
+ * <pre>
+ *
+ * // Create an SVGAnimator
+ * SVGImage map = ...; // See the SVGImage documentation.
+ * SVGAnimator svgAnimator = SVGAnimator.createAnimator(map);
+ *
+ * // Create an SVGEventListener and set it on the animator.
+ * MIDPSVGEventListener listener = new MIDPSVGEventListener(map, animator);
+ * svgAnimator.setSVGEventListener(listener);
+ *
+ * //
+ * // SVGEventListener sample implementation. Adds a new
+ * // circle every time a key is pressed.
+ * //
+ * class MIDPSVGEventListener implements SVGEventListener, Runnable {
+ *      protected SVGDocument svgDocument;
+ *      protected SVGAnimator svgAnimator;
+ *      protected Vector addToTree = new Vector();
+ *
+ *      public MIDPSVGEventListener(SVGImage svgImage, SVGAnimator animator) {
+ *          this.svgDocument = svgImage.getDocument();
+ *          this.svgAnimator = svgAnimator;
+ *      }
+ *
+ *      public void keyPressed(int keyCode) {
+ *          SVGElement circle = svgDocument.createElementNS(svgNS, "circle");
+ *          circle.setFloatTrait("cx", ...);
+ *          circle.setFloatTrait("cy", ...);
+ *          // ....
+ *
+ *          // We synchronized access to the addToTree vector because
+ *          // it is accessed from different threads. Because we do
+ *          // no know how fast this runnable is going to be scheduled
+ *          // by the animator, it is possible that multiple circles
+ *          // be created before the run() method is invoked. This explain
+ *          // why we put all the newly created circles in a Vector and why
+ *          // the run method inserts the current content of the vector
+ *          // into the SVG document.
+ *          synchronized (addToTree) {
+ *             addToTree.addElement(circle);
+ *          }
+ *
+ *          svgAnimator.invokeLater(this);
+ *      }
+ *
+ *      public run() {
+ *          synchronized (addToTree) {
+ *              for (int i = 0; i < addToTree.size(); i++) {
+ *                  svgDocument.getDocumentElement().appendChild(
+ *                     (SVGElement) addToTree.elementAt(i));
+ *              }
+ *              addToTree.clear();
+ *          }
+ *      }
+ * }
+ * </pre>
+ *
+ */
+public interface SVGEventListener
+{
+    /**
+     * Invoked by the SVG implementation when the associated component is
+     * hidden.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.hideNotify</code> method is invoked.
+     *
+     * On AWT, this method is invoked when the <code>java.awt.event.ComponentEvent</code>
+     * with type <code>java.awt.event.ComponentEvent.COMPONENT_HIDDEN</code> is
+     * invoked on a <code>java.awt.Component</code>'s component listener.
+     *
+     */
+    void hideNotify();
+
+    /**
+     * Invoked by the SVG implementation when a key was pressed while the
+     * component associated with the <code>SVGAnimator</code> had focus.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.keyPressed()</code> method is
+     * invoked.
+     *
+     * On AWT, this method is invoked when the
+     * <code>java.awt.event.KeyListener.keyPressed()</code> method is invoked on
+     * a <code>java.awt.Component</code>'s key listener.
+     *
+     * @param keyCode the code of the key that was pressed. For MIDP, the code
+     * is the same as for the <code>javax.microedition.lcdui.Canvas</code>
+     * <code>keyPressed</code> <code>keyCode</code> argument.  For AWT, the code
+     * is the same as in the <code>java.awt.event.KeyEvent.getKeyCode()</code>
+     * method.
+     */
+    void keyPressed(int keyCode);
+
+    /**
+     * Invoked by the SVG implementation when a key was released while the
+     * component associated with the <code>SVGAnimator</code> had focus.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.keyReleased()</code> method is
+     * invoked.
+     *
+     * On AWT, this method is invoked when the
+     * <code>java.awt.event.KeyListener.keyReleased()</code> method is invoked on
+     * a <code>java.awt.Component</code>'s key listener.
+     *
+     * @param keyCode the code of the key that was pressed. For MIDP, the code
+     * is the same as for the <code>javax.microedition.lcdui.Canvas</code>
+     * <code>keyReleased</code> <code>keyCode</code> argument.  For AWT, the code
+     * is the same as in the <code>java.awt.event.KeyEvent.getKeyCode()</code>
+     * method.
+     */
+    void keyReleased(int keyCode);
+
+    /**
+     * Invoked by the SVG implementation when the pointer device (if any), is
+     * pressed over the component associated with the <code>SVGAnimator</code>.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.pointerPressed()</code> method is
+     * invoked. Note that pointer events are only supported on MIDP if the
+     * platform supports them, as defined by the
+     * <code>Canvas.hasPointerEvents</code> method.
+     *
+     * On AWT, this method is invoked when the
+     * <code>java.awt.event.MouseListener.mousePressed()</code> method is invoked on
+     * a <code>java.awt.Component</code>'s mouse listener.
+     *
+     * @param x the x-axis coordinate, in the target component's space (i.e.,
+     * relative to the upper left corner of the component associated with the
+     * <code>SVGAnimator</code>.  On MIDP, this is the same value as passed to the
+     * <code>javax.microedition.midp.Canvas.pointerPressed()</code> method.  On
+     * AWT, this is the same value as returned from the
+     * <code>java.awt.event.MouseEvent.getX()</code> method.
+     *
+     * @param y the y-axis coordinate, in the target component's space (i.e.,
+     * relative to the upper left corner of the component associated with the
+     * <code>SVGAnimator</code>.  On MIDP, this is the same value as passed to the
+     * <code>javax.microedition.midp.Canvas.pointerPressed()</code> method.  On
+     * AWT, this is the same value as returned from the
+     * <code>java.awt.event.MouseEvent.getY()</code> method.
+     */
+    void pointerPressed(int x, int y);
+
+    /**
+     * Invoked by the SVG implementation when the pointer device (if any), is
+     * released over the component associated with the <code>SVGAnimator</code>.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.pointerReleased()</code> method is
+     * invoked. Note that pointer events are only supported on MIDP if the
+     * platform supports them, as defined by the
+     * <code>Canvas.hasPointerEvents</code> method.
+     *
+     * On AWT, this method is invoked when the
+     * <code>java.awt.event.MouseListener.mouseReleased()</code> method is invoked on
+     * a <code>java.awt.Component</code>'s mouse listener.
+     *
+     * @param x the x-axis coordinate, in the target component's space (i.e.,
+     * relative to the upper left corner of the component associated with the
+     * <code>SVGAnimator</code>.  On MIDP, this is the same value as passed to the
+     * <code>javax.microedition.midp.Canvas.pointerReleased()</code> method.  On
+     * AWT, this is the same value as returned from the
+     * <code>java.awt.event.MouseEvent.getX()</code> method.
+     *
+     * @param y the y-axis coordinate, in the target component's space (i.e.,
+     * relative to the upper left corner of the component associated with the
+     * <code>SVGAnimator</code>.  On MIDP, this is the same value as passed to the
+     * <code>javax.microedition.midp.Canvas.pointerReleased()</code> method.  On
+     * AWT, this is the same value as returned from the
+     * <code>java.awt.event.MouseEvent.getY()</code> method.
+     */
+    void pointerReleased(int x, int y);
+
+    /**
+     * Invoked by the SVG implementation when the associated component is
+     * shown.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.showNotify</code> method is invoked.
+     *
+     * On AWT, this method is invoked when the <code>java.awt.event.ComponentEvent</code>
+     * with type <code>java.awt.event.ComponentEvent.COMPONENT_SHOWN</code> is
+     * invoked on a <code>java.awt.Component</code>'s component listener.
+     *
+     */
+    void showNotify();
+
+    /**
+     * Invoked by the SVG implementation when the associated component is
+     * resized.
+     *
+     * On MIDP, this method is invoked when the
+     * <code>javax.microedition.lcdui.Canvas.sizeChanged</code> method is invoked.
+     *
+     * On AWT, this method is invoked when the <code>java.awt.event.ComponentEvent</code>
+     * with type <code>java.awt.event.ComponentEvent.COMPONENT_RESIZED</code> is
+     * invoked on a <code>java.awt.Component</code>'s component listener.
+     *
+     * @param width the new component width.
+     * @param height the new component height.
+     */
+    void sizeChanged(int width, int height);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/javax/microedition/m2g/SVGImage.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,294 @@
+/*
+* Copyright (c) 2004 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 javax.microedition.m2g;
+
+//--------------------------------------------------
+//Imports
+//--------------------------------------------------
+import java.io.*;
+import java.io.InputStream;
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.svg.SVGElement;
+import com.nokia.microedition.m2g.M2GSVGImage;
+
+/**
+* This class represents an SVG image conforming to the W3C SVG Tiny 1.1 Profile. Applications can access the Document
+* associated with this SVGImage using <code>getDocument</code> method. Using the <code>Document</code> class,
+* it is possible to interact with the content and perform operations such as zoom, pan, and rotate
+* apart from various other functions. The event dispatching methods as described
+* in this class must be used for dispatching user specific events to the underlying SVG engine.
+*
+* <p>
+* The width and height values specified in the SVGImage are only used to compute the initial viewport width/height.
+* It is also important to note that according to the SVG 1.1 specification, if viewBox is not defined, then
+* the preserveAspectRatio attribute is ignored. Therefore, the contents should not be scaled if there is no
+* viewBox defined.
+* </p>
+* <p><b>Note:</b> If the application does not have the necessary privilege rights to access this (SVG)
+* content, a SecurityException may be thrown by the underlying implementation. This is applicable
+* to all the tree navigation (see {@link org.w3c.dom.Node Node}) and trait acessor methods (see {@link org.w3c.dom.svg.SVGElement SVGElement}).
+* Features such as zooming, panning and playing of animations will not be affected.
+* <p>
+* Here is the list of events supported in this specification:
+* <p>
+* <table  cellpadding="2" cellspacing="2" border="1"
+ *  style="border-collapse: collapse;">
+ *   <tbody>
+ *     <tr>
+ *       <th width="150" valign="top" bgcolor="#999999"><b>Events<br>
+ *       </b> </th>
+ *       <th valign="top" bgcolor="#999999"><b>Description<br>
+ *       </b> </th>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top"> <b>"DOMFocusIn"</b><br>
+ *       </td>
+ *       <td valign="top"> Occurs when the element comes into focus.<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top"> <b>"DOMFocusOut"</b><br>
+ *       </td>
+ *       <td valign="top"> Occurs when an element goes out of focus.<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top"> <b>"DOMActivate"</b><br>
+ *       </td>
+ *       <td valign="top"> Occurs when an element is activated, for instance, through a keypress (select)<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top"> <b>"click"</b><br>
+ *       </td>
+ *       <td valign="top"> Occurs when the pointing device button is clicked over the SVG content (or particular SVGElement) <br>
+ *       </td>
+ *     </tr>
+ *   </tbody>
+ * </table>
+* @see      javax.microedition.m2g.ScalableImage
+* @see      org.w3c.dom.Document
+*/
+
+public class SVGImage extends ScalableImage
+{
+    //--------------------------------------------------
+    // VARIABLES
+    //--------------------------------------------------
+    private M2GSVGImage iImg = null;
+
+    /**
+     * Constructor
+     */
+    protected SVGImage()
+    {
+        super();
+    }
+
+    /**
+     * This method is used to dispatch an "DOMActivate" event to the document.
+     * The element that has focus is activated, which means that a
+     * "DOMActivate" event with the the currently focused element as target is
+     * dispatched. If no element has focus, this method does not do anything
+     * and no event is dispatched.
+     */
+    public void activate()
+    {
+        iImg.activate();
+    }
+
+    /**
+     * This method creates and loads an empty SVGImage (skeleton) that can be used to
+     * programatically construct a simple SVG image. Note: A root &lt;svg&gt; element
+     * with default viewport size of 100x100 is also created inside this method.
+     *
+     * <p>If an handler is specified, the engine will invoke it for any external resource
+     * referenced in the document. If the handler is set to null, the SVGImage will try to
+     * load images automatically using the engine default implementation,but might not be
+     * able to load all of them.</p>
+     *
+     * <p>Note that the <code>handler</code> is also called when the xlink:href attribute on
+     * &lt;image&gt; is set or changed by the application, but the call is made only when the
+     * element is hooked into the document tree i.e. when the ancestors go all the way up to
+     * the root &lt;svg&gt; element. There are two cases:
+     * <ul>
+     * <li>When changing the xlink:href attribute of an existing &lt;image&gt; element that is already hooked or part of the tree.</li>
+     * <li>When creating a new &lt;image&gt;, setting its xlink:href and hooking it to the document tree.</li>
+     * </ul>
+     * </p>
+     *
+     * @param handler implementation of the ExternalResourceHandler interface
+     * @see      javax.microedition.m2g.ExternalResourceHandler
+     *
+     * @return an empty SVGImage
+     */
+    public static SVGImage createEmptyImage(ExternalResourceHandler handler)
+    {
+        M2GSVGImage image = M2GSVGImage.buildEmptyImage(handler);
+        if (image == null)
+        {
+            throw new NullPointerException();
+        }
+        SVGImage proxy = new SVGImage();
+        proxy.iImg = image;
+        return proxy;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public static ScalableImage createImage(
+        InputStream stream, ExternalResourceHandler handler) throws IOException
+    {
+        M2GSVGImage image = M2GSVGImage.buildImage(stream, handler, null, null);
+        if (image == null)
+        {
+            throw new NullPointerException();
+        }
+        SVGImage proxy = new SVGImage();
+        proxy.iImg = image;
+        return proxy;
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public static ScalableImage createImage(
+        String url, ExternalResourceHandler handler) throws IOException
+    {
+        M2GSVGImage image = M2GSVGImage.buildImage(url, handler);
+        if (image == null)
+        {
+            throw new NullPointerException();
+        }
+        SVGImage proxy = new SVGImage();
+        proxy.iImg = image;
+        return proxy;
+    }
+
+    /**
+     * This method is used to dispatch a mouse event of the specified <code>type</code> to the
+     * document. The mouse position is given as screen coordinates <code>x, y</code>. If the
+     * x, y values are outside the viewport area or no target is available for the x, y
+     * coordinates, the event is not dispatched. Note that when a "click" event is dispatched,
+     * a "DOMActivate" is automatically dispatched by the underlying implementation. The only
+     * required mouse event type is "click". Therefore, if an unsupported type is specified,
+     * a DOMException with error code NOT_SUPPORTED_ERR is thrown.
+     *
+     *
+     * @param type the type of mouse event.
+     * @param x the x location of the mouse/pointer in viewport coordinate
+     *        system.
+     * @param y the y location of the mouse/pointer in viewport coordinate
+     *        system.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR: if the event <code>type</code> is not supported.
+     * @throws NullPointerException if <code>type</code> is null.
+     * @throws IllegalArgumentException if the x or y values are negative.
+     *
+     */
+    public void dispatchMouseEvent(String type, int x, int y) throws DOMException
+    {
+        iImg.dispatchMouseEvent(type, x, y);
+    }
+
+    /**
+     * Returns the associated <code>Document</code>.
+     * @return the associated <code>Document</code>.
+     */
+    public Document getDocument()
+    {
+        return iImg.getDocument();
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public int getViewportHeight()
+    {
+        return iImg.getViewportHeight();
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public int getViewportWidth()
+    {
+        return iImg.getViewportWidth();
+    }
+
+    /**
+     * This method triggers a "DOMFocusIn" event with the specified element as
+     * the event target. That element becomes the element with focus. This
+     * method also triggers a "DOMFocusOut" event with the element which
+     * previous had focus as target. When the activate method is called, a
+     * "DOMActivate" event is triggered with the currently focused element as
+     * the target. The initial focus is always <code>null</code> and setting
+     * <code>null</code> will remove the current focus.
+     *
+     * @param element the element to set the focus on.
+     * @throws DOMException with error code WRONG_DOCUMENT_ERR: if invalid element is passed (for
+     * ex: an element that does not belong to this document).
+     */
+    public void focusOn(SVGElement element)  throws DOMException
+    {
+        iImg.focusOn(element);
+    }
+
+    /**
+     * Increments the animation or media timeline for this SVGImage (in seconds). As the name
+     * implies, this method is intended to move only forward in the timeline and typically should be used
+     * to animate SVG content when the SVGAnimator class in not used. Setting negative values will throw
+     * an Exception. It is important to note that setting large increments of time would result in
+     * skipping parts of the animation as per the SVG animation model.
+     *
+     * @param seconds the value of time to increment in seconds.
+     * @throws IllegalArgumentException if the specified time is negative.
+     */
+    public void incrementTime(float seconds)
+    {
+        iImg.incrementTime(seconds);
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public void requestCompleted(
+        String URI, InputStream resourceData) throws IOException
+    {
+        iImg.requestCompleted(URI, resourceData);
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public void setViewportHeight(int height)
+    {
+        iImg.setViewportHeight(height);
+    }
+
+    /**
+     * @see javax.microedition.m2g.ScalableImage
+     */
+    public void setViewportWidth(int width)
+    {
+        iImg.setViewportWidth(width);
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/javax/microedition/m2g/ScalableGraphics.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2005 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 javax.microedition.m2g;
+
+import com.nokia.microedition.m2g.M2GScalableGraphics;
+
+/**
+ * This is the fundamental class for 2D rendering. The ScalableGraphics context class
+ * provides and handles all the rendering capability within this package. In other
+ * words, the rendering can only be achieved through the render method provided
+ * in this class. Note that the ScalableGraphics instance must be bound to the rendering
+ * target prior to calling the render method. The implementation must clip to the
+ * viewport boundaries.
+*/
+public class ScalableGraphics
+{
+    // Defines a low rendering quality level.
+    public static final int RENDERING_QUALITY_LOW = 1;
+    // Defines a high rendering quality level.
+    public static final int RENDERING_QUALITY_HIGH = 2;
+
+    private M2GScalableGraphics iSg;
+
+    /**
+     *  Constructor
+     */
+    private ScalableGraphics()
+    {
+				
+        iSg = new M2GScalableGraphics();
+        
+    }
+
+    /**
+     * Binds the given Graphics as the rendering target of this ScalableGraphics context. The
+     * type of the Graphics object depends on the Java profile that this specification is
+     * implemented on, as follows:
+     * <ul>
+     * <li> javax.microedition.lcdui.Graphics on profiles supporting LCDUI;</li>
+     * <li> java.awt.Graphics on profiles supporting AWT;</li>
+     * <li> either of the above on profiles supporting both AWT and LCDUI.</li>
+     * </ul>
+     * @param target the object (Graphics) to receive the rendered image.
+     * @throws NullPointerException if <code>target</code> is null.
+     * @throws IllegalArgumentException if <code>target</code> is invalid.
+     * @throws IllegalStateException if <code>target</code> is already bound.
+     */
+    public void bindTarget(java.lang.Object target)
+    {
+    		
+        iSg.bindTarget(target);
+        
+    }
+
+    /**
+     * Retrieve a new instance of ScalableGraphics that can be associated to
+     * an application.
+     * <p>
+     * @return the newly created <code>ScalableGraphics</code> instance.
+     */
+    public static ScalableGraphics createInstance()
+    {
+        return new ScalableGraphics();
+    }
+
+    /**
+     * Flushes the rendered ScalableImage to the currently bound target and then releases
+     * the target. This ensures that the ScalableImage is actually made visible on the target
+     * that was set in bindTarget. Otherwise, the image may or may not become visible.
+     * @throws IllegalStateException if <code>target</code> is not bound.
+     */
+    public void releaseTarget()
+    {
+				
+        iSg.releaseTarget();
+     		
+    }
+
+    /**
+     * Renders the specified ScalableImage using the supplied anchor point. The anchor point given
+     * is relative to the upper left corner of the rendering surface. It is important to note that
+     * the content is made visible or flushed to the display only after a call is made to
+     * <code>releaseTarget</code>.
+     * @param x the X coordinate of the anchor point, in pixels.
+     * @param y the Y coordinate of the anchor point, in pixels.
+     * @param image the ScalableImage to be rendered.
+     * @throws NullPointerException if <code>image</code> is null.
+     * @throws IllegalStateException if <code>target</code> is not bound.
+     * @see #releaseTarget
+     */
+    public void render(int x, int y, ScalableImage image)
+    {
+    		
+        iSg.render(x,y, image);
+        
+    }
+
+    /**
+     * Set the quality of rendering in the ScalableGraphics context. It can take one of the values,
+     * RENDERING_QUALITY_LOW or RENDERING_QUALITY_HIGH. Default=RENDERING_QUALITY_HIGH. The
+     * implementation of these quality levels is implementation dependent and should be mapped
+     * to definitions in SVG spec (shape, text, image and color rendering).
+     * @param mode this value indicates the quality of rendering required.
+     * @throws IllegalArgumentException if the <code>mode</code> is invalid.
+     */
+
+    public void setRenderingQuality(int mode)
+    {
+        iSg.setRenderingQuality(mode);
+    }
+
+    /**
+     * Set the transparency in the ScalableGraphics context with the supplied alpha value.
+     * Alpha value must be a floating point number in the range [0.0, 1.0]. The source pixels
+     * are always combined with destination pixels using the <i>Source Over Destination</i>
+     * rule [Porter-Duff]. In this context, the Source Over Destination rule has the following
+     * properties: a fully opaque pixel in the source must replace the destination pixel, a
+     * fully transparent pixel in the source must leave the destination pixel unchanged, and
+     * a semitransparent pixel in the source must be alpha blended with the destination pixel using
+     * the supplied value. The default alpha value is 1.0 (fully opaque), when not specified.
+     *
+     * @param alpha the constant alpha value to be used for rendering.
+     *
+     * @throws IllegalArgumentException if <code>alpha</code> is out of range.
+     */
+    public void setTransparency(float alpha)
+    {
+        iSg.setTransparency(alpha);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/javax/microedition/m2g/ScalableImage.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2004 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 javax.microedition.m2g;
+
+import java.io.IOException;
+
+/**
+ * This class models images in vector format, such as the Scalable Vector
+ * Graphics (SVG) image format.  Therefore, it is required that all classes
+ * representing "scalable" images extend this class.
+ * @see      javax.microedition.m2g.SVGImage
+ */
+public abstract class ScalableImage
+{
+    /**
+     * Constructor
+     */
+    protected ScalableImage()
+    {
+    }
+
+    /**
+     * This method creates and loads a ScalableImage (e.g. SVG) from the specified stream.
+     * A ScalableImage can only be rendered using the render() method in the ScalableGraphics
+     * context.The image size is determined by the content specification
+     * (eg: width/height attributes on root SVG element). The default viewport size
+     * of 100-by-100 pixels is used when the size is unspecified. This method will throw an exception
+     * when the image is in error. For SVG document, the document is in error when:
+     * <ul>
+     * <li>the SVG document does not conform to the XML 1.0 specification</li>
+     * <li>an element has an attribute or property value which is not permissible according to the SVG specification </li>
+     * <li>the required or mandatory attributes according to the SVG specification are missing</li>
+     * <li>the document contains circular references on the &lt;use&gt; element</li>
+     * <li>the document contains &lt;image&gt; element(s) with local references </li>
+     * <li>the document contains elements with duplicate Id's</li>
+     * <li>the document contains animation(s) in error</li>
+     * </ul>
+     *
+     * <p>If an <code>handler</code> is specified, the engine will invoke it for any
+     * external resource referenced in the document. However, please note that data URIs
+     * (for ex: base64 encoded images like &lt;image xlink:href="data:image/png;base64,/9j/4AAQ..."/&gt;)
+     * are required to be decoded by the engine, and therefore the handler will not be invoked
+     * in such cases. All these requests must occur before createImage returns, and the
+     * engine must only make one call if there exist multiple resources
+     * with the same URI. If the <code>handler</code> is set to null, the ScalableImage
+     * will try to load images automatically using the engine's default implementation,
+     * but might not be able to load all of them. For example, if the ScalableImage
+     * is loaded from a file in a Jar file, the implementation will not be able
+     * to load images that have relative URIs (ex; &lt;image xlink:href="myImage.png" /&gt;).
+     * If the handler is not able to locate a requested resource, it informs the SVG engine
+     * by calling the requestCompleted method with <code>null</code> for resourceData. </p>
+     *
+     * <p>Note that the <code>handler</code> is also called when the xlink:href attribute on
+     * &lt;image&gt; is set or changed by the application, but the call is made only when the
+     * element is hooked into the document tree i.e. when the ancestors go all the way up to
+     * the root &lt;svg&gt; element. There are two cases:
+     * <ul>
+     * <li>When changing the xlink:href attribute of an existing &lt;image&gt; element that is already hooked or part of the tree.</li>
+     * <li>When creating a new &lt;image&gt;, setting its xlink:href and hooking it to the document tree.</li>
+     * </ul>
+     * </p>
+     *
+     * @param stream The stream from which the SVG content should be read.
+     * @param handler implementation of the ExternalResourceHandler interface
+     * @see      javax.microedition.m2g.ExternalResourceHandler
+     *
+     * @return the loaded ScalableImage.
+     * @throws IOException if an error occurs while loading the content.
+     * @throws NullPointerException if <code>stream</code> is null.
+     */
+    public static ScalableImage createImage(java.io.InputStream stream,
+                                            ExternalResourceHandler handler) throws IOException
+    {
+        return SVGImage.createImage(stream, handler);
+    }
+
+
+    /**
+     * This method creates and loads a ScalableImage (e.g. SVG) with the specified
+     * URI. A ScalableImage can only be rendered using the render() method in the ScalableGraphics
+     * context.The image size is determined by the content specification
+     * (eg: width/height attributes on root SVG element). The default viewport size
+     * of 100-by-100 pixels is used when the size is unspecified. This method will throw an
+     * exception when the image is in error. For SVG document, the document is in error when:
+     * <ul>
+     * <li>the SVG document does not conform to the XML 1.0 specification</li>
+     * <li>an element has an attribute or property value which is not permissible according to the SVG specification </li>
+     * <li>the required or mandatory attributes according to the SVG specification are missing</li>
+     * <li>the document contains circular references on the &lt;use&gt; element</li>
+     * <li>the document contains &lt;image&gt; element(s) with local references </li>
+     * <li>the document contains elements with duplicate Id's</li>
+     * <li>the document contains animation(s) in error</li>
+     * </ul>
+     *
+     *
+     * <p>If an <code>handler</code> is specified, the engine will invoke it for any
+     * external resource referenced in the document. However, please note that data URIs
+     * (for ex: base64 encoded images like &lt;image xlink:href="data:image/png;base64,/9j/4AAQ..."/&gt;)
+     * are required to be decoded by the engine, and therefore the handler will not be invoked
+     * in such cases. All these requests must occur before createImage returns, and the
+     * engine must only make one call if there exist multiple resources
+     * with the same URI. If the <code>handler</code> is set to null, the ScalableImage
+     * will try to load images automatically using the engine's default implementation,
+     * but might not be able to load all of them. For example, if the ScalableImage
+     * is loaded from a file in a Jar file, the implementation will not be able
+     * to load images that have relative URIs (ex: &lt;image xlink:href="myImage.png" /&gt;).
+     * If the handler is not able to locate a requested resource, it informs the SVG engine
+     * by calling the requestCompleted method with <code>null</code> for resourceData. </p>
+     *
+     * <p>Note that the <code>handler</code> is also called when the xlink:href attribute on
+     * &lt;image&gt; is set or changed by the application, but the call is made only when the
+     * element is hooked into the document tree i.e. when the ancestors go all the way up to
+     * the root &lt;svg&gt; element. There are two cases:
+     * <ul>
+     * <li>When changing the xlink:href attribute of an existing &lt;image&gt; element that is already hooked or part of the tree.</li>
+     * <li>When creating a new &lt;image&gt;, setting its xlink:href and hooking it to the document tree.</li>
+     * </ul>
+     * </p>
+     *
+     * <p>
+     * If the platform implementation supports the JSR-75 FileConnection, then the file: URLs
+     * as used by JSR-75 shall be supported and the images are loaded from files identified
+     * by this locator. This can be used to load possible DRM protected image files from the
+     * file system.
+     *
+     * @param url A string in URL syntax that identifies the image source.
+     * @param handler implementation of the ExternalResourceHandler interface
+     * @see      javax.microedition.m2g.ExternalResourceHandler
+     *
+     * @return the loaded ScalableImage
+     * @throws IOException if an error occurs while loading the SVG content.
+     * @throws NullPointerException if <code>URL</code> is null.
+     * @throws java.lang.IllegalArgumentException if the specified locator is of unsupported type.
+     * @throws SecurityException if the application does not have the privilege rights to access
+     * the contents of this resource.
+     *
+     */
+    public static ScalableImage createImage(String url,
+                                            ExternalResourceHandler handler) throws IOException
+    {
+        return SVGImage.createImage(url, handler);
+    }
+
+    /**
+     * This method returns the ScalableImage's viewport height. The initial
+     * viewport height is taken from the "height" value specified in the Scalable Image. The value
+     * returned is always in pixels. If the specified height is defined in percentages, the
+     * values are mapped to the default view port size of 100x100. If the viewport height
+     * is explicitly changed by the application, then the percentages are ignored and the content
+     * is made to fit to this new viewport height.
+     *
+     * @return the current height of this ScalableImage.
+     * @see #setViewportHeight
+     */
+    public abstract int getViewportHeight();
+
+    /**
+     * This method returns the ScalableImage's viewport width. The initial
+     * viewport width is taken from the "width" value specified in the Scalable Image. The value
+     * returned is always in pixels. If the specified width is defined in percentages, the
+     * values are mapped to the default view port size of 100x100. If the viewport width
+     * is explicitly changed by the application, then the percentages are ignored and the content
+     * is made to fit to this new viewport width.
+     *
+     * @return the current width of this ScalableImage.
+     * @see #setViewportWidth
+     */
+    public abstract int getViewportWidth();
+
+    /**
+    * Once the requested external resource is available, the application forwards this information
+    * (resourceData) to the SVG engine. If this method is called a second time for a same URL of a
+    * same <code>SVGImage</code>, the engine will replace the current resource data with the new
+    * one. <b>Note:</b> Setting <code>null</code> for resourceData indicates that the requested resource
+    * could not be fetched by the <code>ResourceHandler</code> or application, and in this
+    * event the SVG engine will not make further attempts to load this resource.
+    *
+    * @param URI URI that was requested through requestExternalResource
+    * @param resourceData inputstream containing the external resource
+    *
+    * @see      javax.microedition.m2g.ExternalResourceHandler
+    *
+    * @throws IOException if an error occurs while loading the resource.
+    * @throws NullPointerException if URL is null.
+    */
+    public abstract void requestCompleted(String URI, java.io.InputStream resourceData) throws IOException;
+
+    /**
+     * This method sets the new (viewport) height of this ScalableImage.
+     *
+     * @param height the new height to be set.
+     * @see #getViewportHeight
+     * @throws IllegalArgumentException if height is negative.
+     */
+    public abstract void setViewportHeight(int height);
+
+    /**
+     * This method sets the new (viewport) width of this ScalableImage.
+     * The viewport is the area where the ScalableImage is rendered. Any parts
+     * of the viewport that lie outside the boundaries of the target clipping
+     * rectangle are clipped. The viewport upper left corner (x, y) is given
+     * relative to the upper left corner of the target rendering surface.
+     *
+     * @param width the new width to be set.
+     * @see #getViewportWidth
+     * @throws IllegalArgumentException if width is negative.
+     */
+    public abstract void setViewportWidth(int width);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/DOMException.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* 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:
+*
+*/
+
+package org.w3c.dom;
+
+/**
+ *
+ */
+public class DOMException extends RuntimeException
+{
+
+    /**
+     * If a node is used in a different document than the one that created it
+     * (that doesn't support it).
+     */
+    public static final short WRONG_DOCUMENT_ERR          = 4;
+
+    /**
+     * If index or size is negative, or greater than the allowed value.
+     */
+    public static final short INDEX_SIZE_ERR = 1;
+
+    /**
+     * If any Node is inserted somewhere it doesn't belong.
+     */
+    public static final short HIERARCHY_REQUEST_ERR = 3;
+
+    /**
+     * If an attempt is made to modify an object where modifications are not allowed.
+     */
+    public static final short NO_MODIFICATION_ALLOWED_ERR = 7;
+
+    /**
+     * If an attempt is made to reference a {@link org.w3c.dom.Node Node} in a context where it does not exist. See {@link org.w3c.dom.Node#insertBefore insertBefore} for example.
+     */
+    public static final short NOT_FOUND_ERR = 8;
+
+    /**
+     * If the implementation does not support the requested type of object or operation.
+     */
+    public static final short NOT_SUPPORTED_ERR = 9;
+
+    /**
+     * If an attempt is made to use an object that is not, or is no longer, usable.
+     */
+    public static final short INVALID_STATE_ERR = 11;
+
+    /**
+     * If an attempt is made to modify the type of the underlying object.
+     */
+    public static final short INVALID_MODIFICATION_ERR = 13;
+
+    /**
+     * If a parameter or an operation is not supported by the underlying object.
+     */
+    public static final short INVALID_ACCESS_ERR = 15;
+
+    /**
+     * If the type of an object is incompatible with the expected type of the parameter associated to the object.
+     */
+    public static final short TYPE_MISMATCH_ERR = 17;
+
+    /**
+     *
+     * The member variable to store exception's code, like INVALID_ACCESS_ERR.
+     */
+    public short code;
+
+    /**
+     * Constructs a DOMException with a detailed message.
+     *
+     * @param code the exception's error code.
+     * @param message the exception's descriptive message.
+     */
+    public DOMException(final short code,
+                        final String message)
+    {
+        super(message);
+        this.code = code;
+    }
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/Document.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,105 @@
+/*
+* 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:
+*
+*/
+
+package org.w3c.dom;
+
+/**
+ * The Document interface represents an XML Document.
+ *
+ * <p>This interface is a subset of the Document interface defined
+ * in the <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html">
+ * DOM Level 3 Core</a>.</p>
+ *
+ *
+ * <p>Note the behavior of the following methods from the
+ * <code>Node</code> interface when called on a <code>Document</code>
+ * object:
+ *
+ * <ul>
+ * <li>getParentNode returns <code>null</code></li>
+ * <li>appendChild throws <code>HIERARCHY_REQUEST_ERR</code></li>
+ * <li>insertBefore throws <code>HIERARCHY_REQUEST_ERR</code></li>
+ * <li>removeChild throws <code>NOT_SUPPORTED_ERR</code></li>
+ * </ul>
+ * </p>
+ *
+ */
+public interface Document extends Node
+{
+
+    /**
+     * Create a new <code>Element</code> based on the specified
+     * (qualified) SVG tag name. This JSR does not require multiple
+     * namespaces and may throw a <code>DOMException</code> with a
+     * code of <code>NOT_SUPPORTED_ERR</code> if the URI is not the
+     * SVG namespace URI, or if the specified name is not a valid SVG
+     * Tiny element name. Only the following elements must be supported:
+     * &lt;rect&gt;, &lt;circle&gt;, &lt;ellipse&gt;, &lt;line&gt;,
+     * &lt;path&gt; &lt;use&gt; &lt;image&gt; &lt;text&gt;,
+     * &lt;a&gt; and &lt;g&gt;.
+     *
+     * @param namespaceURI the namespace uri for the newly created
+     * element. This should always be the SVG namespace URI "http://www.w3.org/2000/svg".
+     * @param qualifiedName the qualified name for the newly created
+     * element (For example: "rect", to create a &lt;rect&gt; element)
+     *
+     * @return the newly created SVG Element.
+     *
+     * @throws DOMException NOT_SUPPORTED_ERR if the type of element is
+     * not supported by the implementation. JSR 226 only requires creation
+     * support for some of the SVG namespace elements and only for a limited
+     * number of local names in that namespace (see above documentation).Therefore, in
+     * a conformant JSR 226 implementation, trying to create elements with a namespace
+     * URIs other than the SVG namespace URI and with a qualified name not in the list
+     * of required qualified names may result in this exception being thrown.
+     * @throws NullPointerException if <code>namespaceURI</code> or
+     * <code>qualifiedName</code> is null.
+     *
+     */
+    public Element createElementNS(String namespaceURI, String qualifiedName)
+    throws DOMException;
+
+    /**
+     * Return a child element of this document Node which corresponds to the top-most
+     * tag in XML file. For SVG files it must be <code>SVGSVGElement</code>, but return
+     * type is Element for DOM Core compatibility and to allow for future extensions.
+     *
+     * @return the root <code>Element</code> associated with this
+     * document.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public Element getDocumentElement();
+
+    /**
+     * Return the <code>Element</code> in the current document with
+     * the given unique ID. If no such element exists, this returns null.
+     *
+     * @param id the ID of the object to be retrieved.
+     * @return the Element that matches with the given ID or
+     * <code>null</code> if the ID is not present.
+     *
+     * @throws NullPointerException if id is null
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public Element getElementById(String id);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/Element.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom;
+
+
+/**
+ * This empty interface is defined to ensure compatibility with the DOM
+ * specification, and also to be used as a return type of some Document
+ * methods.
+ *
+ */
+public interface Element extends Node
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/Node.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* 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:
+*
+*/
+
+package org.w3c.dom;
+
+/**
+ * The Node interface describes generic nodes in an SVG document tree.
+ *
+ * <p>This interface is a subset of the Node interface defined
+ * in the <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html">
+ * DOM Level 3 Core</a>.</p>
+ *
+ */
+
+public interface Node
+{
+
+
+    /**
+     * Returns the namespace URI of the Node.
+     *
+     * @return the namespace URI of the Node.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public String getNamespaceURI();
+
+    /**
+     * Returns the local part of the qualified name of this node. If the node is of type SVGElement, this returns the tag name without a prefix.
+     * But, if the node is of type Document then <code>null</code> is returned.
+     * @return the local part of the qualified name of this node.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public String getLocalName();
+
+    /**
+     * Returns the parent <code>Node</code> of this <code>Node</code>.
+     *
+     * @return the parent node or null if there is no parent (i.e. if a node has
+     * just been created and not yet added to the tree, or if it has been removed
+     * from the tree, this is null).
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public Node getParentNode();
+
+    /**
+     * Appends a child to this <code>Node</code>.
+     *
+     * @param newChild the <code>Node</code> to be appended to this
+     * <code>Node</code>. This is equivalent to insertBefore(newChild,null)
+     * @return the added <code>Node</code>.
+     *
+     * @throws DOMException with error code HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children
+     * of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself,
+     * or if this node is of type Document and the DOM application attempts to append a second Element node.
+     * @throws DOMException with error code WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than
+     * the one that created this node.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR: if the newChild node is a child of the Document node or if the
+     * child is of a type that cannot be created with createElementNS.
+     * @throws DOMException with error code INVALID_STATE_ERR: if the newChild node would cause the document to go into
+     * error, for ex: when the newChild contains a &lt;use&gt; element with an invalid xlink:href attribute.
+     * @throws NullPointerException if <code>newChild</code> is null.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public Node appendChild(Node newChild) throws DOMException;
+
+    /**
+     * Removes the specified child associated with this Node. Elements that have ids cannot be
+     * removed from the tree.
+     *
+     * @param oldChild the <code>Node</code> that is to be removed.
+     * @return the node removed.
+     * @throws DOMException with error code NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR: if this node is of type Document or if the
+     * child, or any of its descendants, is of a type that cannot be created with createElementNS.
+     * @throws DOMException with error code INVALID_ACCESS_ERR: if the element being removed or one of its decendants
+     * have non-null id.
+     * @throws NullPointerException if <code>oldChild</code> is null.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public Node removeChild(Node oldChild) throws DOMException;
+
+    /**
+    * Inserts newChild before refChild in the child list for this node. If refChild is null,
+    * newChild is inserted at the end of the list. If the newChild is already part of the
+    * tree, it is first removed.
+    *
+    *
+    * @param newChild the child to add
+    * @param refChild the child before which the new child should be added.
+    * @return the node being inserted.
+    * @throws DOMException with error code HIERARCHY_REQUEST_ERR: if this node is of a type that does not allow children
+    *   of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself,
+    *   or if this node is of type Document and the DOM application attempts to append a second Element node.
+    * @throws DOMException with error code WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than
+    * the one that created this node.
+    * @throws DOMException with error code NOT_FOUND_ERR: raised if refChild is not a child of this node.
+    * @throws DOMException with error code NOT_SUPPORTED_ERR: if the newChild node is a child of the Document node or if the
+    * child is of a type that cannot be created with createElementNS.
+    * @throws DOMException with error code INVALID_STATE_ERR: if the newChild node would cause the document to go into
+    * error, for ex: when the newChild contains a &lt;use&gt; element with an invalid xlink:href attribute.
+    * @throws NullPointerException if <code>newChild</code> is null.
+    * @throws SecurityException if the application does not have the necessary privilege rights
+    * to access this (SVG) content.
+    */
+
+    public Node insertBefore(Node newChild, Node refChild) throws DOMException;
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/events/Event.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.events;
+
+import java.lang.String;
+
+/**
+ * The Event interface is used to provide contextual information about an event to the handler
+ * processing the event. An object which implements the Event interface is passed as the first
+ * parameter to the {@link org.w3c.dom.events.EventListener#handleEvent handleEvent} call. If
+ * an event target is an element instance (see <a href="http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGElementInstance">SVGElementInstance</a>), the currentTarget is an implementation of EventTarget
+ * that does not implement the Node interface.
+ */
+
+public interface Event
+{
+    /**
+     * This method is used to get the current target of this event.
+     * In SVG Tiny, this is always an object to which event listener was attached.
+     *
+     * @return the event's <code>EventTarget</code>.
+     */
+    public EventTarget getCurrentTarget();
+
+    /**
+     * This method returns the event type information. The name of the event is case-sensitive.
+     * The following event types are supported:
+     * <br>
+     * <b>click</b>, <b>DOMActivate</b>, <b>DOMFocusIn</b>, <b>DOMFocusOut</b> (defined DOM Events);
+     * @return the event's type.
+     */
+    public String getType();
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/events/EventListener.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.events;
+
+/**
+* This interface represents an event listener, and is a subset of the EventListener interface
+* defined in the <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/idl-definitions.html">
+* DOM Level 2 Event model</a>.
+* <p>
+* This interface must be implemented and registered on an EventTarget using the
+* {@link org.w3c.dom.events.EventTarget#addEventListener addEventListener} method to be notified
+* about events that occur on or bubble through the event target.
+*
+*
+*/
+
+public interface EventListener
+{
+
+    /**
+     * This method is called whenever an event occurs of the type for which the
+     * EventListener interface was registered.. The Event object contains the
+     * necessary information pertaining to the event, such as its
+     * target and type.
+     *
+     * @param evt the Event object containing necessary event information.
+     */
+    public void handleEvent(Event evt);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/events/EventTarget.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.events;
+
+import org.w3c.dom.DOMException;
+
+/**
+*
+* This interface represents an event target, and is a subset of the EventTarget interface
+* defined in the <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/idl-definitions.html">
+* DOM Level 2 Event model</a>.
+* <br>
+* This interface is implemented by an object (SVGElements) that can notify listeners about events and allows
+* registration and removal of {@link org.w3c.dom.events.EventListener EventListener} objects.
+*
+*
+*/
+
+public interface EventTarget
+{
+
+    /**
+     * This method registers the specified listener with the event target. If an EventListener is added to an EventTarget
+     * while it is processing an event, it will not be triggered by the current actions. If multiple identical EventListeners
+     * are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause
+     * the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener
+     * method.
+     *
+     * @param type The type of event to listen to.
+     * @param listener Will be notified when an event of the desired type happens on this target or one of its descendant.
+     * @param useCapture If true, the listener will be called during the event flow capture phase. Otherwise, the listener
+     * will be called during the bubble phase. If the event's target is this target, then the listener will be called during the 'at target' phase of event flow.
+     *
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if useCapture is true since capture phase is not supported in SVG Tiny.
+     * @throws NullPointerException if <code>listener</code> is null.
+     * @throws NullPointerException if <code>type</code> is null.
+     */
+    public void addEventListener(String type, EventListener listener, boolean useCapture);
+
+    /**
+     * This method removes the specified listener from the event target. If an EventListener is removed
+     * from an EventTarget while it is processing an event, it will not be triggered by the current actions. Calling removeEventListener
+     * with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.
+     *
+     * @param type The type of event that was listened to.
+     * @param listener The listener that was previously registered.
+     * @param useCapture If true, the listener was listening to events in the capture phase of event flow, otherwise the listener
+     * was listening to events in the bubble phase.
+     *
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if useCapture is true since capture phase is not supported in SVG Tiny.
+     * @throws NullPointerException if <code>listener</code> is null.
+     * @throws NullPointerException if <code>type</code> is null.
+     */
+    public void removeEventListener(String type, EventListener listener, boolean useCapture);
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGAnimationElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+
+/**
+ * This interface represents an Animation element, which contains methods to control the timing of
+ * animations.
+ */
+public interface SVGAnimationElement extends SVGElement
+{
+
+    /**
+     * Creates a begin instance time for the current time plus or minus the passed offset.
+     * The new instance time is added to the <a href="http://www.w3.org/TR/2001/REC-smil20-20010807/smil20.html#smil-timing-Timing-BeginEnd-InstanceTimesLists">
+     * begin instance times list</a>.
+
+     *
+     * @param offset The offset in seconds at which to begin the element.
+     */
+    public void beginElementAt(float offset);
+
+    /**
+     * Creates an end instance time for the current time plus or minus the passed offset.
+     * The new instance time is added to the <a href="http://www.w3.org/TR/2001/REC-smil20-20010807/smil20.html#smil-timing-Timing-BeginEnd-InstanceTimesLists">
+     * end instance times list</a>.
+
+     *
+     * @param offset The offset in seconds at which to end the element.
+     */
+    public void endElementAt(float offset);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1051 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+import org.w3c.dom.DOMException;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.events.EventTarget;
+
+/**
+ * This interface represents an SVG element in the document tree. Element's id can be set only
+ * if it does not already have an id. {@link org.w3c.dom.DOMException DOMException} with error
+ * code NO_MODIFICATION_ALLOWED_ERR is raised if an attempt is made to change an existing id.
+ * Elements with non-null id can be inserted, but <b>cannot be removed</b> from the DOM tree
+ * (see {@link org.w3c.dom.Node#removeChild removeChild}). This interface also provides methods
+ * to traverse elements in the DOM tree.
+ *
+ * <p>
+ * This interface can also be used read and manipulate the value of "traits" associated with this
+ * SVGElement. Each <i>trait</i> corresponds to an attribute or property,which is parsed and
+ * understood by the element and in most cases animatable. Unlike attributes, each element has a
+ * well-defined set of traits and attempting to access undefined trait is an error. Also unlike
+ * attributes traits are typed and their values are normalized; for instance SVG path specification
+ * is parsed and all path commands are converted to their absolute variants, it is not possible to
+ * say through the value of the trait if a path command was absolute or relative. When getting and
+ * setting trait values, accessor of the correct type must be used or exception will be thrown.
+ * </p>
+ * <p>
+ * Initial trait values come from parsing corresponding attributes. If value is not specified, but
+ * corresponing attribute (or property for environments where styling is supported) is inherited,
+ * inherited value is returned as a result of the trait query method. If it is not inherited, default
+ * value is returned. Default values are also returned in the case when there is no parent to inherit
+ * from, for ex: when you create a new element, set a trait value to 'inherit', but there is no parent for
+ * inheritance. It is important to note that the value which is returned is always a base value (i.e. before animation
+ * is applied), and this is true for both static and animated content.
+ * </p>
+ * <p>
+ * Setting a trait value has the same effect as changing a corresponding attribute, but trait
+ * setters can operate on typed values. The value which is modified is always a base value.
+ * For inheritable traits the trait value can always be set to "inherit"
+ * (but querying the value will always return the actual inherited value as explained above).
+ * </p>
+ * <p>
+ * There are two situations where the various trait setter methods (such as
+ * setTrait, setFloatTrait or setPathTrait methods) consider a value
+ * invalid and throw a DOMException with the INVALID_ACCESS_ERR code.
+ * The first situation is when the trait value is invalid with regards to
+ * its definition (for example, trying to set the "stroke-linejoin" trait
+ * to "foo" would cause this exception).
+ * The second situation is when the trait value is invalid with regards to
+ * animations currently applied to the trait. The value is considered
+ * invalid because it would put the animation, and therefore the document,
+ * in an error state. For example, if a <path> element has animations on
+ * its "d" attribute, trying to change the "d" attribute to a value
+ * incompatible with the animations will cause the exception to happen.
+ * </p>
+ *
+ * <h3>Traits supported in this specification, SVG Tiny 1.1 DOM</h3>
+ *
+ *
+ * <p>The table below shows the list of attributes and properties that SVG Tiny
+ * DOM 1.1 implementations must support. Each light gray section lists one or
+ * multiple elements for which the subsequent attributes or properties
+ * apply. Each attribute row lists the allowed getter and setter (s). The last
+ * column specifies the default values that must be used for each attribute or
+ * property.</p>
+ * <p><b>Note:</b> For 'REQUIRED' attributes, there are two cases:
+ *
+ * <ul>
+ *  <li>i) The document is in error, if this attribute was not present at the time of loading.</li>
+ *  <li>ii) When using uDOM API, the specified default value (in parenthesis) must be used.</li>
+ * </ul>
+ * </p>
+ *
+ * <table height="1586" cellpadding="2" cellspacing="2" border="1"
+ *  width="825" style="border-collapse: collapse;">
+ *   <tbody>
+ *     <tr>
+ *       <th width="150" valign="top" bgcolor="#999999"><b>Property<br>
+ *       </b> </th>
+ *       <th valign="top" bgcolor="#999999"><b>Trait Getter <br>[possible return value(s)]<br>
+ *       </b> </th>
+ *       <th bgcolor="#999999" valign="top"><b>Trait Setter <br>[allowed value(s)]<br>
+ *       </b> </th>
+ *       <th bgcolor="#999999" valign="top"><b>Default Values<br>
+ *       </b> </th>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td bgcolor="#cccccc" colspan="4" rowspan="1" valign="top">&lt;svg&gt;,
+ *  &lt;rect&gt;, &lt;circle&gt;, &lt;ellipse&gt;, &lt;line&gt;,
+ *  &lt;path&gt;, &lt;g&gt;, &lt;image&gt;, &lt;text&gt;, &lt;a&gt;, and &lt;use&gt;</td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">color <br>
+ *       </td>
+ *       <td valign="top">getRGBColorTrait [SVGRGBColor]<br>
+ *       </td>
+ *       <td valign="top">setTrait [inherit]<br>setRGBColorTrait [SVGRGBColor]<br>
+ *       </td>
+ *       <td valign="top" align="center">rgb(0,0,0)<br>
+ *      </td>
+ *    </tr>
+ *      <tr>
+ *       <td width="150" valign="top">display<br>
+ *       </td>
+ *       <td valign="top">getTrait [inline | none ] <br>
+ *       </td>
+ *       <td valign="top">setTrait [inline | none | inherit ] </td>
+ *       <td valign="top" align="center">"inline"<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">fill<br>
+ *       </td>
+ *       <td valign="top">getRGBColorTrait [null, SVGRGBColor]<br>
+ *       </td>
+ *       <td valign="top">setRGBColorTrait [SVGRGBColor]<br>setTrait(none | currentColor | inherit)<br>
+ *       </td>
+ *       <td valign="top" align="center">rgb(0,0,0)<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">fill-rule<br>
+ *       </td>
+ *       <td valign="top">getTrait [nonzero | evenodd] <br>
+ *       </td>
+ *       <td valign="top">setTrait [nonzero | evenodd | inherit] </td>
+ *       <td valign="top" align="center">"nonzero"<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">stroke</td>
+ *      <td valign="top">getRGBColorTrait [null, SVGRGBColor]</td>
+ *       <td valign="top">setRGBColorTrait [SVGRGBColor]<br>setTrait [none | currentColor | inherit]</td>
+ *       <td valign="top" align="center">"none"<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">stroke-dashoffset</td>
+ *       <td valign="top">getFloatTrait </td>
+ *       <td valign="top">setTrait [inherit]<br>setFloatTrait </td>
+ *       <td valign="top" align="center">0.0f<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">stroke-linecap</td>
+ *       <td valign="top">getTrait [butt | round | square]</td>
+ *       <td valign="top">setTrait [butt | round | square | inherit]</td>
+ *       <td valign="top" align="center">"butt"<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">stroke-linejoin</td>
+ *       <td valign="top">getTrait [miter | round | bevel ]</td>
+ *       <td valign="top">setTrait [miter | round | bevel | inherit]</td>
+ *       <td valign="top" align="center">"miter"<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">stroke-miterlimit</td>
+ *       <td valign="top">getFloatTrait [ value &gt;= 1]</td>
+ *       <td valign="top">setTrait [inherit]<br>setFloatTrait [value &gt;= 1]</td>
+ *       <td valign="top" align="center">4.0f<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">stroke-width</td>
+ *       <td valign="top">getFloatTrait [value &gt;= 0]</td>
+ *       <td valign="top">setTrait [inherit]<br> setFloatTrait [value &gt;= 0]</td>
+ *       <td valign="top" align="center">1.0f<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">visibility</td>
+ *       <td valign="top">getTrait [visible | hidden]</td>
+ *       <td valign="top">setTrait [visible | hidden | inherit]</td>
+ *       <td valign="top" align="center">"visible"<br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td bgcolor="#cccccc" colspan="4" rowspan="1" valign="top">&lt;svg&gt;, &lt;text&gt;, &lt;g&gt;, &lt;a&gt, and &lt;use&gt;;<br>
+ *      </td>
+ *     </tr>
+ *     <tr>
+ *       <td valign="top">font-family<br>
+ *       </td>
+ *       <td valign="top">getTrait [single, computed font-family value]<br>
+ *      </td>
+ *      <td valign="top">setTrait [same syntax as font-family attribute]<br>
+ *     </td>
+ *      <td valign="top" align="center"> User-Agent <br>
+ *      </td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">font-size<br>
+ *       </td>
+ *       <td valign="top">getFloatTrait&nbsp; [value &gt;= 0]<br>
+ *     </td>
+ *       <td valign="top">setFloatTrait [value &gt;= 0]<br>setTrait [inherit]<br>
+ *      </td>
+ *       <td valign="top" align="center"> User-Agent <br>
+ *       </td>     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">font-style<br>
+ *       </td>
+ *      <td valign="top">getTrait [normal | italic | oblique ] </td>
+ *       <td valign="top">setTrait [normal | italic | oblique | inherit] </td>
+ *       <td valign="top" align="center">"normal"<br>
+ *       </td>     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">font-weight<br>
+ *       </td>
+ *       <td valign="top">getTrait [100 | 200 | 300 <br> | 400 | 500 | 600 | 700 | 800 | 900 ] </td>
+ *       <td valign="top">setTrait [normal | bold | bolder | lighter | 100 | 200 | 300 <br />
+ *       | 400 | 500 | 600 | 700 | 800 | 900 | inherit] </td>
+ *       <td valign="top" align="center">"normal"<br>
+ *       </td>     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">text-anchor<br>
+ *       </td>
+ *       <td valign="top">getTrait [start | middle | end]<br>
+ *       </td>
+ *       <td valign="top">setTrait [start | middle | end | inherit ]<br>
+ *       </td>
+ *       <td valign="top" align="center">"start"<br>
+ *       </td>     </tr>
+ *     <tr>
+ *       <td width="150" colspan="4" rowspan="1" valign="top"><br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" bgcolor="#999999" valign="top"><b>Attribute<br>
+ *       </b></td>
+ *       <td bgcolor="#999999" valign="top"><b>Trait Getter<br>
+ *       </b></td>
+ *       <td bgcolor="#999999" valign="top"><b>Trait Setter<br>
+ *       </b></td>
+ *       <td bgcolor="#999999" valign="top"><b>Default Values<br>
+ *       </b></td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *       </td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" bgcolor="#cccccc" colspan="4" rowspan="1" valign="top">
+ *       &lt;rect&gt;, &lt;circle&gt;, &lt;ellipse&gt;, &lt;line&gt;, &lt;path&gt;, &lt;g&gt;,
+ *       &lt;image&gt;, &lt;text&gt;, &lt;a&gt;, and &lt;use&gt;</td>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top">transform<br>
+ *       </td>
+ *       <td valign="top">getMatrixTrait [SVGMatrix]<br>
+ *       </td>
+ *      <td valign="top">setMatrixTrait [SVGMatrix]<br>
+ *       </td>
+ *       <td valign="top" align="center">Identity matrix<br>
+ *       (1,0,0,1,0,0)<br>
+ *     </tr>
+ *     <tr>
+ *       <td width="150" valign="top"><br>
+ *       </td>
+ *       <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;rect&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">height<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [ value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [ value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">width<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [ value &gt;= 0]</td>
+ *      <td valign="top">setFloatTrait [ value &gt;= 0]</td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">x<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">y<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">rx<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [value &gt;= 0]</td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]</td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">ry<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;circle&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">cx<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">cy<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">r<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [ value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" bgcolor="#cccccc" colspan="4" rowspan="1" valign="top">&lt;ellipse&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">cx<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">cy<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">rx<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">ry<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;line&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">x1<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">x2<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">y1<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">y2<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;path&gt; (path-length is not supported)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">d<br>
+ *      </td>
+ *      <td valign="top">getPathTrait [SVGPath]<br>
+ *      </td>
+ *      <td valign="top">setPathTrait [SVGPath]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(Empty SVGPath)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;image&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">x<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait <br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">y<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">width<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">height<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait [value &gt;= 0]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>(0.0f)<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">xlink:href<br>
+ *      </td>
+ *      <td valign="top">getTrait NS[absolute URI]<br>
+ *      </td>
+ *      <td valign="top">setTraitNS [non local-URI value]<br>
+ *      </td>
+ *      <td valign="top" align="center">REQUIRED<br>( "" )<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;use&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">x<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">y<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td valign="top">xlink:href<br>
+ *      </td>
+ *      <td valign="top">getTraitNS[absolute URI]<br>
+ *      </td>
+ *      <td valign="top">setTraitNS<br>
+ *      </td>
+ *      <td valign="top" align="center">""<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;a&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">target<br>
+ *      </td>
+ *      <td valign="top">getTrait<br>
+ *      </td>
+ *      <td valign="top">setTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">""<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td valign="top">xlink:href<br>
+ *      </td>
+ *      <td valign="top">getTraitNS[absolute URI]<br>
+ *      </td>
+ *      <td valign="top">setTraitNS<br>
+ *      </td>
+ *      <td valign="top" align="center">""<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="*" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;text&gt;<br />(Notes:
+ * For 'x' and 'y', it is only possible
+ * to provide floating point scalar values; an array of x or y values is not supported. <br />
+ * 'rotate' attribute is not supported.)<br/>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">x<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">y<br>
+ *      </td>
+ *      <td valign="top">getFloatTrait<br>
+ *      </td>
+ *      <td valign="top">setFloatTrait<br>
+ *      </td>
+ *      <td valign="top" align="center">0.0f<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">#text<br>
+ *      </td>
+ *      <td valign="top">getTrait [not null]<br>
+ *      </td>
+ *      <td valign="top">setTrait [not null]<br>
+ *      </td>
+ *      <td valign="top" align="center">""<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top">&lt;svg&gt;<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">version<br>
+ *      </td>
+ *      <td valign="top">getTrait<br>
+ *      </td>
+ *      <td valign="top">Not available (readonly)<br>
+ *      </td>
+ *      <td valign="top" align="center">"1.1"<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">baseProfile<br>
+ *      </td>
+ *      <td valign="top">getTrait<br>
+ *      </td>
+ *      <td valign="top">Not available (readonly)<br>
+ *      </td>
+ *      <td valign="top" align="center">"tiny"<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">viewBox<br>
+ *      </td>
+ *      <td valign="top">getRectTrait [null, SVGRect]<br>
+ *      </td>
+ *      <td valign="top">setRectTrait [SVGRect]<br>
+ *      </td>
+ *      <td valign="top" align="center">null<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top">zoomAndPan<br>
+ *      </td>
+ *      <td valign="top">getTrait [disable | magnify]<br>
+ *      </td>
+ *      <td valign="top">setTrait [disable | magnify]<br>
+ *      </td>
+ *      <td valign="top" align="center">"magnify"<br>
+ *      </td>
+ *    </tr>
+ *    <tr>
+ *      <td width="150" valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *      <td valign="top"><br>
+ *      </td>
+ *     </tr>
+ *   </tbody>
+ * </table>
+ */
+
+public interface SVGElement extends Element, EventTarget
+{
+
+    /**
+     * Sets the Element's id attribute.
+     * @param Id the value of Id to be set for this Element.
+     * @throws DOMException with error code NO_MODIFICATION_ALLOWED_ERR is raised if an attempt is made to change an existing Id.
+     * @throws DOMException with error code INVALID_ACCESS_ERR is raised if the Id is not unique i.e. if this Id already exists in the document.
+     * @throws NullPointerException if <code>Id</code> is null.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public void setId(String Id)
+    throws DOMException;
+
+    /**
+     * Returns the Element's Id, null if no id specified.
+     * @return the Element's Id.
+     */
+    public String getId();
+
+    /**
+     * Returns the first child element node of this element. <code>null</code> if this element has no child elements.
+     * @return the first child element node of this element.
+     */
+    public Element getFirstElementChild();
+
+    /**
+     * Returns the next sibling element node of this element. <code>null</code> if this element has no element sibling
+     * nodes that come after this one in the document tree.
+     * @return the next sibling element node of this element.
+     */
+    public Element getNextElementSibling();
+
+
+    /**
+     * Returns the trait value as String. In SVG Tiny only certain traits can be obtained as a String value. Syntax of the
+     * returned String matches the syntax of the corresponding attribute. This element is exactly equivalent to {@link org.w3c.dom.svg.SVGElement#getTraitNS getTraitNS}
+     * with namespaceURI set to null.
+     *
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as String for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a String (SVG Tiny only).
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public String getTrait(String name)
+    throws DOMException;
+
+    /**
+     * Same as {@link org.w3c.dom.svg.SVGElement#getTrait getTrait}, but for namespaced traits. Parameter name must be a non-qualified trait name, i.e. without prefix.
+     *
+     * @param namespaceURI the namespaceURI of the trait to retrieve.
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as String for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a String (SVG Tiny only).
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public String getTraitNS(String namespaceURI, String name)
+    throws DOMException;
+
+    /**
+     * Get the trait value as float.
+     *
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as float for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to a float
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public float getFloatTrait(String name)
+    throws DOMException;
+
+    /**
+     * Returns the trait value as {@link org.w3c.dom.svg.SVGMatrix SVGMatrix}. The returned object is a copy of the actual trait value and will not change if
+     * the corresponding trait changes.
+     *
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as SVGMatrix for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to {@link org.w3c.dom.svg.SVGMatrix SVGMatrix}
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public SVGMatrix getMatrixTrait(String name)
+    throws DOMException;
+
+    /**
+     * Returns the trait value as {@link org.w3c.dom.svg.SVGRect SVGRect}. The returned object is a copy of the actual trait value and will not change if
+     * the corresponding trait changes.
+     *
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as SVGRect for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to {@link org.w3c.dom.svg.SVGRect SVGRect}
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public SVGRect getRectTrait(String name)
+    throws DOMException;
+
+    /**
+     * Returns the trait value as {@link org.w3c.dom.svg.SVGPath SVGPath}. The returned object is a copy of the actual trait value and will not change if
+     * the corresponding trait changes.
+     *
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as SVGPath for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to {@link org.w3c.dom.svg.SVGPath SVGPath}
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public SVGPath getPathTrait(String name)
+    throws DOMException;
+
+    /**
+     * Returns the trait value as {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}. The returned object is a copy of the trait value and will not change if
+     * the corresponding trait changes. If the actual trait value is not an RGBColor (i.e. "none"), this method will return null.
+     *
+     * @param name the name of the trait to retrieve.
+     * @return the trait value as SVGRGBColor for the specified name.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if requested trait's computed value cannot be converted to {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public SVGRGBColor getRGBColorTrait(String name)
+    throws DOMException;
+
+    /**
+     * Set the trait value as String. In SVG Tiny only certain traits can be set through a String value. The syntax of the String
+     * that should be given as a value must be the same as syntax of the corresponding XML attribute value. Exactly equivalent
+     * to {@link org.w3c.dom.svg.SVGElement#setTraitNS setTraitNS} with namespaceURI attribute set to null.
+     *
+     * @param name the name of the trait to be set.
+     * @param value the value of the trait to be set as String.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a String
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait or null.
+     * @throws DOMException with error code NO_MODIFICATION_ALLOWED_ERR: if attempt is made to change readonly trait.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public void setTrait(String name, String value)
+    throws DOMException;
+
+    /**
+     * Same as {@link org.w3c.dom.svg.SVGElement#setTrait setTrait}, but for namespaced traits. Parameter name must be a non-qualified trait name, i.e. without prefix.
+     *
+     * @param namespaceURI the namespaceURI of the trait to be set.
+     * @param name the name of the trait to be set.
+     * @param value the value of the trait to be set as String.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a String
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait or null.
+     * This error is also thrown when the &lt;use&gt; element is hooked into the document tree and the the value of xlink:href is set invalid.
+     * @throws DOMException with error code NO_MODIFICATION_ALLOWED_ERR: if attempt is made to change readonly trait.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public void setTraitNS(String namespaceURI, String name, String value)
+    throws DOMException;
+
+    /**
+     * Set the trait value as float.
+     *
+     * @param name the name of the trait to be set.
+     * @param value the value of the trait to be set as float.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as a float
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+    public void setFloatTrait(String name, float value)
+    throws DOMException;
+
+    /**
+     * Set the trait value as {@link org.w3c.dom.svg.SVGMatrix SVGMatrix}. Values in SVGMatrix are copied in the trait so subsequent changes to the given
+     * SVGMatrix have no effect on the value of the trait.
+     *
+     * @param name the name of the trait to be set.
+     * @param matrix the value of the trait to be set as SVGMatrix.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as an {@link org.w3c.dom.svg.SVGMatrix SVGMatrix}
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input matrix value is null.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public void setMatrixTrait(String name, SVGMatrix matrix)
+    throws DOMException;
+
+    /**
+     * Set the trait value as {@link org.w3c.dom.svg.SVGRect SVGRect}. Values in SVGRect are copied in the trait so subsequent changes to the given
+     * SVGRect have no effect on the value of the trait.
+     *
+     * @param name the name of the trait to be set.
+     * @param rect the value of the trait to be set as SVGRect.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as an {@link org.w3c.dom.svg.SVGRect SVGRect}
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait or null.
+     * SVGRect is invalid if the width or height values are set to negative.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public void setRectTrait(String name, SVGRect rect)
+    throws DOMException;
+
+    /**
+     * Set the trait value as {@link org.w3c.dom.svg.SVGPath SVGPath}. Values in SVGPath are copied in the trait so subsequent changes to the given
+     * SVGPath have no effect on the value of the trait.
+     *
+     * @param name the name of the trait to be set.
+     * @param path the value of the trait to be set as SVGPath.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as an {@link org.w3c.dom.svg.SVGPath SVGPath}
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input value is an invalid value for the given trait or null.
+     * SVGPath is invalid if it begins with any segment other than MOVE_TO segment. Note that an empty SVGPath is still a valid value.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public void setPathTrait(String name, SVGPath path)
+    throws DOMException;
+
+    /**
+     * Set the trait value as {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}. Values in SVGRGBColor are copied in the trait so subsequent changes to the given
+     * SVGRGBColor have no effect on the value of the trait.
+     *
+     * @param name the name of the trait to be set.
+     * @param color the value of the trait to be set as SVGRGBColor.
+     * @throws DOMException with error code NOT_SUPPORTED_ERR if the requested trait is not supported on this element or null.
+     * @throws DOMException with error code TYPE_MISMATCH_ERR if the requested trait's value cannot be specified as an {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the input value is null.
+     * @throws SecurityException if the application does not have the necessary privilege rights
+     * to access this (SVG) content.
+     */
+
+    public void setRGBColorTrait(String name, SVGRGBColor color)
+    throws DOMException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGException.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+
+/**
+ * An exception thrown for SVG-specific errors, such as noninvertable matrix in {@link org.w3c.dom.svg.SVGMatrix#inverse inverse}.
+ */
+public class SVGException extends RuntimeException
+{
+    /**
+     * An integer indicating the type of error generated.
+     */
+    public short code;
+
+    /**
+     * Constructs a SVGException with a detailed message.
+     *
+     * @param code the exception's error code.
+     * @param message the exception's descriptive message.
+     */
+    public SVGException(short code, String message)
+    {
+        super(message);
+        this.code = code;
+    }
+
+
+    /**
+     * Value passed to an SVG-specific method is invalid, such as out of range color component in {@link org.w3c.dom.svg.SVGSVGElement#createSVGRGBColor createSVGRGBColor}.
+     */
+    public static final short SVG_INVALID_VALUE_ERR = 1;
+
+    /**
+     * Matrix that has a determinant equal to zero, and therefore not invertable.
+     */
+    public static final short SVG_MATRIX_NOT_INVERTABLE = 2;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGLocatableElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,277 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+
+/**
+ * This interface represents an SVGLocatableElement. It is implemented by all drawable SVG elements
+ * in the document tree. Drawable elements are: &lt;rect&gt;, &lt;circle&gt;, &lt;ellipse&gt;,
+ * &lt;line&gt;, &lt;path&gt; &lt;use&gt; &lt;image&gt; &lt;text&gt;, &lt;svg&gt;, &lt;a&gt;,
+ * and &lt;g&gt;. <b>Note</b> that animations will have an effect on the values of bounding box.
+ *
+ * <br>
+ * <br>
+ * <br>
+ *The following example further clarify the behavior of the getBBox()
+ *method. The example have a short explanation, an SVG fragment and are
+ *followed by a set of bounding box values which have the following
+ *format:<br>
+ *<tt><br>
+ *[elementId] : {x, y, width, height} | {null}</tt><br>
+ *<br>
+ *where x, y, width and height define the values of the SVGRect object's
+ *returned from a getBBox call on the element with the specified id.
+ *There are a few cases where the bounding box may be null (see example
+ *6).<br>
+ *<br>
+ *<h3>Example #1: Simple groups and bounds</h3>
+ *<br>
+ *This first example shows the values returned by the getBBox method for
+ *various simple basic shapes and groups. In particular, it shows that
+ *the transform, on an element, does not change the value of its user
+ *space bounding box.<br>
+ *<br>
+ *<tt>&lt;g id="group1" transform="translate(10, 20)" fill="red" &gt;
+ *<br>
+ *&nbsp;&lt;rect id="rect1" transform="scale(2)" x="10" y="10" width="50"
+ *height="50"/&gt;
+ *<br>
+ *&nbsp;&lt;rect id="rect2" x="10" y="10" width="100" height="100"/&gt;
+ *<br>
+ *&nbsp;&lt;g id="group2" transform="translate(10, 20)" &gt;
+ *<br>
+ *&nbsp;&nbsp; &lt;rect id="rect3" x="0" y="10" width="150" height="50"/&gt;
+ *<br>
+ *&nbsp;&nbsp; &lt;circle id="circle1" cx="20" cy="20" r="100" /&gt;
+ *<br>
+ *&nbsp;&lt;/g&gt;
+ *<br>
+ *&lt;/g&gt;
+ *<br>
+ *</tt><br>
+ *<tt>[group1] : {-70.0, -60.0, 230.0, 200.0}
+ *<br>
+ *[rect1] : {10.0, 10.0, 50.0, 50.0}
+ *<br>
+ *[rect2] : {10.0, 10.0, 100.0, 100.0}
+ *<br>
+ *[group2] : {-80.0, -80.0, 230.0, 200.0}
+ *<br>
+ *[rect3] : {0.0, 10.0, 150.0, 50.0}
+ *<br>
+ *[circle1] : {-80.0, -80.0, 200.0, 200.0}
+ *</tt><br>
+ *<br>
+ *<h3>Example #2: Bounding box on zero width or height rectangle<br>
+ *</h3>
+ *This example illustrates that the bounding box on elements is based on
+ *the element's geometry coordinates. For example, the bounding box on a
+ *zero-width rectangle is defined (see below), even though the rectangle
+ *is not rendered.<br>
+ *<pre><tt>&lt;g id="group1" transform="translate(10, 20)" fill="red" &gt;</tt></pre>
+ *<pre><tt>&nbsp;&nbsp; </tt>&lt;rect id="rect2" x="10" y="10" width="400" height="0"/&gt;</pre>
+ *<pre wrap=""><tt>   &lt;g id="group2" transform="translate(10, 20)" &gt;
+ *      &lt;rect id="rect3" x="0" y="10" width="150" height="50"/&gt;
+ *   &lt;/g&gt;</tt><tt>
+ *&lt;/g&gt;
+ *</tt></pre>
+ *<pre><tt>[group1] : {10.0, 10.0, 400.0, 70.0}
+ *</tt>[rect2] : {10.0, 10.0, 400.0, 0.0}<tt>
+ *</tt>[group2] : {0.0, 10.0, 150.0, 50.0}<tt>
+ *[rect3] : {0.0, 10.0, 150.0, 50.0}</tt>
+ *</pre>
+ *<h3>Example #3: Bounding Box on zero radius ellipses.</h3>
+ *This is another example of how bounding boxes are based on the
+ *element's geometry. Here, the bounding box of an ellipse with a zero
+ *x-axis radius is still defined, even though the ellipse is not rendered.<br>
+ *<pre wrap="">&lt;svg id="mySVG" width="10" height="20"&gt;
+ *&lt;g id="group1" transform="translate(10, 20)" fill="red" &gt;
+ *  &lt;rect id="rect1" x="10" y="10" width="100" height="100"/&gt;
+ *  &lt;ellipse id="ellipse1" cx="20" cy="20" rx="0" ry="70" /&gt;
+ *&lt;/g&gt;</pre>
+ *<tt>[mySVG] : {20.0, -30.0, 100.0, 160.0}
+ *<br>
+ *[group1] : {10.0, -50.0, 100.0, 160.0}
+ *<br>
+ *[rect1] : {10.0, 10.0, 100.0, 100.0}
+ *<br>
+ *[ellipse1] : {20.0, -50.0, 0.0, 140.0}
+ *</tt><br>
+ *<h3>Example #4: Viewports do not clip bounding boxes</h3>
+ *This example shows that no matter what the viewport is on the root SVG
+ *element, the bounding boxes, based on the geometry, are still defined.
+ *Here, even though the root svg has a zero width, the bounding boxes for
+ *the root itself and its children is precisely defined.<br>
+ *<pre wrap="">&lt;svg id="mySVG" width="0" height="50"&gt;
+ *  &lt;g id="group1" transform="translate(10, 20)" fill="red" &gt;
+ *    &lt;rect id="rect1" x="10" y="10" width="50" height="50"/&gt;
+ *    &lt;g id="group2" transform="translate(10, 20)" &gt;
+ *      &lt;rect id="rect2" x="0" y="10" width="150" height="0"/&gt;
+ *      &lt;circle id="circle1" cx="20" cy="20" r="500" /&gt;
+ *    &lt;/g&gt;
+ *  &lt;/g&gt;
+ *&lt;/svg&gt;
+ *</pre>
+ *<tt>[mySVG] : {-460.0, -440.0, 1000.0, 1000.0}
+ *<br>
+ *[group1] : {-470.0, -460.0, 1000.0, 1000.0}
+ *<br>
+ *[rect1] : {10.0, 10.0, 50.0, 50.0}
+ *<br>
+ *[group2] : {-480.0, -480.0, 1000.0, 1000.0}
+ *<br>
+ *[rect2] : {0.0, 10.0, 150.0, 0.0}
+ *<br>
+ *[circle1] : {-480.0, -480.0, 1000.0, 1000.0}
+ *</tt><br>
+ *<h3>Example #5: getBBox on &lt;use&gt;</h3>
+ *This example shows that the bounding box for a &lt;use&gt; element
+ *accounts for the x and y attributes defined on the element, just like
+ *the x and y attributes impact the bounding box computation on a
+ *&lt;rect&gt; or on an &lt;image&gt; element.<br>
+ *<br>
+ *<tt>&lt;svg&gt;
+ *<br>
+ *&nbsp; &lt;defs&gt;
+ *<br>
+ *&nbsp;&nbsp;&nbsp;&nbsp; &lt;rect id="myRect" x="0" y="0" width="60" height="40" /&gt;
+ *<br>
+ *&nbsp; &lt;/defs&gt;
+ *<br>
+ *&nbsp; &lt;use id="myUse" xlink:href="#myRect" x="-30" y="-20" /&gt;
+ *<br>
+ *&lt;/svg&gt;
+ *<br>
+ *</tt>
+ *<br>
+ *<tt>[myRect] : {0.0, 0.0, 60.0, 40.0}
+ *<br>
+ *[myUse] : {-30.0, -20.0, 60.0, 40.0}
+ *</tt><br>
+ *<h3>Example #6: Empty group</h3>
+ *This example shows that the bounding box for an empty group is null. By
+ *the same token, the bounding box of a &lt;path&gt; with an empty
+ *SVGPath (i.e., one with no path commands, which may happen after
+ *creating a new &lt;path&gt; element with a Document.createElementNS
+ *call) is also null.<br>
+ *<br>
+ *<tt>&lt;g id="emptyG" /&gt;
+ *<br>
+ *<br>
+ *[emptyG] : {null}
+ *</tt><br>
+ *<br>
+ *<h3>Example #7: Impact of display='none' and visibility='hidden'<br>
+ *</h3>
+ *This example shows how the bounding box of children with display='none'
+ *are not accounted for in the computation of their parent's bounding
+ *box. This reflects the definition of the display property and its
+ *impact on rendering and bounding box computation. The example also
+ *shows that elements with a 'hidden' visibility still contribute to
+ *their parent's bounding box computation.<br>
+ *<br>
+ *<tt>&lt;g id="g1"&gt; <br>
+ *&nbsp;&nbsp;&nbsp; &lt;g id="g1.1.display.none" display="none"&gt; <br>
+ *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;rect id="rect1" x="10" y="10" width="40" height="40"/&gt;<br>
+ *&nbsp;&nbsp;&nbsp; &lt;g/&gt;
+ *<br>
+ *&nbsp;&nbsp;&nbsp; &lt;rect id="rect2.visibility.hidden" visibility="hidden" <br>
+ *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x="30" y="60" width="10" height="20"/&gt;
+ *<br>
+ *&lt;/g&gt;</tt><br>
+ *<br>
+ *<tt>[g1] : {30.0, 60.0, 10.0, 20.0} <br>
+ *[g1.1.display.none] : {10.0, 10.0, 40.0, 40.0}<br>
+ *[rect1] : {10.0, 10.0, 40.0, 40.0}<br>
+ *[rec2.visibility.hidden] : {30.0, 60.0, 10.0, 20.0}</tt><br>
+ *<h3>Example #8: Concatenating bounding boxes in the container's user
+ *space.<br>
+ *</h3>
+ *This example shows how the concatenation and computation of bounding
+ *boxes for container element happens in the container's user space.<br>
+ *<br>
+ *<tt>&lt;g id="g1"&gt;<br>
+ *&nbsp; &lt;line id="line1" x2="100" y2="100" transform="rotate(-45)"/&gt;<br>
+ *&lt;/g&gt;</tt><br>
+ *<tt><br>
+ *[g1] : {0.0, 0.0, 141.42136, 0}<br>
+ *[line1] : {0.0, 0.0, 100.0, 100.0}</tt><br>
+ *<h3>Example #9: No influence of stroke-width.</h3>
+ *This example illustrates that stroking has no impact on the computation
+ *of bounding boxes.<br>
+ *<tt><br>
+ *&lt;g&gt;<br>
+ *&nbsp;&nbsp; &lt;line id="thickLine" stroke-width="10" x2="100" y2="0" /&gt;<br>
+ *&lt;/g&gt;</tt><br>
+ *<br>
+ *[thickLine] : {0.0, 0.0, 100.0, 0.0}<br>
+ *<br>
+ *<h3>Example #10: No influence of viewBox.</h3>
+ *This example illustrates that viewBox has no impact on the computation
+ *of bounding boxes.<br>
+ *<tt><br>
+ *&lt;svg id="rootSvg" width="500" height="300" viewBox="0 0 200 100" &gt;<br>
+ *&nbsp;&nbsp; &lt;rect x="-100" y="-200" width="500" height="100" /&gt;<br>
+ *&lt;/svg&gt;</tt><br>
+ *<br>
+ *[rootSVG] : {-100, -200, 500, 100}<br>
+ *
+ *
+ */
+public interface SVGLocatableElement extends SVGElement
+{
+
+    /**
+     * <p>
+     * Returns the tight bounding box in current user coordinate space. Tight bounding box is the smallest
+     * possible rectangle that includes the geometry of all contained graphics elements excluding stroke.
+     * The calculation is done in the user coordinate space of the element. When bounding box
+     * is calculated elements with display property (trait) set to none are ignored. Exact rules for the bounding
+     * box calculation are given in the <a href="http://www.w3.org/TR/SVG/coords.html#ObjectBoundingBox">SVG spec</a>.
+     * </p>
+     *
+     * @return the tight bounding box in current user coordinate space.
+     */
+    public SVGRect getBBox();
+
+    /**
+     * <p>
+     * Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any)
+     * to the parent user agent's notion of a "pixel". For display devices, ideally this represents a physical screen pixel.
+     * For other devices or environments where physical pixel sizes are not known, then an algorithm similar to the CSS2
+     * definition of a "pixel" can be used instead. Note that <code>null</code> is returned if this element is not hooked into the
+     * document tree.
+     * </p>
+     *
+     * @return the transformation matrix from current user units to the parent user agent's notion of a "pixel".
+     */
+    public SVGMatrix getScreenCTM();
+
+    /**
+     * <p>
+     * Returns the tight bounding box in screen coordinate space. Tight bounding box is the smallest
+     * possible rectangle that includes the geometry of all contained graphics elements excluding stroke.
+     * The box coordinates are in the screen coordinate space, which is connected to the current user
+     * coordinate space by the matrix returned by {@link org.w3c.dom.svg.SVGLocatableElement#getScreenCTM getScreenCTM} method.
+     * Note that <code>null</code> is returned if this element is not hooked into the
+     * document tree.
+     * </p>
+     *
+     * @return the tight bounding box in screen coordinate space.
+     */
+    public SVGRect getScreenBBox();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGMatrix.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+import org.w3c.dom.svg.SVGException;
+import org.w3c.dom.DOMException;
+
+/**
+ * This interface represents an "SVGMatrix" datatype, identified by an affine transform.
+ * It can be used to read and modify the values of transform attribute as per SVG specification.
+ * Note that the mTranslate, mMultiply, mScale and mRotate methods in this interface
+ * mutate the SVGMatrix object and return a reference to the SVGMatrix instance itself, after
+ * performing the necessary matrix operation.
+ * <p>This matrix transforms source coordinates (x, y) into destination coordinates (x', y') by
+ * considering them to be a column vector and multiplying the coordinate vector by the matrix
+ * according to the following process:</p>
+ *
+ * <p>
+ * <pre>
+ *  [ x' ]    [  a  c  e  ]   [ x ]    [ a.x + c.y + e ]
+ *  [ y' ] =  [  b  d  f  ]   [ y ] =  [ b.x + d.y + f ]
+ *  [ 1  ]    [  0  0  1  ]   [ 1 ]    [        1      ]
+ * </pre>
+ * </p>
+ */
+public interface SVGMatrix
+{
+
+    /**
+     * Returns a component of the matrix by component's zero-based index. <code>getComponent(0)</code> is a, <code>getComponent(1)</code> is b, etc.
+     *
+     * @param index the index of the matrix component to retrieve.
+     * @return the component for the specified index.
+     * @throws DOMException  - INDEX_SIZE_ERR if the <code>index</code> is invalid.
+     */
+    public float getComponent(int index)
+    throws DOMException;
+
+    /**
+     * Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting current matrix.
+     *
+     * @param secondMatrix the matrix to post-multiply with.
+     * @return the resulting current matrix after post-multiplication.
+     * @throws NullPointerException  - if secondMatrix is null.
+     */
+    public SVGMatrix mMultiply(SVGMatrix secondMatrix);
+
+    /**
+     * Returns a new instance of SVGMatrix containing the inverse of the current matrix.
+     *
+     * @return the inverse of the current matrix.
+     * @throws SVGException  - SVG_MATRIX_NOT_INVERTABLE when determinant of this matrix is zero.
+     */
+    public SVGMatrix inverse()
+    throws SVGException;
+
+    /**
+     * Post-multiplies a translation transformation on the current matrix and returns the resulting current matrix.
+     * This is equivalent to calling <code>multiply(T)</code>, where <code>T</code> is an
+     * <code>SVGMatrix</code> object represented by the following
+     * matrix:
+     *
+     * <p>
+     * <pre>
+     *      [   1    0    x  ]
+     *      [   0    1    y  ]
+     *      [   0    0    1   ]
+     * </pre>
+     * </p>
+     *
+     * @param x the distance by which coordinates are translated
+     * in the X axis direction.
+     * @param y the distance by which coordinates are translated
+     * in the Y axis direction.
+     * @return the resulting current matrix after post-multiplication.
+     */
+    public SVGMatrix mTranslate(float x, float y);
+
+    /**
+     * Post-multiplies a uniform scale transformation on the current matrix and returns the resulting current matrix.
+     * This is equivalent to calling <code>multiply(S)</code>, where <code>S</code> is an <code>SVGMatrix</code>
+     * object represented by the following matrix:
+     *
+     * <p>
+     * <pre>
+     *      [   scaleFactor      0          0   ]
+     *      [   0          scaleFactor      0   ]
+     *      [   0                0          1   ]
+     * </pre>
+     * </p>
+     *
+     * @param scaleFactor the factor by which coordinates are scaled along the
+     * X and Y axis.
+     * @return the resulting current matrix after post-mutiplication.
+     */
+    public SVGMatrix mScale(float scaleFactor);
+
+    /**
+     * Post-multiplies a rotation transformation on the current matrix and returns the resulting current matrix.
+     * This is equivalent to calling <code>multiply(R)</code>, where <code>R</code> is an
+     * <code>SVGMatrix</code> object represented by the following matrix:
+     *
+     * <p>
+     * <pre>
+     *      [ cos(angle) -sin(angle) 0 ]
+     *      [ sin(angle)  cos(angle) 0 ]
+     *      [ 0           0          1 ]
+     * </pre>
+     * </p>
+     *
+     * @param angle the angle of rotation in degrees.
+     * @return the resulting current matrix after post-multiplication.
+     */
+    public SVGMatrix mRotate(float angle);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGPath.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+import org.w3c.dom.DOMException;
+
+
+/**
+ * This interface represents an "SVGPath" datatype used to define the path geometry.
+ * Corresponds to SVG path specification or the "d" attribute.
+ *
+ *
+ * <p>The native implementations must support the following simplifications or
+ * canonicalization of path segments. Any simplifications should be lossless.
+ *
+ * <ul>
+ * <li>Relative commands (c, h, l, m, q, s, t, and v) must be converted to their absolute counterparts·</li>
+ * <li>Horizontal and Vertical lines (H, h, V, and v) must be converted to general lines (L and l)·</li>
+ * <li>Translate command S to command C·</li>
+ * <li>Translate command T to command Q.</li>
+ * </ul>
+ * </p>
+ */
+public interface SVGPath
+{
+
+    /**
+     * Numeric value is ASCII code of the letter 'M'.
+     */
+    public static final short MOVE_TO = 77;
+
+    /**
+     * Numeric value is ASCII code of the letter 'L'.
+     */
+    public static final short LINE_TO = 76;
+
+    /**
+     * Numeric value is ASCII code of the letter 'C'.
+     */
+    public static final short CURVE_TO = 67;
+
+    /**
+     * Numeric value is ASCII code of the letter 'Q'.
+     */
+    public static final short QUAD_TO = 81;
+
+    /**
+     * Numeric value is ASCII code of the letter 'Z'.
+     */
+    public static final short CLOSE = 90;
+
+
+    /**
+     * Return number of segments in this path.
+     *
+     * @return the number of segments in this path.
+     */
+    public int getNumberOfSegments();
+
+    /**
+     * Returns segment command by zero-based command index. Returns one of MOVE_TO, LINE_TO, CURVE_TO, QUAD_TO or CLOSE.
+     *
+     * @param cmdIndex the command index for the segment command to retrieve.
+     * @return the segment command for the specified cmdIndex.
+     * @throws DOMException with error code INDEX_SIZE_ERR if segment index out of bounds.
+     *
+     */
+    public short getSegment(int cmdIndex)
+    throws DOMException;
+
+    /**
+     * Returns segment parameter by zero-based command index and zero-based parametr index.
+     *
+     * @param cmdIndex the command index for the segment parameter to retrieve.
+     * @param paramIndex the parameter index for the segment parameter to retrieve.
+     * @return the segment parameter for the specified cmdIndex and paramIndex.
+     * @throws DOMException with error code INDEX_SIZE_ERR if segment index out of bounds or param index out of bounds for this segment's type.
+     */
+    public float getSegmentParam(int cmdIndex, int paramIndex)
+    throws DOMException;
+
+    /**
+     * Appends 'M' (absolute move) segment to the path with the specified coordinates.
+     *
+     * @param x the x-axis coordinate for the specified point.
+     * @param y the y-axis coordinate for the specified point.
+     */
+    public void moveTo(float x, float y);
+
+    /**
+     * Appends 'L' (absolute line) segment to the path with the specified coordinates.
+     *
+     * @param x the x-axis coordinate of the specified point.
+     * @param y the y-axis coordinate of the specified point.
+     */
+    public void lineTo(float x, float y);
+
+    /**
+     * Appends 'Q' (absolute quadratic curve) segment to the path.
+     *
+     * @param x1 the x-axis coordinate of the first control point.
+     * @param y1 the y-axis coordinate of the first control point.
+     * @param x2 the x-axis coordinate of the final end point.
+     * @param y2 the y-axis coordinate of the final end point.
+     *
+     */
+    public void quadTo(float x1, float y1, float x2, float y2);
+
+    /**
+     * Appends 'C' (absolute cubic curve) segment to the path.
+     *
+     * @param x1 the x-axis coordinate of the first control point.
+     * @param y1 the y-axis coordinate of the first control point.
+     * @param x2 the x-axis coordinate of the second end point.
+     * @param y2 the y-axis coordinate of the second end point.
+     * @param x3 the x-axis coordinate of the final end point.
+     * @param y3 the y-axis coordinate of the final end point.
+     *
+     */
+    public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3);
+
+    /**
+     * Appends 'Z' (close path) segment to the path
+     */
+    public void close();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGPoint.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+
+/**
+ * This interface represents an "SVGPoint" datatype, identifiend by its x and y components.
+ */
+public interface SVGPoint
+{
+
+    /**
+     * Sets the x component of the point to the specified float value.
+     *
+     * @param value the x component value
+     *
+     */
+
+    public void setX(float value);
+
+    /**
+     * Sets the y component of the point to the specified float value.
+     *
+     * @param value the y component value
+     *
+     */
+
+    public void setY(float value);
+
+
+    /**
+     * Returns the x component of the point.
+     *
+     * @return the x component of the point.
+     *
+     */
+
+    public float getX();
+
+    /**
+     * Returns the y component of the point.
+     *
+     * @return the y component of the point.
+     *
+     */
+    public float getY();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGRGBColor.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+
+/**
+ * This interface represents an "SVGRGBColor" datatype made up of red, green, and blue components.
+ * It can be used to read properties that store color values ({@link org.w3c.dom.svg.SVGElement#getRGBColorTrait getRGBColorTrait})
+ * such as <code>fill</code>, <code>stroke</code>, and <code>color</code>.
+ */
+public interface SVGRGBColor
+{
+
+    /**
+     * Returns the red component of the SVGRGBColor.
+     *
+     * @return the red component.
+     *
+     */
+    public int getRed();
+
+    /**
+     * Returns the green component of the SVGRGBColor.
+     *
+     * @return the green component.
+     *
+     */
+    public int getGreen();
+
+    /**
+     * Returns the blue component of the SVGRGBColor.
+     *
+     * @return the blue component.
+     *
+     */
+    public int getBlue();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGRect.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+
+/**
+ * This interface represents an "SVGRect" datatype, consisting of a minimum X, minimum Y, width
+ * and height values.
+ */
+public interface SVGRect
+{
+
+    /**
+     * Sets the minimum X value of this SVGRect to the specified value.
+     *
+     * @param value the minimum X value.
+     *
+     */
+    public void setX(float value);
+
+    /**
+     * Sets the minimum Y value of this SVGRect to the specified value.
+     *
+     * @param value the minimum Y value.
+     *
+     */
+    public void setY(float value);
+
+    /**
+     * Sets the width of this SVGRect to the specified value.
+     *
+     * @param value the rectangle width value.
+     *
+     */
+    public void setWidth(float value);
+
+    /**
+     * Sets the height of this SVGRect to the specified value.
+     *
+     * @param value the rectangle height value.
+     *
+     */
+    public void setHeight(float value);
+
+    /**
+     * Returns the minimum X value for this SVGRect.
+     *
+     * @return the minimum X value.
+     *
+     */
+    public float getX();
+
+    /**
+     * Returns the minimum Y value for this SVGRect.
+     *
+     * @return the minimum Y value.
+     *
+     */
+    public float getY();
+
+
+    /**
+     * Returns the width for this SVGRect.
+     *
+     * @return the rectangle width.
+     *
+     */
+    public float getWidth();
+
+    /**
+     * Returns the height for this SVGRect.
+     *
+     * @return the rectangle height.
+     *
+     */
+    public float getHeight();
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/javasrc/org/w3c/dom/svg/SVGSVGElement.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,162 @@
+/*
+* 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:
+*
+*/
+package org.w3c.dom.svg;
+
+import org.w3c.dom.DOMException;
+
+/**
+ * <p>This interface represents &lt;svg&gt; element in (SVG) document tree.</p>
+ * <h4>User Agent Transforms</h4>
+ * <p>
+ * The DOM attributes currentScale, currentRotate and currentTranslate are combined to form user agent transformation
+ * which is applied at the outermost level on the SVG document (i.e., outside the outermost 'svg' element) if "magnification"
+ * is enabled (i.e., zoomAndPan attribute is set to "magnify"). Their values
+ * can potentialy be modified through user-agent specific UI. User agent transformation can be obtained
+ * by multiplying matrix
+ * <p>
+ * <pre>
+ * [currentScale      0       currentTranslate.x]       [cos(currentRotate) -sin(currentRotate 0]
+ * [     0      currentScale  currentTranslate.y]  by   [sin(currentRotate) cos(currentRotate) 0]
+ * [     0            0               1         ]       [         0                  0         1]
+ * </pre>
+ * </p>
+ *
+ * i.e. (translate, then scale, then rotate the coordinate system). The reference point for scale and rotate operations is the origin (0, 0).
+ * </p>
+ *
+ * <p><b>Note:</b> If the application does not have the necessary privilege rights to access this (SVG)
+ * content, a SecurityException may be thrown by the underlying implementation. This is applicable
+ * to all the Tree navigation and Trait acessor methods. Features such as zooming, panning and
+ * playing of animations will not be affected.
+ * </p>
+ */
+public interface SVGSVGElement extends SVGLocatableElement
+{
+    /**
+     * Sets current user agent scale (zoom) coefficient.
+     *
+     * @param value the value of user agent scale coefficient to be set.
+     * @throws DOMException with error code INVALID_ACCESS_ERR if the scale value is set to zero.
+     */
+    public void setCurrentScale(float value)
+    throws DOMException;
+
+    /**
+     * Returns current user agent scale (zoom) coefficient. The initial value for currentScale is 1.
+     *
+     * @return the current user agent scale coefficient.
+     */
+    public float getCurrentScale();
+
+    /**
+     * Sets current user agent rotate coefficient in degrees.
+     *
+     * @param value the value of user agent rotate coefficient to be set.
+     */
+    public void setCurrentRotate(float value);
+
+    /**
+     * Returns current user agent rotation angle in degrees. The initial value for currentRotate is 0.
+     *
+     * @return the current user agent rotation coefficient in degrees.
+     */
+    public float getCurrentRotate();
+
+    /**
+     * Current user agent translation used for scrolling or panning (The returned {@link org.w3c.dom.svg.SVGPoint SVGPoint} object is "live" and setting its
+     * x and y components will change user agent's translation). The initial values for currentTranslate is SVGPoint(0,0).
+     *
+     * @return returns the current user agent translation.
+     */
+    public SVGPoint getCurrentTranslate();
+
+    /**
+     * Returns current animation timeline time in seconds.
+     *
+     * @return the current animation timeline time in seconds.
+     */
+    public float getCurrentTime();
+
+    /**
+     * Sets current animation timeline time (in seconds). This API is required to support moving
+     * forwards in timeline. The underlying implementations are normally designed to seek
+     * forward in time and setting the time backwards is not meant to play the animation backwards.
+     * Note: Moving backwards in time is a costly feature for the implementations to support.
+     *
+     * @param seconds the value of time to be set in seconds.
+     */
+
+    public void setCurrentTime(float seconds);
+
+    /**
+     * Creates new {@link org.w3c.dom.svg.SVGMatrix SVGMatrix} object. This object can be used to modify value of traits which are compatible with {@link org.w3c.dom.svg.SVGMatrix SVGMatrix}
+     * type using {@link org.w3c.dom.svg.SVGElement#setMatrixTrait setMatrixTrait} method. The internal representation of the matrix is as follows:
+     * <p>
+     * <pre>
+     *  [  a  c  e  ]
+     *  [  b  d  f  ]
+     *  [  0  0  1  ]
+     * </pre>
+     * </p>
+     *
+     * @param a the 'a' component of the matrix to be set.
+     * @param b the 'b' component of the matrix to be set.
+     * @param c the 'c' component of the matrix to be set.
+     * @param d the 'd' component of the matrix to be set.
+     * @param e the 'e' component of the matrix to be set.
+     * @param f the 'f' component of the matrix to be set.
+     *
+     * @return the newly created SVGMatrix object.
+     *
+     * @see org.w3c.dom.svg.SVGMatrix
+     */
+
+    public SVGMatrix createSVGMatrixComponents(float a, float b, float c, float d, float e, float f);
+
+    /**
+     * Creates new {@link org.w3c.dom.svg.SVGRect SVGRect} object. This object can be used to modify value of traits which are compatible with {@link org.w3c.dom.svg.SVGRect SVGRect}
+     * type using {@link org.w3c.dom.svg.SVGElement#setRectTrait setRectTrait} method. The intial values for x, y, width, height of this new SVGRect are zero.
+     *
+     * @return the newly created SVGRect object.
+     */
+
+    public SVGRect createSVGRect();
+
+    /**
+     * Creates new {@link org.w3c.dom.svg.SVGPath SVGPath} object. This object can be used to modify value of traits which are compatible with {@link org.w3c.dom.svg.SVGPath SVGPath}
+     * type using {@link org.w3c.dom.svg.SVGElement#setPathTrait setPathTrait} method.
+     *
+     * @return the newly created SVGPath object with empty path commands.
+     */
+
+    public SVGPath createSVGPath();
+
+    /**
+     * Creates new {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor} object. This object can be used to modify value of traits which are compatible with {@link org.w3c.dom.svg.SVGRGBColor SVGRGBColor}
+     * type using {@link org.w3c.dom.svg.SVGElement#setRGBColorTrait setRGBColorTrait} method.
+     *
+     * @param red the red component of SVGRGBColor object.
+     * @param green the green component of SVGRGBColor object.
+     * @param blue the blue component of SVGRGBColor object.
+     *
+     * @return the newly created SVGRGBColor object with specified (r,g,b) values.
+     *
+     * @throws SVGException with error code SVG_INVALID_VALUE_ERR: if any of the parameters is not in the 0..255 range.</li>
+     */
+    public SVGRGBColor createSVGRGBColor(int red, int green, int blue)
+    throws SVGException;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/CM2GRenderContext.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,565 @@
+/*
+* Copyright (c) 2005-2006 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:  Render context implementation
+*
+*/
+
+// INCLUDE FILES
+#include <eikenv.h> // CCoeEnv
+#include <graphics.h>
+
+#include "CM2GRenderContext.h"
+#include "MM2GSVGProxy.h"
+#include "svgtbitmap.h"
+#include <ImageConversion.h>
+#include <f32file.h>
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+/* static */ const TReal32       MM2GRenderContext::KFullOpaque             = 1.0;
+/* static */
+const TReal32       MM2GRenderContext::KFullTransparency       = 0.0;
+/* static */
+const TUint8        MM2GRenderContext::KMaxAlphaValue          = 255;
+/* static */
+const TDisplayMode  MM2GRenderContext::KDefaultDisplayMode     = EColor16MA;
+/* static */
+const TDisplayMode  MM2GRenderContext::KMaskDisplayMode        = EGray256;
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::CM2GRenderContext
+// -----------------------------------------------------------------------------
+CM2GRenderContext::CM2GRenderContext()
+        : CBase(),
+        iProxy(NULL),
+        iEngineHandle(M2G_INVALID_HANDLE),
+        iAlpha(MM2GRenderContext::KFullOpaque),
+        iScaledAlpha(MM2GRenderContext::KMaxAlphaValue),
+        iImgBmp(NULL),
+        iWindowSurface(NULL)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::CM2GRenderContext");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::NewL
+// -----------------------------------------------------------------------------
+CM2GRenderContext* CM2GRenderContext::NewL(MM2GSVGProxy* aProxy)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::NewL()");
+
+    CM2GRenderContext* self = new(ELeave) CM2GRenderContext;
+    CleanupStack::PushL(self);
+
+    self->ConstructL(aProxy);
+
+    CleanupStack::Pop();
+
+    return self;
+}
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::~CM2GRenderContext
+// -----------------------------------------------------------------------------
+CM2GRenderContext::~CM2GRenderContext()
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GRenderContext::~CM2GRenderContext() - proxy=%d, engine=%d", iProxy, iEngineHandle);
+    if ((iEngineHandle != M2G_INVALID_HANDLE) && (iProxy != NULL))
+    {
+        TRAP_IGNORE(iProxy->DeleteSvgEngineL(iEngineHandle));
+    }
+    if(iWindowSurface)
+        {
+            delete iWindowSurface;
+        }
+    if(targetBitmap)
+        {
+        delete targetBitmap;
+        }
+    if(iTargetQImage)
+        {
+        delete iTargetQImage;
+        }
+    if(tempBitmapForMask)
+        {
+        delete tempBitmapForMask;
+        }
+    delete iImgBmp;
+    iFbsSession.Disconnect();
+}
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::BindL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::BindL(TInt& aTargetHandle)
+    {
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::BindL()");
+    // get the screen size
+    TSize screenSize = CEikonEnv::Static()->ScreenDevice()->SizeInPixels();             
+        
+    iWindowSurface = (reinterpret_cast<Java::GFX::WindowSurface*>(aTargetHandle));
+    //wSurfaceType   = (Java::GFX::WindowSurfaceType)iWindowSurface->getType();
+    wSurfaceType = Java::GFX::WsTypeQtImage;
+    
+    iWindowSurface->bind(wSurfaceType);
+        
+    switch(wSurfaceType)
+        {
+        case Java::GFX::WsTypeQtImage:
+            User::LeaveIfNull(iOffScreenQImage = iWindowSurface->getQtImage());
+            targetBitmap = new CSvgtBitmap ((TInt8*)iOffScreenQImage->bits(),
+                    TSize(iOffScreenQImage->size().width(),iOffScreenQImage->size().height()),
+                            EColor16MA,iOffScreenQImage->bytesPerLine());
+            break;
+
+        /*TODO for time being..case Java::GFX::WsTypeQtImage:
+            User::LeaveIfNull(iTargetQImage   = iWindowSurface->getQtImage());
+            InitializeQImageOffscreenBufferL(screenSize,iTargetQImage);
+            break;*/
+            
+        case Java::GFX::WsTypeSymbianBitmap:
+            CFbsBitmap* tempBitmap;
+            User::LeaveIfNull(tempBitmap = (reinterpret_cast<Java::GFX::WindowSurface*>(aTargetHandle)->getSymbianBitmap()));
+            InitializeCFbsBitmapOffscreenBufferL(screenSize,tempBitmap);
+            //iOffScreenBitmap = new(ELeave) CFbsBitmap();
+            break;
+            
+        default:
+            User::Leave(KErrNotSupported);
+            break;
+        }
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::InitializeQImageOffscreenBufferL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::InitializeQImageOffscreenBufferL(TSize aScreenSize,QImage* aQimage)
+    {
+    QSize aSize;
+    aSize.setHeight(aScreenSize.iHeight);
+    aSize.setWidth(aScreenSize.iWidth);
+    iOffScreenQImage = new QImage(aSize,aQimage->format());
+    
+    //TODO For time being the format is EColor16MU 
+    targetBitmap = new CSvgtBitmap ((TInt8*)iOffScreenQImage->bits(),
+    TSize(iOffScreenQImage->size().width(),iOffScreenQImage->size().height()),
+            EColor16MU,iOffScreenQImage->bytesPerLine());
+    }
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::InitializeCFbsBitmapOffscreenBufferL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::InitializeCFbsBitmapOffscreenBufferL(TSize aScreenSize,CFbsBitmap* aBitmap)
+    {
+    
+    iOffScreenBitmap = new(ELeave) CFbsBitmap();
+    User::LeaveIfError(
+            iOffScreenBitmap->Create(aScreenSize, aBitmap->DisplayMode()));
+    
+//    TODO check for stride in case of bitmap.
+//    iTargetBitmap = new CSvgtBitmap( (TInt8*)iOffScreenBitmap->DataAddress() ,aScreenSize,iOffScreenBitmap->DisplayMode()/*KDefaultDisplayMode TODO chk this*/,iOffScreenBitmap->ScanLineLength(iOffScreenBitmap->SizeInPixels().iWidth,KDefaultDisplayMode) );
+    }
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::GetImgHandleL
+// -----------------------------------------------------------------------------
+/*
+ * TODO we don't need method anymore as now we need Surface handle
+ * TM2GBitmapHandle CM2GRenderContext::GetImgHandleL() const
+{
+    User::LeaveIfNull(iImgBmp);
+
+    return REINTERPRET_CAST(TM2GBitmapHandle, iImgBmp);
+}*/
+
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::InitImageBitmapL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::InitImageBitmapL()
+    {
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::InitImageBitmapL() - begin");
+    // get the screen size
+    TSize screenSize = CEikonEnv::Static()->ScreenDevice()->SizeInPixels();
+    switch (wSurfaceType)
+        {
+        case Java::GFX::WsTypeQtImage:
+            {
+            break;
+            }
+        case Java::GFX::WsTypeSymbianBitmap:
+            {
+             break;   
+            }
+        
+        default:
+            break;
+        }
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::InitImageBitmapL() - end");
+    }
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::ReleaseL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::ReleaseL()
+    {
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ReleaseL() - begin");
+    
+    iTargetQImage = NULL;
+    iOffScreenQImage = NULL;
+    iWindowSurface->release();
+
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ReleaseL() - end");
+    }
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::RenderL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::RenderLCDUIL(
+    TM2GSvgDocumentHandle& aSvgDocHandle,
+    const TReal32 aCurrentTime,
+    TInt aSvgW, TInt aSvgH,
+    TM2GRenderRect& aRect
+)
+{
+    // prepare viewbox
+    TRect viewbox;
+    TPoint anchor;
+
+    PrepareViewbox(aRect, aSvgW, aSvgH, viewbox, anchor);
+    RenderLCDUIL(aSvgDocHandle, aCurrentTime, viewbox, anchor);
+}
+
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::RenderESWTL(
+    TM2GSvgDocumentHandle& aSvgDocHandle,
+    const TReal32 aCurrentTime,
+    TInt aSvgW, TInt aSvgH,
+    TM2GRenderRect& aRect,
+    TBool aUseNativeClear,
+    TInt* aReturnData)
+{
+    // prepare viewbox
+    TRect viewbox;
+    TPoint anchor;
+
+    PrepareViewbox(aRect, aSvgW, aSvgH, viewbox, anchor);
+
+    aReturnData[0] = 0;
+    aReturnData[1] = 0;
+    aReturnData[2] = 0;
+    aReturnData[3] = 0;
+    aReturnData[4] = anchor.iX;
+    aReturnData[5] = anchor.iY;
+    aReturnData[6] = viewbox.iTl.iX;
+    aReturnData[7] = viewbox.iTl.iY;
+    aReturnData[8] = viewbox.Width();
+    aReturnData[9] = viewbox.Height();
+
+    RenderESWTL(aSvgDocHandle, aCurrentTime, viewbox, anchor, aUseNativeClear, aReturnData);
+
+    return;
+}
+// CM2GRenderContext::SetRenderingQualityL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::SetRenderingQualityL(TInt aMode)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::SetRenderingQualityL()");
+    User::LeaveIfNull(iProxy);
+    iProxy->RenderQualityL(iEngineHandle, aMode);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::SetTransparencyL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::SetTransparency(TReal32 aAlpha)
+{
+    iAlpha = aAlpha;
+    iScaledAlpha = STATIC_CAST(TUint8, (aAlpha * MM2GRenderContext::KMaxAlphaValue));
+}
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::ConstructL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::ConstructL(MM2GSVGProxy* aProxy)
+    {
+    // Init member variables
+    SetTransparency(MM2GRenderContext::KFullOpaque);
+
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ConstructL() - begin");
+
+    if (aProxy)
+    {
+        iProxy = aProxy;
+        iProxy->CreateSvgEngineL(iEngineHandle);
+        M2G_DEBUG_2("M2G_DEBUG: CM2GRenderContext::ConstructL() - proxy: %d, new engine: %d", iProxy, iEngineHandle);
+    }
+    else
+    {
+        M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ConstructL() - proxy is invalid");
+        M2G_THROW(KM2GArgNotOk);
+    }
+
+    User::LeaveIfError(iFbsSession.Connect());
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ConstructL() - end");
+    }
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::PrepareViewbox
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::PrepareViewbox(
+    TM2GRenderRect& aRr,
+    TInt aSvgW, TInt aSvgH,
+    TRect& aViewbox, TPoint& aAnchor)
+{
+    M2G_DEBUG_6("M2G_DEBUG: CM2GRenderContext::PrepareViewbox() cX=%d, cY=%d, cW=%d, cH=%d, anchorX=%d, anchorY=%d - begin", aRr.GetClipX(), aRr.GetClipY(), aRr.GetClipW(), aRr.GetClipH(), aRr.GetAnchorX(), aRr.GetAnchorY());
+
+    // Create an anchor point and an svg render area rect
+    aAnchor.SetXY(aRr.GetAnchorX(), aRr.GetAnchorY());
+    aViewbox.SetRect(aAnchor, TSize(aSvgW, aSvgH));
+
+    // NOTE: It's already verified in Java side that the SVG render area and
+    // the clip area intersects each other
+    aViewbox.Intersection(aRr);
+
+    // Check if the clip rect has changes the svg rect
+    if (aViewbox.iTl != aAnchor)
+    {
+        // Update anchor position
+        TPoint oldAnchor(aAnchor);
+        aAnchor = aViewbox.iTl;
+
+        // Update svg rect
+        aViewbox.Move((-oldAnchor.iX), (-oldAnchor.iY));
+    }
+    else
+    {
+        // The clip rect has not changed the svg rect. Only the
+        // anchor position need to be updated
+        aViewbox.Move(-aAnchor.iX, -aAnchor.iY);
+    }
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::PrepareViewbox() - end");
+}
+
+void CM2GRenderContext::RenderLCDUIL(
+                TM2GSvgDocumentHandle& aSvgDocHandle,
+                TReal32 aCurrentTime,
+                const TRect& aViewbox,
+                const TPoint& aAnchor)
+    {
+    M2G_DEBUG_4("M2G_DEBUG: CM2GRenderContext::RenderL() viewbox: x=%d, y=%d, w=%d, h=%d begin", aViewbox.iTl.iX, aViewbox.iTl.iY, aViewbox.Size().iWidth, aViewbox.Size().iHeight);
+
+    // No need to render if content is fully transparency (i.e. alpha=0)
+    if (iScaledAlpha == 0)
+    {
+        return;
+    }
+
+    QStringList list;
+    list <<"QImage-Format_RGB32";
+    TBuf8<32> fname;
+    
+    // 1: render the svg document on the iImgBmp
+    iProxy->RenderDocumentL(
+        iEngineHandle,
+        aSvgDocHandle,
+        (TM2GSvgBitmapHandle)targetBitmap 
+        , (TUint)NULL, aCurrentTime);
+      
+      fname.Zero();
+      fname.Format(_L8("c:\\%s.bmp"), list.at(0).toLocal8Bit().constData());
+      TBool ret = iOffScreenQImage->save((const char*)fname.PtrZ());
+      
+      QPixmap pixmap = QPixmap::fromImage(*iOffScreenQImage);
+      tempBitmapForMask  = pixmap.toSymbianCFbsBitmap();
+      
+      TFileName       bitmapFilename;
+      bitmapFilename.Copy(_L("c:\\bugbitmap"));
+      bitmapFilename.AppendNum(tempBitmapForMask->Handle());
+      bitmapFilename.Append(_L(".bmp"));
+      SaveBitmapL(*tempBitmapForMask, bitmapFilename);
+      //TODO Release function should be called from FrameWork
+      //iWindowSurface->release();
+      M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::RenderL() end");
+    }
+
+// -----------------------------------------------------------------------------
+/*TODO
+ * Write the separate RenderDocumentL method for QImage and CFbsBitmap 
+ * also handle subsequent BitBlt and
+ * CreateAlphaBlendMaskL
+ * */
+void CM2GRenderContext::RenderESWTL(
+    TM2GSvgDocumentHandle& aSvgDocHandle,
+    TReal32 aCurrentTime,
+    const TRect& aViewbox,
+    const TPoint& aAnchor,
+    TBool /*aUseNativeClear*/,
+    TInt* aReturnData)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::RenderESWTL() Start");
+    // No need to render if content is fully transparency (i.e. alpha=0)
+    if (iScaledAlpha == 0)
+    {
+        return;
+    }
+    
+    // 1: render the svg document on the iImgBmp
+   iProxy->RenderDocumentL(iEngineHandle,
+       aSvgDocHandle,
+       (TM2GSvgBitmapHandle)targetBitmap, (TUint)NULL, aCurrentTime);
+   M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::RenderESWTL() end");
+    
+}
+// CM2GRenderContext::CreateAlphaBlendMask
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::ClearBitmapL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::ClearBitmapL(CFbsBitmap* aBmp)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ClearBitmap - begin");
+
+    User::LeaveIfNull(aBmp);
+
+    TM2GBitmapLock lock(aBmp);
+
+    TSize   size            = aBmp->SizeInPixels();
+    TInt    scanlineLength  = aBmp->ScanLineLength(size.iWidth, aBmp->DisplayMode());
+
+    TUint32* buf = aBmp->DataAddress();
+    char* bufBytes = REINTERPRET_CAST(char*, buf);
+
+    Mem::FillZ(bufBytes,  size.iHeight * scanlineLength);
+
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ClearBitmap - end");
+}
+
+
+void CM2GRenderContext::ClearSurfaceL(TM2GSvgBitmapHandle aSvgtBmpHandle )
+    {
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ClearBitmap - begin");
+//TODO As Currently we are not using this functionality.     
+/*     switch(wSurfaceType)
+         {
+         case Java::GFX::WsTypeQtImage:
+             QImage* tempQImage;
+             User::LeaveIfNull(tempQImage = (reinterpret_cast<Java::GFX::WindowSurface*>(aSvgtBmpHandle)->getQtImage()));
+             //TODO Do we need to lock the qimage as implemented below        TM2GBitmapLock lock(tempBitmap);?
+             QSize   sizeQimage            = tempQImage->size();//TODO Check for SizeInPixels
+             TInt    scanlineLengthQimage  = tempQImage->bytesPerLine();
+             //uchar* bufBytesQimage = REINTERPRET_CAST(uchar*, tempQImage->bits());
+             
+             Mem::FillZ(tempQImage->bits(),  sizeQimage.height() * scanlineLengthQimage);
+             
+             M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ClearSurface Qimage Clear function- end");
+             break;
+             
+         case Java::GFX::WsTypeSymbianBitmap:
+             CFbsBitmap* tempBitmap;
+             User::LeaveIfNull(tempBitmap = (reinterpret_cast<Java::GFX::WindowSurface*>(aSvgtBmpHandle)->getSymbianBitmap()));
+             TM2GBitmapLock lock(tempBitmap);
+             TSize   sizeBmp            = tempBitmap->SizeInPixels();
+             TInt    scanlineLengthBmp  = tempBitmap->ScanLineLength(sizeBmp.iWidth, tempBitmap->DisplayMode());
+             TUint32* bufBmp = tempBitmap->DataAddress();
+             char* bufBytesBmp = REINTERPRET_CAST(char*, bufBmp);
+
+             Mem::FillZ(bufBytesBmp,  sizeBmp.iHeight * scanlineLengthBmp);
+
+             M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ClearSurface Bitmap Clear function- end");
+             break;
+             
+         default:
+             M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::ClearBitmap Type Not Supported.- end");
+             User::Leave(KErrNotSupported);
+             break;
+         }
+ */
+    }
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::FillBitmapL
+// -----------------------------------------------------------------------------
+void CM2GRenderContext::FillBitmapL(CFbsBitmap* aBmp, const TUint8& aChar)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GRenderContext::FillBitmap() filled with=%d - begin", aChar);
+    User::LeaveIfNull(aBmp);
+    TM2GBitmapLock lock(aBmp);
+
+    TSize   size            = aBmp->SizeInPixels();
+    TInt    scanlineLength  = aBmp->ScanLineLength(size.iWidth, aBmp->DisplayMode());
+
+    TUint32* buf = aBmp->DataAddress();
+    char* bufBytes = REINTERPRET_CAST(char*, buf);
+
+    Mem::Fill(bufBytes, size.iHeight * scanlineLength, aChar);
+
+    M2G_DEBUG_0("M2G_DEBUG: CM2GRenderContext::FillBitmap - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GRenderContext::GetBufferHandleL
+// -----------------------------------------------------------------------------
+TM2GSvgBitmapHandle CM2GRenderContext::GetBufferHandleL() const
+    {
+    switch(wSurfaceType)
+           {
+           case Java::GFX::WsTypeQtImage:
+               User::LeaveIfNull(iOffScreenQImage);
+               return REINTERPRET_CAST(TM2GSvgBitmapHandle , iOffScreenQImage);
+	           break;
+
+           case Java::GFX::WsTypeSymbianBitmap:
+               User::LeaveIfNull(iOffScreenBitmap);
+               return REINTERPRET_CAST(TM2GSvgBitmapHandle , iOffScreenBitmap);
+               break;
+               
+           default:
+               User::Leave(KErrNotSupported);
+               break;
+           }
+    
+    }
+
+//CODE to check the Bitmap Contain.
+TInt CM2GRenderContext::SaveBitmapL(const CFbsBitmap& aNVGBitmap, const TFileName& aFileName)
+    {
+        TFileName       bitmapFilename;
+        bitmapFilename.Copy(aFileName);
+        RFs aFs;
+        User::LeaveIfError(aFs.Connect());
+        CImageEncoder * imgEncoder = 0;
+        TRequestStatus  requesStatus = 0;
+        imgEncoder = CImageEncoder::FileNewL(aFs, bitmapFilename, _L8("image/bmp"), CImageEncoder::EOptionAlwaysThread);
+        imgEncoder->Convert(&requesStatus, aNVGBitmap);
+        User::WaitForRequest(requesStatus);
+        delete imgEncoder;       
+        aFs.Close();
+        return 0;
+    }
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/CM2GSVGProxy.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1135 @@
+/*
+* Copyright (c) 2005-2006 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:  SVGTopt proxy implementation
+*
+*/
+
+// INCLUDE FILES
+#include <AknUtils.h>  // Files add recently
+#include <avkon.hrh>   // Files add recently
+#include <SvgJavaInterfaceImpl.h>
+#include <utf.h> // Character conversion API
+#include <featmgr/featmgr.h>
+#include "CM2GSVGProxy.h"
+#include <eikenv.h>
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::NewL
+// -----------------------------------------------------------------------------
+CM2GSVGProxy* CM2GSVGProxy::NewL()
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::NewL()");
+    CM2GSVGProxy* self = new(ELeave) CM2GSVGProxy;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::~CM2GSVGProxy
+// -----------------------------------------------------------------------------
+CM2GSVGProxy::~CM2GSVGProxy()
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::~CM2GSVGProxy() - native SVGTopt: %d", iNative);
+    if (iNative)
+    {
+        CloseContainers();
+        delete iNative;
+        M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::~CM2GSVGProxy() - native deleted");
+        iNative = NULL;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::AddCloseL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::AddCloseL(const TM2GSvgPathHandle& aPathHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddCloseL() - begin");
+    iNative->SvgPathAddClose(aPathHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddCloseL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::AddCurveToL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::AddCurveToL(
+    const TM2GSvgPathHandle& aPathHandle,
+    const TM2GPathCurveData& aPathCurveData)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddCurveToL() - begin");
+    iNative->SvgPathAddCurveTo(
+        aPathHandle,
+        aPathCurveData[ 0 ], aPathCurveData[ 1 ],  // X1, Y1
+        aPathCurveData[ 2 ], aPathCurveData[ 3 ],  // X2, Y2
+        aPathCurveData[ 4 ], aPathCurveData[ 5 ]);  // X3, Y3
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddCurveToL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::AddLineToL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::AddLineToL(
+    const TM2GSvgPathHandle& aPathHandle,
+    const TReal32& aX, const TReal32& aY)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddLineToL() - begin");
+    iNative->SvgPathAddLineTo(aPathHandle, aX, aY);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddLineToL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::AddMoveToL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::AddMoveToL(
+    const TM2GSvgPathHandle& aPathHandle,
+    const TReal32& aX, const TReal32& aY)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddMoveToL() - begin");
+    iNative->SvgPathAddMoveTo(aPathHandle, aX, aY);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddMoveToL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::AddQuadToL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::AddQuadToL(
+    const TM2GSvgPathHandle& aPathHandle,
+    const TReal32& aX1, const TReal32& aY1,
+    const TReal32& aX2, const TReal32& aY2)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddQuadToL() - begin");
+    iNative->SvgPathAddQuadTo(aPathHandle, aX1, aY1, aX2, aY2);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AddQuadToL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::AppendChildL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::AppendChildL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgElementHandle& aChildElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AppendChildL() - begin");
+    iNative->SvgElementAppendChild(aElementHandle, aChildElementHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::AppendChildL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::BeginElementAtL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::BeginElementAtL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GSvgElementHandle& aElementHandle,
+    const TReal32& aOffset)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::BeginElementAtL() offset:%f - begin", aOffset);
+    iNative->SvgDocumentBeginElementAt(
+        aDocumentHandle, aElementHandle, aOffset);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::BeginElementAtL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CheckRemoveableL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::CheckRemoveableL(
+    const TM2GSvgElementHandle& aElementHandle,
+    TInt& aRemoveable)
+
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CheckRemoveableL() - begin");
+    aRemoveable = iNative->SvgElementCheckRemoveable(aElementHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CheckRemoveableL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::ClearSvgSurfaceL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::ClearSvgSurfaceL(const TM2GBitmapHandle& /* aSurfaceHandle */)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::ClearSvgSurfaceL() - not supported");
+    User::Leave(KErrNotSupported);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CreateDocumentL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::CreateDocumentL(const TPtrC16& aData, TM2GSvgDocumentHandle& aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CreateDocumentL() - begin");
+    aDocumentHandle = M2G_INVALID_HANDLE;
+
+    M2G_DEBUG_1("M2G_DEBUG: M2G_DEBUG: CM2GSVGProxy::CreateDocumentL(): content length=%d - call engine", aData.Length());
+
+    // Create document handle. Note: validity check is done in java side
+    aDocumentHandle = iNative->SvgDocumentCreateL(aData);
+    // Append document handle to the container
+    if (iSvgDocuments.Find(aDocumentHandle) == KErrNotFound)
+    {
+        TRAPD(err, iSvgDocuments.Append(aDocumentHandle));
+        if (err != KM2GOk)
+        {
+            M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::CreateDocumentL(), cannot add handle=%d, err=%d", aDocumentHandle, err);
+        }
+    }
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::CreateDocumentL(), handle=%d, total document count=%d - end", aDocumentHandle, iSvgDocuments.Count());
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CreateElementNsL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::CreateElementNsL(
+    const TM2GSvgAttrType& aType,
+    const TM2GSvgDocumentHandle& /* aDocumentHandle */,
+    TM2GSvgElementHandle& aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CreateElementNsL() - begin");
+    // Note: validity check is done in java side
+    aElementHandle = iNative->SvgElementCreate(aType);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::CreateElementNsL() handle=%d - end", aElementHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CreatePathL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::CreatePathL(TM2GSvgPathHandle& aPathHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CreatePathL() - begin");
+    aPathHandle = iNative->SvgPathCreate();
+    if (aPathHandle == M2G_INVALID_HANDLE)
+    {
+        User::Leave(KM2GMemoryNotOk);
+    }
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CreatePathL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CreateSvgEngineL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::CreateSvgEngineL(TM2GSvgEngineHandle& aEngineHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CreateSvgEngineL() - begin");
+    // Create engine handle
+    aEngineHandle = iNative->SvgEngineCreate();
+    if (aEngineHandle == M2G_INVALID_HANDLE)
+    {
+        User::Leave(KM2GMemoryNotOk);
+    }
+    // Append engine handle  to the container
+    if (iSvgEngines.Find(aEngineHandle) == KErrNotFound)
+    {
+        TRAPD(err, iSvgEngines.Append(aEngineHandle));
+        if (err != KM2GOk)
+        {
+            M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::CreateSvgEngineL(), cannot add handle=%d, err=%d", aEngineHandle, err);
+        }
+    }
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::CreateSvgEngineL(), handle=%d, total engine count=%d - end", aEngineHandle, iSvgEngines.Count());
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CreateSvgSurfaceL
+// -----------------------------------------------------------------------------
+TM2GBitmapHandle CM2GSVGProxy::CreateSvgSurfaceL(TInt /* aWidth */, TInt /* aHeight */)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CreateSvgSurfaceL() - not supported");
+
+    User::Leave(KErrNotSupported);
+
+    return M2G_INVALID_HANDLE;
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::DeleteDocumentL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::DeleteDocumentL(const TM2GSvgDocumentHandle& aDocumentHandle)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL() native:%d, document:%d - begin", iNative, aDocumentHandle);
+    TInt findResult = iSvgDocuments.Find(aDocumentHandle);
+    if (findResult != KErrNotFound)
+    {
+        // Try to remove the handle from the container
+        TRAPD(err, iSvgDocuments.Remove(findResult));
+        if (err != KM2GOk)
+        {
+            M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL(), cannot add handle=%d, err=%d", aDocumentHandle, err);
+        }
+        M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL()  - container remove result=%d", err);
+        // Delete the handle
+        iNative->SvgDocumentDestroy(aDocumentHandle);
+    }
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteDocumentL() - total document count=%d - end", iSvgDocuments.Count());
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::DeleteSvgEngineL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::DeleteSvgEngineL(const TM2GSvgEngineHandle& aEngineHandle)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL() engine:%d - begin", aEngineHandle);
+    TInt findResult = iSvgEngines.Find(aEngineHandle);
+    if (findResult != KErrNotFound)
+    {
+        // Try to remove the handle from the container
+        TRAPD(err, iSvgEngines.Remove(findResult));
+        if (err != KM2GOk)
+        {
+            M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL(), cannot add handle=%d, err=%d", aEngineHandle, err);
+        }
+        M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL()  - container remove result=%d", err);
+        // Delete the handle
+        iNative->SvgEngineDestroy(aEngineHandle);
+    }
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DeleteSvgEngineL() - total engine count=%d - end", iSvgEngines.Count());
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::DeleteSvgSurfaceL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::DeleteSvgSurfaceL(const TM2GBitmapHandle& /* aSurfaceHandle */)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::DeleteSvgSurfaceL() - not supported");
+
+    User::Leave(KErrNotSupported);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::DestroyPathL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::DestroyPathL(const TM2GSvgPathHandle& aPathHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::DestroyPathL() - begin");
+    iNative->SvgPathDestroy(aPathHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::DestroyPathL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::DispatchMouseEventL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::DispatchMouseEventL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt aX, TInt aY, TM2GSvgElementHandle& aElementHandle)
+{
+    M2G_DEBUG_3("M2G_DEBUG: CM2GSVGProxy::DispatchMouseEventL(): doc handle:%d, x=%d, y=%d- begin", aDocumentHandle, aX, aY);
+    aElementHandle = iNative->SvgDocumentDispatchMouseEvent(
+                         aDocumentHandle, aX, aY);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::DispatchMouseEventL(): element handle=%d - end", aElementHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::EndElementAtL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::EndElementAtL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GSvgElementHandle& aElementHandle,
+    const TReal32& aOffset)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::EndElementAtL() offset=%f - begin", aOffset);
+    iNative->SvgDocumentEndElementAt(
+        aDocumentHandle, aElementHandle, aOffset);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::EndElementAtL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::FocusOnL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::FocusOnL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GSvgElementHandle& aElementHandle)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::FocusOnL() document=%d, element=%d - begin", aDocumentHandle, aElementHandle);
+    iNative->SvgDocumentFocusOn(aDocumentHandle, aElementHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::FocusOnL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::FocusOutL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::FocusOutL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GSvgElementHandle& aElementHandle)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::FocusOutL() document=%d, element=%d - begin", aDocumentHandle, aElementHandle);
+    iNative->SvgDocumentFocusOut(aDocumentHandle, aElementHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::FocusOutL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetBBoxL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetBBoxL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TM2GRectData& aRectData, TInt& aResult)
+{
+    aResult = KM2GOk;
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetBBoxL() - begin");
+    iNative->SvgElementGetBBox(
+        aElementHandle,
+        aAttributeType,
+        &aRectData[ 0 ],  // X
+        &aRectData[ 1 ],  // Y
+        &aRectData[ 2 ],  // Width
+        &aRectData[ 3 ]);  // Height
+    M2G_DEBUG_4("M2G_DEBUG: CM2GSVGProxy::GetBBoxL(): [x=%f, y=%f, w=%f, h=%f] - end", aRectData[ 0 ], aRectData[ 1 ], aRectData[ 2 ], aRectData[ 3 ]);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetColorTrait
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetColorTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TM2GColorData& aColor,
+    TInt& aResult)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetColorTraitL() - begin");
+    aResult = iNative->SvgElementGetColorAttribute(
+                  aElementHandle,
+                  aAttributeType,
+                  &aColor[ 0 ],  // Red
+                  &aColor[ 1 ],  // Green
+                  &aColor[ 2 ]);  // Blue
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetColorTraitL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetElementByIdL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetElementByIdL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TPtrC16& aId,
+    TM2GSvgElementHandle& aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetElementByIdL() - begin");
+    aElementHandle = iNative->SvgDocumentGetElementById(
+                         aDocumentHandle,
+                         aId);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetElementByIdL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetElementTypeIdL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetElementTypeIdL(const TM2GSvgElementHandle& aElementHandle, TInt16& aId)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetElementTypeIdL() - begin");
+    aId = STATIC_CAST(TInt16, iNative->SvgElementGetType(aElementHandle));
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetElementTypeIdL() type id:%d- end", aId);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetEnumTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetEnumTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeTypeId,
+    TInt16& aEnumTrait)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetEnumTraitIdL() - begin");
+    aEnumTrait = iNative->SvgElementGetEnumAttribute(
+                     aElementHandle,
+                     aAttributeTypeId);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetEnumTraitIdL() enum trait:%d - end", aEnumTrait);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetExternalListItemL
+// -----------------------------------------------------------------------------
+TInt CM2GSVGProxy::GetExternalListItemL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt aIndex,
+    TPtrC16& aItem)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetExternalListItemL() index=%d- begin", aIndex);
+    TInt result = iNative->SvgDocumentGetExternalListItem(aDocumentHandle, aIndex, aItem);
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::GetExternalListListItemL() result:%d, item sz:%d - end", result, aItem.Length());
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetExternalListSizeL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetExternalListSizeL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt& aListSz)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetExternalListSizeL() - begin");
+    aListSz = iNative->SvgDocumentGetExternalListSize(aDocumentHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetExternalListSizeL(): %d - end", aListSz);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetFirstElementChildL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetFirstElementChildL(
+    const TM2GSvgElementHandle& aElementHandle,
+    TM2GSvgElementHandle& aChildHandle)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetFirstElementChildL() element=%d - begin", aElementHandle);
+    aChildHandle = iNative->SvgElementGetFirstElementChild(aElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetFirstElementChildL() child=%d - end", aChildHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetFloatTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetFloatTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TReal32& aFloatTrait)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetFloatTraitL() - begin");
+    aFloatTrait =
+        iNative->SvgElementGetFloatAttribute(aElementHandle, aAttributeType);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetFloatTraitL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetMatrixTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetMatrixTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TM2GMatrixData& aMatrix, TInt& aResult)
+{
+    // [ m00 m01 m02 ]
+    // [ m10 m11 m12 ]
+    // [  0   0   1  ]
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetMatrixTraitL() - begin");
+    aResult = iNative->SvgElementGetMatrixAttribute(
+                  aElementHandle,
+                  aAttributeType,
+                  &aMatrix[ 0 ], // m00
+                  &aMatrix[ 1 ], // m10
+                  &aMatrix[ 2 ], // m01
+                  &aMatrix[ 3 ], // m11
+                  &aMatrix[ 4 ], // m02
+                  &aMatrix[ 5 ]);  // m12
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetMatrixTraitL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetMediaTimeL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetMediaTimeL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TReal32& aSeconds)
+{
+    aSeconds = iNative->SvgDocumentGetMediaTime(aDocumentHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetNextElementSiblingL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetNextElementSiblingL(
+    const TM2GSvgElementHandle& aElementHandle,
+    TM2GSvgElementHandle& aSiblingElementHandle)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetNextElementSiblingL(), element=%d - begin", aElementHandle);
+    aSiblingElementHandle = iNative->SvgElementGetNextElementSibling(aElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetNextElementSiblingL(), sibling=%d - end", aSiblingElementHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetNumberOfSegmentsL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetNumberOfSegmentsL(
+    const TM2GSvgPathHandle& aPathHandle,
+    TInt& aNumberOfSegments)
+{
+    aNumberOfSegments = iNative->SvgPathGetSegmentCount(aPathHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetParentL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetParentL(
+    const TM2GSvgElementHandle& aElementHandle,
+    TM2GSvgElementHandle& aParentElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetParentL() - begin");
+    aParentElementHandle = iNative->SvgElementGetParent(aElementHandle);
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::GetParentL() element=%d, parent=%d, - end", aElementHandle, aParentElementHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetPathTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetPathTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TInt& aPathTrait)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetPathTraitL() - begin");
+    aPathTrait = iNative->SvgElementGetPathAttribute(aElementHandle, aAttributeType);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetPathTraitL() %d - end", aPathTrait);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetRectTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetRectTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TM2GRectData& aRectData, TInt& aResult)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetRectTraitL() - begin");
+    aResult = iNative->SvgElementGetRectAttribute(
+                  aElementHandle,
+                  aAttributeType,
+                  &aRectData[ 0 ], // X
+                  &aRectData[ 1 ], // Y
+                  &aRectData[ 2 ], // Width
+                  &aRectData[ 3 ]);  // Height
+    M2G_DEBUG_5("M2G_DEBUG: CM2GSVGProxy::GetRectTraitL(): result=%d [x=%f, y=%f, w=%f, h=%f] - end", aResult, aRectData[ 0 ], aRectData[ 1 ], aRectData[ 2 ], aRectData[ 3 ]);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetRootElementL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetRootElementL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TM2GSvgElementHandle& aRootElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetRootElementL() - begin");
+    aRootElementHandle = iNative->SvgDocumentGetRootElement(aDocumentHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetRootElementL() handle:%d - end", aRootElementHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetScreenBBoxL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetScreenBBoxL(
+    const TM2GSvgElementHandle& aElementHandle,
+    TM2GScreenBBoxData& aScreenBBoxData)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetScreenBBoxL() - begin");
+    iNative->SvgElementGetScreenBBox(
+        aElementHandle,
+        &aScreenBBoxData[ 0 ], // X
+        &aScreenBBoxData[ 1 ], // Y
+        &aScreenBBoxData[ 2 ], // Width
+        &aScreenBBoxData[ 3 ]);  // Height
+    M2G_DEBUG_4("M2G_DEBUG: CM2GSVGProxy::GetScreenBBoxL(): [x=%f, y=%f, w=%f, h=%f] - end", aScreenBBoxData[ 0 ], aScreenBBoxData[ 1 ], aScreenBBoxData[ 2 ], aScreenBBoxData[ 3 ]);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetSegmentParameterL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetSegmentParameterL(
+    const TM2GSvgPathHandle& aPathHandle,
+    TInt aSegmentIndex, TInt aParamIndex,
+    TReal32& aSegmentParam)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::SvgPathGetSegmentParameter(): index=%d, paramIndex=%d - begin", aSegmentIndex, aParamIndex);
+    aSegmentParam = iNative->SvgPathGetSegmentParameter(
+                        aPathHandle,
+                        aSegmentIndex,
+                        aParamIndex);
+    M2G_DEBUG_3("M2G_DEBUG: CM2GSVGProxy::SvgPathGetSegmentParameter(): index=%d, paramIndex=%d, param=%d - end", aSegmentIndex, aParamIndex, aSegmentParam);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetSegmentTypeL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetSegmentTypeL(
+    const TM2GSvgPathHandle& aPathHandle,
+    TInt aSegmentIndex,
+    TInt16& aSegmentType)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetSegmentTypeL(): index=%d - begin", aSegmentIndex);
+    aSegmentType = iNative->SvgPathGetSegmentType(
+                       aPathHandle,
+                       aSegmentIndex);
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::GetSegmentTypeL(): index=%d, type=%d - end", aSegmentIndex, aSegmentType);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetStringTraitL
+// -----------------------------------------------------------------------------
+TInt CM2GSVGProxy::GetStringTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TPtrC16& aStr)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::GetStringTraitL(): attribute type:%d, handle:%u - begin", aAttributeType, aElementHandle);
+
+    TInt result = iNative->SvgElementGetStringAttribute(aElementHandle,  aAttributeType, aStr);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetStringTraitL(): attribute sz:%d", aStr.Length());
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetSvgSurfaceHeightL
+// -----------------------------------------------------------------------------
+TInt CM2GSVGProxy::GetSvgSurfaceHeightL(const TM2GBitmapHandle& /* aSurfaceHandle */)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetSvgSurfaceHeightL - not supported");
+
+    User::Leave(KErrNotSupported);
+
+    return 0;
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetSvgSurfaceWidthL
+// -----------------------------------------------------------------------------
+TInt CM2GSVGProxy::GetSvgSurfaceWidthL(const TM2GBitmapHandle& /* aSurfaceHandle */)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::GetSvgSurfaceWidthL - not supported");
+
+    User::Leave(KErrNotSupported);
+
+    return 0;
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetUsedFromElementL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetUsedFromElementL(
+    const TM2GSvgElementHandle& aElementHandle,
+    TM2GSvgElementHandle& aHandle)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetUsedFromElementL() used from element=%d - begin", aElementHandle);
+    aHandle = iNative->SvgElementGetUsedFromElement(aElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::GetUsedFromElementL() found element=%d - end", aHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetViewportHeightL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetViewportHeightL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt& aHeight)
+{
+    aHeight = iNative->SvgDocumentGetViewportHeight(aDocumentHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::GetViewportWidthL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::GetViewportWidthL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt& aWidth)
+{
+    aWidth = iNative->SvgDocumentGetViewportWidth(aDocumentHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::InitViewportL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::InitViewportL(const TM2GSvgDocumentHandle& aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::InitViewportL()");
+    return iNative->SvgDocumentViewportInit(aDocumentHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::InsertBeforeL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::InsertBeforeL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgElementHandle& aNewChildElementHandle,
+    const TM2GSvgElementHandle& aReferenceElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::InsertBeforeL() - begin");
+    iNative->SvgElementInsertBefore(
+        aElementHandle,
+        aNewChildElementHandle,
+        aReferenceElementHandle);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::InsertBeforeL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::IsActiveL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::IsActiveL(const TM2GSvgElementHandle& aElementHandle, TInt& aActive)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::IsActiveL() - begin");
+    aActive = iNative->SvgElementIsActive(aElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::IsActiveL() active:%d - end", aActive);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::IsElementInDomL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::IsElementInDomL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GSvgElementHandle& aElementHandle,
+    TInt& aIsElementInDom)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::IsElementInDomL() doc handle=%d, elem handle=%d - begin", aDocumentHandle, aElementHandle);
+    aIsElementInDom = iNative->SvgElementElementInDOM(
+                          aDocumentHandle, aElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::IsElementInDomL() result=%d - end", aIsElementInDom);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::IsUsedL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::IsUsedL(const TM2GSvgElementHandle& aElementHandle, TInt& aResult)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::IsUsedL() - begin");
+    aResult = iNative->SvgElementIsUsed(aElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::IsUsedL(), result=%d - end", aResult);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::RemoveChildL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::RemoveChildL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgElementHandle& aChildElementHandle,
+    TM2GSvgElementHandle& aHandle)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::RemoveChildL() parent=%d, child=%d - begin", aElementHandle, aChildElementHandle);
+    aHandle = iNative->SvgElementRemoveChild(aElementHandle, aChildElementHandle);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::RemoveChildL() result handle=%d - end", aHandle);
+}
+
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::RenderDocumentL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::RenderDocumentL(
+    const TM2GSvgEngineHandle& aEngineHandle,
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GBitmapHandle& aSurfaceHandle,
+    TM2GBitmapHandle aSurfaceMaskHandle,
+    TReal32 aCurrentTime)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() native:%d, time=%f - begin", iNative, aCurrentTime);
+    M2G_DEBUG_3("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() engine:%d, doc:%d, surface:%d", aEngineHandle, aDocumentHandle, aSurfaceHandle);
+    iNative->SvgEngineRenderDocument(
+        aEngineHandle, aDocumentHandle, aSurfaceHandle, aSurfaceMaskHandle, aCurrentTime);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() - end");
+}
+
+//TODO following changes done for Qimage
+//Check for TUint or TInt for subsequent API Call
+void CM2GSVGProxy::RenderDocumentL(
+    const TM2GSvgEngineHandle& aEngineHandle,
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TM2GSvgBitmapHandle& aSurfaceHandle,
+    TM2GSvgBitmapHandle aSurfaceMaskHandle,
+    TReal32 aCurrentTime)
+    {
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() Qimage variant native:%d, time=%f - begin", iNative, aCurrentTime);
+    M2G_DEBUG_3("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() engine:%d, doc:%d, SvgBitmapHandle:%d", aEngineHandle, aDocumentHandle, aSurfaceHandle);
+    iNative->SvgEngineRenderDocument(
+        aEngineHandle, aDocumentHandle, aSurfaceHandle, aSurfaceMaskHandle, aCurrentTime);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::RenderDocumentL() - end");
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::RenderQualityL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::RenderQualityL(
+    const TM2GSvgDocumentHandle& aEngineHandle,
+    TInt aQuality)
+{
+    iNative->SvgEngineSetRenderQuality(aEngineHandle, aQuality);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::RequestCompletedL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::RequestCompletedL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TPtrC16& aURI,
+    const TPtrC8& aResourceData,
+    TInt& aCompleted)
+{
+    M2G_DEBUG_2("M2G_DEBUG: CM2GSVGProxy::RequestCompleted() uri sz=%d, resource sz= %d ", aURI.Length(), aResourceData.Length());
+    aCompleted = iNative->SvgDocumentRequestCompleted(
+                     aDocumentHandle,
+                     aURI,
+                     aResourceData);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::RequestCompletedL() completed=%d - end", aCompleted);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetColorTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetColorTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    const TM2GColorData& aColor)
+{
+    iNative->SvgElementSetColorAttribute(
+        aElementHandle,
+        aAttributeType,
+        aColor[ 0 ],  // red
+        aColor[ 1 ],  // green
+        aColor[ 2 ]);  // blue
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetEnumTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetEnumTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    TInt16 aValue)
+{
+    iNative->SvgElementSetEnumAttribute(
+        aElementHandle,
+        aAttributeType,
+        aValue);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetFloatTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetFloatTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    const TReal32& aValue)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::SetFloatTraitL() - %f", aValue);
+    iNative->SvgElementSetFloatAttribute(
+        aElementHandle,
+        aAttributeType,
+        aValue);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetMatrixTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetMatrixTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    const TM2GMatrixData& aMatrix)
+{
+    // [ m00 m01 m02 ]
+    // [ m10 m11 m12 ]
+    // [  0   0   1  ]
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::SetMatrixTraitL() - begin");
+    iNative->SvgElementSetMatrixAttribute(
+        aElementHandle,
+        aAttributeType,
+        aMatrix[ 0 ],  // m00 - A
+        aMatrix[ 1 ],  // m10 - B
+        aMatrix[ 2 ],  // m01 - C
+        aMatrix[ 3 ],  // m11 - D
+        aMatrix[ 4 ],  // m02 - E
+        aMatrix[ 5 ]);  // m12 - F
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::SetMatrixTraitL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetMediaTimeL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetMediaTimeL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    const TReal32& aSeconds)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::SetMediaTimeL() %f - begin", aSeconds);
+    iNative->SvgDocumentSetMediaTime(aDocumentHandle, aSeconds);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::SetMediaTimeL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetPathTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetPathTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    const TM2GSvgPathHandle& aPathHandle)
+{
+    iNative->SvgElementSetPathAttribute(
+        aElementHandle,
+        aAttributeType,
+        aPathHandle);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetRectTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetRectTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeType,
+    const TM2GRectData& aRect)
+{
+    iNative->SvgElementSetRectAttribute(
+        aElementHandle,
+        aAttributeType,
+        aRect[ 0 ],  // aX
+        aRect[ 1 ],  // aY
+        aRect[ 2 ],  // aWidth
+        aRect[ 3 ]);  // aHeight
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetRenderingQualityL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetRenderingQualityL(
+    const TM2GSvgDocumentHandle& aEngineHandle,
+    TInt aMode)
+{
+    iNative->SvgEngineSetRenderQuality(aEngineHandle, aMode);
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetStringTraitL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetStringTraitL(
+    const TM2GSvgElementHandle& aElementHandle,
+    const TM2GSvgAttrType& aAttributeTypeId,
+    const TPtrC16& aStr)
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::SetStringTraitL() - begin");
+    iNative->SvgElementSetStringAttribute(
+        aElementHandle,
+        aAttributeTypeId,
+        aStr);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::SetStringTraitL(): str sz:%d - end", aStr.Length());
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetViewportWidthL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetViewportWidthL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt aWidth)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::SetViewportWidthL(): %d - begin", aWidth);
+    iNative->SvgDocumentSetViewportWidth(aDocumentHandle, aWidth);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::SetViewportWidthL() - end");
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::SetViewportHeightL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::SetViewportHeightL(
+    const TM2GSvgDocumentHandle& aDocumentHandle,
+    TInt aHeight)
+{
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::SetViewportHeightL(): %d - begin", aHeight);
+    iNative->SvgDocumentSetViewportHeight(aDocumentHandle, aHeight);
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::SetViewportHeightL() - end");
+}
+
+// == PROTECTED METHODS ==
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CloseContainers
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::CloseContainers()
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CloseContainers() - begin");
+    if (iNative)
+    {
+        // Clear document container
+        TInt count = iSvgDocuments.Count();
+        M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::CloseContainers() - document count=%d", count);
+        for (TInt index = 0; index < count; index++)
+        {
+            iNative->SvgDocumentDestroy(iSvgDocuments[index]);
+        }
+        iSvgDocuments.Reset();
+        iSvgDocuments.Close();
+        // Clear engine container
+        count = iSvgEngines.Count();
+        M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::CloseContainers() - engine count=%d", count);
+        for (TInt index = 0; index < count; index++)
+        {
+            iNative->SvgEngineDestroy(iSvgEngines[index]);
+        }
+        iSvgEngines.Reset();
+        iSvgEngines.Close();
+    }
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::CloseContainers() - end");
+}
+
+// == PRIVATE METHODS ==
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::CM2GSVGProxy
+// -----------------------------------------------------------------------------
+CM2GSVGProxy::CM2GSVGProxy()
+        : CBase(),
+        iNative(NULL),
+        iSvgEngines(),
+        iSvgDocuments()
+{
+    iSvgEngines.Compress();
+    iSvgDocuments.Compress();
+}
+
+// -----------------------------------------------------------------------------
+// CM2GSVGProxy::ConstructL
+// -----------------------------------------------------------------------------
+void CM2GSVGProxy::ConstructL()
+{
+    M2G_DEBUG_0("M2G_DEBUG: CM2GSVGProxy::ConstructL() - begin");
+
+    //Get the font spec with variant default font
+    const TInt KApacFontId   = EApacPlain16;
+    const TInt KLatintFontId = ELatinBold12;
+    TInt fontId = KLatintFontId;
+    
+  /*  switch (AknLayoutUtils::Variant())
+    {
+    case EApacVariant:
+    {
+        fontId = KApacFontId;
+    }
+    break;
+
+    case EEuropeanVariant:
+    default:
+        break;
+    }
+    FeatureManager::InitializeLibL();
+
+    if (FeatureManager::FeatureSupported(KFeatureIdAvkonApac))
+    {
+    fontId = KApacFontId;
+    }
+
+    FeatureManager::UnInitializeLib();
+    
+    const CFont* font = AknLayoutUtils::FontFromId(fontId);
+    TFontSpec spec = font->FontSpecInTwips();*/
+    // TODO have to check for substitute of above. 
+    const CFont* font = CEikonEnv::Static()->NormalFont();
+    TFontSpec spec = font->FontSpecInTwips();
+    iNative = CSvgJavaInterfaceImpl::NewL(spec);
+    M2G_DEBUG_1("M2G_DEBUG: CM2GSVGProxy::ConstructL() - SVGTopt created: %d", iNative);
+}
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/CSynchronization.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2005-2006 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:  M2GCore function call synchronization for J9
+*
+*/
+
+// INCLUDE FILES
+#include "CSynchronization.h"
+
+NONSHARABLE_CLASS(M2gGlobals)
+{
+public:
+    M2gGlobals() : mSync(0) {}
+
+public:
+    CSynchronization* mSync;
+};
+
+#if defined(__WINSCW__)
+
+#include <pls.h>
+M2gGlobals* getM2gGlobals()
+{
+    // Access the PLS of this process.
+    //Todo have to check Uid for process. 
+    return Pls<M2gGlobals>(TUid::Uid(0x200211E2));
+}
+
+#else
+
+static M2gGlobals* sGlobals = 0;
+
+M2gGlobals* getM2gGlobals()
+{
+    if (sGlobals == 0)
+    {
+        sGlobals = new M2gGlobals();
+    }
+    return sGlobals;
+}
+#endif
+
+
+// STATIC MEMBERS
+/*static*/ //CSynchronization* CSynchronization::iSelf = NULL;
+
+// -----------------------------------------------------------------------------
+// CSynchronization::InstanceL
+// -----------------------------------------------------------------------------
+/*static*/ CSynchronization* CSynchronization::InstanceL()
+{
+    static M2gGlobals* globals = getM2gGlobals();
+    if (!globals->mSync)
+    {
+        globals->mSync = CSynchronization::NewL();
+    }
+    return globals->mSync;
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::NewL
+// -----------------------------------------------------------------------------
+/*static*/ CSynchronization* CSynchronization::NewL()
+{
+    CSynchronization* self = new(ELeave) CSynchronization();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::ConstructL
+// -----------------------------------------------------------------------------
+void CSynchronization::ConstructL()
+{
+    User::LeaveIfError(iGuard.CreateLocal());
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::CSynchronization
+// -----------------------------------------------------------------------------
+CSynchronization::CSynchronization() : iErrorCode(0)
+{
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::~CSynchronization
+// -----------------------------------------------------------------------------
+CSynchronization::~CSynchronization()
+{
+    iGuard.Close();
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::Lock
+// -----------------------------------------------------------------------------
+void CSynchronization::Lock()
+{
+    iGuard.Wait();
+    iErrorCode = 0;
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::Unlock
+// -----------------------------------------------------------------------------
+void CSynchronization::Unlock()
+{
+    iErrorCode = 0;
+    iGuard.Signal();
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::SetErrorCode
+// -----------------------------------------------------------------------------
+void CSynchronization::SetErrorCode(TInt aCode)
+{
+    iErrorCode = aCode;
+}
+
+// -----------------------------------------------------------------------------
+// CSynchronization::GetErrorCode
+// -----------------------------------------------------------------------------
+TInt CSynchronization::GetErrorCode()
+{
+    return iErrorCode;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/M2GGeneral.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,287 @@
+/*
+* Copyright (c) 2005-2006 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:  General methods
+*
+*/
+
+// INCLUDE FILES
+#include <s32strm.h> // RWriteStream
+#include "M2GUtils.h"
+
+#ifdef M2G_INFO_POPUP
+#include <eikenv.h> // CEikonEnv::InfoWinL
+#endif
+
+#include <jni.h>
+
+#include <SvgJavaInterfaceImpl.h>
+#include "M2GGeneral.h"
+
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::RaiseException
+// -----------------------------------------------------------------------------
+void M2GGeneral::RaiseException(
+    JNIEnv* aEnv, const TDesC8& aName, const TUint8* aMsg)
+{
+    M2G_DEBUG_0("#### M2G_DEBUG: M2GGeneral::RaiseException() ####");
+
+    if (aEnv)
+    {
+        jclass clazz = aEnv->FindClass(
+                           REINTERPRET_CAST(const char*, aName.Ptr()));
+
+        if (!clazz)
+        {
+            // if exception class not found, then use java.lang.Exception
+            clazz = aEnv->FindClass(
+                        REINTERPRET_CAST(const char*, KJavaExceptionClass().Ptr()));
+        }
+
+        aEnv->ThrowNew(clazz, REINTERPRET_CAST(const char*, aMsg));
+    }
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::CheckErrorCode
+// -----------------------------------------------------------------------------
+TInt M2GGeneral::CheckErrorCode(JNIEnv* aEnv, TInt aErrorCode)
+{
+    M2G_DEBUG_1("M2G_DEBUG: M2GGeneral::CheckErrorCode: %d - begin", aErrorCode);
+    TInt code = aErrorCode;
+    const TUint8* msg = (STATIC_CAST(const TDesC8&, KM2GEmptyString8)).Ptr();
+    jcfcommon::auto_ptr<MJavaError> error;
+
+    // Check if an error object
+    if (aErrorCode > 0)
+    {
+        M2G_DEBUG_0("M2G_DEBUG: M2GGeneral::CheckErrorCode(), is MJavaError");
+
+        // Error object need to be deleted here and the auto_ptr takes care of that!!
+        error.reset(JavaUnhand< MJavaError >(aErrorCode));
+
+        // Get an error description through the MJavaError object
+        msg = error->Description().Ptr();
+
+        switch (error->ErrorCode())
+        {
+        case KM2GIOException:
+        {
+            code = error->ErrorCode();
+        }
+        default:
+        {
+            code = error->ErrorCode();
+        }
+        }
+        M2G_DEBUG_1("M2G_DEBUG: M2GGeneral::CheckErrorCode(), MJavaError: error code=%d", code);
+    }
+
+    switch (code)
+    {
+    case KM2GMemoryNotOk:
+    {
+        M2G_DEBUG_0("#### M2G_DEBUG: M2GGeneral::CheckErrorCode() - OutOfMemoryError ####");
+        M2GGeneral::RaiseException(aEnv, KJavaOutOfMemoryErrorClass, msg);
+        return code;
+    }
+    case KM2GIOException:
+    {
+        M2G_DEBUG_0("#### M2G_DEBUG: M2GGeneral::CheckErrorCode() - IOException ####");
+        M2GGeneral::RaiseException(aEnv, KJavaIOExceptionClass, msg);
+        return code;
+    }
+    case KM2GHandleNotOk:
+    {
+        M2G_DEBUG_0("#### M2G_DEBUG: M2GGeneral::CheckErrorCode() - NullPointerException ####");
+        M2GGeneral::RaiseException(aEnv, KJavaNullPointerException, msg);
+        return code;
+    }
+    default:
+    {
+        M2G_DEBUG_1("M2G_DEBUG: M2GGeneral::CheckErrorCode() error code=%d - end", code);
+        return code;
+    }
+    }
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::CheckHandle
+// -----------------------------------------------------------------------------
+TInt M2GGeneral::CheckHandle(JNIEnv* aEnv, TInt aHandle)
+{
+    if (aHandle == M2G_INVALID_HANDLE)
+    {
+        M2GGeneral::RaiseException(aEnv, KJavaNullPointerException);
+    }
+    if (aHandle < 0)
+    {
+        M2GGeneral::CheckErrorCode(aEnv, aHandle);
+    }
+    return aHandle;
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::CheckErrorCodeAndHandle
+// -----------------------------------------------------------------------------
+TInt M2GGeneral::CheckErrorCodeAndHandle(
+    JNIEnv* aEnv, TInt aErrorCode, TInt aHandle, TInt aErrorResult)
+{
+    if ((aErrorCode == KM2GOk) && (aHandle != M2G_INVALID_HANDLE))
+    {
+        return aHandle;
+    }
+    if (aErrorCode != KM2GOk)
+    {
+        M2GGeneral::CheckErrorCode(aEnv, aErrorCode);
+    }
+    else if (aHandle == M2G_INVALID_HANDLE)
+    {
+        M2GGeneral::RaiseException(aEnv, KJavaOutOfMemoryErrorClass);
+    }
+    return aErrorResult;
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::PopupInfo
+// -----------------------------------------------------------------------------
+#ifdef M2G_INFO_POPUP
+void M2GGeneral::PopupInfo(
+    const TDesC& aLine1,
+    const TDesC& aLine2)
+{
+    TInt err = KM2GOk;
+    TRAP(err, CEikonEnv::InfoWinL(aLine1, aLine2));
+    if (err == KM2GOk)
+    {
+        // DUMMY
+    }
+}
+#endif // M2G_INFO_POPUP
+
+
+#ifdef M2G_STATISTIC_DEBUG
+// -----------------------------------------------------------------------------
+// M2GGeneral::TM2GStatistic::TM2GStatistic
+// -----------------------------------------------------------------------------
+M2GGeneral::TM2GStatistic::TM2GStatistic()
+{
+    Reset();
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::TM2GStatistic::Reset()
+// -----------------------------------------------------------------------------
+void M2GGeneral::TM2GStatistic::Reset()
+{
+    // Time
+    iStartTime.UniversalTime();
+    iEndTime.UniversalTime();
+    // Thread
+    iId = RThread().Id();
+    RThread thread;
+    if (thread.Open(iId) == KM2GOk)
+    {
+        iThreadName = thread.Name();
+        thread.Close();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::TM2GStatistic::Print()
+// -----------------------------------------------------------------------------
+void M2GGeneral::TM2GStatistic::Print(TBool aPrintElapsedTime)
+{
+    TInt totalRom = 0;
+    TInt totalRam = 0;
+    TInt freeRam = 0;
+    HAL::Get(HALData::EMemoryROM, totalRom);
+    HAL::Get(HALData::EMemoryRAM, totalRam);
+    HAL::Get(HALData::EMemoryRAMFree, freeRam);
+
+    // Update time
+    iEndTime.UniversalTime();
+
+    M2G_DEBUG_0("====================================================");
+    // Write memory info
+    if (aPrintElapsedTime)
+    {
+        M2G_DEBUG_5(
+            "Rom size:%d, ram size:%d, ram free:%d, ram used:%d, elapsed time:%d",
+            totalRom >> 10,
+            totalRam >> 10,
+            freeRam >> 10,
+            (totalRam - freeRam) >> 10,
+            iEndTime.MicroSecondsFrom(iStartTime).Int64());
+    }
+    else
+    {
+        M2G_DEBUG_4(
+            "Rom size:%d, ram size:%d, ram free:%d, ram used:%d",
+            totalRom >> 10,
+            totalRam >> 10,
+            freeRam >> 10,
+            (totalRam - freeRam) >> 10);
+    }
+    // Write thread info
+    RThread thread;
+    if (thread.Open(iId) == KM2GOk)
+    {
+        TThreadStackInfo stackInfo;
+        thread.StackInfo(stackInfo);
+        thread.Close();
+        TUint id = iId;
+        M2G_DEBUG_2("Thread id:%d, size:%d", id, (stackInfo.iBase - stackInfo.iLimit) >> 10);
+    }
+    M2G_DEBUG_0("====================================================");
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::TM2GStatistic::Print()
+// -----------------------------------------------------------------------------
+void M2GGeneral::TM2GStatistic::Print(RWriteStream& /*aStream*/)
+{
+}
+
+// -----------------------------------------------------------------------------
+// M2GGeneral::TM2GStatistic::Log()
+// -----------------------------------------------------------------------------
+void M2GGeneral::TM2GStatistic::Log()
+{
+    M2G_DEBUG_0("M2GGeneral::TM2GStatistic::Log()");
+    M2GGeneral::TM2GStatistic statistic;
+    statistic.Print();
+}
+
+#endif // M2G_STATISTIC_DEBUG
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/M2GUtils.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,346 @@
+/*
+* Copyright (c) 2005-2006 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:  Util methods
+*
+*/
+
+// INCLUDE FILES
+#include <bitdev.h> // CFbsBitmapDevice
+#include <bitstd.h> // CFbsBitGc
+#include <e32math.h> // FRand
+#include "M2GUtils.h"
+
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class TSWTBitBlt;
+class TM2GBitmapLock;
+// -----------------------------------------------------------------------------
+// M2GBitmapUtils::BitBlt
+// -----------------------------------------------------------------------------
+TInt M2GBitmapUtils::BitBlt(CFbsBitmap& aTarget,
+                            const CFbsBitmap& aSource,
+                            const TPoint& aPoint,
+                            const TRect* aRect,
+                            const CFbsBitmap* aSourceMask)
+{
+    M2G_DEBUG_2("M2G_DEBUG: M2GBitmapUtils::BitBlt() - Point(x=%d, y=%d)", aPoint.iX, aPoint.iY);
+    CFbsBitGc* context = NULL;
+    CFbsBitmapDevice* device = NULL;
+    TInt err = KM2GOk;
+    TRAP(err, (device = CFbsBitmapDevice::NewL(&aTarget)));
+    if ((err == KM2GOk) && (device != NULL))
+    {
+        err = device->CreateContext(context);
+        if ((err == KM2GOk) && (context != NULL))
+        {
+            M2G_DEBUG_0("M2G_DEBUG: M2GBitmapUtils::BitBlt() - CFbsBitGc::BitBlt()");
+            if (aRect)
+            {
+                // Check if mask
+                if (aSourceMask)
+                {
+                    M2G_DEBUG_4("M2G_DEBUG: M2GBitmapUtils::BitBlt() -  mask rect(x1=%d, y1=%d, x2=%d, y2=%d)", aRect->iTl.iX, aRect->iTl.iY, aRect->iBr.iX, aRect->iBr.iY);
+                    // A pixel that is masked by a BLACK is NOT transferred to a destination rectangle.
+                    context->BitBltMasked(aPoint, &aSource, *aRect, aSourceMask, ETrue);
+                    err = KM2GOk;
+                }
+                else
+                {
+                    M2G_DEBUG_4("M2G_DEBUG: M2GBitmapUtils::BitBlt() - rect(x1=%d, y1=%d, x2=%d, y2=%d)", aRect->iTl.iX, aRect->iTl.iY, aRect->iBr.iX, aRect->iBr.iY);
+                    context->BitBlt(aPoint, &aSource, *aRect);
+                    err = KM2GOk;
+                }
+            }
+            else
+            {
+                M2G_DEBUG_0("M2G_DEBUG: M2GBitmapUtils::BitBlt() - no rect");
+                context->BitBlt(aPoint, &aSource);
+                err = KM2GOk;
+            }
+        }
+    }
+    delete context;
+    delete device;
+    context = NULL;
+    device = NULL;
+    M2G_DEBUG_1("M2G_DEBUG: M2GBitmapUtils::BitBlt() - end: %d", err);
+    return err;
+}
+
+
+TInt M2GBitmapUtils::BitQBlt(QImage& aTargetQimage,
+                            const QImage& aSourceQimage,
+                            const TPoint& aPoint,
+                            const TRect* aRect,
+                            const CFbsBitmap* aSourceMask)
+{
+    M2G_DEBUG_2("M2G_DEBUG: M2GBitmapUtils::BitQBlt() - Point(x=%d, y=%d)", aPoint.iX, aPoint.iY);
+    
+    QPixmap pixmapTarget = QPixmap::fromImage(aTargetQimage);
+    CFbsBitmap* aTarget  = pixmapTarget.toSymbianCFbsBitmap();
+
+    QPixmap pixmapSource = QPixmap::fromImage(aSourceQimage);
+    CFbsBitmap* aSource = pixmapSource.toSymbianCFbsBitmap();
+
+    CFbsBitGc* context = NULL;
+    CFbsBitmapDevice* device = NULL;
+    TInt err = KM2GOk;
+    TRAP(err, (device = CFbsBitmapDevice::NewL(aTarget)));
+    if ((err == KM2GOk) && (device != NULL))
+    {
+        err = device->CreateContext(context);
+        if ((err == KM2GOk) && (context != NULL))
+        {
+            M2G_DEBUG_0("M2G_DEBUG: M2GBitmapUtils::BitBlt() - CFbsBitGc::BitBlt()");
+            if (aRect)
+            {
+                // Check if mask
+                if (aSourceMask)
+                {
+                    M2G_DEBUG_4("M2G_DEBUG: M2GBitmapUtils::BitBlt() -  mask rect(x1=%d, y1=%d, x2=%d, y2=%d)", aRect->iTl.iX, aRect->iTl.iY, aRect->iBr.iX, aRect->iBr.iY);
+                    // A pixel that is masked by a BLACK is NOT transferred to a destination rectangle.
+                    context->BitBltMasked(aPoint, aSource, *aRect, aSourceMask, ETrue);
+                    err = KM2GOk;
+                }
+                else
+                {
+                    M2G_DEBUG_4("M2G_DEBUG: M2GBitmapUtils::BitBlt() - rect(x1=%d, y1=%d, x2=%d, y2=%d)", aRect->iTl.iX, aRect->iTl.iY, aRect->iBr.iX, aRect->iBr.iY);
+                    context->BitBlt(aPoint, aSource, *aRect);
+                    err = KM2GOk;
+                }
+            }
+            else
+            {
+                M2G_DEBUG_0("M2G_DEBUG: M2GBitmapUtils::BitBlt() - no rect");
+                context->BitBlt(aPoint, aSource);
+                err = KM2GOk;
+            }
+        }
+    }
+    delete context;
+    delete device;
+    context = NULL;
+    device = NULL;
+    M2G_DEBUG_1("M2G_DEBUG: M2GBitmapUtils::BitBlt() - end: %d", err);
+    return err;
+}
+
+
+
+TInt M2GBitmapUtils::BitBlt(CBitmapContext& aTargetContext,
+                            const CFbsBitmap& aSource,
+                            const TPoint& aPoint,
+                            const TRect* aRect,
+                            const CFbsBitmap* aSourceMask,
+                            /*MSwtClient* aClientHandle,*/
+                            TBool aUseNativeClear /*= EFalse*/)
+{
+    M2G_DEBUG_2("M2G_DEBUG: M2GBitmapUtils::BitBlt() - Point(x=%d, y=%d)", aPoint.iX, aPoint.iY);
+    TInt err = KM2GOk;
+    TSWTBitBlt bitBlitter(aTargetContext, aPoint,
+                          &aSource, aRect, aSourceMask, aUseNativeClear);
+    bitBlitter();
+    M2G_DEBUG_1("M2G_DEBUG: M2GBitmapUtils::BitBlt() - end: %d", err);
+    return err;
+}
+
+// -----------------------------------------------------------------------------
+// TM2GRenderRect::TM2GRenderRect
+// -----------------------------------------------------------------------------
+TM2GRenderRect::TM2GRenderRect(
+    TInt aAnchorX, TInt aAnchorY,
+    TInt aClipX, TInt aClipY,
+    TInt aClipW, TInt aClipH)
+        : TRect(
+            TPoint(aClipX, aClipY),
+            TSize(aClipW, aClipH)),
+        iAnchorX(aAnchorX),
+        iAnchorY(aAnchorY)
+{
+}
+
+// -----------------------------------------------------------------------------
+// TM2GRenderRect::TM2GRenderRect
+// -----------------------------------------------------------------------------
+TM2GRenderRect::TM2GRenderRect(TInt* aDimensions, TInt /*aLength*/)
+        : TRect(
+            TPoint(aDimensions[EClipX], aDimensions[EClipY]),
+            TSize(aDimensions[EClipW], aDimensions[EClipH])),
+        iAnchorX(aDimensions[EAnchorX]),
+        iAnchorY(aDimensions[EAnchorY])
+{
+}
+
+// -----------------------------------------------------------------------------
+// TM2GRenderRect::~TM2GRenderRect
+// -----------------------------------------------------------------------------
+TM2GRenderRect::~TM2GRenderRect()
+{
+}
+
+// -----------------------------------------------------------------------------
+// TM2GRenderRect::TM2GRenderRect
+// -----------------------------------------------------------------------------
+TM2GRenderRect::TM2GRenderRect(const TM2GRenderRect& aRd)
+{
+    (*this = aRd);
+}
+
+// -----------------------------------------------------------------------------
+// TM2GRenderRect::operator=
+// -----------------------------------------------------------------------------
+TM2GRenderRect& TM2GRenderRect::operator=(const TM2GRenderRect& aRd)
+{
+    if (this != &aRd)
+    {
+        iAnchorX = aRd.iAnchorX;
+        iAnchorY = aRd.iAnchorY;
+        SetRect(aRd.iTl.iX, aRd.iTl.iY, aRd.iBr.iX, aRd.iBr.iY);
+    }
+    return *this;
+}
+
+// -----------------------------------------------------------------------------
+// TM2GRenderRect::GetRegionSizeInPixels
+// -----------------------------------------------------------------------------
+TSize TM2GRenderRect::GetRegionSizeInPixels(
+    TM2GRenderRect& aRect,
+    const TSize& aSz)
+{
+    return TSize(
+               // determine the width of the region to be paint
+               M2GGeneral::Min< TInt >(aRect.GetAnchorX() + aSz.iWidth, aRect.GetClipX() + aRect.GetClipW()) -
+               M2GGeneral::Max< TInt >(aRect.GetAnchorX(), aRect.GetClipX()),
+               // determine the height of the region to be paint
+               M2GGeneral::Min< TInt >(aRect.GetAnchorY() + aSz.iHeight, aRect.GetClipY() + aRect.GetClipH()) -
+               M2GGeneral::Max< TInt >(aRect.GetAnchorY(), aRect.GetClipY()));
+}
+
+
+// -----------------------------------------------------------------------------
+// TM2GBitmapLock::TM2GBitmapLock
+// -----------------------------------------------------------------------------
+TM2GBitmapLock::TM2GBitmapLock(const CFbsBitmap* aBitmap, TBool aLock)
+        : iBitmap(aBitmap), iIsLocked(EFalse)
+{
+    if (aLock)
+    {
+        Lock();
+    }
+}
+
+// -----------------------------------------------------------------------------
+// TM2GBitmapLock::~TM2GBitmapLock
+// -----------------------------------------------------------------------------
+TM2GBitmapLock::~TM2GBitmapLock()
+{
+    Unlock();
+}
+
+// -----------------------------------------------------------------------------
+// TM2GBitmapLock::Lock()
+// -----------------------------------------------------------------------------
+void TM2GBitmapLock::Lock()
+{
+    if (iBitmap && !iIsLocked)
+    {
+        iBitmap->LockHeap();
+        iIsLocked = ETrue;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// TM2GBitmapLock::Unlock()
+// -----------------------------------------------------------------------------
+void TM2GBitmapLock::Unlock()
+{
+    if (iBitmap && iIsLocked)
+    {
+        iBitmap->UnlockHeap();
+        iIsLocked = EFalse;
+    }
+}
+
+TSWTBitBlt::TSWTBitBlt(CBitmapContext& aTargetContext,
+                       const TPoint& aPoint,
+                       const CFbsBitmap* aBitmap,
+                       const TRect* aSourceRect,
+                       const CFbsBitmap* aMaskBitmap,
+                       TBool aUseNativeClear)
+        : iTargetContext(aTargetContext),
+        iPoint(aPoint),
+        iUseNativeClear(aUseNativeClear)
+{
+    iBitmap = aBitmap;
+    iRect = aSourceRect;
+    iMaskBitmap = aMaskBitmap;
+}
+void TSWTBitBlt::operator()() const
+{
+    M2G_DEBUG_0("TSWTBitBlt()+");
+    CFbsBitmap* tempBitmap = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL(tempBitmap);
+    User::LeaveIfError(tempBitmap->Duplicate(iBitmap->Handle()));
+    if (iRect)
+    {
+        if (iUseNativeClear)
+        {
+            iTargetContext.SetBrushColor(KRgbWhite);
+            iTargetContext.Clear(*iRect);
+        }
+        if (iMaskBitmap)
+        {
+            CFbsBitmap* tempMask = new(ELeave) CFbsBitmap;
+            CleanupStack::PushL(tempMask);
+            User::LeaveIfError(tempMask->Duplicate(iMaskBitmap->Handle()));
+            iTargetContext.BitBltMasked(
+                iPoint, tempBitmap, *iRect, tempMask, ETrue);
+            CleanupStack::PopAndDestroy(tempMask);
+        }
+        else
+        {
+            iTargetContext.BitBlt(iPoint, tempBitmap, *iRect);
+        }
+    }
+    else
+    {
+        if (iUseNativeClear)
+        {
+            iTargetContext.SetBrushColor(KRgbWhite);
+            iTargetContext.Clear();
+        }
+        iTargetContext.BitBlt(iPoint, tempBitmap);
+    }
+    CleanupStack::PopAndDestroy(tempBitmap);
+    M2G_DEBUG_0("TSWTBitBlt()-");
+}
+//TODO Check for M2G_DO_LOCK M2G_DO_UNLOCK 
+//TODO Put Check for aSvgProxyHandle in all the functions.
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GDocument.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,445 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GDocument.h"
+#include "MM2GSVGProxy.h"
+
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_createDocument
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::CreateDocumentL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aData Document data
+ * @param aHandle Document handle to be returned
+ * @throws Exception if not ok
+*/
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1createDocument(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jstring aData)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _createDocument - begin");
+    
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt err    = KM2GNotOk;
+    JStringUtils data(*aJni, aData);
+    //RJString data(*aJni, aData);
+    TPtrC16* bData = STATIC_CAST(TPtrC16*, &data);
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->CreateDocumentL(*bData, handle););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, M2G_INVALID_HANDLE); 
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _createDocument: %d - end", handle);
+    return handle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_createElementNS
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::CreateElementNsL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aType Element type id.
+ * @param aDocumentHandle Document handle.
+ * @param aHandle Element handle to be returned
+ * @throws Exception if not ok
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1createElementNS(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jshort aType,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _createElementNS - begin");
+
+    // Execute native engine method
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->CreateElementNsL(
+                aType,
+                aDocumentHandle,
+                handle);    );
+        
+        }
+    M2G_DO_UNLOCK(aJni) 
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _createElementNS: %d - end", handle);
+    return handle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_deleteDocument
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::DeleteDocumentL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle
+ * @throws Exception if not ok
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1deleteDocument(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle )
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _deleteDocument - begin");
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    // Extract the SVGProxy handle
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->DeleteDocumentL(aDocumentHandle););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _deleteDocument - end");
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_getElementById
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetElementByIdL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aId Element ID.
+ * @param aHandle Element handle to be returned.
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1getElementById(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jstring aId)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getElementById - begin");
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt err    = KM2GNotOk;
+    //RJString id(*aJni, aId);
+    JStringUtils id(*aJni, aId);
+    TPtrC16* lId = STATIC_CAST(TPtrC16*, &id);
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->GetElementByIdL(aDocumentHandle, *lId, handle););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _getElementById: %d - end", handle);
+    return handle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_getViewportHeight
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetViewportHeightL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aHeight Height to be returned.
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1getViewportHeight(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getViewportHeight - begin");
+    TInt err    = KM2GNotOk;
+    TInt height = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->GetViewportHeightL(aDocumentHandle, height););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _getViewportHeight: %d - end", height);
+    return height;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_getViewportWidth
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetViewportWidthL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aWidth Width to be returned.
+ * Class: com_nokia_microedition_m2g_M2GDocument
+ * Method: _getViewportWidth
+ * Signature:
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1getViewportWidth(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _getViewportWidth - begin");
+    TInt   err = KM2GNotOk;
+    TInt width = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->GetViewportWidthL(aDocumentHandle, width););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _getViewportWidth: %d - end", width);
+    return width;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_isElementInDom
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::IsElementInDomL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aElementHandle Element pointer.
+ * @param aIsElementInDom Result
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1isElementInDOM(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI _isElementInDOM - begin");
+    TInt isElementInDom = -1;
+    TInt            err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+            MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+            TRAP(err,aProxy->IsElementInDomL(
+                aDocumentHandle, aElementHandle, isElementInDom););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI _isElementInDOM: %d - end", isElementInDom);
+    return isElementInDom;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_requestCompleted
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::RequestCompletedL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aURI Resource uri
+ * @param aResourceData Resource data
+ * @param aCompleted Result
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1requestCompleted(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jstring aURI,
+    jbyteArray aResourceData)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _requestCompleted - begin");
+
+    //RJString uri(*aJni, aURI);
+    JStringUtils uri(*aJni, aURI);
+    TInt err = KM2GNotOk;
+    TPtrC8 lResData8;
+    jbyte* resBytes = NULL;
+
+    if (aResourceData)
+        {
+        resBytes  = aJni->GetByteArrayElements(aResourceData, NULL);
+        lResData8.Set(REINTERPRET_CAST(TUint8*, resBytes), aJni->GetArrayLength(aResourceData));
+        }
+
+    TInt completed = -1;
+    TPtrC16* pUri = STATIC_CAST(TPtrC16*, &uri);
+    
+    M2G_DO_LOCK
+    
+    if (aSvgProxyHandle)
+        {
+        
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        
+        TRAP(err,    aProxy->RequestCompletedL(
+                aDocumentHandle,
+                *pUri,
+                lResData8,
+                completed););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    if (aResourceData)
+        {
+        aJni->ReleaseByteArrayElements(aResourceData, resBytes, JNI_ABORT);   // don't copy back
+        }
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GDocument ) _requestCompleted: %d - end", completed);
+
+    return completed;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_setViewportHeight
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetViewportHeightL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aHeight Height
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1setViewportHeight(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jint aHeight)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportHeight - begin");
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->SetViewportHeightL(
+                (TM2GSvgDocumentHandle)aDocumentHandle, aHeight););
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportHeight - end");
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GDocument::_setViewportWidth
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetViewportWidthL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aWidth Width
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GDocument__1setViewportWidth(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jint aWidth)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportWidth - begin");
+    TInt err = KM2GNotOk;
+ 
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+            MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+            TRAP(err,    aProxy->SetViewportWidthL(
+                    (TM2GSvgDocumentHandle)aDocumentHandle, aWidth););
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GDocument ) _setViewportWidth - end");
+}
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GManager.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GManager.h"
+#include "CM2GSVGProxy.h"
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GManager::_createSvgEngine
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::CreateSvgEngineL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aHandle Svg engine handle
+*/
+/**
+ * JNI method
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GManager__1createSvgEngine(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _createSvgEngine - begin");
+    
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        TRAP(err,JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle)->CreateSvgEngineL(handle););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    handle = M2GGeneral::CheckErrorCodeAndHandle(
+                        aJni, err, handle, M2G_INVALID_HANDLE); 
+    
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _createSvgEngine: %d - end", handle);
+    return handle;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GManager::_createSvgProxy
+// -----------------------------------------------------------------------------
+/**
+ * Creates an svg proxy.
+ * @since Series S60 3.0
+ * @param Svg proxy handle
+/**
+ * JNI method
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GManager__1createSvgProxy(
+    JNIEnv* aJni,jclass)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _createSvgProxy - begin");
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt    err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    TRAP(err, MM2GSVGProxy* proxy = CM2GSVGProxy::NewL(); handle = JavaMakeHandle(proxy););
+    M2G_DO_UNLOCK(aJni)
+
+    handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _createSvgProxy: %d - end", handle);
+    return handle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GManager::_deleteSvgEngine
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::DeleteSvgEnginedL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ 
+/**
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GManager__1deleteSvgEngine(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aSvgEngineHandle   )
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgEngine - begin");
+    
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+           TRAP(err,JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle)->DeleteSvgEngineL(
+           STATIC_CAST(TM2GSvgEngineHandle, aSvgEngineHandle)););
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgEngine: - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GManager::_deleteSvgProxy
+// -----------------------------------------------------------------------------
+/**
+ * Deletes a proxy object. NOTE: The proxy object has to be deleted inside same
+ * thread as it was created, otherwice there will be problem to delete a CFbsBitmap
+ * server object inside the SVGTopt componenet see KATA-6KYA9T (SVGEngineJI: SVGTopt
+ * crashes when deleting svg document object that contains external resource)
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+
+/**
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GManager__1deleteSvgProxy(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgProxy - begin");
+    TInt            err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* proxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,delete proxy;);
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _deleteSvgProxy: - end");
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GManager::_finalizeEventSource
+// -----------------------------------------------------------------------------
+/**
+ * JNI method TODO check this function for modifications
+ */
+//JNIEXPORT void JNICALL
+//Java_com_nokia_microedition_m2g_M2GManager__1finalizeEventSource(
+//    JNIEnv *aJni, jclass, jint aEventSourceHandle, jboolean aUiToolkit)
+//{
+//    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _finalizeEventSource: %d", aEventSourceHandle);
+//    if (aUiToolkit)
+//    {
+////        MSwtClient* client  = reinterpret_cast< MSwtClient* >(aEventSourceHandle);
+////        if (client)
+////        {
+////            delete client;
+////            client = NULL;
+////        }
+//    }
+//    else
+//    {
+//        CM2GEventSource* eventSource = JavaUnhand< CM2GEventSource >(aEventSourceHandle);
+//        if (eventSource)
+//        {
+//            eventSource->Dispose(*aJni);
+//        }
+//        eventSource = NULL;
+//    }
+//}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GManager::_initEventSource
+// -----------------------------------------------------------------------------
+/**
+ * JNI method TODO check this function for modifications
+ 
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GManager__1initEventSource(
+    JNIEnv *aJni,
+    jclass aPeer,
+    jint aServer)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _initEventSource - begin");
+
+    M2G_DO_LOCK
+    TRAPD(eventSourceHandle, eventSourceHandle = CM2GEventSource::NewL(
+                *aJni, aPeer, aServer));
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckHandle(aJni, eventSourceHandle);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _initEventSource - end: %d", eventSourceHandle);
+    return eventSourceHandle;
+}*/
+////TODO check this function for modifications
+//JNIEXPORT jint JNICALL
+//Java_com_nokia_microedition_m2g_M2GManager__1initSwtEventSource(
+//    JNIEnv *aJni,
+//    jclass /*aPeer*/)
+//{
+//    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GManager ) _initEventSource - begin");
+//
+//    MSwtClient* client = NULL;
+//    TRAP_IGNORE(client = SWT::CreateClientL());
+//    if (!client)
+//    {
+//        return KErrNotFound;
+//    }
+//    M2GGeneral::CheckHandle(aJni, (int)client);
+//    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GManager ) _initEventSource - end: %d", eventSourceHandle);
+//    return (int)client;
+//}
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GSVGAnimationElement.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GSVGAnimationElement.h"
+#include "MM2GSVGProxy.h"
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGAnimationElement::_beginElementAt
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::BeginElementAtL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle
+ * @param aElementHandle Element handle
+ * @param aOffset Offset time
+ * @throws Exception if not ok.
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGAnimationElement__1beginElementAt(
+    JNIEnv* aJni,
+    jobject,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jint aElementHandle,
+    jfloat aOffset,
+    jfloat aCurrentTime)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGAnimationElement ) _beginElementAt - begin");
+    TInt err = KM2GNotOk;
+    
+    if (aSvgProxyHandle && aDocumentHandle)
+        {
+            MM2GSVGProxy* aProxy =    JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+            TInt16 restartAttribute;
+            
+            TRAP(err, aProxy->GetEnumTraitL(
+                        STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+                        STATIC_CAST(TM2GSvgAttrType, KM2GRestartAttribute),
+                        restartAttribute);
+                    )
+            
+            TInt isActive;
+            TRAP(err, aProxy->IsActiveL(STATIC_CAST(TM2GSvgElementHandle, aElementHandle), isActive); ) 
+            
+            if (isActive && (restartAttribute == KM2GRestartWhenNotActive))
+            {
+                M2G_DEBUG_1("M2G_DEBUG: M2GSVGAnimationElement::DoBeginElementAtL() - active & restart att:%d", restartAttribute);
+            }
+            else if ((aCurrentTime != 0) && (restartAttribute == KM2GRestartNever))
+            {
+                // Cannot restart even if animation hasn't ended?
+                M2G_DEBUG_1("M2G_DEBUG: M2GSVGAnimationElement::DoBeginElementAtL() - not active & restart att:%d", restartAttribute);
+            }
+            else
+                {
+                    M2G_DEBUG_2("M2G_DEBUG: M2GSVGAnimationElement::DoBeginElementAtL() - offset:%f & current:%f", aOffset, aCurrentTime);
+                    TRAP(err,   aProxy->BeginElementAtL(
+                                STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+                                STATIC_CAST(TM2GSvgElementHandle, aElementHandle), 
+                                (aOffset+aCurrentTime) );
+                    )
+                }
+        }
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGAnimationElement ) _beginElementAt - end");
+    
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGAnimationElement::_endElementAt
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::EndElementAt method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle
+ * @param aElementHandle Element handle
+ * @param aOffset Offset time
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGAnimationElement__1endElementAt(
+    JNIEnv* aJni,
+    jobject,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jint aElementHandle,
+    jfloat aOffset)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGAnimationElement ) _endElementAt - begin");
+    TInt err = KM2GNotOk;
+    
+    MM2GSVGProxy* aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+    
+    TRAP(err,  aProxy->EndElementAtL(STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+               STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+               aOffset);
+            )
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGAnimationElement ) _endElementAt - end");
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGAnimationElement::_isActive
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::EndElementAt method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ */
+JNIEXPORT jboolean JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGAnimationElement__1isActive(
+    JNIEnv* aJni,
+    jobject,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGAnimationElement ) _isActive - begin");
+    TInt err = KM2GNotOk;
+    TInt active = 0;
+    MM2GSVGProxy* aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+    
+    TRAP(err, aProxy->IsActiveL(
+              STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+              active);
+        )
+  
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGAnimationElement ) _isActive: %d - end", active);
+    return STATIC_CAST(jboolean, (active == 1 ? ETrue : EFalse));
+}
+
+M2G_NS_END
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GSVGElement.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,1141 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GSVGElement.h"
+#include "MM2GSVGProxy.h"
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_appendChild
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::AppendChildL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aChildElementHandle Child handle
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1appendChild(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jint aChildElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _appendChild - begin");
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,   aProxy->AppendChildL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgElementHandle, aChildElementHandle)); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _appendChild - end");
+    M2GGeneral::CheckErrorCode(aJni, err);
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_checkRemoveable
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::CheckRemoveableL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aRemoveable Result
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_microedition_m2g_M2GSVGElement__1checkRemoveable(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    TInt removeable = -1;
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _checkRemoveable - begin");
+    TInt err = KM2GNotOk;
+    
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+    
+        TRAP(err, aProxy->CheckRemoveableL(aElementHandle, removeable););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _checkRemoveable: %d - end", removeable);
+    return removeable;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getBBox
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetBBoxL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aRectData Returns rect components
+ * @param aResult Result "0" ok
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getBBox(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jfloatArray aRectComponents)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getBBox - begin");
+
+    TM2GRectData rect;
+    TInt result = 0;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetBBoxL(
+           STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+           STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+           rect, result); );
+        }
+    M2G_DO_UNLOCK(aJni)
+  
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    aJni->SetFloatArrayRegion(
+        REINTERPRET_CAST(jfloatArray, aRectComponents),
+        0,
+        rect.Count(), REINTERPRET_CAST(jfloat*, rect.Begin()));
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getBBox: %d - end", result);
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getColorTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetColorTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aColors Color elements ( RGB )
+ * @param aTrait Result
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getColorTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jintArray aColorComponents)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getColorTrait - begin");
+    TM2GColorData color;
+    TInt result = -1;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err, aProxy->GetColorTraitL(
+            aElementHandle,
+            aAttributeTypeId,
+            color,
+            result); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    if (color[ 0 ] == -1 && color[ 1 ] == -1 && color[ 2 ] == -1)
+    {
+        result = 0;
+        aJni->SetIntArrayRegion(aColorComponents, 0, color.Count(), &(color[ 0 ]));
+    }
+    else if (result != -1)
+    {
+        result = 1;
+        aJni->SetIntArrayRegion(aColorComponents, 0, color.Count(),  color.Begin());
+    }
+
+    M2G_DEBUG_4("M2G_DEBUG: JNI ( M2GSVGElement ) _getColorTrait: %d, R=%d, G=%d, B=%d - end", result, color[ 0 ], color[ 1 ], color[ 2 ]);
+    return result;
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getElementTypeId
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetElementTypeIdL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aId
+ */
+JNIEXPORT jshort JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getElementTypeId(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getElementTypeId - begin");
+    TInt16 id = 0;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,  aProxy->GetElementTypeIdL(aElementHandle, id); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getElementTypeId: %d - end", id);
+    return id;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getEnumTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetEnumTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aEnumTrait The enumeration value of the specified attribute
+ */
+JNIEXPORT jshort JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getEnumTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getEnumTrait - begin");
+    TInt16 enumTrait = 0;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetEnumTraitL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+            enumTrait); );
+        }
+    M2G_DO_UNLOCK(aJni)
+        
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getEnumTrait: %d - end", enumTrait);
+    return enumTrait;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getFirstElementChild
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetFirstElementChildL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aHandle Element handle to be returned.
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getFirstElementChild(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getFirstElementChild - begin");
+
+    TInt childHandle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err, aProxy->GetFirstElementChildL(aElementHandle, childHandle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getFirstElementChild: %d - end", childHandle);
+    return childHandle;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getFloatTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetFloatTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aFloatTrait Float attribute to be returned
+ */
+JNIEXPORT jfloat JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getFloatTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getFloatTrait - begin");
+    TInt err = KM2GNotOk;
+    TReal32 floatTrait = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+       MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+       TRAP(err ,aProxy->GetFloatTraitL(
+           STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+           STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+           floatTrait););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getFloatTrait: %f - end", floatTrait);
+    return STATIC_CAST(jfloat, floatTrait);
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getMatrixTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetMatrixTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aResult Result: "0" if ok and "-1" if nok
+ s*/
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getMatrixTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jfloatArray aMatrixComponents)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getMatrixTrait - begin");
+    TM2GMatrixData matrix;
+    TInt result = -1;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetMatrixTraitL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+             matrix, result); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    if (M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk)
+    {
+        // Init matrix object
+        jfloat* components = aJni->GetFloatArrayElements(aMatrixComponents, 0);
+        TInt count =
+            M2GGeneral::Min(aJni->GetArrayLength(aMatrixComponents), matrix.Count());
+        for (TInt index = 0; index < count; index++)
+        {
+            components[ index ] = matrix[ index ];
+        }
+        // Release data source
+        aJni->ReleaseFloatArrayElements(aMatrixComponents, components, 0);
+    }
+
+    M2G_DEBUG_6("M2G_DEBUG: JNI ( M2GSVGElement ) _getMatrixTrait: %f, %f, %f, %f, %f, %f - end", matrix[ 0 ], matrix[ 1 ], matrix[ 2 ], matrix[ 3 ], matrix[ 4 ], matrix[ 5 ]);
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getNextElementSibling
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetNextElementSiblingL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aSiblingHandle Sibling handle
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getNextElementSibling(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getNextElementSibling - begin");
+    TInt siblingHandle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+           MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+           TRAP(err, aProxy->GetNextElementSiblingL(aElementHandle, siblingHandle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+   
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getNextElementSibling: %d - end", siblingHandle);
+    return siblingHandle;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getParent
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetParentL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aParentHandle Parent handle to be returned.
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getParent(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getParent - begin");
+    TInt parentHandle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,    aProxy->GetParentL(aElementHandle, parentHandle););
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getParent: %d - end", parentHandle);
+    return parentHandle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getPathTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetPathTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aAttributeTypeId Attribute type.
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getPathTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getPathTrait - begin");
+    TInt aPathTrait = 0;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetPathTraitL(
+           STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+           STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+           aPathTrait); );
+        }
+    M2G_DO_UNLOCK(aJni)
+ 
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getPathTrait: %d - end", aPathTrait);
+    return aPathTrait;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getRectTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetRectTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aRectData Returns rect components
+ * @param aResult Result "0" if ok and "-1" if nok
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getRectTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jfloatArray aRectComponents)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait - begin");
+    TM2GRectData rect;
+    TInt result = 0;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err , aProxy->GetRectTraitL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+            rect, result); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    aJni->SetFloatArrayRegion(
+        REINTERPRET_CAST(jfloatArray, aRectComponents),
+        0,
+        rect.Count(), REINTERPRET_CAST(jfloat*, rect.Begin()));
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait: %d - end", result);
+    return result;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getRootElement
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetRootElementL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aRootElementHandle Root element handle
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getRootElement(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRootElement - begin");
+    TInt rootElementHandle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetRootElementL(
+           STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+           rootElementHandle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+ 
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getRootElement: %d - end", rootElementHandle);
+    return rootElementHandle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getScreenBBox
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetScreenBBoxL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aRectData Returns rect components
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getScreenBBox(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jfloatArray aScreenBBoxComponents)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getScreenBBox - begin");
+    TM2GScreenBBoxData screenBBox;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetScreenBBoxL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            screenBBox); );
+        }
+    M2G_DO_UNLOCK(aJni)
+ 
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    aJni->SetFloatArrayRegion(
+        REINTERPRET_CAST(jfloatArray, aScreenBBoxComponents),
+        0,
+        screenBBox.Count(), REINTERPRET_CAST(jfloat*, screenBBox.Begin()));
+
+    M2G_DEBUG_4("M2G_DEBUG: JNI ( M2GSVGElement ) _getScreenBBox: %f, %f, %f, %f - end", screenBBox[ 0 ], screenBBox[ 1 ], screenBBox[ 2 ], screenBBox[ 3 ]);
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getStringTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetStringTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aAttributeTypeId Attribute type.
+ * @param aAttribute Returns a string attribute
+ */
+JNIEXPORT jstring JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getStringTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getStringTrait - begin");
+
+    TPtrC16 attribute;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetStringTraitL(
+           STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+           STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+           attribute); );
+        }
+    M2G_DO_UNLOCK(aJni)
+   
+    if ((M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk) &&
+            (attribute.Length() > 0))
+    {
+        return CreateJavaString(*aJni, attribute);
+    }
+
+    return NULL;
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getStringTrait: %d - end", err);
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_getUsedFromElement
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetUsedFromElementL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aHandle Return element handle
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1getUsedFromElement(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getUsedFromElement - begin");
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->GetUsedFromElementL(
+        STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+        handle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+ 
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _getUsedFromElement: %d - end", handle);
+    return handle;
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_insertBefore
+// -----------------------------------------------------------------------------
+/**
+ * Class: com_nokia_microedition_m2g_M2GSVGElement
+ * Method: insertBefore
+ * Signature:
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1insertBefore(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jint aNewChildElementHandle,
+    jint aReferenceElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _insertBefore - begin");
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+    
+        TRAP(err, aProxy->InsertBeforeL(
+          STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+          STATIC_CAST(TM2GSvgElementHandle, aNewChildElementHandle),
+          STATIC_CAST(TM2GSvgElementHandle, aReferenceElementHandle)); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _insertBefore - end");
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_isUsed
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::IsUsedL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aResult Return "1" if used otherwise returns "0"
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1isUsed(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle )
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _isUsed - begin");
+    TInt result = KM2GNotOk;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err, aProxy->IsUsedL(STATIC_CAST(TM2GSvgElementHandle, aElementHandle), result); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _isUsed: %d - end", result);
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_removeChild
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::RemoveChild method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aChildElementHandle child element pointer
+ * @param aHandle Handle to removed element.
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1removeChild(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jint aChildElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _removeChild - begin");
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+         TRAP(err ,aProxy->RemoveChildL(
+           STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+           STATIC_CAST(TM2GSvgElementHandle, aChildElementHandle), handle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+  
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _removeChild: %d - end", handle);
+    return handle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setColorTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetColorTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aAttributeTypeId -
+ * @param aColorData -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setColorTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jint aRed, jint aGreen, jint aBlue)
+{
+    M2G_DEBUG_3("M2G_DEBUG: JNI ( M2GSVGElement ) _setColorTrait: R=%d, G=%d, B=%d - begin", aRed, aGreen, aBlue);
+    TM2GColorData color;
+    color[ 0 ] = aRed;
+    color[ 1 ] = aGreen;
+    color[ 2 ] = aBlue;
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+           MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+           TRAP(err, aProxy->SetColorTraitL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+            color); );
+        }
+    M2G_DO_UNLOCK(aJni)
+ 
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _setColorTrait: %d - end", err);
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setEnumTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetEnumTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aAttributeTypeId -
+ * @param aValue 
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setEnumTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jshort aValue)
+{
+    M2G_DEBUG_2("M2G_DEBUG: JNI ( M2GSVGElement ) _setEnumTrait: type=%d, value=%d - begin", aAttributeTypeId, aValue);
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+    
+        TRAP(err, aProxy->SetEnumTraitL(
+        STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+        STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+        aValue); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setEnumTrait - end");
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setFloatTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetFloatTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element pointer.
+ * @param aAttributeTypeId -
+ * @param aValue -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setFloatTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jfloat aValue)
+{
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGElement ) _setFloatTrait: %f - begin", aValue);
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->SetFloatTraitL(
+        STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+        STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+        aValue); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setFloatTrait: - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setMatrixTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetMatrixTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aMatrixData -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setMatrixTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jfloatArray aMatrixComponents)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setMatrixTrait - begin");
+    TInt err = KM2GNotOk;
+    TM2GMatrixData matrix;
+    // Init matrix object
+    jfloat* components = aJni->GetFloatArrayElements(aMatrixComponents,0);
+    TInt count = aJni->GetArrayLength(aMatrixComponents);
+    for (TInt index = 0; index < count; index++)
+    {
+        matrix[ index ] = components[ index ];
+    }
+    // Release data source
+    aJni->ReleaseFloatArrayElements(aMatrixComponents, components, JNI_ABORT);
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err, aProxy->SetMatrixTraitL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+            matrix); );
+        }
+    M2G_DO_UNLOCK(aJni)
+   
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_6("JNI ( M2GSVGElement ) _setMatrixTrait: %f, %f, %f, %f, %f, %f - end", matrix[ 0 ], matrix[ 1 ], matrix[ 2 ], matrix[ 3 ], matrix[ 4 ], matrix[ 5 ]);
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setPathTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetPathTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aMatrixData -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setPathTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jint aPathHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setPathTrait - begin");
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+
+        TRAP(err,aProxy->SetPathTraitL(
+           STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+           STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+           STATIC_CAST(TM2GSvgPathHandle, aPathHandle)); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setPathTrait - end");
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setRectTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetRectTraitL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aMatrixData -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setRectTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jfloat aX, jfloat aY, jfloat aWidth, jfloat aHeight)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setRectTrait - begin");
+    TM2GRectData rect;
+    rect[ 0 ] = aX;
+    rect[ 1 ] = aY;
+    rect[ 2 ] = aWidth;
+    rect[ 3 ] = aHeight;
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+    
+        TRAP(err,  aProxy->SetRectTraitL(
+                STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+                STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+                rect); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _getRectTrait - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGElement::_setStringTrait
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetStringTraitL method.
+ * @since Series S60 3.0
+ * @param aElementHandle Element handle
+ * @param aAttributeTypeId Attribute type id
+ * @param aString -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGElement__1setStringTrait(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aElementHandle,
+    jshort aAttributeTypeId,
+    jstring aValue)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setStringTrait - begin");
+    //RJString str(*aJni, aValue);
+    JStringUtils str(*aJni, aValue);
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TPtrC16 lValue=STATIC_CAST(TPtrC16, str);
+        
+        TRAP(err, aProxy->SetStringTraitL(
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle),
+            STATIC_CAST(TM2GSvgAttrType, aAttributeTypeId),
+            lValue); );
+        }
+    M2G_DO_UNLOCK(aJni)
+   
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGElement ) _setStringTrait - end");
+}
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GSVGImage.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,269 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GSVGImage.h"
+#include "MM2GSVGProxy.h"
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_dispatchMouseEvent
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::DispatchMouseEventL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle.
+ * @param aX X coordinate.
+ * @param aY Y coordinate
+ * @param aElementHandle Target element handle
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGImage__1dispatchMouseEvent(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle, jint aX, jint aY)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGImage ) _dispatchMouseEvent - begin");
+
+    TInt elementHandle = M2G_INVALID_HANDLE;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+            MM2GSVGProxy *  aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+            TRAP(err, aProxy->DispatchMouseEventL(
+                    STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+                    aX, aY, elementHandle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGImage ) _dispatchMouseEvent: %d - end", elementHandle);
+    return elementHandle;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_focusOn
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::FocusOnL method.
+ * @since Series S60 3.1
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle.
+ * @param aElementHandle Target element handle
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGImage__1focusOn(
+    JNIEnv* /* aJni */,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle, jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGImage ) _focusOn - begin");
+
+    // TInt elementHandle = M2G_INVALID_HANDLE;
+     TInt err = KM2GNotOk;  
+     
+     if (aSvgProxyHandle)
+         {
+         MM2GSVGProxy *     aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+         TRAP(err, aProxy->FocusOnL(
+                 STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+                 STATIC_CAST(TM2GSvgElementHandle, aElementHandle)); ); 
+         }
+     
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGImage ) _focusOn: %d - end", err);
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_focusOut
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::FocusOutL method.
+ * @since Series S60 3.1
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle.
+ * @param aElementHandle Target element handle
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGImage__1focusOut(
+    JNIEnv* /* aJni */,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle, jint aElementHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGImage ) _focusOut - begin");
+    TInt err = KM2GNotOk; 
+    
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy *    aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err,aProxy->FocusOutL(
+            STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+            STATIC_CAST(TM2GSvgElementHandle, aElementHandle));  ); 
+        }
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGImage ) _focusOut: %d - end", err);
+
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_getExternalListItem
+// EXTENSION
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetExternalListItemL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aIndex External item index.
+ * @param aItem External item
+ * @throws Exception if not ok
+ * JNI method
+ */
+JNIEXPORT jstring JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGImage__1getExternalListItem(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jint aIndex)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGImage ) _getExternalListItem - begin");
+    TPtrC16 lItem;
+    TInt err    = KM2GNotOk;
+        
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+         MM2GSVGProxy * aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+         TRAP(err, aProxy->GetExternalListItemL(
+                             STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+                             aIndex,
+                             lItem); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    if ((M2GGeneral::CheckErrorCode(aJni, err) == KM2GOk) && (lItem.Length() > 0))
+    {
+        return CreateJavaString(*aJni, lItem);
+    }
+
+    return NULL;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_getExternalListSize
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetExternalListItemL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle.
+ * @param aListSz List size to be returned.
+ */
+JNIEXPORT TInt JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGImage__1getExternalListSize(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGImage ) _getExternalListSize - begin");
+
+    // TInt elementHandle = M2G_INVALID_HANDLE;
+    TInt err           = KM2GNotOk;
+    TInt listSz = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+         MM2GSVGProxy *  aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+         TRAP(err, aProxy->GetExternalListSizeL(
+                STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle), listSz); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGImage ) _getExternalListSize: %d - end", listSz);
+    return listSz;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_getExternalListItem
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetExternalListItemL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document pointer.
+ * @param aIndex Index.
+ * @param aStrBuf Returns a string
+ * @throws Exception if not ok
+ * JNI method
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGImage__1initViewport(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGImage ) _initViewport - begin");
+    // TInt elementHandle = M2G_INVALID_HANDLE;
+     TInt err           = KM2GNotOk;
+     
+     if (aSvgProxyHandle)
+         {
+           MM2GSVGProxy * aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+           TRAP(err, aProxy->InitViewportL(
+                STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle));  ); 
+         }
+     M2GGeneral::CheckErrorCode(aJni, err);
+     
+     M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGImage ) _initViewport: %d - end", err);
+
+}
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GSVGPath.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,404 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GSVGPath.h"
+#include "MM2GSVGProxy.h"
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_addClose
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::AddCloseL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1addClose(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _addClose - begin");
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+        TRAP(err, aProxy->AddCloseL(STATIC_CAST(TM2GSvgPathHandle, aPathHandle)); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _addClose - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_addCurve
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::AddCurveTo method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @param aPathCurveData Curve parameters
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1addCurveTo(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle,
+    jfloat aX1, jfloat aY1, jfloat aX2, jfloat aY2, jfloat aX3, jfloat aY3 )
+{
+    M2G_DEBUG_6("M2G_DEBUG: JNI ( M2GSVGPath ) _addCurveTo: X1=%f, Y1=%f, X2=%f, Y2=%f, X3=%f, Y3=%f - begin", aX1, aY1, aX2, aY2, aX3, aY3);
+    TInt err = KM2GNotOk;
+
+    TM2GPathCurveData curve;
+              curve[ 0 ] = STATIC_CAST(TReal32, aX1);
+              curve[ 1 ] = STATIC_CAST(TReal32, aY1);
+              curve[ 2 ] = STATIC_CAST(TReal32, aX2);
+              curve[ 3 ] = STATIC_CAST(TReal32, aY2);
+              curve[ 4 ] = STATIC_CAST(TReal32, aX3);
+              curve[ 5 ] = STATIC_CAST(TReal32, aY3);
+
+      M2G_DO_LOCK        
+      if (aSvgProxyHandle)
+          {
+          MM2GSVGProxy* aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+          TRAP(err,    aProxy->AddCurveToL(
+                 STATIC_CAST(TM2GSvgPathHandle, aPathHandle),
+                 curve); );
+          }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _addCurveTo - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_addLineTo
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::AddLineToL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @param aX -
+ * @param aY - 
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1addLineTo(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle,
+    jfloat aX, jfloat aY )
+{
+    M2G_DEBUG_2("M2G_DEBUG: JNI ( M2GSVGPath ) _addLineTo: X=%f, Y=%f - begin", aX, aY);
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+        TRAP(err,     aProxy->AddLineToL(STATIC_CAST(TM2GSvgPathHandle, aPathHandle), *(REINTERPRET_CAST(TReal32*, &aX)), *(REINTERPRET_CAST(TReal32*, &aY))); );
+    
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _addLineTo - end");
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_addMoveTo
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::AddMoveToL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @param aX -
+ * @param aY -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1addMoveTo(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle,
+    jfloat aX,
+    jfloat aY)
+{
+    M2G_DEBUG_2("M2G_DEBUG: JNI ( M2GSVGPath ) _addMoveTo: X=%f, Y=%f - begin", aX, aY);
+    TInt err           = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+            MM2GSVGProxy *   aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+            TRAP(err, aProxy->AddMoveToL(STATIC_CAST(TM2GSvgPathHandle, aPathHandle), aX, aY)   ); 
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _addMoveTo - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_addQuadTo
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::AddQuadToL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @param aX1 -
+ * @param aY1 -
+ * @param aX2 -
+ * @param aY2 -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1addQuadTo(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle,
+    jfloat aX1, jfloat aY1, jfloat aX2, jfloat aY2)
+{
+    M2G_DEBUG_4("M2G_DEBUG: JNI ( M2GSVGPath ) _addQuadTo: X1=%f, Y1=%f, X2=%f, Y2=%f - begin", aX1, aY1, aX2, aY2);
+    // TInt elementHandle = M2G_INVALID_HANDLE;
+    TInt err           = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+            MM2GSVGProxy *   aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+            TRAP(err, aProxy->AddQuadToL(
+                    STATIC_CAST(TM2GSvgPathHandle, aPathHandle),aX1, aY1, aX2, aY2); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _addQuadTo - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_createPath
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::CreatePathL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Path handle
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1createPath(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _createPath - begin");
+
+    TInt err           = KM2GNotOk;
+    TInt pathHandle = M2G_INVALID_HANDLE;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+            MM2GSVGProxy *    aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+            TRAP(err, aProxy->CreatePathL(pathHandle);  );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGPath ) _createPath: %d - end", pathHandle);
+    return STATIC_CAST(jint, pathHandle);
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_destroyPath
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::DestroyPathL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1destroyPath(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle)
+{
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGPath ) _destroyPath: %d - begin", aPathHandle);
+    TInt err           = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy *    aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+        TRAP(err, aProxy->DestroyPathL(
+                STATIC_CAST(TM2GSvgPathHandle, STATIC_CAST(TM2GSvgPathHandle, aPathHandle))); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _destroyPath - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_getNumberOfSegments
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetNumberOfSegments method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @return Number of segments
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1getNumberOfSegments(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GSVGPath ) _getNumberOfSegments - begin");
+    TInt err              = KM2GNotOk;
+    TInt numberOfSegments = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy * aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+        TRAP(err, aProxy->GetNumberOfSegmentsL(
+                STATIC_CAST(TM2GSvgPathHandle, aPathHandle),
+                numberOfSegments); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGPath ) _getNumberOfSegments: %d - end", numberOfSegments);
+    return STATIC_CAST(jint, numberOfSegments);
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_getSegmentParameter
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetSegmentParameterL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @param aSegmentIndex -
+ * @param aParamIndex -
+ * @param aSegmentParam Segment parameter
+ */
+JNIEXPORT jfloat JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1getSegmentParameter(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aPathHandle, jint aSegmentIndex, jint aParamIndex)
+{
+    M2G_DEBUG_2("M2G_DEBUG: JNI ( M2GSVGPath ) _getSegmentParameter: seg index=%d, param index=%d - begin", aSegmentIndex, aParamIndex);
+    TInt err              = KM2GNotOk;
+    TReal32 segmentParam  = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy *             aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+        TRAP(err,    aProxy->GetSegmentParameterL(
+            STATIC_CAST(TM2GSvgPathHandle, aPathHandle), aSegmentIndex,aParamIndex, segmentParam); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGPath ) _getSegmentParameter: %f - end", segmentParam);
+    return STATIC_CAST(jfloat, segmentParam);
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGPath::_getSegmentType
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetSegmentTypeL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aPathHandle Svg path handle
+ * @param aSegmentIndex -
+ * @param aSegmentType Segment type to be returned
+ */
+JNIEXPORT jshort JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGPath__1getSegmentType(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    TInt aPathHandle,
+    jint aIndex)
+{
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGPath ) _getSegmentType: index=%d - begin", aIndex);
+    TInt err              = KM2GNotOk;
+    TInt16 aSegmentType  = 0;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy *             aProxy = JavaUnhand< MM2GSVGProxy >(aSvgProxyHandle);
+        TRAP(err, aProxy->GetSegmentTypeL(
+                   STATIC_CAST(TM2GSvgPathHandle, aPathHandle), aIndex,aSegmentType); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GSVGPath ) _getSegmentType: %d - end", aSegmentType);
+    return STATIC_CAST(jshort, aSegmentType);
+}
+
+M2G_NS_END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GSVGSVGElement.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GSVGSVGElement.h"
+#include "MM2GSVGProxy.h"
+
+M2G_NS_START
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_getMediaTime
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::GetMediaTimeL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle
+ * @param aSeconds Media time to be returned.
+ */
+JNIEXPORT jfloat JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGSVGElement__1getMediaTime(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle)
+{
+    M2G_DEBUG_0("JNI ( M2GSVGSVGElement ) _getMediaTime - begin");
+    TReal32 seconds = 0;
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err, aProxy->GetMediaTimeL(STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),seconds); );
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    M2GGeneral::CheckErrorCode(aJni, err);
+ 
+    M2G_DEBUG_1("JNI ( M2GSVGSVGElement ) _getMediaTime: %f - end", seconds);
+    return STATIC_CAST(jfloat, seconds);
+}
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GSVGImage::_setMediaTime
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GSVGProxy::SetMediaTimeL method.
+ * @since Series S60 3.0
+ * @param aProxy Proxy instance.
+ * @param aDocumentHandle Document handle
+ * @param aSeconds Media time
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GSVGSVGElement__1setMediaTime(
+    JNIEnv* aJni,
+    jclass,
+    jint aSvgProxyHandle,
+    jint aDocumentHandle,
+    jfloat aSeconds
+)
+{
+    M2G_DEBUG_0("JNI ( M2GSVGSVGElement ) _setMediaTime - begin");
+    TInt err = KM2GNotOk;
+    
+    TReal32* lseconds = REINTERPRET_CAST(TReal32*, &aSeconds);
+    
+    M2G_DO_LOCK
+    if (aSvgProxyHandle)
+        {
+        MM2GSVGProxy* aProxy = JavaUnhand<MM2GSVGProxy>(aSvgProxyHandle);
+        TRAP(err, aProxy->SetMediaTimeL(
+                STATIC_CAST(TM2GSvgDocumentHandle, aDocumentHandle),
+                *lseconds); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_1("JNI ( M2GSVGSVGElement ) _setMediaTime: %f - end", aSeconds);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/m2g_qt/src/jni/M2GScalableGraphics.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2005-2006 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:  JNI methods
+*
+*/
+
+// INCLUDE FILES
+#include "com_nokia_microedition_m2g_M2GScalableGraphics.h"
+#include "CM2GRenderContext.h"
+#include "MM2GSVGProxy.h" // TM2GRenderRect
+#include <graphics.h>
+
+M2G_NS_START
+#include "M2GUtils.h"
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+// ================================ FUNCTIONS ==================================
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_bind
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GRenderContext::BindL method.
+ * @since Series S60 3.0
+ * @param aRenderContextHandle Render context handle.
+ * @param aTargetHandle Target graphics handle
+ * @throws exception if not ok
+ 
+LOCAL_C void DoBindL(TInt aRenderContextHandle, TInt aTargetHandle, TBool aUiToolkit)
+{
+    MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+    rc->BindL(aTargetHandle, aUiToolkit);
+}
+*/
+/**
+ * JNI method
+ 
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1bind(
+    JNIEnv* aJni,
+    jobject,
+    jint aEventSourceHandle,
+    jint aRenderContextHandle,
+    jint aTargetHandle,
+    jboolean aUiToolkit)
+ */
+
+
+
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1bind(
+    JNIEnv* aJni,
+    jobject,
+    jint aRenderContextHandle,
+    jint aTargetHandle )
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _bind - begin");
+    
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    
+    if (aRenderContextHandle)
+        {
+        MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+        TRAP(err,rc->BindL(aTargetHandle););
+        }
+
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _bind: %d - end", err);
+
+    return err; 
+}
+
+
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_createRenderContext
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GRenderContext::NewL method.
+ * @since Series S60 3.0
+ * @param aSvgProxyHandle Proxy instance.
+ * @param aHandle Render context handle.
+ * @throws exception if not ok
+ */
+
+
+
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1createRenderContext(
+    JNIEnv* aJni,
+    jobject,
+    jint aSvgProxyHandle   )
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _createRenderContext - begin");
+    TInt handle = M2G_INVALID_HANDLE;
+    TInt  err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+  
+    if (aSvgProxyHandle)
+        {
+         TRAP(err, MM2GRenderContext* rchandle = CM2GRenderContext::NewL(JavaUnhand<MM2GSVGProxy> (aSvgProxyHandle));  handle = JavaMakeHandle(rchandle); );
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    handle = M2GGeneral::CheckErrorCodeAndHandle(aJni, err, handle, err);
+
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _createRenderContext: %d - end", handle);
+    
+
+    
+    return handle;
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_deleteRenderContext
+// -----------------------------------------------------------------------------
+/**
+ * Class: com_nokia_microedition_m2g_M2GScalableGraphics
+ * Method: deleteRenderContext
+ * Signature:
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1deleteRenderContext(
+    JNIEnv* aJni,
+    jobject,
+    jint aRenderContextHandle)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _deleteRenderContext - begin");
+    
+    M2G_DO_LOCK
+    
+    if (aRenderContextHandle)
+        {
+        MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+        delete rc;
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _deleteRenderContext - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_release
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GRenderContext::ReleaseL method.
+ * @since Series S60 3.0
+ * @param aRenderContextHandle Context handle
+ * @return KM2GOk if ok
+ */
+
+
+/**
+ * JNI method
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1release(
+    JNIEnv* aJni,
+    jobject,
+    jint aSurfaceHandle,
+    jint aRenderContextHandle)
+{
+    
+    // Release used target surface
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _release - begin");
+    TInt err = KM2GNotOk;
+    M2G_DO_LOCK
+   
+    if (aRenderContextHandle)
+        {
+        MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+        TRAP(err,rc->ReleaseL(););
+    
+        }
+    M2G_DO_UNLOCK(aJni)//TODO Check for M2G_DO_LOCK M2G_DO_UNLOCK
+//TODO just check it pankaj 8/9/2010    
+//    Java::GFX::WindowSurface* surf = reinterpret_cast<Java::GFX::WindowSurface*>(aSurfaceHandle);
+//    surf->release();  //TODO check This windows surface call detected from Graphics3d.inl 
+    M2GGeneral::CheckErrorCode(aJni, err);
+    
+    return err; 
+    
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_render
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GRenderContext::RenderL method.
+ * @since Series S60 3.0
+ * @param aRenderContextHandle Context handle
+ * @param aDocumentHandle Document handle.
+ * @param aSvgW Svg width.
+ * @param aSvgH Svg heigth.
+ * @param aCurrentTime Current time.
+ * @throws Exception if not ok
+ */
+
+
+/**
+ * JNI method
+ */
+JNIEXPORT jint JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1renderLCDUI(
+    JNIEnv* aJni,
+    jobject,
+    jint aRenderContextHandle,
+    jint aDocumentHandle,
+    jint aX, jint aY,
+    jint aClipX, jint aClipY, jint aClipW, jint aClipH,
+    jint aSvgW, jint aSvgH,
+    jfloat aCurrentTime)
+{
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render, time:%f - begin", aCurrentTime);
+
+    TM2GRenderRect rr(aX, aY, aClipX, aClipY, aClipW, aClipH);
+    TInt err = KM2GNotOk;
+
+    M2G_DO_LOCK
+    
+    if (aRenderContextHandle && aDocumentHandle)
+        {
+            MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+            TRAP(err,rc->RenderLCDUIL(aDocumentHandle, aCurrentTime, aSvgW, aSvgH, rr););
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err); 
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render: %d - end", err);
+    return err;
+}
+
+
+JNIEXPORT jintArray JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1renderESWT(
+    JNIEnv* aJni,
+    jobject,
+    jint aRenderContextHandle,
+    jint aDocumentHandle,
+    jint aX, jint aY,
+    jint aClipX, jint aClipY, jint aClipW, jint aClipH,
+    jint aSvgW, jint aSvgH,
+    jfloat aCurrentTime,
+    jint aUseNativeClear
+)
+{
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render, time:%f - begin", aCurrentTime);
+    TM2GRenderRect rr(aX, aY, aClipX, aClipY, aClipW, aClipH);
+    TInt err = KM2GNotOk;
+    jintArray returnDataJava  = aJni->NewIntArray(10);
+    
+    M2G_DO_LOCK
+    
+    TInt returnData[10];
+    
+    if (aRenderContextHandle && aDocumentHandle)
+        {
+        MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+        TRAP(err,rc->RenderESWTL(aDocumentHandle,aCurrentTime,aSvgW,aSvgH,rr,aUseNativeClear,returnData););    
+        }
+    M2G_DO_UNLOCK(aJni)
+
+    
+    if (returnDataJava != NULL)
+        aJni->SetIntArrayRegion(returnDataJava, 0, 10, const_cast<TInt*>(returnData));
+    
+    M2GGeneral::CheckErrorCode(aJni, err); 
+    M2G_DEBUG_1("M2G_DEBUG: JNI ( M2GScalableGraphics ) _render: %d - end", err);
+    return returnDataJava;
+}
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_setRenderingQuality
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GRenderContext::SetRenderingQuality method.
+ * @since Series S60 3.0
+ * @param aRenderContextHandle Context handle
+ * @param aMode
+ * @throws Exception if not ok
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1setRenderingQuality(
+    JNIEnv* aJni,
+    jobject,
+    jint aRenderContextHandle, jint aMode)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setRenderingQuality - begin");
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    
+    if ( aRenderContextHandle)
+        {
+        MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+        TRAP(err,rc->SetRenderingQualityL(aMode););
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setRenderingQuality - end");
+}
+
+// -----------------------------------------------------------------------------
+// Java_com_nokia_microedition_m2g_M2GScalableGraphics::_setTransparency
+// -----------------------------------------------------------------------------
+/**
+ * Calls MM2GRenderContext::SetTransparency method.
+ * @since Series S60 3.0
+ * @param aRenderContextHandle Context handle
+ * @param aAplha -
+ */
+JNIEXPORT void JNICALL
+Java_com_nokia_microedition_m2g_M2GScalableGraphics__1setTransparency(
+    JNIEnv* aJni,
+    jobject,
+    jint aRenderContextHandle,
+    jfloat aAlpha)
+{
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setTransparency - begin");
+    TInt err = KM2GNotOk;
+    
+    M2G_DO_LOCK
+    
+    if (aRenderContextHandle)
+        {
+        MM2GRenderContext* rc = JavaUnhand<MM2GRenderContext>(aRenderContextHandle);
+        TRAP(err,rc->SetTransparency( (TReal32)aAlpha ););
+        }
+    M2G_DO_UNLOCK(aJni)
+    
+    M2GGeneral::CheckErrorCode(aJni, err);
+
+    M2G_DEBUG_0("M2G_DEBUG: JNI ( M2GScalableGraphics ) _setTransparency - end");
+}
+
+M2G_NS_END
+
+
+
--- a/javauis/runtimeui_qt/javasrc.s60/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQt.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/runtimeui_qt/javasrc.s60/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQt.java	Fri Oct 15 12:29:39 2010 +0300
@@ -23,7 +23,6 @@
 import com.nokia.mj.impl.utils.exception.ExceptionBase;
 import com.nokia.mj.impl.rt.support.Jvm;
 
-import com.nokia.mj.impl.utils.Id;
 import com.nokia.mj.impl.utils.ResourceLoader;
 
 /**
@@ -32,10 +31,10 @@
  */
 public class RuntimeUiQt extends RuntimeUi
 {
-    private static final Id ALLOW_BUTTON = new Id(null, "prompt_allow");
-    private static final Id DENY_BUTTON = new Id(null, "prompt_deny");
-    private static final Id DETAILS_BUTTON = new Id(null, "error_details");
-    private static final Id OK_BUTTON = new Id(null, "prompt_ok");
+    private static final String ALLOW_BUTTON = "prompt_allow";
+    private static final String DENY_BUTTON = "prompt_deny";
+    private static final String DETAILS_BUTTON = "error_details";
+    private static final String OK_BUTTON = "prompt_ok";
     private static final String QT_LOC_FILE = "javaapplicationsecuritymessages";
     private static final String QT_PREFIX = "txt_java_secur_button_";
 
@@ -67,7 +66,6 @@
      */
     public boolean confirm(String aAppName, ConfirmData aConfirmData)
     {
-
         if (aConfirmData == null)
         {
             Logger.LOG(Logger.EJavaRuntime,
@@ -80,17 +78,13 @@
         {
             if (iRes == null)
             {
-                iRes = ResourceLoader.getInstance(null, null, QT_LOC_FILE, QT_PREFIX);
+                iRes = ResourceLoader.getInstance(QT_LOC_FILE, QT_PREFIX);
             }
 
-            String allowButton = iRes.format(ALLOW_BUTTON, null);
-            String denyButton = iRes.format(DENY_BUTTON, null);
-
-            aConfirmData = new ConfirmData(aConfirmData.getQuestion(),
-                                           new String[] {allowButton, denyButton},
-                                           aConfirmData.getAnswerSuggestion());
+            String[] answerOptions = {iRes.format(ALLOW_BUTTON).toString(),
+                                      iRes.format(DENY_BUTTON).toString()};
+            aConfirmData.setAnswerOptions(answerOptions);
         }
-
         return _confirm(aAppName, aConfirmData, isIdentified());
     }
 
@@ -111,14 +105,11 @@
                 iRes = ResourceLoader.getInstance(null, null, QT_LOC_FILE, QT_PREFIX);
             }
 
-            String detailsButton = iRes.format(DETAILS_BUTTON, null);
-            String okButton = iRes.format(OK_BUTTON, null);
-
             _error(aAppName,
                    aException.getShortMessage(),
                    aException.getDetailedMessage(),
-                   detailsButton,
-                   okButton);
+                   iRes.format(DETAILS_BUTTON).toString(),
+                   iRes.format(OK_BUTTON).toString());
         }
     }
 
--- a/javauis/runtimeui_qt/src.s60/runtimeuiqt.cpp	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/runtimeui_qt/src.s60/runtimeuiqt.cpp	Fri Oct 15 12:29:39 2010 +0300
@@ -24,6 +24,8 @@
 
 using namespace java::runtimeui;
 
+_LIT(KTrustedWarningIcon, "qtg_large_warning_trusted");
+
 OS_EXPORT void RuntimeUiQt::errorL(const TDesC& /*aAppName*/, const TDesC& aShortMsg,
     const TDesC& aDetailedMsg, const TDesC& aDetailsButton, const TDesC& aOkButton)
 {
@@ -33,6 +35,7 @@
 
     messageBox->SetTextL(aShortMsg);
     messageBox->SetTimeout(HbPopup::NoTimeout);
+    messageBox->SetIconNameL(KTrustedWarningIcon);
 
     if (aDetailedMsg.Size() > 0)
     {
@@ -58,8 +61,11 @@
     CleanupStack::PopAndDestroy(messageBox);
 }
 
+_LIT(KTrustedIcon, "qtg_large_query_trusted");
+_LIT(KUntrustedIcon, "qtg_large_query_untrusted");
+
 OS_EXPORT int RuntimeUiQt::confirmL(const TDesC& /*aAppName*/, const TDesC& aQuestion,
-    const ConfirmData& aConfirmData, bool /*aIdentified*/)
+    const ConfirmData& aConfirmData, bool aIdentified)
 {
     CHbDeviceMessageBoxSymbian* messageBox
         = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
@@ -68,6 +74,15 @@
     messageBox->SetTextL(aQuestion);
     messageBox->SetTimeout(HbPopup::NoTimeout);
 
+    if (aIdentified)   // Trusted application.
+    {
+        messageBox->SetIconNameL(KTrustedIcon);
+    }
+    else
+    {
+        messageBox->SetIconNameL(KUntrustedIcon);
+    }
+
     // Deny by default.
     int result = 1;
 
--- a/javauis/runtimeui_qt/tsrc.s60/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/runtimeui_qt/tsrc.s60/build/build.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -1,6 +1,6 @@
 <!--
 #
-# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 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"
@@ -12,81 +12,36 @@
 #
 # Contributors:
 #
-# Description: 
+# Description:
 #
 -->
 
-<project name="runtimeuiqttests" default="deploy.ut" basedir=".">
+<project name="runtimeuiunittests" basedir="." default="deploy">
 
   <import file="../../../../build/utilities.xml"/>
+  <property file="../../../../build/unittest.properties"/>
 
-  <property environment="env"/>
-  <property name="java.src.root" location="${env.JAVA_SRC_ROOT}"/>
-  <property name="java.bin.root" location="${env.JAVA_BIN_ROOT}"/>
+  <property name="java.src.paths" value="../javasrc"/>
+  <property name="java.bin.root" value="${env.JAVA_BIN_ROOT}"/>
 
-  <property name="src.dir" location="../javasrc"/>
-  <property name="build.dir" location="../build"/>
-  <property name="classes.dir" location="${build.dir}/javabuild"/>
-  <property name="installer.jar.filename" value="javainstaller.jar"/>
-  <property name="runtimeuiqttests.jar.filename" value="runtimeuiqttests.jar"/>
-  <property name="utils.jar.filename" value="javacommonutils.jar"/>
-  <property name="logger.jar.filename" value="logger.jar"/>
-  <property name="junit.jar.dir" location="${java.src.root}/tools/junit"/>
-  <property name="junit.jar.filename" value="j2meunit1.1.1.jar"/>
-  <property name="junit.omj.jar.filename" value="j2meunitomj.jar"/>
-
-  <property name="bootclasspath.cdc" location="${java.src.root}/javaruntime/jvm/ibm/j9_23/ibmdelivery/resource/lib/jclCdc11/classes.zip"/>
-
-  <property name="javac.source" value="1.3"/>
-  <property name="javac.target" value="1.3"/>
-
-  <target name="init.my.properties" depends="init.properties">
-    <property name="dist" location="${vm.extension.directory}"/>
+<!-- Appending classpath like this is illegal to normal components. Don't copy
+       paste this!!! -->
+  <target name="compile">
+    <omj.javac classpath="${compile.result.root}/javaruntimeui/classes/first"/>
   </target>
 
-  <target name="clean">
-    <delete dir="${classes.dir}"/>
-    <delete file="${dist}/${runtimeuiqttests.jar.filename}"/>
-    <delete file="${dist}/${junit.jar.filename}"/>
-    <delete file="${dist}/${junit.omj.jar.filename}"/>
-  </target>
+  <target name="run" depends="deploy">
+      <echo>Running TestRuntimeUI</echo>
+      <exec executable="${java.bin.root}/bin/javaunittester">
+          <arg line="-mainclass=com.nokia.mj.impl.rt.ui.qt.RuntimeUiQtTests"/>
+      </exec>
 
-  <target name="compile.ut" depends="init.my.properties">
-    <property name="jars.dir" location="${jarfiles.collect.root}"/>
-    <property name="jars.dir.cdc" location="${jarfiles.collect.cdc.root}"/>
-    <mkdir dir="${classes.dir}"/>
-    <javac source="${javac.source}" target="${javac.target}"
-           destdir="${classes.dir}"
-           bootclasspath="${bootclasspath.cdc}">
-           <classpath>
-               <pathelement
-                 location="${jars.dir.cdc}/${installer.jar.filename}"/>
-               <pathelement location="${impl.cldc.jar}"/>
-               <pathelement location="${impl.cdc.jar}"/>
-               <pathelement location="${public.api.jar}"/>
-               <pathelement location="${platform.api.jar}"/>
-               <pathelement location="${junit.jar.dir}/${junit.jar.filename}"/>
-               <pathelement location="${junit.jar.dir}/${junit.omj.jar.filename}"/>
-           </classpath>
-      <src path="${src.dir}"/>
-    </javac>
-  </target>
-
-  <target name="deploy.ut" depends="compile.ut">
-      <mkdir dir="${dist}"/>
-      <jar destfile="${dist}/${runtimeuiqttests.jar.filename}" basedir="${classes.dir}"/>
-      <copy file="${junit.jar.dir}/${junit.jar.filename}"
-            tofile="${dist}/${junit.jar.filename}"/>
-      <copy file="${junit.jar.dir}/${junit.omj.jar.filename}"
-            tofile="${dist}/${junit.omj.jar.filename}"/>
+      <echo>Running TestRuntimeUI Icons</echo>
+      <exec executable="${java.bin.root}/bin/javaunittester">
+          <arg line="-mainclass=com.nokia.mj.impl.rt.ui.RuntimeUiQtIconTest"/>
+      </exec>
   </target>
 
   <target name="main" depends="clean,run"/>
 
-  <target name="run" depends="deploy.ut">
-      <echo>Running RuntimeUiQtTests</echo>
-      <exec executable="${env.JAVA_BIN_ROOT}/bin/javainstaller">
-          <arg line="test -mainclass=com.nokia.mj.impl.rt.ui.qt.RuntimeUiQtTests"/>
-      </exec>
-  </target>
 </project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/runtimeui_qt/tsrc.s60/build/dummy.pro	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2010 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 dummy pro file for generating a Jar file. Keeping
+#              build system happy.
+#
+
+TEMPLATE = subdirs
--- a/javauis/runtimeui_qt/tsrc.s60/build/jiut.bat	Mon Oct 04 11:29:25 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description: 
-@rem
-rem Script for running runtimeUiAvkon unit tests from S60 eshell
-javainstaller test -mainclass=com.nokia.mj.impl.rt.ui.qt.RuntimeUiQtTests
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/RuntimeUiQtIconTest.java	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2010 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: Tests for RuntimeUI confirmation dialog icons.
+*
+*/
+
+
+package com.nokia.mj.impl.rt.ui;
+
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
+import com.nokia.mj.impl.utils.exception.ExceptionBase;
+import com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt;
+import com.nokia.mj.impl.rt.ui.RuntimeUi;
+import com.nokia.mj.impl.rt.ui.ConfirmData;
+
+import j2meunit.framework.Test;
+import j2meunit.framework.TestCase;
+import j2meunit.framework.TestMethod;
+import j2meunit.framework.TestSuite;
+
+/**
+ * RuntimeUiQt icon tests.
+ */
+public class RuntimeUiQtIconTest extends TestCase implements UnitTestSuiteCreator
+{
+    public TestSuite createTestSuite(String[] args)
+    {
+        TestSuite suite = new TestSuite(this.getClass().getName());
+
+        suite.addTest(new RuntimeUiQtIconTest("testIcons", new TestMethod()
+        {
+            public void run(TestCase tc)
+            {
+                ((RuntimeUiQtIconTest)tc).testIcons();
+            }
+        }));
+
+        return suite;
+    }
+
+    public RuntimeUiQtIconTest()
+    {
+    }
+
+    public RuntimeUiQtIconTest(String aTestName, TestMethod aTestMethod)
+    {
+        super(aTestName, aTestMethod);
+    }
+
+    public void assertFalse(String aMsg, boolean aCondition)
+    {
+        assertTrue(aMsg, !aCondition);
+    }
+
+    // End j2meunit test framework setup
+
+    protected void setUp()
+    {
+    }
+
+    protected void tearDown()
+    {
+    }
+
+    private void testIcons()
+    {
+        doTest(new RuntimeUiQt());
+    }
+
+    private void doTest(RuntimeUi runtimeUi)
+    {
+        boolean answerAvailable = false;
+        
+        // Check untrusted icon.
+        ConfirmData confirmData = new ConfirmData(
+            "Check untrusted icon. If wrong choose DENY", new String[] {"allow", "deny"}, 1);
+        runtimeUi.setIdentified(false);
+        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
+                
+        assertTrue(answerAvailable && confirmData.getAnswer() == 0);
+
+        // Check trusted icon.
+        confirmData = new ConfirmData(
+            "Check trusted icon. If wrong choose DENY", new String[] {"allow", "deny"}, 1);
+        runtimeUi.setIdentified(true);
+        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
+        assertTrue(answerAvailable && confirmData.getAnswer() == 0);
+
+        runtimeUi.destroy();
+    }
+}
--- a/javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQtTests.java	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQtTests.java	Fri Oct 15 12:29:39 2010 +0300
@@ -18,7 +18,7 @@
 
 package com.nokia.mj.impl.rt.ui.qt;
 
-import com.nokia.mj.impl.installer.utils.InstallerMain;
+import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator;
 import com.nokia.mj.impl.utils.exception.ExceptionBase;
 import com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt;
 import com.nokia.mj.impl.rt.ui.RuntimeUi;
@@ -32,11 +32,9 @@
 /**
  * RuntimeUiQt unit tests.
  */
-public class RuntimeUiQtTests extends TestCase implements InstallerMain
+public class RuntimeUiQtTests extends TestCase implements UnitTestSuiteCreator
 {
-
-    // Begin j2meunit test framework setup
-    public void installerMain(String[] args)
+    public TestSuite createTestSuite(String[] args)
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
@@ -48,7 +46,7 @@
             }
         }));
 
-        com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
+        return suite;
     }
 
     public RuntimeUiQtTests()
@@ -103,6 +101,8 @@
             0,
             null /* no params for detailed msg */);
 
+        runtimeUi.error("MyApplication", exc);
+        
         boolean answerAvailable = false;
 
         // Test confirm
@@ -114,7 +114,7 @@
         answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
         assertTrue(answerAvailable && confirmData.getAnswer() == 1);
 
-        confirmData = new ConfirmData("Null Answer options", null /*Not Supported*/, 1);
+        confirmData = new ConfirmData("Null Answer options", null, 1);
         answerAvailable = runtimeUi.confirm("Null answer options", confirmData);
         assertTrue(answerAvailable);
 
@@ -129,6 +129,12 @@
         ConfirmData nullConf = null;
         runtimeUi.confirm("Null Application", nullConf);
 
+        // If confirm data does not contain localized texts for button names RuntimeUI populates them.
+        // Check those are localized and correct response is received.
+        confirmData = new ConfirmData("Test RuntimeUI loc working. Press allow", null, 0);
+        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);        
+        assertTrue(answerAvailable && confirmData.getAnswer() == 0);
+
         runtimeUi.destroy();
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/runtimeui_qt/tsrc.s60/subsystem.mk	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2010 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:
+#
+
+include $(JAVA_SRC_ROOT)/build/Makefile.defs
+
+# Include the test frameworks.
+SUBSYSTEMS = \
+	$(JAVA_SRC_ROOT)/tools
+
+COMPONENTS = \
+	build
+
+# Make dependency to those.
+build: $(JAVA_SRC_ROOT)/tools
+include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/runtimeui_qt/tsrc.s60/tst.bat	Fri Oct 15 12:29:39 2010 +0300
@@ -0,0 +1,18 @@
+@rem
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+javaunittester -mainclass=com.nokia.mj.impl.rt.ui.qt.RuntimeUiQtTests
+javaunittester -mainclass=com.nokia.mj.impl.rt.ui.RuntimeUiQtIconTest
--- a/javauis/subsystem_qt.mk	Mon Oct 04 11:29:25 2010 +0300
+++ b/javauis/subsystem_qt.mk	Fri Oct 15 12:29:39 2010 +0300
@@ -15,9 +15,9 @@
 #
 
 SUBSYSTEMS   += eswt_qt/build nokiauiapi_qt/build
-COMPONENTS   += coreui_qt/build lcdui_qt/build runtimeui_qt/build mmapi_qt/build amms_qt/build m3g_qt/build
+COMPONENTS   += coreui_qt/build lcdui_qt/build runtimeui_qt/build mmapi_qt/build amms_qt/build m3g_qt/build m2g_qt/build
 
-SYMBIAN_ONLY += coreui_qt/build mmapi_qt/build amms_qt/build m3g_qt/build
+SYMBIAN_ONLY += coreui_qt/build mmapi_qt/build amms_qt/build m3g_qt/build m2g_qt/build
 
 # Build order dependency
-coreui_qt/build lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_qt/build: eswt_qt/build
+coreui_qt/build lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_qt/build m2g_qt/build: eswt_qt/build
--- a/layers.sysdef.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/layers.sysdef.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -8,15 +8,7 @@
     <layer name="app_layer">
       <module name="jrt">
         <unit name="jrt" unitID="jrt.jrt" mrp=""
-              bldFile="&layer_real_source_path;" proFile="jrt.pro" 
-              qmakeArgs="-r"
-              filter="!sf_build" />
-      </module>
-      <module name="jrt_sf">
-        <unit name="jrt_sf" unitID="jrt.jrt_sf" mrp=""
-              bldFile="&layer_real_source_path;" proFile="jrt.pro"
-              qmakeArgs="-r RD_JAVA_SF_BUILD=1"
-              filter="sf_build" />
+              bldFile="&layer_real_source_path;" proFile="jrt.pro" />
       </module>
     </layer>
   </systemModel>
--- a/package_definition.xml	Mon Oct 04 11:29:25 2010 +0300
+++ b/package_definition.xml	Fri Oct 15 12:29:39 2010 +0300
@@ -36,32 +36,32 @@
     
     <collection id="javacommons" name="Java Commons" level="generic">
       <component id="javacommons_build" filter="s60" name="Java Commons Build">
-        <unit bldFile="javacommons" qt:proFile="javacommons.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javacommons" qt:proFile="javacommons.pro"/>
       </component>
     </collection>
     <collection id="javaruntimes" name="Java Runtimes" level="rt">
       <component id="javaruntimes_build" filter="s60" name="Java Runtimes Build">
-        <unit bldFile="javaruntimes" qt:proFile="javaruntimes.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javaruntimes" qt:proFile="javaruntimes.pro"/>
       </component>
     </collection>
     <collection id="javauis" name="Java UIs" level="ui">
       <component id="javauis_build" filter="s60" name="Java UIs Build">
-        <unit bldFile="javauis" qt:proFile="javauis.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javauis" qt:proFile="javauis.pro"/>
       </component>
     </collection>
     <collection id="javamanager" name="Java Manager" level="generic">
       <component id="javamanager_build" filter="s60" name="Java Manager Build">
-        <unit bldFile="javamanager" qt:proFile="javamanager.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javamanager" qt:proFile="javamanager.pro"/>
       </component>
     </collection>
     <collection id="javatools" name="Java Tools" level="util">
       <component id="javatools_build" filter="s60" name="Java Tools Build">
-        <unit bldFile="javatools" qt:proFile="javatools.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javatools" qt:proFile="javatools.pro"/>
       </component>
     </collection>
     <collection id="javaextensions" name="Java Extensions" level="generic">
       <component id="javaextensions_build" filter="s60" name="Java Extensions Build">
-        <unit bldFile="javaextensions" qt:proFile="javaextensions.pro" qt:qmakeArgs="-r RD_JAVA_SF_BUILD=1"/>
+        <unit bldFile="javaextensions" qt:proFile="javaextensions.pro"/>
       </component>
     </collection>
     
--- a/rom/installerodclist30	Mon Oct 04 11:29:25 2010 +0300
+++ b/rom/installerodclist30	Fri Oct 15 12:29:39 2010 +0300
@@ -1,6 +1,7 @@
 eswtqt.odc
 javacomms.odc
 javaconnectionmanager.odc
+javacoreui.odc
 javadatagram.odc
 javafile.odc
 javafileutils.odc
--- a/rom/javalocalization_3_1.iby	Mon Oct 04 11:29:25 2010 +0300
+++ b/rom/javalocalization_3_1.iby	Fri Oct 15 12:29:39 2010 +0300
@@ -19,7 +19,12 @@
 #define __JAVALOCALIZATION_IBY__
 
 data=DATAZ_\RESOURCE_FILES_DIR\java\javausermessages.rsc            RESOURCE_FILES_DIR\java\javausermessages.rsc
+data=DATAZ_\QT_TRANSLATIONS_DIR\javaapplicationinstaller.qm         QT_TRANSLATIONS_DIR\javaapplicationinstaller.qm
+data=DATAZ_\QT_TRANSLATIONS_DIR\javaapplicationinstallererrors.qm   QT_TRANSLATIONS_DIR\javaapplicationinstallererrors.qm
+data=DATAZ_\QT_TRANSLATIONS_DIR\javaapplicationsecuritymessages.qm  QT_TRANSLATIONS_DIR\javaapplicationsecuritymessages.qm
+data=DATAZ_\QT_TRANSLATIONS_DIR\javapim.qm                          QT_TRANSLATIONS_DIR\javapim.qm
 data=DATAZ_\QT_TRANSLATIONS_DIR\javaruntimeapplicationsettings.qm   QT_TRANSLATIONS_DIR\javaruntimeapplicationsettings.qm
-data=DATAZ_\QT_TRANSLATIONS_DIR\javaapplicationinstaller.qm         QT_TRANSLATIONS_DIR\javaapplicationinstaller.qm
+data=DATAZ_\QT_TRANSLATIONS_DIR\javaruntimecertificatemanagement.qm QT_TRANSLATIONS_DIR\javaruntimecertificatemanagement.qm
+data=DATAZ_\QT_TRANSLATIONS_DIR\javauitoolkits.qm                   QT_TRANSLATIONS_DIR\javauitoolkits.qm
 
 #endif // __JAVALOCALIZATION_IBY__