uiacceltk/hitchcock/ServerCore/Src/alfappsrvsession.cpp
changeset 14 83d2d132aa58
parent 0 15bf7259bb7c
child 11 46927d61fef3
equal deleted inserted replaced
13:8f67d927ea57 14:83d2d132aa58
   362     	// Disable all animated textures for the session
   362     	// Disable all animated textures for the session
   363     	for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
   363     	for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
   364         	{
   364         	{
   365       		iAnimatedTextures.operator[](index)->EnableAnimation(EFalse); 
   365       		iAnimatedTextures.operator[](index)->EnableAnimation(EFalse); 
   366         	}
   366         	}
   367        	
   367 #ifndef SYMBIAN_BUILD_GCE       	
   368       	StoreControlGroupOrderL(*display, EFalse ); // do not hide  
   368       	StoreControlGroupOrderL(*display, EFalse ); // do not hide  
   369        	// background must be drawn as long as the effect is displayed 
   369 #endif
       
   370       	// background must be drawn as long as the effect is displayed 
   370        	// as the background will be visible if the effect does not cover full screen
   371        	// as the background will be visible if the effect does not cover full screen
   371        	// or is partially transparent.
   372        	// or is partially transparent.
   372     	}
   373     	}
   373 /*    	
   374 /*    	
   374 #else
   375 #else
   419         if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
   420         if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
   420             {
   421             {
   421             iControlGroupOrder.AppendL( &group );
   422             iControlGroupOrder.AppendL( &group );
   422             }
   423             }
   423         }
   424         }
       
   425     
   424     // at the end the lowest index the bottom most and the biggest index the top most.
   426     // at the end the lowest index the bottom most and the biggest index the top most.
   425     
   427     
   426     // hide at the end so it does not affect the order of the group in the roster
   428     // hide at the end so it does not affect the order of the group in the roster
   427     if ( aAlsoHide )
   429     if ( aAlsoHide )
   428         {
   430         {
   429         for ( TInt i = 0 ; i < iControlGroupOrder.Count() ; i++ )
   431         for ( TInt i = 0 ; i < iControlGroupOrder.Count() ; i++ )
   430             {
   432             {
   431             CHuiLayout* hostContainer = iControlGroupOrder[i]->Control(0).ContainerLayout( NULL );
   433             CHuiLayout* hostContainer = iControlGroupOrder[i]->Control(0).ContainerLayout( NULL );
   432             hostContainer->iOpacity.Set(0.f); 
   434 
   433             aDisplay.Roster().Hide( *iControlGroupOrder[i] );
   435             aDisplay.Roster().Hide( *iControlGroupOrder[i] );
   434             }
   436             }
   435         }
   437         }
   436     }
   438     }
   437     
   439     
   438 void CAlfAppSrvSession::ShowControlGroupsInOrderL(CHuiDisplay& aDisplay)
   440 void CAlfAppSrvSession::ShowControlGroupsInOrderL(CHuiDisplay& aDisplay)
   439     {
   441     {
       
   442 #ifdef SYMBIAN_BUILD_GCE
       
   443     iControlGroupOrder.Reset();
       
   444     // gather all the control groups that belong to this session
       
   445     for ( TInt g = 0 ; g < aDisplay.Roster().Count() ; g++ )
       
   446         {
       
   447         // first append the bottom one
       
   448         CHuiControlGroup& group = aDisplay.Roster().ControlGroup( g );
       
   449         
       
   450         // make sure we only store control groups for this session
       
   451         if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
       
   452             {
       
   453             iControlGroupOrder.AppendL( &group );
       
   454             }
       
   455         }
       
   456 #endif
       
   457     // put this session's controlgroups on top
   440     while ( iControlGroupOrder.Count() )
   458     while ( iControlGroupOrder.Count() )
   441         {
   459         {
   442         CHuiControlGroup& group = *iControlGroupOrder[iControlGroupOrder.Count()-1];
   460         CHuiControlGroup& group = *iControlGroupOrder[iControlGroupOrder.Count()-1];
   443         
   461         
   444         // make sure that the group still exists.
   462         // make sure that the group still exists.
   445         if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
   463         if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
   446             {
   464             {
   447             CHuiLayout* hostContainer = group.Control(0).ContainerLayout( NULL );
   465             CHuiLayout* hostContainer = group.Control(0).ContainerLayout( NULL );
   448             hostContainer->iOpacity.Set(1.f); 
   466 
   449 #ifdef SYMBIAN_BUILD_GCE
   467 #ifdef SYMBIAN_BUILD_GCE
   450             AlfAppUi()->ShowControlGroupL(aDisplay.Roster(), group, KAlfRosterShowAtBottom, 0); 
   468             
       
   469             AlfAppUi()->ShowControlGroupL(aDisplay.Roster(), group, KHuiRosterShowAtTop, 0); 
       
   470             
   451 #else    
   471 #else    
   452             aDisplay.Roster().ShowL( group, KAlfRosterShowAtBottom );
   472             aDisplay.Roster().ShowL( group, KAlfRosterShowAtBottom );
   453 #endif
   473 #endif
   454             iControlGroupOrder.Remove(iControlGroupOrder.Count()-1);
   474             iControlGroupOrder.Remove(iControlGroupOrder.Count()-1);
   455             }
   475             }
   662             
   682             
   663             // Show only if session is focused, otherwise delay until focus is gained
   683             // Show only if session is focused, otherwise delay until focus is gained
   664             if (iFocused)
   684             if (iFocused)
   665                 {
   685                 {
   666 #ifdef SYMBIAN_BUILD_GCE
   686 #ifdef SYMBIAN_BUILD_GCE
   667                 AlfAppUi()->ShowControlGroupL(display.Roster(), controlGroup, where, 0); 
   687                 CHuiLayout* hostContainer = controlGroup.Control(0).ContainerLayout( NULL );                
       
   688                 if(hostContainer)
       
   689                     hostContainer->ClearFlags( EHuiVisualFlagUnderOpaqueHint);
       
   690                 AlfAppUi()->ShowControlGroupL(display.Roster(), controlGroup, where, 0);
   668 #else    
   691 #else    
   669                 display.Roster().ShowL(controlGroup, where);                                    
   692                 display.Roster().ShowL(controlGroup, where);                                    
   670 #endif
   693 #endif
   671                 AlfServer()->AdjustWindowGroupPositionL( 
   694                 AlfServer()->AdjustWindowGroupPositionL( 
   672                     *CHuiStatic::RootWin(), 
   695                     *CHuiStatic::RootWin(), 
   673                     ClientWindowGroup(), 
   696                     ClientWindowGroup(), 
   674                     PreferredWindowGroupPosition()  );
   697                     PreferredWindowGroupPosition()  );
   675 
       
   676                 }
   698                 }
   677             else
   699             else
   678                 {                
   700                 {
       
   701 #ifdef SYMBIAN_BUILD_GCE
       
   702             CHuiLayout* hostContainer = controlGroup.Control(0).ContainerLayout( NULL );                
       
   703                 if(hostContainer)
       
   704                     hostContainer->ClearFlags(EHuiVisualFlagUnderOpaqueHint);
       
   705                 AlfAppUi()->ShowControlGroupL(display.Roster(), controlGroup, where, 0);
       
   706 #else                    
       
   707 
   679                 if (where == KHuiRosterShowAtTop)
   708                 if (where == KHuiRosterShowAtTop)
   680                     {
   709                     {
   681                     if (iControlGroupOrder.Count())
   710                     if (iControlGroupOrder.Count())
   682                         {
   711                         {
   683                         iControlGroupOrder.InsertL(&controlGroup, 0);            
   712                         iControlGroupOrder.InsertL(&controlGroup, 0);            
   687                         iControlGroupOrder.AppendL(&controlGroup);                
   716                         iControlGroupOrder.AppendL(&controlGroup);                
   688                         }    
   717                         }    
   689                     }
   718                     }
   690                 else if (where == KHuiRosterShowAtBottom)
   719                 else if (where == KHuiRosterShowAtBottom)
   691                     {
   720                     {
       
   721                 
   692                     iControlGroupOrder.AppendL(&controlGroup);                
   722                     iControlGroupOrder.AppendL(&controlGroup);                
   693                     }
   723                     }
   694                 else
   724                 else
   695                     {
   725                     {
   696                     if (iControlGroupOrder.Count() < where)
   726                     if (iControlGroupOrder.Count() < where)
   699                         }
   729                         }
   700                     else
   730                     else
   701                         {
   731                         {
   702                         iControlGroupOrder.InsertL(&controlGroup, where);                                        
   732                         iControlGroupOrder.InsertL(&controlGroup, where);                                        
   703                         }                                                
   733                         }                                                
   704                     }                                                        
   734                     }
       
   735 #endif                    
   705                 }    
   736                 }    
   706                         
   737                         
   707             break;
   738             break;
   708             }
   739             }
   709             
   740             
  1022         case EAlfForceSwRendering:
  1053         case EAlfForceSwRendering:
  1023             {
  1054             {
  1024             EnvForceSwRendering( aMessage );
  1055             EnvForceSwRendering( aMessage );
  1025             break;    
  1056             break;    
  1026             }
  1057             }
       
  1058         
       
  1059         case EAlfGetSizeAndRotation:
       
  1060             {
       
  1061             EnvGetSizeAndRotation( aMessage );
       
  1062             break;
       
  1063             }
       
  1064             
       
  1065         case EAlfReadPixels:
       
  1066             {
       
  1067             EnvReadPixels( aMessage );
       
  1068             break;
       
  1069             }
       
  1070                         
       
  1071         case EAlfBlankScreen:
       
  1072             {
       
  1073             AlfAppUi()->DoBlankScreen(aMessage);
       
  1074             break;    
       
  1075             }
  1027             
  1076             
  1028             
  1077             
  1029         default:
  1078         default:
  1030             User::Leave( KErrNotSupported );
  1079             User::Leave( KErrNotSupported );
  1031         }
  1080         }
  1185     CHuiDisplay& display = displaySubSession.Display();
  1234     CHuiDisplay& display = displaySubSession.Display();
  1186 
  1235 
  1187     // hide
  1236     // hide
  1188     controlGroupSubSession.SetIsShown( EFalse );
  1237     controlGroupSubSession.SetIsShown( EFalse );
  1189   
  1238   
       
  1239     
       
  1240 #ifdef SYMBIAN_BUILD_GCE
       
  1241     CHuiLayout* hostContainer = controlGroup.Control(0).ContainerLayout( NULL );                
       
  1242     if(hostContainer)
       
  1243         hostContainer->SetFlags(EHuiVisualFlagUnderOpaqueHint);
       
  1244 #else    
  1190     // hide from the roster only if session is focused
  1245     // hide from the roster only if session is focused
  1191     if ( iFocused )
  1246     if ( iFocused )
  1192         {
  1247         {
  1193         display.Roster().Hide(controlGroup);
  1248         display.Roster().Hide(controlGroup);
  1194         }
  1249         }
  1198          if(  index != KErrNotFound)
  1253          if(  index != KErrNotFound)
  1199              {
  1254              {
  1200              iControlGroupOrder.Remove( index );
  1255              iControlGroupOrder.Remove( index );
  1201              }
  1256              }
  1202         }
  1257         }
       
  1258 #endif
  1203     }
  1259     }
  1204     
  1260     
  1205 // ---------------------------------------------------------------------------
  1261 // ---------------------------------------------------------------------------
  1206 // class    :   CHuiRoster
  1262 // class    :   CHuiRoster
  1207 // function :   ShowVisualL
  1263 // function :   ShowVisualL
  2832     TBool enabled = aMessage.Int0();
  2888     TBool enabled = aMessage.Int0();
  2833     TInt err = AlfAppUi()->ForceSwRendering( enabled );
  2889     TInt err = AlfAppUi()->ForceSwRendering( enabled );
  2834     aMessage.Complete( err );
  2890     aMessage.Complete( err );
  2835     }
  2891     }
  2836 
  2892 
       
  2893 // ---------------------------------------------------------------------------
       
  2894 // EnvGetSizeAndRotation
       
  2895 // ---------------------------------------------------------------------------
       
  2896 //    
       
  2897 void CAlfAppSrvSession::EnvGetSizeAndRotation(const RMessage2& aMessage)
       
  2898     {
       
  2899     TPckgBuf<TSize> size;
       
  2900     TPckgBuf<TInt> rotation;
       
  2901     TInt err = AlfAppUi()->GetSizeAndRotation(size(), rotation());
       
  2902     if ( err == KErrNone )
       
  2903         {
       
  2904         aMessage.Write(0, size);
       
  2905         aMessage.Write(1, rotation);
       
  2906         }
       
  2907     aMessage.Complete( err );
       
  2908     }
       
  2909 
       
  2910 // ---------------------------------------------------------------------------
       
  2911 // EnvReadPixels
       
  2912 // ---------------------------------------------------------------------------
       
  2913 //    
       
  2914 void CAlfAppSrvSession::EnvReadPixels(const RMessage2& aMessage)
       
  2915     {
       
  2916     TInt bitmapHandle = aMessage.Int0();
       
  2917     CFbsBitmap* bmp = new CFbsBitmap;
       
  2918     TInt err = KErrNoMemory;
       
  2919 
       
  2920     if ( bmp )
       
  2921         {
       
  2922         err = bmp->Duplicate( bitmapHandle );
       
  2923         if ( err == KErrNone )
       
  2924             {
       
  2925             err = AlfAppUi()->ReadPixels( bmp );
       
  2926             }        
       
  2927         delete bmp;
       
  2928         }
       
  2929     
       
  2930     aMessage.Complete( err );
       
  2931     }
       
  2932 
       
  2933 
  2837 // End of file    
  2934 // End of file