graphicscomposition/openwfsupport/inc/contentupdateproxy.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // contentupdateproxy.h
       
    15 // Proxy object for receiving SUS surface content update notifications and rerouting them to nativestream 
       
    16 //
       
    17 #ifndef COMPBACKUPDATEPROXY_H
       
    18 #define COMPBACKUPDATEPROXY_H
       
    19 #include <e32cmn.h>
       
    20 #include <e32base.h>
       
    21 #include <graphics/compositionsurfaceupdate.h>
       
    22 #include <graphics/extensioncontainer.h>
       
    23 class TSurfaceId;
       
    24 class MRectangle;
       
    25 class TRegion;
       
    26 class COpenWfcStreamMap;
       
    27 class CSurfaceStream;
       
    28 
       
    29 #define KContentUpdateProxyVersion 3 
       
    30 
       
    31 NONSHARABLE_CLASS(CContentUpdateProxy) : public CExtensionContainer, public MCompositionSurfaceUpdate
       
    32 	{
       
    33 public:
       
    34 	static CExtensionContainer* NewL(TInt aScreenNum, COpenWfcStreamMap*	aSingleton,TInt aInternalVersion,TInt aPriority);
       
    35 	
       
    36 
       
    37 /*-------------------------------------------------------------------*//*!
       
    38  * \brief   Gets the API version number of the
       
    39  *          MCompositionSurfaceUpdate implementation.
       
    40  *
       
    41  * @return  1 for Oghma conformant implementation,
       
    42  *          2 for Sphinx.
       
    43  *          3 for OpenWF-C
       
    44  *//*-------------------------------------------------------------------*/
       
    45 
       
    46     virtual TInt        ApiVersion          (void) ;
       
    47 
       
    48 /*-------------------------------------------------------------------*//*!
       
    49  * \brief   Gets the internal version number of the
       
    50  *          MCompositionSurfaceUpdate implementation.
       
    51  *
       
    52  * @return  The version number of the MCompositionSurfaceUpdate
       
    53  *          instance.
       
    54  *//*-------------------------------------------------------------------*/
       
    55 
       
    56     virtual TVersion    InternalVersion     (void) ;
       
    57 
       
    58 
       
    59 /*-------------------------------------------------------------------*//*!
       
    60  * \brief   A function that responds to surface content notifications.
       
    61  *
       
    62  * When the contents of a surface change, this function gets called
       
    63  * by a mechanism that is an implementation detail of the graphics
       
    64  * driver together with the MCompositionSurfaceUpdate implementation. The
       
    65  * call can originate from different processes and the
       
    66  * MCompositionSurfaceUpdate together with the surface implementation
       
    67  * relays the information content of it, through implementation
       
    68  * specific means, to trigger the actual composition soon after this
       
    69  * call - this composition call should be synchronized with the
       
    70  * refresh rate of the screen.
       
    71  *
       
    72  * @param   aSurface            The surface that has been updated.
       
    73  * @param   aBuffer             The buffer of the surface to be used in
       
    74  *                              composition. Integer starting from 0.
       
    75  * @param   aRegion             The sub-area that has the updates. If NULL, the
       
    76  *                              whole surface is considered changed.
       
    77  * @param   aStatusConsumed     A request status object or NULL. If not NULL, then the
       
    78  *                              request status is completed once the backend
       
    79  *                              does not anymore need the contents of the
       
    80  *                              surface to render the update. This may happen
       
    81  *                              before actually displaying the finished frame.
       
    82  * @param   aStatusDisplayed    This is signaled after the composited frame
       
    83  *                              is posted the to display for the first time after
       
    84  *                              the update. After this the value in
       
    85  *                              aTimeStamp is valid, if the value in the
       
    86  *                              status object is KErrNone. Can be NULL, if
       
    87  *                              no signal is desired.
       
    88  * @param   aTimeStamp          Value of the User::FastCounter() right after the
       
    89  *                              display refresh that signaled aStatusDisplayed.
       
    90  * @param   aStatusDispXTimes   This is signaled when the surface has been on
       
    91  *                              the screen for aDisplayedXTimes refreshes,
       
    92  *                              including the update that signaled aStatusDisplayed.
       
    93  *                              Can be NULL, if no signal is wanted.
       
    94  * @param   aDisplayedXTimes    The number of refreshes after which aStatusDispXTimes
       
    95  *                              is signaled or NULL. If values is provided, it must be
       
    96  *                              >= 1.
       
    97  *
       
    98  * @pre     The MCompositionSurfaceUpdate implementation is waiting for content
       
    99  *          update notifications.
       
   100  * @pre     aSurface.IsNull() returns EFalse.
       
   101  * @pre     The surface aSurface is registered with the backend or all status
       
   102  *          requests are completed with KErrArgument.
       
   103  * @pre     Either both aStatusDisplayed and aTimeStamp are NULL or neither
       
   104  *          of them are.
       
   105  * @pre     Either both aStatusDispXTimes and aDisplayedXTimes are NULL or
       
   106  *          neither of them are.
       
   107  * @post    The MCompositionSurfaceUpdate is waiting for vsync or another
       
   108  *          synchronisation method to trigger composition,
       
   109  *          depending on cached visibility information.
       
   110  * @note    The updated region is used only as an optimisation hint.
       
   111  *          the current contents of the surface are always used for
       
   112  *          composition independent of the aRegion.
       
   113  * @see     Surface Update API Specification [R6] for further details
       
   114  *          about the semantics of the parameters and return values
       
   115  *          of the TRequestStatus objects.
       
   116  *//*-------------------------------------------------------------------*/
       
   117 
       
   118     virtual void        ContentUpdated      (const TSurfaceId&  aSurface,
       
   119                                              TInt               aBuffer,
       
   120                                              const TRegion*     aRegion,
       
   121                                              TRequestStatus*    aStatusConsumed,
       
   122                                              TRequestStatus*    aStatusDisplayed,
       
   123                                              TUint32*           aTimeStamp,
       
   124                                              TRequestStatus*    aStatusDispXTimes,
       
   125                                              TInt*              aDisplayedXTimes) ;
       
   126 
       
   127     
       
   128 public:
       
   129     void RegisterNotifications(CSurfaceStream& aNs,
       
   130                                TInt            aBuffer,
       
   131                                TRequestStatus* aStatusDisplayed, TUint32* aTimeStamp,
       
   132                                TRequestStatus* aStatusDispXTimes, TInt* aDisplayedXTimes,
       
   133                                TRequestStatus* aStatusConsumed, const TRegion* aRegion);   
       
   134     
       
   135 private:	//methods
       
   136 	void ConstructL(TInt aScreenNum, COpenWfcStreamMap*	aSingleton,TInt aInternalVersio,TInt aPriority);
       
   137 	CContentUpdateProxy();
       
   138 	~CContentUpdateProxy();
       
   139 	void CompleteStatus(TRequestStatus* aStatusConsumed,TRequestStatus* aStatusDisplayed,
       
   140 	        TRequestStatus* aStatusDispXTimes,TInt aReason);
       
   141 	virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
       
   142 
       
   143 private:	//data
       
   144 	TInt				iScreenNum;
       
   145 	TInt				iInternalVersion;
       
   146 	TInt				iPriority;
       
   147 	COpenWfcStreamMap*	iSingleton;
       
   148 	RHeap&              iHeap;
       
   149 	};
       
   150 
       
   151 
       
   152 #endif /*COMPBACKUPDATEPROXY_*/