os/graphics/graphicsdeviceinterface/directgdiadaptation/swsrc/swdirectgdidriverimpl.h
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Declaration of a Direct Graphics Device Interface (GDI) software implementation,
15 // this class actually implements the HAI.
19 #ifndef __SWDIRECTGDIDRIVERIMPL_H__
20 #define __SWDIRECTGDIDRIVERIMPL_H__
27 #include "swdirectgdiengine.h"
29 #include <pixelformats.h>
30 #include <graphics/directgdidriverinternal.h>
33 class CSwDirectGdiImageTargetImpl;
34 class CSwDirectGdiImageSourceImpl;
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.
41 NONSHARABLE_CLASS(CSwDirectGdiDriverImpl): public CDirectGdiDriverInternal
44 virtual ~CSwDirectGdiDriverImpl();
46 // From CDirectGdiDriverInternal
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);
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);
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;
75 #endif //__SWDIRECTGDIDRIVERIMPL_H__