|
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 #include "graphicscontextchecker.h" |
|
17 #include "panics.h" |
|
18 |
|
19 #define CHECK_TEXTCURSOR() \ |
|
20 CHK_ASSERT_ALWAYS(iTextCursor, EEventCheckerPanicUsingMWsTextCursorAfterEnd) |
|
21 |
|
22 #define CHECK_FADER() \ |
|
23 CHK_ASSERT_ALWAYS(iFader, EEventCheckerPanicUsingMWsFaderAfterEnd) |
|
24 |
|
25 #define CHECK_DRAWING_TARGET() \ |
|
26 CHK_ASSERT_ALWAYS(iTarget != ETargetNone, EEventCheckerPanicDrawingWithoutTarget) |
|
27 |
|
28 #define CHECK_GC_AND_DRAWING_TARGET() \ |
|
29 do { \ |
|
30 CHK_ASSERT_ALWAYS(iContext, EEventCheckerPanicUsingMWsGraphicsContextAfterEnd); \ |
|
31 CHECK_DRAWING_TARGET(); \ |
|
32 } while(EFalse) |
|
33 |
|
34 #define CHECK_TEXTCURSOR_AND_DRAWING_TARGET() \ |
|
35 do { \ |
|
36 CHECK_TEXTCURSOR(); \ |
|
37 CHECK_DRAWING_TARGET(); \ |
|
38 } while(EFalse) |
|
39 |
|
40 #define CHECK_FADER_AND_DRAWING_TARGET() \ |
|
41 do { \ |
|
42 CHECK_FADER(); \ |
|
43 CHECK_DRAWING_TARGET(); \ |
|
44 } while(EFalse) |
|
45 |
|
46 CGraphicsContextChecker* CGraphicsContextChecker::NewL(MWsGraphicDrawerEnvironment& /*aEnv*/) |
|
47 { |
|
48 CGraphicsContextChecker* self = new(ELeave) CGraphicsContextChecker(); |
|
49 return self; |
|
50 } |
|
51 |
|
52 CGraphicsContextChecker::CGraphicsContextChecker() |
|
53 : iTarget(ETargetNone) |
|
54 { |
|
55 } |
|
56 |
|
57 CGraphicsContextChecker::~CGraphicsContextChecker() |
|
58 { |
|
59 iContext = NULL; |
|
60 iTextCursor = NULL; |
|
61 iFader = NULL; |
|
62 } |
|
63 |
|
64 void CGraphicsContextChecker::SetGraphicsContext(MWsGraphicsContext* aGraphicsContext) |
|
65 { |
|
66 iContext = aGraphicsContext; |
|
67 } |
|
68 |
|
69 const MWsGraphicsContext* CGraphicsContextChecker::GraphicsContext() const |
|
70 { |
|
71 return iContext; |
|
72 } |
|
73 |
|
74 void CGraphicsContextChecker::SetTextCursor(MWsTextCursor* aTextCursor) |
|
75 { |
|
76 iTextCursor = aTextCursor; |
|
77 } |
|
78 |
|
79 const MWsTextCursor* CGraphicsContextChecker::TextCursor() const |
|
80 { |
|
81 return iTextCursor; |
|
82 } |
|
83 |
|
84 void CGraphicsContextChecker::SetFader(MWsFader* aFader) |
|
85 { |
|
86 iFader = aFader; |
|
87 } |
|
88 |
|
89 const MWsFader* CGraphicsContextChecker::Fader() const |
|
90 { |
|
91 return iFader; |
|
92 } |
|
93 |
|
94 TAny* CGraphicsContextChecker::ResolveObjectInterface(TUint aTypeId) |
|
95 { |
|
96 if(aTypeId == MWsDrawAnnotationObserver::EWsObjectInterfaceId) |
|
97 return static_cast<MWsDrawAnnotationObserver*>(this); |
|
98 |
|
99 //The remaining part of this method isn't exactly beautiful since we are merging three object |
|
100 //provider interfaces into one object, so we have no way of knowing |
|
101 //which interface this method was called on. |
|
102 //however, aTypeId is a unique id and the chance that multiple |
|
103 //mixins implement the same extension is slim |
|
104 TAny* interface = NULL; |
|
105 if(!interface && iContext) |
|
106 interface = iContext->ResolveObjectInterface(aTypeId); |
|
107 if(!interface && iTextCursor) |
|
108 interface = iTextCursor->ResolveObjectInterface(aTypeId); |
|
109 if(!interface && iFader) |
|
110 interface = iFader->ResolveObjectInterface(aTypeId); |
|
111 return interface; |
|
112 } |
|
113 |
|
114 void CGraphicsContextChecker::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap) |
|
115 { |
|
116 CHECK_GC_AND_DRAWING_TARGET(); |
|
117 iContext->BitBlt(aDestPos, aSourceBitmap); |
|
118 } |
|
119 |
|
120 void CGraphicsContextChecker::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect) |
|
121 { |
|
122 CHECK_GC_AND_DRAWING_TARGET(); |
|
123 iContext->BitBlt(aDestPos, aSourceBitmap, aSourceRect); |
|
124 } |
|
125 |
|
126 void CGraphicsContextChecker::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask) |
|
127 { |
|
128 CHECK_GC_AND_DRAWING_TARGET(); |
|
129 iContext->BitBltMasked(aDestPos, aSourceBitmap, aSourceRect, aMaskBitmap, aInvertMask); |
|
130 } |
|
131 |
|
132 void CGraphicsContextChecker::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos) |
|
133 { |
|
134 CHECK_GC_AND_DRAWING_TARGET(); |
|
135 iContext->BitBltMasked(aDestPos, aSourceBitmap, aSourceRect, aMaskBitmap, aMaskPos); |
|
136 } |
|
137 |
|
138 void CGraphicsContextChecker::ResetClippingRegion() |
|
139 { |
|
140 CHECK_GC_AND_DRAWING_TARGET(); |
|
141 iContext->ResetClippingRegion(); |
|
142 } |
|
143 |
|
144 void CGraphicsContextChecker::Clear() |
|
145 { |
|
146 CHECK_GC_AND_DRAWING_TARGET(); |
|
147 iContext->Clear(); |
|
148 } |
|
149 |
|
150 void CGraphicsContextChecker::Clear(const TRect& aRect) |
|
151 { |
|
152 CHECK_GC_AND_DRAWING_TARGET(); |
|
153 iContext->Clear(aRect); |
|
154 } |
|
155 |
|
156 void CGraphicsContextChecker::ResetBrushPattern() |
|
157 { |
|
158 CHECK_GC_AND_DRAWING_TARGET(); |
|
159 iContext->ResetBrushPattern(); |
|
160 } |
|
161 |
|
162 void CGraphicsContextChecker::ResetFont() |
|
163 { |
|
164 CHECK_GC_AND_DRAWING_TARGET(); |
|
165 iContext->ResetFont(); |
|
166 } |
|
167 |
|
168 void CGraphicsContextChecker::DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd) |
|
169 { |
|
170 CHECK_GC_AND_DRAWING_TARGET(); |
|
171 iContext->DrawArc(aRect, aStart, aEnd); |
|
172 } |
|
173 |
|
174 void CGraphicsContextChecker::DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd) |
|
175 { |
|
176 CHECK_GC_AND_DRAWING_TARGET(); |
|
177 iContext->DrawPie(aRect, aStart, aEnd); |
|
178 } |
|
179 |
|
180 void CGraphicsContextChecker::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap) |
|
181 { |
|
182 CHECK_GC_AND_DRAWING_TARGET(); |
|
183 iContext->DrawBitmap(aDestRect, aSourceBitmap); |
|
184 } |
|
185 |
|
186 void CGraphicsContextChecker::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect) |
|
187 { |
|
188 CHECK_GC_AND_DRAWING_TARGET(); |
|
189 iContext->DrawBitmap(aDestRect, aSourceBitmap, aSourceRect); |
|
190 } |
|
191 |
|
192 void CGraphicsContextChecker::DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask) |
|
193 { |
|
194 CHECK_GC_AND_DRAWING_TARGET(); |
|
195 iContext->DrawBitmapMasked(aDestRect, aSourceBitmap, aSourceRect, aMaskBitmap, aInvertMask); |
|
196 } |
|
197 |
|
198 void CGraphicsContextChecker::DrawRoundRect(const TRect& aRect, const TSize& aEllipse) |
|
199 { |
|
200 CHECK_GC_AND_DRAWING_TARGET(); |
|
201 iContext->DrawRoundRect(aRect, aEllipse); |
|
202 } |
|
203 |
|
204 void CGraphicsContextChecker::DrawPolyLine(const TArray<TPoint>& aPointList) |
|
205 { |
|
206 CHECK_GC_AND_DRAWING_TARGET(); |
|
207 iContext->DrawPolyLine(aPointList); |
|
208 } |
|
209 |
|
210 void CGraphicsContextChecker::DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList) |
|
211 { |
|
212 CHECK_GC_AND_DRAWING_TARGET(); |
|
213 iContext->DrawPolyLineNoEndPoint(aPointList); |
|
214 } |
|
215 |
|
216 void CGraphicsContextChecker::DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule) |
|
217 { |
|
218 CHECK_GC_AND_DRAWING_TARGET(); |
|
219 iContext->DrawPolygon(aPointList, aFillRule); |
|
220 } |
|
221 |
|
222 void CGraphicsContextChecker::DrawEllipse(const TRect& aRect) |
|
223 { |
|
224 CHECK_GC_AND_DRAWING_TARGET(); |
|
225 iContext->DrawEllipse(aRect); |
|
226 } |
|
227 |
|
228 void CGraphicsContextChecker::DrawLine(const TPoint& aStart, const TPoint& aEnd) |
|
229 { |
|
230 CHECK_GC_AND_DRAWING_TARGET(); |
|
231 iContext->DrawLine(aStart, aEnd); |
|
232 } |
|
233 |
|
234 void CGraphicsContextChecker::DrawLineTo(const TPoint& aPoint) |
|
235 { |
|
236 CHECK_GC_AND_DRAWING_TARGET(); |
|
237 iContext->DrawLineTo(aPoint); |
|
238 } |
|
239 |
|
240 void CGraphicsContextChecker::DrawLineBy(const TPoint& aVector) |
|
241 { |
|
242 CHECK_GC_AND_DRAWING_TARGET(); |
|
243 iContext->DrawLineBy(aVector); |
|
244 } |
|
245 |
|
246 void CGraphicsContextChecker::DrawRect(const TRect& aRect) |
|
247 { |
|
248 CHECK_GC_AND_DRAWING_TARGET(); |
|
249 iContext->DrawRect(aRect); |
|
250 } |
|
251 |
|
252 void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam) |
|
253 { |
|
254 CHECK_GC_AND_DRAWING_TARGET(); |
|
255 iContext->DrawText(aText, aParam); |
|
256 } |
|
257 |
|
258 void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition) |
|
259 { |
|
260 CHECK_GC_AND_DRAWING_TARGET(); |
|
261 iContext->DrawText(aText, aParam, aPosition); |
|
262 } |
|
263 |
|
264 void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect) |
|
265 { |
|
266 CHECK_GC_AND_DRAWING_TARGET(); |
|
267 iContext->DrawText(aText, aParam, aClipRect); |
|
268 } |
|
269 |
|
270 void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipFillRect, TInt aBaselineOffset, TTextAlign aHrz, TInt aMargin) |
|
271 { |
|
272 CHECK_GC_AND_DRAWING_TARGET(); |
|
273 iContext->DrawText(aText, aParam, aClipFillRect, aBaselineOffset, aHrz, aMargin); |
|
274 } |
|
275 |
|
276 void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp) |
|
277 { |
|
278 CHECK_GC_AND_DRAWING_TARGET(); |
|
279 iContext->DrawTextVertical(aText, aParam, aUp); |
|
280 } |
|
281 |
|
282 void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition, TBool aUp) |
|
283 { |
|
284 CHECK_GC_AND_DRAWING_TARGET(); |
|
285 iContext->DrawTextVertical(aText, aParam, aPosition, aUp); |
|
286 } |
|
287 |
|
288 void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TBool aUp) |
|
289 { |
|
290 CHECK_GC_AND_DRAWING_TARGET(); |
|
291 iContext->DrawTextVertical(aText, aParam, aClipRect, aUp); |
|
292 } |
|
293 |
|
294 void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TBool aUp, TTextAlign aVert, TInt aMargin) |
|
295 { |
|
296 CHECK_GC_AND_DRAWING_TARGET(); |
|
297 iContext->DrawTextVertical(aText, aParam, aClipRect, aBaselineOffset, aUp, aVert, aMargin); |
|
298 } |
|
299 |
|
300 void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TInt aTextWidth, TBool aUp, TTextAlign aVert, TInt aMargin) |
|
301 { |
|
302 CHECK_GC_AND_DRAWING_TARGET(); |
|
303 iContext->DrawTextVertical(aText, aParam, aClipRect, aBaselineOffset, aTextWidth, aUp, aVert, aMargin); |
|
304 } |
|
305 |
|
306 void CGraphicsContextChecker::MoveTo(const TPoint& aPoint) |
|
307 { |
|
308 CHECK_GC_AND_DRAWING_TARGET(); |
|
309 iContext->MoveTo(aPoint); |
|
310 } |
|
311 |
|
312 void CGraphicsContextChecker::MoveBy(const TPoint& aVector) |
|
313 { |
|
314 CHECK_GC_AND_DRAWING_TARGET(); |
|
315 iContext->MoveBy(aVector); |
|
316 } |
|
317 |
|
318 void CGraphicsContextChecker::Plot(const TPoint& aPoint) |
|
319 { |
|
320 CHECK_GC_AND_DRAWING_TARGET(); |
|
321 iContext->Plot(aPoint); |
|
322 } |
|
323 |
|
324 void CGraphicsContextChecker::Reset() |
|
325 { |
|
326 CHECK_GC_AND_DRAWING_TARGET(); |
|
327 iContext->Reset(); |
|
328 } |
|
329 |
|
330 void CGraphicsContextChecker::SetBrushColor(const TRgb& aColor) |
|
331 { |
|
332 CHECK_GC_AND_DRAWING_TARGET(); |
|
333 iContext->SetBrushColor(aColor); |
|
334 } |
|
335 |
|
336 void CGraphicsContextChecker::SetBrushOrigin(const TPoint& aOrigin) |
|
337 { |
|
338 CHECK_GC_AND_DRAWING_TARGET(); |
|
339 iContext->SetBrushOrigin(aOrigin); |
|
340 } |
|
341 |
|
342 void CGraphicsContextChecker::SetBrushStyle(TBrushStyle aBrushStyle) |
|
343 { |
|
344 CHECK_GC_AND_DRAWING_TARGET(); |
|
345 iContext->SetBrushStyle(aBrushStyle); |
|
346 } |
|
347 |
|
348 void CGraphicsContextChecker::SetClippingRegion(const TRegion& aRegion) |
|
349 { |
|
350 CHECK_GC_AND_DRAWING_TARGET(); |
|
351 iContext->SetClippingRegion(aRegion); |
|
352 } |
|
353 |
|
354 void CGraphicsContextChecker::SetDrawMode(TDrawMode aDrawMode) |
|
355 { |
|
356 CHECK_GC_AND_DRAWING_TARGET(); |
|
357 iContext->SetDrawMode(aDrawMode); |
|
358 } |
|
359 |
|
360 void CGraphicsContextChecker::SetOrigin(const TPoint& aPoint) |
|
361 { |
|
362 CHECK_GC_AND_DRAWING_TARGET(); |
|
363 iContext->SetOrigin(aPoint); |
|
364 } |
|
365 |
|
366 void CGraphicsContextChecker::SetPenColor(const TRgb& aColor) |
|
367 { |
|
368 CHECK_GC_AND_DRAWING_TARGET(); |
|
369 iContext->SetPenColor(aColor); |
|
370 } |
|
371 |
|
372 void CGraphicsContextChecker::SetPenStyle(TPenStyle aPenStyle) |
|
373 { |
|
374 CHECK_GC_AND_DRAWING_TARGET(); |
|
375 iContext->SetPenStyle(aPenStyle); |
|
376 } |
|
377 |
|
378 void CGraphicsContextChecker::SetPenSize(const TSize& aSize) |
|
379 { |
|
380 CHECK_GC_AND_DRAWING_TARGET(); |
|
381 iContext->SetPenSize(aSize); |
|
382 } |
|
383 |
|
384 void CGraphicsContextChecker::SetTextShadowColor(const TRgb& aColor) |
|
385 { |
|
386 CHECK_GC_AND_DRAWING_TARGET(); |
|
387 iContext->SetTextShadowColor(aColor); |
|
388 } |
|
389 |
|
390 void CGraphicsContextChecker::SetCharJustification(TInt aExcessWidth, TInt aNumChars) |
|
391 { |
|
392 CHECK_GC_AND_DRAWING_TARGET(); |
|
393 iContext->SetCharJustification(aExcessWidth, aNumChars); |
|
394 } |
|
395 |
|
396 void CGraphicsContextChecker::SetWordJustification(TInt aExcessWidth, TInt aNumGaps) |
|
397 { |
|
398 CHECK_GC_AND_DRAWING_TARGET(); |
|
399 iContext->SetWordJustification(aExcessWidth, aNumGaps); |
|
400 } |
|
401 |
|
402 void CGraphicsContextChecker::SetUnderlineStyle(TFontUnderline aUnderlineStyle) |
|
403 { |
|
404 CHECK_GC_AND_DRAWING_TARGET(); |
|
405 iContext->SetUnderlineStyle(aUnderlineStyle); |
|
406 } |
|
407 |
|
408 void CGraphicsContextChecker::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle) |
|
409 { |
|
410 CHECK_GC_AND_DRAWING_TARGET(); |
|
411 iContext->SetStrikethroughStyle(aStrikethroughStyle); |
|
412 } |
|
413 |
|
414 void CGraphicsContextChecker::SetBrushPattern(const CFbsBitmap& aBitmap) |
|
415 { |
|
416 CHECK_GC_AND_DRAWING_TARGET(); |
|
417 iContext->SetBrushPattern(aBitmap); |
|
418 } |
|
419 |
|
420 void CGraphicsContextChecker::SetBrushPattern(TInt aFbsBitmapHandle) |
|
421 { |
|
422 CHECK_GC_AND_DRAWING_TARGET(); |
|
423 iContext->SetBrushPattern(aFbsBitmapHandle); |
|
424 } |
|
425 |
|
426 void CGraphicsContextChecker::SetFont(const CFont* aFont) |
|
427 { |
|
428 CHECK_GC_AND_DRAWING_TARGET(); |
|
429 iContext->SetFont(aFont); |
|
430 } |
|
431 |
|
432 void CGraphicsContextChecker::CopyRect(const TPoint& aOffset, const TRect& aRect) |
|
433 { |
|
434 CHECK_GC_AND_DRAWING_TARGET(); |
|
435 iContext->CopyRect(aOffset, aRect); |
|
436 } |
|
437 |
|
438 void CGraphicsContextChecker::UpdateJustification(const TDesC& aText, const TTextParameters* aParam) |
|
439 { |
|
440 CHECK_GC_AND_DRAWING_TARGET(); |
|
441 iContext->UpdateJustification(aText, aParam); |
|
442 } |
|
443 |
|
444 void CGraphicsContextChecker::UpdateJustificationVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp) |
|
445 { |
|
446 CHECK_GC_AND_DRAWING_TARGET(); |
|
447 iContext->UpdateJustificationVertical(aText, aParam, aUp); |
|
448 } |
|
449 |
|
450 void CGraphicsContextChecker::SetFontNoDuplicate(const CFont* aFont) |
|
451 { |
|
452 CHECK_GC_AND_DRAWING_TARGET(); |
|
453 iContext->SetFontNoDuplicate(aFont); |
|
454 } |
|
455 |
|
456 TBool CGraphicsContextChecker::HasBrushPattern() const |
|
457 { |
|
458 CHECK_GC_AND_DRAWING_TARGET(); |
|
459 return iContext->HasBrushPattern(); |
|
460 } |
|
461 |
|
462 TBool CGraphicsContextChecker::HasFont() const |
|
463 { |
|
464 CHECK_GC_AND_DRAWING_TARGET(); |
|
465 return iContext->HasFont(); |
|
466 } |
|
467 |
|
468 TRgb CGraphicsContextChecker::BrushColor() const |
|
469 { |
|
470 CHECK_GC_AND_DRAWING_TARGET(); |
|
471 return iContext->BrushColor(); |
|
472 } |
|
473 |
|
474 TRgb CGraphicsContextChecker::PenColor() const |
|
475 { |
|
476 CHECK_GC_AND_DRAWING_TARGET(); |
|
477 return iContext->PenColor(); |
|
478 } |
|
479 |
|
480 TRgb CGraphicsContextChecker::TextShadowColor() const |
|
481 { |
|
482 CHECK_GC_AND_DRAWING_TARGET(); |
|
483 return iContext->TextShadowColor(); |
|
484 } |
|
485 |
|
486 TInt CGraphicsContextChecker::GetError() |
|
487 { |
|
488 CHECK_GC_AND_DRAWING_TARGET(); |
|
489 return iContext->GetError(); |
|
490 } |
|
491 |
|
492 TPoint CGraphicsContextChecker::Origin() const |
|
493 { |
|
494 CHECK_GC_AND_DRAWING_TARGET(); |
|
495 return iContext->Origin(); |
|
496 } |
|
497 |
|
498 const TRegion& CGraphicsContextChecker::ClippingRegion() |
|
499 { |
|
500 CHECK_GC_AND_DRAWING_TARGET(); |
|
501 return iContext->ClippingRegion(); |
|
502 } |
|
503 |
|
504 TInt CGraphicsContextChecker::Push() |
|
505 { |
|
506 CHECK_GC_AND_DRAWING_TARGET(); |
|
507 return iContext->Push(); |
|
508 } |
|
509 |
|
510 void CGraphicsContextChecker::Pop() |
|
511 { |
|
512 CHECK_GC_AND_DRAWING_TARGET(); |
|
513 iContext->Pop(); |
|
514 } |
|
515 |
|
516 void CGraphicsContextChecker::DrawTextCursor(const TTextCursorInfo& aTextCursorInfo) |
|
517 { |
|
518 //CHECK_TEXTCURSOR_AND_DRAWING_TARGET(); |
|
519 CHECK_TEXTCURSOR(); |
|
520 iTextCursor->DrawTextCursor(aTextCursorInfo); |
|
521 } |
|
522 |
|
523 void CGraphicsContextChecker::SetFadingParameters(const TDesC8& aData) |
|
524 { |
|
525 CHECK_FADER_AND_DRAWING_TARGET(); |
|
526 iFader->SetFadingParameters(aData); |
|
527 } |
|
528 |
|
529 void CGraphicsContextChecker::FadeArea(const TRegion& aRegion) |
|
530 { |
|
531 CHECK_FADER_AND_DRAWING_TARGET(); |
|
532 iFader->FadeArea(aRegion); |
|
533 } |
|
534 |
|
535 void CGraphicsContextChecker::WindowRedrawStart(const MWsWindowTreeNode& /*aWindowTreeNode*/, const TRegion& /*aRegion*/) |
|
536 { |
|
537 CHK_ASSERT_ALWAYS(iTarget == ETargetNone, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
538 iTarget = ETargetWindow; |
|
539 } |
|
540 |
|
541 void CGraphicsContextChecker::WindowRedrawEnd(const MWsWindowTreeNode& /*aWindowTreeNode*/) |
|
542 { |
|
543 CHK_ASSERT_ALWAYS(iTarget == ETargetWindow, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
544 iTarget = ETargetNone; |
|
545 } |
|
546 |
|
547 void CGraphicsContextChecker::WindowAnimRedrawStart(const MWsWindowTreeNode& /*aWindowTreeNode*/, const TRegion& /*aRegion*/) |
|
548 { |
|
549 CHK_ASSERT_ALWAYS(iTarget == ETargetNone, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
550 iTarget = ETargetWindowAnim; |
|
551 } |
|
552 |
|
553 void CGraphicsContextChecker::WindowAnimRedrawEnd(const MWsWindowTreeNode& /*aWindowTreeNode*/) |
|
554 { |
|
555 CHK_ASSERT_ALWAYS(iTarget == ETargetWindowAnim, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
556 iTarget = ETargetNone; |
|
557 } |
|
558 |
|
559 void CGraphicsContextChecker::SpriteRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& /*aRegion*/) |
|
560 { |
|
561 CHK_ASSERT_ALWAYS(iTarget==ETargetNone, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
562 iTarget = (aWindowTreeNode.ParentNode()->NodeType() == MWsWindowTreeNode::EWinTreeNodeRoot) ? ETargetFloatingSprite : ETargetWindowSprite; |
|
563 } |
|
564 |
|
565 void CGraphicsContextChecker::SpriteRedrawEnd(const MWsWindowTreeNode& /*aWindowTreeNode*/) |
|
566 { |
|
567 CHK_ASSERT_ALWAYS((iTarget==ETargetFloatingSprite || iTarget==ETargetWindowSprite), EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
568 iTarget = ETargetNone; |
|
569 } |
|
570 |
|
571 void CGraphicsContextChecker::SpriteFlash(const MWsWindowTreeNode& /*aWindowTreeNode*/, TBool /*aFlashOn*/) |
|
572 { |
|
573 CHK_ASSERT_ALWAYS((iTarget==ETargetFloatingSprite || iTarget==ETargetWindowSprite), EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
574 } |
|
575 |
|
576 void CGraphicsContextChecker::SegmentRedrawStart(const TRegion& /*aRegion*/) |
|
577 { |
|
578 CHK_ASSERT_ALWAYS(iTarget == ETargetWindow, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
579 } |
|
580 |
|
581 void CGraphicsContextChecker::SegmentRedrawEnd() |
|
582 { |
|
583 CHK_ASSERT_ALWAYS(iTarget == ETargetWindow, EEventCheckerPanicUnbalancedDrawingTargetEvents); |
|
584 } |
|
585 |