idlehomescreen/xmluirendering/uiengine/src/xneffectmanager.cpp
changeset 1 5315654608de
parent 0 f72a12da539e
child 11 ff572dfe6d86
equal deleted inserted replaced
0:f72a12da539e 1:5315654608de
   154 //
   154 //
   155 void CXnEffectManager::UiRendered()
   155 void CXnEffectManager::UiRendered()
   156     {
   156     {
   157     for ( TInt i = 0; i < iEffects.Count(); )
   157     for ( TInt i = 0; i < iEffects.Count(); )
   158         {
   158         {
   159         TInt count = iEffects.Count(); // for debugging
       
   160         TXnEffect* effect = iEffects[i];
   159         TXnEffect* effect = iEffects[i];
   161         if ( effect && effect->iState == KEffectStarted )
   160         if ( effect && effect->iState == KEffectStarted )
   162             {
   161             {
   163             if ( effect->iType == KEffectTypeFullscreen )
   162             if ( effect->iType == KEffectTypeFullscreen )
   164                 {
   163                 {
   181 // CXnEffectManager::UiLayouted
   180 // CXnEffectManager::UiLayouted
   182 // -----------------------------------------------------------------------------
   181 // -----------------------------------------------------------------------------
   183 //
   182 //
   184 void CXnEffectManager::UiLayouted()
   183 void CXnEffectManager::UiLayouted()
   185     {
   184     {
   186     TInt count = iEffects.Count();
   185     for ( TInt i = 0; i < iEffects.Count(); )
   187     for ( TInt i = 0; i < count; i++ )
   186         {
   188         {
   187         TBool effectStarted = ETrue;
   189         TXnEffect* effect = iEffects[i];
   188         TXnEffect* effect = iEffects[i];
   190         if ( effect && effect->iNode &&
   189         if ( effect && effect->iNode &&
   191              effect->iState == KWaitForLayout &&
   190              effect->iState == KWaitForLayout &&
   192              effect->iNode->IsLaidOut())
   191              effect->iNode->IsLaidOut())
   193             {
   192             {
   194             if ( effect->iType == KEffectTypeFullscreen )
   193             if ( effect->iType == KEffectTypeFullscreen )
   195                 {
   194                 {
   196                 DoBeginFullscreenEffect( *effect );
   195                 effectStarted = DoBeginFullscreenEffect( *effect );
   197                 }
   196                 }
   198             else if ( effect->iType == KEffectTypeControl )
   197             else if ( effect->iType == KEffectTypeControl )
   199                 {
   198                 {
   200                 DoBeginControlEffect( *effect );
   199                 effectStarted = DoBeginControlEffect( *effect );
   201                 }
   200                 }
   202             }
   201             }
       
   202         
       
   203         if ( effectStarted )
       
   204             {
       
   205             i++;
       
   206             }
       
   207         else
       
   208             {
       
   209             // effect cannot be started, remove it
       
   210             RemoveEffect( effect );
       
   211             }
   203         }
   212         }
   204     }
   213     }
   205 
   214 
   206 // -----------------------------------------------------------------------------
   215 // -----------------------------------------------------------------------------
   207 // CXnEffectManager::DoBeginFullscreenEffect
   216 // CXnEffectManager::DoBeginFullscreenEffect
   208 // -----------------------------------------------------------------------------
   217 // -----------------------------------------------------------------------------
   209 //
   218 //
   210 void CXnEffectManager::DoBeginFullscreenEffect( TXnEffect& aEffect )
   219 TBool CXnEffectManager::DoBeginFullscreenEffect( TXnEffect& aEffect )
   211     {
   220     {
   212     CCoeEnv* coe( CCoeEnv::Static() );
   221     CCoeEnv* coe( CCoeEnv::Static() );
   213            
   222            
   214     if ( coe->WsSession().GetFocusWindowGroup() != 
   223     if ( coe->WsSession().GetFocusWindowGroup() != 
   215          coe->RootWin().Identifier() )
   224          coe->RootWin().Identifier() )
   216         {
   225         {
   217         // Window group is not focused
   226         // Window group is not focused
   218         RemoveEffect( &aEffect );
   227         return EFalse;
   219         return;
       
   220         }
   228         }
   221 
   229 
   222     const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel );
   230     const TInt flags( AknTransEffect::TParameter::EActivateExplicitCancel );
   223     const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() );
   231     const TUid targetAppUid( iAvkonAppUi->Application()->AppDllUid() );
   224 
   232 
   226     GfxTransEffect::BeginFullScreen( aEffect.iId , iAvkonAppUi->ClientRect(),
   234     GfxTransEffect::BeginFullScreen( aEffect.iId , iAvkonAppUi->ClientRect(),
   227         AknTransEffect::EParameterType, AknTransEffect::GfxTransParam(
   235         AknTransEffect::EParameterType, AknTransEffect::GfxTransParam(
   228         targetAppUid, flags ) );
   236         targetAppUid, flags ) );
   229     
   237     
   230     aEffect.iState = KEffectStarted;
   238     aEffect.iState = KEffectStarted;
       
   239     return ETrue;
   231     }
   240     }
   232 
   241 
   233 // -----------------------------------------------------------------------------
   242 // -----------------------------------------------------------------------------
   234 // CXnEffectManager::DoBeginControlEffect
   243 // CXnEffectManager::DoBeginControlEffect
   235 // -----------------------------------------------------------------------------
   244 // -----------------------------------------------------------------------------
   236 //
   245 //
   237 void CXnEffectManager::DoBeginControlEffect( TXnEffect& aEffect )
   246 TBool CXnEffectManager::DoBeginControlEffect( TXnEffect& aEffect )
   238     {
   247     {
       
   248     TBool ret = EFalse;
   239     CCoeEnv* coe( CCoeEnv::Static() );
   249     CCoeEnv* coe( CCoeEnv::Static() );
   240            
   250            
   241     if ( coe->WsSession().GetFocusWindowGroup() != 
   251     if ( coe->WsSession().GetFocusWindowGroup() != 
   242          coe->RootWin().Identifier() )
   252          coe->RootWin().Identifier() )
   243         {
   253         {
   244         // Window group is not focused
   254         // Window group is not focused
   245         RemoveEffect( &aEffect );
   255         return ret;
   246         return;
       
   247         }
   256         }
   248 
   257 
   249     // Set effect begin point
   258     // Set effect begin point
   250     if ( aEffect.iNode )
   259     if ( aEffect.iNode )
   251         {
   260         {
   252         GfxTransEffect::Begin( aEffect.iNode->Control() , aEffect.iId );
   261         GfxTransEffect::Begin( aEffect.iNode->Control() , aEffect.iId );
   253         aEffect.iState = KEffectStarted;
   262         aEffect.iState = KEffectStarted;
   254         }
   263         ret = ETrue;
   255     else
   264         }
   256         {
   265     
   257         RemoveEffect( &aEffect );
   266     return ret;
   258         }
       
   259     }
   267     }
   260 
   268 
   261 // -----------------------------------------------------------------------------
   269 // -----------------------------------------------------------------------------
   262 // CXnEffectManager::RemoveEffect
   270 // CXnEffectManager::RemoveEffect
   263 // -----------------------------------------------------------------------------
   271 // -----------------------------------------------------------------------------