idlehomescreen/xmluirendering/uiengine/src/xnviewmanager.cpp
branchRCL_3
changeset 38 79311d856354
parent 34 d05a55b217df
child 47 7be2816dbabd
equal deleted inserted replaced
34:d05a55b217df 38:79311d856354
    25 #include <aknnotewrappers.h>
    25 #include <aknnotewrappers.h>
    26 #include <AknsConstants.h>
    26 #include <AknsConstants.h>
    27 #include <aifwdefs.h>
    27 #include <aifwdefs.h>
    28 #include <gfxtranseffect/gfxtranseffect.h>
    28 #include <gfxtranseffect/gfxtranseffect.h>
    29 #include <akntransitionutils.h>
    29 #include <akntransitionutils.h>
       
    30 #include <layoutmetadata.cdl.h>
    30 
    31 
    31 // User includes
    32 // User includes
    32 #include "xnapplication.h"
    33 #include "xnapplication.h"
    33 #include "xnuiengine.h"
    34 #include "xnuiengine.h"
    34 #include "xnproperty.h"
    35 #include "xnproperty.h"
   323 
   324 
   324     iHspsWrapper = &iEditor->HspsWrapper();
   325     iHspsWrapper = &iEditor->HspsWrapper();
   325     
   326     
   326     iComposer = CXnComposer::NewL( *iHspsWrapper );
   327     iComposer = CXnComposer::NewL( *iHspsWrapper );
   327     
   328     
       
   329     iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
       
   330     
   328     DoRobustnessCheckL();
   331     DoRobustnessCheckL();
   329     }
   332     }
   330 
   333 
   331 // -----------------------------------------------------------------------------
   334 // -----------------------------------------------------------------------------
   332 // CXnViewManager::LoadUiL()
   335 // CXnViewManager::LoadUiL()
   864     if ( !next.Occupied() )
   867     if ( !next.Occupied() )
   865         {                
   868         {                
   866         if ( next.Load() == KErrNoMemory )
   869         if ( next.Load() == KErrNoMemory )
   867             {
   870             {
   868             next.ShowOutOfMemError();
   871             next.ShowOutOfMemError();
   869             
       
   870             return;
   872             return;
   871             }
   873             }
   872         }
   874         }
   873         
   875         
   874     // Activate view
   876     // Activate view
   883         GfxTransEffect::Register( thisView, KGfxContextActivateNextView );    
   885         GfxTransEffect::Register( thisView, KGfxContextActivateNextView );    
   884         GfxTransEffect::Register( nextView, KGfxContextActivateNextView );
   886         GfxTransEffect::Register( nextView, KGfxContextActivateNextView );
   885         
   887         
   886         TInt ret( GfxTransEffect::BeginGroup() );
   888         TInt ret( GfxTransEffect::BeginGroup() );
   887         
   889         
   888         CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() );
   890         CFbsBitmap* currentBg( ActiveViewData().WallpaperImage() );
   889         
   891         CFbsBitmap* nextBg( next.WallpaperImage() );
   890         GfxTransEffect::Begin( bg, KGfxControlActionAppear );
   892         
   891 
   893         if ( currentBg || nextBg )
   892         GfxTransEffect::SetDemarcation( bg, bg->Position() );
   894             {
   893         GfxTransEffect::End( bg );        
   895             CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() );
   894         
   896             
   895         GfxTransEffect::Begin( thisView, KGfxControlActionDisappear );
   897             if ( !currentBg && nextBg )
   896         
   898                 {
   897         iAppUiAdapter.ViewAdapter().ActivateContainerL( next );
   899                 GfxTransEffect::Begin( bg, KGfxControlActionBgAnimToImgAppear );
       
   900                 }
       
   901             else
       
   902                 {
       
   903                 GfxTransEffect::Begin( bg, KGfxControlActionBgImgToImgAppear );
       
   904                 }
       
   905             
       
   906             GfxTransEffect::SetDemarcation( bg, bg->Position() );
       
   907             GfxTransEffect::End( bg );
       
   908             }
       
   909         
       
   910         if ( iIsLandscapeOrientation )
       
   911             {
       
   912             GfxTransEffect::Begin( thisView, KGfxControlActionDisappearLsc );
       
   913             GfxTransEffect::Begin( nextView, KGfxControlActionAppearLsc );
       
   914             }
       
   915         else
       
   916             {
       
   917             GfxTransEffect::Begin( thisView, KGfxControlActionDisappearPrt );
       
   918             GfxTransEffect::Begin( nextView, KGfxControlActionAppearPrt );
       
   919             }
       
   920         
       
   921         TRAP_IGNORE( iAppUiAdapter.ViewAdapter().ActivateContainerL( next ) );
   898         
   922         
   899         GfxTransEffect::SetDemarcation( thisView, thisView->Position() );
   923         GfxTransEffect::SetDemarcation( thisView, thisView->Position() );
   900         GfxTransEffect::End( thisView );
   924         GfxTransEffect::End( thisView );
   901                 
   925         
   902         GfxTransEffect::Begin( nextView, KGfxControlActionAppear );
       
   903         GfxTransEffect::SetDemarcation( nextView, nextView->Position() );
   926         GfxTransEffect::SetDemarcation( nextView, nextView->Position() );
   904         GfxTransEffect::End( nextView );
   927         GfxTransEffect::End( nextView );
   905                                 
   928                                 
   906         GfxTransEffect::EndGroup( ret );
   929         GfxTransEffect::EndGroup( ret );
   907         
   930         
   922     if ( !prev.Occupied() )
   945     if ( !prev.Occupied() )
   923         {
   946         {
   924         if ( prev.Load() == KErrNoMemory )
   947         if ( prev.Load() == KErrNoMemory )
   925             {
   948             {
   926             prev.ShowOutOfMemError();
   949             prev.ShowOutOfMemError();
   927             
       
   928             return;
   950             return;
   929             }
   951             }
   930         }
   952         }
   931         
   953         
   932     // Activate view
   954     // Activate view
   940 
   962 
   941         GfxTransEffect::Register( thisView, KGfxContextActivatePrevView );    
   963         GfxTransEffect::Register( thisView, KGfxContextActivatePrevView );    
   942         GfxTransEffect::Register( prevView, KGfxContextActivatePrevView );
   964         GfxTransEffect::Register( prevView, KGfxContextActivatePrevView );
   943     
   965     
   944         TInt ret( GfxTransEffect::BeginGroup() );
   966         TInt ret( GfxTransEffect::BeginGroup() );
   945             
   967         
   946         CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() );
   968         CFbsBitmap* currentBg( ActiveViewData().WallpaperImage() );
   947         
   969         CFbsBitmap* prevBg( prev.WallpaperImage() );
   948         GfxTransEffect::Begin( bg, KGfxControlActionAppear );
   970         
   949     
   971         if ( currentBg || prevBg )
   950         GfxTransEffect::SetDemarcation( bg, bg->Position() );
   972             {
   951         GfxTransEffect::End( bg );        
   973             CCoeControl* bg( &iAppUiAdapter.ViewAdapter().BgManager() );
   952         
   974             
   953         GfxTransEffect::Begin( thisView, KGfxControlActionDisappear );
   975             if ( !currentBg && prevBg )
   954         
   976                 {
   955         iAppUiAdapter.ViewAdapter().ActivateContainerL( prev );
   977                 GfxTransEffect::Begin( bg, KGfxControlActionBgAnimToImgAppear );
       
   978                 }
       
   979             else
       
   980                 {
       
   981                 GfxTransEffect::Begin( bg, KGfxControlActionBgImgToImgAppear );
       
   982                 }
       
   983             
       
   984             GfxTransEffect::SetDemarcation( bg, bg->Position() );
       
   985             GfxTransEffect::End( bg );
       
   986             }
       
   987         
       
   988         if ( iIsLandscapeOrientation )
       
   989             {
       
   990             GfxTransEffect::Begin( thisView, KGfxControlActionDisappearLsc );
       
   991             GfxTransEffect::Begin( prevView, KGfxControlActionAppearLsc );
       
   992             }
       
   993         else
       
   994             {
       
   995             GfxTransEffect::Begin( thisView, KGfxControlActionDisappearPrt );
       
   996             GfxTransEffect::Begin( prevView, KGfxControlActionAppearPrt );
       
   997             }
       
   998         
       
   999         TRAP_IGNORE( iAppUiAdapter.ViewAdapter().ActivateContainerL( prev ) );
   956         
  1000         
   957         GfxTransEffect::SetDemarcation( thisView, thisView->Position() );
  1001         GfxTransEffect::SetDemarcation( thisView, thisView->Position() );
   958         GfxTransEffect::End( thisView );
  1002         GfxTransEffect::End( thisView );
   959                 
  1003                                       
   960         GfxTransEffect::Begin( prevView, KGfxControlActionAppear );
       
   961                               
       
   962         GfxTransEffect::SetDemarcation( prevView, prevView->Position() );
  1004         GfxTransEffect::SetDemarcation( prevView, prevView->Position() );
   963         GfxTransEffect::End( prevView );
  1005         GfxTransEffect::End( prevView );
   964                                 
  1006                                 
   965         GfxTransEffect::EndGroup( ret );
  1007         GfxTransEffect::EndGroup( ret );
   966         
  1008         
  1770                                 KStabilityInterval,
  1812                                 KStabilityInterval,
  1771                                 TCallBack( SystemStabileTimerCallback, this ) );
  1813                                 TCallBack( SystemStabileTimerCallback, this ) );
  1772         }           
  1814         }           
  1773     }
  1815     }
  1774 
  1816 
       
  1817 // -----------------------------------------------------------------------------
       
  1818 // CXnViewManager::OrientationChanged 
       
  1819 // -----------------------------------------------------------------------------
       
  1820 void CXnViewManager::OrientationChanged()
       
  1821     {
       
  1822     iIsLandscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();    
       
  1823     }
       
  1824 
  1775 // End of file
  1825 // End of file