os/graphics/graphicsdeviceinterface/directgdi/inc/directgdidriver.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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) Driver, this class 
    15 // defines the API which is intended to be used by DirectGDI client applications.
    16 // 
    17 //
    18 
    19 #ifndef DIRECTGDIDRIVER_H
    20 #define DIRECTGDIDRIVER_H
    21 
    22 /**
    23 @file
    24 @publishedPartner
    25 @prototype
    26 */
    27 
    28 #include <e32base.h>
    29 
    30 
    31 class RSgDrawable;
    32 class RSgImage;
    33 class RDirectGdiImageTarget;
    34 class RDirectGdiDrawableSource;
    35 class CDirectGdiContext;
    36 class MDirectGdiEngine;
    37 class CDirectGdiDriverInternal;
    38 class CTDirectGdiDriver;
    39 
    40 /**
    41 Provides an interface which is intended to be used by DirectGDI client applications. It will be implemented using 
    42 the handle/body idiom, where the handle part will form the public and private API that is intended to be used by 
    43 DirectGDI client applications and other DirectGDI generic parts, and the body part defines the HAI that needs to be 
    44 implemented by an adaptation. The implementation of the handle part will be generic for all adaptations. The implementation 
    45 of the body part is adaptation specific and provides interfaces for initialisation, termination, construction 
    46 of the concrete drawing engine and the creation of source or target rendering. Initialisation and termination are 
    47 intended to give opportunities for an adaptation to perform any thread specific tasks which may be required. This class
    48 is intended to be a singleton within a thread. It delegates to an adaptation-specific implementation that provides a 
    49 platform-specific mechanism. 
    50 
    51 @publishedPartner
    52 @prototype
    53 @deprecated
    54 */
    55 NONSHARABLE_CLASS(CDirectGdiDriver): public CBase
    56 	{
    57 	friend class CDirectGdiContext;
    58 	friend class RDirectGdiImageTarget;
    59 	friend class RDirectGdiDrawableSource;
    60 	friend class CTDirectGdiDriver;
    61 	
    62 public:
    63 	IMPORT_C static CDirectGdiDriver* Static();
    64 	IMPORT_C static TInt Open();
    65 	IMPORT_C void Close();
    66 	IMPORT_C void Flush();
    67 	IMPORT_C void Finish();
    68 	IMPORT_C TInt GetError();	
    69 	IMPORT_C TInt GetInterface(TUid aInterfaceId, TAny*& aInterface);
    70 	
    71 private:
    72 	CDirectGdiDriver();
    73 	~CDirectGdiDriver();
    74 	TInt CreateDrawableSource(RDirectGdiDrawableSource& aRDirectGdiDrawableSource, const RSgDrawable& aRSgDrawable);
    75 	void CloseDrawableSource(RDirectGdiDrawableSource& aRDirectGdiDrawableSource);
    76 	TInt CreateImageTarget(RDirectGdiImageTarget& aRDirectGdiImageTarget, const RSgImage& aRSgImage);
    77 	void CloseImageTarget(RDirectGdiImageTarget& aRDirectGdiImageTarget);
    78 	TInt CreateEngine(MDirectGdiEngine*& aMDirectGdiEngine);
    79 	void DestroyEngine(MDirectGdiEngine* aMDirectGdiEngine);
    80 	IMPORT_C void SetError(TInt aErr);
    81 #ifdef __WINS__
    82 	TInt CreateInternalDriver(const RLibrary& aLibrary);
    83 #else
    84 	TInt CreateInternalDriver();
    85 #endif
    86 
    87 private:	
    88 	TInt iOpenCount;	/**< A count of how many times this driver object has been opened.*/
    89 	CDirectGdiDriverInternal* iDriverInternal;	/**< To delegate calls to adaptation.*/
    90 	};
    91 
    92 #endif //__DIRECTGDIDRIVER_H__