os/graphics/windowing/windowserver/nonnga/SERVER/WSANIMGC.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/nonnga/SERVER/WSANIMGC.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,612 @@
     1.4 +// Copyright (c) 1996-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 +// Interface code for animated DLL's GC
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include <e32std.h>
    1.22 +#include "server.h"
    1.23 +#include "playbackgc.h"
    1.24 +#include "ANIM.H"
    1.25 +#include "wsfont.h"
    1.26 +
    1.27 +CWsAnimGc::CWsAnimGc() : iUserActive(EFalse), iUseDrawingRegion(EFalse)
    1.28 +	{
    1.29 +	__DECLARE_NAME(_S("CWsAnimGc"));
    1.30 +	}
    1.31 +
    1.32 +void CWsAnimGc::SetDrawingRegions(const TRegion *aRegion)
    1.33 +	{
    1.34 +	if (aRegion)
    1.35 +		{
    1.36 +		iDrawingRegion.Copy(*aRegion);
    1.37 +		iDrawingRegion.Offset(iWin->Origin());
    1.38 +		}
    1.39 +	iDrawingRegion.Intersect(*iBaseRegion);
    1.40 +	iDrawingRegion.Tidy();
    1.41 +	iGc->SetClippingRegion(iDrawingRegion);
    1.42 +	iUseDrawingRegion=ETrue;
    1.43 +	}
    1.44 +
    1.45 +void CWsAnimGc::Activate(CWsClientWindow *aWindow, CWsAnim *aWsAnim, const TRegion *aRegion, CFbsBitGc *aGc)
    1.46 +	{
    1.47 +	iOwningWsAnim=aWsAnim;
    1.48 +	if (iWin)
    1.49 +		iOwningWsAnim->Panic();
    1.50 +	iWin=aWindow;
    1.51 +	iBaseRegion=aRegion ? aRegion : &iWin->VisibleRegion();
    1.52 +
    1.53 +	iGc = aGc;
    1.54 +	iUserActive = ETrue;
    1.55 +	Reset();
    1.56 +	}
    1.57 +
    1.58 +void CWsAnimGc::Deactivate()
    1.59 +	{
    1.60 +	if (iUseDrawingRegion)
    1.61 +		{
    1.62 +		iDrawingRegion.Close();
    1.63 +		}
    1.64 +	iUseDrawingRegion=EFalse;
    1.65 +	CloseCurrentFont();
    1.66 +
    1.67 +	iWin=NULL;
    1.68 +	iGc=NULL;
    1.69 +	iUserActive = EFalse;
    1.70 +	}
    1.71 +
    1.72 +TBool CWsAnimGc::IsActive() const
    1.73 +	{
    1.74 +	return (iUserActive || (iGc != NULL));
    1.75 +	}
    1.76 +
    1.77 +void CWsAnimGc::UserActivate(CWsClientWindow *aWindow, CWsAnim *aWsAnim)
    1.78 +	{
    1.79 +	if (iWin)
    1.80 +		{
    1.81 +		UserDeactivate();
    1.82 +		iOwningWsAnim->Panic();
    1.83 +		}
    1.84 +	iOwningWsAnim=aWsAnim;
    1.85 +	iWin=aWindow;
    1.86 +	iUserActive = ETrue;
    1.87 +	}
    1.88 +
    1.89 +void CWsAnimGc::UserDeactivate()
    1.90 +	{
    1.91 +	CloseCurrentFont();
    1.92 +
    1.93 +	if (iWin && iOwningWsAnim)
    1.94 +		{
    1.95 +		TRegionFix<1> animRegion(iOwningWsAnim->BestRect());
    1.96 +		iWin->ScheduleRegionUpdate(&animRegion);
    1.97 +		}
    1.98 +
    1.99 +	iWin = NULL;
   1.100 +	iUserActive = EFalse;
   1.101 +	}
   1.102 +
   1.103 +void CWsAnimGc::AnimDeleted(CWsAnim *aWsAnim)
   1.104 +	{	
   1.105 +	if (iOwningWsAnim==aWsAnim)
   1.106 +		iOwningWsAnim=NULL;
   1.107 +	}
   1.108 +
   1.109 +CGraphicsDevice* CWsAnimGc::Device() const
   1.110 +	{
   1.111 +	if (!iUserActive)
   1.112 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.113 +
   1.114 +	return iGc ? iGc->Device() : NULL;
   1.115 +	}
   1.116 +
   1.117 +void CWsAnimGc::SetClippingRect(const TRect& aRect)
   1.118 +	{
   1.119 +	if (!iUserActive)
   1.120 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.121 +
   1.122 +	if (iGc)
   1.123 +		{
   1.124 +		iClippingRect=aRect;
   1.125 +		iClippingRect.Intersection(TRect(iWin->Size()));
   1.126 +		iGc->SetClippingRect(iClippingRect);
   1.127 +		}
   1.128 +	}
   1.129 +
   1.130 +TInt CWsAnimGc::SetClippingRegion(const TRegion &aRegion)
   1.131 +//This function is virtual and so cannot have an 'L' at the end of it's name
   1.132 +	{
   1.133 +	if (iWin==NULL)
   1.134 +		User::Leave(KErrGeneral);
   1.135 +
   1.136 +	if (iGc)
   1.137 +		SetDrawingRegions(&aRegion);
   1.138 +	return KErrNone;
   1.139 +	}
   1.140 +
   1.141 +void CWsAnimGc::CancelClippingRegion()
   1.142 +	{
   1.143 +	if (!iUserActive)
   1.144 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.145 +
   1.146 +	if (iGc)
   1.147 +		{
   1.148 +		iDrawingRegion.Clear();
   1.149 +		iUseDrawingRegion=EFalse;
   1.150 +		iGc->SetClippingRegion(iBaseRegion);
   1.151 +		}
   1.152 +	}
   1.153 +
   1.154 +void CWsAnimGc::CancelClippingRect()
   1.155 +	{
   1.156 +	if (!iUserActive)
   1.157 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.158 +
   1.159 +	if (iGc)
   1.160 +		{
   1.161 +		iClippingRect=TRect(iWin->Size());
   1.162 +		iGc->SetClippingRect(iClippingRect);
   1.163 +		}
   1.164 +	}
   1.165 +
   1.166 +void CWsAnimGc::SetDrawMode(TDrawMode aDrawingMode)
   1.167 +	{
   1.168 +	if (!iUserActive)
   1.169 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.170 +
   1.171 +	if (iGc)
   1.172 +		iGc->SetDrawMode(aDrawingMode);
   1.173 +	}
   1.174 +
   1.175 +void CWsAnimGc::UseFont(const CFont *aFont)
   1.176 +	{
   1.177 +	CloseCurrentFont();
   1.178 +	iFont=(CAnimFbsFont *)aFont;
   1.179 +	iFont->Open();
   1.180 +	if (!iUserActive)
   1.181 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.182 +	if (iGc)
   1.183 +		iGc->UseFontNoDuplicate(iFont);
   1.184 +	}
   1.185 +
   1.186 +void CWsAnimGc::DiscardFont()
   1.187 +	{
   1.188 +	CloseCurrentFont();
   1.189 +	if (!iUserActive)
   1.190 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.191 +	if (iGc)
   1.192 +		iGc->DiscardFont();
   1.193 +	}
   1.194 +
   1.195 +void CWsAnimGc::SetUnderlineStyle(TFontUnderline aUnderlineStyle)
   1.196 +	{
   1.197 +	if (!iUserActive)
   1.198 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.199 +	if (iGc)
   1.200 +		iGc->SetUnderlineStyle(aUnderlineStyle);
   1.201 +	}
   1.202 +
   1.203 +void CWsAnimGc::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)
   1.204 +	{
   1.205 +	if (!iUserActive)
   1.206 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.207 +	if (iGc)
   1.208 +		iGc->SetStrikethroughStyle(aStrikethroughStyle);
   1.209 +	}
   1.210 +
   1.211 +void CWsAnimGc::SetWordJustification(TInt aExcessWidth,TInt aNumGaps)
   1.212 +	{
   1.213 +	if (!iUserActive)
   1.214 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.215 +	if (iGc)
   1.216 +		iGc->SetWordJustification(aExcessWidth,aNumGaps);
   1.217 +	}
   1.218 +
   1.219 +void CWsAnimGc::SetCharJustification(TInt aExcessWidth,TInt aNumChars)
   1.220 +	{
   1.221 +	if (!iUserActive)
   1.222 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.223 +	if (iGc)
   1.224 +		iGc->SetCharJustification(aExcessWidth,aNumChars);
   1.225 +	}
   1.226 +
   1.227 +void CWsAnimGc::SetPenColor(const TRgb &aColor)
   1.228 +	{
   1.229 +	if (!iUserActive)
   1.230 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.231 +	if (iGc)
   1.232 +		iGc->SetPenColor(aColor);
   1.233 +	}
   1.234 +
   1.235 +void CWsAnimGc::SetPenStyle(TPenStyle aPenStyle)
   1.236 +	{
   1.237 +	if (!iUserActive)
   1.238 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.239 +	if (iGc)
   1.240 +		iGc->SetPenStyle(aPenStyle);
   1.241 +	}
   1.242 +
   1.243 +void CWsAnimGc::SetPenSize(const TSize& aSize)
   1.244 +	{
   1.245 +	if (!iUserActive)
   1.246 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.247 +	if (iGc)
   1.248 +		iGc->SetPenSize(aSize);
   1.249 +	}
   1.250 +
   1.251 +void CWsAnimGc::SetBrushColor(const TRgb &aColor)
   1.252 +	{
   1.253 +	if (!iUserActive)
   1.254 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.255 +	if (iGc)
   1.256 +		iGc->SetBrushColor(aColor);
   1.257 +	}
   1.258 +
   1.259 +void CWsAnimGc::SetBrushStyle(TBrushStyle aBrushStyle)
   1.260 +	{
   1.261 +	if (!iUserActive)
   1.262 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.263 +	if (iGc)
   1.264 +		iGc->SetBrushStyle(aBrushStyle);
   1.265 +	}
   1.266 +
   1.267 +void CWsAnimGc::SetBrushOrigin(const TPoint &aOrigin)
   1.268 +	{
   1.269 +	if (!iUserActive)
   1.270 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.271 +	if (iGc)
   1.272 +		iGc->SetBrushOrigin(aOrigin);
   1.273 +	}
   1.274 +
   1.275 +void CWsAnimGc::UseBrushPattern(const CFbsBitmap *aBitmap)
   1.276 +	{
   1.277 +	if (!iUserActive)
   1.278 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.279 +	if (iGc)
   1.280 +		iGc->UseBrushPattern(aBitmap);
   1.281 +	}
   1.282 +
   1.283 +void CWsAnimGc::DiscardBrushPattern()
   1.284 +	{
   1.285 +	if (!iUserActive)
   1.286 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.287 +	if (iGc)
   1.288 +		iGc->DiscardBrushPattern();
   1.289 +	}
   1.290 +
   1.291 +void CWsAnimGc::SetFaded(TBool aFaded)
   1.292 +	{
   1.293 +	if (!iUserActive)
   1.294 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.295 +	if (iGc)
   1.296 +		iGc->SetFaded(aFaded);
   1.297 +	}
   1.298 +
   1.299 +void CWsAnimGc::SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap)
   1.300 +	{
   1.301 +	if (!iUserActive)
   1.302 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.303 +	if (iGc)
   1.304 +		iGc->SetFadingParameters(aBlackMap,aWhiteMap);
   1.305 +	}
   1.306 +
   1.307 +//
   1.308 +// Drawing commands 								//
   1.309 +//
   1.310 +
   1.311 +void CWsAnimGc::DrawArc(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd)
   1.312 +	{
   1.313 +	if (!iUserActive)
   1.314 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.315 +	if (iGc)
   1.316 +		iGc->DrawArc(aRect,aStart,aEnd);
   1.317 +	}
   1.318 +
   1.319 +void CWsAnimGc::DrawPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd)
   1.320 +	{
   1.321 +	if (!iUserActive)
   1.322 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.323 +	if (iGc)
   1.324 +		iGc->DrawPie(aRect,aStart,aEnd);
   1.325 +	}
   1.326 +
   1.327 +void CWsAnimGc::DrawLine(const TPoint &aPoint1,const TPoint &aPoint2)
   1.328 +	{
   1.329 +	if (!iUserActive)
   1.330 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.331 +	if (iGc)
   1.332 +		iGc->DrawLine(aPoint1, aPoint2);
   1.333 +	}
   1.334 +
   1.335 +void CWsAnimGc::DrawLineTo(const TPoint &aPoint)
   1.336 +	{
   1.337 +	if (!iUserActive)
   1.338 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.339 +	if (iGc)
   1.340 +		iGc->DrawLineTo(aPoint);
   1.341 +	}
   1.342 +
   1.343 +void CWsAnimGc::DrawLineBy(const TPoint &aPoint)
   1.344 +	{
   1.345 +	if (!iUserActive)
   1.346 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.347 +	if (iGc)
   1.348 +		iGc->DrawLineBy(aPoint);
   1.349 +	}
   1.350 +
   1.351 +void CWsAnimGc::DrawEllipse(const TRect &aRect)
   1.352 +	{
   1.353 +	if (!iUserActive)
   1.354 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.355 +	if (iGc)
   1.356 +		iGc->DrawEllipse(aRect);
   1.357 +	}
   1.358 +
   1.359 +void CWsAnimGc::DrawRect(const TRect &aRect)
   1.360 +	{
   1.361 +	if (!iUserActive)
   1.362 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.363 +	if (iGc)
   1.364 +		iGc->DrawRect(aRect);
   1.365 +	}
   1.366 +
   1.367 +void CWsAnimGc::DrawRoundRect(const TRect &aRect,const TSize &aCornerSize)
   1.368 +	{
   1.369 +	if (!iUserActive)
   1.370 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.371 +	if (iGc)
   1.372 +		iGc->DrawRoundRect(aRect, aCornerSize);
   1.373 +	}
   1.374 +
   1.375 +void CWsAnimGc::Clear(const TRect &aRect)
   1.376 +	{
   1.377 +	if (!iUserActive)
   1.378 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.379 +	if (iGc)
   1.380 +		iGc->Clear(aRect);
   1.381 +	}
   1.382 +
   1.383 +void CWsAnimGc::Clear()
   1.384 +	{
   1.385 +	if (!iUserActive)
   1.386 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.387 +	if (iGc)
   1.388 +		iGc->Clear();
   1.389 +	}
   1.390 +
   1.391 +void CWsAnimGc::BitBlt(const TPoint &aPoint,const CFbsBitmap *aBitmap)
   1.392 +	{
   1.393 +	if (!iUserActive)
   1.394 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.395 +	if (iGc)
   1.396 +		iGc->BitBlt(aPoint, aBitmap);
   1.397 +	}
   1.398 +
   1.399 +void CWsAnimGc::BitBlt(const TPoint &aDestination,const CFbsBitmap *aBitmap,const TRect &aSource)
   1.400 +	{
   1.401 +	if (!iUserActive)
   1.402 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.403 +	if (iGc)
   1.404 +		iGc->BitBlt(aDestination, aBitmap, aSource);
   1.405 +	}
   1.406 +
   1.407 +void CWsAnimGc::BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask)
   1.408 +	{
   1.409 +	if (!iUserActive)
   1.410 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.411 +	if (iGc)
   1.412 +		iGc->BitBltMasked(aPoint, aBitmap, aSourceRect, aMaskBitmap, aInvertMask);
   1.413 +	}
   1.414 +
   1.415 +void CWsAnimGc::DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aSource)
   1.416 +	{
   1.417 +	if (!iUserActive)
   1.418 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.419 +	if (iGc)
   1.420 +		iGc->DrawBitmap(aTopLeft, aSource);
   1.421 +	}
   1.422 +
   1.423 +void CWsAnimGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource)
   1.424 +	{
   1.425 +	if (!iUserActive)
   1.426 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.427 +	if (iGc)
   1.428 +		iGc->DrawBitmap(aDestRect, aSource);
   1.429 +	}
   1.430 +
   1.431 +void CWsAnimGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource, const TRect &aSrcRect)
   1.432 +	{
   1.433 +	if (!iUserActive)
   1.434 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.435 +	if (iGc)
   1.436 +		iGc->DrawBitmap(aDestRect, aSource, aSrcRect);
   1.437 +	}
   1.438 +
   1.439 +void CWsAnimGc::DrawBitmapMasked(const TRect &aDestRect, const CFbsBitmap *aBitmap, const TRect &aSrcRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask)
   1.440 +	{
   1.441 +	if (!iUserActive)
   1.442 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.443 +	if (iGc)
   1.444 +		iGc->DrawBitmapMasked(aDestRect, aBitmap, aSrcRect, aMaskBitmap, aInvertMask);
   1.445 +	}
   1.446 +
   1.447 +void CWsAnimGc::DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSrcRect,const CWsBitmap* aMaskBitmap, TBool aInvertMask)
   1.448 +	{
   1.449 +	if (!iUserActive)
   1.450 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.451 +	if (iGc)
   1.452 +		iGc->DrawBitmapMasked(aDestRect, aBitmap, aSrcRect, aMaskBitmap, aInvertMask);
   1.453 +	}
   1.454 +
   1.455 +void CWsAnimGc::DrawPolyLine(const TPoint* aPointList,TInt aNumPoints)
   1.456 +	{
   1.457 +	if (!iUserActive)
   1.458 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.459 +	if (iGc)
   1.460 +		iGc->DrawPolyLine(aPointList, aNumPoints);
   1.461 +	}
   1.462 +
   1.463 +void CWsAnimGc::DrawPolyLine(const CArrayFix<TPoint> *aPointList)
   1.464 +	{
   1.465 +	if (!iUserActive)
   1.466 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.467 +	if (iGc)
   1.468 +		iGc->DrawPolyLine(aPointList);
   1.469 +	}
   1.470 +
   1.471 +TInt CWsAnimGc::DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule)
   1.472 +	{
   1.473 +	TInt result = KErrNone;
   1.474 +	if (!iUserActive)
   1.475 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.476 +	if (iGc)
   1.477 +		result = iGc->DrawPolygon(aPointList, aNumPoints, aFillRule);
   1.478 +	return result;
   1.479 +	}
   1.480 +
   1.481 +TInt CWsAnimGc::DrawPolygon(const CArrayFix<TPoint> *aPointList,TFillRule aFillRule)
   1.482 +	{
   1.483 +	TInt result = KErrNone;
   1.484 +	if (!iUserActive)
   1.485 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.486 +	if (iGc)
   1.487 +		result = iGc->DrawPolygon(aPointList, aFillRule);
   1.488 +	return result;
   1.489 +	}
   1.490 +
   1.491 +void CWsAnimGc::DrawText(const TDesC &aString,const TPoint &aPosition)
   1.492 +	{
   1.493 +	if (!iFont)
   1.494 +		iOwningWsAnim->Panic(EWservPanicNoFont);
   1.495 +	if (iGc)
   1.496 +		iGc->DrawText(aString, aPosition);
   1.497 +	}
   1.498 +
   1.499 +void CWsAnimGc::DrawText(const TDesC &aString,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz,TInt aLeftMrg)
   1.500 +	{
   1.501 +	if (!iFont)
   1.502 +		iOwningWsAnim->Panic(EWservPanicNoFont);
   1.503 +	if (iGc)
   1.504 +		iGc->DrawText(aString, aBox, aBaselineOffset, aHoriz, aLeftMrg);	
   1.505 +	}
   1.506 +
   1.507 +void CWsAnimGc::MoveTo(const TPoint &aPoint)
   1.508 +	{
   1.509 +	if (!iUserActive)
   1.510 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.511 +	if (iGc)
   1.512 +		iGc->MoveTo(aPoint);
   1.513 +	}
   1.514 +
   1.515 +void CWsAnimGc::MoveBy(const TPoint &aPoint)
   1.516 +	{
   1.517 +	if (!iUserActive)
   1.518 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.519 +	if (iGc)
   1.520 +		iGc->MoveBy(aPoint);
   1.521 +	}
   1.522 +
   1.523 +void CWsAnimGc::Plot(const TPoint &aPoint)
   1.524 +	{
   1.525 +	if (!iUserActive)
   1.526 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.527 +	if (iGc)
   1.528 +		iGc->Plot(aPoint);
   1.529 +	}
   1.530 +
   1.531 +void CWsAnimGc::SetOrigin(const TPoint &aPoint)
   1.532 +	{
   1.533 +	if (!iUserActive)
   1.534 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.535 +	if (iGc)
   1.536 +		iGc->SetOrigin(iWin->Origin() + aPoint);
   1.537 +	}
   1.538 +
   1.539 +void CWsAnimGc::CopyRect(const TPoint& aOffset,const TRect& aRect)
   1.540 +	{
   1.541 +	if (!iUserActive)
   1.542 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.543 +	if (iGc)
   1.544 +		iGc->CopyRect(aOffset, aRect);
   1.545 +	}
   1.546 +
   1.547 +void CWsAnimGc::Reset()
   1.548 +	{
   1.549 +	CloseCurrentFont();
   1.550 +	if (!iUserActive)
   1.551 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.552 +	if (iGc)
   1.553 +		iGc->Reset();
   1.554 +	SetOrigin(TPoint(0,0));
   1.555 +	CancelClippingRect();
   1.556 +	CancelClippingRegion();
   1.557 +	}
   1.558 +
   1.559 +void CWsAnimGc::CloseCurrentFont()
   1.560 +	{
   1.561 +	if (iFont)
   1.562 +		{
   1.563 +		iFont->Close();
   1.564 +		iFont=NULL;
   1.565 +		}
   1.566 +	}
   1.567 +
   1.568 +/**
   1.569 +@see CBitmapContext::AlphaBlendBitmaps()*/
   1.570 +TInt CWsAnimGc::AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp,	const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp,	const TPoint& aAlphaPt)	
   1.571 +	{
   1.572 +	TInt result = KErrNone;
   1.573 +	if (!iUserActive)
   1.574 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.575 +	if (iGc)
   1.576 +		result = iGc->AlphaBlendBitmaps(aDestPt, aSrcBmp, aSrcRect, aAlphaBmp, aAlphaPt);
   1.577 +	return result;
   1.578 +	}
   1.579 +
   1.580 +/*Body stub implementation. The alternate AlphaBlendBitmap function using CFbsBitmaps should instead be used*/
   1.581 +TInt CWsAnimGc::AlphaBlendBitmaps(const TPoint& /*aDestPt*/, const CWsBitmap* /*aSrcBmp*/,	const TRect& /*aSrcRect*/, const CWsBitmap* /*aAlphaBmp*/,	const TPoint& /*aAlphaPt*/)
   1.582 +	{
   1.583 +	return KErrNone;		
   1.584 +	};
   1.585 +
   1.586 +/**
   1.587 +@see CGraphicsContext::MapColors()*/
   1.588 +void CWsAnimGc::MapColors(const TRect &aRect,const TRgb *aColors,TInt aNumPairs,TBool aMapForwards)
   1.589 +	{
   1.590 +	if (!iUserActive)
   1.591 +		iOwningWsAnim->Panic(EWservPanicAnimLeave);
   1.592 +	if (iGc)
   1.593 +		iGc->MapColors(aRect, aColors, aNumPairs, aMapForwards);
   1.594 +	}
   1.595 +	
   1.596 +/**
   1.597 +@see CGraphicsContext::DrawTextVertical()*/
   1.598 +void CWsAnimGc::DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp)
   1.599 +	{
   1.600 +	if (!iFont) 
   1.601 +		iOwningWsAnim->Panic(EWservPanicNoFont);
   1.602 +	if (iGc)
   1.603 +		iGc->DrawTextVertical(aText, aPos, aUp);
   1.604 +	}
   1.605 +
   1.606 +/**
   1.607 +@see CGraphicsContext::DrawTextVertical()*/
   1.608 +void CWsAnimGc::DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert,TInt aMargin)
   1.609 +	{
   1.610 +	if (!iFont) 
   1.611 +		iOwningWsAnim->Panic(EWservPanicNoFont);
   1.612 +	if (iGc)
   1.613 +		iGc->DrawTextVertical(aText, aBox, aBaselineOffset, aUp, aVert, aMargin);
   1.614 +	}
   1.615 +