sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: /**
sl@0:  @file
sl@0:  @internalComponent
sl@0: */
sl@0: 
sl@0: #ifndef SGDRIVER_H
sl@0: #define SGDRIVER_H
sl@0: 
sl@0: #include <e32std.h>
sl@0: #include <pls.h>
sl@0: 
sl@0: 
sl@0: class MSgDriverAdapter;
sl@0: 
sl@0: /**
sl@0: @internalComponent
sl@0: 
sl@0: This class encapsulates the global data in the Graphics Resource DLL.
sl@0: */
sl@0: NONSHARABLE_CLASS(XSgDriverPls)
sl@0: 	{
sl@0: public:
sl@0: 	/**
sl@0: 	Default constructor, called when the Graphics Resource DLL is loaded into a
sl@0: 	process. Creates the mutex used to synchronise access to the global data. The
sl@0: 	mutex will be automatically destroyed by the kernel on process termination.
sl@0: 	*/
sl@0: 	XSgDriverPls();
sl@0: public:
sl@0: 	/**
sl@0: 	Result code of the constructor.
sl@0: 	*/
sl@0: 	TInt iError;
sl@0: 	/**
sl@0: 	Handle to the mutex used to synchronise access to the global data.
sl@0: 	*/
sl@0: 	RMutex iMutex;
sl@0: #ifdef __WINS__
sl@0: 	/**
sl@0: 	Handle to the Graphics Resource Adapter DLL owned by this process.
sl@0: 	*/
sl@0: 	RLibrary iLibrary;
sl@0: #endif
sl@0: 	/**
sl@0: 	Number of times SgDriver::Open() has been called from this process without
sl@0: 	a corresponding call to SgDriver::Close().
sl@0: 	*/
sl@0: 	TInt iOpenCount;
sl@0: 	/**
sl@0: 	Pointer to the Graphics Resource Adapter singleton in this process.
sl@0: 	*/
sl@0: 	MSgDriverAdapter* iDriver;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: /**
sl@0: @internalComponent
sl@0: 
sl@0: The UID3 value in the compound identifier of the Graphics Resource DLL.
sl@0: */
sl@0: const TUid KSgResourceLibraryUid = {0x10285A70};
sl@0: 
sl@0: 
sl@0: /**
sl@0: @internalComponent
sl@0: 
sl@0: The global data in the Graphics Resource DLL.
sl@0: */
sl@0: #ifdef __WINS__
sl@0: #define gPls (*Pls<XSgDriverPls>(KSgResourceLibraryUid))
sl@0: #else
sl@0: extern XSgDriverPls gPls;
sl@0: #endif
sl@0: 
sl@0: 
sl@0: #endif // SGDRIVER_H