|
1 // Copyright (c) 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 // Graphics Resource - logical device driver |
|
15 // |
|
16 |
|
17 #ifndef SGDEVICE_H |
|
18 #define SGDEVICE_H |
|
19 |
|
20 #include <e32des8.h> |
|
21 #include <sgresource/sgcommon.h> |
|
22 |
|
23 _LIT(KSgDeviceName, "sgdevice"); |
|
24 |
|
25 inline TVersion SgDeviceVersionRequired(); |
|
26 |
|
27 class RSgDevice: public RBusLogicalChannel |
|
28 { |
|
29 friend class DSgChannel; |
|
30 public: |
|
31 inline TInt Connect(); |
|
32 inline TInt CreateResource(TUint32 aAttribs, const TDesC8& aMetaData, TInt aDataSize, TUint64& aId); |
|
33 inline TInt OpenResource(TUint64 aId); |
|
34 inline TInt CloseResource(TUint64 aId); |
|
35 inline TUint32 ResourceAttributes(TUint64 aId); |
|
36 inline TInt GetResourceMetaData(TUint64 aId, TDes8& aMetaData); |
|
37 inline TAny* ResourceDataAddress(TUint64 aId); |
|
38 inline TInt ResourceDataSize(TUint64 aId); |
|
39 inline TInt GlobalResourceCount(); |
|
40 inline TInt LocalGraphicsMemoryUsed(); |
|
41 inline TInt GlobalGraphicsMemoryUsed(); |
|
42 private: |
|
43 enum TControl |
|
44 { |
|
45 EControlCreateResource, |
|
46 EControlOpenResource, |
|
47 EControlCloseResource, |
|
48 EControlResourceAttributes, |
|
49 EControlGetResourceMetaData, |
|
50 EControlResourceDataAddress, |
|
51 EControlResourceDataSize, |
|
52 EControlGlobalResourceCount, |
|
53 EControlLocalGraphicsMemoryUsed, |
|
54 EControlGlobalGraphicsMemoryUsed |
|
55 }; |
|
56 class TCreateResourceArgs |
|
57 { |
|
58 public: |
|
59 TUint32 iAttributes; |
|
60 const TDesC8* iMetaData; |
|
61 TInt iDataSize; |
|
62 }; |
|
63 }; |
|
64 |
|
65 #include <sgresource/sgdevice.inl> |
|
66 |
|
67 #endif // SGDEVICE_H |