uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp
branchRCL_3
changeset 10 88b23e2e82e1
parent 8 10534483575f
child 11 46927d61fef3
equal deleted inserted replaced
8:10534483575f 10:88b23e2e82e1
   159 
   159 
   160 // ---------------------------------------------------------------------------
   160 // ---------------------------------------------------------------------------
   161 // NewSessionL
   161 // NewSessionL
   162 // ---------------------------------------------------------------------------
   162 // ---------------------------------------------------------------------------
   163 //   
   163 //   
   164 CSession2* CAlfStreamerServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& /*aMessage*/) const
   164 CSession2* CAlfStreamerServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& aMessage) const
   165     {
   165     {
   166 	CSession2* newSession = new(ELeave) CAlfStreamerServerSession();
   166     RThread t;    
       
   167     aMessage.Client(t);
       
   168     CleanupClosePushL(t);
       
   169 	CSession2* newSession = new(ELeave) CAlfStreamerServerSession(t.Id());
       
   170     CleanupStack::PopAndDestroy();
   167     iSessions++;
   171     iSessions++;
   168     
   172     
   169     return newSession;   
   173     return newSession;   
   170     }
   174     }
   171 
   175 
   186 
   190 
   187 // ---------------------------------------------------------------------------
   191 // ---------------------------------------------------------------------------
   188 // HandleClientExit
   192 // HandleClientExit
   189 // ---------------------------------------------------------------------------
   193 // ---------------------------------------------------------------------------
   190 //   
   194 //   
   191 void CAlfStreamerServer::HandleClientExit(const CSession2* /*aClient*/)
   195 void CAlfStreamerServer::HandleClientExit(const CAlfStreamerServerSession* aClient)
   192     {
   196     {
   193     iSessions--;
   197     iSessions--;
       
   198     if (WindowMgr())
       
   199         {
       
   200         WindowMgr()->HandleClientExit(aClient->ThreadId());
       
   201         }
   194     if (!iSessions)
   202     if (!iSessions)
   195         {
   203         {
   196         // CActiveScheduler::Stop(); // TODO: lets not die, if client dies.
   204         // CActiveScheduler::Stop(); // TODO: lets not die, if client dies.
   197         }
   205         }
   198     }
   206     }
   537         aMessage.Complete(KErrNone);
   545         aMessage.Complete(KErrNone);
   538         return;
   546         return;
   539         }
   547         }
   540     
   548     
   541     if ( aOp == KAlfCompositionLowOnGraphicsMemory ||  aOp == KAlfCompositionGoodOnGraphicsMemory 
   549     if ( aOp == KAlfCompositionLowOnGraphicsMemory ||  aOp == KAlfCompositionGoodOnGraphicsMemory 
   542 		|| aOp == KAlfCompositionTargetHidden ||aOp == KAlfCompositionTargetVisible)
   550 		|| aOp == KAlfCompositionTargetHidden ||aOp == KAlfCompositionTargetVisible  || aOp == KAlfCompositionLayoutSwitchComplete)
   543         {
   551         {
   544         aMessage.Complete(KErrNone);
   552         aMessage.Complete(KErrNone);
   545         QueueRequestAllSessionsL(KNullDesC8(), aOp, ETrue);    
   553         QueueRequestAllSessionsL(KNullDesC8(), aOp, ETrue);    
   546         return;
   554         return;
   547         }        
   555         }        
   686 
   694 
   687 // ---------------------------------------------------------------------------
   695 // ---------------------------------------------------------------------------
   688 // constructor
   696 // constructor
   689 // ---------------------------------------------------------------------------
   697 // ---------------------------------------------------------------------------
   690 //   
   698 //   
   691 CAlfStreamerServerSession::CAlfStreamerServerSession() : iScreenNumber(KErrNotFound)
   699 CAlfStreamerServerSession::CAlfStreamerServerSession(const TThreadId& aThreadId) : iScreenNumber(KErrNotFound), iThreadId(aThreadId)
   692     {
   700     {
   693     }
   701     }
   694 
   702 
   695 // ---------------------------------------------------------------------------
   703 // ---------------------------------------------------------------------------
   696 // destructor of CAlfStreamerServerSession
   704 // destructor of CAlfStreamerServerSession
   966     case KAlfCompositionLowOnGraphicsMemory:
   974     case KAlfCompositionLowOnGraphicsMemory:
   967     case KAlfCompositionGoodOnGraphicsMemory:    
   975     case KAlfCompositionGoodOnGraphicsMemory:    
   968     case KAlfCompositionTargetHidden:
   976     case KAlfCompositionTargetHidden:
   969     case KAlfCompositionTargetVisible:
   977     case KAlfCompositionTargetVisible:
   970     case KAlfCompositionTargetCreated:
   978     case KAlfCompositionTargetCreated:
       
   979     case KAlfCompositionLayoutSwitchComplete:
   971         {
   980         {
   972         aServer->HandleCompositionEventL(this, aOp, aMessage);
   981         aServer->HandleCompositionEventL(this, aOp, aMessage);
   973         break;
   982         break;
   974         }
   983         }
   975 
   984