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