|
1 // Copyright (c) 1997-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 __SCDRAW_H__ |
|
17 #define __SCDRAW_H__ |
|
18 |
|
19 #include <e32svr.h> |
|
20 #include <e32wins.h> |
|
21 |
|
22 #if defined(SYMBIAN_GRAPHICS_GCE) |
|
23 #include <graphics/surfaceupdateclient.h> |
|
24 #include <bitdrawsurface.h> |
|
25 #endif //SYMBIAN_GRAPHICS_GCE |
|
26 |
|
27 #include "BMDRAW.H" |
|
28 #include "_WININC.H" |
|
29 |
|
30 /** |
|
31 @internalComponent |
|
32 */ |
|
33 template <class T> |
|
34 class CScreenDevice : public T |
|
35 { |
|
36 public: |
|
37 TInt ConstructScreen(TInt aScreenNo, TAny* aHwnd,const TSize& aSize); |
|
38 protected: |
|
39 virtual ~CScreenDevice(); |
|
40 void SetScreenOrientation(TInt aOrientation); |
|
41 TUint8* WinPixelAddress(TInt aX,TInt aY) const; |
|
42 private: |
|
43 // From CFbsDrawDevice |
|
44 virtual TInt HorzTwipsPerThousandPixels() const; |
|
45 virtual TInt VertTwipsPerThousandPixels() const; |
|
46 virtual void OrientationsAvailable(TBool aOrientation[4]); |
|
47 virtual void SetAutoUpdate(TBool aAutoUpdate); |
|
48 virtual void SetDisplayMode(CFbsDrawDevice* aDrawDevice); |
|
49 virtual void Update(); |
|
50 virtual void Update(const TRegion& aUpdateRegion); |
|
51 virtual void UpdateRegion(const TRect& aRect); |
|
52 virtual void UpdateScreen(const TRegion& aRegion); |
|
53 // New functions |
|
54 virtual void UpdateRect(const TRect& aRect) const = 0; |
|
55 protected: |
|
56 CFbsDrawDevice::TOrientation iEmulatorOrientation; |
|
57 TInt iScreenNo; |
|
58 private: |
|
59 RWindows* iWindow; |
|
60 RSemaphore iWindowInUse; |
|
61 TBool iAutoUpdate; |
|
62 RRegion iUpdateRegion; |
|
63 #if defined(SYMBIAN_GRAPHICS_GCE) |
|
64 RSurfaceUpdateSession iSurfaceUpdateSession; |
|
65 TInt iSurfaceUpdateError; |
|
66 #endif //SYMBIAN_GRAPHICS_GCE |
|
67 }; |
|
68 |
|
69 #include "SCDRAW.INL" // implementation of CScreenDevice<> |
|
70 |
|
71 /** |
|
72 @internalComponent |
|
73 */ |
|
74 class CDrawOneBppScreenBitmap : public CScreenDevice<CDrawOneBppBitmap> |
|
75 { |
|
76 private: |
|
77 // From CFbsDrawDevice |
|
78 void OrientationsAvailable(TBool aOrientation[4]); |
|
79 //virtual function from CScreenDevice |
|
80 void UpdateRect(const TRect& aRect) const; |
|
81 //new functions |
|
82 virtual TInt InitScreen(); |
|
83 }; |
|
84 |
|
85 /** |
|
86 @internalComponent |
|
87 */ |
|
88 class CDrawTwoBppScreenBitmap : public CScreenDevice<CDrawTwoBppBitmap> |
|
89 { |
|
90 private: |
|
91 // From CFbsDrawDevice |
|
92 void OrientationsAvailable(TBool aOrientation[4]); |
|
93 //virtual function from CScreenDevice |
|
94 void UpdateRect(const TRect& aRect) const; |
|
95 //new functions |
|
96 virtual TInt InitScreen(); |
|
97 }; |
|
98 |
|
99 /** |
|
100 @internalComponent |
|
101 */ |
|
102 class CDrawFourBppScreenBitmapGray : public CScreenDevice<CDrawFourBppBitmapGray> |
|
103 { |
|
104 private: |
|
105 // From CFbsDrawDevice |
|
106 void OrientationsAvailable(TBool aOrientation[4]); |
|
107 //virtual function from CScreenDevice |
|
108 void UpdateRect(const TRect& aRect) const; |
|
109 //new functions |
|
110 virtual TInt InitScreen(); |
|
111 }; |
|
112 |
|
113 /** |
|
114 @internalComponent |
|
115 */ |
|
116 class CDrawFourBppScreenBitmapColor : public CScreenDevice<CDrawFourBppBitmapColor> |
|
117 { |
|
118 private: |
|
119 // From CFbsDrawDevice |
|
120 void OrientationsAvailable(TBool aOrientation[4]); |
|
121 //virtual function from CScreenDevice |
|
122 void UpdateRect(const TRect& aRect) const; |
|
123 //new functions |
|
124 virtual TInt InitScreen(); |
|
125 }; |
|
126 |
|
127 /** |
|
128 @internalComponent |
|
129 */ |
|
130 class CDrawEightBppScreenBitmapGray : public CScreenDevice<CDrawEightBppBitmapGray> |
|
131 { |
|
132 private: |
|
133 //virtual function from CDrawBitmap |
|
134 TBool SetOrientation(TOrientation aOrientation); |
|
135 //virtual function from CScreenDevice |
|
136 void UpdateRect(const TRect& aRect) const; |
|
137 //new functions |
|
138 virtual TInt InitScreen(); |
|
139 }; |
|
140 |
|
141 /** |
|
142 @internalComponent |
|
143 */ |
|
144 class CDrawEightBppScreenBitmapColor : public CScreenDevice<CDrawEightBppBitmapColor> |
|
145 { |
|
146 private: |
|
147 //virtual function from CDrawEightBppBitmapColor |
|
148 TInt SetCustomPalette(const CPalette* aPalette); |
|
149 //virtual function from CDrawBitmap |
|
150 TBool SetOrientation(TOrientation aOrientation); |
|
151 //virtual function from CScreenDevice |
|
152 void UpdateRect(const TRect& aRect) const; |
|
153 //new functions |
|
154 virtual TInt InitScreen(); |
|
155 }; |
|
156 |
|
157 /** |
|
158 @internalComponent |
|
159 */ |
|
160 class CDrawTwelveBppScreenBitmap : public CScreenDevice<CDrawTwelveBppBitmap> |
|
161 { |
|
162 private: |
|
163 //virtual function from CDrawBitmap |
|
164 TBool SetOrientation(TOrientation aOrientation); |
|
165 //virtual function from CScreenDevice |
|
166 void UpdateRect(const TRect& aRect) const; |
|
167 //new functions |
|
168 virtual TInt InitScreen(); |
|
169 }; |
|
170 |
|
171 /** |
|
172 @internalComponent |
|
173 */ |
|
174 class CDrawSixteenBppScreenBitmap : public CScreenDevice<CDrawSixteenBppBitmap> |
|
175 { |
|
176 private: |
|
177 //virtual function from CDrawBitmap |
|
178 TBool SetOrientation(TOrientation aOrientation); |
|
179 //virtual function from CScreenDevice |
|
180 void UpdateRect(const TRect& aRect) const; |
|
181 //new functions |
|
182 virtual TInt InitScreen(); |
|
183 }; |
|
184 |
|
185 /** |
|
186 @internalComponent |
|
187 */ |
|
188 class CDrawTwentyFourBppScreenBitmap : public CScreenDevice<CDrawTwentyFourBppBitmap> |
|
189 { |
|
190 private: |
|
191 //virtual function from CDrawBitmap |
|
192 TBool SetOrientation(TOrientation aOrientation); |
|
193 //virtual function from CScreenDevice |
|
194 void UpdateRect(const TRect& aRect) const; |
|
195 //new functions |
|
196 virtual TInt InitScreen(); |
|
197 }; |
|
198 |
|
199 /** |
|
200 @internalComponent |
|
201 */ |
|
202 class CDrawUTwentyFourBppScreenBitmap : public CScreenDevice<CDrawUTwentyFourBppBitmap> |
|
203 { |
|
204 private: |
|
205 //virtual function from CDrawBitmap |
|
206 TBool SetOrientation(TOrientation aOrientation); |
|
207 //virtual function from CScreenDevice |
|
208 void UpdateRect(const TRect& aRect) const; |
|
209 //new functions |
|
210 virtual TInt InitScreen(); |
|
211 }; |
|
212 |
|
213 /** |
|
214 @internalComponent |
|
215 */ |
|
216 class CDrawThirtyTwoBppScreenBitmapAlpha : public CScreenDevice<CDrawThirtyTwoBppBitmapAlpha> |
|
217 { |
|
218 private: |
|
219 //virtual function from CDrawBitmap |
|
220 TBool SetOrientation(TOrientation aOrientation); |
|
221 //virtual function from CScreenDevice |
|
222 void UpdateRect(const TRect& aRect) const; |
|
223 //new functions |
|
224 virtual TInt InitScreen(); |
|
225 }; |
|
226 |
|
227 /** |
|
228 @internalComponent |
|
229 */ |
|
230 class CDrawThirtyTwoBppScreenBitmapAlphaPM : public CScreenDevice<CDrawThirtyTwoBppBitmapAlphaPM> |
|
231 { |
|
232 private: |
|
233 //virtual function from CDrawBitmap |
|
234 TBool SetOrientation(TOrientation aOrientation); |
|
235 //virtual function from CScreenDevice |
|
236 void UpdateRect(const TRect& aRect) const; |
|
237 //new functions |
|
238 virtual TInt InitScreen(); |
|
239 }; |
|
240 |
|
241 #endif //__SCDRAW_H__ |
|
242 |