Revision: 201009 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 15 Mar 2010 12:39:47 +0200
branchRCL_3
changeset 12 9674c1a575e9
parent 11 ff572dfe6d86
child 15 040e93e348f6
child 17 b8fae6b8a148
Revision: 201009 Kit: 201010
idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css
idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css
idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css
idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css
idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css
idlehomescreen/inc/xnproperty.h
idlehomescreen/inc/xnuiengine.h
idlehomescreen/inc/xnuienginepluginif.h
idlehomescreen/inc/xnviewmanager.h
idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp
idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp
idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h
idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp
idlehomescreen/widgetmanager/group/wmicons.txt
idlehomescreen/widgetmanager/inc/wminstaller.h
idlehomescreen/widgetmanager/inc/wmlistbox.h
idlehomescreen/widgetmanager/inc/wmmaincontainer.h
idlehomescreen/widgetmanager/inc/wmplugin.h
idlehomescreen/widgetmanager/inc/wmwidgetdata.h
idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h
idlehomescreen/widgetmanager/inc/wmwidgetorderdata.h
idlehomescreen/widgetmanager/src/wmimageconverter.cpp
idlehomescreen/widgetmanager/src/wminstaller.cpp
idlehomescreen/widgetmanager/src/wmlistbox.cpp
idlehomescreen/widgetmanager/src/wmmaincontainer.cpp
idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp
idlehomescreen/widgetmanager/src/wmplugin.cpp
idlehomescreen/widgetmanager/src/wmwidgetdata.cpp
idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp
idlehomescreen/widgetmanager/src/wmwidgetorderdata.cpp
idlehomescreen/xmluicontroller/inc/aieventhandler.h
idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h
idlehomescreen/xmluicontroller/src/aieventhandler.cpp
idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp
idlehomescreen/xmluicontroller/src/appui.cpp
idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp
idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp
idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp
idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp
idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h
idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp
idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby
idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby
idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def
idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def
idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp
idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h
idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h
idlehomescreen/xmluirendering/uiengine/inc/xngesture.h
idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h
idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h
idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h
idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h
idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h
idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h
idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h
idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h
idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp
idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp
idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp
idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp
idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp
idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp
idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp
idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp
idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp
idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp
idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp
idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp
idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp
idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp
idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp
idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp
idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss
idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp
idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp
idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp
idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp
idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp
idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp
idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp
idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp
idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp
idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.rss
menufw/menufwui/matrixmenu/src/mmgui.cpp
menufw/menufwui/mmwidgets/group/mmwidgets.mmp
menufw/menufwui/mmwidgets/inc/mmgrid.h
menufw/menufwui/mmwidgets/inc/mmgridview.h
menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h
menufw/menufwui/mmwidgets/src/mmgrid.cpp
menufw/menufwui/mmwidgets/src/mmgridview.cpp
menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp
menufw/menufwui/mmwidgets/src/mmlistboxview.cpp
menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp
menufw/menusuites/foldersuite/loc/matrixmenudata.loc
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h
taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h
taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp
taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/00/profile.css	Mon Mar 15 12:39:47 2010 +0200
@@ -1,9 +1,5 @@
 widget#profilewidget
 {
-    padding-top: 3px;
-    padding-left: 3px;
-    padding-right: 3px;
-    padding-bottom: 3px;
     background-color: none;
 }
 
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/37/profile.css	Mon Mar 15 12:39:47 2010 +0200
@@ -1,9 +1,5 @@
 widget#profilewidget
 {
-    padding-top: 3px;
-    padding-left: 3px;
-    padding-right: 3px;
-    padding-bottom: 3px;
     background-color: none;
 }
 
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/50/profile.css	Mon Mar 15 12:39:47 2010 +0200
@@ -1,9 +1,5 @@
 widget#profilewidget
 {
-    padding-top: 3px;
-    padding-left: 3px;
-    padding-right: 3px;
-    padding-bottom: 3px;
     background-color: none;
 }
 
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/57/profile.css	Mon Mar 15 12:39:47 2010 +0200
@@ -1,9 +1,5 @@
 widget#profilewidget
 {
-    padding-top: 3px;
-    padding-left: 3px;
-    padding-right: 3px;
-    padding-bottom: 3px;
     background-color: none;
 }
 
--- a/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/data/qhd_tch/profile_2001cb7c/xuikon/94/profile.css	Mon Mar 15 12:39:47 2010 +0200
@@ -1,9 +1,5 @@
 widget#profilewidget
 {
-    padding-top: 3px;
-    padding-left: 3px;
-    padding-right: 3px;
-    padding-bottom: 3px;
     background-color: none;
 }
 
--- a/idlehomescreen/inc/xnproperty.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/inc/xnproperty.h	Mon Mar 15 12:39:47 2010 +0200
@@ -186,6 +186,13 @@
         _LIT8( KMute, "mute" );
         _LIT8( KVolumeLevelAdjustment, "_s60-volume-level-adjustment" ); 
         }
+    namespace texteditor
+        {
+        _LIT8( KEditorMarginLeft, "editor-margin-left" );
+        _LIT8( KEditorMarginRight, "editor-margin-right" );
+        _LIT8( KEditorMarginTop, "editor-margin-top" );
+        _LIT8( KEditorMarginBottom, "editor-margin-bottom" );
+        }
     namespace action
         {
         _LIT8(KActions, "actions");
--- a/idlehomescreen/inc/xnuiengine.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/inc/xnuiengine.h	Mon Mar 15 12:39:47 2010 +0200
@@ -145,6 +145,16 @@
         const TDesC8& aNamespace = KNullDesC8 );
 
     /**
+     * Find content source nodes from namespace. Ownership is not transferred.
+     *
+     * @since S60 5.2
+     * @param aNamespace Namespace
+     * @return Content source nodes from namespace
+     */    
+    CXnPointerArray* FindContentSourceNodesL(
+        const TDesC8& aNamespace );
+    
+    /**
      * Find resources (images etc.) of the UI. Ownership is not transferred.
      *
      * @since Series 60 3.1
@@ -461,6 +471,14 @@
       */      
     TBool IsPartialInputActive();
 
+    /**
+      * Checks if text editor is focused or partioal touch input open.
+      * 
+      * @since Series 60 5.2
+      * @return TBool True if partial input is open or editor focused
+      */      
+    TBool IsTextEditorActive();
+
 private:
     /**
      * C++ default constructor.
--- a/idlehomescreen/inc/xnuienginepluginif.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/inc/xnuienginepluginif.h	Mon Mar 15 12:39:47 2010 +0200
@@ -330,7 +330,15 @@
      * @param TBool True if partial input is open      
      */      
     IMPORT_C void EnablePartialTouchInput( CXnNodePluginIf& aNode, TBool aEnable );
-  
+
+    /**
+     * Checks if text editor is focused or partioal touch input open.
+     * 
+     * @since Series 60 5.2
+     * @return TBool True if partial input is open or editor focused
+     */      
+    IMPORT_C TBool IsTextEditorActive();
+
 private:
     // Data
 
--- a/idlehomescreen/inc/xnviewmanager.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/inc/xnviewmanager.h	Mon Mar 15 12:39:47 2010 +0200
@@ -41,6 +41,7 @@
 class CHsContentInfo;
 class CXnViewAdapter;
 class CXnOomSysHandler;
+class CIdle;
 
 namespace hspswrapper
     {
@@ -211,6 +212,8 @@
     CXnOomSysHandler& OomSysHandler() const;
     
     void UpdatePageManagementInformationL();
+    
+    TBool UiStartupPhaseAllDone() const;
             
 private:
     // new functions
@@ -245,10 +248,7 @@
     
     void ShowDiskFullMessageL() const;
           
-
     TInt ResolveIconIndex( TInt aPageCount, TInt aPageNum ) const;
-
-    void UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew );
     
     /**
      * Callback for stability timer
@@ -362,7 +362,12 @@
      * Own.
      */
     CPeriodic* iStabilityTimer;
-        
+
+    /**
+     * Flag to indicate that UI startup phase is ready
+     */
+    TBool iUiStartupPhaseAllDone;
+    
 private:   
     // Friend classes
     
--- a/idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/nativeuicontroller/src/aidialogrenderer.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -34,12 +34,12 @@
 
 
 // AVKON headers
-#include <AknNoteWrappers.h>             // for Note Wrappers
-#include <AknPopup.h>                    // for Popup menus
+#include <aknnotewrappers.h>             // for Note Wrappers
+#include <aknPopup.h>                    // for Popup menus
 #include <AknWaitDialog.h>               // for CAknWaitDialog
 #include <StringLoader.h>                // for StringLoader
 #include <eiktxlbm.h>                    // for CTextListBoxModel
-#include <AknLists.h>                    // for AknPopupListEmpty
+#include <aknlists.h>                    // for AknPopupListEmpty
 #include <bautils.h>                     // for BaflUtils
 
 // Phonesettings headers
--- a/idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/sapiwrapper/hspswrapper/group/hspswrapper.mmp	Mon Mar 15 12:39:47 2010 +0200
@@ -62,6 +62,8 @@
 
 LIBRARY		 euser.lib
 LIBRARY      liwServiceHandler.lib
+LIBRARY		 centralrepository.lib
+
 #ifdef ENABLE_ABIV2_MODE
 DEBUGGABLE
 #endif
--- a/idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/sapiwrapper/hspswrapper/inc/hspswrapper.h	Mon Mar 15 12:39:47 2010 +0200
@@ -33,10 +33,10 @@
 class CLiwDefaultList;
 class MLiwNotifyCallback;
 class CLiwGenericParamList;
+class CRepository;
 
 namespace hspswrapper{
 
-
 class CHspsConfiguration;
 class CItemMap;
 class CPluginInfo;
@@ -228,20 +228,20 @@
      */
     IMPORT_C TInt RemovePluginL(const TDesC8& aPluginId);
     
-   /**
-     * Sets plugin active into active configuration. 
+    /**
+     * Sets plugin active. 
      *
      * @param aPluginId Plugin id to be activated
      * @return Operation status. KErrNone (success), KErrNotFound
      */
-    IMPORT_C TInt SetActivePluginL(const TDesC8& aPluginId);	
-
+    IMPORT_C TInt SetActivePluginL(const TDesC8& aPluginId);     
+    
     /**
       * Restore active view. Will remove all plugins in active view.
       *
       * @return Operation status. KErrNone (success), KErrNotFound
       */
-     IMPORT_C TInt RestoreActiveViewL();        
+    IMPORT_C TInt RestoreActiveViewL();        
 
      /**
        * Restore whole root configuration. Will remove
@@ -249,7 +249,7 @@
        *
        * @return Operation status. KErrNone (success), KErrNotFound
        */
-      IMPORT_C TInt RestoreRootL();      
+    IMPORT_C TInt RestoreRootL();      
      
     /**
      * Replace plugin in the active configuration.
@@ -314,19 +314,24 @@
      * Returns HSPS services interface
      */   
     IMPORT_C MLiwInterface* HspsInterface() const;
-
+    
 protected:
     CHspsWrapper(MHspsWrapperObserver* aObserver);
-    void ConstructL(const TDesC8& aAppUid);
-    
-    void ProcessConfigurationMapL(const CLiwMap& aSource, CHspsConfiguration& aTarget);
-    void ProcessConfigurationPluginsL(const CLiwList& aPluginsList, CHspsConfiguration& aTarget);
+    void ConstructL(const TDesC8& aAppUid);    
+    void ProcessConfigurationMapL( const CLiwMap& aSource,
+                                   CHspsConfiguration& aTarget,
+                                   const TBool aAppConf );    
+    void ProcessConfigurationPluginsL( const CLiwList& aPluginsList,
+                                       CHspsConfiguration& aTarget,
+                                       const TBool aAppConf );
     void ProcessConfigurationSettingsL(const CLiwList& aItemList, CHspsConfiguration& aTarget);
     void ProcessConfigurationResourcesL(const CLiwList& aObjectList, CHspsConfiguration& aTarget);
     void ProcessConfItemPropertiesL(const CLiwList& aPropertyMapList,CItemMap& aItemMap);
     void ProcessPluginsL(const CLiwList& aPluginInfoMapList, RPointerArray<CPluginInfo>& aPlugins);
     void FillMapFromItemL( CLiwDefaultMap& aMap, const CItemMap& aItemMap );
     void FillMapFromPropertiesL( CLiwDefaultList& aInPropertyMapList, const RPointerArray<CPropertyMap>& aProperties );
+    TInt LoadActivePluginIdL();
+    const TDesC8& ActivePluginId() const;
 
 protected: // from MLiwNotifyCallback 
 
@@ -364,6 +369,16 @@
      * Asynchronous service request tarnsaction id
      */ 
     TInt iTransactionId;
+    
+    /*
+     * Central repository session. Owned;
+     */ 
+    CRepository* iRepository;
+        
+    /*
+     * Active plugin id. Owned.
+     */ 
+    HBufC8* iActivePluginId;
     };
 }
 
--- a/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/sapiwrapper/hspswrapper/src/hspswrapper.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -19,6 +19,8 @@
 #include <liwservicehandler.h>
 #include <liwvariant.h>
 #include <bamdesca.h>
+#include <centralrepository.h>
+#include <activeidle2domaincrkeys.h>
 
 #include "hspswrapper.h"
 #include "hspsconfiguration.h"
@@ -28,7 +30,6 @@
 #include "objectmap.h"
 #include "plugininfo.h"
 
-
 _LIT8( KHSPS, "Service.HSPS" );
 _LIT8( KHSPSConfigurationIf, "IConfiguration" );
 
@@ -38,7 +39,6 @@
 _LIT8( KHSPSCommandAddPlugin, "AddPlugin" );
 _LIT8( KHSPSCommandRemovePlugin, "RemovePlugin" );
 _LIT8( KHSPSCommandReplacePlugin, "ReplacePlugin" );
-_LIT8( KHSPSCommandSetActivePlugin, "SetActivePlugin" );
 _LIT8( KHSPSCommandSetConfState, "SetConfState" );
 _LIT8( KHSPSCommandGetAppConfs, "GetAppConfs" );
 _LIT8( KHSPSCommandSetAppConf, "SetActiveAppConf" );
@@ -69,6 +69,10 @@
 _LIT8( KRestore, "restore" );
 _LIT8( KActive, "active" );
 _LIT8( KAll, "all" );
+_LIT8( K0, "0" );
+_LIT8( K1, "1" );
+_LIT8( KPluginIdNotSet, "-1" );
+const TInt KMaxPluginIdLen = 32;
 
 namespace hspswrapper{
 
@@ -149,7 +153,11 @@
 // ---------------------------------------------------------------------------
 //
 void CHspsWrapper::ConstructL(const TDesC8& aAppUid)
-    {
+    {    
+    // Read active view.
+    iRepository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) );
+    LoadActivePluginIdL();
+        
     // Attach to HSPS:
     iServiceHandler = CLiwServiceHandler::NewL();
     
@@ -269,6 +277,8 @@
     
     delete iHspsService;
     delete iServiceHandler;    
+    delete iRepository;
+    delete iActivePluginId;
     }
 
 // ---------------------------------------------------------------------------
@@ -297,7 +307,7 @@
         // 2: Process Configuration map
         if(confMap)
            {
-           ProcessConfigurationMapL(*confMap,*configuration);
+           ProcessConfigurationMapL( *confMap, *configuration, ETrue );
            }
         }
     outParamList.Reset();
@@ -377,6 +387,8 @@
 EXPORT_C TInt CHspsWrapper::SetAppConfigurationL(
     const TDesC8& aConfigurationUid )
     {
+    SetActivePluginL( KPluginIdNotSet );
+    
 #ifdef _XN_PERFORMANCE_TEST_
     RDebug::Print( _L( "CHspsWrapper::SetAppConfigurationL() - start" ) );
 #endif //_XN_PERFORMANCE_TEST_        
@@ -451,7 +463,7 @@
         // 2: Process Configuration map
         if(confMap)
            {
-           ProcessConfigurationMapL(*confMap,*configuration);
+           ProcessConfigurationMapL( *confMap, *configuration, EFalse );
            }
         }
    
@@ -725,38 +737,29 @@
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
-EXPORT_C TInt CHspsWrapper::SetActivePluginL(const TDesC8& aPluginId)
+EXPORT_C TInt CHspsWrapper::SetActivePluginL( const TDesC8& aPluginId )
     {
-    // Compose AddPlugin hsps LIW message to Service.HomeScreenPluginConfiguration
-    CLiwGenericParamList& inParamList = iServiceHandler->InParamListL();
-    CLiwGenericParamList& outParamList = iServiceHandler->OutParamListL();
-         
-    // Compose Liw message
-    TLiwGenericParam pluginIdParam;
-    pluginIdParam.SetNameAndValueL( KKeyPluginId, TLiwVariant(aPluginId) );
-    pluginIdParam.PushL();
-    inParamList.AppendL( pluginIdParam );
-    CleanupStack::Pop(&pluginIdParam);
-    pluginIdParam.Reset();
-      
-    iHspsInterface->ExecuteCmdL( KHSPSCommandSetActivePlugin, 
-                                 inParamList, 
-                                 outParamList ); 
-      
-    inParamList.Reset();
-      
-    // check success
-    const TLiwGenericParam* outParam = NULL;
-    TInt pos(0);
-    outParam = outParamList.FindFirst( pos, KOutKeyStatus );
-    TInt status(KErrGeneral);
+    TPtrC8 pluginId = aPluginId;
+    if( aPluginId.Length() > KMaxPluginIdLen )
+        {
+        pluginId.Set( aPluginId.Left( KMaxPluginIdLen ) );
+        }
+        
+    const TInt error = iRepository->Set( KAIActiveViewPluginId, pluginId );
+
+    delete iActivePluginId;
+    iActivePluginId = NULL;    
     
-    if ( outParam )
+    if( error == KErrNone )
         {
-        status = outParam->Value().AsTInt32();
+        iActivePluginId = pluginId.AllocL();        
         }
-    outParamList.Reset();
-    return status;
+    else
+        {
+        iActivePluginId = KPluginIdNotSet().AllocL();
+        }
+    
+    return error;
     }
 
 // ---------------------------------------------------------------------------
@@ -1048,7 +1051,8 @@
 //
 void CHspsWrapper::ProcessConfigurationMapL(
     const CLiwMap& aSource, 
-    CHspsConfiguration& aTarget)
+    CHspsConfiguration& aTarget,
+    const TBool aAppConf )
     {
     TLiwVariant tempVariant;
     tempVariant.PushL();
@@ -1090,7 +1094,9 @@
         const CLiwList* plugins( tempVariant.AsList() );
         if( plugins )
             {
-            ProcessConfigurationPluginsL(*plugins,aTarget);
+            ProcessConfigurationPluginsL( *plugins,
+                                          aTarget,
+                                          aAppConf );
             }
         }
     if( aSource.FindL( _L8("settings"), tempVariant ) )
@@ -1118,8 +1124,11 @@
 //
 void CHspsWrapper::ProcessConfigurationPluginsL(
     const CLiwList& aPluginsList, 
-    CHspsConfiguration& aTarget)
+    CHspsConfiguration& aTarget,
+    const TBool aAppConf )
     {
+    TBool activePluginFound = EFalse;
+    
     TLiwVariant pluginMapVariant;
     pluginMapVariant.PushL();
     for( int i=0;i<aPluginsList.Count();++i )
@@ -1140,24 +1149,66 @@
                     {
                     plugin->SetPluginUidL( pluginVariant.AsData() );
                     }
-                if( pluginMap->FindL( _L8("activationstate"),pluginVariant ) )
-                    {
-                    plugin->SetActivationStateL( pluginVariant.AsData() );
-                    }
                 if ( pluginMap->FindL( _L8( "locking_status" ), pluginVariant ) )
                     {
                     plugin->SetLockingStatusL( pluginVariant.AsData() );
+                    }                
+                
+                if( aAppConf )
+                    {
+                    if( ActivePluginId().Compare( KPluginIdNotSet ) == 0 && 
+                        pluginMap->FindL( _L8( "activationstate" ), pluginVariant ) )
+                        {
+                        const TPtrC8 data = pluginVariant.AsData();
+                        
+                        plugin->SetActivationStateL( data );
+                        
+                        if( data.Compare( K1 ) == 0 )
+                            {
+                            SetActivePluginL( plugin->PluginId() );
+                            activePluginFound = ETrue;
+                            }
+                        }
+                    else if( ActivePluginId().Compare( plugin->PluginId() ) == 0 )
+                        {
+                        plugin->SetActivationStateL( K1 );
+                        activePluginFound = ETrue;
+                        }
+                    else
+                        {
+                        plugin->SetActivationStateL( K0 );
+                        }
                     }
+                else
+                    {
+                    if ( pluginMap->FindL( _L8( "activationstate" ), pluginVariant ) )
+                        {
+                        plugin->SetActivationStateL( pluginVariant.AsData() );
+                        }                                
+                    }
+                
                 aTarget.AddPluginMapL(plugin);                    
                 CleanupStack::Pop(plugin);
                 }
             CleanupStack::Pop(&pluginVariant);
             pluginVariant.Reset();
-            }
-       
+            }       
         }
+    
     CleanupStack::Pop(&pluginMapVariant);
     pluginMapVariant.Reset();
+    
+    if( aAppConf &&
+        !activePluginFound &&
+        aTarget.PluginMaps().Count() > 0 )
+        {
+        CPluginMap* plugin = aTarget.PluginMaps()[0]; 
+        if( plugin )
+            {
+            plugin->SetActivationStateL( K1 );
+            SetActivePluginL( plugin->PluginId() );
+            }
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -1564,7 +1615,46 @@
    
     
     return retval;    
-    }    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//    
+TInt CHspsWrapper::LoadActivePluginIdL()
+    {    
+    delete iActivePluginId;
+    iActivePluginId = NULL;    
+    
+    iActivePluginId = HBufC8::NewL( KMaxPluginIdLen );
+    TPtr8 activePluginId = iActivePluginId->Des();
+        
+    const TInt error = iRepository->Get( KAIActiveViewPluginId, activePluginId );
+    
+    if( error != KErrNone )
+        {
+        delete iActivePluginId;
+        iActivePluginId = NULL;
+        iActivePluginId = KPluginIdNotSet().AllocL();
+        }
+    
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//    
+const TDesC8& CHspsWrapper::ActivePluginId() const
+    {
+    if( iActivePluginId )
+        {
+        return *iActivePluginId;
+        }
+    else
+        {
+        return KPluginIdNotSet;
+        }
+    }
+
 }
 
 //End of file
--- a/idlehomescreen/widgetmanager/group/wmicons.txt	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/group/wmicons.txt	Mon Mar 15 12:39:47 2010 +0200
@@ -1,3 +1,2 @@
 -c32,8 qgn_menu_hswidget
--c32,8 add_widget_button
 -c32,8 qgn_menu_ovistore.svg
--- a/idlehomescreen/widgetmanager/inc/wminstaller.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wminstaller.h	Mon Mar 15 12:39:47 2010 +0200
@@ -24,6 +24,7 @@
 class CIdle;
 class CWmWidgetData;
 class TUid;
+class CWmPlugin;
 
 /**
  * CWmInstaller 
@@ -33,16 +34,17 @@
 public:
     /**
      * Two-phased constructors.
+	 * @param aWmPlugin Reference to plugin root
      */
-    static CWmInstaller* NewL();
-    static CWmInstaller* NewLC();
+    static CWmInstaller* NewL( CWmPlugin& aWmPlugin );
+    static CWmInstaller* NewLC( CWmPlugin& aWmPlugin );
     
     /** Destructor */
     ~CWmInstaller();
     
 private:    
     /** constructor */
-    CWmInstaller();
+    CWmInstaller( CWmPlugin& aWmPlugin );
     
     /** 2nd phase constructor */
     void ConstructL();
@@ -106,6 +108,9 @@
     
     
     HBufC8* iMime;
+    
+    /** reference to plugin root */
+    CWmPlugin& iWmPlugin;
     };
 
 #endif // __WMPLUGIN_
--- a/idlehomescreen/widgetmanager/inc/wmlistbox.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmlistbox.h	Mon Mar 15 12:39:47 2010 +0200
@@ -322,13 +322,6 @@
      * @see CCoeControl::Draw
      */
     void Draw( const TRect& aRect ) const;
-
-	/**
-	 * Handles pointer events.
-	 * 
-	 * @see CCoeControl::HandlePointerEventL
-	 */
-	void HandlePointerEventL( const TPointerEvent& aPointerEvent );
 	
 private:
   	 /** Constructor for performing 1st stage construction */
--- a/idlehomescreen/widgetmanager/inc/wmmaincontainer.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmmaincontainer.h	Mon Mar 15 12:39:47 2010 +0200
@@ -84,7 +84,12 @@
             const TRect& aRect );
 
 public: // new functions	
-
+    
+    /** 
+     * @return true, if widgets loading operation is ongoing. 
+     */
+    TBool IsLoadingWidgets();
+    
     /** 
      * @return true, if portal button is currently selected 
      */
@@ -249,6 +254,11 @@
      */
     void ProcessForegroundEvent( TBool aForeground );
     
+    /**
+     * access to WM list
+     */
+    CWmListBox& WmListBox();
+    
 protected: // from base class CCoeControl
     
     /**
--- a/idlehomescreen/widgetmanager/inc/wmplugin.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmplugin.h	Mon Mar 15 12:39:47 2010 +0200
@@ -163,6 +163,13 @@
      */
     CWmInstaller& WmInstaller();
     
+    /**
+     * Get widget by Uid. Used for getting widget details 
+     * when error has occured during uninstallation.
+     * @param aUid Uid of widget
+     */
+    CWmWidgetData* GetUninstalledWidgetByUid( TUid aUid );
+
 private:
     /** constructor */
     CWmPlugin();
--- a/idlehomescreen/widgetmanager/inc/wmwidgetdata.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmwidgetdata.h	Mon Mar 15 12:39:47 2010 +0200
@@ -154,7 +154,7 @@
      * @param aHsContentInfo new content (takes ownership)
      * @return ETrue if content was changed
      */
-    TBool ReplaceContentInfoL(
+    TBool ReplaceContentInfo(
             CHsContentInfo* aHsContentInfo );
     
 public: // comparing / sorting
@@ -217,6 +217,9 @@
 	/** start animation for uninstallation*/
     void VisualizeUninstallL();
 	
+    /** stop uninstallation animation */
+    void StopUninstallAnimationL();
+    
 protected: // from MConverterObserver
 
     /** image conversin completed */
@@ -227,10 +230,11 @@
     /** uninstall animation related*/
     void PrepairAnimL();
     void DestroyAnimData();
-    static TInt Tick( TAny* aPtr );
+    static TInt AnimationTick( TAny* aPtr );
     
     /** fetches publisher uid from widget registry*/
     void FetchPublisherUidL( 
+            const TDesC& aPublisherId,
             RWidgetRegistryClientSession* aRegistryClientSession );
 
     /** Converts uid to TUid from TDesC8 */
@@ -239,6 +243,7 @@
     /** Logo icon string handling */
     void HandleIconString( const TDesC& aIconStr );
     void FireDataChanged();
+    static TInt TimeoutTick( TAny* aPtr );
 
 private: // data members
     
@@ -281,8 +286,11 @@
     /* Array of uninstall animation bitmaps*/
     RArray<CFbsBitmap*> iUninstallAnimIcons;
     
-    /** periodic timer for updating animation */
-    CPeriodic*          iPeriodic;
+    /** timer for updating animation */
+    CPeriodic*          iAnimationTimer;
+    
+    /** timer for canceling image convertion */
+    CPeriodic*          iTimeoutTimer;
     
     /* uninstall animation index */
     TInt                iAnimationIndex;
@@ -298,6 +306,12 @@
      * is being prepaired.
      */
     CActiveSchedulerWait* iWait;
+    
+    /**
+     * Holds widget name. Used for restoring widget name 
+     * if error has occurred during uninstallation.
+     */
+    HBufC* iWidgetName;
     };
 
 
--- a/idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmwidgetloaderao.h	Mon Mar 15 12:39:47 2010 +0200
@@ -56,6 +56,11 @@
      */
     void StartLoading();
     
+    /**
+     * Is loading ongoing.
+     */
+    TBool IsLoading();
+
 private:
     
     /**
@@ -85,6 +90,11 @@
 private:
 
     /**
+     * connects to wrt registry
+     */
+    void OpenSessionL();
+    
+    /**
      * loads widgets into the listbox
      */
     void DoLoadWidgetsL();
@@ -126,6 +136,9 @@
     
 	/** uid of currently unistalled widget */
     TUid iUninstallUid;
+    
+    /** switch for loading operation */
+    TBool iLoading;
     };
 
 #endif // WMWIDGETLOADERAO_H_
--- a/idlehomescreen/widgetmanager/inc/wmwidgetorderdata.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/inc/wmwidgetorderdata.h	Mon Mar 15 12:39:47 2010 +0200
@@ -97,7 +97,7 @@
             CWmPersistentWidgetOrder* aPersistentWidgetOrder );
     
     /** Updates name if param aName is different than iName */
-    void UpdateNameL( const TDesC& aName );
+    void UpdateName( const TDesC& aName );
     
 private: // data members
     /** uid */
--- a/idlehomescreen/widgetmanager/src/wmimageconverter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmimageconverter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -998,6 +998,12 @@
         User::Leave( KErrArgument );
         }
     
+    // make target to correct size
+    if ( aTrgBitmap->SizeInPixels() != aSize )
+        {
+        aTrgBitmap->Resize( aSize );
+        }
+    
     TRect targetRect( aSize );
 
     // calculate aspect ratio
--- a/idlehomescreen/widgetmanager/src/wminstaller.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wminstaller.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -20,6 +20,7 @@
 
 #include "wminstaller.h"
 #include "wmwidgetdata.h"
+#include "wmplugin.h"
 
 
 // CONSTANTS
@@ -29,9 +30,9 @@
 // CWmInstaller::NewL
 // ---------------------------------------------------------
 //
-CWmInstaller* CWmInstaller::NewL()
+CWmInstaller* CWmInstaller::NewL( CWmPlugin& aWmPlugin )
     {
-    CWmInstaller* self = CWmInstaller::NewLC();
+    CWmInstaller* self = CWmInstaller::NewLC( aWmPlugin );
     CleanupStack::Pop(); // self;
     return self;
     }
@@ -40,9 +41,9 @@
 // CWmInstaller::NewLC
 // ---------------------------------------------------------
 //
