sl@0
|
1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "E32Std.h"
|
sl@0
|
17 |
#include "E32Cons.h"
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "dummy.h"
|
sl@0
|
20 |
|
sl@0
|
21 |
CDummyDevice::CDummyDevice()
|
sl@0
|
22 |
{
|
sl@0
|
23 |
}
|
sl@0
|
24 |
|
sl@0
|
25 |
EXPORT_C CDummyDevice* CDummyDevice::NewL()
|
sl@0
|
26 |
{
|
sl@0
|
27 |
CDummyDevice* device=new(ELeave) CDummyDevice;
|
sl@0
|
28 |
device->iConsole=(CConsoleBase*)NewConsole();
|
sl@0
|
29 |
return device;
|
sl@0
|
30 |
}
|
sl@0
|
31 |
|
sl@0
|
32 |
EXPORT_C CDummyDevice::~CDummyDevice()
|
sl@0
|
33 |
{
|
sl@0
|
34 |
delete iConsole;
|
sl@0
|
35 |
}
|
sl@0
|
36 |
|
sl@0
|
37 |
EXPORT_C TInt CDummyDevice::HorizontalTwipsToPixels(TInt aTwips) const
|
sl@0
|
38 |
{
|
sl@0
|
39 |
return aTwips;
|
sl@0
|
40 |
}
|
sl@0
|
41 |
|
sl@0
|
42 |
EXPORT_C TInt CDummyDevice::VerticalTwipsToPixels(TInt aTwips) const
|
sl@0
|
43 |
{
|
sl@0
|
44 |
return aTwips;
|
sl@0
|
45 |
}
|
sl@0
|
46 |
|
sl@0
|
47 |
EXPORT_C TInt CDummyDevice::HorizontalPixelsToTwips(TInt aPixels) const
|
sl@0
|
48 |
{
|
sl@0
|
49 |
return aPixels;
|
sl@0
|
50 |
}
|
sl@0
|
51 |
|
sl@0
|
52 |
EXPORT_C TInt CDummyDevice::VerticalPixelsToTwips(TInt aPixels) const
|
sl@0
|
53 |
{
|
sl@0
|
54 |
return aPixels;
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
EXPORT_C TInt CDummyDevice::GetNearestFontInTwips(CFont*& /*aFont*/,const TFontSpec& /*aFontSpec*/)
|
sl@0
|
58 |
{
|
sl@0
|
59 |
return KErrNone;
|
sl@0
|
60 |
}
|
sl@0
|
61 |
|
sl@0
|
62 |
EXPORT_C TInt CDummyDevice::GetNearestFontToDesignHeightInTwips(CFont*& /*aFont*/,const TFontSpec& /*aFontSpec*/)
|
sl@0
|
63 |
{
|
sl@0
|
64 |
return KErrNone;
|
sl@0
|
65 |
}
|
sl@0
|
66 |
|
sl@0
|
67 |
EXPORT_C void CDummyDevice::ReleaseFont(CFont* /*aFont*/)
|
sl@0
|
68 |
{
|
sl@0
|
69 |
}
|
sl@0
|
70 |
|
sl@0
|
71 |
EXPORT_C TDisplayMode CDummyDevice::DisplayMode() const
|
sl@0
|
72 |
{
|
sl@0
|
73 |
return EGray2;
|
sl@0
|
74 |
}
|
sl@0
|
75 |
|
sl@0
|
76 |
EXPORT_C TSize CDummyDevice::SizeInPixels() const
|
sl@0
|
77 |
{
|
sl@0
|
78 |
return TSize(1000,1000);
|
sl@0
|
79 |
}
|
sl@0
|
80 |
|
sl@0
|
81 |
EXPORT_C TSize CDummyDevice::SizeInTwips() const
|
sl@0
|
82 |
{
|
sl@0
|
83 |
return TSize(1000,1000);
|
sl@0
|
84 |
}
|
sl@0
|
85 |
|
sl@0
|
86 |
EXPORT_C TInt CDummyDevice::CreateContext(CGraphicsContext*& aGC)
|
sl@0
|
87 |
{
|
sl@0
|
88 |
TInt ret;
|
sl@0
|
89 |
CDummyGc* gc = new CDummyGc(this);
|
sl@0
|
90 |
if (!gc)
|
sl@0
|
91 |
ret=KErrNoMemory;
|
sl@0
|
92 |
else
|
sl@0
|
93 |
{
|
sl@0
|
94 |
aGC=gc;
|
sl@0
|
95 |
ret=KErrNone;
|
sl@0
|
96 |
}
|
sl@0
|
97 |
return ret;
|
sl@0
|
98 |
}
|
sl@0
|
99 |
|
sl@0
|
100 |
EXPORT_C TInt CDummyDevice::NumTypefaces() const
|
sl@0
|
101 |
{
|
sl@0
|
102 |
return 0;
|
sl@0
|
103 |
}
|
sl@0
|
104 |
|
sl@0
|
105 |
EXPORT_C void CDummyDevice::TypefaceSupport(TTypefaceSupport& /*aTypefaceSupport*/,TInt /*aTypefaceIndex*/) const
|
sl@0
|
106 |
{
|
sl@0
|
107 |
}
|
sl@0
|
108 |
|
sl@0
|
109 |
EXPORT_C TInt CDummyDevice::FontHeightInTwips(TInt /*aTypefaceIndex*/,TInt /*aHeightIndex*/) const
|
sl@0
|
110 |
{
|
sl@0
|
111 |
return 0;
|
sl@0
|
112 |
}
|
sl@0
|
113 |
|
sl@0
|
114 |
EXPORT_C void CDummyDevice::PaletteAttributes(TBool& /*aModifiable*/,TInt& /*aNumEntries*/) const
|
sl@0
|
115 |
{
|
sl@0
|
116 |
}
|
sl@0
|
117 |
|
sl@0
|
118 |
EXPORT_C void CDummyDevice::SetPalette(CPalette* /*aPalette*/)
|
sl@0
|
119 |
{
|
sl@0
|
120 |
}
|
sl@0
|
121 |
|
sl@0
|
122 |
EXPORT_C TInt CDummyDevice::GetPalette(CPalette*& /*aPalette*/) const
|
sl@0
|
123 |
{
|
sl@0
|
124 |
return 0;
|
sl@0
|
125 |
}
|
sl@0
|
126 |
|
sl@0
|
127 |
EXPORT_C CDummyGc::CDummyGc(CDummyDevice* aDevice):
|
sl@0
|
128 |
iDevice(aDevice)
|
sl@0
|
129 |
{
|
sl@0
|
130 |
}
|
sl@0
|
131 |
|
sl@0
|
132 |
EXPORT_C CDummyGc::~CDummyGc()
|
sl@0
|
133 |
{
|
sl@0
|
134 |
iDevice->iConsole->Getch();
|
sl@0
|
135 |
}
|
sl@0
|
136 |
|
sl@0
|
137 |
EXPORT_C CGraphicsDevice* CDummyGc::Device() const
|
sl@0
|
138 |
{
|
sl@0
|
139 |
return iDevice;
|
sl@0
|
140 |
}
|
sl@0
|
141 |
|
sl@0
|
142 |
EXPORT_C void CDummyGc::SetOrigin(const TPoint& /*aPos*/)
|
sl@0
|
143 |
{
|
sl@0
|
144 |
iDevice->iConsole->Printf(_L("SetOrigin\n"));
|
sl@0
|
145 |
}
|
sl@0
|
146 |
|
sl@0
|
147 |
EXPORT_C void CDummyGc::SetDrawMode(TDrawMode /*aDrawingMode*/)
|
sl@0
|
148 |
{
|
sl@0
|
149 |
iDevice->iConsole->Printf(_L("SetDrawMode\n"));
|
sl@0
|
150 |
}
|
sl@0
|
151 |
|
sl@0
|
152 |
EXPORT_C void CDummyGc::SetClippingRect(const TRect& /*aRect*/)
|
sl@0
|
153 |
{
|
sl@0
|
154 |
iDevice->iConsole->Printf(_L("SetClippingRect\n"));
|
sl@0
|
155 |
}
|
sl@0
|
156 |
|
sl@0
|
157 |
EXPORT_C void CDummyGc::CancelClippingRect()
|
sl@0
|
158 |
{
|
sl@0
|
159 |
iDevice->iConsole->Printf(_L("CancelClippingRect\n"));
|
sl@0
|
160 |
}
|
sl@0
|
161 |
|
sl@0
|
162 |
EXPORT_C void CDummyGc::Reset()
|
sl@0
|
163 |
{
|
sl@0
|
164 |
iDevice->iConsole->Printf(_L("Reset\n"));
|
sl@0
|
165 |
}
|
sl@0
|
166 |
|
sl@0
|
167 |
|
sl@0
|
168 |
EXPORT_C void CDummyGc::UseFont(const CFont* /*aFont*/)
|
sl@0
|
169 |
{
|
sl@0
|
170 |
iDevice->iConsole->Printf(_L("UseFont\n"));
|
sl@0
|
171 |
}
|
sl@0
|
172 |
|
sl@0
|
173 |
EXPORT_C void CDummyGc::DiscardFont()
|
sl@0
|
174 |
{
|
sl@0
|
175 |
iDevice->iConsole->Printf(_L("DiscardFont\n"));
|
sl@0
|
176 |
}
|
sl@0
|
177 |
|
sl@0
|
178 |
EXPORT_C void CDummyGc::SetUnderlineStyle(TFontUnderline /*aUnderlineStyle*/)
|
sl@0
|
179 |
{
|
sl@0
|
180 |
iDevice->iConsole->Printf(_L("SetUnderlineStyle\n"));
|
sl@0
|
181 |
}
|
sl@0
|
182 |
|
sl@0
|
183 |
EXPORT_C void CDummyGc::SetStrikethroughStyle(TFontStrikethrough /*aStrikethroughStyle*/)
|
sl@0
|
184 |
{
|
sl@0
|
185 |
iDevice->iConsole->Printf(_L("SetStrikethroughStyle\n"));
|
sl@0
|
186 |
}
|
sl@0
|
187 |
|
sl@0
|
188 |
EXPORT_C void CDummyGc::SetWordJustification(TInt /*aExcessWidth*/,TInt /*aNumGaps*/)
|
sl@0
|
189 |
{
|
sl@0
|
190 |
iDevice->iConsole->Printf(_L("SetWordJustification\n"));
|
sl@0
|
191 |
}
|
sl@0
|
192 |
|
sl@0
|
193 |
EXPORT_C void CDummyGc::SetCharJustification(TInt /*aExcessWidth*/,TInt /*aNumChars*/)
|
sl@0
|
194 |
{
|
sl@0
|
195 |
iDevice->iConsole->Printf(_L("SetCharJustification\n"));
|
sl@0
|
196 |
}
|
sl@0
|
197 |
|
sl@0
|
198 |
|
sl@0
|
199 |
EXPORT_C void CDummyGc::SetPenColor(const TRgb& /*aColor*/)
|
sl@0
|
200 |
{
|
sl@0
|
201 |
iDevice->iConsole->Printf(_L("SetPenColor\n"));
|
sl@0
|
202 |
}
|
sl@0
|
203 |
|
sl@0
|
204 |
EXPORT_C void CDummyGc::SetPenStyle(TPenStyle /*aPenStyle*/)
|
sl@0
|
205 |
{
|
sl@0
|
206 |
iDevice->iConsole->Printf(_L("SetPenStyle\n"));
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
EXPORT_C void CDummyGc::SetPenSize(const TSize& /*aSize*/)
|
sl@0
|
210 |
{
|
sl@0
|
211 |
iDevice->iConsole->Printf(_L("SetPenSize\n"));
|
sl@0
|
212 |
}
|
sl@0
|
213 |
|
sl@0
|
214 |
|
sl@0
|
215 |
EXPORT_C void CDummyGc::SetBrushColor(const TRgb& /*aColor*/)
|
sl@0
|
216 |
{
|
sl@0
|
217 |
iDevice->iConsole->Printf(_L("SetBrushColor\n"));
|
sl@0
|
218 |
}
|
sl@0
|
219 |
|
sl@0
|
220 |
EXPORT_C void CDummyGc::SetBrushStyle(TBrushStyle /*aBrushStyle*/)
|
sl@0
|
221 |
{
|
sl@0
|
222 |
iDevice->iConsole->Printf(_L("SetBrushStyle\n"));
|
sl@0
|
223 |
}
|
sl@0
|
224 |
|
sl@0
|
225 |
EXPORT_C void CDummyGc::SetBrushOrigin(const TPoint& /*aOrigin*/)
|
sl@0
|
226 |
{
|
sl@0
|
227 |
iDevice->iConsole->Printf(_L("SetBrushOrigin\n"));
|
sl@0
|
228 |
}
|
sl@0
|
229 |
|
sl@0
|
230 |
EXPORT_C void CDummyGc::UseBrushPattern(const CFbsBitmap* /*aBitmap*/)
|
sl@0
|
231 |
{
|
sl@0
|
232 |
iDevice->iConsole->Printf(_L("SetBrushPattern\n"));
|
sl@0
|
233 |
}
|
sl@0
|
234 |
|
sl@0
|
235 |
EXPORT_C void CDummyGc::DiscardBrushPattern()
|
sl@0
|
236 |
{
|
sl@0
|
237 |
iDevice->iConsole->Printf(_L("DiscardBrushPattern\n"));
|
sl@0
|
238 |
}
|
sl@0
|
239 |
|
sl@0
|
240 |
EXPORT_C void CDummyGc::MoveTo(const TPoint& /*aPoint*/)
|
sl@0
|
241 |
{
|
sl@0
|
242 |
iDevice->iConsole->Printf(_L("MoveTo\n"));
|
sl@0
|
243 |
}
|
sl@0
|
244 |
|
sl@0
|
245 |
EXPORT_C void CDummyGc::MoveBy(const TPoint& /*aVector*/)
|
sl@0
|
246 |
{
|
sl@0
|
247 |
iDevice->iConsole->Printf(_L("MoveBy\n"));
|
sl@0
|
248 |
}
|
sl@0
|
249 |
|
sl@0
|
250 |
EXPORT_C void CDummyGc::Plot(const TPoint& /*aPoint*/)
|
sl@0
|
251 |
{
|
sl@0
|
252 |
iDevice->iConsole->Printf(_L("Plot\n"));
|
sl@0
|
253 |
}
|
sl@0
|
254 |
|
sl@0
|
255 |
EXPORT_C void CDummyGc::DrawArc(const TRect& /*aRect*/,const TPoint& /*aStart*/,const TPoint& /*aEnd*/)
|
sl@0
|
256 |
{
|
sl@0
|
257 |
iDevice->iConsole->Printf(_L("DrawArc\n"));
|
sl@0
|
258 |
}
|
sl@0
|
259 |
|
sl@0
|
260 |
EXPORT_C void CDummyGc::DrawLine(const TPoint& /*aPoint1*/,const TPoint& /*aPoint2*/)
|
sl@0
|
261 |
{
|
sl@0
|
262 |
iDevice->iConsole->Printf(_L("DrawLine\n"));
|
sl@0
|
263 |
}
|
sl@0
|
264 |
|
sl@0
|
265 |
EXPORT_C void CDummyGc::DrawLineTo(const TPoint& /*aPoint*/)
|
sl@0
|
266 |
{
|
sl@0
|
267 |
iDevice->iConsole->Printf(_L("DrawLineTo\n"));
|
sl@0
|
268 |
}
|
sl@0
|
269 |
|
sl@0
|
270 |
EXPORT_C void CDummyGc::DrawLineBy(const TPoint& /*aVector*/)
|
sl@0
|
271 |
{
|
sl@0
|
272 |
iDevice->iConsole->Printf(_L("DrawLineBy\n"));
|
sl@0
|
273 |
}
|
sl@0
|
274 |
|
sl@0
|
275 |
EXPORT_C void CDummyGc::DrawPolyLine(const CArrayFix<TPoint>* /*aPointList*/)
|
sl@0
|
276 |
{
|
sl@0
|
277 |
iDevice->iConsole->Printf(_L("DrawPolyLine\n"));
|
sl@0
|
278 |
}
|
sl@0
|
279 |
|
sl@0
|
280 |
EXPORT_C void CDummyGc::DrawPolyLine(const TPoint* /*aPointList*/,TInt /*aNumPoints*/)
|
sl@0
|
281 |
{
|
sl@0
|
282 |
iDevice->iConsole->Printf(_L("DrawPolyLine\n"));
|
sl@0
|
283 |
}
|
sl@0
|
284 |
|
sl@0
|
285 |
EXPORT_C void CDummyGc::DrawPie(const TRect& /*aRect*/,const TPoint& /*aStart*/,const TPoint& /*aEnd*/)
|
sl@0
|
286 |
{
|
sl@0
|
287 |
iDevice->iConsole->Printf(_L("DrawPie\n"));
|
sl@0
|
288 |
}
|
sl@0
|
289 |
|
sl@0
|
290 |
EXPORT_C void CDummyGc::DrawEllipse(const TRect& /*aRect*/)
|
sl@0
|
291 |
{
|
sl@0
|
292 |
iDevice->iConsole->Printf(_L("DrawEllipse\n"));
|
sl@0
|
293 |
}
|
sl@0
|
294 |
|
sl@0
|
295 |
EXPORT_C void CDummyGc::DrawRect(const TRect& /*aRect*/)
|
sl@0
|
296 |
{
|
sl@0
|
297 |
iDevice->iConsole->Printf(_L("DrawRect\n"));
|
sl@0
|
298 |
}
|
sl@0
|
299 |
|
sl@0
|
300 |
EXPORT_C void CDummyGc::DrawRoundRect(const TRect& /*aRect*/,const TSize& /*aCornerSize*/)
|
sl@0
|
301 |
{
|
sl@0
|
302 |
iDevice->iConsole->Printf(_L("DrawRoundRect\n"));
|
sl@0
|
303 |
}
|
sl@0
|
304 |
|
sl@0
|
305 |
EXPORT_C TInt CDummyGc::DrawPolygon(const CArrayFix<TPoint>* /*aPointList*/,TFillRule /*aFillRule*/)
|
sl@0
|
306 |
{
|
sl@0
|
307 |
iDevice->iConsole->Printf(_L("DrawPolygon\n"));
|
sl@0
|
308 |
return KErrNone;
|
sl@0
|
309 |
}
|
sl@0
|
310 |
|
sl@0
|
311 |
EXPORT_C TInt CDummyGc::DrawPolygon(const TPoint* /*aPointList*/,TInt /*aNumPoints*/,TFillRule /*aFillRule*/)
|
sl@0
|
312 |
{
|
sl@0
|
313 |
iDevice->iConsole->Printf(_L("DrawPolygon\n"));
|
sl@0
|
314 |
return KErrNone;
|
sl@0
|
315 |
}
|
sl@0
|
316 |
|
sl@0
|
317 |
EXPORT_C void CDummyGc::DrawBitmap(const TPoint& /*aTopLeft*/,const CFbsBitmap* /*aSource*/)
|
sl@0
|
318 |
{
|
sl@0
|
319 |
iDevice->iConsole->Printf(_L("DrawBitmap\n"));
|
sl@0
|
320 |
}
|
sl@0
|
321 |
|
sl@0
|
322 |
EXPORT_C void CDummyGc::DrawBitmap(const TRect& /*aDestRect*/,const CFbsBitmap* /*aSource*/)
|
sl@0
|
323 |
{
|
sl@0
|
324 |
iDevice->iConsole->Printf(_L("DrawBitmap\n"));
|
sl@0
|
325 |
}
|
sl@0
|
326 |
|
sl@0
|
327 |
EXPORT_C void CDummyGc::DrawBitmap(const TRect& /*aDestRect*/,const CFbsBitmap* /*aSource*/,const TRect& /*aSourceRect*/)
|
sl@0
|
328 |
{
|
sl@0
|
329 |
iDevice->iConsole->Printf(_L("DrawBitmap\n"));
|
sl@0
|
330 |
}
|
sl@0
|
331 |
|
sl@0
|
332 |
EXPORT_C void CDummyGc::DrawText(const TDesC& /*aString*/,const TPoint& /*aPosition*/)
|
sl@0
|
333 |
{
|
sl@0
|
334 |
iDevice->iConsole->Printf(_L("DrawText\n"));
|
sl@0
|
335 |
}
|
sl@0
|
336 |
|
sl@0
|
337 |
EXPORT_C void CDummyGc::DrawText(const TDesC& /*aString*/,const TRect& /*aBox*/,TInt /*aBaselineOffset*/,TTextAlign /*aHoriz*/,TInt /*aLeftMrg*/)
|
sl@0
|
338 |
{
|
sl@0
|
339 |
iDevice->iConsole->Printf(_L("DrawText\n"));
|
sl@0
|
340 |
}
|
sl@0
|
341 |
|
sl@0
|
342 |
EXPORT_C void CDummyGc::DrawBitmapMasked(const TRect& /*aDestRect*/,const CFbsBitmap* /*aBitmap*/,const TRect& /*aSourceRect*/,const CFbsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/)
|
sl@0
|
343 |
{
|
sl@0
|
344 |
}
|
sl@0
|
345 |
|
sl@0
|
346 |
EXPORT_C void CDummyGc::DrawBitmapMasked(const TRect& /*aDestRect*/,const CWsBitmap* /*aBitmap*/,const TRect& /*aSourceRect*/,const CWsBitmap* /*aMaskBitmap*/,TBool /*aInvertMask*/)
|
sl@0
|
347 |
{
|
sl@0
|
348 |
}
|