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