-CWmInstaller* CWmInstaller::NewLC()
+CWmInstaller* CWmInstaller::NewLC( CWmPlugin& aWmPlugin )
     {
-    CWmInstaller* self = new ( ELeave ) CWmInstaller();
+    CWmInstaller* self = new ( ELeave ) CWmInstaller( aWmPlugin );
     CleanupStack::PushL(self);
     self->ConstructL();
     return self;
@@ -52,7 +53,9 @@
 // CWmInstaller::CWmInstaller
 // ---------------------------------------------------------
 //
-CWmInstaller::CWmInstaller() : CActive( EPriorityStandard )
+CWmInstaller::CWmInstaller( CWmPlugin& aWmPlugin ) :
+    CActive( EPriorityStandard ),
+    iWmPlugin( aWmPlugin )
     {
     iUid = KNullUid;
     iIdle = NULL;
@@ -107,6 +110,16 @@
 //
 void CWmInstaller::RunL()
     {
+    // error has occurred, stop uninstallation animation.
+    if ( iStatus != KErrNone )
+        { 
+        CWmWidgetData* widget = iWmPlugin.GetUninstalledWidgetByUid( iUid );
+        if ( widget )
+            {
+            widget->StopUninstallAnimationL();
+            }
+        }
+    
     // close SWI session
     if ( iIdle && iIdle->IsActive() )
         {
--- a/idlehomescreen/widgetmanager/src/wmlistbox.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmlistbox.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -226,8 +226,20 @@
 
     AknsUtils::GetCachedColor( 
                     skin, textColor, KAknsIIDQsnTextColors, index );
-    TAknTextLineLayout titleTextLayout = 
-              AknLayoutScalable_Apps::listrow_wgtman_pane_t1().LayoutLine();
+
+    TAknTextLineLayout titleTextLayout;
+    if ( !wData.IsUninstalling() )
+        {
+        // centered 1 row layout 
+        titleTextLayout = 
+              AknLayoutScalable_Apps::listrow_wgtman_pane_t1(1).LayoutLine();
+        }
+    else
+        {
+        // 2 row layout for uninstalling
+        titleTextLayout = 
+                AknLayoutScalable_Apps::listrow_wgtman_pane_t1(0).LayoutLine();
+        }
 
     TAknLayoutText textLayoutTitle;
     textLayoutTitle.LayoutText( itemRect, titleTextLayout );
@@ -577,26 +589,6 @@
     }
 
 // ---------------------------------------------------------
-// CWmListBox::HandlePointerEventL
-// ---------------------------------------------------------
-//
-void CWmListBox::HandlePointerEventL( const TPointerEvent& aPointerEvent )
-    {
-	if ( Rect().Contains( aPointerEvent.iPosition ) )
-		{
-        TInt itemIndex = CurrentListBoxItemIndex();
-        TBool itemPointed = View()->XYPosToItemIndex(
-                                aPointerEvent.iPosition,
-                                itemIndex );
-        if ( itemIndex >= 0 && itemPointed )
-            {
-            SetCurrentItemIndex( itemIndex ); //update index
-            }
-		}
-	CAknDouble2LargeStyleListBox::HandlePointerEventL( aPointerEvent );
-    }
-
-// ---------------------------------------------------------
 // CWmListBox::LogoSize
 // ---------------------------------------------------------
 //
--- a/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmmaincontainer.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -52,6 +52,7 @@
 #include <hlplch.h>      // HlpLauncher
 #include <csxhelp/hmsc.hlp.hrh>
 #include <aisystemuids.hrh>
+#include <babitflags.h>
 
 #include "wmcommon.h"
 #include "wmplugin.h"
@@ -92,9 +93,11 @@
 //
 CWmMainContainer::~CWmMainContainer()
 	{
+    delete iWidgetLoader;
+
     RemoveCtrlsFromStack();
     Components().ResetAndDestroy();
-    delete iWidgetLoader;
+    
     iWidgetsList = NULL;
     iPortalButtonOne = NULL;
     iPortalButtonTwo = NULL;
@@ -893,6 +896,16 @@
     }
 
 // ---------------------------------------------------------
+// CWmMainContainer::IsLoadingWidgets
+// ---------------------------------------------------------
+//
+TBool CWmMainContainer::IsLoadingWidgets()
+    {    
+    return ((iWidgetLoader && iWidgetLoader->IsLoading()) ? 
+        ETrue : EFalse);
+    }
+
+// ---------------------------------------------------------
 // CWmMainContainer::PortalSelected
 // ---------------------------------------------------------
 //
@@ -1081,7 +1094,13 @@
     if ( iFindbox && !iFindPaneIsVisible &&
             iWidgetsList->Model()->NumberOfItems() > KMinWidgets )
         {
-		// enable filtering
+        // set column filter flag
+        TBitFlags32 bitFlag;
+        bitFlag.ClearAll(); // clear all columns
+        bitFlag.Assign( 1,1 ); // turn on column at index one
+        iFindbox->SetListColumnFilterFlags( bitFlag );
+        
+        // enable filtering
         CAknFilteredTextListBoxModel* m = 
                 static_cast <CAknFilteredTextListBoxModel*> ( iWidgetsList->Model() );
         if ( m )
@@ -1406,5 +1425,14 @@
         }
     }
 
+// ----------------------------------------------------
+// CWmMainContainer::WmListBox
+// ----------------------------------------------------
+//
+CWmListBox& CWmMainContainer::WmListBox()
+    {
+    return *iWidgetsList;
+    }
+
 // End of File
 
--- a/idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmmaincontainerview.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -27,6 +27,7 @@
 #include <eikbtgpc.h>
 #include <widgetmanagerview.rsg>
 #include <hscontentcontroller.h>
+#include <AknUtils.h>
 
 #include "wmplugin.h"
 #include "widgetmanager.hrh"
@@ -141,8 +142,14 @@
                 break;
             case EWmMainContainerViewBackMenuItemCommand: // flow through
             case EAknSoftkeyBack:
-                iWmPlugin.CloseView();
+                {
+                if ( iWmMainContainer && 
+                  !iWmMainContainer->IsLoadingWidgets() )
+                    {
+                    iWmPlugin.CloseView();
+                    }
                 break;
+                }
             case EWmMainContainerViewWiddetDetailsMenuItemCommand:
                 HandleDetailsMenuItemSelectedL();
                 break;
@@ -176,6 +183,12 @@
             R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
     StatusPane()->ApplyCurrentSettingsL();
     
+    // disable transparancy 
+    if ( StatusPane()->IsTransparent() )
+        {
+        StatusPane()->EnableTransparent( EFalse );    
+        }
+
     // title in status pane
     SetTitleL();
     
@@ -185,7 +198,12 @@
     CEikButtonGroupContainer* bgc( Cba() );
     CEikCba* cba = static_cast< CEikCba* >( bgc->ButtonGroup() );
     if ( cba ) 
-        {       
+        {
+        TInt cbaResourceId = ( AknLayoutUtils::MSKEnabled() ?
+                                R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT : 
+                                R_AVKON_SOFTKEYS_OPTIONS_BACK );
+
+        cba->SetCommandSetL( cbaResourceId );
         bgc->SetBoundingRect( TRect() );
         cba->DrawNow();
         }
--- a/idlehomescreen/widgetmanager/src/wmplugin.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmplugin.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -36,7 +36,7 @@
 #include "wmeffectmanager.h"
 #include "wmwidgetdata.h"
 #include "wminstaller.h"
-
+#include "wmlistbox.h"
 
 // ---------------------------------------------------------
 // CWmPlugin::NewL
@@ -97,7 +97,7 @@
     iFs = &eikonEnv->FsSession();
     iResourceLoader = CWmResourceLoader::NewL( *eikonEnv );
     iEffectManager = CWmEffectManager::NewL( *eikonEnv );
-    iWmInstaller = CWmInstaller::NewL();
+    iWmInstaller = CWmInstaller::NewL( *this );
 
     // main view
     CWmMainContainerView* mainView =
@@ -299,10 +299,9 @@
                 R_QTN_HS_ADD_WIDGET_NO_SPACE_NOTE, KNullDesC );
             break;
         case KErrNoMemory:
-            // Not enough memory to add more content. 
-            // Please remove some Homescreen content and try again.
-            ResourceLoader().InfoPopupL( R_QTN_HS_HS_MEMORY_FULL, KNullDesC ); 
-            break;
+        case KErrDiskFull:
+            // do not show error note here to avoid multiple error notes
+            break;   
         default:
             ResourceLoader().ErrorPopup( aError );
             break;
@@ -366,5 +365,30 @@
     return *iWmInstaller;
     }
 
+// ---------------------------------------------------------
+// CWmPlugin::GetUnistalledWidget
+// ---------------------------------------------------------
+//
+CWmWidgetData* CWmPlugin::GetUninstalledWidgetByUid( TUid aUid )
+    {
+    CWmWidgetData* retVal = NULL;
+    if ( iWmMainContainer )
+        {
+        const RWidgetDataValues& widgetArray =
+            iWmMainContainer->WmListBox().WidgetDataArray();
+        for ( TInt i = 0; i < widgetArray.Count(); i++ )
+            {
+            CWmWidgetData* widgetData = widgetArray[i];
+            if ( widgetData->IsUninstalling() &&
+                widgetData->PublisherUid() == aUid )
+                {
+                retVal = widgetArray[i];
+                break;
+                }
+            }
+        }
+    return retVal;
+    }
+
 // End of file
 
--- a/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmwidgetdata.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -85,11 +85,13 @@
     iWidgetType = CWmWidgetData::EUnknown;
     iPublisherUid = KNullUid;
     iLogoSize = aLogoSize;
-    iPeriodic = NULL;
+    iAnimationTimer = NULL;
+    iTimeoutTimer = NULL;
     iAnimationIndex = 0;
     iAsyncUninstalling = EFalse;
     iFireLogoChanged = EFalse;
     iMdcaPoint = NULL;
+    iWidgetName = NULL;
     }
 
 // ---------------------------------------------------------
@@ -100,13 +102,14 @@
         CHsContentInfo* aHsContentInfo,
         RWidgetRegistryClientSession* aRegistryClientSession )
     {
-    InitL( aHsContentInfo, aRegistryClientSession );
-
     // start decoding the icon
     iImageConverter = CWmImageConverter::NewL( this );
     iWait = new (ELeave) CActiveSchedulerWait();
-    iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
+    iAnimationTimer = CPeriodic::NewL( CActive::EPriorityStandard );
+    iTimeoutTimer = CPeriodic::NewL( CActive::EPriorityStandard );
 
+    InitL( aHsContentInfo, aRegistryClientSession );
+    
     // start logo handling
     iImageConverter->SetLogoSize( iLogoSize );
     HandleIconString( HsContentInfo().IconPath() );
@@ -130,16 +133,18 @@
         iWidgetType = CWmWidgetData::ENative;
         }
 
-    // take ownership of the content info
-    iHsContentInfo = aHsContentInfo;
+    // get publisher uid from widget registry
+    FetchPublisherUidL( aHsContentInfo->PublisherId(), 
+                        aRegistryClientSession );
     
     // create iMdcaPoint for listbox    
     _LIT( KFormatStr, "0\t%S");
     iMdcaPoint = HBufC::NewL( 
-            iHsContentInfo->Name().Length() + KFormatStr().Length() );
-    iMdcaPoint->Des().Format( KFormatStr(), &iHsContentInfo->Name() );
-    // get publisher uid from widget registry
-    FetchPublisherUidL( aRegistryClientSession );
+            aHsContentInfo->Name().Length() + KFormatStr().Length() );
+    iMdcaPoint->Des().Format( KFormatStr(), &aHsContentInfo->Name() );
+
+    // take ownership of the content info
+    iHsContentInfo = aHsContentInfo;
     }
 
 // ---------------------------------------------------------
@@ -148,6 +153,14 @@
 //
 CWmWidgetData::~CWmWidgetData()
     {
+    if ( iTimeoutTimer && 
+        iTimeoutTimer->IsActive() )
+        {
+        iTimeoutTimer->Cancel();
+        }
+    delete iTimeoutTimer;
+
+    delete iWidgetName;
     if ( iWait && iWait->IsStarted() )
         {
         iWait->AsyncStop();
@@ -155,7 +168,7 @@
     delete iWait;
     SetObserver( NULL );
     DestroyAnimData();
-    delete iPeriodic;
+    delete iAnimationTimer;
     delete iLogoImage;
     delete iLogoImageMask;
     delete iImageConverter;
@@ -254,7 +267,7 @@
         if ( iFireLogoChanged ) 
             {
             iFireLogoChanged = EFalse;
-            FireDataChanged(); 
+            FireDataChanged();
             }
         }
     }
@@ -299,8 +312,12 @@
     
     // handle result
     if ( KErrNone == err && iWait &&
-        IsPrepairingLogo() )
+        IsPrepairingLogo() && iTimeoutTimer )
         {
+        iTimeoutTimer->Cancel();
+        const TInt tickInterval = 200000;        
+        iTimeoutTimer->Start(
+                tickInterval,tickInterval,TCallBack(TimeoutTick, this));
         iWait->Start();
         }
     else if ( KErrNone != err && iFireLogoChanged )
@@ -356,14 +373,15 @@
 // ----------------------------------------------------
 //
 void CWmWidgetData::FetchPublisherUidL( 
+            const TDesC& aPublisherId,
             RWidgetRegistryClientSession* aRegistryClientSession )
     {
     if ( iPublisherUid == KNullUid && 
-        PublisherId() != KNullDesC &&
+        aPublisherId != KNullDesC &&
         iWidgetType != CWmWidgetData::ENative &&
         aRegistryClientSession )
         {
-        TInt widgetUid = aRegistryClientSession->GetWidgetUidL( PublisherId() );
+        TInt widgetUid = aRegistryClientSession->GetWidgetUidL( aPublisherId );
         if ( widgetUid != 0 )
             {
             // WRT widget
@@ -414,10 +432,10 @@
     }
 
 // ---------------------------------------------------------
-// CWmWidgetData::ReplaceContentInfoL
+// CWmWidgetData::ReplaceContentInfo
 // ---------------------------------------------------------
 //
-TBool CWmWidgetData::ReplaceContentInfoL(
+TBool CWmWidgetData::ReplaceContentInfo(
         CHsContentInfo* aHsContentInfo )
     {
     TBool sameAppearance = (
@@ -430,10 +448,15 @@
     // delete the old content info
     delete iHsContentInfo;
     iHsContentInfo = NULL;
-
-    // re-init the object
-    InitL( aHsContentInfo, NULL );
-
+    
+    // re-init the object, take care about leave.
+    TRAPD( err, InitL( aHsContentInfo, NULL ); );
+    if ( KErrNone != err )
+        {
+        delete aHsContentInfo;
+        aHsContentInfo = NULL;
+        }
+   
     if ( !sameAppearance )
         {
         // fire change event -> widget redrawn
@@ -473,12 +496,19 @@
     DestroyAnimData();
     PrepairAnimL();
     
-    iHsContentInfo->SetNameL( iWmResourceLoader.Uninstalling() );
+    // set copy of widget name for uninstallation error case.
+    if ( iHsContentInfo->Name().Compare( iWmResourceLoader.Uninstalling() ) !=
+        KErrNone )
+        {
+        iWidgetName = iHsContentInfo->Name().AllocL();
+        iHsContentInfo->SetNameL( iWmResourceLoader.Uninstalling() );
+        }
+
     iAsyncUninstalling = ETrue;
     iAnimationIndex = 0;
     const TInt tickInterval = 400000;
-    iPeriodic->Start(
-            tickInterval,tickInterval,TCallBack(Tick, this));
+    iAnimationTimer->Start(
+            tickInterval,tickInterval,TCallBack(AnimationTick, this));
     }
 
 // ---------------------------------------------------------
@@ -521,9 +551,9 @@
 //
 void CWmWidgetData::DestroyAnimData()
     {
-    if ( iPeriodic && iPeriodic->IsActive() )
+    if ( iAnimationTimer && iAnimationTimer->IsActive() )
         {
-        iPeriodic->Cancel();
+        iAnimationTimer->Cancel();
         }
         
     for( TInt i=0; i < iUninstallAnimIcons.Count(); i++ )
@@ -535,10 +565,10 @@
     }
 
 // ---------------------------------------------------------
-// CWmWidgetData::Tick
+// CWmWidgetData::AnimationTick
 // ---------------------------------------------------------
 //
-TInt CWmWidgetData::Tick( TAny* aPtr )
+TInt CWmWidgetData::AnimationTick( TAny* aPtr )
     {
     CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr );
     self->iAnimationIndex += 2;
@@ -551,6 +581,21 @@
     }
 
 // ---------------------------------------------------------
+// CWmWidgetData::TimeoutTick
+// ---------------------------------------------------------
+//
+TInt CWmWidgetData::TimeoutTick( TAny* aPtr )
+    {
+    CWmWidgetData* self = static_cast< CWmWidgetData* >( aPtr );
+    self->iTimeoutTimer->Cancel();
+    if ( self->iWait && self->iWait->IsStarted() )
+        {
+        self->iWait->AsyncStop();
+        }
+    return 1;
+    }
+
+// ---------------------------------------------------------
 // CWmWidgetData::AnimationBitmap
 // ---------------------------------------------------------
 //
@@ -619,5 +664,24 @@
         return KNullDesC;
     }
 
+// ---------------------------------------------------------
+// CWmWidgetData::StopUninstallAnimation
+// ---------------------------------------------------------
+//
+void CWmWidgetData::StopUninstallAnimationL()
+    {
+    DestroyAnimData();
+    // restore widget name
+    if ( iWidgetName )
+        {
+        iHsContentInfo->SetNameL( iWidgetName->Des() );
+        delete iWidgetName;
+        iWidgetName = NULL;
+        }
+    
+    FireDataChanged(); //redraw
+    iAsyncUninstalling = EFalse;
+    }
+
 // End of file
 
--- a/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmwidgetloaderao.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -55,12 +55,13 @@
 CWmWidgetLoaderAo::CWmWidgetLoaderAo(
         CWmPlugin& aWmPlugin,
         CWmListBox& aTargetList )
-    : CAsyncOneShot( EPriorityStandard )
+    : CAsyncOneShot( EPriorityHigh )
     , iWmPlugin( aWmPlugin )
     , iWidgetsList( aTargetList )
     {
     iWidgetRegistry = NULL;
     iWidgetOrder = NULL;
+    iLoading = EFalse;
     }
 
 // ---------------------------------------------------------------------------
@@ -129,6 +130,9 @@
 	// iUninstallUid is null no uninstallation is ongoing
     iUninstallUid = iWmPlugin.WmInstaller().UninstallUid();
     
+    // connect to widget registry
+    OpenSessionL();
+    
     // 1. load the widgets array
     MHsContentController& controller = iWmPlugin.ContentController();    
     CHsContentInfoArray* contentInfoArray = CHsContentInfoArray::NewL();
@@ -136,10 +140,10 @@
     controller.WidgetListL( *contentInfoArray );
     
     // 2. load the widget order
-    if ( iWidgetOrder ) { Cleanup(); }
+    if ( iWidgetOrder ) { Cleanup(); }    
     iWidgetOrder = CWmPersistentWidgetOrder::NewL( iWmPlugin.FileServer() );
     TRAPD( loadError, iWidgetOrder->LoadL() );
-
+    
     // 3. prepare the widget data array & sort order array
     for( TInt i=0; i<iWidgetsList.WidgetDataCount(); ++i )
         {
@@ -155,6 +159,7 @@
     // widget data.
     TInt widgetsAdded = 0;
     TInt widgetsChanged = 0;
+    iLoading = ETrue;
     while( contentInfoArray->Array().Count() > 0 )
         {
         CHsContentInfo* contentInfo = contentInfoArray->Array()[0];
@@ -169,7 +174,7 @@
             {
             // update existing visible widget data
             existingData->SetValid( ETrue );
-            if ( existingData->ReplaceContentInfoL( contentInfo ) )
+            if ( existingData->ReplaceContentInfo( contentInfo ) )
                 {
                 // Update name to order array if name changed
                 for ( TInt i=0; i < iWidgetsList.OrderDataArray().Count(); i++ )
@@ -178,7 +183,7 @@
                     if ( order->EqualsTo( 
                             existingData->Uid(), existingData->PublisherId() ) )
                         {
-                        order->UpdateNameL( existingData->Name() );
+                        order->UpdateName( existingData->Name() );
                         }
                     }
                 ++widgetsChanged;
@@ -187,7 +192,7 @@
         else
             {
             // add a new widget data
-            AddWidgetDataL( contentInfo, widgetsAdded );
+            TRAP_IGNORE( AddWidgetDataL( contentInfo, widgetsAdded ); );
             }
         }
 
@@ -233,7 +238,7 @@
     // 8. store list order if necessary
     if ( loadError != KErrNone || widgetsAdded > 0 || widgetsRemoved > 0 )
         {
-        iWidgetOrder->StoreL( iWidgetsList.OrderDataArray() );
+        TRAP_IGNORE( iWidgetOrder->StoreL( iWidgetsList.OrderDataArray() ); );
         }
     }
 
@@ -256,13 +261,11 @@
     }
 
 // ---------------------------------------------------------
-// CWmWidgetLoaderAo::AddWidgetDataL
+// CWmWidgetLoaderAo::OpenSessionL
 // ---------------------------------------------------------
 //
-void CWmWidgetLoaderAo::AddWidgetDataL(
-        CHsContentInfo* aContentInfo, TInt& aCount )
+void CWmWidgetLoaderAo::OpenSessionL()
     {
-    CleanupStack::PushL( aContentInfo );
     if ( !iWidgetRegistry )
         {
         iWidgetRegistry = new (ELeave) RWidgetRegistryClientSession();
@@ -274,6 +277,16 @@
             User::Leave( err );
             }
         }
+    }
+
+// ---------------------------------------------------------
+// CWmWidgetLoaderAo::AddWidgetDataL
+// ---------------------------------------------------------
+//
+void CWmWidgetLoaderAo::AddWidgetDataL(
+        CHsContentInfo* aContentInfo, TInt& aCount )
+    {
+    CleanupStack::PushL( aContentInfo );
             
     // Becouse we show only widgets that can be added we need two arrays
     // to maintain order data and visible data. 
@@ -292,13 +305,16 @@
     
     if ( aContentInfo->CanBeAdded() )
         {
-		// widgetdata takes ownership of contentinfo
-        CleanupStack::Pop( aContentInfo );
-        
-        CWmWidgetData* widgetData = CWmWidgetData::NewLC(
+        CWmWidgetData* widgetData = CWmWidgetData::NewL(
                 iWidgetsList.LogoSize(),
                 iWmPlugin.ResourceLoader(),
                 aContentInfo, iWidgetRegistry );
+
+        // widgetdata has taken ownership of contentinfo
+        CleanupStack::Pop( aContentInfo );
+        
+        CleanupStack::PushL( widgetData );
+        
         widgetData->SetPersistentWidgetOrder( iWidgetOrder );
         widgetData->SetValid( ETrue );
         
@@ -327,6 +343,8 @@
 //
 void CWmWidgetLoaderAo::Cleanup()
     {
+    iLoading = EFalse;
+    
     // disconnect widget registry
     if ( iWidgetRegistry )
         {
@@ -364,5 +382,15 @@
         }
     return uid;
     }
+
+// ----------------------------------------------------
+// CWmWidgetData::IsLoading
+// ----------------------------------------------------
+//
+TBool CWmWidgetLoaderAo::IsLoading()
+    {
+    return iLoading;
+    }
+
 // end of file
 
--- a/idlehomescreen/widgetmanager/src/wmwidgetorderdata.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/widgetmanager/src/wmwidgetorderdata.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -174,13 +174,13 @@
 // CWmWidgetOrderData::UpdateName
 // ---------------------------------------------------------
 //
-void CWmWidgetOrderData::UpdateNameL( const TDesC& aName )
+void CWmWidgetOrderData::UpdateName( const TDesC& aName )
     {
     if ( iName->Compare( aName ) != KErrNone )
         {
         delete iName;
         iName = NULL;
-        iName = aName.AllocL();
+        iName = aName.Alloc();
         }
     }
 
--- a/idlehomescreen/xmluicontroller/inc/aieventhandler.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluicontroller/inc/aieventhandler.h	Mon Mar 15 12:39:47 2010 +0200
@@ -81,6 +81,12 @@
      * Own.
      */
     CLiwServiceHandler* iServiceHandler;
+    
+    /**
+     * Service interface.
+     * Own
+     */
+    MLiwInterface* iMsgInterface;
     };
 }
 
--- a/idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluicontroller/inc/aixuikoneventhandler.h	Mon Mar 15 12:39:47 2010 +0200
@@ -38,6 +38,7 @@
 class CContentRenderer;
 class MAiUiEventHandler;
 class MAiApplicationEventHandler;
+class CAIEventHandler;
 
 /**
  *  @ingroup group_xmluicontroller
@@ -169,6 +170,12 @@
      * Not owned.
      */
     XnVolumeControlInterface::MXnVolumeControlInterface* iVolumeControl;
+    
+    /**
+     * AiEvent handler
+     * Owned
+     */
+    CAIEventHandler* iAiEventHandler;
     };
 
 } // namespace AiXmlUiController
--- a/idlehomescreen/xmluicontroller/src/aieventhandler.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluicontroller/src/aieventhandler.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -41,7 +41,7 @@
 
 _LIT( KLaunchApplication, "launch_application" );
 _LIT( KViewActivation, "view_activation" );
-_LIT( KCmdLine, "cmd_line");
+_LIT( KCmdLine, "cmd_line" );
 
 _LIT8( KType, "type" );
 _LIT8( KLaunchMethod, "launch_method" );
@@ -107,7 +107,7 @@
 // ----------------------------------------------------------------------------
 //
 CAIEventHandler::CAIEventHandler( CXmlUiController& aUiController )
-    : iUiController( aUiController ) 
+    : iUiController( aUiController ), iMsgInterface ( NULL )
     {
     }
 
@@ -139,6 +139,12 @@
 //
 CAIEventHandler::~CAIEventHandler()
     {
+    if ( iMsgInterface )
+        {
+        iMsgInterface->Close();
+        iMsgInterface = NULL;
+        }
+    
     if( iServiceHandler )
         {
         iServiceHandler->Reset();
@@ -206,6 +212,7 @@
     
     CLiwDefaultMap* map = CLiwDefaultMap::NewL(); 
     map->PushL();
+    
     map->InsertL( KType, TLiwVariant( KLaunchApplication ));
     map->InsertL( KLaunchMethod, TLiwVariant( KCmdLine ));
     map->InsertL( KApplicationUid, TLiwVariant( uid ));
@@ -257,8 +264,12 @@
 //
 void CAIEventHandler::ExecuteAppLauncherL( CLiwDefaultMap& aMap )
     {
-    MLiwInterface* msgInterface = ActionHandlerInterfaceL( );
-    if( msgInterface && iServiceHandler )
+    if ( !iMsgInterface )
+        {
+        iMsgInterface = ActionHandlerInterfaceL();
+        }
+    
+    if( iMsgInterface && iServiceHandler )
         {
         CLiwGenericParamList& inparam = iServiceHandler->InParamListL();
         CLiwGenericParamList& outparam = iServiceHandler->OutParamListL();
@@ -269,8 +280,7 @@
         TLiwGenericParam data( KData, TLiwVariant( &aMap ));
         inparam.AppendL( data );
 
-        msgInterface ->ExecuteCmdL(KExecute, inparam, outparam);
-        msgInterface->Close();
+        iMsgInterface ->ExecuteCmdL(KExecute, inparam, outparam);
 
         outparam.Reset();
         inparam.Reset();
--- a/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluicontroller/src/aixuikoneventhandler.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -104,7 +104,8 @@
 CAIXuikonEventHandler::CAIXuikonEventHandler( CXmlUiController& aUiController,
                                              CContentRenderer& aRenderer )
     : iUiController(aUiController),
-      iContentRenderer(aRenderer)
+      iContentRenderer(aRenderer),
+      iAiEventHandler( NULL )
     {
     }
 
@@ -145,7 +146,7 @@
     {
     delete iNullEventHandler;
     delete iVolumeEvent;
-    
+    delete iAiEventHandler;
     Release( iStrParser );
     }
 
@@ -225,10 +226,13 @@
         // Event is not targeted here
         return EFalse;
         }
-    CAIEventHandler* handler = CAIEventHandler::NewL( iUiController );
-    CleanupStack::PushL( handler );
-    handler->HandleEventL( aEventText, aEvent );
-    CleanupStack::PopAndDestroy( handler );
+    
+    if ( !iAiEventHandler )
+        {
+        iAiEventHandler = CAIEventHandler::NewL( iUiController );
+        }
+    iAiEventHandler->HandleEventL( aEventText, aEvent );
+    
     return ETrue;
     }
 
--- a/idlehomescreen/xmluicontroller/src/appui.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluicontroller/src/appui.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -23,7 +23,7 @@
 #include <AknDlgShut.h>                 
 #include <aknview.h>
 #include <apacmdln.h>
-#include <logsuicmdstarter.h>
+#include <LogsUiCmdStarter.h>
 #include <aknconsts.h>
 #include <akntitle.h>
 #include <StringLoader.h>
@@ -195,7 +195,7 @@
             iDeviceStatusInfo, EAiFwSystemStartup );                                       
         }
     
-    iUiCtl.FwEventHandler()->HandleUiReadyEventL( iUiCtl );
+    TRAP_IGNORE( iUiCtl.FwEventHandler()->HandleUiReadyEventL( iUiCtl ) );
     
     __PRINTS( "*** CAppUi::ActivateUi - done" );
     }
@@ -616,7 +616,11 @@
 //
 void CAppUi::SetTitlePaneTextL( const TDesC& aText )
     {
-    CEikStatusPane* sp( StatusPane() );
+    CEikStatusPane* sp( StatusPane() );  
+    if ( !sp ) { return; }
+    
+    // make sure status pane is transparent.
+    sp->EnableTransparent( ETrue );
     
     TUid titlePaneUid( TUid::Uid( EEikStatusPaneUidTitle ) );
            
@@ -631,8 +635,12 @@
         if ( title )
             {
             title->SetTextL( aText );        
+            title->DrawNow();
             }               
         }
+    
+    // redraw statuspane
+    sp->DrawNow();
     }
 
 // End of File.
--- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockadapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -37,7 +37,7 @@
 _LIT8( KDateInformation, "Clock/DateInformation" );
 _LIT8( KDayInformation, "Clock/DayInformation" );
 
-_LIT( KDigitalFont, "EAknLogicalFontDigitalFont" );
+_LIT( KDigitalFont, "EAknLogicalFontSecondaryFont" );
 _LIT( KAmPmFont, "EAknLogicalFontSecondaryFont" );
 _LIT( KDateFont, "EAknLogicalFontSecondaryFont" );
 
--- a/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnclockfactory/src/xnclockface.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -91,62 +91,63 @@
 //
 void CXnClockFaceDigital::DrawL( CXnClockAdapter& aAdapter, CWindowGc& aGc, 
     const TRect& aRect, const TTime& aTime )
-    {        
+    {
     TBuf< KMaxTimeFormatSpec > time;
-    aTime.FormatL( time, KTimeFormat() );         
+    aTime.FormatL( time, KTimeFormat() );
 
     TBuf< KMaxTimeFormatSpec > ampm;
     aTime.FormatL( ampm, KAmPmFormat() );
-    
+
     AknTextUtils::LanguageSpecificNumberConversion( time );
-    
+
     const CAknLayoutFont* clockFont( 
             aAdapter.FontL( CXnClockAdapter::EDigitalFont ) );
-    
+
     const CAknLayoutFont* ampmFont( 
             aAdapter.FontL( CXnClockAdapter::EAmPmFont ) );
 
     const CAknLayoutFont* dateFont( 
             aAdapter.FontL( CXnClockAdapter::EDateFont ) );
-    
+
     const TRgb& color( aAdapter.TextColorL() );
-    
+
     CXnNodePluginIf* date( aAdapter.Date() );
-        
+
     TInt ampmWidth( 0 );
-    
+
     if( TLocale().TimeFormat() == ETime12 )
-        {                
+        {
         // Measure the full width of the ampm string 
         ampmWidth = AknBidiTextUtils::MeasureTextBoundsWidth( *ampmFont, ampm, 
-            CFont::TMeasureTextInput::EFVisualOrder );                                    
+            CFont::TMeasureTextInput::EFVisualOrder );
         }
-    
+
+
     const TInt deltaHeight( aRect.Height() - clockFont->TextPaneHeight() );
     TInt offset( clockFont->TextPaneTopToBaseline() + deltaHeight / 2 );
-    
+
     if( date )
         {
         // When date string is shown, time string must be lifted up
         offset -= ( dateFont->TextPaneHeight() / 2 );
         }
-    
+
     // Measure the full width of the time string 
     TInt textWidth( AknBidiTextUtils::MeasureTextBoundsWidth( *clockFont, time, 
         CFont::TMeasureTextInput::EFVisualOrder ) );
-    
-    TInt extraWidth( aRect.Width() - ampmWidth - textWidth );
-    
+
+    TInt extraWidth( aRect.Width() - textWidth );
+
     TInt margin( extraWidth / 2 );
-   
+
     aGc.SetPenColor( color );
-    
+
     aGc.UseFont( clockFont );
 
     CGraphicsContext::TTextAlign align;
-    
+
     TBool mirrored( AknLayoutUtils::LayoutMirrored() );
-    
+
     if( mirrored )
         {
         align = CGraphicsContext::ERight;
@@ -154,65 +155,64 @@
     else
         {
         align = CGraphicsContext::ELeft;
-        }        
-       
+        }
+
     aGc.DrawText( time, aRect, offset, align, margin );
 
     aGc.DiscardFont();
-    
+
     if( TLocale().TimeFormat() == ETime12 )
         {
         TRect ampmRect( aRect );
-    
+        TInt ampmHeight( ampmFont->TextPaneHeight() );
+
         if( mirrored )
             {
-            ampmRect.iBr.iX -= ( textWidth + ( margin / 2 ) );
+            align = CGraphicsContext::ELeft;
             }
         else
             {
-            ampmRect.iTl.iX += ( textWidth + ( margin / 2 ) );
-            }            
-                            
-        extraWidth = ampmRect.Width() - ampmWidth;
-        
-        margin = extraWidth / 2;
+            align = CGraphicsContext::ERight;
+            }
+
+        ampmRect.iTl.iY += ampmHeight;
 
         aGc.UseFont( ampmFont );
-                
+
         aGc.DrawText( ampm, ampmRect, offset, align, margin );
-        
+
         aGc.DiscardFont();
-        }    
-    
+        }
+
     if( date )
         {
         const TDesC* dateStr( &KNullDesC() );
-                    
+
         CXnText* textIf( NULL );
 
-        XnComponentInterface::MakeInterfaceL( textIf, date->AppIfL() );                                 
+        XnComponentInterface::MakeInterfaceL( textIf, date->AppIfL() );
 
         if( textIf )
             {
             dateStr = textIf->Text();
-            }        
-                
+            }
+
         // Measure the full width of the time string 
         TInt dateWidth( AknBidiTextUtils::MeasureTextBoundsWidth( *dateFont, *dateStr, 
             CFont::TMeasureTextInput::EFVisualOrder ) );
-        
+
         TInt width( aRect.Width() - dateWidth );
         TInt margin( width / 2 );
-        
+
         // Move date string down by text pane height and 5% of rect height
         offset += dateFont->TextPaneHeight() + ( aRect.Height() / 20 );
-        
+
         aGc.UseFont( dateFont );
-                     
+
         aGc.DrawText( *dateStr, aRect, offset, align, margin );
-        
-        aGc.DiscardFont();        
-        }    
+
+        aGc.DiscardFont();
+        }
     }
 
 // ============================ MEMBER FUNCTIONS ===============================
--- a/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xnmenufactory/src/xnmenuadapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -1478,13 +1478,16 @@
     RPointerArray< const TDesC8 > groups;
     CleanupClosePushL( groups );
                
-    if( iUiEngine->EditMode() )
-        {
-        groups.AppendL( &KEditMode );
-        }
-    else
-        {
-        groups.Append( &KNormalMode );
+    if ( !iUiEngine->IsTextEditorActive() )
+        {    
+        if( iUiEngine->EditMode() )
+            {
+            groups.AppendL( &KEditMode );
+            }
+        else
+            {
+            groups.Append( &KNormalMode );
+            }
         }
     
     groups.AppendL( &KAlwaysShown );
--- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/group/xntexteditorfactory.mmp	Mon Mar 15 12:39:47 2010 +0200
@@ -56,6 +56,7 @@
 LIBRARY         gdi.lib
 LIBRARY         etext.lib
 LIBRARY         aknskins.lib
+LIBRARY         egul.lib
    
 LANG            SC
 
--- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/inc/xntexteditoradapter.h	Mon Mar 15 12:39:47 2010 +0200
@@ -29,6 +29,7 @@
 class CXnNodePluginIf;
 class CEikEdwin;
 class CXnTextEditorPublisher;
+class CXnAppUiAdapter;
 
 // CLASS DECLARATION
 class CXnTextEditorAdapter : public CXnControlAdapter
@@ -118,7 +119,12 @@
     * See CCoeControl documentation
     */          
     void Draw( const TRect& aRect ) const;
-           
+
+    /**
+    * See CCoeControl documentation
+    */          
+    void HandleResourceChange( TInt aType );
+
 private:
     // from MCoeControlObserver
     
@@ -126,7 +132,7 @@
     * See MCoeControlObserver documentation
     */
     void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
-        
+
 private:
     // private constrcutors 
 
@@ -138,6 +144,8 @@
     // new functions
                  
     void SetPropertiesL();
+    
+    void SetEditorMarginPropertiesL();
 
 private:
     // data
@@ -147,6 +155,8 @@
     CXnNodePluginIf&    	iNode; 
     /** UI engine, not owned */
     TXnUiEnginePluginIf*    iUiEngine;
+    /** Appui adapter, not owned */
+    CXnAppUiAdapter*        iAppui;
     /** Editor, owned */
     CEikEdwin*              iEditor; 
     /** CPS publisher wrapper, owned */
@@ -160,7 +170,7 @@
     /** Flag to indicate whether focus loss is refused */
     TBool                   iRefusesFocusLoss;
     /** Split input states*/
-    TInt                    iSplitInputState;
+    TInt                    iSplitInputFlags;
     };
 
 #endif      // _XNTEXTEDITORADAPTER_H
--- a/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/renderingplugins/xntexteditorfactory/src/xntexteditoradapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -25,11 +25,13 @@
 #include <AknsUtils.h>
 #include <aknview.h>
 #include <aknedsts.h>
+#include <AknPriv.hrh>
 #include <txtglobl.h>
 #include <txtfmlyr.h>
 #include <txtfrmat.h>
 #include <txtrich.h>
 #include <gdi.h>
