|
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 #ifndef __WSUIBUFFER_H__ |
|
17 #define __WSUIBUFFER_H__ |
|
18 |
|
19 #include <pixelformats.h> |
|
20 #include <graphics/wsgraphicdrawerinterface.h> |
|
21 |
|
22 /** |
|
23 @file |
|
24 @publishedPartner |
|
25 @prototype |
|
26 */ |
|
27 |
|
28 /** |
|
29 This class provides direct access to the memory of the UI buffer. |
|
30 |
|
31 This interface is to be used by CRPs that don't want to go through MWsGraphicsContext |
|
32 to handle their rendering, but want direct memory access. |
|
33 @publishedPartner |
|
34 @prototype |
|
35 */ |
|
36 class MWsUiBuffer: public MWsObjectProvider |
|
37 { |
|
38 public: |
|
39 DECLARE_WS_TYPE_ID(KMWsUiBufferInterfaceId) |
|
40 |
|
41 /** |
|
42 Finishes pending rendering to the buffer and temporarily makes the pixel |
|
43 data of the buffer image accessible for reading and writing by the CPU. |
|
44 |
|
45 When finished with the pixel data, the caller must end the mapping by |
|
46 calling @c Unmap(). |
|
47 |
|
48 This method should only be called from the context of |
|
49 @c CWsGraphicDrawer::Draw(). |
|
50 @param aDataAddress On return, the base address of the pixel data in the |
|
51 address space of the calling process |
|
52 @param aDataStride On return, the number of bytes between rows of the |
|
53 pixel data |
|
54 @return KErrNone if successful, otherwise one of the standard Symbian |
|
55 error codes |
|
56 @see Unmap() |
|
57 @publishedPartner |
|
58 @prototype |
|
59 */ |
|
60 virtual TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride) = 0; |
|
61 |
|
62 /** |
|
63 Finishes pending rendering to the buffer and temporarily makes the pixel |
|
64 data of the buffer image accessible for writing by the CPU. |
|
65 |
|
66 When finished with the pixel data, the caller must end the mapping by |
|
67 calling @c Unmap(). |
|
68 |
|
69 This method should only be called from the context of |
|
70 @c CWsGraphicDrawer::Draw(). |
|
71 @param aDataAddress On return, the base address of the pixel data in the |
|
72 address space of the calling process |
|
73 @param aDataStride On return, the number of bytes between rows of the |
|
74 pixel data |
|
75 @return KErrNone if successful, otherwise one of the standard Symbian |
|
76 error codes |
|
77 @see Unmap() |
|
78 @publishedPartner |
|
79 @prototype |
|
80 */ |
|
81 virtual TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride) = 0; |
|
82 |
|
83 /** |
|
84 Makes the pixel data of an image no longer accessible to the CPU. |
|
85 |
|
86 Before calling this method the buffer must be mapped for CPU access by |
|
87 a previous call to @c MapReadWrite() or @c MapWriteOnly(). |
|
88 |
|
89 This method should only be called from the context of |
|
90 @c CWsGraphicDrawer::Draw(). |
|
91 @return KErrNone if successful, otherwise one of the standard Symbian |
|
92 error codes |
|
93 @see MapReadWrite() |
|
94 @see MapWriteOnly() |
|
95 @publishedPartner |
|
96 @prototype |
|
97 */ |
|
98 virtual TInt Unmap() = 0; |
|
99 |
|
100 /** |
|
101 Gets the pixel format of the buffer. |
|
102 @return The pixel format of the buffer |
|
103 @publishedPartner |
|
104 @prototype |
|
105 */ |
|
106 virtual TUidPixelFormat PixelFormat() const = 0; |
|
107 |
|
108 /** |
|
109 Gets the current size of the buffer. |
|
110 |
|
111 The actual size of the whole buffer might be larger than the returned |
|
112 value depending on the current screen mode. However, it is the size |
|
113 returned by this method that should be used when accessing the pixel data. |
|
114 @return The current size of the buffer |
|
115 @publishedPartner |
|
116 @prototype |
|
117 */ |
|
118 virtual TSize SizeInPixels() const = 0; |
|
119 }; |
|
120 |
|
121 #endif //__WSUiBUFFER_H__ |