williamr@2: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __CDSB_H__ williamr@2: #define __CDSB_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: Direct Screen Bitmap. williamr@2: API to allow provide synchronisation of the display of images with the williamr@2: displays refresh to prevent tearing. williamr@2: williamr@2: This is an abstract base class, so must be derived from on a per-variant basis. williamr@2: williamr@2: @internalComponent williamr@2: */ williamr@2: class CDirectScreenBitmap : public CBase williamr@2: { williamr@2: public: williamr@2: enum TSettingsFlags williamr@2: { williamr@2: ENone = 0, williamr@2: EDoubleBuffer = 1, williamr@2: EIncrementalUpdate = 2 williamr@2: }; williamr@2: williamr@2: public: williamr@2: /** williamr@2: Constructs a CDirectScreenBitmap derived object. williamr@2: The default screen (with number 0) will be used. williamr@2: @return A pointer to the created CDirectScreenBitmap object williamr@2: @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object williamr@2: */ williamr@2: IMPORT_C static CDirectScreenBitmap* NewL(); williamr@2: williamr@2: /** williamr@2: Constructs a CDirectScreenBitmap derived object. williamr@2: @param aScreenNo Screen number, used by the CDirectScreenBitmap object. williamr@2: @return A pointer to the created CDirectScreenBitmap object williamr@2: @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object williamr@2: */ williamr@2: IMPORT_C static CDirectScreenBitmap* NewL(TInt aScreenNo); williamr@2: williamr@2: /** williamr@2: Creates a CDirectScreenBitmap object which can be used for drawing to williamr@2: a region of the screen indicated by aScreenRect. This region must have williamr@2: previously been 'claimed' via the Window Servers Direct Screen Access API. williamr@2: williamr@2: @param aScreenRect The region to be displayed williamr@2: @param aSettingsFlags The mode of operation. The upper 3 bits are used williamr@2: for the screen number value: 0..7. By default the screen williamr@2: with number 0 will be used. williamr@2: @return KErrNone if successful williamr@2: KErrNoMemory if there was insufficient memory williamr@2: KErrNotSupported if the creation failed for other reasons williamr@2: */ williamr@2: virtual TInt Create(const TRect& aScreenRect, TSettingsFlags aSettingsFlags) =0; williamr@2: williamr@2: /** williamr@2: Returns a TAcceleratedBitmapInfo referring to a bitmap which the williamr@2: applicationcan render to. williamr@2: williamr@2: @param aBitmapInfo The Bitmap williamr@2: @return KErrNone if successful, another error code otherwise williamr@2: */ williamr@2: virtual TInt BeginUpdate(TAcceleratedBitmapInfo& aBitmapInfo) =0; williamr@2: williamr@2: /** williamr@2: Indicates to the Video Driver that the bitmap corresponding to the williamr@2: update has been fully rendered. The video driver will perform williamr@2: the actions required to copy this to the frame buffer. williamr@2: williamr@2: The request status aComplete will be signalled when the copying has completed. williamr@2: williamr@2: @param aComplete Asynchronous completion status williamr@2: */ williamr@2: virtual void EndUpdate(TRequestStatus& aComplete) =0; williamr@2: williamr@2: /** williamr@2: Indicates to the Video Driver that the area indicated in aScreenRect has williamr@2: been fully rendered. The video driver will perform the actions required williamr@2: to copy this to the frame buffer. williamr@2: williamr@2: The request status aComplete will be signalled when the copying has completed. williamr@2: williamr@2: Note: aScreenRects coordinates are relative to the screen, not the update region specified williamr@2: in Create(). aScreenRect must fit entirely within the bounds of the original region passed williamr@2: to Create(). williamr@2: williamr@2: @param aScreenRect The region to update williamr@2: @param aComplete Asynchronous completion status williamr@2: */ williamr@2: virtual void EndUpdate(const TRect& aScreenRect, TRequestStatus& aComplete) =0; williamr@2: williamr@2: /** williamr@2: Deletes all resources associated with the CDirectScreenBitmap object. williamr@2: */ williamr@2: virtual void Close() =0; williamr@2: }; williamr@2: williamr@2: #endif