+#include <gulutil.h>
 
 #include <activeidle2domainpskeys.h>
 
@@ -52,10 +54,9 @@
 
 enum TSplitInputState
     {
-    ESplitInputDisabled = 0,   
-    ESplitInputClosed,
-    ESplitInputOpen,
-    ESplitInputRemoveFromStack         
+    ESplitInputEnabled = 1,   
+    ESplitInputOpen = 2,
+    ESplitInputEditorInStack = 4,
     };
 
 _LIT8( KCpsPublishing, "cpspublishing" );
@@ -72,6 +73,30 @@
 
 // ============================ LOCAL FUNCTIONS ================================   
 
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+TBool IsFlagSet( TInt aFlags, TInt aFlag )
+    {
+    return aFlags & aFlag;
+    }
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+void SetFlag( TInt& aFlags, TInt aFlag )
+    {
+    aFlags |= aFlag;
+    }
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+void ClearFlag( TInt& aFlags, TInt aFlag )
+    {
+    aFlags &= ~aFlag;
+    }
+
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -109,7 +134,15 @@
 // -----------------------------------------------------------------------------
 //
 CXnTextEditorAdapter::~CXnTextEditorAdapter()
-    {    
+    {  
+    if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )    
+        {
+        if( iUiEngine )
+            {
+            iUiEngine->EnablePartialTouchInput( iNode, EFalse );    
+            }
+        }
+
     if ( iAvkonAppUi )
         {
         iAvkonAppUi->RemoveFromStack( iEditor );
@@ -135,6 +168,8 @@
     CXnControlAdapter::ConstructL( iNode );    
     iUiEngine = iNode.UiEngineL();
 
+    iAppui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi );
+    
     // Max line amount
     iMaxLines = 0;
     
@@ -183,13 +218,13 @@
 
     // Enable partial Screen
     CXnProperty* enablepartialinput( iNode.GetPropertyL( KEnablePartialInput ) );
-    iSplitInputState = ESplitInputDisabled;
+    iSplitInputFlags = 0;
      
     if ( enablepartialinput && 
          enablepartialinput->StringValue() == XnPropertyNames::KTrue )
         {
         iEditor->SetAknEditorFlags( EAknEditorFlagEnablePartialScreen );
-        iSplitInputState = ESplitInputClosed;
+        SetFlag( iSplitInputFlags, ESplitInputEnabled );
         }
     
     iEditor->SetObserver( this );
@@ -306,50 +341,48 @@
 // 
 void CXnTextEditorAdapter::FocusChanged( TDrawNow aDrawNow )
     {
-    CXnAppUiAdapter* appui( 
-        static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) );
-    
     TBool isFocused( IsFocused() ? ETrue : EFalse );
-      
     TInt value;
 
     if ( isFocused )
         {      
         value = EPSAiDontForwardNumericKeysToPhone;
 
-        if( iSplitInputState == ESplitInputDisabled )
+        if( !IsFlagSet( iSplitInputFlags, ESplitInputEnabled ) )
             {
-            TRAP_IGNORE( appui->AddToStackL( appui->View(), iEditor ) );            
+            TRAP_IGNORE( iAppui->AddToStackL( iAppui->View(), iEditor ) );  
             // AddToStackL calls iEditor->SetFocus( ETrue ); 
             }
-        else if( iSplitInputState == ESplitInputClosed )
+        else if( !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )
             {
-            iUiEngine->EnablePartialTouchInput(iNode , ETrue);
-            TRAP_IGNORE( appui->AddToStackL( appui->View(), iEditor ) ); 
-            iSplitInputState = ESplitInputOpen;
+            TRAP_IGNORE( iAppui->AddToStackL( iAppui->View(), iEditor ) ); 
+            SetFlag( iSplitInputFlags, ESplitInputEditorInStack );
             }
         }
     else
         {
         value = EPSAiForwardNumericKeysToPhone;
                                       
-        if( iSplitInputState == ESplitInputDisabled )
+        if( !IsFlagSet( iSplitInputFlags, ESplitInputEnabled ) )
             {    
-            appui->RemoveFromStack( iEditor );            
+            iAppui->RemoveFromStack( iEditor );            
             iEditor->SetFocus( EFalse, aDrawNow );
             }
-        else if( iSplitInputState == ESplitInputRemoveFromStack )
+        
+        // Remove editor from stack if it has not beed removed AND split screen has been closed
+        else if( IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) &&
+                 !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )
             {
-            appui->RemoveFromStack( iEditor );            
+            iAppui->RemoveFromStack( iEditor );            
             iEditor->SetFocus( EFalse, aDrawNow );
-            iSplitInputState = ESplitInputClosed;
+            ClearFlag( iSplitInputFlags, ESplitInputEditorInStack );            
             }            
         }
 
-    if( iSplitInputState == ESplitInputOpen )
+    if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )
         {
         value = EPSAiDontForwardNumericKeysToPhone;
-        }
+        } 
 
     iRefusesFocusLoss = isFocused;
     
@@ -369,6 +402,50 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnTextEditorAdapter::HandleResourceChange
+//
+// -----------------------------------------------------------------------------
+//
+void CXnTextEditorAdapter::HandleResourceChange( TInt aType )
+    {
+    if ( aType == KAknSplitInputEnabled ) 
+        {
+        if( IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) && 
+            !IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )
+            {
+            iUiEngine->EnablePartialTouchInput( iNode, ETrue );
+            SetFlag( iSplitInputFlags, ESplitInputOpen );
+            }
+        }    
+    
+     if ( aType == KAknSplitInputDisabled ) 
+        {
+        if( IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )    
+            {
+            iUiEngine->EnablePartialTouchInput( iNode, EFalse );
+            ClearFlag( iSplitInputFlags, ESplitInputOpen );
+            
+            // If editor is not focused anymore, remove if from stack
+            CXnNodePluginIf* focusedNode( NULL );
+            TRAP_IGNORE( focusedNode = iUiEngine->FocusedNodeL() );
+            if( focusedNode != &iNode && 
+                IsFlagSet( iSplitInputFlags, ESplitInputEditorInStack ) )
+                {
+                iAppui->RemoveFromStack( iEditor );
+                iEditor->SetFocus( EFalse );
+                ClearFlag( iSplitInputFlags, ESplitInputEditorInStack );
+
+                // Forward keys to phone again    
+                RProperty::Set( KPSUidAiInformation,            
+                                KActiveIdleForwardNumericKeysToPhone,
+                                EPSAiForwardNumericKeysToPhone );
+                }
+            }
+        }
+    CCoeControl::HandleResourceChange( aType );
+    }
+    
+// -----------------------------------------------------------------------------
 // CXnTextEditorAdapter::HandleControlEventL
 // 
 // -----------------------------------------------------------------------------
@@ -418,35 +495,14 @@
 //
 void CXnTextEditorAdapter::HandleEditorEvent( TInt aReason )
     {
-    CXnAppUiAdapter* appui( 
-        static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) );
- 
-    switch( aReason )
-            {           
-            case CXnTextEditor::KDeactivateTextEditor:
-                {
-                if( iSplitInputState == ESplitInputOpen )
-                     {
-                     iUiEngine->EnablePartialTouchInput(iNode, EFalse);
-                     iSplitInputState = ESplitInputClosed;
-                     appui->RemoveFromStack( iEditor );
-                     iEditor->SetFocus( EFalse );
-                     }              
-                break;
-                }
-            case CXnTextEditor::KRemoveSplitInputFromStack:
-                {
-                iSplitInputState = ESplitInputRemoveFromStack;
-                break;
-                }
-            case CXnTextEditor::KKeepSplitInputInStack:
-                {
-                iSplitInputState = ESplitInputOpen;
-                break;
-                }
-            default:                    
-                break;    
-            }
+    if( aReason == CXnTextEditor::KDeactivateTextEditor &&
+        IsFlagSet( iSplitInputFlags, ESplitInputOpen ) )
+        {
+        iAppui->RemoveFromStack( iEditor );
+        iEditor->SetFocus( EFalse );
+        ClearFlag( iSplitInputFlags, ESplitInputEditorInStack ); 
+        iRefusesFocusLoss = EFalse;
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -575,11 +631,61 @@
                 cf.iFontPresentation.iTextColor = KRgbBlack;                
                 }
             }
-        }    
+        }
+    
+    SetEditorMarginPropertiesL();
     
     CCharFormatLayer *pCharFL = CCharFormatLayer::NewL(cf,cfm);
     iEditor->SetCharFormatLayer(pCharFL);
     iEditor->SetTextBaselineSpacing( 2 );
     }
 
+// -----------------------------------------------------------------------------
+// CXnTextEditorAdapter::SetEditorMarginPropertiesL
+// Sets text properties
+// -----------------------------------------------------------------------------
+//
+void CXnTextEditorAdapter::SetEditorMarginPropertiesL()
+    {
+    TMargins8 margins;
+    
+    CXnProperty* leftMarginProp( 
+        iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginLeft ) );
+    if( leftMarginProp )
+        {
+        TInt leftValue = iUiEngine->HorizontalPixelValueL( leftMarginProp,
+                iNode.Rect().Width() );
+        margins.iLeft = leftValue;
+        }
+    
+    CXnProperty* rightMarginProp( 
+        iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginRight ) );
+    if( rightMarginProp )
+        {
+        TInt rightValue = iUiEngine->HorizontalPixelValueL( rightMarginProp,
+                iNode.Rect().Width() );
+        margins.iRight = rightValue;
+        }
+    
+    CXnProperty* topMarginProp( 
+        iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginTop ) );
+    if( topMarginProp )
+        {
+        TInt topValue = iUiEngine->VerticalPixelValueL( topMarginProp,
+                iNode.Rect().Width() );
+        margins.iTop = topValue;
+        }
+    
+    CXnProperty* bottomMarginProp( 
+        iNode.GetPropertyL( XnPropertyNames::texteditor::KEditorMarginBottom ) );
+    if( bottomMarginProp )
+        {
+        TInt bottomValue = iUiEngine->VerticalPixelValueL( bottomMarginProp,
+                iNode.Rect().Width() );
+        margins.iBottom = bottomValue;
+        }
+    
+    iEditor->SetBorderViewMargins( margins );
+    }
+
 // End of file
--- a/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering.iby	Mon Mar 15 12:39:47 2010 +0200
@@ -38,6 +38,7 @@
 data=\epoc32\data\z\resource\plugins\xn3volumecontrol.rsc \resource\plugins\xn3volumecontrol.rsc
 
 data=\epoc32\data\Z\resource\apps\xnuiengine.rsc      APP_RESOURCE_DIR\xnuiengine.rsc
+data=\epoc32\data\Z\resource\apps\xnwallpaperview.rsc APP_RESOURCE_DIR\xnwallpaperview.rsc
 
 // Stock plugins
 ECOM_PLUGIN( xn3textfactory.dll , xn3textfactory.rsc )
--- a/idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/rom/ai3xmluirendering_resources.iby	Mon Mar 15 12:39:47 2010 +0200
@@ -23,5 +23,6 @@
 #include <data_caging_paths_for_iby.hrh>
 
 data=\epoc32\data\Z\resource\apps\xnuiengine.rsc      APP_RESOURCE_DIR\xnuiengine.rsc
+data=\epoc32\data\Z\resource\apps\xnwallpaperview.rsc APP_RESOURCE_DIR\xnwallpaperview.rsc
 
 #endif // XMLUIRENDERINGRESOURCES_IBY
--- a/idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/bwins/xn3layoutengineu.def	Mon Mar 15 12:39:47 2010 +0200
@@ -233,4 +233,5 @@
 	?SetVisible@CXnControlAdapter@@QAEXH@Z @ 232 NONAME ; void CXnControlAdapter::SetVisible(int)
 	?Node@CXnComponent@@QAEPAVCXnNodePluginIf@@XZ @ 233 NONAME ; class CXnNodePluginIf * CXnComponent::Node(void)
 	?ProcessMessageL@CXnAppUiAdapter@@UAEXVTUid@@ABVTDesC8@@@Z @ 234 NONAME ; void CXnAppUiAdapter::ProcessMessageL(class TUid, class TDesC8 const &)
+	?IsTextEditorActive@TXnUiEnginePluginIf@@QAEHXZ @ 235 NONAME ; int TXnUiEnginePluginIf::IsTextEditorActive(void)
 
--- a/idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/eabi/xn3layoutengineu.def	Mon Mar 15 12:39:47 2010 +0200
@@ -285,4 +285,5 @@
 	_ZThn52_N17CXnControlAdapter19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 284 NONAME
 	_ZThn60_N17CXnControlAdapter19HandleLongTapEventLERK6TPointS2_ @ 285 NONAME
 	_ZN15CXnAppUiAdapter15ProcessMessageLE4TUidRK6TDesC8 @ 286 NONAME
+	_ZN19TXnUiEnginePluginIf18IsTextEditorActiveEv @ 287 NONAME
 
--- a/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/group/xnlayoutengine.mmp	Mon Mar 15 12:39:47 2010 +0200
@@ -81,11 +81,11 @@
 SOURCE    xnwallpaperview.cpp
 SOURCE    xnwallpapercontainer.cpp
 SOURCE    xneffectmanager.cpp
-SOURCE    xnbgcontrol.cpp 
 SOURCE    xninactivitymonitor.cpp 
 SOURCE    xnfocuscontrol.cpp
 SOURCE    xnextrenderingpluginwrapper.cpp
 SOURCE    xnbackgroundmanager.cpp
+SOURCE    xnviewcontroladapter.cpp
 
 START RESOURCE  xnuiengine.rss
 HEADER
@@ -93,6 +93,11 @@
 LANGUAGE_IDS
 END
 
+START RESOURCE  xnwallpaperview.rss
+HEADER
+TARGETPATH      APP_RESOURCE_DIR
+LANGUAGE_IDS
+END
 
 USERINCLUDE     ../inc                               // uiengine
 USERINCLUDE     ../../inc             				 // xmluirendering
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnbackgroundmanager.h	Mon Mar 15 12:39:47 2010 +0200
@@ -46,6 +46,13 @@
     {
 public:
 
+   enum WppType
+        {
+        ENone,
+        ECommon,        
+        EPageSpecific 
+        };
+   
     /**
      * Two-phased constructor.
      * @param aWrapper HSPS wrapper
@@ -74,7 +81,7 @@
      * @since S60 5.0
      * @param aFileName WallpaperImage image path and filename
      * @return Error code.
-     */            
+     */
     TInt AddWallpaperL( const TDesC& aFileName );
 
     /**
@@ -86,11 +93,11 @@
     void DeleteWallpaper( CXnViewData& aViewData );
 
     /**
-     * Checks whether page specific wallpaper feature is activated or not.
+     * Returns wallpaper type.
      *  
      * @since S60 5.0
      */
-    TBool ActivatedL();
+    CXnBackgroundManager::WppType WallpaperType();
 
     /**
      * Shows wallpaper change dialog
@@ -106,7 +113,15 @@
      * @param aOldView         Old view
      * @param aNewView         New view 
      */
-    void WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView );
+    void WallpaperChanged( const CXnViewData& aOldView, 
+        const CXnViewData& aNewView );
+    
+    /**
+     * Draws wallpaper immediately, or once the window comes visible.
+     * 
+     * @since S60 5.0
+     */
+    void UpdateScreen();
 
 public: // Functions from base classes    
 
@@ -172,8 +187,7 @@
     void CheckFeatureTypeL();
     TInt AddPageSpecificWallpaperL( const TDesC& aFileName );
     TInt AddCommonWallpaperL( const TDesC& aFileName, TBool aSave = ETrue );
-    void ReadWallpaperFromCenrepL();
-    void UpdateScreen();
+    void ReadWallpaperFromCenrepL();    
     void DrawEditModeBackgroundSkin() const;
 
     /**
@@ -223,10 +237,9 @@
     TRect iRect;
 
     /** 
-     * States whether page specific wallpaper is supported or
-     * same wallpaper is shown in all pages.
+     * Stores wallpaper type. 
      */
-    TBool iFeatureSuppoted;
+    CXnBackgroundManager::WppType iType;
 
     /** 
      * Internal wallpaper update in progress
--- a/idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xneffectmanager.h	Mon Mar 15 12:39:47 2010 +0200
@@ -20,14 +20,34 @@
 #ifndef CXNEFFECTMANAGER_H
 #define CXNEFFECTMANAGER_H
 
-//  INCLUDES
+// System incldues
 #include <e32base.h>
 
-// CLASS DECLARATION
+// User includes
+
+// Forward declarations
 class CXnPluginData;
 class CXnViewData;
 class CXnNode;
 
+// Constants
+
+// Control effect context ids
+#define KGfxContextAddWidget            TUid::Uid( 0x102750F4 )
+#define KGfxContextRemoveWidget         TUid::Uid( 0x102750F4 )
+#define KGfxContextActivateNextView     TUid::Uid( 0x102750F1 )
+#define KGfxContextActivatePrevView     TUid::Uid( 0x102750F2 )
+#define KGfxContextBgAppear             TUid::Uid( 0x102750F3 )
+
+// Control effect action ids
+#define KGfxControlActionAppear         3
+#define KGfxControlActionDisappear      4
+
+// Full screen effect ids
+#define KGfxContextOpenWallpaperView    1007
+#define KGfxContextCloseWallpaperView   1008
+
+// Class declaration
 /**
  *  Struct which holds needed info of effect.
  */
@@ -47,6 +67,8 @@
 NONSHARABLE_CLASS( CXnEffectManager ) : public CBase
     {
 public:
+    // constructor and destructor
+
     /**
      * Two-phased constructor.
      * @return new instance of CXnEffectManager.
@@ -57,9 +79,14 @@
      * Destructor.
      */
     ~CXnEffectManager();
+
+public:
+    // new functions
     
     /**
      * Begin handling of fullscreen effect.
+     * 
+     * @since S60 5.2 
      * @param aId effect id
      * @aView view data
      */
@@ -67,17 +94,25 @@
     
     /**
      * When UiRendered is called effect is ended and will be drawn
+     * 
+     * @since S60 5.2 
      */
     void UiRendered();
 
     /**
      * When UiLayouted is called effect is started if it was not started earlier.
+     * 
+     * @since S60 5.2
      */
     void UiLayouted();
 
 private:
+    // new functions
+    
     /**
      * Starts fullscreen effect.
+     * 
+     * @since S60 5.2
      * @param aEffect effect data
      * @return ETrue if effect started, otherwise EFalse
      */
@@ -85,25 +120,30 @@
     
     /**
      * Removes and destroys effect from effect list.
+     * 
+     * @since S60 5.2
      * @param aEffect effect data
      */
     void RemoveEffect( TXnEffect* aEffect );
     
+private:
+    // constructors
+    
     /**
-     * C++ default constructor.
+     * C++ default constructor
      */
     CXnEffectManager();
 
     /**
-     * By default Symbian 2nd phase constructor is private.
+     * 2nd phase constructor 
      */
     void ConstructL();
 
-private: // data
-    /**
-     * List of started effects.
-     */
-    RPointerArray<TXnEffect> iEffects;
+private: 
+    // data
+    
+    /** List of started effects, owned */
+    RPointerArray<TXnEffect> iEffects;    
     };
 
 #endif      // CXNEFFECTMANAGER_H
--- a/idlehomescreen/xmluirendering/uiengine/inc/xngesture.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesture.h	Mon Mar 15 12:39:47 2010 +0200
@@ -214,6 +214,16 @@
          * @return Distance between two points
          */
         TPoint Distance() const;
+        
+        /**
+         * Checks and returns gesture
+         * 
+         * @param aRelevantAxis See @ref MGestureEvent::Code
+         * @return gesture code by analysing the sequence of points
+         */
+        TXnGestureCode CodeFromPoints( TAxis aRelevantAxis ) const;
+        
+        TXnGestureCode LastDirection( TAxis aRelevantAxis ) const;
 
     private:
         
@@ -238,14 +248,6 @@
             TPoint iPos;
             };
 
-        /**
-         * Checks and returns gesture
-         * 
-         * @param aRelevantAxis See @ref MGestureEvent::Code
-         * @return gesture code by analysing the sequence of points
-         */
-        TXnGestureCode CodeFromPoints( TAxis aRelevantAxis ) const;
-
         /** 
          * Returns elapsed time
          *
--- a/idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesturedefs.h	Mon Mar 15 12:39:47 2010 +0200
@@ -56,7 +56,7 @@
      * tolerance in degrees to either side of an angle, for direction to be 
      * the same as reference angle
      */
-    const TReal KAngleTolerance = 25;
+    const TReal KAngleTolerance = 35;
     
     /**  
      * maximum pointer movement from pointer down position for a gesture be 
@@ -68,7 +68,7 @@
      * minimum length of a valid swipe in pixels. should be larger than 
      * KTapTolerance
      */
-    const TReal KMinSwipeLength = 5;
+    const TReal KMinSwipeLength = 100;
     
     /** Nth pointer event before the latest point */
     const TInt KPreviousPointOffset = 3;
--- a/idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesturehelper.h	Mon Mar 15 12:39:47 2010 +0200
@@ -22,21 +22,13 @@
 // System includes
 #include <e32base.h>
 
+// User includes
+#include "xngesturerecogniser.h"
+
 // Forward declarations
 class CXnNode;
 struct TPointerEvent;
 
-
-/**
- * Swipe directions (left, right, none)
- */
-enum TSwipeResult
-    {
-    ESwipeNone = 0,
-    ESwipeLeft,
-    ESwipeRight
-    };
-
 /**
  * XnGestureHelper namespace
  * Used for the whole gesture family - Gesture recognizer, gesture helper, 
@@ -50,10 +42,9 @@
     class CXnGesture;
     
     // Constants
-    const TReal32 KGestureMinSpeedX = 300;
-    const TInt KGestureMinLengthX = 100;
-    const TInt KGestureMaxDeltaY = 100;
-    
+    const TInt KGestureMinSpeed = 25;
+    const TInt KGestureMinLength = 100;
+        
     /**
      *  Implementation of CGestureHelper interface
      *
@@ -113,8 +104,8 @@
          * 
          * @see CGestureHelper::HandlePointerEventL 
          */ 
-        TSwipeResult HandlePointerEventL( const TPointerEvent& aEvent );
-        
+        TXnGestureCode HandlePointerEventL( const TPointerEvent& aEvent ); 
+                    
         /** Reset helper state */
         void Reset();
 
@@ -153,7 +144,7 @@
          * 
          * @return Swiping left/right/none 
          */
-        TSwipeResult ValidSwipe();
+        TXnGestureCode ValidSwipe() const;
 
     private:
 
@@ -178,7 +169,9 @@
         /** 
          * Gesture destination, Not owned.
          */        
-        CXnNode* iDestination;        
+        CXnNode* iDestination;
+        
+        TXnGestureCode iDirection;
         };
     } // GestureHelper
 
--- a/idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xngesturerecogniser.h	Mon Mar 15 12:39:47 2010 +0200
@@ -70,6 +70,7 @@
         EGestureSwipeUp = 0x0000000A,
         /** swipe down */
         EGestureSwipeDown = 0x0000000B,
+        EGestureCanceled = 0x0000000C,
         /** 
          * these codes are sent when user initiates holding by keeping stylus 
          * in same place for a longer duration
@@ -104,6 +105,8 @@
          * @return recognised gesture id or EUnknownGesture
          */
         TXnGestureCode GestureCode( const TXnPointArray& aPoints ) const;
+        
+        TXnGestureCode LastDirection( const TXnPointArray& aPoints ) const;
         };
     } // namespace XnGestureHelper
 
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnuiengineimpl.h	Mon Mar 15 12:39:47 2010 +0200
@@ -78,12 +78,12 @@
     /** Partial screen editor node. Not own */
     CXnNode* iPartialScreenEditorNode;
     /** Is partial screen input open */
-    TBool isPartialScreenOpen;
+    TBool iPartialScreenOpen;
     /** Partial screen block progression. Own. */
     HBufC8* iPartialScreenBlock;
-    /** Is partial screen enabled*/
-    TBool isPartialScreenEnabled;
-    
+
+    TXnSplitScreenState(): iPartialScreenBlock( NULL ){}
+
     ~TXnSplitScreenState()
         {
         delete iPartialScreenBlock;
@@ -214,6 +214,16 @@
         const TDesC8& aNamespace = KNullDesC8 );
     
     /**
+     * Find content source nodes from namespace. Ownership is not transferred.
+     *
+     * @since S60 5.2
+     * @param aNamespace Namespace
+     * @return Content source nodes from namespace
+     */    
+    CXnPointerArray* CXnUiEngineImpl::FindContentSourceNodesL(
+        const TDesC8& aNamespace );
+    
+    /**
      * Gets resources of the UI
      * 
      * @since Series 60 3.1
@@ -518,7 +528,15 @@
      * @return TBool is partial input active      
      */      
     TBool IsPartialInputActive();
-        
+
+    /**
+      * Checks if text editor is focused or partioal touch input open.
+      * 
+      * @since Series 60 5.2
+      * @return TBool True if partial input is open or editor focused
+      */      
+    TBool IsTextEditorActive();
+
 private:
     
     IMPORT_C static void EnableRenderUi( TAny* aAny );
@@ -583,7 +601,7 @@
       * @since Series 60 5.2
       * @param TInt aType 
       */ 
-    void HandlePartialTouchInputL( TInt aType );
+    void HandlePartialTouchInputL( CXnNode& aNode, TBool aEnable );
 
     /**
       * Set node visible
@@ -609,6 +627,20 @@
       * @param TDesC8 aBlockProgression set layout direction
       */     
     void StorePartialScreenBlockProgressionL();
+    
+    /**
+      * Handles skin change resource change
+      * 
+      * @since Series 60 5.2
+      */
+    void HandleSkinChangeL();
+
+    /**
+      * Handles KEikDynamicLayoutVariantSwitch resource change
+      * 
+      * @since Series 60 5.2
+      */
+    void HandleDynamicLayoutVariantSwitchL();
 	
 private:
     //Derived functions
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewadapter.h	Mon Mar 15 12:39:47 2010 +0200
@@ -32,7 +32,6 @@
 class CXnAppUiAdapter;
 class CXnControlAdapter;
 class CXnKeyEventDispatcher;
-class CXnBgControl;
 class CXnBackgroundManager;
 class CXnFocusControl;
 
@@ -88,14 +87,6 @@
     CXnKeyEventDispatcher* EventDispatcher() const;
     
     /**
-     * Gets bg control
-     * 
-     * @since S60 5.0
-     * return Bg control
-     */        
-    CCoeControl& BgControl() const;
-
-    /**
      * Gets background manager
      * 
      * @since S60 5.0
@@ -112,11 +103,11 @@
     CXnFocusControl& FocusControl() const;  
 	
 	 /**
-     * updates rsk by mode
+     * updates rsk by UI state
      * 
      * @since S60 5.0
      */  
-    void UpdateRskByModeL();
+    void UpdateRskByUiStateL( const CXnViewData& aViewData );
 
     /**
      * Closes all popups for this container.
@@ -168,7 +159,7 @@
      */
     void NotifyInCallStateChaged( TBool aInCall );
         
-private:
+public:
     // new functions
 
     /**
@@ -180,6 +171,9 @@
      */
     void ChangeControlsStateL( TBool aAwake );
     
+private:
+    // new functions
+    
     /**
      * Activates new container ro view. 
      * Deactivates internally previous container if it exists.
@@ -239,8 +233,6 @@
 
     /** AppUi, Not owned */
     CXnAppUiAdapter& iAppUiAdapter;
-    /** Bg control, Owned */
-    CXnBgControl* iBgControl;
     /** Background manager, Owned */
     CXnBackgroundManager* iBgManager;
     /** Focus control, Owned */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewcontroladapter.h	Mon Mar 15 12:39:47 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2002-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:  View control adater.
+*
+*/
+
+#ifndef _XNVIEWCONTROLADAPTER_H
+#define _XNVIEWCONTROLADAPTER_H
+
+//  System includes
+#include <e32base.h>
+
+// User includes
+#include "xncontroladapter.h"
+#include "xnuistatelistener.h"
+
+// Forward declarations
+class CXnNodePluginIf;
+class CXnBackgroundManager;
+class CXnAppUiAdapter;
+class CXnViewFlicker;
+
+// Class declaration
+/**
+*  @ingroup group_xnlayoutengine
+*  @lib xn3layoutengine.lib
+*  @since S60 5.2
+*/   
+NONSHARABLE_CLASS( CXnViewControlAdapter ) : public CXnControlAdapter,
+    public MXnUiStateObserver
+   {
+public: 
+    // Constructors and destructor
+    
+    /**
+     * 2 phase construction.
+     */
+    static CXnViewControlAdapter* NewL( CXnNodePluginIf& aNode );
+
+    /**
+     * Destructor.
+     */
+    ~CXnViewControlAdapter();
+
+public: 
+    // From base classes
+
+    /**
+    * @see CCoeControl documentation        
+    */         
+    void MakeVisible( TBool aVisible );
+    
+    /**
+     * @see CCoeControl
+     */
+    void Draw( const TRect& aRect ) const;
+            
+    /**
+     * @see CCoeControl
+     */
+    void HandlePointerEventL( const TPointerEvent& aPointerEvent );
+
+public:
+    // new functions
+    
+    /**
+     * Resets grabbing
+     * 
+     * @since S60 5.2
+     */
+    void ResetGrabbing();
+
+private:    
+    // new functions
+    
+    void RemoveGrabbingControL( 
+        const CCoeControl* aControl, const TPointerEvent& aEvent ) const;
+    
+private:
+    // from MXnUiStateObserver
+    
+    /**
+     * @see MXnUiStateObserver
+     */
+    void NotifyForegroundChanged( TForegroundStatus aStatus );
+    
+    /**
+     * @see MXnUiStateObserver
+     */
+    void NotifyLightStatusChanged( TBool aLightsOn );
+    
+    /**
+     * @see MXnUiStateObserver
+     */
+    void NotifyInCallStateChaged( TBool aInCall );   
+    
+private: 
+    // constructors
+    
+    /**
+     * C++ default constructor
+     */    
+    CXnViewControlAdapter( CXnNodePluginIf& aNode );
+    
+    /**
+     * 2nd phase constructor
+     */
+    void ConstructL( CXnNodePluginIf& aNode );
+    
+private: 
+    // data
+
+    /** Node */
+    CXnNodePluginIf& iNode;
+    /** AppUi */
+    CXnAppUiAdapter& iAppUi;
+    /** stored point of EButton1Down */
+    TPoint iHitpoint;   
+    };
+    
+#endif      // _XNVIEWCONTROLADAPTER_H
+            
+// End of File
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnviewdata.h	Mon Mar 15 12:39:47 2010 +0200
@@ -201,7 +201,12 @@
      *         Returns KNullCDes if wallpaper has not been set.
      */
     const TDesC& WallpaperImagePath() const;
-    
+
+    /**
+     * Loads publishers to this view           
+     */
+    void LoadPublishers();    
+                   
     /**
      * Destroys all publishers in this view
      * 
@@ -212,8 +217,6 @@
 private:
     // new functions
     
-    void LoadPublishers();    
-           
     static TInt DoLoadPublishersL( TAny* aAny );
     
     void DoDestroyPublishersL( TInt aReason );
--- a/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/inc/xnwallpaperview.h	Mon Mar 15 12:39:47 2010 +0200
@@ -21,15 +21,19 @@
 #ifndef CXNWALLPAPERVIEW_H
 #define CXNWALLPAPERVIEW_H
 
-//  INCLUDES
+// System includes
 #include <aknview.h>
 
+// User includes
+
+// Forward declarations
 class CXnWallpaperContainer;
+class CXnAppUiAdapter;
 class CXnUiEngine;
 class TVwsViewId;
 class CPeriodic;
 
-// CONSTANTS
+// Constants
 const TUid KWallpaperViewUid = { 0x200286DB };
 
 /**
@@ -41,8 +45,7 @@
     {
     TBool iMultiple;
     TUid iAppUid;
-    TUid iViewUid;
-    CPeriodic* iTimer; // Not own.
+    TUid iViewUid;    
     };
 
 // CLASS DECLARATION
@@ -108,11 +111,18 @@
      * Own.
      */
     CXnWallpaperContainer* iContainer;
+        
+    /**
+     * UiEngine
+     * Not owned.
+     */
+    CXnUiEngine& iEngine;
     
     /**
-     * Reference to uiengine.
+     * AppUi
+     * Not owned.
      */
-    CXnUiEngine& iEngine;
+    CXnAppUiAdapter& iAppUi;
     
     /**
      * Data structure, that is transferred to TimerCallback.
@@ -124,7 +134,11 @@
      * Own.
      */
     CPeriodic* iTimer;
-
+    
+    /**
+     * Resource file offset
+     */
+    TInt iResourceOffset;    
     };
 
 #endif      // CXNWALLPAPERVIEW_H
--- a/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnappuiadapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -72,7 +72,13 @@
 
         toolbar->DisableToolbarL( ETrue );
         }
-        
+
+    CEikStatusPane* sp( StatusPane() );
+    if ( sp )
+        {
+        sp->EnableTransparent( ETrue );
+        }
+
     __TIME_ENDMARK( "CXnAppUiAdapter::ConstructL - BaseConstructL, done", time2 );
     
     iImpl = CXnAppUiAdapterImpl::NewL( iApplicationUid, *this );
--- a/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -27,8 +27,11 @@
 #include "xnwallpaperview.h"
 #include "xnrootdata.h"
 #include "xnuiengine.h"
+#include "xneffectmanager.h"
 
 // SYSTEM INCLUDE FILES
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntransitionutils.h>
 #include <aknlistquerydialog.h> 
 #include <xnuiengine.rsg>
 #include <AknSkinsInternalCRKeys.h>
@@ -45,9 +48,11 @@
 
 using namespace hspswrapper;
 
+// Constants
 _LIT8( KSingle, "single" );
 const TUid KDummyUid = { 0x0000000 };
-const TInt KSkinGfxInnerRectShrink = 5;
+const TInt KSkinGfxInnerRectShrink( 5 );
+const TInt KCallbackDelay( 500000 ); // 500ms
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -96,6 +101,8 @@
     CheckFeatureTypeL();   
 
     iTimer = CPeriodic::NewL( CActive::EPriorityIdle );
+    
+    GfxTransEffect::Register( this, KGfxContextBgAppear );    
     }
 
 // -----------------------------------------------------------------------------
