graphicsdeviceinterface/screendriver/inc/cdsb.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 1996-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 //
       
    15 
       
    16 #ifndef __CDSB_H__
       
    17 #define __CDSB_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <bitdev.h>
       
    21 
       
    22 /**
       
    23 Direct Screen Bitmap.
       
    24 API to allow provide synchronisation of the display of images with the
       
    25 displays refresh to prevent tearing.
       
    26  
       
    27 This is an abstract base class, so must be derived from on a per-variant basis.
       
    28 
       
    29 @publishedPartner
       
    30 @released
       
    31 
       
    32 Note: this class is likely to be deprecated in the future
       
    33 */ 
       
    34 class CDirectScreenBitmap : public CBase
       
    35 	{
       
    36 public:
       
    37 	enum TSettingsFlags
       
    38 		{
       
    39 		ENone = 0,
       
    40 		EDoubleBuffer = 1,
       
    41 		EIncrementalUpdate = 2
       
    42 		};
       
    43 
       
    44 public:
       
    45 	/**
       
    46 	Constructs a CDirectScreenBitmap derived object.
       
    47     The default screen (with number 0) will be used.
       
    48     @return A pointer to the created CDirectScreenBitmap object
       
    49     @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
       
    50 	*/
       
    51 	IMPORT_C static CDirectScreenBitmap* NewL();	
       
    52 
       
    53 	/**
       
    54 	Constructs a CDirectScreenBitmap derived object.
       
    55 	@param aScreenNo Screen number, used by the CDirectScreenBitmap object.
       
    56     @return A pointer to the created CDirectScreenBitmap object
       
    57     @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object
       
    58 	*/
       
    59 	IMPORT_C static CDirectScreenBitmap* NewL(TInt aScreenNo);	
       
    60 
       
    61     /**
       
    62 	Creates a CDirectScreenBitmap object which can be used for drawing to
       
    63 	a region of the screen indicated by aScreenRect.  This region must have
       
    64 	previously been 'claimed' via the Window Servers Direct Screen Access API.
       
    65 
       
    66 	@param aScreenRect The region to be displayed
       
    67 	@param aSettingsFlags The mode of operation. The upper 3 bits are used 
       
    68                           for the screen number value: 0..7.  By default the screen 
       
    69                           with  number 0 will be used.
       
    70 	@return KErrNone if successful
       
    71 	        KErrNoMemory if there was insufficient memory
       
    72 	        KErrNotSupported if the creation failed for other reasons
       
    73 	*/
       
    74 	virtual TInt Create(const TRect& aScreenRect, TSettingsFlags aSettingsFlags) =0;
       
    75 
       
    76 	/**
       
    77 	Returns a TAcceleratedBitmapInfo referring to a bitmap which the
       
    78 	applicationcan render to.
       
    79 
       
    80 	@param aBitmapInfo The Bitmap
       
    81 	@return KErrNone if successful, another error code otherwise
       
    82 	*/
       
    83 	virtual TInt BeginUpdate(TAcceleratedBitmapInfo& aBitmapInfo) =0;
       
    84 
       
    85 	/**
       
    86 	Indicates to the Video Driver that the bitmap corresponding to the
       
    87 	update has been fully rendered.  The video driver will perform
       
    88 	the actions required to copy this to the frame buffer.
       
    89 
       
    90 	The request status aComplete will be signalled when the copying has completed.
       
    91 	
       
    92 	@param aComplete Asynchronous completion status
       
    93 	*/
       
    94 	virtual void EndUpdate(TRequestStatus& aComplete) =0;
       
    95 
       
    96 	/**
       
    97 	Indicates to the Video Driver that the area indicated in aScreenRect has
       
    98 	been fully rendered.  The video driver will perform the actions required 
       
    99 	to copy this to the frame buffer.
       
   100 	
       
   101 	The request status aComplete will be signalled when the copying has completed.
       
   102 	
       
   103 	Note: aScreenRects coordinates are relative to the screen, not the update region specified
       
   104 	in Create().  aScreenRect must fit entirely within the bounds of the original region passed
       
   105 	to Create().
       
   106 
       
   107 	@param aScreenRect The region to update
       
   108 	@param aComplete Asynchronous completion status
       
   109 	*/
       
   110 	virtual void EndUpdate(const TRect& aScreenRect, TRequestStatus& aComplete) =0;
       
   111 
       
   112 	/**
       
   113 	Deletes all resources associated with the CDirectScreenBitmap object.
       
   114 	*/
       
   115 	virtual void Close() =0;
       
   116 	};
       
   117 
       
   118 #endif