graphicsresourceservices/graphicsresource/inc/sgdriver.h
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2008-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef SGDRIVER_H
       
    22 #define SGDRIVER_H
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <pls.h>
       
    26 
       
    27 
       
    28 class MSgDriverAdapter;
       
    29 
       
    30 /**
       
    31 @internalComponent
       
    32 
       
    33 This class encapsulates the global data in the Graphics Resource DLL.
       
    34 */
       
    35 NONSHARABLE_CLASS(XSgDriverPls)
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 	Default constructor, called when the Graphics Resource DLL is loaded into a
       
    40 	process. Creates the mutex used to synchronise access to the global data. The
       
    41 	mutex will be automatically destroyed by the kernel on process termination.
       
    42 	*/
       
    43 	XSgDriverPls();
       
    44 public:
       
    45 	/**
       
    46 	Result code of the constructor.
       
    47 	*/
       
    48 	TInt iError;
       
    49 	/**
       
    50 	Handle to the mutex used to synchronise access to the global data.
       
    51 	*/
       
    52 	RMutex iMutex;
       
    53 #ifdef __WINS__
       
    54 	/**
       
    55 	Handle to the Graphics Resource Adapter DLL owned by this process.
       
    56 	*/
       
    57 	RLibrary iLibrary;
       
    58 #endif
       
    59 	/**
       
    60 	Number of times SgDriver::Open() has been called from this process without
       
    61 	a corresponding call to SgDriver::Close().
       
    62 	*/
       
    63 	TInt iOpenCount;
       
    64 	/**
       
    65 	Pointer to the Graphics Resource Adapter singleton in this process.
       
    66 	*/
       
    67 	MSgDriverAdapter* iDriver;
       
    68 	};
       
    69 
       
    70 
       
    71 /**
       
    72 @internalComponent
       
    73 
       
    74 The UID3 value in the compound identifier of the Graphics Resource DLL.
       
    75 */
       
    76 const TUid KSgResourceLibraryUid = {0x10285A70};
       
    77 
       
    78 
       
    79 /**
       
    80 @internalComponent
       
    81 
       
    82 The global data in the Graphics Resource DLL.
       
    83 */
       
    84 #ifdef __WINS__
       
    85 #define gPls (*Pls<XSgDriverPls>(KSgResourceLibraryUid))
       
    86 #else
       
    87 extern XSgDriverPls gPls;
       
    88 #endif
       
    89 
       
    90 
       
    91 #endif // SGDRIVER_H