@@ -119,6 +126,8 @@
 //
 CXnBackgroundManager::~CXnBackgroundManager()
     {
+    GfxTransEffect::Deregister( this );
+    
     delete iTimer;
     CleanCache();
     iSkinSrv.Close();
@@ -135,42 +144,23 @@
 //    
 void CXnBackgroundManager::Draw(const TRect& aRect) const
     {
-    if( iFeatureSuppoted )
+    CFbsBitmap* wallpaper( NULL );
+    if( iType == EPageSpecific )
         {
         CXnViewData& viewData( iViewManager.ActiveViewData() );
-        CFbsBitmap* wallpaper = viewData.WallpaperImage();
-        if( wallpaper )
-            {   
-            TSize bitmapSize = wallpaper->SizeInPixels();
-            
-            if( iRect.Height() > bitmapSize.iHeight && iRect.Width() > bitmapSize.iWidth )
-                {
-                TInt width = bitmapSize.iWidth / 2;
-                TInt height = bitmapSize.iHeight / 2;
-            
-                TPoint point = iRect.Center();
-                point.SetXY( point.iX - width, point.iY - height );
-                
-                SystemGc().SetBrushColor( KRgbBlack );
-                SystemGc().Clear( aRect );
-                SystemGc().DrawBitmap( TRect( point, bitmapSize), wallpaper );
-                }
-            else
-                {
-                SystemGc().DrawBitmap( iRect, wallpaper );
-                }
+        wallpaper = viewData.WallpaperImage();
+        }
+    else if( iType == ECommon )
+        {
+        wallpaper = iBgImage;
+        }
 
-            if( iViewManager.UiEngine().IsEditMode() )
-                {
-                DrawEditModeBackgroundSkin();
-                }
-            return;
-            }
-        }
-    else if( iBgImage )
-        {
-        TSize bitmapSize = iBgImage->SizeInPixels();
+    // Draw bg image
+    if( wallpaper )
+        {   
+        TSize bitmapSize = wallpaper->SizeInPixels();
         
+        // If image is smaller that screen size it needs to be centralized
         if( iRect.Height() > bitmapSize.iHeight && iRect.Width() > bitmapSize.iWidth )
             {
             TInt width = bitmapSize.iWidth / 2;
@@ -181,26 +171,26 @@
             
             SystemGc().SetBrushColor( KRgbBlack );
             SystemGc().Clear( aRect );
-            SystemGc().DrawBitmap( TRect( point, bitmapSize ), iBgImage );
-
+            SystemGc().DrawBitmap( TRect( point, bitmapSize), wallpaper );
             }
         else
             {
-            SystemGc().DrawBitmap( iRect, iBgImage );
-            }
-        if( iViewManager.UiEngine().IsEditMode() )
-            {
-            DrawEditModeBackgroundSkin();
+            SystemGc().DrawBitmap( iRect, wallpaper );
             }
-        return;
-        }    
-    MAknsSkinInstance* skin( AknsUtils::SkinInstance() );     
-    AknsDrawUtils::Background( skin, iBgContext, this, SystemGc(), aRect );
+        }
     
+    // Skin bg is used by default
+    else
+        {  
+        MAknsSkinInstance* skin( AknsUtils::SkinInstance() );     
+        AknsDrawUtils::Background( skin, iBgContext, this, SystemGc(), aRect );
+        }
+
+    // Draw edit mode background highlight
     if( iViewManager.UiEngine().IsEditMode() )
         {
         DrawEditModeBackgroundSkin();
-        }   
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -210,11 +200,11 @@
 void CXnBackgroundManager::SizeChanged()
     {
     iRect = Rect();
-    if( iFeatureSuppoted )
+    if( iType == EPageSpecific )
         {
         TRAP_IGNORE( UpdateWallpapersL() );
         }
-    else
+    else if( iType == ECommon ) 
         {
         if( iBgImagePath )
             {
@@ -307,15 +297,22 @@
 //
 TInt CXnBackgroundManager::AddWallpaperL( const TDesC& aFileName )
     {
-    TInt retVal = KErrNone;
-    if( iFeatureSuppoted )
+    TInt retVal( KErrNone );
+    
+    GfxTransEffect::Begin( this, KGfxControlActionAppear );
+                   
+    if ( iType == EPageSpecific )
         {
         retVal = AddPageSpecificWallpaperL( aFileName );
         }
-    else
+    else if ( iType == ECommon )
         {
         retVal = AddCommonWallpaperL( aFileName );
         }
+    
+    GfxTransEffect::SetDemarcation( this, Position() );    
+    GfxTransEffect::End( this );
+    
     return retVal;
     }
 
@@ -325,7 +322,7 @@
 //
 void CXnBackgroundManager::DeleteWallpaper( CXnViewData& aViewData )
     {
-    if( iFeatureSuppoted )
+    if( iType == EPageSpecific )
         {
         const TDesC& path = aViewData.WallpaperImagePath();
         if( path != KNullDesC )
@@ -335,7 +332,7 @@
             aViewData.SetWallpaperImage( NULL );
             }
         }
-    else
+    else if( iType == ECommon )
         {
         if( iBgImagePath )
             {
@@ -349,21 +346,22 @@
     }
     
 // ---------------------------------------------------------------------------
-// CXnBackgroundManager::ActivatedL
+// CXnBackgroundManager::WallpaperType
 // ---------------------------------------------------------------------------
 //
-TBool CXnBackgroundManager::ActivatedL()
+CXnBackgroundManager::WppType CXnBackgroundManager::WallpaperType()
     {
-    return iFeatureSuppoted;
+    return iType;
     }
     
 // -----------------------------------------------------------------------------
 // CXnBackgroundManager::WallpaperChanged
 // -----------------------------------------------------------------------------
 //
-void CXnBackgroundManager::WallpaperChanged( CXnViewData& aOldView, CXnViewData& aNewView )
+void CXnBackgroundManager::WallpaperChanged( const CXnViewData& aOldView, 
+    const CXnViewData& aNewView )
     {
-    if( iFeatureSuppoted && 
+    if( iType == EPageSpecific && 
         aOldView.WallpaperImagePath().Compare( aNewView.WallpaperImagePath() ) )
         {
         UpdateScreen();
@@ -374,7 +372,7 @@
             {
             iTimer->Cancel();
             }
-        iTimer->Start( 0, 1000, TCallBack( TimerCallback, this ) );
+        iTimer->Start(KCallbackDelay, KCallbackDelay, TCallBack( TimerCallback, this ) );
         }
     }
 
@@ -385,7 +383,7 @@
 void CXnBackgroundManager::SaveWallpaperL()
     {
     // Save wallpaper to HSPS
-    if( iFeatureSuppoted )
+    if( iType == EPageSpecific )
         {
         TBuf8<KMaxFileName> wallpaper8;
         CXnViewData& viewData( iViewManager.ActiveViewData() );
@@ -507,8 +505,12 @@
             }
         else if ( selectedIndex == 1 )
             {
-            iViewManager.AppUiAdapter().ActivateLocalViewL( KWallpaperViewUid, 
-                KDummyUid, KSingle );                
+            CXnAppUiAdapter& appui( iViewManager.AppUiAdapter() );
+            
+            appui.EffectManager()->BeginFullscreenEffectL(
+                KGfxContextOpenWallpaperView, iViewManager.ActiveViewData() );        
+            
+            appui.ActivateLocalViewL( KWallpaperViewUid, KDummyUid, KSingle );                                 
             }
         }
     CleanupStack::Pop( query );
@@ -642,7 +644,7 @@
 //
 void CXnBackgroundManager::RemovableDiskInsertedL()
     {
-    if( iFeatureSuppoted )
+    if( iType == EPageSpecific )
         {
         CXnRootData& rootData = iViewManager.ActiveAppData();
         if( !&rootData )
@@ -685,7 +687,7 @@
 //
 void CXnBackgroundManager::CheckFeatureTypeL()
     {
-    iFeatureSuppoted = EFalse;
+    iType = ECommon;
     CRepository* repository = CRepository::NewL( TUid::Uid( KCRUidActiveIdleLV ) );
     CleanupStack::PushL( repository );
     if ( repository )
@@ -695,7 +697,7 @@
         TInt err = repository->Get( KAIWallpaperChangeType, type );
         if ( err == KErrNone && type == 1)
             {
-            iFeatureSuppoted = ETrue;
+            iType = EPageSpecific;
             }
         else
             {
@@ -833,13 +835,13 @@
             {
             if ( wallpaperType == 0 )
                 {
-                if( iFeatureSuppoted )
+                if( iType == EPageSpecific )
                     {
                     CXnViewData& viewData( iViewManager.ActiveViewData() );
                     RemoveWallpaperFromCache( viewData.WallpaperImagePath() );
                     RemoveWallpaperL( viewData );                        
                     } 
-                else
+                else if( iType == ECommon )
                     {
                     if( iBgImagePath )
                         {
@@ -860,11 +862,11 @@
                 err = repository->Get( KPslnIdleBackgroundImagePath, wallpaper );
                 if ( err == KErrNone )
                     {
-                    if( iFeatureSuppoted )
+                    if( iType == EPageSpecific )
                         {
                         AddPageSpecificWallpaperL( wallpaper );
                         }
-                    else
+                    else if( iType == ECommon )
                         {
                         AddCommonWallpaperL( wallpaper, EFalse );
                         }
--- a/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xncomponentfactory.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -97,10 +97,6 @@
             
     if ( type == KView )
         {
-        CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi );
-        
-        adapter->SetContainerWindowL( appui->ViewAdapter().BgControl() ); 
-                           
         aNode.ViewNodeImpl()->SetComponent( aTargetComponent );
         }
     else
@@ -130,9 +126,7 @@
         // Don't activate tooltip yet
         adapter->ActivateL();
         }
-    
-    adapter->MakeVisible( EFalse );
-    
+      
     CleanupStack::Pop( aTargetComponent );
     
     return response;
--- a/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xncomposer.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -592,7 +592,7 @@
         CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager();
         
         // if page specific wallpaper feature is enabled
-        if( bgManager.ActivatedL() )
+        if( bgManager.WallpaperType() == CXnBackgroundManager::EPageSpecific )
             {
             HBufC* bgImage = ItemValueL( *configuration, KWallpaper, KPath );
             CleanupStack::PushL( bgImage );
--- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -130,6 +130,8 @@
         iCurrentLongTapStartDelay = KLongTapStartDelay;
         iCurrentLongTapTimeDelay = KLongTapTimeDelay;
         }    
+    
+    CCoeControl::MakeVisible( EFalse );
     }
 
 // -----------------------------------------------------------------------------
--- a/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -21,7 +21,6 @@
 #include <SVGEngineInterfaceImpl.h>
 #include <s32file.h>
 #include <mifconvdefs.h>
-//skinning support
 #include <AknsFrameBackgroundControlContext.h>
 #include <AknsDrawUtils.h>
 #include <aknconsts.h>
@@ -39,6 +38,7 @@
 #include "xncontroladapterimpl.h"
 #include "xncontroladapter.h"
 #include "xnmenuadapter.h"
+#include "xnviewcontroladapter.h"
 #include "xncomponentnodeimpl.h"
 #include "xntype.h"
 #include "xnnodepluginif.h"
@@ -60,7 +60,6 @@
 #include "xnscrollablecontroladapter.h"
 #include "xnfocuscontrol.h"
 #include "xneditmode.h"
-#include "xnbgcontrol.h"
 
 _LIT8(KScrollableBoxNodeName, "scrollablebox");
         
@@ -3521,6 +3520,8 @@
         
         if ( control && control->RefusesFocusLoss() )
             {
+            focused->HideTooltipsL();
+            
             // It is now time to give up holding focus
             focused->UnsetStateL( 
                 XnPropertyNames::style::common::KFocus );
@@ -3897,14 +3898,17 @@
             CancelFocusRefusalL( *engine );
             
             appui.HideFocus();
-                                   
-            CCoeControl& bg( appui.ViewAdapter().BgControl() );
+
+            if ( !menuBar )
+                {
+                CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >(
+                    appui.ViewManager().ActiveViewData().ViewNode()->Control() );
+                
+                control->IgnoreEventsUntilNextPointerUp();
+                control->ResetGrabbing();                      
+                }
             
-            // Ignore events
-            bg.IgnoreEventsUntilNextPointerUp();
-            static_cast<CXnBgControl*>(&bg)->ResetGrabbingL();
-
-          // Indicate long tap has taken plave
+            // Indicate long tap has taken plave
             iLongtap = ETrue;
             
             CXnNode* hold = BuildTriggerNodeL( *engine,
@@ -3938,9 +3942,13 @@
         if( PassEventToGestureHelperL( aPointerEvent ) )
             { 
             CXnAppUiAdapter& appui( engine->AppUiAdapter() );
-            CCoeControl& bg( appui.ViewAdapter().BgControl() );
-            static_cast<CXnBgControl*>(&bg)->ResetGrabbingL();
+            CXnViewData& data( appui.ViewManager().ActiveViewData() );
             
+            CXnViewControlAdapter* control = 
+                static_cast< CXnViewControlAdapter* >( data.ViewNode()->Control() );
+            
+            control->ResetGrabbing();
+
             // Swipe took place, consume this event
             return ETrue;
             }
@@ -3962,7 +3970,8 @@
     
     CAknLongTapDetector* detector( iAdapter->LongTapDetector() );
     
-    if ( detector && !engine->IsPartialInputActive())
+    if ( ( detector && ( !engine->IsPartialInputActive() || 
+        event.iType == TPointerEvent::EButton1Up ) ) ) 
         {
         if ( menuBar )
             {
@@ -4025,7 +4034,7 @@
                 XnPropertyNames::style::common::KFocus, 
                 XnEventSource::EStylus );
             node->SetStateL( 
-                XnPropertyNames::style::common::KPressedDown );                            
+                XnPropertyNames::style::common::KPressedDown );
             }        
         }
     else if ( event.iType == TPointerEvent::EDrag )
@@ -4035,8 +4044,15 @@
             if ( !node->MarginRect().Contains( event.iPosition ) )
                 {
                 // Remove pressed down
-                node->UnsetStateL( XnPropertyNames::style::common::KPressedDown );
-                }            
+                node->UnsetStateL(
+                    XnPropertyNames::style::common::KPressedDown );
+                }
+            if ( node->MarginRect().Contains( event.iPosition ) )
+                {
+                // Add pressed down
+                node->SetStateL(
+                    XnPropertyNames::style::common::KPressedDown );
+                }
             }
         }
     else if ( event.iType == TPointerEvent::EButton1Up )
@@ -5895,15 +5911,15 @@
                 }
             }
 
-        TSwipeResult result( iGestureHelper->HandlePointerEventL( aPointerEvent ) );
+        TXnGestureCode result( iGestureHelper->HandlePointerEventL( aPointerEvent ) );
         
         const TDesC8* swipe( NULL );
     
-        if ( result == ESwipeLeft )
+        if ( result == EGestureSwipeLeft )
             {
             swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KLeft;
             }
-        else if ( result == ESwipeRight )
+        else if ( result == EGestureSwipeRight )
             {
             swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KRight;
             }
--- a/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xneditmode.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -36,6 +36,7 @@
 #include "xnuiengine.h"
 #include "xncontroladapter.h"
 #include "xnpopupcontroladapter.h"
+#include "xnviewcontroladapter.h"
 #include "xnfocuscontrol.h"
 #include "xneditor.h"
 #include "xntype.h"
@@ -349,11 +350,12 @@
     // Remove focus
     appui.HideFocus();
     
-    CCoeControl& bg( appui.ViewAdapter().BgControl() );
-    
+    CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >(
+        appui.ViewManager().ActiveViewData().ViewNode()->Control() );
+            
     if ( aVisible )
         {
-        bg.DrawableWindow()->SetPointerGrab( EFalse );
+        control->DrawableWindow()->SetPointerGrab( EFalse );
         
         Window().SetOrdinalPosition( 0 );
         Window().SetPointerGrab( ETrue );
@@ -365,13 +367,13 @@
         {
         Window().SetPointerGrab( EFalse );
         
-        bg.DrawableWindow()->SetPointerGrab( ETrue );
+        control->DrawableWindow()->SetPointerGrab( ETrue );               
         
         TRAP_IGNORE( appui.HandleEnterEditModeL( EFalse ) );                                                
         }
     
     // Update background
-    appui.ViewAdapter().BgManager().DrawNow();
+    appui.ViewAdapter().BgManager().UpdateScreen();
     }
 
 // -----------------------------------------------------------------------------
--- a/idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -16,7 +16,13 @@
 */
 
 
-// INCLUDE FILES
+// System includes
+#include <eikapp.h>
+#include <aknappui.h>
+#include <gfxtranseffect/gfxtranseffect.h>  
+#include <akntranseffect.h>                 
+
+// User includes
 #include "xneffectmanager.h"
 #include "xnplugindata.h"
 #include "xnviewdata.h"
@@ -24,20 +30,15 @@
 #include "xndomnode.h"
 #include "xncontroladapter.h"
 
-// SYSTEM INCLUDE FILES
-#include <eikapp.h>
-#include <aknappui.h>
-#include <gfxtranseffect/gfxtranseffect.h>  // For transition effects
-#include <akntranseffect.h>                 // For transition effects
-
-// CONSTANTS
+// Constants
 const TInt KWaitForLayout = 1;
 const TInt KEffectStarted = 2;
 
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
-// C++ default constructor.
+// CXnEffectManager::CXnEffectManager
+//
 // -----------------------------------------------------------------------------
 //
 CXnEffectManager::CXnEffectManager()
@@ -45,7 +46,8 @@
     }
 
 // -----------------------------------------------------------------------------
-// Symbian 2nd phase constructor.
+// CXnEffectManager::ConstructL
+//
 // -----------------------------------------------------------------------------
 //
 void CXnEffectManager::ConstructL()
@@ -53,12 +55,13 @@
     }
 
 // -----------------------------------------------------------------------------
-// Two-phased constructor.
+// CXnEffectManager::NewL
+//
 // -----------------------------------------------------------------------------
 //
 CXnEffectManager* CXnEffectManager::NewL()
     {
-    CXnEffectManager* self = new (ELeave) CXnEffectManager();
+    CXnEffectManager* self = new ( ELeave ) CXnEffectManager();
     CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop( self );
@@ -66,7 +69,8 @@
     }
 
 // -----------------------------------------------------------------------------
-// Destructor.
+// CXnEffectManager::~CXnEffectManager
+//
 // -----------------------------------------------------------------------------
 //
 CXnEffectManager::~CXnEffectManager()
@@ -77,6 +81,7 @@
 
 // -----------------------------------------------------------------------------
 // CXnEffectManager::BeginFullscreenEffectL
+//
 // -----------------------------------------------------------------------------
 //
 void CXnEffectManager::BeginFullscreenEffectL( TInt aId, CXnViewData& aView )
@@ -106,15 +111,16 @@
 
 // -----------------------------------------------------------------------------
 // CXnEffectManager::UiRendered
+//
 // -----------------------------------------------------------------------------
 //
 void CXnEffectManager::UiRendered()
     {
     for ( TInt i = 0; i < iEffects.Count(); )
         {
-        TXnEffect* effect = iEffects[i];
-        if ( effect &&
-             effect->iState == KEffectStarted )
+        TXnEffect* effect( iEffects[i] );
+        
+        if ( effect && effect->iState == KEffectStarted )            
             {
             GfxTransEffect::EndFullScreen();
             RemoveEffect( effect );
@@ -128,14 +134,17 @@
 
 // -----------------------------------------------------------------------------
 // CXnEffectManager::UiLayouted
+//
 // -----------------------------------------------------------------------------
 //
 void CXnEffectManager::UiLayouted()
     {
     for ( TInt i = 0; i < iEffects.Count(); )
         {
-        TBool effectStarted = ETrue;
-        TXnEffect* effect = iEffects[i];
+        TBool effectStarted( ETrue );
+        
+        TXnEffect* effect( iEffects[i] );
+        
         if ( effect && effect->iNode &&
              effect->iState == KWaitForLayout &&
              effect->iNode->IsLaidOut() )
@@ -157,14 +166,16 @@
 
 // -----------------------------------------------------------------------------
 // CXnEffectManager::DoBeginFullscreenEffect
+//
 // -----------------------------------------------------------------------------
 //
 TBool CXnEffectManager::DoBeginFullscreenEffect( TXnEffect& aEffect )
     {
-    CCoeEnv* coe( CCoeEnv::Static() );
+    CCoeEnv* env( CCoeEnv::Static() );
            
-    if ( coe->WsSession().GetFocusWindowGroup() != 
-         coe->RootWin().Identifier() )
+    RWsSession& session( env->WsSession() );
+    
+    if ( session.GetFocusWindowGroup() != env->RootWin().Identifier() )          
         {
         // Window group is not focused
         return EFalse;
@@ -172,28 +183,39 @@
 
     const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel );
     const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() );
-
+    
+    // Must give some time before starting effect, because otherwise
+    // fullscreen effect may contain unwanted parts (dialog, note, etc.)
+    // which was shown when fullscreen effect is about to be started
+    session.Finish();
+    User::After( 1000 );
+        
     // Set effect begin point
     GfxTransEffect::BeginFullScreen( aEffect.iId , iAvkonAppUi->ClientRect(),
         AknTransEffect::EParameterType, AknTransEffect::GfxTransParam(
         targetAppUid, flags ) );
     
     aEffect.iState = KEffectStarted;
+    
     return ETrue;
     }
 
 // -----------------------------------------------------------------------------
 // CXnEffectManager::RemoveEffect
+//
 // -----------------------------------------------------------------------------
 //
 void CXnEffectManager::RemoveEffect( TXnEffect* aEffect )
     {
-    TInt index = iEffects.Find( aEffect );
+    TInt index( iEffects.Find( aEffect ) );
+    
     if ( index != KErrNotFound )
         {
-        TXnEffect* temp = iEffects[index];
-        iEffects.Remove( index );
+        TXnEffect* temp( iEffects[index] ); 
         delete temp;
+        temp = NULL;
+        
+        iEffects.Remove( index );        
         }
     }
 
--- a/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnfocuscontrol.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -118,6 +118,8 @@
                                    
             if ( node )
                 {
+                node->HideTooltipsL();
+                                    
                 CXnControlAdapter* control( node->Control() );
                 
                 if  ( control && control->RefusesFocusLoss() )
--- a/idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xngesture.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -668,6 +668,30 @@
     }
 
 // ----------------------------------------------------------------------------
+// CodeFromPoints
+// ----------------------------------------------------------------------------
+//
+TXnGestureCode CXnGesture::LastDirection( TAxis aRelevantAxis ) const
+    {
+    // select the correct filter based on aRelevantAxis
+    // these filter_ objects are array decorators that will eliminate either
+    // x, y or neither coordinate of each point
+    TXAxisPointArray filterY( iPoints );
+    TYAxisPointArray filterX( iPoints );
+    TXnPointArray filterNone( iPoints );
+    TXnPointArray& filter =
+        aRelevantAxis == EAxisHorizontal ? static_cast< TXnPointArray& >( filterY ) :
+        aRelevantAxis == EAxisVertical   ? static_cast< TXnPointArray& >( filterX ) :
+        /* otherwise EAxisBoth */          filterNone;
+
+    // currently the gesture recogniser does not have any state, so it is fast
+    // to instantiate. The call is not static however, to allow the recogniser
+    // to be replaced by a more complicated implementation that has state.
+    // then it may make sense to make the recogniser a member variable.
+    return TXnGestureRecogniser().LastDirection( filter );
+    }
+
+// ----------------------------------------------------------------------------
 // return nth point from the end of the points array
 // ----------------------------------------------------------------------------
 //
@@ -691,7 +715,7 @@
 //
 inline TPoint CXnGesture::PreviousPos() const
     {
-    return PreviousEntry().iPos;
+    return NthLastEntry( KPreviousPointOffset - 1 ).iPos;
     }
 
 // ----------------------------------------------------------------------------
--- a/idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xngesturehelper.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -212,9 +212,11 @@
 // Handle a pointer event
 // ----------------------------------------------------------------------------
 //
-TSwipeResult CXnGestureHelper::HandlePointerEventL( const TPointerEvent& aEvent )
+TXnGestureCode CXnGestureHelper::HandlePointerEventL( 
+    const TPointerEvent& aEvent )
     {
-    TSwipeResult ret = ESwipeNone;
+    TXnGestureCode ret( EGestureUnknown );
+    
     switch ( aEvent.iType )
         {
         case TPointerEvent::EButton1Down:
@@ -238,6 +240,7 @@
             // since the callback would trigger a gesture callback, and that
             // would access an empty points array.
             iHoldingTimer->Start();
+            iDirection = EGestureUnknown;
             break;
 
         case TPointerEvent::EDrag:
@@ -248,16 +251,34 @@
             // Also, while stylus down, the same event is received repeatedly
             // even if stylus does not move. Filter out by checking if point
             // is the same as the latest point
-            if ( !IsIdle() && !iGesture->IsLatestPoint( Position( aEvent ) ) )
+            if ( iDirection != EGestureCanceled )
                 {
-                AddPointL( aEvent );
-                if ( !( iGesture->IsHolding() ||
-                        iGesture->IsNearHoldingPoint( Position( aEvent ) ) ) )
+                if ( iDirection == EGestureUnknown )
+                    {
+                    // check current direction
+                    iDirection = iGesture->CodeFromPoints( CXnGesture::EAxisBoth );
+                    }
+                else
                     {
-                    // restart hold timer, since pointer has moved
-                    iHoldingTimer->Start();
-                    // Remember the point in which holding was started
-                    iGesture->SetHoldingPoint();
+                    // check if direction has changed
+                    if ( iDirection != iGesture->LastDirection( CXnGesture::EAxisBoth ) )
+                        {
+                        // cancel swipe
+                        iDirection = EGestureCanceled;
+                        }
+                    }
+                
+                if ( !IsIdle() && !iGesture->IsLatestPoint( Position( aEvent ) ) )
+                    {
+                    AddPointL( aEvent );
+                    if ( !( iGesture->IsHolding() ||
+                            iGesture->IsNearHoldingPoint( Position( aEvent ) ) ) )
+                        {
+                        // restart hold timer, since pointer has moved
+                        iHoldingTimer->Start();
+                        // Remember the point in which holding was started
+                        iGesture->SetHoldingPoint();
+                        }
                     }
                 }
             break;
@@ -272,24 +293,27 @@
                 // observer leaves
                 CleanupStack::PushL( TCleanupItem( &ResetHelper, this ) );
                 iGesture->SetComplete();
-                // if adding of the point fails, notify client with a
-                // cancelled event. It would be wrong to send another
-                // gesture code when the up point is not known
-                if ( AddPoint( aEvent ) != KErrNone )
-                    {
-                    iGesture->SetCancelled();
-                    }
-                else
+                if ( iDirection != EGestureCanceled )
                     {
-                    // send gesture code if holding has not been started
-                    if ( !iGesture->IsHolding() )
+                    // if adding of the point fails, notify client with a
+                    // cancelled event. It would be wrong to send another
+                    // gesture code when the up point is not known
+                    if ( AddPoint( aEvent ) != KErrNone )
+                        {
+                        iGesture->SetCancelled();
+                        }
+                    else
                         {
-                        // if client leaves, the state is automatically reset.
-                        // In this case the client will not get the released event
-                        ret = ValidSwipe();
+                        // send gesture code if holding has not been started
+                        if ( !iGesture->IsHolding() )
+                            {
+                            // if client leaves, the state is automatically reset.
+                            // In this case the client will not get the released event
+                            ret = iDirection;
+                            }
+                        // send an event that stylus was lifted
+                        iGesture->SetReleased();
                         }
-                    // send an event that stylus was lifted
-                    iGesture->SetReleased();
                     }
                 // reset state
                 CleanupStack::PopAndDestroy( this );
@@ -299,6 +323,7 @@
         default:
             break;
         }
+    
     return ret;
     }
 
@@ -372,49 +397,7 @@
 // Check if swipe is valid
 // ----------------------------------------------------------------------------
 //
-TSwipeResult CXnGestureHelper::ValidSwipe()
-    {
-    TSwipeResult ret = ESwipeNone;
-    TBool validSwipe(ETrue);
-
-    // check if swipe is between defined values
-    TInt distanceX = Abs( iGesture->Distance().iX );
-    TInt speedX = Abs( static_cast< TInt >( iGesture->Speed().iX ) );
-
-    TInt minLength( iOwner.MarginRect().Width() / 2 );
-    
-    TInt dy( Abs( iGesture->StartPos().iY - iGesture->CurrentPos().iY ) );
-    
-    if ( distanceX < minLength )
-        {
-        validSwipe = EFalse;
-        }
-
-    if ( speedX < KGestureMinSpeedX )
-        {
-        validSwipe = EFalse;
-        }
-               
-    if ( dy > KGestureMaxDeltaY )
-        {
-        validSwipe = EFalse;
-        }
-    
-    // check the direction of swipe
-    if ( validSwipe )
-        {
-        switch ( iGesture->Code( CXnGesture::EAxisHorizontal ) )
-            {
-             case EGestureSwipeLeft:
-                ret = ESwipeLeft;
-                break;
-             case EGestureSwipeRight:
-                 ret = ESwipeRight;
-                break;
-             default: // fall through
-                break;
-            }
-        }
-
-    return ret;
+TXnGestureCode CXnGestureHelper::ValidSwipe() const
+    {                        
+    return iGesture->Code( CXnGesture::EAxisBoth );
     }
--- a/idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xngesturerecogniser.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -23,6 +23,8 @@
 
 using namespace XnGestureHelper;
 
+const TInt minPointCount = 5;
+
 /**
  * Vector class (math)
  */
@@ -180,9 +182,9 @@
     }
 
 /** @return direction between last two points */
-inline TXnGestureCode LastDirection( const TXnPointArray& aPoints )
+TXnGestureCode TXnGestureRecogniser::LastDirection( const TXnPointArray& aPoints ) const
     {
-    if ( aPoints.Count() > 1 )
+    if ( aPoints.Count() > minPointCount )
         {
         // return direction between latest and previous points.
         // pick the previous point that is different than the last point
@@ -191,9 +193,10 @@
         // the differing coordinate coordinate is filtered out. For example,
         // if dragging left and slightly up, many y coordinates will have the
         // same value, while only x differs.
-        return Direction( PreviousPoint( aPoints ), aPoints[aPoints.Count() - 1] );
+        return Direction( aPoints[ aPoints.Count() - minPointCount ],
+                          aPoints[ aPoints.Count() - 1 ] );
         }
-    return EGestureUnknown;
+    return GeneralDirection( aPoints );
     }
 
 // ----------------------------------------------------------------------------
@@ -205,21 +208,13 @@
     __ASSERT_DEBUG( aPoints.Count() > 0, Panic( EGesturePanicIllegalLogic ) );
 
     if (aPoints.Count() <= 0)
+        {
         return EGestureUnknown;
-        
-    if ( IsTap( aPoints ) )
-        {
-        return EGestureTap;
         }
 
     if ( GestureLength( aPoints ) >= KMinSwipeLength )
         {
-        TXnGestureCode direction = GeneralDirection( aPoints );
-        if ( direction != LastDirection( aPoints ) )
-            {
-            direction = EGestureUnknown;
-            }
-        return direction;
+        return GeneralDirection( aPoints );
         }
 
     // the pointer was moved but was either not moved far enough, or was
--- a/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnkeyeventdispatcher.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -40,6 +40,8 @@
     ( k == EStdKeyLeftArrow || k == EStdKeyRightArrow || \
       k == EStdKeyUpArrow || k == EStdKeyDownArrow ) 
 
+const TInt KOneView = 1;
+
 // -----------------------------------------------------------------------------
 // SetInitialFocusL
 // -----------------------------------------------------------------------------
@@ -274,8 +276,30 @@
                 if ( !iNode )
                     {
                     // Find initial location for focus
-                    ResolveAndSetFocusL(); 
-                                            
+                    ResolveAndSetFocusL();
+                    
+                    // If focus is still not set, we are in normal mode and the view is empty.
+                    // left and right arrows lead to next/previous view. When other arrows
+                    // are pressed, the focus is hidden.
+                    if( !iNode )
+                        {
+                        if( iUiEngine.ViewManager()->ViewAmount() != KOneView &&
+                            aKeyEvent.iScanCode == EStdKeyRightArrow )
+                            {
+                            iUiEngine.ViewManager()->ActivateNextViewL();
+                            }
+                        else if( iUiEngine.ViewManager()->ViewAmount() != KOneView &&
+                                 aKeyEvent.iScanCode == EStdKeyLeftArrow )
+                            {
+                            iUiEngine.ViewManager()->ActivatePreviousViewL();
+                            }
+                        else
+                            {
+                            // hide focus if view is not switched
+                            appui.HideFocus();
+                            }
+                        }
+
                     return EKeyWasConsumed;
                     }
                 }
--- a/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnnodeimpl.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -46,6 +46,7 @@
 #include "xnhittest.h"
 #include "xnscrollablecontroladapter.h"
 #include "xnviewdata.h"
+#include "xnrootdata.h"
 #include "xnpanic.h"
 #include "xnlistquerydialogadapter.h"
 #include "xneffectmanager.h"
@@ -59,6 +60,7 @@
 _LIT8( KToolTip, "tooltip" );
 _LIT8( KMenuBar, "menubar" );
 _LIT8( KTextEditor, "texteditor" );
+_LIT8( KPlugin, "plugin" );
 
 _LIT8( KActionsHandler, "actionshandler" );
 
@@ -2810,7 +2812,7 @@
 static void RunActivateNextViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode )
     {
     TInt effectid = ResolveEffectId( aEventNode );
-    aEngine.ViewManager()->ActivateNextViewL( effectid );
+    aEngine.ViewManager()->ActivateNextViewL( /*effectid*/ );
     }
 
 // -----------------------------------------------------------------------------
@@ -2820,7 +2822,7 @@
 static void RunActivatePreviousViewL( CXnUiEngine& aEngine, CXnDomNode& aEventNode )
     {
     TInt effectid = ResolveEffectId( aEventNode );
-    aEngine.ViewManager()->ActivatePreviousViewL( effectid );
+    aEngine.ViewManager()->ActivatePreviousViewL( /*effectid*/ );
     }
 
 // -----------------------------------------------------------------------------
@@ -2944,8 +2946,29 @@
     aEngine.DisableRenderUiLC();
    
     // Set plugins to edit state
-    RPointerArray< CXnPluginData>& plugins( 
-            aEngine.ViewManager()->ActiveViewData().PluginData() );
+    RPointerArray< CXnPluginData >& views( 
+        aEngine.ViewManager()->ActiveAppData().PluginData() );
+    
+    CXnViewData* view( NULL );
+    
+    for ( TInt i = 0; i < views.Count(); i++ )
+        {
+        view = static_cast< CXnViewData* >( views[i] );
+        
+        CXnPluginData* plugin( view->Plugin( aThis->Node() ) );
+        
+        if ( plugin && plugin == view )
+            {
+            break;
+            }            
+        }
+    
+    if ( !view )
+        {
+        return;
+        }
+    
+    RPointerArray< CXnPluginData >& plugins( view->PluginData() );             
 
     CXnDomStringPool* sp( aEventNode.StringPool() );
     
@@ -2980,7 +3003,7 @@
                 // Find nodes by class
                 else if ( name == XnPropertyNames::common::KClass )
                     {
-                    CXnPointerArray* array = aEngine.FindNodeByClassL( value );
+                    CXnPointerArray* array = aEngine.FindNodeByClassL( value, aThis->Namespace() );
                     CleanupStack::PushL( array );
 
                     if ( array )
@@ -3008,7 +3031,8 @@
                 }
             }
         }
-    TBool useEmpty( aEngine.ViewManager()->ActiveViewData().UseEmptyWidget() );
+    
+    TBool useEmpty( view->UseEmptyWidget() );
     
     for ( TInt i = 0; i < plugins.Count(); i++ )
         {
@@ -3025,12 +3049,12 @@
             }                                              
         }
     
-        aEngine.EditMode()->SetEditModeL( CXnEditMode::EDragAndDrop );        
-        aEngine.AppUiAdapter().ViewAdapter().CloseAllPopupsL();
+    aEngine.EditMode()->SetEditModeL( CXnEditMode::EDragAndDrop );        
+    aEngine.AppUiAdapter().ViewAdapter().CloseAllPopupsL();
 
     CleanupStack::PopAndDestroy();
     
-    aEngine.AppUiAdapter().ViewAdapter().UpdateRskByModeL();
+    aEngine.AppUiAdapter().ViewAdapter().UpdateRskByUiStateL( *view );
     }
 
 // -----------------------------------------------------------------------------
@@ -3041,7 +3065,30 @@
     CXnNodeImpl* aThis,
     CXnUiEngine& aEngine,
     CXnDomNode& aEventNode )
-    {    
+    {
+    // Set plugins to edit state
+    RPointerArray< CXnPluginData >& views( 
+        aEngine.ViewManager()->ActiveAppData().PluginData() );
+    
+    CXnViewData* view( NULL );
+    
+    for ( TInt i = 0; i < views.Count(); i++ )
+        {
+        view = static_cast< CXnViewData* >( views[i] );
+        
+        CXnPluginData* plugin( view->Plugin( aThis->Node() ) );
+        
+        if ( plugin && plugin == view )
+            {
+            break;
+            }            
+        }
+    
+    if ( !view )
+        {
+        return;
+        }
+    
     CXnDomList& children( aEventNode.ChildNodes() );
 
     TInt count( children.Length() );
@@ -3072,7 +3119,7 @@
                     }
                 else if ( name == XnPropertyNames::common::KClass )
                     {
-                    CXnPointerArray* array( aEngine.FindNodeByClassL( value ) );
+                    CXnPointerArray* array( aEngine.FindNodeByClassL( value, aThis->Namespace() ) );
                     CleanupStack::PushL( array );
 
                     const TInt count = array->Container().Count();
@@ -3094,13 +3141,12 @@
                 }
             }
         }
-
-    RPointerArray< CXnPluginData>& plugins( 
-            aEngine.ViewManager()->ActiveViewData().PluginData() );
-
+    
+    RPointerArray< CXnPluginData>& plugins( view->PluginData() );             
+    
     CXnDomStringPool* sp( aEventNode.StringPool() );
 
-    TBool useEmpty( aEngine.ViewManager()->ActiveViewData().UseEmptyWidget() );
+    TBool useEmpty( view->UseEmptyWidget() );
     
     for ( TInt i = 0; i < plugins.Count(); i++ )
         {
@@ -3119,7 +3165,7 @@
     
     aEngine.EditMode()->SetEditModeL( CXnEditMode::ENone );   
 
-    aEngine.AppUiAdapter().ViewAdapter().UpdateRskByModeL();
+    aEngine.AppUiAdapter().ViewAdapter().UpdateRskByUiStateL( *view );
     }
 
 // -----------------------------------------------------------------------------
@@ -3763,7 +3809,7 @@
         }
     else if ( name && classId && type )
         {
-        CXnPointerArray* array = aEngine.FindNodeByClassL( *classId );
+        CXnPointerArray* array = aEngine.FindNodeByClassL( *classId, aThis->Namespace() );
         CleanupStack::PushL( array );
 
         const TInt count = array->Container().Count();
@@ -4842,12 +4888,6 @@
     // find node below or above to the right
     if ( !nextNode )
         {
-        if ( !stayInNamespace && aEngine &&
-             aEngine->ViewManager()->ViewAmount() != KOneView )
-            {
-            aEngine->ViewManager()->ActivateNextViewL();
-            return nextNode;
-            }
         CXnNode* candidateAbove = NULL;
         CXnNode* candidateBelow = NULL;
 
@@ -4968,6 +5008,13 @@
     // loop to the right
     if ( !nextNode )
         {
+        if ( !stayInNamespace && aEngine &&
+             aEngine->ViewManager()->ViewAmount() != KOneView )
+            {
+            aEngine->ViewManager()->ActivateNextViewL();
+            return nextNode;
+            }        
+        
         CXnNode* candidateAbove = NULL;
         CXnNode* candidateBelow = NULL;
 
@@ -5271,12 +5318,6 @@
 
     if ( !nextNode )
         {
-        if ( !stayInNamespace && aEngine &&
-             aEngine->ViewManager()->ViewAmount() != KOneView )
-            {
-            aEngine->ViewManager()->ActivatePreviousViewL();
-            return nextNode;
-            }
         CXnNode* candidateAbove = NULL;
         CXnNode* candidateBelow = NULL;
 
@@ -5400,6 +5441,13 @@
     // loop to the left
     if ( !nextNode )
         {
+        if ( !stayInNamespace && aEngine &&
+             aEngine->ViewManager()->ViewAmount() != KOneView )
+            {
+            aEngine->ViewManager()->ActivatePreviousViewL();
+            return nextNode;
+            }
+        
         CXnNode* candidateAbove = NULL;
         CXnNode* candidateBelow = NULL;
 
@@ -5936,8 +5984,6 @@
 //
 static CXnNode* FindPluginNode( CXnNode& aNode )
     {
-    _LIT8( KPlugin, "plugin" );
-
     CXnNode* pluginNode = NULL;
     CXnNode* tmp = &aNode;
 
@@ -6017,6 +6063,19 @@
             }
         if ( nextNode )
             {
+            // focus plugin node if in edit mode
+            if( aEngine.IsEditMode() )
+                {
+                if( nextNode->Type()->Type() != KPlugin )
+                    {
+                    CXnNode* pluginNode = FindPluginNode( *nextNode );
+                    if( pluginNode )
+                        {
+                        nextNode = pluginNode;
+                        }
+                    }
+                }
+
             if( nextNode && nextNode->ScrollableControl() )
                 {
                 nextNode->ScrollableControl()->ShowItem( *nextNode );
@@ -7070,7 +7129,7 @@
                     {
                     if ( aSource == XnEventSource::EStylus )
                         {
-                        const TTimeIntervalMicroSeconds32 delay( 0 );                       
+                        const TTimeIntervalMicroSeconds32 delay( 1000 * 100 );                       
                         const TTimeIntervalMicroSeconds32 display( 1000 * 1000 * 6 );                                                
                         
                         popup->ShowPopupL( aRect, delay, display );
--- a/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnodtparser.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -32,6 +32,7 @@
 #include "xnuiengine.h"
 #include "xntype.h"
 #include "xncontroladapter.h"
+#include "xnviewcontroladapter.h"
 #include "xnpopupcontroladapter.h"
 #include "xnwidgetextensionadapter.h"
 #include "xnscrollablecontroladapter.h"
@@ -1179,7 +1180,7 @@
     if ( aName != KBoxNodeName && aName != KButtonNodeName &&
          aName != KStylusPopupNodeName && aName != KScrollableBoxNodeName&& 
          aName != KWidgetExtensionNodeName && 
-                  aName != KPopUpNodeName &&
+         aName != KPopUpNodeName && aName != KViewNodeName &&
 		 aName != XnPropertyNames::listquerydialog::KListQueryDialog )         
         {
         return CreateExternalControlL( aNode, aName );
@@ -1226,12 +1227,15 @@
                 }
             }
         }
-
-    __ASSERT_DEBUG( parentAdapter, User::Leave( KErrGeneral ) );
     
     CXnControlAdapter* adapter( NULL );
-    
-    if( aName == KStylusPopupNodeName )
+
+    if( aName == KViewNodeName )
+        {
+        adapter = CXnViewControlAdapter::NewL( aNode.PluginIfL() );
+        CleanupStack::PushL( adapter );
+        }
+    else if( aName == KStylusPopupNodeName )
         {
         adapter = CXnPopupControlAdapter::NewL( aNode.PluginIfL() );
         CleanupStack::PushL( adapter );
@@ -1270,12 +1274,24 @@
         CleanupStack::PushL( adapter );
         }
     
-    parentAdapter->AppendChildL( *adapter, aNode );
-    CleanupStack::Pop( adapter );
+    if ( parentAdapter )
+        {
+        parentAdapter->AppendChildL( *adapter, aNode );
+        }
     
-    component->SetControlAdapter( adapter );
+    component->SetControlAdapter( adapter ); // ovnership transferred
+    CleanupStack::Pop( adapter );
 
-    aNode.ComponentNodeImpl()->SetComponent( component );
+    __ASSERT_DEBUG( adapter, User::Leave( KErrGeneral ) );
+    
+    if( aName == KViewNodeName )
+        {
+        aNode.ViewNodeImpl()->SetComponent( component );
+        }
+    else
+        {
+        aNode.ComponentNodeImpl()->SetComponent( component );
+        }
 
     component->SetNode( aNode.PluginIfL() );
 
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -138,6 +138,17 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnUiEngine::FindContentSourceNodesL
+// Forwards the call to the ui engine implementation
+// -----------------------------------------------------------------------------
+//
+CXnPointerArray* CXnUiEngine::FindContentSourceNodesL(
+    const TDesC8& aNamespace )
+    {
+    return iUiEngineImpl->FindContentSourceNodesL( aNamespace );
+    }
+
+// -----------------------------------------------------------------------------
 // CXnUiEngine::RenderUIL
 // Forwards the call to the ui engine implementation
 // -----------------------------------------------------------------------------
@@ -530,7 +541,7 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnUiEngine::EnablePartialTouchInput( )
+// CXnUiEngine::EnablePartialTouchInput()
 // -----------------------------------------------------------------------------
 //               
 void CXnUiEngine::EnablePartialTouchInput( CXnNode& aNode, TBool aEnable )
@@ -547,6 +558,14 @@
     return iUiEngineImpl->IsPartialInputActive();
     }
 
+// -----------------------------------------------------------------------------
+// CXnUiEngine::IsTextEditorActive()
+// -----------------------------------------------------------------------------
+//               
+TBool CXnUiEngine::IsTextEditorActive()
+    {
+    return iUiEngineImpl->IsTextEditorActive();
+    }
 
 #ifndef EKA2
 GLDEF_C TInt  E32Dll( TDllReason )
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengine.rss	Mon Mar 15 12:39:47 2010 +0200
@@ -157,7 +157,4 @@
     buf = qtn_hs_operation_failed_no_disk; 
     }
 
-RESOURCE TBUF r_qtn_hs_corrupted_image_note 
-    {
-    buf = qtn_hs_corrupted_image_note; 
-    }
+// End of file
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineappif.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -142,38 +142,33 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnUiEngine::FindNodeByClassL
+// CXnUiEngine::FindContentSourceNodesL
 // Forwards the call to the ui engine implementation
 // -----------------------------------------------------------------------------
 //
 EXPORT_C RPointerArray< CXnNodeAppIf > TXnUiEngineAppIf::FindContentSourceNodesL(
     const TDesC8& aNamespace )
-    {
+    {   
+    CXnPointerArray* array = iUiEngine->FindContentSourceNodesL( aNamespace );
+    CleanupStack::PushL( array );
+    
     RPointerArray< CXnNodeAppIf > interfaceArray;
     CleanupClosePushL( interfaceArray );
-
-    CXnViewManager* manager( iUiEngine->ViewManager() );
-
-    CXnPluginData* data( manager->ActiveViewData().Plugin( aNamespace ) );
-
-    if ( data )
+    
+    const TInt count = array->Container().Count();
+    interfaceArray.ReserveL( count );
+    
+    for ( TInt i = 0; i < count; i++ )
         {
-        RPointerArray< CXnNode > nodes;
-        CleanupClosePushL( nodes );
-
-        data->ContentSourceNodesL( nodes );
-
-        for ( TInt i = 0; i < nodes.Count(); i++ )
-            {
-            interfaceArray.AppendL( &nodes[i]->AppIfL() );
-            }
-
-        CleanupStack::PopAndDestroy( &nodes );
+        CXnNode* node = static_cast< CXnNode* >( array->Container()[i] );
+        // Append cannot fail because ReserveL call before this loop has
+        // allocated the array buffer
+        interfaceArray.Append( &( node->AppIfL() ) );    
         }
-
+    
     CleanupStack::Pop( &interfaceArray );
-
-    return interfaceArray;
+    CleanupStack::PopAndDestroy( array );
+    return interfaceArray;    
     }
 
 // -----------------------------------------------------------------------------
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuiengineimpl.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -33,7 +33,9 @@
 #include "xndompropertyvalue.h"
 #include "xnmenuadapter.h"
 #include "xnpopupcontroladapter.h"
+#include "xnviewcontroladapter.h"
 #include "xnviewdata.h"
+#include "xnrootdata.h"
 #include "xnnodebreadthfirstiterator.h"
 #include "xntype.h"
 #include "xnnodepluginif.h"
@@ -56,7 +58,6 @@
 #include "xneditor.h"
 #include "xnbackgroundmanager.h"
 #include "xntexteditor.h"
-#include "xnbgcontrol.h"
 
 #ifdef _XN_PERFORMANCE_TEST_
 #include "xntimemon.h"
@@ -81,6 +82,7 @@
 _LIT8( KScrollableBoxNodeName, "scrollablebox" );
 _LIT8( KMenuBar, "menubar" );
 _LIT8( KPopUpNodeName, "popup" );
+_LIT8( KEditorNodeName, "texteditor" );
 
 _LIT8( KPlugin, "plugin" );
 
@@ -8102,7 +8104,6 @@
            
     delete iEditMode;
     delete iHitTest;
-    delete iSplitScreenState.iPartialScreenBlock;
 
     iFocusCandidateList.Reset();
     iRedrawRegions.ResetAndDestroy();
@@ -8274,7 +8275,7 @@
                         rect = ClientRect();
                         
                         // Move it to 0, 0
-                        rect.Move( -rect.iTl.iX, -rect.iTl.iY );                        
+                        //rect.Move( -rect.iTl.iX, -rect.iTl.iY );                        
                         }
                     else
                         {
@@ -8422,9 +8423,31 @@
     const TDesC8& aNamespace )
     {
     // Find the namespace where to start node id look-up 
-    CXnPluginData* pluginData( 
-        iViewManager.ActiveViewData().Plugin( aNamespace ) );
-
+    CXnViewData& active( iViewManager.ActiveViewData() );
+    
+    CXnPluginData* pluginData( active.Plugin( aNamespace ) ); 
+        
+    if ( aNamespace != KNullDesC8 && !pluginData )
+        {
+        RPointerArray< CXnPluginData >& views( 
+            iViewManager.ActiveAppData().PluginData() );
+        
+        for ( TInt i = 0; i < views.Count(); i++ )
+            {
+            CXnViewData* view = static_cast< CXnViewData* >( views[i] );
+            
+            if ( view != &active )
+                {
+                pluginData = view->Plugin( aNamespace );
+                
+                if ( pluginData )
+                    {
+                    break;
+                    }
+                }
+            }                
+        }
+    
     if ( !pluginData )
         {
         return NULL;
@@ -8464,9 +8487,31 @@
     const TDesC8& aClassId, const TDesC8& aNamespace )
     {
     // Find the namespace where to start node class look-up
-    CXnPluginData* pluginData( 
-        iViewManager.ActiveViewData().Plugin( aNamespace ) );
-
+    CXnViewData& active( iViewManager.ActiveViewData() );
+    
+    CXnPluginData* pluginData( active.Plugin( aNamespace ) ); 
+        
+    if ( aNamespace != KNullDesC8 && !pluginData )
+        {
+        RPointerArray< CXnPluginData >& views( 
+            iViewManager.ActiveAppData().PluginData() );
+        
+        for ( TInt i = 0; i < views.Count(); i++ )
+            {
+            CXnViewData* view = static_cast< CXnViewData* >( views[i] );
+            
+            if ( view != &active )
+                {
+                pluginData = view->Plugin( aNamespace );
+                
+                if ( pluginData )
+                    {
+                    break;
+                    }
+                }
+            }                
+        }
+    
     CXnPointerArray* array = CXnPointerArray::NewL();
     CleanupStack::PushL( array );
     
@@ -8482,6 +8527,65 @@
     }
 
 // -----------------------------------------------------------------------------
+// CXnUiEngineImpl::FindContentSourceNodesL()
+// -----------------------------------------------------------------------------
+//
+CXnPointerArray* CXnUiEngineImpl::FindContentSourceNodesL(
+    const TDesC8& aNamespace )
+    {
+    CXnViewData& active( iViewManager.ActiveViewData() );
+
+    CXnPluginData* pluginData( active.Plugin( aNamespace ) );
+    
+    if ( aNamespace != KNullDesC8 && !pluginData )
+        {
+        RPointerArray< CXnPluginData >& views( 
+            iViewManager.ActiveAppData().PluginData() );
+        
+        for ( TInt i = 0; i < views.Count(); i++ )
+            {
+            CXnViewData* view = static_cast< CXnViewData* >( views[i] );
+            
+            if ( view != &active )
+                {
+                pluginData = view->Plugin( aNamespace );
+                
+                if ( pluginData )
+                    {
+                    break;
+                    }
+                }
+            }                    
+        }
+          
+    CXnPointerArray* array = CXnPointerArray::NewL();
+    CleanupStack::PushL( array );
+    
+    if ( pluginData )
+        {       
+        RPointerArray< CXnNode > list;
+        CleanupClosePushL( list );
+       
+        pluginData->ContentSourceNodesL( list );
+       
+        const TInt count( list.Count() );
+       
+        array->Container().ReserveL( count );
+       
+        for ( TInt i = 0; i < count; i++ )
+            {
+            array->Container().Append( list[i] );
+            }
+       
+        CleanupStack::PopAndDestroy( &list );
+        }
+   
+    CleanupStack::Pop( array );
+
+    return array;
+    }
+    
+// -----------------------------------------------------------------------------
 // CXnUiEngineImpl::Resources()
 // -----------------------------------------------------------------------------
 //
@@ -8592,7 +8696,7 @@
     SetClientRectL( iAppUiAdapter.ClientRect(), EFalse );
     
     RootNode()->SetDirtyL();
-    iUiEngine->RenderUIL();
+    ForceRenderUIL();
     }
 
 // -----------------------------------------------------------------------------
@@ -8883,31 +8987,6 @@
 //
 void CXnUiEngineImpl::HandleResourceChangeL( TInt aType )
     {
-    
-    if ( aType == KAknSplitInputEnabled ) 
-        {
-        if(!iSplitScreenState.isPartialScreenEnabled )
-            {
-            DisableRenderUiLC();
-            HandlePartialTouchInputL( aType );
-            RootNode()->SetDirtyL();
-            ForceRenderUIL();
-            CleanupStack::PopAndDestroy();
-            }
-        }    
-    
-     if ( aType == KAknSplitInputDisabled ) 
-        {
-        if( iSplitScreenState.isPartialScreenEnabled )    
-            {
-            DisableRenderUiLC();
-            HandlePartialTouchInputL( aType );
-            RootNode()->SetDirtyL();
-            ForceRenderUIL();
-            CleanupStack::PopAndDestroy();
-            }
-        }    
-
     if ( iMenuNode )
         {
         CXnControlAdapter* adapter( iMenuNode->Control() );
@@ -8920,61 +8999,105 @@
     
     if ( aType == KEikDynamicLayoutVariantSwitch )
         {
-        // Must return here if there is no current view or
-        // controladapterlist. This may occur when the phone
-        // is booted for the first time and the location/date
-        // query is visible.
-        if ( !ActiveView() )
-            {
-            return;
-            }
-
-        // Update client rect
-        SetClientRectL( iAppUiAdapter.ClientRect(), EFalse );
-
-        // Update background rect
-        // Bg rect is always screen size.
-        TRect bgRect;
-        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect );
-        iAppUiAdapter.ViewAdapter().BgManager().SetRect( bgRect );
-
-        iEditMode->HandleScreenDeviceChangedL();
-        
-        // Force relayout
-        DisableRenderUiLC();
-        
-        RootNode()->SetDirtyL();
-
-        ReportScreenDeviceChangeL();
-                
-        for ( TInt i = 0; i < iControlAdapterList->Count(); i++ )
-            {
-            CXnControlAdapter* adapter( ( *iControlAdapterList )[i] );
-            
-            adapter->HandleScreenDeviceChangedL();
-            }
-        
-        ForceRenderUIL();
-        
-        CleanupStack::PopAndDestroy();
+        HandleDynamicLayoutVariantSwitchL();
         }
     else if ( aType == KAknsMessageSkinChange )
         {
-        // Force relayout
-        DisableRenderUiLC();
+        HandleSkinChangeL();
+        }
+    else if( iCurrentViewControlAdapter )
+        {
+        iCurrentViewControlAdapter->HandleResourceChange( aType );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CXnUiEngineImpl::HandleSkinChangeL
+// Handles a skin change to the controls
+// -----------------------------------------------------------------------------
+//
+void CXnUiEngineImpl::HandleSkinChangeL()
+    {
+    // Force relayout
+    DisableRenderUiLC();
+    
+    RootNode()->SetDirtyL();
+
+    for ( TInt i = 0; i < iControlAdapterList->Count(); i++ )
+        {
+        CXnControlAdapter* adapter( ( *iControlAdapterList )[i] );
+        adapter->SkinChanged();
+        }
+
+    ForceRenderUIL();
+    
+    CleanupStack::PopAndDestroy();
+    
+    // Handle inactive views
+    RPointerArray< CXnPluginData >& views(
+            iAppUiAdapter.ViewManager().ActiveAppData().PluginData() );
+
+    for ( TInt i = 0; i < views.Count(); i++ )
+        {
+        CXnViewData* view = static_cast< CXnViewData* >( views[i] );
+        if ( view && !view->Active() )
+            {
+            RPointerArray< CXnControlAdapter > controls;
+            CleanupClosePushL( controls );
+            view->ControlsL( controls );
+            for ( TInt j = 0; j < controls.Count(); j++ )
+                {
+                controls[j]->SkinChanged();
+                }
+            CleanupStack::PopAndDestroy( &controls );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CXnUiEngineImpl::HandleDynamicLayoutVariantSwitchL
+// Handles a KEikDynamicLayoutVariantSwitch resource change
+// -----------------------------------------------------------------------------
+//
+void CXnUiEngineImpl::HandleDynamicLayoutVariantSwitchL()
+    {
+    // Must return here if there is no current view or
+    // controladapterlist. This may occur when the phone
+    // is booted for the first time and the location/date
+    // query is visible.
+    if ( !ActiveView() )
+        {
+        return;
+        }
+
+    // Update client rect
+    SetClientRectL( iAppUiAdapter.ClientRect(), EFalse );
+
+    // Update background rect
+    // Bg rect is always screen size.
+    TRect bgRect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, bgRect );
+    iAppUiAdapter.ViewAdapter().BgManager().SetRect( bgRect );
+
+    iEditMode->HandleScreenDeviceChangedL();
+    
+    // Force relayout
+    DisableRenderUiLC();
+    
+    RootNode()->SetDirtyL();
+
+    ReportScreenDeviceChangeL();
+            
+    for ( TInt i = 0; i < iControlAdapterList->Count(); i++ )
+        {
+        CXnControlAdapter* adapter( ( *iControlAdapterList )[i] );
         
-        RootNode()->SetDirtyL();
-
-        for ( TInt i = 0; i < iControlAdapterList->Count(); i++ )
-            {
-            CXnControlAdapter* adapter( ( *iControlAdapterList )[i] );
-            adapter->SkinChanged();
-            }
-
-        ForceRenderUIL();
-        
-        CleanupStack::PopAndDestroy();
-        }
+        adapter->HandleScreenDeviceChangedL();
+        }
+    
+    ForceRenderUIL();
+    
+    CleanupStack::PopAndDestroy();
     }
 
 // -----------------------------------------------------------------------------
@@ -9188,11 +9311,15 @@
         }
     
     TBool retval( EFalse );
-    if ( iDisableCount > 0 &&
-         !( iLayoutControl & XnLayoutControl::EIgnoreState ) )
-        {
-        retval =  ETrue;
-        }
+    
+    if ( !( iLayoutControl & XnLayoutControl::EIgnoreState ) )
+        {
+        if ( iDisableCount > 0 )
+            {
+            retval = ETrue;
+            }
+        }
+    
     return retval;
     }
 
@@ -9389,9 +9516,7 @@
         
         UpdateInternalUnits( iHorizontalUnitInPixels, iVerticalUnitInPixels,
             iClientRect );
-        
-        iAppUiAdapter.ViewAdapter().BgControl().SetRect( aRect );
-
+               
         if ( aDrawNow )
             {
             RootNode()->SetDirtyL();
@@ -9721,74 +9846,59 @@
 // -----------------------------------------------------------------------------
 // CXnUiEngineImpl::HandlePartialTouchInputL()
 // -----------------------------------------------------------------------------
-void CXnUiEngineImpl::HandlePartialTouchInputL( TInt aType )
-    {
-    if( !iSplitScreenState.iPartialScreenEditorNode )
-        {
-        return;
-        }
-    if ( aType == KAknSplitInputEnabled ) 
-        {
+void CXnUiEngineImpl::HandlePartialTouchInputL( CXnNode& aNode, TBool aEnable )
+    {
+    DisableRenderUiLC();
+    CXnNode* editorplugin = FindPlugin( aNode );
+
+    if ( aEnable ) 
+    
+        {        
+        iSplitScreenState.iPartialScreenOpen = ETrue;           
+        iSplitScreenState.iPartialScreenEditorNode = &aNode;           
+
         // make sure that we always get up event
-        CCoeControl& bg( iAppUiAdapter.ViewAdapter().BgControl() );                    
-        static_cast<CXnBgControl*>(&bg)->ResetGrabbingL();        
-
-        // don't remove input from stack if split input is enabled
-        XnTextEditorInterface::MXnTextEditorInterface* editorControl = NULL;             
-        XnComponentInterface::MakeInterfaceL( editorControl, 
-            iSplitScreenState.iPartialScreenEditorNode->AppIfL() );
-        if( editorControl )
-            {
-            editorControl->HandleEditorEvent(CXnTextEditor::KKeepSplitInputInStack);
-            }
-
-        RPointerArray<CXnNode> plugins = *Plugins();        
-     
-         for( TInt i=0; i<plugins.Count(); i++ )     
+        CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >(  
+            iViewManager.ActiveViewData().ViewNode()->Control() );            
+                
+        control->ResetGrabbing();
+
+        // Hide all plugins except the one that contains given editor node
+        RPointerArray< CXnNode >& plugins( *Plugins() );                   
+        for( TInt i=0; i<plugins.Count(); i++ )
              {         
              CXnNode* pluginNode = plugins[i];
-             CXnNode* editorplugin = FindPlugin( *iSplitScreenState.iPartialScreenEditorNode );
-             
              if ( pluginNode != editorplugin )
                 {
                 SetNodeVisibleL(pluginNode, EFalse);
                 }      
              }
-            
+         
+        // Block progression must be bottom-to-top when partial screen is open
+        // Previous value needs to be stored first
         StorePartialScreenBlockProgressionL();
            
-        iSplitScreenState.isPartialScreenEnabled = ETrue;           
         SetPartialScreenBlockProgressionL( 
             XnPropertyNames::style::common::block_progression::KBT );
+        
+        // Hide statuspane
         iAppUiAdapter.StatusPane()->MakeVisible( EFalse );
         } 
      
-     if ( aType == KAknSplitInputDisabled ) 
-         {
-         
-         // set remove stack true if disable event does not come from widget controls
-         if(iSplitScreenState.isPartialScreenOpen)
-             {
-             XnTextEditorInterface::MXnTextEditorInterface* editorControl = NULL;             
-             XnComponentInterface::MakeInterfaceL( editorControl, 
-                 iSplitScreenState.iPartialScreenEditorNode->AppIfL() );
-             if( editorControl )
-                 {
-                 editorControl->HandleEditorEvent(CXnTextEditor::KRemoveSplitInputFromStack);
-                 }
-             }
-
-         RPointerArray<CXnNode> plugins = *Plugins();
-    
-            for( TInt i=0; i<plugins.Count(); i++ )
-               {           
-               CXnNode* pluginNode = plugins[i];               
-               
-               if ( pluginNode != iSplitScreenState.iPartialScreenEditorNode )
-                    {
-                    SetNodeVisibleL(pluginNode, ETrue);
-                    }           
-               }
+    else
+        { 
+        // Show plugin nodes again
+        RPointerArray< CXnNode >& plugins( *Plugins() );                   
+
+        for( TInt i=0; i<plugins.Count(); i++ )
+           {           
+           CXnNode* pluginNode = plugins[i];               
+           
+           if ( pluginNode != editorplugin )
+                {
+                SetNodeVisibleL(pluginNode, ETrue);
+                }           
+           }
             
         if( iSplitScreenState.iPartialScreenBlock == NULL )
             {
@@ -9798,11 +9908,20 @@
         else
             {
             SetPartialScreenBlockProgressionL(iSplitScreenState.iPartialScreenBlock->Des());
+            delete iSplitScreenState.iPartialScreenBlock; 
+            iSplitScreenState.iPartialScreenBlock = NULL;
             }
         
-         iSplitScreenState.isPartialScreenEnabled = EFalse;
-         iAppUiAdapter.StatusPane()->MakeVisible(ETrue);
-         }
+        iSplitScreenState.iPartialScreenEditorNode = NULL;
+        iSplitScreenState.iPartialScreenOpen = EFalse;
+                 
+        // Show statuspane again
+        iAppUiAdapter.StatusPane()->MakeVisible(ETrue);
+        }
+    
+    RootNode()->SetDirtyL();
+    ForceRenderUIL();
+    CleanupStack::PopAndDestroy();
     }
 
 // -----------------------------------------------------------------------------
@@ -9901,9 +10020,12 @@
 // EnablePartialTouchInput 
 // -----------------------------------------------------------------------------
 void CXnUiEngineImpl::EnablePartialTouchInput( CXnNode& aNode, TBool aEnable )
-    {    
-    iSplitScreenState.iPartialScreenEditorNode = &aNode;
-    iSplitScreenState.isPartialScreenOpen = aEnable;
+    {
+    if( aEnable && !iSplitScreenState.iPartialScreenOpen ||
+        !aEnable && iSplitScreenState.iPartialScreenOpen )
+        {
+        TRAP_IGNORE( HandlePartialTouchInputL( aNode, aEnable ) );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -9993,8 +10115,28 @@
 // -----------------------------------------------------------------------------
 TBool CXnUiEngineImpl::IsPartialInputActive()
     {
-    return iSplitScreenState.isPartialScreenEnabled;
-    }
-
+    return iSplitScreenState.iPartialScreenOpen;
+    }
+
+// -----------------------------------------------------------------------------
+// CXnUiEngineImpl::IsTextEditorActive()
+// -----------------------------------------------------------------------------
+//               
+TBool CXnUiEngineImpl::IsTextEditorActive()
+    {
+    if( iSplitScreenState.iPartialScreenOpen )
+        {
+        return ETrue;
+        }
+    CXnNode* focusedNode = FocusedNode();
+    if( focusedNode )
+        {
+        if( focusedNode->Type()->Type() == KEditorNodeName )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
 
 // End of file
--- a/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnuienginepluginif.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -451,6 +451,15 @@
     iUiEngine->EnablePartialTouchInput(aNode.Node(), aEnable);
     }
 
+// -----------------------------------------------------------------------------
+// TXnUiEnginePluginIf::IsTextEditorActive
+// 
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TBool TXnUiEnginePluginIf::IsTextEditorActive()
+    {
+    return iUiEngine->IsTextEditorActive();
+    }
 
 
 // End of file
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewadapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -37,7 +37,6 @@
 #include "xnnodeimpl.h"
 #include "xnnode.h"
 #include "xntype.h"
-#include "xnbgcontrol.h"
 #include "xnfocuscontrol.h"
 #include "xneditor.h"
 #include "xnbackgroundmanager.h"
@@ -52,6 +51,7 @@
 // Constants
 const TUid KXmlViewUid = { 1 };
 _LIT8( KActivateDefaultView, "activatedefault" );
+_LIT8( KMenuBar, "menubar" );
 
 // Data types
 enum 
@@ -211,8 +211,7 @@
     delete iTimer;
     delete iActivate;
     delete iDeactivate;
-    delete iEditState;
-    delete iBgControl;
+    delete iEditState;    
     delete iBgManager;
     delete iFocusControl;
     }
@@ -248,9 +247,6 @@
     iAppUiAdapter.AddViewL( this );    
     iAppUiAdapter.SetDefaultViewL( *this );
 
-    iBgControl = CXnBgControl::NewL();
-    iBgControl->SetMopParent( this );
-
     iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(),
         iAppUiAdapter.ViewManager().Editor().HspsWrapper() );
 
@@ -326,16 +322,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnViewAdapter::BgControl
-// Returns bg control.
-// -----------------------------------------------------------------------------
-//
-CCoeControl& CXnViewAdapter::BgControl() const
-    {
-    return *iBgControl;
-    }
-
-// -----------------------------------------------------------------------------
 // CXnViewAdapter::BgManager
 // Returns background manager.
 // -----------------------------------------------------------------------------
@@ -346,7 +332,7 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnViewAdapter::BgControl
+// CXnViewAdapter::FocusControl
 // Returns focus control.
 // -----------------------------------------------------------------------------
 //
@@ -386,6 +372,9 @@
     
     iAppUiAdapter.AddToStackL( *this, iEventDispatcher );
 
+    // enable statuspane transparancy 
+    CEikStatusPane* sp( iAppUiAdapter.StatusPane() );
+
     CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() );
     
     if ( bgc )
@@ -396,8 +385,7 @@
 
         iAppUiAdapter.RemoveFromStack( cba );        
         }
-    
-    iBgControl->MakeVisible( ETrue );
+        
     iBgManager->MakeVisible( ETrue );
 
     // Set status pane layout
@@ -410,15 +398,19 @@
 
     if ( spane != KErrNotFound )
         {
-        CEikStatusPane* sp( iAppUiAdapter.StatusPane() );
-
         if ( sp && sp->CurrentLayoutResId() != spane )
             {
             sp->SwitchLayoutL( spane );
             sp->ApplyCurrentSettingsL();
             }
         }    
-                
+    
+    if ( sp && !sp->IsTransparent() ) 
+        { 
+        sp->EnableTransparent( ETrue );
+        sp->DrawNow();
+        }
+
     if ( iFlags.IsSet( EIsFirstActivation ) )
         {                             
         // Set the active container
@@ -497,7 +489,6 @@
 
     TRAP_IGNORE( DeactivateContainerL() );
     
-    iBgControl->MakeVisible( EFalse );
     iBgManager->MakeVisible( EFalse );
     
     iFocusControl->MakeVisible( EFalse );
@@ -514,12 +505,19 @@
 //
 void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, 
     TBool aEnterEditState )
-    {                       
-    if ( iContainer == &aContainer || iFlags.IsSet( EIsDestructionRunning ) )    
+    {   
+    if ( !iAppUiAdapter.ViewManager().UiStartupPhaseAllDone() )
+        {
+        return;
+        }            
+        
+    if ( iContainer == &aContainer || iFlags.IsSet( EIsDestructionRunning ) )   
         {            
         return;
         }
 
+    const CXnViewData* previous( iContainer );
+    
     // Deactivate previous
     DeactivateContainerL();
     
@@ -529,8 +527,8 @@
         // postpone container activation
         return;
         }
-    
-    // Update
+        
+    // Update  
     iContainer = &aContainer;
         
     // Disable layout and redraw until container activation is done
@@ -555,9 +553,7 @@
         // This container is in-call state
         NotifyInCallStateChaged( ETrue );        
         }
-                 
-    iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer );
-    
+       
     if ( aEnterEditState || iAppUiAdapter.UiEngine().IsEditMode() )
         {
         EnterEditStateL( aContainer, ETrue );                        
@@ -566,14 +562,20 @@
         {
         EnterEditStateL( aContainer, EFalse );                                
         }
+                          
+    iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer );
+    
+    if ( previous && iContainer )
+        {
+        iBgManager->WallpaperChanged( *previous, *iContainer );    
+        }
     
     CXnControlAdapter* adapter( node->Control() );
-    
-    iBgControl->SetCompoundControl( adapter );
-            
+    adapter->MakeVisible( ETrue );
+	            
     iAppUiAdapter.UiEngine().RenderUIL();
     
-    CleanupStack::PopAndDestroy(); // DisableRenderUiLC        
+    CleanupStack::PopAndDestroy(); // DisableRenderUiLC   
     }
 
 // -----------------------------------------------------------------------------
@@ -672,8 +674,7 @@
     CXnNode* node( iContainer->Node()->LayoutNode() );
                 
     node->ReportXuikonEventL( *iDeactivate );
-
-    iBgControl->SetCompoundControl( NULL );
+    node->Control()->MakeVisible( EFalse );
     
     iContainer = NULL;
     }
@@ -741,9 +742,9 @@
         {
         return;
         }
-    
+
     TBool incallNow( iFlags.IsSet( EIsInCall ) ? ETrue : EFalse );
-    
+
     if ( incallNow == aInCall )
         {
         return;
@@ -757,8 +758,10 @@
         {
         iFlags.Clear( EIsInCall );
         }
+
+    CXnViewData& view( iAppUiAdapter.ViewManager().ActiveViewData() );
     
-    TRAP_IGNORE( UpdateRskByModeL() );
+    TRAP_IGNORE( UpdateRskByUiStateL( view ) );
     }
 
 // -----------------------------------------------------------------------------
@@ -821,13 +824,35 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnViewAdapter::UpdateRskByModeL()
+// CXnViewAdapter::UpdateRskByUiStateL()
 // 
 // -----------------------------------------------------------------------------
 //
-void CXnViewAdapter::UpdateRskByModeL()
+void CXnViewAdapter::UpdateRskByUiStateL( const CXnViewData& aViewData )
     {
-    CXnNode* menubar( iAppUiAdapter.UiEngine().MenuBarNode() );
+    CXnNode* menubar( NULL );
+    
+    CXnDomNode* view( aViewData.Node() );
+    
+    if ( view && view->LayoutNode() )
+        {
+        RPointerArray< CXnNode >& children( view->LayoutNode()->Children() );
+        
+        for ( TInt count = children.Count() - 1; count >= 0 ; --count )
+            {
+            CXnNode* node( children[count] );
+
+            // Check that the given type of a control is parent
+            // (or ancestor) of this control
+            const TDesC8& type( node->Type()->Type() );
+            
+            if ( type == KMenuBar )
+                {
+                menubar = node;
+                break;
+                }
+            }        
+        }
     
     if( menubar )
         {
@@ -865,6 +890,8 @@
                     {
                     menuIf->SetSoftKeyL( &node->PluginIfL() , XnMenuInterface::MXnMenuInterface::ERight );
                     node->SetDirtyL( XnDirtyLevel::ERender );
+                                       
+                    TRAP_IGNORE( iAppUiAdapter.UiEngine().RefreshMenuL() );                   
                     } 
                 }
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewcontroladapter.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -0,0 +1,232 @@
+/*
+* Copyright (c) 2002-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:  Implementation for wrapper for a box
+*
+*/
+
+// System includes
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntransitionutils.h>
+
+// User includes
+#include "xnappuiadapter.h"
+#include "xnuiengine.h"
+#include "xnnode.h"
+#include "xndomnode.h"
+#include "xnnodepluginif.h"
+#include "xnproperty.h"
+#include "xnviewadapter.h"
+#include "xnbackgroundmanager.h"
+#include "xnviewdata.h"
+#include "xnviewmanager.h"
+#include "xnviewcontroladapter.h"
+
+// Constants
+    
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::NewL
+// Symbian static 1st phase constructor
+// -----------------------------------------------------------------------------
+//
+CXnViewControlAdapter* CXnViewControlAdapter::NewL( CXnNodePluginIf& aNode )
+    {
+	CXnViewControlAdapter* self = new( ELeave ) CXnViewControlAdapter( aNode );
+
+    CleanupStack::PushL( self );
+    self->ConstructL( aNode );
+    CleanupStack::Pop( self );
+
+    return self;	
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::ConstructL( CXnNodePluginIf& aNode )
+    {
+    CXnControlAdapter::ConstructL( aNode );
+            
+    CreateWindowL();
+
+    if( Window().SetTransparencyAlphaChannel() == KErrNone )      
+        {       
+        Window().SetBackgroundColor( ~0 );       
+        }   
+   
+    Window().SetPointerGrab( EFalse );
+    
+    EnableDragEvents();
+           
+    ActivateL();
+  
+    SetComponentsToInheritVisibility( ETrue );
+        
+    iAppUi.UiStateListener().AddObserver( *this );
+    }
+    
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::CXnViewControlAdapter
+// C++ default constructor
+// -----------------------------------------------------------------------------
+//
+CXnViewControlAdapter::CXnViewControlAdapter( CXnNodePluginIf& aNode ) 
+    : iNode( aNode ), iAppUi( static_cast< CXnAppUiAdapter& >( *iAvkonAppUi ) ),
+    iHitpoint( TPoint( -1,-1 ) )
+    {    
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::~CXnViewControlAdapter
+// C++ destructor
+// -----------------------------------------------------------------------------
+//
+CXnViewControlAdapter::~CXnViewControlAdapter()
+    {
+    iAppUi.UiStateListener().RemoveObserver( *this );      
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::MakeVisible
+//
+// -----------------------------------------------------------------------------
+// 
+void CXnViewControlAdapter::MakeVisible( TBool aVisible )
+    {
+    if ( aVisible == IsVisible() )
+        {
+        return;
+        }
+    
+    if ( aVisible )
+        {
+        if ( !iAppUi.UiEngine().IsEditMode() )
+            {
+            Window().SetPointerGrab( ETrue );
+            }
+        }
+    else
+        {
+        Window().SetPointerGrab( EFalse );
+        
+        ResetGrabbing();
+        }
+        
+    CCoeControl::MakeVisible( aVisible );    
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::Draw
+//
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::Draw( const TRect& aRect ) const
+    {    
+    SystemGc().Clear( aRect );        
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::HandlePointerEventL
+//
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::HandlePointerEventL( 
+    const TPointerEvent& aPointerEvent )
+    {
+    if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
+        {
+        iHitpoint = aPointerEvent.iPosition;
+        }
+    
+    iAppUi.UiEngine().DisableRenderUiLC();
+            
+    CXnControlAdapter::HandlePointerEventL( aPointerEvent );
+    
+    iAppUi.UiEngine().RenderUIL();
+    
+    CleanupStack::PopAndDestroy();    
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::ResetGrabbing()
+// 
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::ResetGrabbing()
+    {
+    TPointerEvent event;
+    event.iType = TPointerEvent::EButton1Up;
+    
+    TRAP_IGNORE( RemoveGrabbingControL( this, event ) );
+    
+    iHitpoint.SetXY( -1, -1 );
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::RemoveGrabbingControL()
+// Removes recursively grabbing controls
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::RemoveGrabbingControL( const CCoeControl* aControl,
+    const TPointerEvent& aEvent ) const
+    {
+    TInt count( aControl->CountComponentControls() );
+    
+    for( TInt i = 0; i < count; i++ )
+        {
+        CCoeControl* child( aControl->ComponentControl( i ) );
+        
+        if( child && child->Rect().Contains( iHitpoint ) )
+            {
+            child->CCoeControl::HandlePointerEventL( aEvent ); 
+            RemoveGrabbingControL( child, aEvent );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::NotifyForegroundChanged()
+// 
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::NotifyForegroundChanged( TForegroundStatus aStatus )
+    {
+    if ( aStatus == EBackground || aStatus == EPartialForeground )
+        {
+        ResetGrabbing();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::NotifyLightStatusChanged()
+//  
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::NotifyLightStatusChanged( TBool /*aLightsOn*/ )
+    {    
+    }
+
+// -----------------------------------------------------------------------------
+// CXnViewControlAdapter::NotifyInCallStateChaged()
+// 
+// -----------------------------------------------------------------------------
+//
+void CXnViewControlAdapter::NotifyInCallStateChaged( TBool /*aInCall*/ )
+    {    
+    }
+
+// End of file
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewdata.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -34,6 +34,7 @@
 #include "debug.h"
 
 // Constants
+const TInt KLoadDelay( 100000 );
 const TInt KInterval( 10000 );
 
 // ============================ LOCAL FUNCTIONS ================================
@@ -111,12 +112,11 @@
         }
        
     if ( aActive )
-        {     
+        {
+        iFlags.Set( EIsActive );
         iFlags.Clear( EIsInitial );
-
-        iFlags.Set( EIsActive );
-
-        LoadPublishers();       
+        
+        LoadPublishers();                             
         }
     else
         {                              
@@ -217,12 +217,17 @@
 //
 CXnPluginData* CXnViewData::Plugin( CXnNode* aNode )
     {
-    if ( !aNode ) { return NULL; }
+    if ( !aNode ) 
+        { 
+        return NULL; 
+        }
 
+    CXnDomNode* view( Node() );
+    
     if ( aNode->ViewNodeImpl() )
         {
         // Reached view, return self
-        if ( Node()->LayoutNode() == aNode )
+        if ( view && view->LayoutNode() == aNode )
             {
             return this;
             }
@@ -230,7 +235,9 @@
 
     for ( TInt i = 0; i < iPluginsData.Count(); i++ )
         {
-        if ( iPluginsData[i]->Owner()->LayoutNode() == aNode )
+        CXnDomNode* plugin( iPluginsData[i]->Owner() );
+        
+        if ( plugin && plugin->LayoutNode() == aNode )
             {
             return iPluginsData[i];
             }
@@ -466,7 +473,7 @@
     
     iLoadIndex = 0;
                                 
-    iLoader->Start( TTimeIntervalMicroSeconds32( KInterval ),
+    iLoader->Start( TTimeIntervalMicroSeconds32( KLoadDelay ),
                     TTimeIntervalMicroSeconds32( KInterval ),
                     TCallBack( DoLoadPublishersL, this ) );           
     }
@@ -505,7 +512,14 @@
         TInt reason( plugin->VirginPublishers() ? 
             EAiFwSystemStartup : EAiFwPageStartup );         
         
-        if( plugin->LoadPublishers( reason ) != KErrNone )
+        TInt ret( plugin->LoadPublishers( reason ) );
+        
+        if ( ret == KErrAlreadyExists )
+            {
+            ret = KErrNone;
+            }
+        
+        if( ret != KErrNone )
             {
             self->iManager.UnloadWidgetFromPluginL( *plugin, ETrue );
             
--- a/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -25,6 +25,8 @@
 #include <aknnotewrappers.h>
 #include <AknsConstants.h>
 #include <aifwdefs.h>
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntransitionutils.h>
 
 // User includes
 #include "xnapplication.h"
@@ -58,10 +60,10 @@
 _LIT8( KEmptyWidgetUid, "0x2001f47f" );
 _LIT8( KTemplateViewUID, "0x20026f50" );
 
-const TInt KPSCategoryUid = 0x200286E3;
-const TInt KPSCrashCountKey = 1;     
-const TInt KStabilityInterval = 60000000; // 1 minute
-const TInt KCrashRestoreThreshold = 3;
+const TInt KPSCategoryUid( 0x200286E3 );
+const TInt KPSCrashCountKey( 1 );     
+const TInt KStabilityInterval( 60000000 ); // 1 minute
+const TInt KCrashRestoreThreshold( 3 );
 
 // ============================ LOCAL FUNCTIONS ===============================
 // -----------------------------------------------------------------------------
@@ -277,12 +279,7 @@
     {
     delete iUiStartupPhase;
     
-    if( iStabilityTimer )
-        {
-        iStabilityTimer->Cancel();
-        delete iStabilityTimer;
-        iStabilityTimer = NULL;
-        }
+    delete iStabilityTimer;
     
     iObservers.Reset();
     
@@ -314,14 +311,25 @@
     {
     if ( aKey == KPSStartupUiPhase && aValue == EStartupUiPhaseAllDone )
         {
-        if ( iRootData )
-            {
-            iRootData->LoadRemainingViews();
-            }
+	    iUiStartupPhaseAllDone = ETrue;
+				
+        iAppUiAdapter.ViewAdapter().ActivateContainerL( ActiveViewData() );    
         }
+    
+    iUiStartupPhaseAllDone = ETrue;
     }
 
 // -----------------------------------------------------------------------------
+// CXnViewManager::UiStartupPhaseAllDone()
+// 
+// -----------------------------------------------------------------------------
+//
+TBool CXnViewManager::UiStartupPhaseAllDone() const
+    {
+    return iUiStartupPhaseAllDone;        
+    }
+    
+// -----------------------------------------------------------------------------
 // CXnViewManager::ConstructL()
 // 2nd phase constructor
 // -----------------------------------------------------------------------------
@@ -350,7 +358,7 @@
     RProperty::Get( TUid::Uid( KPSCategoryUid ),
                     KPSCrashCountKey,
                     crashCount );    
-    
+            
     if( crashCount >= KCrashRestoreThreshold )
         {
         iHspsWrapper->RestoreRootL();
@@ -366,7 +374,7 @@
         iStabilityTimer->Start( KStabilityInterval,
                                 KStabilityInterval,
                                 TCallBack( SystemStabileTimerCallback, this ) );
-        }
+        }       
     }
 
 // -----------------------------------------------------------------------------
@@ -389,6 +397,8 @@
     // Determine UI startup phase
     delete iUiStartupPhase;
     iUiStartupPhase = NULL;
+    
+    iUiStartupPhaseAllDone = EFalse;
                    
     iUiStartupPhase = CXnPropertySubscriber::NewL( 
         KPSUidStartup, KPSStartupUiPhase, *this );
@@ -896,14 +906,14 @@
     {
     return iRootData->NextViewData();
     }
-
+    
 // -----------------------------------------------------------------------------
 // CXnViewManager::ActivateNextViewL()
 // Activates the next view
 // -----------------------------------------------------------------------------
 //
-void CXnViewManager::ActivateNextViewL( TInt aEffectId )
-    {    
+void CXnViewManager::ActivateNextViewL( TInt /*aEffectId*/ )
+    { 
     CXnViewData& next( NextViewData() );
     
     if ( !next.Occupied() )
@@ -911,18 +921,47 @@
         if ( next.Load() == KErrNoMemory )
             {
             next.ShowOutOfMemError();
+            
+            return;
             }
         }
         
     // Activate view
     if ( next.Occupied() && !next.Active() )
         {       
-        if( aEffectId )
-            {
-            iUiEngine->AppUiAdapter().EffectManager()->BeginFullscreenEffectL(
-                    aEffectId, iUiEngine->ViewManager()->ActiveViewData() );        
-            }
-        iAppUiAdapter.ViewAdapter().ActivateContainerL( next );                
+        CXnControlAdapter* thisView( 
+            ActiveViewData().ViewNode()->Control() );                
+        
+        CXnControlAdapter* nextView( 
+            next.ViewNode()->Control() );
+    
+        GfxTransEffect::Register( thisView, KGfxContextActivateNextView );    
+        GfxTransEffect::Register( nextView, KGfxContextActivateNextView );
+        
+        TInt ret( GfxTransEffect::BeginGroup() );
+        
+        CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() );
+        
+        GfxTransEffect::Begin( bg, KGfxControlActionAppear );
+
+        GfxTransEffect::SetDemarcation( bg, bg->Position() );
+        GfxTransEffect::End( bg );        
+        
+        GfxTransEffect::Begin( thisView, KGfxControlActionDisappear );
+        
+        iAppUiAdapter.ViewAdapter().ActivateContainerL( next );
+        
+        GfxTransEffect::SetDemarcation( thisView, thisView->Position() );
+        GfxTransEffect::End( thisView );
+                
+        GfxTransEffect::Begin( nextView, KGfxControlActionAppear );
+        GfxTransEffect::SetDemarcation( nextView, nextView->Position() );
+        GfxTransEffect::End( nextView );
+                                
+        GfxTransEffect::EndGroup( ret );
+        
+        GfxTransEffect::Deregister( thisView );
+        GfxTransEffect::Deregister( nextView );
         }
     }
 
@@ -931,7 +970,7 @@
 // Activates the previous view
 // -----------------------------------------------------------------------------
 //
-void CXnViewManager::ActivatePreviousViewL( TInt aEffectId )
+void CXnViewManager::ActivatePreviousViewL( TInt /*aEffectId*/ )
     {    
     CXnViewData& prev( PreviousViewData() );
 
@@ -940,18 +979,48 @@
         if ( prev.Load() == KErrNoMemory )
             {
             prev.ShowOutOfMemError();
+            
+            return;
             }
         }
         
     // Activate view
     if ( prev.Occupied() && !prev.Active() )
         {
-        if( aEffectId  )
-            {
-            iUiEngine->AppUiAdapter().EffectManager()->BeginFullscreenEffectL(
-                    aEffectId, iUiEngine->ViewManager()->ActiveViewData() );        
-            }
+        CXnControlAdapter* thisView( 
+            ActiveViewData().ViewNode()->Control() ); 
+        
+        CXnControlAdapter* prevView( 
+            prev.ViewNode()->Control() );
+
+        GfxTransEffect::Register( thisView, KGfxContextActivatePrevView );    
+        GfxTransEffect::Register( prevView, KGfxContextActivatePrevView );
+    
+        TInt ret( GfxTransEffect::BeginGroup() );
+            
+        CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() );
+        
+        GfxTransEffect::Begin( bg, KGfxControlActionAppear );
+    
+        GfxTransEffect::SetDemarcation( bg, bg->Position() );
+        GfxTransEffect::End( bg );        
+        
+        GfxTransEffect::Begin( thisView, KGfxControlActionDisappear );
+        
         iAppUiAdapter.ViewAdapter().ActivateContainerL( prev );
+        
+        GfxTransEffect::SetDemarcation( thisView, thisView->Position() );
+        GfxTransEffect::End( thisView );
+                
+        GfxTransEffect::Begin( prevView, KGfxControlActionAppear );
+                              
+        GfxTransEffect::SetDemarcation( prevView, prevView->Position() );
+        GfxTransEffect::End( prevView );
+                                
+        GfxTransEffect::EndGroup( ret );
+        
+        GfxTransEffect::Deregister( thisView );
+        GfxTransEffect::Deregister( prevView );        
         }
     }
 
@@ -1088,8 +1157,8 @@
             // Start transition effect
             if( aEffectId )
                 {
-                iUiEngine->AppUiAdapter().EffectManager()->BeginFullscreenEffectL(
-                        aEffectId, iUiEngine->ViewManager()->ActiveViewData() );        
+                iAppUiAdapter.EffectManager()->BeginFullscreenEffectL(
+                        aEffectId, ActiveViewData() );        
                 }
 
             // Load succeed, add the new view behind the current view               
@@ -1212,8 +1281,8 @@
         // Start transition effect
         if( aEffectId )
             {
-            iUiEngine->AppUiAdapter().EffectManager()->BeginFullscreenEffectL(
-                    aEffectId, iUiEngine->ViewManager()->ActiveViewData() );        
+            iAppUiAdapter.EffectManager()->BeginFullscreenEffectL(
+                    aEffectId, ActiveViewData() );        
             }
 
         // Activate the next view, or first if in the last view 
@@ -1373,10 +1442,6 @@
 // -----------------------------------------------------------------------------
 void CXnViewManager::NotifyContainerChangedL( CXnViewData& aViewToActivate )
     {
-#ifdef _XN_PERFORMANCE_TEST_
-    RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - start" ) );
-#endif //_XN_PERFORMANCE_TEST_        
-                     
     CXnViewData& viewToDeactivate( ActiveViewData() );
     
     if ( &aViewToActivate != &viewToDeactivate )
@@ -1385,12 +1450,11 @@
                       
         viewToDeactivate.SetActive( EFalse );
         aViewToActivate.SetActive( ETrue );
-        
-        iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() );
-
+                             
+        iHspsWrapper->SetActivePluginL( aViewToActivate.PluginId() ); 
+                    
         // Cache update is needed after view activation
-        UpdateCachesL();       
-        UpdateWallpaperL( viewToDeactivate, aViewToActivate );
+        UpdateCachesL();               
         }
     else
         {
@@ -1399,14 +1463,13 @@
 
         // Cache update is needed after view activation
         UpdateCachesL();
+        
+        // Schedule remaining views loading
+        iRootData->LoadRemainingViews();
         }
     
     NotifyViewActivatedL( aViewToActivate );
     UpdatePageManagementInformationL();
-    
-    #ifdef _XN_PERFORMANCE_TEST_
-    RDebug::Print( _L( "CXnViewManager::NotifyContainerChangedL - end" ) );
-#endif //_XN_PERFORMANCE_TEST_
     }
 
 // -----------------------------------------------------------------------------
@@ -1594,15 +1657,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CXnViewManager::UpdateWallpaperL
-// -----------------------------------------------------------------------------
-//
-void CXnViewManager::UpdateWallpaperL( CXnViewData& aCurrent, CXnViewData& aNew )
-    {
-    iAppUiAdapter.ViewAdapter().BgManager().WallpaperChanged( aCurrent, aNew );
-    }
-
-// -----------------------------------------------------------------------------
 // CXnViewManager::ShowOperationFailedMessageL
 // -----------------------------------------------------------------------------
 //
--- a/idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpapercontainer.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -57,9 +57,14 @@
 void CXnWallpaperContainer::ConstructL()
     {
     CreateWindowL();
-    TRect rect = iAvkonAppUi->ClientRect();
+    
     iBgContext = CAknsBasicBackgroundControlContext::NewL(
-            KAknsIIDQsnBgScreen, rect, EFalse );
+            KAknsIIDQsnBgScreen, TRect(), ETrue );
+
+    TRect rect;
+    
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect ); 
+    
     SetRect( rect );
     }
 
@@ -97,8 +102,11 @@
     {
     if ( iBgContext )
         {
-        iBgContext->SetRect(Rect());
-        TRect rect = Rect();
+        TRect rect;
+        
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, rect ); 
+                                    
+        iBgContext->SetRect( rect );        
         }
     }
  
@@ -107,13 +115,16 @@
 // -----------------------------------------------------------------------------
 //
 void CXnWallpaperContainer::HandleResourceChange(TInt aType)
-    {
-    TRect rect;
+    {    
     if ( aType == KEikDynamicLayoutVariantSwitch )
         {
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
-        SetRect(rect);
+        TRect rect;
+        
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
+        
+        SetRect( rect );
         }
+    
     CCoeControl::HandleResourceChange(aType);
     }
 
--- a/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -15,17 +15,7 @@
 *
 */
 
-
-// INCLUDE FILES
-#include "xnwallpaperview.h"
-#include "xnwallpapercontainer.h"
-#include "xnuiengine.h"
-#include "xnappuiadapter.h"
-#include "xnviewadapter.h"
-#include "xnbackgroundmanager.h"
-#include <xnuiengine.rsg>
-
-// SYSTEM INCLUDE FILES
+// System includes
 #include <aknappui.h>
 #include <eikbtgpc.h>
 #include <avkon.rsg>
@@ -34,9 +24,27 @@
 #include <aknnotewrappers.h>
 #include <StringLoader.h> 
 #include <caf/caf.h>
+#include <bautils.h>
+#include <data_caging_path_literals.hrh>
+
+// User includes
+#include <xnwallpaperview.rsg>
+#include "xnwallpaperview.h"
+#include "xnwallpapercontainer.h"
+#include "xnuiengine.h"
+#include "xnappuiadapter.h"
+#include "xnviewadapter.h"
+#include "xnbackgroundmanager.h"
+#include "xneffectmanager.h"
+#include "xnviewmanager.h"
+
+// Constants
+_LIT( KResourceDrive, "z:" );
+_LIT( KResourceFile, "xnwallpaperview.rsc" );
 
 _LIT8( KMulti, "multi" );
-const TInt KFileArrayGranularity = 6;
+
+const TInt KFileArrayGranularity( 6 );
 
 // ============================ MEMBER FUNCTIONS ===============================
 
@@ -44,8 +52,8 @@
 // C++ default constructor.
 // -----------------------------------------------------------------------------
 //
-CXnWallpaperView::CXnWallpaperView( CXnUiEngine& aEngine ) :
-    iEngine( aEngine )
+CXnWallpaperView::CXnWallpaperView( CXnUiEngine& aEngine ) 
+    : iEngine( aEngine ), iAppUi( iEngine.AppUiAdapter() )    
     {
     }
 
@@ -55,7 +63,19 @@
 //
 void CXnWallpaperView::ConstructL()
     {
-    BaseConstructL();
+    TFileName resFile;
+    resFile.Append( KResourceDrive );
+    resFile.Append( KDC_APP_RESOURCE_DIR );
+    resFile.Append( KResourceFile );
+    
+    CCoeEnv* env( CCoeEnv::Static() );
+
+    BaflUtils::NearestLanguageFile( env->FsSession(), resFile );
+
+    iResourceOffset = env->AddResourceFileL( resFile );
+    
+    BaseConstructL( R_WALLPAPER_VIEW );
+           
     iTimer = CPeriodic::NewL( CActive::EPriorityIdle );
     }
 
@@ -77,12 +97,10 @@
 // -----------------------------------------------------------------------------
 //
 CXnWallpaperView::~CXnWallpaperView()
-    {
-    if ( iContainer )
-        {
-        delete iContainer;
-        iContainer = NULL;
-        }
+    {    
+    CCoeEnv::Static()->DeleteResourceFile( iResourceOffset );    
+    
+    delete iContainer;    
     delete iTimer;
     }
 
@@ -99,18 +117,37 @@
 // CXnWallpaperView::DoActivateL
 // -----------------------------------------------------------------------------
 //
-void CXnWallpaperView::DoActivateL(
-            const TVwsViewId& aPrevViewId,
-            TUid /*aCustomMessageId*/,
-            const TDesC8& aCustomMessage )
+void CXnWallpaperView::DoActivateL( const TVwsViewId& aPrevViewId,           
+    TUid /*aCustomMessageId*/, const TDesC8& aCustomMessage )            
     {
-    iAvkonAppUi->StatusPane()->SwitchLayoutL(
-            R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
-    iAvkonAppUi->StatusPane()->DrawNow();
+    // switch layout 
+    CEikStatusPane* sp( iAppUi.StatusPane() );
+    
+    sp->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT );
+    sp->ApplyCurrentSettingsL();
+            
+    // disable transparancy
+    if ( sp->IsTransparent() )
+        {
+        sp->EnableTransparent( EFalse );
+        }
+    
+    sp->DrawNow();
+    
+    // update cba
+    CEikButtonGroupContainer* bgc( Cba() );
+    CEikCba* cba = static_cast< CEikCba* >( bgc->ButtonGroup() );
+
+    if ( cba ) 
+        {       
+        bgc->SetBoundingRect( TRect() );
+        cba->DrawNow();
+        }
+    
     if ( !iContainer )
         {
         iContainer = CXnWallpaperContainer::NewL();
-        iAvkonAppUi->AddToStackL( *this,  iContainer );
+        iAppUi.AddToStackL( *this, iContainer );
         iContainer->ActivateL();
         iContainer->DrawNow();
         }
@@ -118,19 +155,17 @@
     iData.iAppUid = aPrevViewId.iAppUid;
     iData.iViewUid = aPrevViewId.iViewUid; 
     iData.iMultiple = EFalse;
-    iData.iTimer = iTimer;
-    
-    if( aCustomMessage == KMulti )
+        
+    if ( aCustomMessage == KMulti )
         {
         iData.iMultiple = ETrue;
         }
 
     // Run image selection dialog asynchronously
-    if ( iTimer->IsActive() )
-        {
-        iTimer->Cancel();
-        }
-    iTimer->Start( 0, 1000, TCallBack( TimerCallbackL, &iData ) );
+    iTimer->Cancel();
+    iTimer->Start( 0, 1000, TCallBack( TimerCallbackL, this ) );
+    
+    iAppUi.EffectManager()->UiRendered();
     }
 
 // -----------------------------------------------------------------------------
@@ -141,44 +176,48 @@
     {
     if ( iContainer )
         {
-        iAvkonAppUi->RemoveFromStack( iContainer );
+        iAppUi.RemoveFromStack( iContainer );
         delete iContainer;
         iContainer = NULL;
         }
+    
+    iAppUi.EffectManager()->UiRendered();
     }
 
 // -----------------------------------------------------------------------------
 // CXnWallpaperView::TimerCallback
 // -----------------------------------------------------------------------------
 //
-TInt CXnWallpaperView::TimerCallbackL(TAny *aPtr)
-    {
-    TInt errAddWallpaper = KErrNone;
-    
-    TXnWallpaperViewData* data = reinterpret_cast<TXnWallpaperViewData*>( aPtr );
-    data->iTimer->Cancel();
+TInt CXnWallpaperView::TimerCallbackL( TAny *aPtr )
+    {       
+    CXnWallpaperView* self = reinterpret_cast< CXnWallpaperView* >( aPtr );
+    self->iTimer->Cancel();
     
     CDesCArrayFlat* files = 
-        new (ELeave) CDesCArrayFlat( KFileArrayGranularity );
+        new (ELeave) CDesCArrayFlat( KFileArrayGranularity );    
     CleanupStack::PushL( files );
-    TBool selected = EFalse;
 
-    TRAPD( err, selected = MGFetch::RunL( *files, EImageFile, data->iMultiple ) );
-    if ( err == KErrNone &&
-         selected &&
-         files->MdcaCount() > 0 )
+    TInt err( KErrNone );
+    TBool selected( EFalse );
+        
+    TXnWallpaperViewData& data( self->iData );
+    
+    CXnBackgroundManager& bg( self->iAppUi.ViewAdapter().BgManager() );
+    
+    TRAPD( fetch, selected = MGFetch::RunL( *files, EImageFile, data.iMultiple ) );
+    
+    if ( fetch == KErrNone && selected && files->MdcaCount() > 0 )                 
         {
-        // set wallpaper.
+        // set wallpaper
         if( files->MdcaCount() == 1 )
-            {
-            CXnAppUiAdapter* appui = static_cast< CXnAppUiAdapter* >( iAvkonAppUi );
-            CXnBackgroundManager& bgManager = appui->ViewAdapter().BgManager();
-            errAddWallpaper = bgManager.AddWallpaperL( files->MdcaPoint( 0 ) );
+            {                        
+            err = bg.AddWallpaperL( files->MdcaPoint( 0 ) );
             }
         }
+    
     CleanupStack::PopAndDestroy( files );
 
-    if( errAddWallpaper == KErrCACorruptContent )
+    if ( err == KErrCACorruptContent )
         {
         //load message text
         HBufC* msg = StringLoader::LoadLC( R_QTN_HS_CORRUPTED_IMAGE_NOTE );
@@ -191,10 +230,12 @@
         CleanupStack::PopAndDestroy( msg );
         }
     
-    iAvkonAppUi->ActivateViewL( TVwsViewId( data->iAppUid, data->iViewUid ) );
+    self->iAppUi.EffectManager()->BeginFullscreenEffectL( 
+        KGfxContextCloseWallpaperView, self->iAppUi.ViewManager().ActiveViewData() );
+    
+    self->iAppUi.ActivateViewL( TVwsViewId( data.iAppUid, data.iViewUid ) );
 
-    return EFalse;
+    return KErrNone;
     }
 
-
 //  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnwallpaperview.rss	Mon Mar 15 12:39:47 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* 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:
+* 
+*
+*/
+
+//  System includes
+#include <eikon.rh>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.loc>
+#include <appinfo.rh>
+#include <avkon.mbg>
+#include <activeidle3.loc>
+
+//  RESOURCE IDENTIFIER
+NAME    XNWP // 4 letter ID
+
+RESOURCE RSS_SIGNATURE
+	{
+	}
+
+// ----------------------------------------------------
+// r_wallpaper_view
+//
+// ----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_wallpaper_view
+    {
+    cba = R_AVKON_SOFTKEYS_CANCEL;
+    menubar = 0;
+    toolbar = 0;
+    }
+
+// ----------------------------------------------------
+// r_qtn_hs_corrupted_image_note
+//
+// ----------------------------------------------------
+//
+RESOURCE TBUF r_qtn_hs_corrupted_image_note 
+    {
+    buf = qtn_hs_corrupted_image_note; 
+    }
+
+// End of file
--- a/menufw/menufwui/matrixmenu/src/mmgui.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/matrixmenu/src/mmgui.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -17,7 +17,7 @@
 
 
 // INCLUDE FILES
-#include <mw/memorymanager.h>
+#include <mw/MemoryManager.h>
 #include <eikstart.h>
 #include "mmapplication.h"
 
--- a/menufw/menufwui/mmwidgets/group/mmwidgets.mmp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/group/mmwidgets.mmp	Mon Mar 15 12:39:47 2010 +0200
@@ -22,6 +22,8 @@
 TARGETTYPE      dll
 UID             0x1000008d 0x2001E658
 
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC    -O3 -Otime --cpu 6
 CAPABILITY      CAP_GENERAL_DLL
 VENDORID        VID_DEFAULT
 
--- a/menufw/menufwui/mmwidgets/inc/mmgrid.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/inc/mmgrid.h	Mon Mar 15 12:39:47 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  CMmGrid declaration
-*  Version     : %version: MM_32.1.23 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_32.1.24 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -22,7 +22,7 @@
 
 #include <e32std.h>
 #include <e32base.h>
-#include <AknGrid.h> 
+#include <AknGrid.h>
 
 class CMmGridModel;
 class CMmListBoxItemDrawer;
@@ -32,7 +32,7 @@
 
 /**
  *  Multimedia Menu Grid Widget
- * 
+ *
  *  @code
  *  @endcode
  *  @lib mmwidgets
@@ -42,27 +42,27 @@
 NONSHARABLE_CLASS( CMmGrid ) : public CAknGrid
     {
 public:
-    
+
     /**
      * Two-phased constructor.
-     * 
+     *
      * @param aParent Parent control.
      * @param aFlags Additional Flags.
      * @param aTemplateLibrary Template library for drawer.
      */
     static CMmGrid* NewL( const CCoeControl* aParent, TInt aFlags,
         CMmTemplateLibrary* aTemplateLibrary );
-    
+
     /**
      * Two-phased constructor.
-     * 
+     *
      * @param aParent Parent control.
      * @param aFlags Additional Flags.
      * @param aTemplateLibrary Template library for drawer.
      */
     static CMmGrid* NewLC(const CCoeControl* aParent, TInt aFlags,
         CMmTemplateLibrary* aTemplateLibrary );
-    
+
     /**
      * Destructor.
      */
@@ -75,7 +75,7 @@
      * @param aRect Rect within which grid should be drawn.
      */
     void Draw( const TRect& aRect ) const;
-    
+
     /**
      * Draws the grid view.
      *
@@ -85,19 +85,19 @@
 
     /**
      * Creates the item drawer for grid.
-     * 
+     *
      * @since S60 v3.0
      */
     void CreateItemDrawerL();
-    
+
     /**
      * Creates the item drawer for grid.
-     * 
-     * @param aTemplateLibrary Template library for drawer. 
+     *
+     * @param aTemplateLibrary Template library for drawer.
      * @since S60 v3.0
      */
     void CreateItemDrawerL( CMmTemplateLibrary* aTemplateLibrary );
-    
+
     /**
      * Creates the view class instance for grid.
      *
@@ -105,7 +105,7 @@
      * @return Griv view.
      */
     CListBoxView* MakeViewClassInstanceL();
-    
+
     /**
      * Handles scrolling event.
      *
@@ -113,9 +113,9 @@
      * @param aScrollBar Scrollbar being scrolled.
      * @param aEventType Type of scrollbar event.
      */
-    void HandleScrollEventL( CEikScrollBar* aScrollBar, 
+    void HandleScrollEventL( CEikScrollBar* aScrollBar,
             TEikScrollEvent aEventType );
-    
+
     /**
      * Handles pointer event.
      *
@@ -123,7 +123,7 @@
      * @param aPointerEvent Type of pointer event.
      */
     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
-     
+
     /**
      * Sets item drawer and view background context.
      *
@@ -132,14 +132,14 @@
      */
     void SetItemDrawerAndViewBgContext(
     		CAknsBasicBackgroundControlContext* aBgContext );
-    
+
     /**
      * Handles changes in scrollbar visibility.
      *
      * @since S60 v3.0
      */
     TBool HandleScrollbarVisibilityChangeL();
-    
+
     /**
      * Checks if all items from model fit in given rectangle.
      *
@@ -147,14 +147,14 @@
      * @return Do items fit in view rectangle.
      */
     TBool AllItemsFitInViewRect();
-    
+
     /**
      * Updates scrollbar changes.
      *
      * @since S60 v3.0
      */
     void UpdateScrollBarsL();
-    
+
     /**
      * Sets the marquee adapter.
      *
@@ -162,7 +162,7 @@
      * @param aAdapter Marquee adapter.
      */
     void SetMarqueeAdapter( CMmMarqueeAdapter* aAdapter );
-    
+
     /**
      * Sets up the layout (orientation and items' sizes).
      *
@@ -175,29 +175,29 @@
      *
      * @since S60 v3.0
      * @return Grid model.
-     */       
+     */
     CMmGridModel * MmModel();
-    
+
     /**
      * This function from @c CAknGrid handles key events.
-     *  
+     *
      * It has been overridden to allow for correct handling of
      * left and right rocker keys when mirrored layout is used.
-     * 
+     *
      * @param aKeyEvent event to handle
      * @param aType type of the key event
      * @return response code ( @c EKeyWasConsumed, @c EKeyWasNotConsumed )
      */
     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
-    
+
     /**
-     * This function from CAknGrid is overriden to make grid 
+     * This function from CAknGrid is overriden to make grid
      * behavior correct in the mirrored layout.
      * Please note that it is necessary because of the hackish
      * solution used to draw items in mirrored layout.
      */
     void HandleViewRectSizeChangeL();
-    
+
     /**
      * Overridden function from CAknGrid.
      */
@@ -206,19 +206,19 @@
     /**
      * Set the vertical item offset;
      * @param aOffset The offset to set to the widget.
-     * 
+     *
      * @since S60 v5.0
      */
     void SetVerticalItemOffset( TInt aOffset );
 
     /**
      * Gets the current widget vertical item offset.
-     * 
+     *
      * @since S60 v5.0
      * @return The current widget vertical item offset.
      */
     TInt VerticalItemOffset() const;
-    
+
     /**
      * Simply sets the item height members in widget and view.
      */
@@ -231,33 +231,33 @@
 
     /**
      * Counts the number of component controls which this component owns.
-     */ 
+     */
     TInt CountComponentControls() const;
 
     /**
      * Disables/enables child component (scrollbar) drawing.
      */
     void SetDisableChildComponentDrawing( TBool aDisable );
-    
+
 private:
     /**
      * Default constructor.
-     * 
-     * @since S60 v3.0 
+     *
+     * @since S60 v3.0
      */
     CMmGrid();
-    
+
     /**
      * 2nd phase constructor.
-     * 
-     * @since S60 v3.0 
+     *
+     * @since S60 v3.0
      * @param aParent Parent control.
      * @param aFlags Additional Flags.
      * @param aTemplateLibrary Template library for drawer.
      */
     void ConstructL( const CCoeControl* aParent, TInt aFlags,
         CMmTemplateLibrary* aTemplateLibrary );
-    
+
     /**
      * Handles changes in resource.
      *
@@ -268,7 +268,7 @@
      */
     void DoHandleResourceChangeL( TBool aIsLandscape, TSize& aCellSize,
             TSize& aViewLayout );
-    
+
     /**
      * Handles changes in resource.
      *
@@ -278,55 +278,44 @@
      */
     void DoHandleResourceChangeL( TSize& aCellSize,
             TSize& aViewLayout );
-    
+
     /**
      * Sets up the layout (for use in non-leaving SetupLayout())
-     * 
-     * @since S60 v3.0 
+     *
+     * @since S60 v3.0
      */
     void DoSetupLayoutL();
-    
+
     /**
      * Handles pointer events when edit mode is enabled.
-     * 
+     *
      * This method is only called during edit mode. It selectively passes
      * only some of the pointer events to CAknGrid::HandlePointerEventL
      * in order to disable flicking and panning.
-     * 
+     *
      * @param aPointerEvent pointer event
      */
     void HandlePointerEventInEditModeL( const TPointerEvent& aPointerEvent );
-    
+
     /**
      * Handles pointer events when edit mode is disabled.
-     * 
+     *
      * @param aPointerEvent pointer event
      */
     void HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent );
-    
-    /**
-     * Handles button repeat event in normal mode.
-     * 
-     * Such event is requested when handling button1down event so that
-     * certain actions (i.e. setting highlight visibility) can be made
-     * with a small delay - this improves menu behavior on flicking.
-     * 
-     * @param aPointerEvent pointer event 
-     */
-    void HandleButtonRepeatEventInNormalModeL( const TPointerEvent& aPointerEvent );
-    
+
     /**
      * Scrolls the view if pointer is close to the top/bottom edge.
-     * 
+     *
      * This method is used only when edit mode is active. In a way it
      * brings back the focus based scrolling behavior that was present
      * in CAknGrid before ODE scrolling was introduced.
      */
     void HandleScrollingInEditMode( const TPointerEvent& aPointerEvent );
-    
+
     /**
      * Checks if pointer position is within the scroll-triggering area.
-     * 
+     *
      * @param aPointerEvent pointer event
      * @return true if pointer above the top scrolling threshold.
      */
@@ -335,37 +324,37 @@
 
     /**
      * Checks if pointer position is within the scroll-triggering area.
-     * 
+     *
      * @param aPointerEvent pointer event
      * @return true if pointer below the bottom scrolling threshold.
      */
     TBool IsPointerInBottomScrollingThreshold(
             const TPointerEvent& aPointerEvent ) const;
-    
+
     /**
      * Scrolls the view if the pointer is near top/bottom edge of the screen.
-     * 
+     *
      * Assumes that current item index is the index of the item under the
      * pointer. The time value returned is based on the distance of the pointer
      * from the top/bottom edge of the grid view (this makes the scrolling speed
      * dependent of how close the pointer is to the edge).
      * If there is no need to continue scrolling because the beginning/end of
      * the list has already been reached, 0 is returned.
-     * 
+     *
      * @param aPointerEvent pointer event
      * @return time to wait before calling this method again (in microseconds)
      *         or 0 if already at the beginning/end of the list
      */
     TInt ScrollIfNeeded( const TPointerEvent& aPointerEvent );
-    
+
     /**
-     * Minimal scrolling (setting top item index and vertical offset) with 
+     * Minimal scrolling (setting top item index and vertical offset) with
      * boundary checking and WITHOUT redrawing.
-     * 
+     *
      * @param aDistanceInPixels Distance to scroll.
      */
     void ScrollWithoutRedraw( TInt aDistanceInPixels );
-    
+
     /**
      * Updates the dispapearing highlight.
      *
@@ -382,46 +371,46 @@
      * be drawn correctly in mirrored layout.
      */
     void FixViewForMirroredLayout();
-    
+
     /**
      * Gets the offset margin of scrollbar related to view rectangle.
-     * 
+     *
      * @return The distance from view rect side to scrollbar.
      */
     TInt ScrollBarOffset();
-    
+
     /**
      * Redraws the background under the vertical scrollbar in mirrored layout.
-     * 
+     *
      * The reason such method is needed is that view rectangle is shifted
      * to the right in mirrored layout and does not cover the scrollbar
      * area. In normal (non-mirrored) mode this method does nothing.
      */
     void RedrawScrollbarBackground() const;
-    
+
     /**
      * Does actual handling of scroll events.
-     * 
+     *
      * @param aScrollBar Scrollbar being scrolled.
      * @param aEventType Type of scrollbar event.
      */
-    void ProcessScrollEventL( CEikScrollBar* aScrollBar, 
+    void ProcessScrollEventL( CEikScrollBar* aScrollBar,
             TEikScrollEvent aEventType );
-    
+
     /**
      * Handles periodic events from @c iRedrawTimer.
      * Such events are generated at equal time intervals while
      * the view is being scrolled using the scrollbar.
      * This function typically calls @c ProcessScrollEventL,
-     * which actually scrolls the view and causes a redraw. 
+     * which actually scrolls the view and causes a redraw.
      */
     void HandleRedrawTimerEventL();
-    
+
 private:
     /**
      * Callback function for @c iRedrawTimer.
      * It simply calls @c HandleRedrawTimerEventL and returns 0.
-     * 
+     *
      * @param aPtr A pointer to CMmGrid object.
      * @return 0 (always).
      */
@@ -430,53 +419,53 @@
 private:
     /**
      * Grid model.
-     */            
+     */
     CMmGridModel* iMmModel;
-    
+
     /**
      * Item drawer.
-     */                
+     */
     CMmListBoxItemDrawer* iMmDrawer;
 
     /**
      * Marquee adapter.
-     */                
+     */
     CMmMarqueeAdapter* iMarqueeAdapter;
-    
+
     /**
      * Scrollbar visibility flag.
-     */                
+     */
     TBool iScrollbarVisibilityChanged;
 
     /**
      * Item index which is current in grid.
-     */            
+     */
     TInt iCurrentItemIndex;
-    
+
     /**
      * Currently top view item index.
-     */            
+     */
     TInt iCurrentTopItemIndex;
-    
+
     /**
      * Layout of grid.
-     */            
+     */
     TSize iViewLayout;
-    
+
     /**
      * A flag that indicates that highlight is visible because
      * the user is pressing the screen (continuously) and that
      * highlight should remain visible only as long as the screen
-     * is being pressed.    
+     * is being pressed.
      */
     TBool iHighlightVisibleUntilButton1Up;
-	
+
     /**
      * Blocks scrollbar drawing. When this flag is set scrollbars components
-     * are blocked in the CountComponentControls() method;   
+     * are blocked in the CountComponentControls() method;
      */
     TBool iDisableChildComponentDrawing;
-    
+
     /**
      * This member is only used in edit mode to store the position of the pointer
      * during EButton1Down event.
@@ -487,7 +476,7 @@
      * ETrue if the view is being scrolled with the scrollbar.
      */
     TBool iScrollbarThumbIsBeingDragged;
-    
+
     /**
      * Stores the number of scrollbar events that were ignored.
      * It is only used while scrolling the view using scrollbar,
@@ -496,7 +485,7 @@
      * iRedrawTimer completes.
      */
     TInt iSkippedScrollbarEventsCount;
-    
+
     /**
      * A timer that initiates redraws at certain time intervals.
      * It is used to refresh the view while scrolling with
--- a/menufw/menufwui/mmwidgets/inc/mmgridview.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/inc/mmgridview.h	Mon Mar 15 12:39:47 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  CMmGridView declaration
-*  Version     : %version: MM_24.1.9 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_24.1.10 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -22,7 +22,7 @@
 
 #include <e32std.h>
 #include <e32base.h>
-#include <AknGridView.h> 
+#include <AknGridView.h>
 
 /**
  *  Multimedia Menu Grid View.
@@ -38,25 +38,25 @@
 public:
     /**
      * Two-phased constructor.
-     * 
+     *
      * @since S60 v3.0
      */
     static CMmGridView* NewL();
-    
+
     /**
      * Two-phased constructor.
-     * 
+     *
      * @since S60 v3.0
      */
     static CMmGridView* NewLC();
 
     /**
      * Destructor.
-     * 
+     *
      * @since S60 v3.0
      */
     virtual ~CMmGridView();
-    
+
     /**
      * Draws the grid within the given clipping rectangle.
      *
@@ -64,44 +64,44 @@
      * @param aClipRect Clipping rectangle.
      */
 	void Draw( const TRect* aClipRect ) const;
-	
+
 	/**
      * Gets item position.
-     * 
+     *
      * This fuction from @c CAknGridView is overridden so that it
      * returns 'mirrored' item positions when mirrored layout is
-     * used. 
-     * 
+     * used.
+     *
      * @since S60 v3.0
      * @param aItemIndex Item index.
      * @return Item position.
      */
     TPoint ItemPos( TInt aItemIndex ) const;
-    
+
     /**
      * Converts an (x, y) pixel position to an item index.
-     * 
+     *
      * This fuction from @c CAknGridView has been overridden in order
      * to make it work properly when mirrored layout is used.
-     * 
+     *
      * @param aPosition Pixel position in the viewing rectangle.
      * @param aItemIndex Reference to the item index.
      * @return Whether there was an item at aPosition.
-     */  
+     */
     TBool XYPosToItemIndex(TPoint aPosition, TInt& aItemIndex) const;
-	
+
 	/**
 	 * Returns this view's gc.
-	 * 
+	 *
 	 * @return pointer to gc
 	 */
 	CWindowGc* Gc();
-	
+
     /**
      * @see CAknGridView::UpdateSelectionL
-     * 
+     *
      * This method of CAknGridView is overriden to so that
-     * correct effects are displayed when moving highlight with 
+     * correct effects are displayed when moving highlight with
      * rocker key in mirrored layout.
      * Please note that it is necessary because of the hackish
      * solution used to draw items in mirrored layout.
@@ -110,9 +110,9 @@
 
 	/**
 	 * @see CAknGridView::MoveCursorL
-	 * 
+	 *
 	 * This method of CAknGridView is overriden to so that
-	 * correct effects are displayed when moving highlight with 
+	 * correct effects are displayed when moving highlight with
 	 * rocker key in mirrored layout.
      * Please note that it is necessary because of the hackish
      * solution used to draw items in mirrored layout.
@@ -122,18 +122,18 @@
 
     /**
      * Gets the current widget vertical item offset.
-     * 
+     *
      * @since S60 v5.0
      * @return The current widget vertical item offset.
      */
     TInt VerticalItemOffset() const;
-    
+
 	/**
 	* This function sets item height in pixels.
 	* @param aItemHeight New height in pixels for this view’s items.
-	*/	
+	*/
     void SetItemHeight(TInt aItemHeight);
-    
+
     /**
      * Updates various member variables in this grid view and related objects
      * with item dimensions taken from the template library.
@@ -141,21 +141,21 @@
     void UpdateItemHeightAndWidth();
 
 private:
-	
+
     /**
      * Default constructor.
-     * 
-     * @since S60 v3.0 
+     *
+     * @since S60 v3.0
      */
     CMmGridView();
 
     /**
      * 2nd phase constructor.
-     * 
-     * @since S60 v3.0 
+     *
+     * @since S60 v3.0
      */
     void ConstructL();
-    
+
     /**
      * Draws the grid within the given clipping rectangle.
      *
@@ -163,17 +163,17 @@
      * @param aClipRect Clipping rectangle.
      */
     void DoDraw( const TRect* aClipRect ) const;
-    
+
     /**
      * Gets item position.
-     * 
+     *
      * AVKON implementation of ItemPos method does not always work properly.
      * It fails when:
      *   aItemIndex < TopItemIndex() - NumberOfColsInView()
      * Because of that problem this method was created. It is now used in
      * CMmGridView::ItemPos in place where base class (AVKON) implementation
      * was used previously.
-     * 
+     *
      * @param aItemIndex Item index.
      * @return Item position.
      */
@@ -183,24 +183,24 @@
 
     /**
      * Stores cursor movement flag during CMmGridView::MoveCursorL execution.
-     * 
+     *
      * When CMmGridView::MoveCursorL is not executing this member variable is
      * always set to ECursorFirstItem. This is part of the hack that allows
      * for correct effects to be displayed when using rocker key in mirrored
      * layout.
      */
     TCursorMovement iLastCurMove;
-    
+
     /**
      * Stores previosly highlighted item index during CMmGridView::MoveCursorL
      * execution.
-     * 
+     *
      * When CMmGridView::MoveCursorL is not executing this member variable is
      * always set to KErrNotFound. This is part of the hack that allows
      * for correct effects to be displayed when using rocker key in mirrored
      * layout.
      */
-    TInt iOldIndex;	
+    TInt iOldIndex;
     };
 
 #endif // C_MMGRIDVIEW_H
--- a/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/inc/mmlistboxitemdrawer.h	Mon Mar 15 12:39:47 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  CMmListBoxItemDrawer
-*  Version     : %version: MM_38.1.15 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_38.1.16 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -94,42 +94,42 @@
      * @since S60 v3.0
      */
     ~CMmListBoxItemDrawer();
-    
+
     /**
      * Enables/disables cached data use.
-     * 
+     *
      * When aEnable is true:
      * Enables the use of cached data when drawing items.
      * This significantly improves performance.
      * Do not ever try to use this feature in edit mode.
-     * 
+     *
      * When aEnable is false:
      * Restores the normal mode where data needed for drawing
      * items is retrieved from the model and the cached data
      * is updated with the information retrieved from the model
-     * 
+     *
      * @param aEnable Self-explanatory.
      */
     void EnableCachedDataUse( TBool aEnable );
-    
+
     /**
      * Returns ETrue if item drawer is using cached data.
      * To start/stop using cached data, use the @c EnableCachedDataUse
      * method.
-     * 
+     *
      * @return ETrue if cached data is used, EFalse otherwise.
      */
     TBool CachedDataUseIsEnabled() const;
-    
+
     /**
      * This method should be called whenever items(s) are removed
      * in order to remove corresponding entries in the local
      * items data cache.
-     * 
+     *
      * @param aItemCount current item count
      */
     void TrimCacheSize( TInt aItemCount );
-    
+
     /**
      * Invalidates the cached data for all items.
      */
@@ -154,7 +154,7 @@
      * @return Size of item.
      */
     TSize GetItemSize( TInt aItemIndex, TBool aItemIsCurrent ) const;
-    
+
     /**
      * Gets rect of indicator.
      *
@@ -372,14 +372,14 @@
      * @param aPosition Floating item index to be removed.
      */
     void RemoveFloatingItem( TInt aPosition );
-    
+
     /**
      * Removes all floating items.
      *
      * @since S60 5.0
      */
     void RemoveFloatingItems();
-    
+
     /**
      * Gets floating item at particular index in the
      * floating item array.
@@ -469,6 +469,14 @@
 	 */
 	void SetHighlightShown( TBool aDrawn );
 
+    /**
+     * Draws background and separator lines.
+     *
+     * @since S60 v3.0
+     * @param aItemTextRect Item rectangle.
+     */
+    void DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect ) const;
+
 protected:
     /**
      * From CListItemDrawer. Draws an item.
@@ -499,26 +507,19 @@
     		TBool aItemIsCurrent, TBool aViewIsEmphasized,
     		TBool aItemIsSelected ) const;
     /**
-     * Draws the actual item contents for the specified item in the specified 
+     * Draws the actual item contents for the specified item in the specified
      * rectangle.
      *
-     * @param aItemIndex Index of the item to draw. 
-     * @param aActualItemRect Area to draw into. 
-     * @param aItemIsCurrent @c ETrue if the item is current. 
-     * @param aViewIsEmphasized @c ETrue if the view is emphasised. 
+     * @param aItemIndex Index of the item to draw.
+     * @param aActualItemRect Area to draw into.
+     * @param aItemIsCurrent @c ETrue if the item is current.
+     * @param aViewIsEmphasized @c ETrue if the view is emphasised.
      * @param aViewIsDimmed Ignored
      * @param aItemIsSelected @c ETrue if the item is selected.
      */
     void DrawActualItem(TInt aItemIndex, const TRect& aActualItemRect,
 			TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aViewIsDimmed,
 			TBool aItemIsSelected) const;
-    /**
-     * Draws background and separator lines.
-     *
-     * @since S60 v3.0
-     * @param aItemTextRect Item rectangle.
-     */
-    void DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect ) const;
 
     /**
      * Sets up item currently drawn item subcells.
@@ -667,11 +668,11 @@
     void SetupIconSubcellL(
     		RArray<TTemplateChild>& aTemplateChildArray, TInt aChildIndex, TInt aItemIndex,
     		RBuf& aItemText, TInt& aSubcellIncrement ) const;
-    
+
     /**
      * Determines whether a bitmap of given size needs scaling to be displayed
      * in a rectangular area of some given target size.
-     * 
+     *
      * This method assumes that the bitmap will always be scaled with aspect
      * ratio preserved. A bitmap does not need scaling if its size meets either
      * of the two conditions:
@@ -683,8 +684,8 @@
      * 1 pixel.
      * Please note that a bitmap which is too small (i.e. neither its width or its
      * height is close to the target width/height) will be regarded as one that
-     * needs scaling. 
-     * 
+     * needs scaling.
+     *
      * @param aBmpSize size of the bitmap
      * @param aTargetSize size of the area where bitmap will be displayed
      * @return ETrue if bitmap does not need scaling
@@ -728,13 +729,13 @@
      *
      * @param aItemIndex An index of a currently drawn item.
      * @param aItemIsCurrent Is aItemIndex the current item index.
-     * @param aAllowHighlightForNonDraggedItem Should highlight be shown 
+     * @param aAllowHighlightForNonDraggedItem Should highlight be shown
      * 	(set in case when effects are used).
      * @return ETrue if highlight is drawn for the actually drawn item.
      */
-    TBool GetHighlightVisibility(  TInt aItemIndex, 
+    TBool GetHighlightVisibility(  TInt aItemIndex,
     		TBool aItemIsCurrent, TBool aAllowHighlightForNonDraggedItem  ) const;
-    
+
     /**
      * Returns backdrop visibility.
      *
@@ -886,7 +887,7 @@
      * Not own.
      */
     CMmTemplateLibrary* iTemplateLibrary;
-    
+
     /**
      * Storage for cached items data. The data is updated during normal operation
      * and used when iUseCache is ETrue.
@@ -905,7 +906,7 @@
      * Stores information on the last used subcells configuration.
      * Such information is needed to determine whether it is necessary to
      * setup subcells before drawing a particular item or is it possible
-     * to skip this step because the subcells are already set properly.  
+     * to skip this step because the subcells are already set properly.
      */
     mutable TMmSubcellsSetupCode iLastSubcellsSetupCode;
 
@@ -913,17 +914,17 @@
      * Set to ETrue if item has backdrop.
      */
     mutable TBool iItemHasBackdrop;
-    
+
     /**
      * Number of subcells in iData.
      */
     mutable TInt iCurrentNumberOfSubcellsSet;
-    
+
     /**
      * A structure that stores color information needed to draw an item.
      */
     mutable CFormattedCellListBoxData::TColors iColors;
-    
+
     /**
      * ETrue if the item that was last drawn was a floating item.
      */
--- a/menufw/menufwui/mmwidgets/src/mmgrid.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmgrid.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:
-*  Version     : %version: MM_101 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_102 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -318,72 +318,7 @@
 //
 void CMmGrid::HandlePointerEventInNormalModeL( const TPointerEvent& aPointerEvent )
     {
-    CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
-    if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
-		{
-        const TInt KIgnoreRectSize = 40;
-        TRect ignoreDragRect(aPointerEvent.iPosition,
-                TSize(KIgnoreRectSize, KIgnoreRectSize));
-        ignoreDragRect.Move( - KIgnoreRectSize / 2, - KIgnoreRectSize / 2 );
-        Window().RequestPointerRepeatEvent( 50000, ignoreDragRect );
-		}
-    else if ( aPointerEvent.iType == TPointerEvent::EButtonRepeat )
-        {
-        HandleButtonRepeatEventInNormalModeL( aPointerEvent );
-        }
-	CAknGrid::HandlePointerEventL(aPointerEvent);
-    }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CMmGrid::HandleButtonRepeatEventInNormalModeL(
-        const TPointerEvent& aPointerEvent )
-    {
-    TInt itemUnderPointerIndex = KErrNotFound;
-    TBool itemFound = View()->XYPosToItemIndex(
-            aPointerEvent.iPosition, itemUnderPointerIndex );
-    if ( !itemFound )
-        {
-        return;
-        }
-
-    View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState );
-    CMmWidgetContainer* parent = static_cast<CMmWidgetContainer*>( Parent() );
-    TBool highlightWasVisible = parent->IsHighlightVisible();
-
-    if( itemUnderPointerIndex == View()->CurrentItemIndex() )
-        {
-#ifdef RD_UI_TRANSITION_EFFECTS_LIST
-        MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(
-                iMmDrawer->Gc() );
-         if ( transApi )
-             {
-             transApi->Remove( MAknListBoxTfxInternal::EListHighlight );
-             View()->DrawItem( itemUnderPointerIndex );
-             TRect itemUnderPointerIndexRect (
-                     View()->ItemPos(itemUnderPointerIndex),
-                     View()->ItemSize(itemUnderPointerIndex));
-             transApi->Draw( itemUnderPointerIndexRect );
-             }
-         else
-        	 {
-        	 View()->DrawItem( itemUnderPointerIndex );
-        	 }
-#else
-         View()->DrawItem( itemUnderPointerIndex );
-#endif
-        }
-     else
-        {
-        TInt previouslyHighlightedItemIndex = View()->CurrentItemIndex();
-        parent->SetManualHighlightL( itemUnderPointerIndex , EFalse );
-        if ( highlightWasVisible )
-            {
-            View()->DrawItem( previouslyHighlightedItemIndex );
-            }
-        }
+    CAknGrid::HandlePointerEventL(aPointerEvent);
     }
 
 // -----------------------------------------------------------------------------
--- a/menufw/menufwui/mmwidgets/src/mmgridview.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmgridview.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -95,7 +95,7 @@
         TInt mirroredItemCol = colNum - itemCol - 1;
         aItemIndex = aItemIndex - itemCol + mirroredItemCol;
         }
-    
+
     // return CAknGridView::ItemPos( aItemIndex );
     return CorrectItemPos( aItemIndex );
     }
@@ -109,19 +109,19 @@
     // it the assertion below fails, review this implementation to make sure that
     // primary vertical case is handled correctly
     ASSERT( !IsPrimaryVertical() );
-    
+
     ASSERT( aItemIndex >= 0 );
     const TInt colNum = NumberOfColsInView();
     TInt itemRow = aItemIndex / colNum;
     TInt itemCol = aItemIndex % colNum;
-    
+
     TInt topItemRow = TopItemIndex() / colNum;
 //    __ASSERT_DEBUG( TopItemIndex() % colNum == 0, User::Invariant() );
-    
+
     // it is safe to assume that size between items is (0, 0) because we
     // explicitly set such value in CMmGrid::DoSetupLayoutL
     const TSize sizeBetweenItems( 0, 0 );
-    
+
     TPoint itemPos(
         iViewRect.iTl.iX + itemCol *
             ( ColumnWidth() + sizeBetweenItems.iWidth ),
@@ -240,7 +240,18 @@
 		iWin->Invalidate( *aClipRect );
 		iWin->BeginRedraw( *aClipRect );
     	}
-    CAknGridView::Draw( aClipRect );
+
+    if ( !itemDrawer->IsEditMode() )
+        {
+        itemDrawer->DrawBackgroundAndSeparatorLines(ViewRect());
+        itemDrawer->SetRedrawItemBackground( EFalse );
+        CAknGridView::Draw( aClipRect );
+        itemDrawer->SetRedrawItemBackground( ETrue );
+        }
+    else
+        {
+        CAknGridView::Draw( aClipRect );
+        }
 
 	if ( aClipRect )
 	    {
@@ -288,7 +299,7 @@
 	CMmListBoxItemDrawer* itemDrawer =
 	        STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
 	static_cast<CMmGrid*>(itemDrawer->Widget())->SetItemHeight( aItemHeight );
-	
+
 	CAknGridView::SetItemHeight(aItemHeight);
 	}
 
--- a/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmlistboxitemdrawer.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -293,6 +293,7 @@
 //
 void CMmListBoxItemDrawer::DrawFloatingItems(TRect currentlyDrawnRect)
     {
+    TBool redrawItemBackground = IsRedrawItemBackgroundEnabled( );
     SetRedrawItemBackground( EFalse );
     for(TInt i(iFloatingItems.Count()-1); i >= 0 ; i--)
         {
@@ -327,7 +328,7 @@
             iFloatingItems.Remove(i);
         	}
         }
-    SetRedrawItemBackground( ETrue );
+    SetRedrawItemBackground( redrawItemBackground );
     }
 
 // -----------------------------------------------------------------------------
@@ -1035,11 +1036,13 @@
 	if ( iDrawMoveIndicators )
 		{
 		iIsIndicatorItem = ETrue;
+		TBool redrawItemBackground =
+            IsRedrawItemBackgroundEnabled( );
 		SetRedrawItemBackground( EFalse );
 
 		DrawActualItem( aItemIndex, AdjustItemRect( aItemIndex ) , EFalse, EFalse, EFalse, EFalse);
 
-		SetRedrawItemBackground( ETrue );
+		SetRedrawItemBackground( redrawItemBackground );
 		iIsIndicatorItem = EFalse;
 		}
 	}
--- a/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmlistboxview.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:
- *  Version     : %version: MM_50 % << Don't touch! Updated by Synergy at check-out.
+ *  Version     : %version: MM_51 % << Don't touch! Updated by Synergy at check-out.
  *
 */
 
@@ -151,7 +151,7 @@
 		}
 
 	TInt ret(i - aStartIndex);
-	
+
 	if ( !AknLayoutUtils::PenEnabled() && totalHeight > aHeight )
 		{
 		ret--; // exclude partial item
@@ -299,7 +299,7 @@
 		{
 		cc = itemDrawer->FormattedCellData()->SkinBackgroundContext ();
 		}
-	
+
 	itemDrawer->SetTopItemIndex (iTopItemIndex);
 
 	if ( iModel->NumberOfItems () > 0)
@@ -327,12 +327,27 @@
 
 		TInt lastPotentialItemIndex = Min (iModel->NumberOfItems (),
 				iTopItemIndex + GetNumberOfItemsThatFitInRect( ViewRect (), ETrue ) );
-		while (i < lastPotentialItemIndex)
-			{
-            DrawItem(i++);
-            }
 
-		RedrawBackground();
+		if ( !itemDrawer->IsEditMode() )
+		    {
+		    itemDrawer->DrawBackgroundAndSeparatorLines( ViewRect() );
+            itemDrawer->SetRedrawItemBackground( EFalse );
+            while (i < lastPotentialItemIndex)
+                {
+                DrawItem(i++);
+                }
+            itemDrawer->SetRedrawItemBackground( ETrue );
+		    }
+		else
+		    {
+		    while (i < lastPotentialItemIndex)
+                {
+                DrawItem(i++);
+                }
+		    // this redraws background in the view portion not covered by items
+		    RedrawBackground();
+		    }
+
 
 		if ( CAknEnv::Static()->TransparencyEnabled () && !drawingInitiated)
 			{
@@ -360,7 +375,7 @@
 								CurrentItemIndex());
 		view->SetPreviouslyDrawnCurrentItemIndex( CurrentItemIndex() );
 		}
-	
+
 	if ( !redrawConsumed )
 		{
 		DrawSingleItem ( aItemIndex );
@@ -446,11 +461,11 @@
 	{
 	//	we need to update the iItemHeight member in widget also (there are two different item height value holders - in widget and here in widget view)
 	iItemHeight = aItemHeight;
-	
+
 	CMmListBoxItemDrawer* itemDrawer =
 			STATIC_CAST( CMmListBoxItemDrawer*, ItemDrawer() );
 	static_cast<CMmListBox*>(itemDrawer->Widget())->SetItemHeight( aItemHeight );
-		
+
 	}
 
 // -----------------------------------------------------------------------------
@@ -466,7 +481,7 @@
 
 	TInt itemHeight = itemDrawer->
 		GetItemHeight( aItemIndex, aItemIndex == CurrentItemIndex() );
-	
+
 	// ItemIsPartiallyVisible uses fixed iItemHeight, but we have to support
 	// variable item height in lists, unfortunately ItemIsPartiallyVisible
 	// is not virtual
@@ -476,13 +491,13 @@
           itemPosition.iY + itemHeight >= iViewRect.iTl.iY ) ||
         ( itemPosition.iY <= iViewRect.iBr.iY &&
           itemPosition.iY + itemHeight > iViewRect.iBr.iY );
-		
+
 	TBool itemIsFullyVisible = ItemIsVisible( aItemIndex ) &&
             !itemPartiallyVisible;
 
 	TBool itemIsAboveVisibleArea = !itemIsFullyVisible &&
             ItemPos( aItemIndex ).iY < ViewRect().iTl.iY;
-		
+
 	TBool itemIsBeneathVisibleArea = !itemIsFullyVisible &&
             !itemIsAboveVisibleArea && ItemPos( aItemIndex ).iY + itemDrawer->
             GetItemHeight( aItemIndex, aItemIndex == CurrentItemIndex() ) >
@@ -496,7 +511,7 @@
 
 	if ( itemIsBeneathVisibleArea )
         {
-        const TInt viewHeight = ViewRect().Height(); 
+        const TInt viewHeight = ViewRect().Height();
         newTopItemIndex = aItemIndex;
         for ( ;; )
             {
@@ -576,7 +591,7 @@
             usedPortionHeight));
     usedPortionOfViewRect.Move(0,
             CFormattedCellListBoxView::ItemPos(iTopItemIndex).iY);
-    
+
     RedrawBackground(usedPortionOfViewRect, iViewRect);
 #endif
 	}
@@ -603,7 +618,7 @@
 	TSize size = itemDrawer->GetItemSize( aItemIndex, highlightVisible &&
 	        CurrentItemIndex() == aItemIndex );
 	itemDrawer->SetItemCellSize( size );
-	
+
 	// CMmListBoxView* view= CONST_CAST( CMmListBoxView*, this );
 	// view->SetItemHeight( size.iHeight );
 	// The above line (currently commented-out) was originaly needed to correct
@@ -611,8 +626,8 @@
 	// rocker keys. It seems that this is no longer needed. If anything should
 	// change, please note that now the SetItemHeight method does much more than
 	// it used to, so simply uncommenting this line would be a bad idea (consider
-	// setting the iItemHeight member variable directly). 
-	
+	// setting the iItemHeight member variable directly).
+
 	CFormattedCellListBoxView::DrawItem (aItemIndex);
 
 	//To eliminate the effect of undrawn fragment of background, when the last
--- a/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/menufw/menufwui/mmwidgets/src/mmwidgetcontainer.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:
-*  Version     : %version: MM_71.1.17.1.56 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: MM_71.1.17.1.57 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -638,7 +638,7 @@
     if ( aPointerEvent.iType == TPointerEvent::EButton1Down
             && itemExists  )
         {
-        SetHighlightL( index );
+        SetHighlightL( index );///////////--
         }
     else if ( aPointerEvent.iType == TPointerEvent::EDrag
               // the line below is needed to enable edit mode in the list widget
@@ -738,6 +738,7 @@
     {
     // activate the model
     CHnSuiteModel* suiteModel = GetMmModel()->GetSuiteModel();
+
     if ( suiteModel )
         {
         suiteModel->SetActiveL( aEnable );
@@ -766,7 +767,7 @@
             iWidget->View()->ItemDrawer()->ClearFlags(
                 CListItemDrawer::ESingleClickDisabledHighlight );
             }
-    
+
         if ( IsVisible() )
             {
             TInt highlight = GetHighlight();
@@ -1190,7 +1191,7 @@
     numberOfItemsBefore = GetMmModel()->NumberOfItems();
 
     GetMmModel()->SetSuiteModelL( aModel );
-    
+
     TBool highlightVisibleBefore = iWidget->IsVisible() && IsHighlightVisible();
 
     // This needs to be in place (disabling redraw)
@@ -1210,7 +1211,7 @@
         SetupWidgetLayoutL();
         }
     iWidget->MakeVisible(ETrue);
-    
+
     if ( highlightVisibleBefore )
         {
         SetHighlightVisibilityL( ETrue );
@@ -1895,38 +1896,16 @@
     switch ( aEventType )
 		{
 		case MEikListBoxObserver::EEventPenDownOnItem:
-			{
-			iDragOccured = EFalse;
-			if ( !iLongTapInProgress )
-				{
-				SetHighlightVisibilityL( ETrue );
-				}
-			break;
-			}
 		case MEikListBoxObserver::EEventItemSingleClicked:
 			{
-			if ( !iDragOccured && !iLongTapInProgress )
-				{
-				SetHighlightL( Widget()->CurrentItemIndex() );
-				SetHighlightVisibilityL( EFalse );
-				}
 			iDragOccured = EFalse;
 			break;
 			}
 		case MEikListBoxObserver::EEventItemDraggingActioned:
 			{
-			SetHighlightVisibilityL( EFalse );
 			iDragOccured = ETrue;
 			break;
 			}
-		case MEikListBoxObserver::EEventPanningStarted:
-		case MEikListBoxObserver::EEventPanningStopped:
-		case MEikListBoxObserver::EEventFlickStarted:
-		case MEikListBoxObserver::EEventFlickStopped:
-			{
-			SetHighlightVisibilityL( EFalse );
-			break;
-			}
 		}
 
 //    handle different behaviour in edit mode and normal mode
@@ -1935,6 +1914,7 @@
 		switch ( aEventType )
 			{
 			case MEikListBoxObserver::EEventFlickStarted:
+			case MEikListBoxObserver::EEventPanningStarted:
 				{
 				static_cast<CMmListBoxItemDrawer*>(
 						Widget()->View()->ItemDrawer() )->
@@ -1949,6 +1929,13 @@
 				DrawView();
 				break;
 				}
+			case MEikListBoxObserver::EEventPanningStopped:
+				{
+				static_cast<CMmListBoxItemDrawer*>(
+						Widget()->View()->ItemDrawer() )->
+						EnableCachedDataUse( EFalse );
+				break;
+				}
 			}
 		}
 	else
@@ -1965,10 +1952,10 @@
 			}
 		}
 
-    if ( iListBoxObserver && !iLongTapInProgress && !iDrawer->IsDraggable() )
+    if ( aEventType == MEikListBoxObserver::EEventItemSingleClicked &&
+        iListBoxObserver && !iLongTapInProgress && !iDrawer->IsDraggable() )
         {
         iListBoxObserver->HandleListBoxEventL( aListBox, aEventType );
         }
     }
-
 //End of file
Binary file menufw/menusuites/foldersuite/loc/matrixmenudata.loc has changed
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappui.h	Mon Mar 15 12:39:47 2010 +0200
@@ -167,9 +167,6 @@
     // Device state
     CTsDeviceState* iDeviceState;
 
-    // Buffer to keeping some memory allocation while being in background.    
-    TUint8* iMemAllocBuf;
-
     CPeriodic* iGoToBackgroundTimer;
     
     TBool iEffectsEnabled;
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsappview.h	Mon Mar 15 12:39:47 2010 +0200
@@ -193,7 +193,7 @@
      * Declare drag gesture handling.
      * @param aOffset - drag distance
      */
-    virtual void MoveOffset(const TPoint& aOffset);
+    virtual void MoveOffset(const TPoint& aOffset, TBool aDrawNow);
     
     /**
      * Declare tap gesture handling.
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontroler.h	Mon Mar 15 12:39:47 2010 +0200
@@ -161,6 +161,14 @@
      */
     void StopAnimation();
     
+    /**
+     * Enables/disables event handling based on passed value.
+     * 
+     * @param  aEnable  ETrue - enables event handling
+     *                  EFalse - disables event handling
+     */
+    void EnableEventHandling( TBool aEnable );
+    
 private:
     /**
      * Controler observer. Not own
@@ -176,6 +184,11 @@
      * Physics helper. Own
      */
     CTsPhysicsEngine* iPhysicsHelper;
+    
+    /**
+     * Flag to enable/disable event handling
+     */
+    TBool iHandleEvents;
     };
 
 #endif // TSEVENTCONTROLER_H
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tseventcontrolerobserver.h	Mon Mar 15 12:39:47 2010 +0200
@@ -33,7 +33,7 @@
      * Declare drag gesture handling.
      * @param aOffset - drag distance
      */
-    virtual void MoveOffset(const TPoint& aOffset)=0;
+    virtual void MoveOffset(const TPoint& aOffset, TBool aDrawNow)=0;
     
     /**
      * Declare tap gesture handling.
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswaparea.h	Mon Mar 15 12:39:47 2010 +0200
@@ -184,7 +184,7 @@
      * Implements drag gesture handling
      * @see MTsEventControlerObserver
      */
-    void MoveOffset(const TPoint&);
+    void MoveOffset(const TPoint&, TBool);
 
     /**
      * Implements tap gesture handling
@@ -375,6 +375,13 @@
      * consume EEventKeyUp that follows after event that swiched on the highlight.
      */
     TKeyResponse ShowHighlightOnKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aType);
+    
+    /**
+     * Returns current screen orientation:
+     * 
+     * @return  1 if landscape, 0 if portait 
+     */
+    TInt GetCurrentScreenOrientation();
 
 private: // Data
     
@@ -415,16 +422,18 @@
     TPointerEvent iTapEvent;
     CTsFastSwapTimer* iHighlightTimer;
     
-    //Ignore physics move when request is cased by drag outside owned area
-    TBool iIgnorePhysicsMove;
+    // View offset position, used by animation physics
+    TInt iLogicalViewPosOffset;
     
     // Grid scrolling
     TInt iGridItemWidth;
     TInt iGridItemGap;
     
     CTsFastSwapTimer* iRedrawTimer; // owned
-    
     CTsFastSwapTimer* iUpdateGridTimer;//owned
+    CTsFastSwapTimer* iOrientationSignalTimer; // owned
+    TInt iPrevScreenOrientation;
+    TBool iIgnoreLayoutSwitch;
     
     // Key event handling
     TBool iConsumeEvent;
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsfastswapgrid.h	Mon Mar 15 12:39:47 2010 +0200
@@ -255,7 +255,8 @@
 
 public: // Constructor and destructor
     CTsGridItemDrawer( CTsFastSwapGrid* aGrid,
-                               CFormattedCellListBoxData* aData );
+                       CFormattedCellListBoxData* aData,
+                       TRect aScreenRect );
     ~CTsGridItemDrawer();
 
 public: // New functions
--- a/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/inc/tsphysicsengine.h	Mon Mar 15 12:39:47 2010 +0200
@@ -76,11 +76,6 @@
     TBool IsRunning() const;
     
     /**
-     * Checks if the physics is running drag
-     */
-    TBool IsDragging() const;
-    
-    /**
      * Stops physics
      */
     void Stop();
@@ -114,9 +109,22 @@
     TTime iStartTime;
     
     /**
+     * Drag start position
+     */
+    TPoint iStartPosition;
+    
+    /**
      * Taskswitcher physics for item switch animation
      */
     CTsPhysics* iTaskswitcherPhysics;
+    
+    /**
+     * Marks direction in which drag events are made:
+     * Values: 0 - uninitialized
+     *         1 - drag right
+     *        -1 - drag left 
+     */
+    TInt iDragDirection;
 
     };
 
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappui.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -57,7 +57,6 @@
 //values for checking the OOM
 const TInt KMemoryRequestAmountInBytes = 524288;
 const TInt KMinMemoryAmountInBytes = 524288;
-const TInt KMemoryToBeReservedInBytes = 524288; // 512 KB
 
 // time to wait before sending the task to background
 // (must give time to animation)
@@ -190,7 +189,6 @@
         }
 
     delete iDeviceState;
-    delete iMemAllocBuf;
     delete iThemeEffectsEnabledWatcher;
     
     iWg.Close();
@@ -265,10 +263,13 @@
 // CTsAppUi::TransitionFinished
 // -----------------------------------------------------------------------------
 //
-void CTsAppUi::TransitionFinished(const CCoeControl* /*aControl*/, 
+void CTsAppUi::TransitionFinished(const CCoeControl* aControl, 
                                   TUint /*aAction*/)
     {
-    TRAP_IGNORE( DisablePopUpL() );
+    if ( aControl == iAppView )
+        {
+        TRAP_IGNORE( DisablePopUpL() );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -526,13 +527,6 @@
         iForeground = EFalse;
         SetTaskswitcherStateProperty( KTaskswitcherBackgroundValue );
 
-        //allocating extra memory space
-        if ( !iMemAllocBuf )
-            {
-            iMemAllocBuf =
-                (TUint8*) User::Alloc( KMemoryToBeReservedInBytes );
-            }
-
         // notify view
         iAppView->HandleSwitchToBackgroundEvent();
         }
@@ -552,10 +546,6 @@
     // must not do anything if iForeground is already up-to-date
     if ( !iForeground )
         {
-        //freeing extra memory space
-        delete iMemAllocBuf;
-        iMemAllocBuf = NULL;
-
         TInt freeRamMemory;
         HAL::Get( HALData::EMemoryRAMFree, freeRamMemory );
         if ( freeRamMemory <= KMinMemoryAmountInBytes )
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsappview.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -458,6 +458,8 @@
     
     Window().Invalidate(Rect());
     
+    iEvtHandler->EnableEventHandling(ETrue);
+    
     // Fade behind the pop-up
     iPopupFader.FadeBehindPopup( this, NULL, ETrue );
 
@@ -602,7 +604,15 @@
         {
 		LaunchFeedback(ETouchFeedbackBasic, TTouchFeedbackType(
 				ETouchFeedbackVibra | ETouchFeedbackAudio), aPointerEvent);
-        } 
+		if ( !( iFastSwapArea->Rect().Contains(aPointerEvent.iParentPosition) ||
+		        iAppsHeading->Rect().Contains(aPointerEvent.iParentPosition)
+		       ) )
+		    {
+		    //move task switcher to background
+		    iEvtHandler->EnableEventHandling(EFalse);
+		    iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit);
+		    }
+        }
     iFastSwapArea->HandlePointerEventL(aPointerEvent);
     }
 
@@ -660,10 +670,13 @@
 // CTsAppView::MoveOffset
 // -----------------------------------------------------------------------------
 //
-void CTsAppView::MoveOffset(const TPoint& aOffset)
+void CTsAppView::MoveOffset(const TPoint& aOffset, TBool aDrawNow)
     {
-    DrawDeferred();
-    iFastSwapArea->MoveOffset(aOffset);
+    if ( aDrawNow )
+        {
+        DrawDeferred();
+        }
+    iFastSwapArea->MoveOffset(aOffset, aDrawNow);
     }
 
 // -----------------------------------------------------------------------------
@@ -677,11 +690,6 @@
         iFastSwapArea->TapL(aPoint);
         DrawNow();
         }
-    else if( !iAppsHeading->Rect().Contains(aPoint))
-        {
-        //move task switcher to background
-        iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit);
-        }
     }
 
 // -----------------------------------------------------------------------------
@@ -694,11 +702,6 @@
         {
         iFastSwapArea->LongTapL(aPoint);
         }
-    else if( !iAppsHeading->Rect().Contains(aPoint))
-        {
-        //move task switcher to background
-        iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit);
-        }
     }
 
 // -----------------------------------------------------------------------------
@@ -717,11 +720,6 @@
         {
 		iFastSwapArea->DragL(aEvent);
         }
-    else 
-    	{
-		//move task switcher to background
-		iEikonEnv->EikAppUi()->HandleCommandL(EAknSoftkeyExit);
-    	}
     }
 
 // -----------------------------------------------------------------------------
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tseventcontroler.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -65,7 +65,8 @@
     MTsEventControlerObserver& aObserver)
     :
     CBase(),
