os/graphics/graphicscomposition/openwfsupport/inc/contentupdateproxy.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicscomposition/openwfsupport/inc/contentupdateproxy.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,152 @@
     1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// contentupdateproxy.h
    1.18 +// Proxy object for receiving SUS surface content update notifications and rerouting them to nativestream 
    1.19 +//
    1.20 +#ifndef COMPBACKUPDATEPROXY_H
    1.21 +#define COMPBACKUPDATEPROXY_H
    1.22 +#include <e32cmn.h>
    1.23 +#include <e32base.h>
    1.24 +#include <graphics/compositionsurfaceupdate.h>
    1.25 +#include <graphics/extensioncontainer.h>
    1.26 +class TSurfaceId;
    1.27 +class MRectangle;
    1.28 +class TRegion;
    1.29 +class COpenWfcStreamMap;
    1.30 +class CSurfaceStream;
    1.31 +
    1.32 +#define KContentUpdateProxyVersion 3 
    1.33 +
    1.34 +NONSHARABLE_CLASS(CContentUpdateProxy) : public CExtensionContainer, public MCompositionSurfaceUpdate
    1.35 +	{
    1.36 +public:
    1.37 +	static CExtensionContainer* NewL(TInt aScreenNum, COpenWfcStreamMap*	aSingleton,TInt aInternalVersion,TInt aPriority);
    1.38 +	
    1.39 +
    1.40 +/*-------------------------------------------------------------------*//*!
    1.41 + * \brief   Gets the API version number of the
    1.42 + *          MCompositionSurfaceUpdate implementation.
    1.43 + *
    1.44 + * @return  1 for Oghma conformant implementation,
    1.45 + *          2 for Sphinx.
    1.46 + *          3 for OpenWF-C
    1.47 + *//*-------------------------------------------------------------------*/
    1.48 +
    1.49 +    virtual TInt        ApiVersion          (void) ;
    1.50 +
    1.51 +/*-------------------------------------------------------------------*//*!
    1.52 + * \brief   Gets the internal version number of the
    1.53 + *          MCompositionSurfaceUpdate implementation.
    1.54 + *
    1.55 + * @return  The version number of the MCompositionSurfaceUpdate
    1.56 + *          instance.
    1.57 + *//*-------------------------------------------------------------------*/
    1.58 +
    1.59 +    virtual TVersion    InternalVersion     (void) ;
    1.60 +
    1.61 +
    1.62 +/*-------------------------------------------------------------------*//*!
    1.63 + * \brief   A function that responds to surface content notifications.
    1.64 + *
    1.65 + * When the contents of a surface change, this function gets called
    1.66 + * by a mechanism that is an implementation detail of the graphics
    1.67 + * driver together with the MCompositionSurfaceUpdate implementation. The
    1.68 + * call can originate from different processes and the
    1.69 + * MCompositionSurfaceUpdate together with the surface implementation
    1.70 + * relays the information content of it, through implementation
    1.71 + * specific means, to trigger the actual composition soon after this
    1.72 + * call - this composition call should be synchronized with the
    1.73 + * refresh rate of the screen.
    1.74 + *
    1.75 + * @param   aSurface            The surface that has been updated.
    1.76 + * @param   aBuffer             The buffer of the surface to be used in
    1.77 + *                              composition. Integer starting from 0.
    1.78 + * @param   aRegion             The sub-area that has the updates. If NULL, the
    1.79 + *                              whole surface is considered changed.
    1.80 + * @param   aStatusConsumed     A request status object or NULL. If not NULL, then the
    1.81 + *                              request status is completed once the backend
    1.82 + *                              does not anymore need the contents of the
    1.83 + *                              surface to render the update. This may happen
    1.84 + *                              before actually displaying the finished frame.
    1.85 + * @param   aStatusDisplayed    This is signaled after the composited frame
    1.86 + *                              is posted the to display for the first time after
    1.87 + *                              the update. After this the value in
    1.88 + *                              aTimeStamp is valid, if the value in the
    1.89 + *                              status object is KErrNone. Can be NULL, if
    1.90 + *                              no signal is desired.
    1.91 + * @param   aTimeStamp          Value of the User::FastCounter() right after the
    1.92 + *                              display refresh that signaled aStatusDisplayed.
    1.93 + * @param   aStatusDispXTimes   This is signaled when the surface has been on
    1.94 + *                              the screen for aDisplayedXTimes refreshes,
    1.95 + *                              including the update that signaled aStatusDisplayed.
    1.96 + *                              Can be NULL, if no signal is wanted.
    1.97 + * @param   aDisplayedXTimes    The number of refreshes after which aStatusDispXTimes
    1.98 + *                              is signaled or NULL. If values is provided, it must be
    1.99 + *                              >= 1.
   1.100 + *
   1.101 + * @pre     The MCompositionSurfaceUpdate implementation is waiting for content
   1.102 + *          update notifications.
   1.103 + * @pre     aSurface.IsNull() returns EFalse.
   1.104 + * @pre     The surface aSurface is registered with the backend or all status
   1.105 + *          requests are completed with KErrArgument.
   1.106 + * @pre     Either both aStatusDisplayed and aTimeStamp are NULL or neither
   1.107 + *          of them are.
   1.108 + * @pre     Either both aStatusDispXTimes and aDisplayedXTimes are NULL or
   1.109 + *          neither of them are.
   1.110 + * @post    The MCompositionSurfaceUpdate is waiting for vsync or another
   1.111 + *          synchronisation method to trigger composition,
   1.112 + *          depending on cached visibility information.
   1.113 + * @note    The updated region is used only as an optimisation hint.
   1.114 + *          the current contents of the surface are always used for
   1.115 + *          composition independent of the aRegion.
   1.116 + * @see     Surface Update API Specification [R6] for further details
   1.117 + *          about the semantics of the parameters and return values
   1.118 + *          of the TRequestStatus objects.
   1.119 + *//*-------------------------------------------------------------------*/
   1.120 +
   1.121 +    virtual void        ContentUpdated      (const TSurfaceId&  aSurface,
   1.122 +                                             TInt               aBuffer,
   1.123 +                                             const TRegion*     aRegion,
   1.124 +                                             TRequestStatus*    aStatusConsumed,
   1.125 +                                             TRequestStatus*    aStatusDisplayed,
   1.126 +                                             TUint32*           aTimeStamp,
   1.127 +                                             TRequestStatus*    aStatusDispXTimes,
   1.128 +                                             TInt*              aDisplayedXTimes) ;
   1.129 +
   1.130 +    
   1.131 +public:
   1.132 +    void RegisterNotifications(CSurfaceStream& aNs,
   1.133 +                               TInt            aBuffer,
   1.134 +                               TRequestStatus* aStatusDisplayed, TUint32* aTimeStamp,
   1.135 +                               TRequestStatus* aStatusDispXTimes, TInt* aDisplayedXTimes,
   1.136 +                               TRequestStatus* aStatusConsumed, const TRegion* aRegion);   
   1.137 +    
   1.138 +private:	//methods
   1.139 +	void ConstructL(TInt aScreenNum, COpenWfcStreamMap*	aSingleton,TInt aInternalVersio,TInt aPriority);
   1.140 +	CContentUpdateProxy();
   1.141 +	~CContentUpdateProxy();
   1.142 +	void CompleteStatus(TRequestStatus* aStatusConsumed,TRequestStatus* aStatusDisplayed,
   1.143 +	        TRequestStatus* aStatusDispXTimes,TInt aReason);
   1.144 +	virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
   1.145 +
   1.146 +private:	//data
   1.147 +	TInt				iScreenNum;
   1.148 +	TInt				iInternalVersion;
   1.149 +	TInt				iPriority;
   1.150 +	COpenWfcStreamMap*	iSingleton;
   1.151 +	RHeap&              iHeap;
   1.152 +	};
   1.153 +
   1.154 +
   1.155 +#endif /*COMPBACKUPDATEPROXY_*/