os/graphics/graphicsdeviceinterface/directgdiadaptation/swsrc/swdirectgdidriverimpl.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.
     1 // Copyright (c) 2007-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 // Declaration of a Direct Graphics Device Interface (GDI) software implementation,
    15 // this class actually implements the HAI.
    16 // 
    17 //
    18 
    19 #ifndef __SWDIRECTGDIDRIVERIMPL_H__
    20 #define __SWDIRECTGDIDRIVERIMPL_H__
    21 
    22 /**
    23 @file
    24 @internalComponent
    25 */
    26 
    27 #include "swdirectgdiengine.h"
    28 #include <gdi.h>
    29 #include <pixelformats.h>
    30 #include <graphics/directgdidriverinternal.h>
    31 
    32 class CFbsDrawDevice;
    33 class CSwDirectGdiImageTargetImpl;
    34 class CSwDirectGdiImageSourceImpl;
    35 
    36 /**
    37 This class represents the body part of CDirectGdiDriver that actually implements
    38 the HAI. It derives from the CDirectGdiDriverInternal class and implements all the 
    39 interfaces to provide the functionality required by the generic layer.
    40 */
    41 NONSHARABLE_CLASS(CSwDirectGdiDriverImpl): public CDirectGdiDriverInternal
    42 	{
    43 public:		
    44 	virtual ~CSwDirectGdiDriverImpl();
    45 	
    46 	// From CDirectGdiDriverInternal
    47 	void Flush() ;
    48 	void Finish() ;
    49 	TInt GetError();
    50 	void SetError(TInt aErr);
    51 	TInt CreateDrawableSource(TInt& aHandleRet, const RSgDrawable& aSgDrawable);
    52 	void CloseDrawableSource(TInt& aHandle);
    53 	TInt CreateImageTarget(TInt& aHandleRet, const RSgImage& aRSgImage);
    54 	void CloseImageTarget(TInt& aHandle);
    55 	TInt CreateEngine(MDirectGdiEngine*& aMDirectGdiEngine);
    56 	void DestroyEngine(MDirectGdiEngine* aMDirectGdiEngine);
    57 	TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
    58 	
    59 	TBool ValidImageSource(TInt aHandle) const;
    60 	TBool ValidImageTarget(TInt aHandle) const;
    61 	void Deactivate(CSwDirectGdiImageTargetImpl* aRenderingTarget);
    62 	TInt RegisterSourceImage(const CSwDirectGdiImageSourceImpl& aImageSource);
    63 	TInt RegisterTargetImage(const CSwDirectGdiImageTargetImpl& aImageTarget);
    64 	TInt UnregisterTargetImage(const CSwDirectGdiImageTargetImpl& aImageTarget);
    65 	TInt UnregisterSourceImage(const CSwDirectGdiImageSourceImpl& aImageSource);
    66 	CSwDirectGdiDriverImpl(RLibrary aLibrary);
    67 
    68 private:
    69 	TInt iErrorCode;	/**< The first error code to occur in any CSwDirectGdiEngine instance.*/
    70 	RPointerArray<MDirectGdiEngine> iEngines;
    71 	RPointerArray<CSwDirectGdiImageTargetImpl> iTargets;
    72 	RPointerArray<CSwDirectGdiImageSourceImpl> iImageSources;	
    73 	};
    74 
    75 #endif //__SWDIRECTGDIDRIVERIMPL_H__