-    iObserver(aObserver)
+    iObserver(aObserver),
+    iHandleEvents(ETrue)
     {
     }
 
@@ -88,15 +89,18 @@
 void CTsEventControler::HandleTouchGestureL(
     AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent)
     {
-    if (AknTouchGestureFwEventDrag(aEvent))
+    if ( iHandleEvents )
         {
-        HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent));
+        if (AknTouchGestureFwEventDrag(aEvent))
+            {
+            HandleDragEventL(*AknTouchGestureFwEventDrag(aEvent));
+            }
+        else if (AknTouchGestureFwEventTap(aEvent))
+            {
+            HandleTapEventL(*AknTouchGestureFwEventTap(aEvent));
+            }
+        //ignore flick and pinch events
         }
-    else if (AknTouchGestureFwEventTap(aEvent))
-        {
-        HandleTapEventL(*AknTouchGestureFwEventTap(aEvent));
-        }
-    //ignore flick and pinch events
     }
 
 // -----------------------------------------------------------------------------
@@ -114,12 +118,7 @@
         {
         if( IsPhysicsRunning() )
             {
-            TBool forwardTap = iPhysicsHelper->IsDragging();
             iPhysicsHelper->Stop();
-            if ( forwardTap )
-                {
-                iObserver.TapL(aEvent.Position());
-                }
             }
         else
             {
@@ -136,7 +135,10 @@
     MAknTouchGestureFwDragEvent& aEvent)
     {
     iObserver.DragL(aEvent);
-    iPhysicsHelper->HandleDragEvent(aEvent);
+    if ( iHandleEvents )
+        {
+        iPhysicsHelper->HandleDragEvent(aEvent);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -144,10 +146,10 @@
 // -----------------------------------------------------------------------------
 //
 void CTsEventControler::ViewPositionChanged(const TPoint& aNewPosition,
-    TBool /*aDrawNow*/,
+    TBool aDrawNow,
     TUint /*aFlags*/)
     {
-    iObserver.MoveOffset(aNewPosition);
+    iObserver.MoveOffset(aNewPosition, aDrawNow);
     }
 
 // -----------------------------------------------------------------------------
@@ -205,4 +207,18 @@
     iPhysicsHelper->Stop();
     }
 
+
+// -----------------------------------------------------------------------------
+// EnableEventHandling
+// -----------------------------------------------------------------------------
+//
+void CTsEventControler::EnableEventHandling( TBool aEnable )
+    {
+    iHandleEvents = aEnable;
+    if ( !aEnable && IsPhysicsRunning() )
+        {
+        iPhysicsHelper->Stop();
+        }
+    }
+
 // end of file
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswaparea.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -69,6 +69,7 @@
 const TInt KRedrawTimeForLayoutSwitch = 700000; // 0.7 sec
 const TInt KHighlighActivationTime = 100000; // 100 ms
 const TInt KUpdateGridTime = 0; // imediately
+const TInt KOrientationSwitchTime = 1000000; // 1 sec
 
 const TInt KMaxGranularity = 4;
 
@@ -109,7 +110,7 @@
     CTsDeviceState& aDeviceState,
     CTsEventControler& aEventHandler) :
     iParent(aParent), iDeviceState(aDeviceState), iEvtHandler(aEventHandler),
-    iPreviousNoOfItems(0)
+    iPreviousNoOfItems(0), iIgnoreLayoutSwitch(EFalse)
     {
     // no implementation required
     }
@@ -127,6 +128,7 @@
     delete iHighlightTimer;
     delete iRedrawTimer;
     delete iUpdateGridTimer;
+    delete iOrientationSignalTimer;
     }
 
 // -----------------------------------------------------------------------------
