epoc32/include/cdsb.h
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/cdsb.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,115 @@
     1.4 +// Copyright (c) 1996-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +//
    1.18 +
    1.19 +#ifndef __CDSB_H__
    1.20 +#define __CDSB_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include <bitdev.h>
    1.24 +
    1.25 +/**
    1.26 +Direct Screen Bitmap.
    1.27 +API to allow provide synchronisation of the display of images with the
    1.28 +displays refresh to prevent tearing.
    1.29 + 
    1.30 +This is an abstract base class, so must be derived from on a per-variant basis.
    1.31 +
    1.32 +@internalComponent
    1.33 +*/ 
    1.34 +class CDirectScreenBitmap : public CBase
    1.35 +	{
    1.36 +public:
    1.37 +	enum TSettingsFlags
    1.38 +		{
    1.39 +		ENone = 0,
    1.40 +		EDoubleBuffer = 1,
    1.41 +		EIncrementalUpdate = 2
    1.42 +		};
    1.43 +
    1.44 +public:
    1.45 +	/**
    1.46 +	Constructs a CDirectScreenBitmap derived object.
    1.47 +    The default screen (with number 0) will be used.
    1.48 +    @return A pointer to the created CDirectScreenBitmap object
    1.49 +    @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
    1.50 +	*/
    1.51 +	IMPORT_C static CDirectScreenBitmap* NewL();	
    1.52 +
    1.53 +	/**
    1.54 +	Constructs a CDirectScreenBitmap derived object.
    1.55 +	@param aScreenNo Screen number, used by the CDirectScreenBitmap object.
    1.56 +    @return A pointer to the created CDirectScreenBitmap object
    1.57 +    @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
    1.58 +	*/
    1.59 +	IMPORT_C static CDirectScreenBitmap* NewL(TInt aScreenNo);	
    1.60 +
    1.61 +    /**
    1.62 +	Creates a CDirectScreenBitmap object which can be used for drawing to
    1.63 +	a region of the screen indicated by aScreenRect.  This region must have
    1.64 +	previously been 'claimed' via the Window Servers Direct Screen Access API.
    1.65 +
    1.66 +	@param aScreenRect The region to be displayed
    1.67 +	@param aSettingsFlags The mode of operation. The upper 3 bits are used 
    1.68 +                          for the screen number value: 0..7.  By default the screen 
    1.69 +                          with  number 0 will be used.
    1.70 +	@return KErrNone if successful
    1.71 +	        KErrNoMemory if there was insufficient memory
    1.72 +	        KErrNotSupported if the creation failed for other reasons
    1.73 +	*/
    1.74 +	virtual TInt Create(const TRect& aScreenRect, TSettingsFlags aSettingsFlags) =0;
    1.75 +
    1.76 +	/**
    1.77 +	Returns a TAcceleratedBitmapInfo referring to a bitmap which the
    1.78 +	applicationcan render to.
    1.79 +
    1.80 +	@param aBitmapInfo The Bitmap
    1.81 +	@return KErrNone if successful, another error code otherwise
    1.82 +	*/
    1.83 +	virtual TInt BeginUpdate(TAcceleratedBitmapInfo& aBitmapInfo) =0;
    1.84 +
    1.85 +	/**
    1.86 +	Indicates to the Video Driver that the bitmap corresponding to the
    1.87 +	update has been fully rendered.  The video driver will perform
    1.88 +	the actions required to copy this to the frame buffer.
    1.89 +
    1.90 +	The request status aComplete will be signalled when the copying has completed.
    1.91 +	
    1.92 +	@param aComplete Asynchronous completion status
    1.93 +	*/
    1.94 +	virtual void EndUpdate(TRequestStatus& aComplete) =0;
    1.95 +
    1.96 +	/**
    1.97 +	Indicates to the Video Driver that the area indicated in aScreenRect has
    1.98 +	been fully rendered.  The video driver will perform the actions required 
    1.99 +	to copy this to the frame buffer.
   1.100 +	
   1.101 +	The request status aComplete will be signalled when the copying has completed.
   1.102 +	
   1.103 +	Note: aScreenRects coordinates are relative to the screen, not the update region specified
   1.104 +	in Create().  aScreenRect must fit entirely within the bounds of the original region passed
   1.105 +	to Create().
   1.106 +
   1.107 +	@param aScreenRect The region to update
   1.108 +	@param aComplete Asynchronous completion status
   1.109 +	*/
   1.110 +	virtual void EndUpdate(const TRect& aScreenRect, TRequestStatus& aComplete) =0;
   1.111 +
   1.112 +	/**
   1.113 +	Deletes all resources associated with the CDirectScreenBitmap object.
   1.114 +	*/
   1.115 +	virtual void Close() =0;
   1.116 +	};
   1.117 +
   1.118 +#endif