os/graphics/windowing/windowserver/test/t_eventchecker/src/graphicscontextchecker.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/t_eventchecker/src/graphicscontextchecker.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,585 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include "graphicscontextchecker.h"
1.20 +#include "panics.h"
1.21 +
1.22 +#define CHECK_TEXTCURSOR() \
1.23 + CHK_ASSERT_ALWAYS(iTextCursor, EEventCheckerPanicUsingMWsTextCursorAfterEnd)
1.24 +
1.25 +#define CHECK_FADER() \
1.26 + CHK_ASSERT_ALWAYS(iFader, EEventCheckerPanicUsingMWsFaderAfterEnd)
1.27 +
1.28 +#define CHECK_DRAWING_TARGET() \
1.29 + CHK_ASSERT_ALWAYS(iTarget != ETargetNone, EEventCheckerPanicDrawingWithoutTarget)
1.30 +
1.31 +#define CHECK_GC_AND_DRAWING_TARGET() \
1.32 + do { \
1.33 + CHK_ASSERT_ALWAYS(iContext, EEventCheckerPanicUsingMWsGraphicsContextAfterEnd); \
1.34 + CHECK_DRAWING_TARGET(); \
1.35 + } while(EFalse)
1.36 +
1.37 +#define CHECK_TEXTCURSOR_AND_DRAWING_TARGET() \
1.38 + do { \
1.39 + CHECK_TEXTCURSOR(); \
1.40 + CHECK_DRAWING_TARGET(); \
1.41 + } while(EFalse)
1.42 +
1.43 +#define CHECK_FADER_AND_DRAWING_TARGET() \
1.44 + do { \
1.45 + CHECK_FADER(); \
1.46 + CHECK_DRAWING_TARGET(); \
1.47 + } while(EFalse)
1.48 +
1.49 +CGraphicsContextChecker* CGraphicsContextChecker::NewL(MWsGraphicDrawerEnvironment& /*aEnv*/)
1.50 + {
1.51 + CGraphicsContextChecker* self = new(ELeave) CGraphicsContextChecker();
1.52 + return self;
1.53 + }
1.54 +
1.55 +CGraphicsContextChecker::CGraphicsContextChecker()
1.56 + : iTarget(ETargetNone)
1.57 + {
1.58 + }
1.59 +
1.60 +CGraphicsContextChecker::~CGraphicsContextChecker()
1.61 + {
1.62 + iContext = NULL;
1.63 + iTextCursor = NULL;
1.64 + iFader = NULL;
1.65 + }
1.66 +
1.67 +void CGraphicsContextChecker::SetGraphicsContext(MWsGraphicsContext* aGraphicsContext)
1.68 + {
1.69 + iContext = aGraphicsContext;
1.70 + }
1.71 +
1.72 +const MWsGraphicsContext* CGraphicsContextChecker::GraphicsContext() const
1.73 + {
1.74 + return iContext;
1.75 + }
1.76 +
1.77 +void CGraphicsContextChecker::SetTextCursor(MWsTextCursor* aTextCursor)
1.78 + {
1.79 + iTextCursor = aTextCursor;
1.80 + }
1.81 +
1.82 +const MWsTextCursor* CGraphicsContextChecker::TextCursor() const
1.83 + {
1.84 + return iTextCursor;
1.85 + }
1.86 +
1.87 +void CGraphicsContextChecker::SetFader(MWsFader* aFader)
1.88 + {
1.89 + iFader = aFader;
1.90 + }
1.91 +
1.92 +const MWsFader* CGraphicsContextChecker::Fader() const
1.93 + {
1.94 + return iFader;
1.95 + }
1.96 +
1.97 +TAny* CGraphicsContextChecker::ResolveObjectInterface(TUint aTypeId)
1.98 + {
1.99 + if(aTypeId == MWsDrawAnnotationObserver::EWsObjectInterfaceId)
1.100 + return static_cast<MWsDrawAnnotationObserver*>(this);
1.101 +
1.102 + //The remaining part of this method isn't exactly beautiful since we are merging three object
1.103 + //provider interfaces into one object, so we have no way of knowing
1.104 + //which interface this method was called on.
1.105 + //however, aTypeId is a unique id and the chance that multiple
1.106 + //mixins implement the same extension is slim
1.107 + TAny* interface = NULL;
1.108 + if(!interface && iContext)
1.109 + interface = iContext->ResolveObjectInterface(aTypeId);
1.110 + if(!interface && iTextCursor)
1.111 + interface = iTextCursor->ResolveObjectInterface(aTypeId);
1.112 + if(!interface && iFader)
1.113 + interface = iFader->ResolveObjectInterface(aTypeId);
1.114 + return interface;
1.115 + }
1.116 +
1.117 +void CGraphicsContextChecker::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap)
1.118 + {
1.119 + CHECK_GC_AND_DRAWING_TARGET();
1.120 + iContext->BitBlt(aDestPos, aSourceBitmap);
1.121 + }
1.122 +
1.123 +void CGraphicsContextChecker::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect)
1.124 + {
1.125 + CHECK_GC_AND_DRAWING_TARGET();
1.126 + iContext->BitBlt(aDestPos, aSourceBitmap, aSourceRect);
1.127 + }
1.128 +
1.129 +void CGraphicsContextChecker::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask)
1.130 + {
1.131 + CHECK_GC_AND_DRAWING_TARGET();
1.132 + iContext->BitBltMasked(aDestPos, aSourceBitmap, aSourceRect, aMaskBitmap, aInvertMask);
1.133 + }
1.134 +
1.135 +void CGraphicsContextChecker::BitBltMasked(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, const TPoint& aMaskPos)
1.136 + {
1.137 + CHECK_GC_AND_DRAWING_TARGET();
1.138 + iContext->BitBltMasked(aDestPos, aSourceBitmap, aSourceRect, aMaskBitmap, aMaskPos);
1.139 + }
1.140 +
1.141 +void CGraphicsContextChecker::ResetClippingRegion()
1.142 + {
1.143 + CHECK_GC_AND_DRAWING_TARGET();
1.144 + iContext->ResetClippingRegion();
1.145 + }
1.146 +
1.147 +void CGraphicsContextChecker::Clear()
1.148 + {
1.149 + CHECK_GC_AND_DRAWING_TARGET();
1.150 + iContext->Clear();
1.151 + }
1.152 +
1.153 +void CGraphicsContextChecker::Clear(const TRect& aRect)
1.154 + {
1.155 + CHECK_GC_AND_DRAWING_TARGET();
1.156 + iContext->Clear(aRect);
1.157 + }
1.158 +
1.159 +void CGraphicsContextChecker::ResetBrushPattern()
1.160 + {
1.161 + CHECK_GC_AND_DRAWING_TARGET();
1.162 + iContext->ResetBrushPattern();
1.163 + }
1.164 +
1.165 +void CGraphicsContextChecker::ResetFont()
1.166 + {
1.167 + CHECK_GC_AND_DRAWING_TARGET();
1.168 + iContext->ResetFont();
1.169 + }
1.170 +
1.171 +void CGraphicsContextChecker::DrawArc(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
1.172 + {
1.173 + CHECK_GC_AND_DRAWING_TARGET();
1.174 + iContext->DrawArc(aRect, aStart, aEnd);
1.175 + }
1.176 +
1.177 +void CGraphicsContextChecker::DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
1.178 + {
1.179 + CHECK_GC_AND_DRAWING_TARGET();
1.180 + iContext->DrawPie(aRect, aStart, aEnd);
1.181 + }
1.182 +
1.183 +void CGraphicsContextChecker::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
1.184 + {
1.185 + CHECK_GC_AND_DRAWING_TARGET();
1.186 + iContext->DrawBitmap(aDestRect, aSourceBitmap);
1.187 + }
1.188 +
1.189 +void CGraphicsContextChecker::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect)
1.190 + {
1.191 + CHECK_GC_AND_DRAWING_TARGET();
1.192 + iContext->DrawBitmap(aDestRect, aSourceBitmap, aSourceRect);
1.193 + }
1.194 +
1.195 +void CGraphicsContextChecker::DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap, const TRect& aSourceRect, const CFbsBitmap& aMaskBitmap, TBool aInvertMask)
1.196 + {
1.197 + CHECK_GC_AND_DRAWING_TARGET();
1.198 + iContext->DrawBitmapMasked(aDestRect, aSourceBitmap, aSourceRect, aMaskBitmap, aInvertMask);
1.199 + }
1.200 +
1.201 +void CGraphicsContextChecker::DrawRoundRect(const TRect& aRect, const TSize& aEllipse)
1.202 + {
1.203 + CHECK_GC_AND_DRAWING_TARGET();
1.204 + iContext->DrawRoundRect(aRect, aEllipse);
1.205 + }
1.206 +
1.207 +void CGraphicsContextChecker::DrawPolyLine(const TArray<TPoint>& aPointList)
1.208 + {
1.209 + CHECK_GC_AND_DRAWING_TARGET();
1.210 + iContext->DrawPolyLine(aPointList);
1.211 + }
1.212 +
1.213 +void CGraphicsContextChecker::DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList)
1.214 + {
1.215 + CHECK_GC_AND_DRAWING_TARGET();
1.216 + iContext->DrawPolyLineNoEndPoint(aPointList);
1.217 + }
1.218 +
1.219 +void CGraphicsContextChecker::DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule)
1.220 + {
1.221 + CHECK_GC_AND_DRAWING_TARGET();
1.222 + iContext->DrawPolygon(aPointList, aFillRule);
1.223 + }
1.224 +
1.225 +void CGraphicsContextChecker::DrawEllipse(const TRect& aRect)
1.226 + {
1.227 + CHECK_GC_AND_DRAWING_TARGET();
1.228 + iContext->DrawEllipse(aRect);
1.229 + }
1.230 +
1.231 +void CGraphicsContextChecker::DrawLine(const TPoint& aStart, const TPoint& aEnd)
1.232 + {
1.233 + CHECK_GC_AND_DRAWING_TARGET();
1.234 + iContext->DrawLine(aStart, aEnd);
1.235 + }
1.236 +
1.237 +void CGraphicsContextChecker::DrawLineTo(const TPoint& aPoint)
1.238 + {
1.239 + CHECK_GC_AND_DRAWING_TARGET();
1.240 + iContext->DrawLineTo(aPoint);
1.241 + }
1.242 +
1.243 +void CGraphicsContextChecker::DrawLineBy(const TPoint& aVector)
1.244 + {
1.245 + CHECK_GC_AND_DRAWING_TARGET();
1.246 + iContext->DrawLineBy(aVector);
1.247 + }
1.248 +
1.249 +void CGraphicsContextChecker::DrawRect(const TRect& aRect)
1.250 + {
1.251 + CHECK_GC_AND_DRAWING_TARGET();
1.252 + iContext->DrawRect(aRect);
1.253 + }
1.254 +
1.255 +void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam)
1.256 + {
1.257 + CHECK_GC_AND_DRAWING_TARGET();
1.258 + iContext->DrawText(aText, aParam);
1.259 + }
1.260 +
1.261 +void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition)
1.262 + {
1.263 + CHECK_GC_AND_DRAWING_TARGET();
1.264 + iContext->DrawText(aText, aParam, aPosition);
1.265 + }
1.266 +
1.267 +void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect)
1.268 + {
1.269 + CHECK_GC_AND_DRAWING_TARGET();
1.270 + iContext->DrawText(aText, aParam, aClipRect);
1.271 + }
1.272 +
1.273 +void CGraphicsContextChecker::DrawText(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipFillRect, TInt aBaselineOffset, TTextAlign aHrz, TInt aMargin)
1.274 + {
1.275 + CHECK_GC_AND_DRAWING_TARGET();
1.276 + iContext->DrawText(aText, aParam, aClipFillRect, aBaselineOffset, aHrz, aMargin);
1.277 + }
1.278 +
1.279 +void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp)
1.280 + {
1.281 + CHECK_GC_AND_DRAWING_TARGET();
1.282 + iContext->DrawTextVertical(aText, aParam, aUp);
1.283 + }
1.284 +
1.285 +void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TPoint& aPosition, TBool aUp)
1.286 + {
1.287 + CHECK_GC_AND_DRAWING_TARGET();
1.288 + iContext->DrawTextVertical(aText, aParam, aPosition, aUp);
1.289 + }
1.290 +
1.291 +void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TBool aUp)
1.292 + {
1.293 + CHECK_GC_AND_DRAWING_TARGET();
1.294 + iContext->DrawTextVertical(aText, aParam, aClipRect, aUp);
1.295 + }
1.296 +
1.297 +void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TBool aUp, TTextAlign aVert, TInt aMargin)
1.298 + {
1.299 + CHECK_GC_AND_DRAWING_TARGET();
1.300 + iContext->DrawTextVertical(aText, aParam, aClipRect, aBaselineOffset, aUp, aVert, aMargin);
1.301 + }
1.302 +
1.303 +void CGraphicsContextChecker::DrawTextVertical(const TDesC& aText, const TTextParameters* aParam, const TRect& aClipRect, TInt aBaselineOffset, TInt aTextWidth, TBool aUp, TTextAlign aVert, TInt aMargin)
1.304 + {
1.305 + CHECK_GC_AND_DRAWING_TARGET();
1.306 + iContext->DrawTextVertical(aText, aParam, aClipRect, aBaselineOffset, aTextWidth, aUp, aVert, aMargin);
1.307 + }
1.308 +
1.309 +void CGraphicsContextChecker::MoveTo(const TPoint& aPoint)
1.310 + {
1.311 + CHECK_GC_AND_DRAWING_TARGET();
1.312 + iContext->MoveTo(aPoint);
1.313 + }
1.314 +
1.315 +void CGraphicsContextChecker::MoveBy(const TPoint& aVector)
1.316 + {
1.317 + CHECK_GC_AND_DRAWING_TARGET();
1.318 + iContext->MoveBy(aVector);
1.319 + }
1.320 +
1.321 +void CGraphicsContextChecker::Plot(const TPoint& aPoint)
1.322 + {
1.323 + CHECK_GC_AND_DRAWING_TARGET();
1.324 + iContext->Plot(aPoint);
1.325 + }
1.326 +
1.327 +void CGraphicsContextChecker::Reset()
1.328 + {
1.329 + CHECK_GC_AND_DRAWING_TARGET();
1.330 + iContext->Reset();
1.331 + }
1.332 +
1.333 +void CGraphicsContextChecker::SetBrushColor(const TRgb& aColor)
1.334 + {
1.335 + CHECK_GC_AND_DRAWING_TARGET();
1.336 + iContext->SetBrushColor(aColor);
1.337 + }
1.338 +
1.339 +void CGraphicsContextChecker::SetBrushOrigin(const TPoint& aOrigin)
1.340 + {
1.341 + CHECK_GC_AND_DRAWING_TARGET();
1.342 + iContext->SetBrushOrigin(aOrigin);
1.343 + }
1.344 +
1.345 +void CGraphicsContextChecker::SetBrushStyle(TBrushStyle aBrushStyle)
1.346 + {
1.347 + CHECK_GC_AND_DRAWING_TARGET();
1.348 + iContext->SetBrushStyle(aBrushStyle);
1.349 + }
1.350 +
1.351 +void CGraphicsContextChecker::SetClippingRegion(const TRegion& aRegion)
1.352 + {
1.353 + CHECK_GC_AND_DRAWING_TARGET();
1.354 + iContext->SetClippingRegion(aRegion);
1.355 + }
1.356 +
1.357 +void CGraphicsContextChecker::SetDrawMode(TDrawMode aDrawMode)
1.358 + {
1.359 + CHECK_GC_AND_DRAWING_TARGET();
1.360 + iContext->SetDrawMode(aDrawMode);
1.361 + }
1.362 +
1.363 +void CGraphicsContextChecker::SetOrigin(const TPoint& aPoint)
1.364 + {
1.365 + CHECK_GC_AND_DRAWING_TARGET();
1.366 + iContext->SetOrigin(aPoint);
1.367 + }
1.368 +
1.369 +void CGraphicsContextChecker::SetPenColor(const TRgb& aColor)
1.370 + {
1.371 + CHECK_GC_AND_DRAWING_TARGET();
1.372 + iContext->SetPenColor(aColor);
1.373 + }
1.374 +
1.375 +void CGraphicsContextChecker::SetPenStyle(TPenStyle aPenStyle)
1.376 + {
1.377 + CHECK_GC_AND_DRAWING_TARGET();
1.378 + iContext->SetPenStyle(aPenStyle);
1.379 + }
1.380 +
1.381 +void CGraphicsContextChecker::SetPenSize(const TSize& aSize)
1.382 + {
1.383 + CHECK_GC_AND_DRAWING_TARGET();
1.384 + iContext->SetPenSize(aSize);
1.385 + }
1.386 +
1.387 +void CGraphicsContextChecker::SetTextShadowColor(const TRgb& aColor)
1.388 + {
1.389 + CHECK_GC_AND_DRAWING_TARGET();
1.390 + iContext->SetTextShadowColor(aColor);
1.391 + }
1.392 +
1.393 +void CGraphicsContextChecker::SetCharJustification(TInt aExcessWidth, TInt aNumChars)
1.394 + {
1.395 + CHECK_GC_AND_DRAWING_TARGET();
1.396 + iContext->SetCharJustification(aExcessWidth, aNumChars);
1.397 + }
1.398 +
1.399 +void CGraphicsContextChecker::SetWordJustification(TInt aExcessWidth, TInt aNumGaps)
1.400 + {
1.401 + CHECK_GC_AND_DRAWING_TARGET();
1.402 + iContext->SetWordJustification(aExcessWidth, aNumGaps);
1.403 + }
1.404 +
1.405 +void CGraphicsContextChecker::SetUnderlineStyle(TFontUnderline aUnderlineStyle)
1.406 + {
1.407 + CHECK_GC_AND_DRAWING_TARGET();
1.408 + iContext->SetUnderlineStyle(aUnderlineStyle);
1.409 + }
1.410 +
1.411 +void CGraphicsContextChecker::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)
1.412 + {
1.413 + CHECK_GC_AND_DRAWING_TARGET();
1.414 + iContext->SetStrikethroughStyle(aStrikethroughStyle);
1.415 + }
1.416 +
1.417 +void CGraphicsContextChecker::SetBrushPattern(const CFbsBitmap& aBitmap)
1.418 + {
1.419 + CHECK_GC_AND_DRAWING_TARGET();
1.420 + iContext->SetBrushPattern(aBitmap);
1.421 + }
1.422 +
1.423 +void CGraphicsContextChecker::SetBrushPattern(TInt aFbsBitmapHandle)
1.424 + {
1.425 + CHECK_GC_AND_DRAWING_TARGET();
1.426 + iContext->SetBrushPattern(aFbsBitmapHandle);
1.427 + }
1.428 +
1.429 +void CGraphicsContextChecker::SetFont(const CFont* aFont)
1.430 + {
1.431 + CHECK_GC_AND_DRAWING_TARGET();
1.432 + iContext->SetFont(aFont);
1.433 + }
1.434 +
1.435 +void CGraphicsContextChecker::CopyRect(const TPoint& aOffset, const TRect& aRect)
1.436 + {
1.437 + CHECK_GC_AND_DRAWING_TARGET();
1.438 + iContext->CopyRect(aOffset, aRect);
1.439 + }
1.440 +
1.441 +void CGraphicsContextChecker::UpdateJustification(const TDesC& aText, const TTextParameters* aParam)
1.442 + {
1.443 + CHECK_GC_AND_DRAWING_TARGET();
1.444 + iContext->UpdateJustification(aText, aParam);
1.445 + }
1.446 +
1.447 +void CGraphicsContextChecker::UpdateJustificationVertical(const TDesC& aText, const TTextParameters* aParam, TBool aUp)
1.448 + {
1.449 + CHECK_GC_AND_DRAWING_TARGET();
1.450 + iContext->UpdateJustificationVertical(aText, aParam, aUp);
1.451 + }
1.452 +
1.453 +void CGraphicsContextChecker::SetFontNoDuplicate(const CFont* aFont)
1.454 + {
1.455 + CHECK_GC_AND_DRAWING_TARGET();
1.456 + iContext->SetFontNoDuplicate(aFont);
1.457 + }
1.458 +
1.459 +TBool CGraphicsContextChecker::HasBrushPattern() const
1.460 + {
1.461 + CHECK_GC_AND_DRAWING_TARGET();
1.462 + return iContext->HasBrushPattern();
1.463 + }
1.464 +
1.465 +TBool CGraphicsContextChecker::HasFont() const
1.466 + {
1.467 + CHECK_GC_AND_DRAWING_TARGET();
1.468 + return iContext->HasFont();
1.469 + }
1.470 +
1.471 +TRgb CGraphicsContextChecker::BrushColor() const
1.472 + {
1.473 + CHECK_GC_AND_DRAWING_TARGET();
1.474 + return iContext->BrushColor();
1.475 + }
1.476 +
1.477 +TRgb CGraphicsContextChecker::PenColor() const
1.478 + {
1.479 + CHECK_GC_AND_DRAWING_TARGET();
1.480 + return iContext->PenColor();
1.481 + }
1.482 +
1.483 +TRgb CGraphicsContextChecker::TextShadowColor() const
1.484 + {
1.485 + CHECK_GC_AND_DRAWING_TARGET();
1.486 + return iContext->TextShadowColor();
1.487 + }
1.488 +
1.489 +TInt CGraphicsContextChecker::GetError()
1.490 + {
1.491 + CHECK_GC_AND_DRAWING_TARGET();
1.492 + return iContext->GetError();
1.493 + }
1.494 +
1.495 +TPoint CGraphicsContextChecker::Origin() const
1.496 + {
1.497 + CHECK_GC_AND_DRAWING_TARGET();
1.498 + return iContext->Origin();
1.499 + }
1.500 +
1.501 +const TRegion& CGraphicsContextChecker::ClippingRegion()
1.502 + {
1.503 + CHECK_GC_AND_DRAWING_TARGET();
1.504 + return iContext->ClippingRegion();
1.505 + }
1.506 +
1.507 +TInt CGraphicsContextChecker::Push()
1.508 + {
1.509 + CHECK_GC_AND_DRAWING_TARGET();
1.510 + return iContext->Push();
1.511 + }
1.512 +
1.513 +void CGraphicsContextChecker::Pop()
1.514 + {
1.515 + CHECK_GC_AND_DRAWING_TARGET();
1.516 + iContext->Pop();
1.517 + }
1.518 +
1.519 +void CGraphicsContextChecker::DrawTextCursor(const TTextCursorInfo& aTextCursorInfo)
1.520 + {
1.521 + //CHECK_TEXTCURSOR_AND_DRAWING_TARGET();
1.522 + CHECK_TEXTCURSOR();
1.523 + iTextCursor->DrawTextCursor(aTextCursorInfo);
1.524 + }
1.525 +
1.526 +void CGraphicsContextChecker::SetFadingParameters(const TDesC8& aData)
1.527 + {
1.528 + CHECK_FADER_AND_DRAWING_TARGET();
1.529 + iFader->SetFadingParameters(aData);
1.530 + }
1.531 +
1.532 +void CGraphicsContextChecker::FadeArea(const TRegion& aRegion)
1.533 + {
1.534 + CHECK_FADER_AND_DRAWING_TARGET();
1.535 + iFader->FadeArea(aRegion);
1.536 + }
1.537 +
1.538 +void CGraphicsContextChecker::WindowRedrawStart(const MWsWindowTreeNode& /*aWindowTreeNode*/, const TRegion& /*aRegion*/)
1.539 + {
1.540 + CHK_ASSERT_ALWAYS(iTarget == ETargetNone, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.541 + iTarget = ETargetWindow;
1.542 + }
1.543 +
1.544 +void CGraphicsContextChecker::WindowRedrawEnd(const MWsWindowTreeNode& /*aWindowTreeNode*/)
1.545 + {
1.546 + CHK_ASSERT_ALWAYS(iTarget == ETargetWindow, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.547 + iTarget = ETargetNone;
1.548 + }
1.549 +
1.550 +void CGraphicsContextChecker::WindowAnimRedrawStart(const MWsWindowTreeNode& /*aWindowTreeNode*/, const TRegion& /*aRegion*/)
1.551 + {
1.552 + CHK_ASSERT_ALWAYS(iTarget == ETargetNone, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.553 + iTarget = ETargetWindowAnim;
1.554 + }
1.555 +
1.556 +void CGraphicsContextChecker::WindowAnimRedrawEnd(const MWsWindowTreeNode& /*aWindowTreeNode*/)
1.557 + {
1.558 + CHK_ASSERT_ALWAYS(iTarget == ETargetWindowAnim, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.559 + iTarget = ETargetNone;
1.560 + }
1.561 +
1.562 +void CGraphicsContextChecker::SpriteRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& /*aRegion*/)
1.563 + {
1.564 + CHK_ASSERT_ALWAYS(iTarget==ETargetNone, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.565 + iTarget = (aWindowTreeNode.ParentNode()->NodeType() == MWsWindowTreeNode::EWinTreeNodeRoot) ? ETargetFloatingSprite : ETargetWindowSprite;
1.566 + }
1.567 +
1.568 +void CGraphicsContextChecker::SpriteRedrawEnd(const MWsWindowTreeNode& /*aWindowTreeNode*/)
1.569 + {
1.570 + CHK_ASSERT_ALWAYS((iTarget==ETargetFloatingSprite || iTarget==ETargetWindowSprite), EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.571 + iTarget = ETargetNone;
1.572 + }
1.573 +
1.574 +void CGraphicsContextChecker::SpriteFlash(const MWsWindowTreeNode& /*aWindowTreeNode*/, TBool /*aFlashOn*/)
1.575 + {
1.576 + CHK_ASSERT_ALWAYS((iTarget==ETargetFloatingSprite || iTarget==ETargetWindowSprite), EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.577 + }
1.578 +
1.579 +void CGraphicsContextChecker::SegmentRedrawStart(const TRegion& /*aRegion*/)
1.580 + {
1.581 + CHK_ASSERT_ALWAYS(iTarget == ETargetWindow, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.582 + }
1.583 +
1.584 +void CGraphicsContextChecker::SegmentRedrawEnd()
1.585 + {
1.586 + CHK_ASSERT_ALWAYS(iTarget == ETargetWindow, EEventCheckerPanicUnbalancedDrawingTargetEvents);
1.587 + }
1.588 +