@@ -162,6 +164,9 @@
     iUpdateGridTimer = new (ELeave) CTsFastSwapTimer( *this );
     iUpdateGridTimer->ConstructL();
     
+    iOrientationSignalTimer = new (ELeave) CTsFastSwapTimer( *this ); 
+    iOrientationSignalTimer->ConstructL();
+    
     ActivateL();
     }
 
@@ -326,14 +331,14 @@
     TSLOG_CONTEXT( CTsFastSwapArea::SizeChanged, TSLOG_LOCAL );
     TSLOG_IN();
     
-    if ( iGrid )
+    if ( iGrid && !iIgnoreLayoutSwitch )
         {
         // Grid needs to be recreated to proper reinitilize
         // data with new layout values
         TInt selIdx = SelectedIndex();
         TRAPD(err, 
               ReCreateGridL();
-              iEvtHandler.ReInitPhysicsL(GridWorldSize(), ViewSize(), ETrue););
+              /*iEvtHandler.ReInitPhysicsL(GridWorldSize(), ViewSize(), ETrue);*/);
         if ( err != KErrNone )
             {
             TSLOG1( TSLOG_INFO, "ReCreateGridL leaves with %d", err );
@@ -383,10 +388,18 @@
         // Order is important and cannot be reversed.
         iFSClient->SwitchToApp( wgId );
         // We do not want to come back to ts if the activated app is closed.
-        // Therefore ts must be moved to background.
+        // Therefore ts must be moved to background. Ignore orientation updates, it
+        // will be done after task switcher is sent to background
+        iIgnoreLayoutSwitch = ETrue;
         CTsAppUi* appui =
             static_cast<CTsAppUi*>( iEikonEnv->AppUi() );
         appui->MoveAppToBackground( CTsAppUi::EActivationTransition );
+        iIgnoreLayoutSwitch = EFalse;
+        
+        // Orientation update
+        iPrevScreenOrientation = -1; // force orientation reinit
+        iOrientationSignalTimer->Cancel();
+        iOrientationSignalTimer->After(KOrientationSwitchTime);
         }
     }
 
