os/graphics/graphicsresourceservices/graphicsresource/inc/sgdriver.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicsresourceservices/graphicsresource/inc/sgdriver.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,91 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @internalComponent
    1.22 +*/
    1.23 +
    1.24 +#ifndef SGDRIVER_H
    1.25 +#define SGDRIVER_H
    1.26 +
    1.27 +#include <e32std.h>
    1.28 +#include <pls.h>
    1.29 +
    1.30 +
    1.31 +class MSgDriverAdapter;
    1.32 +
    1.33 +/**
    1.34 +@internalComponent
    1.35 +
    1.36 +This class encapsulates the global data in the Graphics Resource DLL.
    1.37 +*/
    1.38 +NONSHARABLE_CLASS(XSgDriverPls)
    1.39 +	{
    1.40 +public:
    1.41 +	/**
    1.42 +	Default constructor, called when the Graphics Resource DLL is loaded into a
    1.43 +	process. Creates the mutex used to synchronise access to the global data. The
    1.44 +	mutex will be automatically destroyed by the kernel on process termination.
    1.45 +	*/
    1.46 +	XSgDriverPls();
    1.47 +public:
    1.48 +	/**
    1.49 +	Result code of the constructor.
    1.50 +	*/
    1.51 +	TInt iError;
    1.52 +	/**
    1.53 +	Handle to the mutex used to synchronise access to the global data.
    1.54 +	*/
    1.55 +	RMutex iMutex;
    1.56 +#ifdef __WINS__
    1.57 +	/**
    1.58 +	Handle to the Graphics Resource Adapter DLL owned by this process.
    1.59 +	*/
    1.60 +	RLibrary iLibrary;
    1.61 +#endif
    1.62 +	/**
    1.63 +	Number of times SgDriver::Open() has been called from this process without
    1.64 +	a corresponding call to SgDriver::Close().
    1.65 +	*/
    1.66 +	TInt iOpenCount;
    1.67 +	/**
    1.68 +	Pointer to the Graphics Resource Adapter singleton in this process.
    1.69 +	*/
    1.70 +	MSgDriverAdapter* iDriver;
    1.71 +	};
    1.72 +
    1.73 +
    1.74 +/**
    1.75 +@internalComponent
    1.76 +
    1.77 +The UID3 value in the compound identifier of the Graphics Resource DLL.
    1.78 +*/
    1.79 +const TUid KSgResourceLibraryUid = {0x10285A70};
    1.80 +
    1.81 +
    1.82 +/**
    1.83 +@internalComponent
    1.84 +
    1.85 +The global data in the Graphics Resource DLL.
    1.86 +*/
    1.87 +#ifdef __WINS__
    1.88 +#define gPls (*Pls<XSgDriverPls>(KSgResourceLibraryUid))
    1.89 +#else
    1.90 +extern XSgDriverPls gPls;
    1.91 +#endif
    1.92 +
    1.93 +
    1.94 +#endif // SGDRIVER_H