|
1 // Copyright (c) 2006-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 // Surface Manager Implementation |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 @prototype |
|
22 */ |
|
23 |
|
24 #ifndef __SURFACEMANAGERDRIVER_H__ |
|
25 #define __SURFACEMANAGERDRIVER_H__ |
|
26 |
|
27 #include <graphics/surfacemanager.h> |
|
28 |
|
29 /** |
|
30 RSurface Manager driver. This is a simple user side interface class derived from RBusLogicalChannel |
|
31 with each surface manager function implemented with a call to DoControl |
|
32 */ |
|
33 class RSurfaceManagerDriver : public RBusLogicalChannel |
|
34 { |
|
35 public: |
|
36 |
|
37 /** Package class to exchange data between the client interface of the driver (RSurfaceManagerDriver) |
|
38 * and the kernel extension which implement it (DSurfaceManger)*/ |
|
39 class TDeviceParam |
|
40 { |
|
41 public: |
|
42 TDeviceParam(){} |
|
43 TDeviceParam(TAny* aSurfaceId, TAny* aBuffer) : iSurfaceId(aSurfaceId), iBuffer(aBuffer) {} |
|
44 /** Generic object used to pass as a parameter to device driver*/ |
|
45 TAny* iBuffer; |
|
46 /** Generic object used to pass as a parameter to device driver*/ |
|
47 TAny* iSurfaceId; |
|
48 }; |
|
49 |
|
50 class TCaps |
|
51 { |
|
52 public: |
|
53 TVersion iVersion; |
|
54 }; |
|
55 |
|
56 public: |
|
57 #ifndef __KERNEL_MODE__ |
|
58 inline TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId); |
|
59 inline TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf& aReqs, TSurfaceId& aSurfaceId, const RChunk& aChunkHandle); |
|
60 inline TInt OpenSurface(const TSurfaceId& aSurfaceId); |
|
61 inline TInt CloseSurface(const TSurfaceId& aSurfaceId); |
|
62 inline TInt MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle); |
|
63 inline TInt SurfaceInfo(const TSurfaceId& aSurfaceId, RSurfaceManager::TInfoBuf& aInfo); |
|
64 inline TInt Open(); |
|
65 inline TInt SynchronizeCache(const TSurfaceId& aSurfaceId, TInt aBuffer, RSurfaceManager::TSyncOperation aOperation); |
|
66 inline TInt GetSurfaceHint(const TSurfaceId& aSurfaceId, RSurfaceManager::THintPair& aHint); |
|
67 inline TInt SetSurfaceHint(const TSurfaceId& aSurfaceId, const RSurfaceManager::THintPair& aHint); |
|
68 inline TInt AddSurfaceHint(const TSurfaceId&aSurface, const RSurfaceManager::THintPair& aHint); |
|
69 inline TInt GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset); |
|
70 inline TInt GetSurfaceManagerAttrib(RSurfaceManager::TSurfaceManagerAttrib aAttrib, TInt& aValue); |
|
71 #endif //__KERNEL_MODE__ |
|
72 |
|
73 inline static const TDesC& Name(); |
|
74 inline static TVersion VersionRequired(); |
|
75 |
|
76 private: |
|
77 enum TSurfaceManagerControl |
|
78 { |
|
79 EControlCreateSurface, |
|
80 EControlOpenSurface, |
|
81 EControlCloseSurface, |
|
82 EControlAccessSurfaceData, |
|
83 EControlSurfaceInfo, |
|
84 EControlCreateSurfaceEx, |
|
85 EControlSynchronizeCache, |
|
86 EControlGetSurfaceHint, |
|
87 EControlSetSurfaceHint, |
|
88 EControlAddSurfaceHint, |
|
89 EControlGetBufferOffset, |
|
90 EControlGetSurfaceManagerAttrib |
|
91 }; |
|
92 |
|
93 friend class DSurfaceManagerChannel; |
|
94 |
|
95 }; |
|
96 |
|
97 |
|
98 #include "surfacemanagerdriver.inl" |
|
99 |
|
100 #endif //__SURFACEMANAGERDRIVER_H__ |