@@ -435,6 +448,11 @@
             DrawDeferred();
             iGrid->SetCurrentDataIndex(selIdx);
             }
+        
+        // Orientation update
+        iPrevScreenOrientation = GetCurrentScreenOrientation();
+        iOrientationSignalTimer->Cancel();
+        iOrientationSignalTimer->After(KOrientationSwitchTime);
         }
 
     TSLOG_OUT();
@@ -1024,6 +1042,17 @@
         {
         UpdateGrid(ETrue, ETrue);
         }
+    else if ( aSource == iOrientationSignalTimer )
+        {
+        TInt currentOrientation = GetCurrentScreenOrientation();
+        if ( currentOrientation != iPrevScreenOrientation )
+            {
+            // Order layout change
+            static_cast<CAknAppUi*>(iCoeEnv->AppUi())->HandleResourceChangeL(KEikDynamicLayoutVariantSwitch);
+            iRedrawTimer->Cancel();
+            iRedrawTimer->After(KRedrawTime);
+            }
+        }
     }
 
 
@@ -1282,12 +1311,11 @@
         {
         if ( aAnimate )
             {
-			iIgnorePhysicsMove = EFalse;
             iEvtHandler.Animate( targetPoint );
             }
         else
             {
-            MoveOffset(targetPoint);
+            MoveOffset(targetPoint, ETrue);
             iEvtHandler.StopAnimation();
             }
         if ( aForceRedraw )
@@ -1324,18 +1352,13 @@
 // CTsFastSwapArea::MoveOffset
 // --------------------------------------------------------------------------
 //
-void CTsFastSwapArea::MoveOffset(const TPoint& aPoint)
+void CTsFastSwapArea::MoveOffset(const TPoint& aPoint, TBool aDrawNow)
     {
     TSLOG_CONTEXT( CTsFastSwapArea::MoveOffset, TSLOG_LOCAL );
     TSLOG2_IN("Old position x: %d, y:%d", ViewPos().iX, ViewPos().iY);
     TSLOG2_IN("New position x: %d, y:%d", aPoint.iX, aPoint.iY);
     TSLOG_OUT();
-    
-    //ignore case when drag occurs outside owned area 
-    if( iIgnorePhysicsMove )
-    	{
-		return;
-    	}
+
     //postpone center item request in case of being moved
     if(iUpdateGridTimer->IsActive())
     	{
@@ -1343,19 +1366,28 @@
 		iUpdateGridTimer->After(KUpdateGridTime);
     	}
     
-    TInt currentXPos = aPoint.iX;
-    currentXPos -= Rect().Width() / 2;
-    TRect gridViewRect = Rect();
-    gridViewRect.iTl.iX = -currentXPos;
-    // Take edge offset into account
-    gridViewRect.iTl.iX += Rect().iTl.iX;
-    if(GridItemCount() <= iMaxItemsOnScreen)
+    if ( aDrawNow )
         {
-        // Center view
-        gridViewRect.iTl.iX += ( Rect().Width() - GridItemCount() * iGridItemWidth ) / 2;
+        TInt currentXPos = aPoint.iX;
+        currentXPos -= Rect().Width() / 2;
+        TRect gridViewRect = Rect();
+        gridViewRect.iTl.iX = -currentXPos;
+        // Take edge offset into account
+        gridViewRect.iTl.iX += Rect().iTl.iX;
+        if(GridItemCount() <= iMaxItemsOnScreen)
+            {
+            // Center view
+            gridViewRect.iTl.iX += ( Rect().Width() - GridItemCount() * iGridItemWidth ) / 2;
+            }
+        iGrid->SetRect( gridViewRect );
+        DrawDeferred();
+        iLogicalViewPosOffset = 0;
         }
-    iGrid->SetRect( gridViewRect );
-    DrawDeferred();
+    else
+        {
+        // Update logical view position
+        iLogicalViewPosOffset = aPoint.iX - ViewPos().iX;
+        }
     }
 
 // --------------------------------------------------------------------------
@@ -1416,15 +1448,6 @@
 		{
 		CenterItem( KUpdateGridTime );
 		}
-	if( !Rect().Contains(aEvent.CurrentPosition()) )
-		{
-		iIgnorePhysicsMove = ETrue;
-		return;
-		}
-	else
-		{
-		iIgnorePhysicsMove = EFalse;
-		}
 		
     iGrid->SetTactileFeedbackSupport(ETrue);
     iGrid->HideHighlight();
@@ -1464,6 +1487,7 @@
         // View centered
         retVal.iX += ( Rect().Width() - gridItemCount * iGridItemWidth ) / 2;
         }
