uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h
changeset 14 83d2d132aa58
parent 0 15bf7259bb7c
child 19 f5bac0badc7e
--- a/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h	Fri Mar 19 09:43:21 2010 +0200
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h	Fri Apr 16 15:56:24 2010 +0300
@@ -35,7 +35,7 @@
     static TInt LaunchServer(TThreadId& aThreadId, CAlfStreamerBridge* aBridge );
     static void NewLC(CAlfStreamerBridge* aBridge);
 	~CAlfStreamerServer();
-    void HandleClientExit(const CSession2* aClient);
+    void HandleClientExit(const CAlfStreamerServerSession* aClient);
     CAlfWindowManager* WindowMgr() 
         {
         return iWindowMgr;
@@ -62,6 +62,18 @@
     void ValidateToken(CAlfStreamerServerSession* aSession, const RMessage2& aMessage);
 
     void FreeCompositionSessionExtents(CAlfStreamerServerSession* aSession);
+
+    // ALF use
+    void CreatePermissionTokenL(TInt aAlfToken, TInt aWindowHandle, TInt aWindowGroup);
+    void ReleasePermissionTokenL(TInt aAlfToken);
+    void QueueRequestSessionsL(TInt aAlfToken, const TPtrC8& aPtr, TInt aOp);  
+    void HandleCompositionRequestL(CAlfStreamerServerSession* aSession, TInt aOp, TPtr8& aClientBuf);
+
+    void RemoveTargetFromInactiveSurfaces(TInt aTarget);
+    void AddTargetFromInactiveSurfaces(TInt aTarget);
+    void GetListOfWGsHavingInactiveSurfacesL(const RMessage2& aMessage, TBool aActiveAlso = ETrue);
+    void QueueRequestBGAnimSessionsL(const TPtrC8& aPtr, TInt aOp);
+    
     
 private:
     void ConstructL();
@@ -73,6 +85,10 @@
 
     CAlfStreamerServerSession* WservSession(TInt aScreenNumber);
     
+    TInt SearchCommonEntryForToken(const RMessage2& aMessage);
+    CAlfStreamerServerSession* SearchSessionForToken(TInt aToken);
+    
+    
 private:
     CAlfStreamerBridge* iBridge; // not owned
     mutable TUint iSessions;
@@ -84,15 +100,15 @@
     RPointerArray<CAlfStreamerServerSession> iCompositionHostSessions;
     RPointerArray<CAlfStreamerServerSession> iWindowServerSessions;
     
-    class CCompositionToken : public CBase
-    {   
-    public:
+    class TCompositionToken
+        {   
+        public:
         
         /*
          * CCompositionToken is used by CAlfCompositionSource and CAlfCompositionHost
          * for maintaining layer sharing permissions.
          */
-        CCompositionToken( TInt aKey, TInt aSecretKey, TInt aFlags, TInt aTarget, TInt aScreenNumber, TBool aCombinedTarget = EFalse) : 
+        TCompositionToken( TInt aKey, TInt aSecretKey, TInt aFlags, TInt aTarget, TInt aScreenNumber, TBool aCombinedTarget = EFalse) : 
             iKey(aKey),
             iSecretKey(aSecretKey), 
             iFlags(aFlags),
@@ -106,16 +122,31 @@
             TInt iTarget;
             TInt iScreenNumber;
             TBool iCombinedTarget;
+            TInt iAlfKey;
+            
     };
     
-    RArray<CCompositionToken> iCompositionTokens;
+    RArray<TCompositionToken> iCompositionTokens;
+
     CAsyncCallBack * iRendezvous;
+
+public:    
+    struct TAlfCompParams
+        {
+        TInt iTarget; 
+        TInt iTarget2;  // padding actually
+        TInt iWindowHandle;
+        TInt iWindowGroup;
+        }; 
+
+    RArray<TAlfCompParams> iAlfTargets;
+    RArray<TAlfCompParams> iInactiveSurfaces;
     };
 
 NONSHARABLE_CLASS(CAlfStreamerServerSession): public CSession2
     {
 public:
-    CAlfStreamerServerSession();
+    CAlfStreamerServerSession(const TThreadId& aThreadId);
     ~CAlfStreamerServerSession();
     void ServiceL(const RMessage2& aMessage);
     void HandleCompositionOpL(TInt aOp, const RMessage2& aMessage, CAlfStreamerServer* aServer);
@@ -129,6 +160,12 @@
     void SetScreenNumber(TInt aScreennumber);
     TInt ScreenNumber() const;
     TSurfaceId& ExtentSurfaceId();
+    TInt& AlfToken(){ return iAlfToken; }
+    TBool IsBgAnimSession(){return iIsBgAnimSession;}
+    TThreadId ThreadId() const
+		{
+		return iThreadId;
+		} 
     
 private:
     RArray<TInt> iLoadedPlugins;
@@ -143,7 +180,10 @@
     
     // Surface id of the composition client. If composition client has set extent to some other screen than where its actual window is. 
     // This is used to identify layers created for this composition client 
-    TSurfaceId iExtentSurfaceId;  
+    TSurfaceId iExtentSurfaceId;
+    TInt iAlfToken;
+    TBool iIsBgAnimSession;
+    TThreadId iThreadId;
     };
 
 #endif