+    retVal.iX += iLogicalViewPosOffset;
     return retVal;
     }
 
@@ -1640,4 +1664,16 @@
         }
     }
 
+
+// -----------------------------------------------------------------------------
+// CTsFastSwapArea::GetCurrentScreenOrientation
+// -----------------------------------------------------------------------------
+//
+TInt CTsFastSwapArea::GetCurrentScreenOrientation()
+    {
+    TPixelsAndRotation availableRect;
+    iEikonEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(availableRect);
+    return availableRect.iPixelSize.iWidth > availableRect.iPixelSize.iHeight;
+    }
+
 // End of file
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsfastswapgrid.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -23,6 +23,7 @@
 #include <touchfeedback.h>
 
 #include "tsfastswapgrid.h"
+#include "tsapplogging.h"
 
  /* ================================================================================
   * CTsFastSwapGrid
@@ -65,6 +66,9 @@
 //
 void CTsFastSwapGrid::ConstructL( const CCoeControl* aParent )
     {
+    TSLOG_CONTEXT( CTsFastSwapGrid::ConstructL, TSLOG_LOCAL );
+    TSLOG_IN();
+    
     iParent = aParent;
     CAknGrid::ConstructL( aParent, EAknListBoxSelectionGrid );
     SetPrimaryScrollingType(CAknGridView::EScrollFollowsItemsAndLoops);
@@ -79,6 +83,8 @@
     iCloseIconRedrawTimer->ConstructL();
     iFeedbackTimer = new (ELeave) CTsFastSwapTimer( *this );
     iFeedbackTimer->ConstructL();
+    
+    TSLOG_OUT();
     }
 
 // -----------------------------------------------------------------------------
@@ -87,6 +93,9 @@
 //
 void CTsFastSwapGrid::HandlePointerEventL( const TPointerEvent &aPointerEvent )
     {
+    TSLOG_CONTEXT( CTsFastSwapGrid::HandlePointerEventL, TSLOG_LOCAL );
+    TSLOG_IN();
+    
     TBool eventHandled( EFalse );
     if ( aPointerEvent.iType == TPointerEvent::EButton1Up ||
          aPointerEvent.iType == TPointerEvent::EButton1Down )
@@ -102,7 +111,7 @@
                 break;
                 }
             }
-        if ( hitItem != KErrNotFound )
+        if ( hitItem != KErrNotFound && CanCloseItem( hitItem ) )
             {
             // Item found, check if close icon has been hit
             TPoint itemPos = GridView()->ItemPos( hitItem );
@@ -173,6 +182,8 @@
         CAknGrid::HandlePointerEventL( aPointerEvent );
         Redraw();
         }
+    
+    TSLOG_OUT();
     }
 
 
@@ -182,10 +193,15 @@
 //
 void CTsFastSwapGrid::HandleDeviceStateChanged( TChangeType aChangeType )
     {
+    TSLOG_CONTEXT( CTsFastSwapGrid::HandleDeviceStateChanged, TSLOG_LOCAL );
+    TSLOG_IN();
+    
     if ( aChangeType == ESkin )
         {
         LoadCloseIcon();
         }
+    
+    TSLOG_OUT();
     }
 
 // -----------------------------------------------------------------------------
@@ -208,11 +224,16 @@
 //
 void CTsFastSwapGrid::HandleResourceChange( TInt aType )
     {
+    TSLOG_CONTEXT( CTsFastSwapGrid::HandleResourceChange, TSLOG_LOCAL );
+    TSLOG_IN();
+    
     if ( aType != KEikDynamicLayoutVariantSwitch &&
          Model()->ItemTextArray()->MdcaCount() )
         {
         CAknGrid::HandleResourceChange( aType );
         }
+    
+    TSLOG_OUT();
     }
 
 
@@ -241,26 +262,32 @@
 //
 void CTsFastSwapGrid::CreateItemDrawerL()
     {
-    TRect availableRect;
-    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, availableRect);
+    TSLOG_CONTEXT( CTsFastSwapGrid::CreateItemDrawerL, TSLOG_LOCAL );
+    TSLOG_IN();
+    
+    TPixelsAndRotation screenSize;
+    iEikonEnv->ScreenDevice()->GetDefaultScreenSizeAndRotation(screenSize);
+    TRect availableRect = TRect( TPoint(0,0), screenSize.iPixelSize );
     TAknLayoutRect fastSwapAreaPane;
     TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0;
     fastSwapAreaPane.LayoutRect( availableRect,
             AknLayoutScalable_Apps::tport_appsw_pane( variety ) );
-    const TInt leftOffset = fastSwapAreaPane.Rect().iTl.iX;
-    const TInt rightOffset = availableRect.Width() - fastSwapAreaPane.Rect().iBr.iX;
+    const TInt leftOffset = iParent->Rect().iTl.iX;
+    const TInt rightOffset = availableRect.Width() - iParent->Rect().iBr.iX;
     SetVisibleViewRect(fastSwapAreaPane.Rect());
     
     CFormattedCellGridData* data = CFormattedCellGridData::NewL();
     CleanupStack::PushL( data );
     CTsGridItemDrawer* itemDrawer =
-        new ( ELeave ) CTsGridItemDrawer( this, data );
+        new ( ELeave ) CTsGridItemDrawer( this, data, availableRect );
     CleanupStack::PushL( itemDrawer );
     itemDrawer->SetEdgeOffset( leftOffset, rightOffset );
     iItemDrawer = itemDrawer;
     CleanupStack::Pop( itemDrawer );
     CleanupStack::Pop( data );
     LoadCloseIcon();
+    
+    TSLOG_OUT();
     }
 
 // -----------------------------------------------------------------------------
@@ -605,13 +632,14 @@
 //
 CTsGridItemDrawer::CTsGridItemDrawer(
         CTsFastSwapGrid* aGrid,
-        CFormattedCellListBoxData* aData )
+        CFormattedCellListBoxData* aData,
+        TRect aScreenRect )
 : CFormattedCellListBoxItemDrawer( aGrid->Model(),
         NULL,
         aData ),
-  iGrid( aGrid )
+  iGrid( aGrid ),
+  iScreenRect(aScreenRect)
     {
-    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, iScreenRect);
     }
 
 
--- a/taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp	Fri Mar 12 15:41:49 2010 +0200
+++ b/taskswitcher/taskswitcherui/taskswitcherapp/src/tsphysicsengine.cpp	Mon Mar 15 12:39:47 2010 +0200
@@ -86,16 +86,6 @@
     return iPhysics->OngoingPhysicsAction() != CAknPhysics::EAknPhysicsActionNone;
     }
 
-
-// -----------------------------------------------------------------------------
-// CTsPhysicsEngine::IsDragging
-// -----------------------------------------------------------------------------
-//
-TBool CTsPhysicsEngine::IsDragging() const
-    {
-    return iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionDragging;
-    }
-
 // -----------------------------------------------------------------------------
 // CTsPhysicsEngine::HandleDragEvent
 // -----------------------------------------------------------------------------
@@ -107,16 +97,25 @@
         {
         iPhysics->StopPhysics();
         iStartTime.HomeTime();
+        iStartPosition = aEvent.CurrentPosition();
+        iDragDirection = 0;
         }
     else if (AknTouchGestureFw::EAknTouchGestureFwOn == aEvent.State())
         {
+        TInt direction =
+                aEvent.CurrentPosition().iX > aEvent.PreviousPosition().iX ? -1 : 1;
         TPoint deltaPoint(aEvent.PreviousPosition() - aEvent.CurrentPosition());
         iPhysics->RegisterPanningPosition(deltaPoint);
-        iStartTime.HomeTime();
+        if (iDragDirection && iDragDirection != direction)
+            {
+            iStartTime.HomeTime();
+            iStartPosition = aEvent.PreviousPosition();
+            }
+        iDragDirection = direction;
         }
     else //AknTouchGestureFw::EAknTouchGestureFwStop
         {
-        TPoint drag(aEvent.PreviousPosition() - aEvent.CurrentPosition());
+        TPoint drag(iStartPosition - aEvent.CurrentPosition());
         iPhysics->StartPhysics(drag, iStartTime);
         }
     }