os/graphics/windowing/windowserver/nonnga/SERVER/WSANIMGC.CPP
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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
// Interface code for animated DLL's GC
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#include <e32std.h>
sl@0
    19
#include "server.h"
sl@0
    20
#include "playbackgc.h"
sl@0
    21
#include "ANIM.H"
sl@0
    22
#include "wsfont.h"
sl@0
    23
sl@0
    24
CWsAnimGc::CWsAnimGc() : iUserActive(EFalse), iUseDrawingRegion(EFalse)
sl@0
    25
	{
sl@0
    26
	__DECLARE_NAME(_S("CWsAnimGc"));
sl@0
    27
	}
sl@0
    28
sl@0
    29
void CWsAnimGc::SetDrawingRegions(const TRegion *aRegion)
sl@0
    30
	{
sl@0
    31
	if (aRegion)
sl@0
    32
		{
sl@0
    33
		iDrawingRegion.Copy(*aRegion);
sl@0
    34
		iDrawingRegion.Offset(iWin->Origin());
sl@0
    35
		}
sl@0
    36
	iDrawingRegion.Intersect(*iBaseRegion);
sl@0
    37
	iDrawingRegion.Tidy();
sl@0
    38
	iGc->SetClippingRegion(iDrawingRegion);
sl@0
    39
	iUseDrawingRegion=ETrue;
sl@0
    40
	}
sl@0
    41
sl@0
    42
void CWsAnimGc::Activate(CWsClientWindow *aWindow, CWsAnim *aWsAnim, const TRegion *aRegion, CFbsBitGc *aGc)
sl@0
    43
	{
sl@0
    44
	iOwningWsAnim=aWsAnim;
sl@0
    45
	if (iWin)
sl@0
    46
		iOwningWsAnim->Panic();
sl@0
    47
	iWin=aWindow;
sl@0
    48
	iBaseRegion=aRegion ? aRegion : &iWin->VisibleRegion();
sl@0
    49
sl@0
    50
	iGc = aGc;
sl@0
    51
	iUserActive = ETrue;
sl@0
    52
	Reset();
sl@0
    53
	}
sl@0
    54
sl@0
    55
void CWsAnimGc::Deactivate()
sl@0
    56
	{
sl@0
    57
	if (iUseDrawingRegion)
sl@0
    58
		{
sl@0
    59
		iDrawingRegion.Close();
sl@0
    60
		}
sl@0
    61
	iUseDrawingRegion=EFalse;
sl@0
    62
	CloseCurrentFont();
sl@0
    63
sl@0
    64
	iWin=NULL;
sl@0
    65
	iGc=NULL;
sl@0
    66
	iUserActive = EFalse;
sl@0
    67
	}
sl@0
    68
sl@0
    69
TBool CWsAnimGc::IsActive() const
sl@0
    70
	{
sl@0
    71
	return (iUserActive || (iGc != NULL));
sl@0
    72
	}
sl@0
    73
sl@0
    74
void CWsAnimGc::UserActivate(CWsClientWindow *aWindow, CWsAnim *aWsAnim)
sl@0
    75
	{
sl@0
    76
	if (iWin)
sl@0
    77
		{
sl@0
    78
		UserDeactivate();
sl@0
    79
		iOwningWsAnim->Panic();
sl@0
    80
		}
sl@0
    81
	iOwningWsAnim=aWsAnim;
sl@0
    82
	iWin=aWindow;
sl@0
    83
	iUserActive = ETrue;
sl@0
    84
	}
sl@0
    85
sl@0
    86
void CWsAnimGc::UserDeactivate()
sl@0
    87
	{
sl@0
    88
	CloseCurrentFont();
sl@0
    89
sl@0
    90
	if (iWin && iOwningWsAnim)
sl@0
    91
		{
sl@0
    92
		TRegionFix<1> animRegion(iOwningWsAnim->BestRect());
sl@0
    93
		iWin->ScheduleRegionUpdate(&animRegion);
sl@0
    94
		}
sl@0
    95
sl@0
    96
	iWin = NULL;
sl@0
    97
	iUserActive = EFalse;
sl@0
    98
	}
sl@0
    99
sl@0
   100
void CWsAnimGc::AnimDeleted(CWsAnim *aWsAnim)
sl@0
   101
	{	
sl@0
   102
	if (iOwningWsAnim==aWsAnim)
sl@0
   103
		iOwningWsAnim=NULL;
sl@0
   104
	}
sl@0
   105
sl@0
   106
CGraphicsDevice* CWsAnimGc::Device() const
sl@0
   107
	{
sl@0
   108
	if (!iUserActive)
sl@0
   109
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   110
sl@0
   111
	return iGc ? iGc->Device() : NULL;
sl@0
   112
	}
sl@0
   113
sl@0
   114
void CWsAnimGc::SetClippingRect(const TRect& aRect)
sl@0
   115
	{
sl@0
   116
	if (!iUserActive)
sl@0
   117
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   118
sl@0
   119
	if (iGc)
sl@0
   120
		{
sl@0
   121
		iClippingRect=aRect;
sl@0
   122
		iClippingRect.Intersection(TRect(iWin->Size()));
sl@0
   123
		iGc->SetClippingRect(iClippingRect);
sl@0
   124
		}
sl@0
   125
	}
sl@0
   126
sl@0
   127
TInt CWsAnimGc::SetClippingRegion(const TRegion &aRegion)
sl@0
   128
//This function is virtual and so cannot have an 'L' at the end of it's name
sl@0
   129
	{
sl@0
   130
	if (iWin==NULL)
sl@0
   131
		User::Leave(KErrGeneral);
sl@0
   132
sl@0
   133
	if (iGc)
sl@0
   134
		SetDrawingRegions(&aRegion);
sl@0
   135
	return KErrNone;
sl@0
   136
	}
sl@0
   137
sl@0
   138
void CWsAnimGc::CancelClippingRegion()
sl@0
   139
	{
sl@0
   140
	if (!iUserActive)
sl@0
   141
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   142
sl@0
   143
	if (iGc)
sl@0
   144
		{
sl@0
   145
		iDrawingRegion.Clear();
sl@0
   146
		iUseDrawingRegion=EFalse;
sl@0
   147
		iGc->SetClippingRegion(iBaseRegion);
sl@0
   148
		}
sl@0
   149
	}
sl@0
   150
sl@0
   151
void CWsAnimGc::CancelClippingRect()
sl@0
   152
	{
sl@0
   153
	if (!iUserActive)
sl@0
   154
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   155
sl@0
   156
	if (iGc)
sl@0
   157
		{
sl@0
   158
		iClippingRect=TRect(iWin->Size());
sl@0
   159
		iGc->SetClippingRect(iClippingRect);
sl@0
   160
		}
sl@0
   161
	}
sl@0
   162
sl@0
   163
void CWsAnimGc::SetDrawMode(TDrawMode aDrawingMode)
sl@0
   164
	{
sl@0
   165
	if (!iUserActive)
sl@0
   166
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   167
sl@0
   168
	if (iGc)
sl@0
   169
		iGc->SetDrawMode(aDrawingMode);
sl@0
   170
	}
sl@0
   171
sl@0
   172
void CWsAnimGc::UseFont(const CFont *aFont)
sl@0
   173
	{
sl@0
   174
	CloseCurrentFont();
sl@0
   175
	iFont=(CAnimFbsFont *)aFont;
sl@0
   176
	iFont->Open();
sl@0
   177
	if (!iUserActive)
sl@0
   178
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   179
	if (iGc)
sl@0
   180
		iGc->UseFontNoDuplicate(iFont);
sl@0
   181
	}
sl@0
   182
sl@0
   183
void CWsAnimGc::DiscardFont()
sl@0
   184
	{
sl@0
   185
	CloseCurrentFont();
sl@0
   186
	if (!iUserActive)
sl@0
   187
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   188
	if (iGc)
sl@0
   189
		iGc->DiscardFont();
sl@0
   190
	}
sl@0
   191
sl@0
   192
void CWsAnimGc::SetUnderlineStyle(TFontUnderline aUnderlineStyle)
sl@0
   193
	{
sl@0
   194
	if (!iUserActive)
sl@0
   195
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   196
	if (iGc)
sl@0
   197
		iGc->SetUnderlineStyle(aUnderlineStyle);
sl@0
   198
	}
sl@0
   199
sl@0
   200
void CWsAnimGc::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)
sl@0
   201
	{
sl@0
   202
	if (!iUserActive)
sl@0
   203
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   204
	if (iGc)
sl@0
   205
		iGc->SetStrikethroughStyle(aStrikethroughStyle);
sl@0
   206
	}
sl@0
   207
sl@0
   208
void CWsAnimGc::SetWordJustification(TInt aExcessWidth,TInt aNumGaps)
sl@0
   209
	{
sl@0
   210
	if (!iUserActive)
sl@0
   211
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   212
	if (iGc)
sl@0
   213
		iGc->SetWordJustification(aExcessWidth,aNumGaps);
sl@0
   214
	}
sl@0
   215
sl@0
   216
void CWsAnimGc::SetCharJustification(TInt aExcessWidth,TInt aNumChars)
sl@0
   217
	{
sl@0
   218
	if (!iUserActive)
sl@0
   219
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   220
	if (iGc)
sl@0
   221
		iGc->SetCharJustification(aExcessWidth,aNumChars);
sl@0
   222
	}
sl@0
   223
sl@0
   224
void CWsAnimGc::SetPenColor(const TRgb &aColor)
sl@0
   225
	{
sl@0
   226
	if (!iUserActive)
sl@0
   227
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   228
	if (iGc)
sl@0
   229
		iGc->SetPenColor(aColor);
sl@0
   230
	}
sl@0
   231
sl@0
   232
void CWsAnimGc::SetPenStyle(TPenStyle aPenStyle)
sl@0
   233
	{
sl@0
   234
	if (!iUserActive)
sl@0
   235
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   236
	if (iGc)
sl@0
   237
		iGc->SetPenStyle(aPenStyle);
sl@0
   238
	}
sl@0
   239
sl@0
   240
void CWsAnimGc::SetPenSize(const TSize& aSize)
sl@0
   241
	{
sl@0
   242
	if (!iUserActive)
sl@0
   243
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   244
	if (iGc)
sl@0
   245
		iGc->SetPenSize(aSize);
sl@0
   246
	}
sl@0
   247
sl@0
   248
void CWsAnimGc::SetBrushColor(const TRgb &aColor)
sl@0
   249
	{
sl@0
   250
	if (!iUserActive)
sl@0
   251
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   252
	if (iGc)
sl@0
   253
		iGc->SetBrushColor(aColor);
sl@0
   254
	}
sl@0
   255
sl@0
   256
void CWsAnimGc::SetBrushStyle(TBrushStyle aBrushStyle)
sl@0
   257
	{
sl@0
   258
	if (!iUserActive)
sl@0
   259
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   260
	if (iGc)
sl@0
   261
		iGc->SetBrushStyle(aBrushStyle);
sl@0
   262
	}
sl@0
   263
sl@0
   264
void CWsAnimGc::SetBrushOrigin(const TPoint &aOrigin)
sl@0
   265
	{
sl@0
   266
	if (!iUserActive)
sl@0
   267
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   268
	if (iGc)
sl@0
   269
		iGc->SetBrushOrigin(aOrigin);
sl@0
   270
	}
sl@0
   271
sl@0
   272
void CWsAnimGc::UseBrushPattern(const CFbsBitmap *aBitmap)
sl@0
   273
	{
sl@0
   274
	if (!iUserActive)
sl@0
   275
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   276
	if (iGc)
sl@0
   277
		iGc->UseBrushPattern(aBitmap);
sl@0
   278
	}
sl@0
   279
sl@0
   280
void CWsAnimGc::DiscardBrushPattern()
sl@0
   281
	{
sl@0
   282
	if (!iUserActive)
sl@0
   283
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   284
	if (iGc)
sl@0
   285
		iGc->DiscardBrushPattern();
sl@0
   286
	}
sl@0
   287
sl@0
   288
void CWsAnimGc::SetFaded(TBool aFaded)
sl@0
   289
	{
sl@0
   290
	if (!iUserActive)
sl@0
   291
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   292
	if (iGc)
sl@0
   293
		iGc->SetFaded(aFaded);
sl@0
   294
	}
sl@0
   295
sl@0
   296
void CWsAnimGc::SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap)
sl@0
   297
	{
sl@0
   298
	if (!iUserActive)
sl@0
   299
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   300
	if (iGc)
sl@0
   301
		iGc->SetFadingParameters(aBlackMap,aWhiteMap);
sl@0
   302
	}
sl@0
   303
sl@0
   304
//
sl@0
   305
// Drawing commands 								//
sl@0
   306
//
sl@0
   307
sl@0
   308
void CWsAnimGc::DrawArc(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd)
sl@0
   309
	{
sl@0
   310
	if (!iUserActive)
sl@0
   311
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   312
	if (iGc)
sl@0
   313
		iGc->DrawArc(aRect,aStart,aEnd);
sl@0
   314
	}
sl@0
   315
sl@0
   316
void CWsAnimGc::DrawPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd)
sl@0
   317
	{
sl@0
   318
	if (!iUserActive)
sl@0
   319
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   320
	if (iGc)
sl@0
   321
		iGc->DrawPie(aRect,aStart,aEnd);
sl@0
   322
	}
sl@0
   323
sl@0
   324
void CWsAnimGc::DrawLine(const TPoint &aPoint1,const TPoint &aPoint2)
sl@0
   325
	{
sl@0
   326
	if (!iUserActive)
sl@0
   327
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   328
	if (iGc)
sl@0
   329
		iGc->DrawLine(aPoint1, aPoint2);
sl@0
   330
	}
sl@0
   331
sl@0
   332
void CWsAnimGc::DrawLineTo(const TPoint &aPoint)
sl@0
   333
	{
sl@0
   334
	if (!iUserActive)
sl@0
   335
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   336
	if (iGc)
sl@0
   337
		iGc->DrawLineTo(aPoint);
sl@0
   338
	}
sl@0
   339
sl@0
   340
void CWsAnimGc::DrawLineBy(const TPoint &aPoint)
sl@0
   341
	{
sl@0
   342
	if (!iUserActive)
sl@0
   343
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   344
	if (iGc)
sl@0
   345
		iGc->DrawLineBy(aPoint);
sl@0
   346
	}
sl@0
   347
sl@0
   348
void CWsAnimGc::DrawEllipse(const TRect &aRect)
sl@0
   349
	{
sl@0
   350
	if (!iUserActive)
sl@0
   351
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   352
	if (iGc)
sl@0
   353
		iGc->DrawEllipse(aRect);
sl@0
   354
	}
sl@0
   355
sl@0
   356
void CWsAnimGc::DrawRect(const TRect &aRect)
sl@0
   357
	{
sl@0
   358
	if (!iUserActive)
sl@0
   359
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   360
	if (iGc)
sl@0
   361
		iGc->DrawRect(aRect);
sl@0
   362
	}
sl@0
   363
sl@0
   364
void CWsAnimGc::DrawRoundRect(const TRect &aRect,const TSize &aCornerSize)
sl@0
   365
	{
sl@0
   366
	if (!iUserActive)
sl@0
   367
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   368
	if (iGc)
sl@0
   369
		iGc->DrawRoundRect(aRect, aCornerSize);
sl@0
   370
	}
sl@0
   371
sl@0
   372
void CWsAnimGc::Clear(const TRect &aRect)
sl@0
   373
	{
sl@0
   374
	if (!iUserActive)
sl@0
   375
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   376
	if (iGc)
sl@0
   377
		iGc->Clear(aRect);
sl@0
   378
	}
sl@0
   379
sl@0
   380
void CWsAnimGc::Clear()
sl@0
   381
	{
sl@0
   382
	if (!iUserActive)
sl@0
   383
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   384
	if (iGc)
sl@0
   385
		iGc->Clear();
sl@0
   386
	}
sl@0
   387
sl@0
   388
void CWsAnimGc::BitBlt(const TPoint &aPoint,const CFbsBitmap *aBitmap)
sl@0
   389
	{
sl@0
   390
	if (!iUserActive)
sl@0
   391
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   392
	if (iGc)
sl@0
   393
		iGc->BitBlt(aPoint, aBitmap);
sl@0
   394
	}
sl@0
   395
sl@0
   396
void CWsAnimGc::BitBlt(const TPoint &aDestination,const CFbsBitmap *aBitmap,const TRect &aSource)
sl@0
   397
	{
sl@0
   398
	if (!iUserActive)
sl@0
   399
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   400
	if (iGc)
sl@0
   401
		iGc->BitBlt(aDestination, aBitmap, aSource);
sl@0
   402
	}
sl@0
   403
sl@0
   404
void CWsAnimGc::BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask)
sl@0
   405
	{
sl@0
   406
	if (!iUserActive)
sl@0
   407
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   408
	if (iGc)
sl@0
   409
		iGc->BitBltMasked(aPoint, aBitmap, aSourceRect, aMaskBitmap, aInvertMask);
sl@0
   410
	}
sl@0
   411
sl@0
   412
void CWsAnimGc::DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aSource)
sl@0
   413
	{
sl@0
   414
	if (!iUserActive)
sl@0
   415
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   416
	if (iGc)
sl@0
   417
		iGc->DrawBitmap(aTopLeft, aSource);
sl@0
   418
	}
sl@0
   419
sl@0
   420
void CWsAnimGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource)
sl@0
   421
	{
sl@0
   422
	if (!iUserActive)
sl@0
   423
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   424
	if (iGc)
sl@0
   425
		iGc->DrawBitmap(aDestRect, aSource);
sl@0
   426
	}
sl@0
   427
sl@0
   428
void CWsAnimGc::DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource, const TRect &aSrcRect)
sl@0
   429
	{
sl@0
   430
	if (!iUserActive)
sl@0
   431
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   432
	if (iGc)
sl@0
   433
		iGc->DrawBitmap(aDestRect, aSource, aSrcRect);
sl@0
   434
	}
sl@0
   435
sl@0
   436
void CWsAnimGc::DrawBitmapMasked(const TRect &aDestRect, const CFbsBitmap *aBitmap, const TRect &aSrcRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask)
sl@0
   437
	{
sl@0
   438
	if (!iUserActive)
sl@0
   439
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   440
	if (iGc)
sl@0
   441
		iGc->DrawBitmapMasked(aDestRect, aBitmap, aSrcRect, aMaskBitmap, aInvertMask);
sl@0
   442
	}
sl@0
   443
sl@0
   444
void CWsAnimGc::DrawBitmapMasked(const TRect& aDestRect,const CWsBitmap* aBitmap,const TRect& aSrcRect,const CWsBitmap* aMaskBitmap, TBool aInvertMask)
sl@0
   445
	{
sl@0
   446
	if (!iUserActive)
sl@0
   447
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   448
	if (iGc)
sl@0
   449
		iGc->DrawBitmapMasked(aDestRect, aBitmap, aSrcRect, aMaskBitmap, aInvertMask);
sl@0
   450
	}
sl@0
   451
sl@0
   452
void CWsAnimGc::DrawPolyLine(const TPoint* aPointList,TInt aNumPoints)
sl@0
   453
	{
sl@0
   454
	if (!iUserActive)
sl@0
   455
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   456
	if (iGc)
sl@0
   457
		iGc->DrawPolyLine(aPointList, aNumPoints);
sl@0
   458
	}
sl@0
   459
sl@0
   460
void CWsAnimGc::DrawPolyLine(const CArrayFix<TPoint> *aPointList)
sl@0
   461
	{
sl@0
   462
	if (!iUserActive)
sl@0
   463
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   464
	if (iGc)
sl@0
   465
		iGc->DrawPolyLine(aPointList);
sl@0
   466
	}
sl@0
   467
sl@0
   468
TInt CWsAnimGc::DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule)
sl@0
   469
	{
sl@0
   470
	TInt result = KErrNone;
sl@0
   471
	if (!iUserActive)
sl@0
   472
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   473
	if (iGc)
sl@0
   474
		result = iGc->DrawPolygon(aPointList, aNumPoints, aFillRule);
sl@0
   475
	return result;
sl@0
   476
	}
sl@0
   477
sl@0
   478
TInt CWsAnimGc::DrawPolygon(const CArrayFix<TPoint> *aPointList,TFillRule aFillRule)
sl@0
   479
	{
sl@0
   480
	TInt result = KErrNone;
sl@0
   481
	if (!iUserActive)
sl@0
   482
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   483
	if (iGc)
sl@0
   484
		result = iGc->DrawPolygon(aPointList, aFillRule);
sl@0
   485
	return result;
sl@0
   486
	}
sl@0
   487
sl@0
   488
void CWsAnimGc::DrawText(const TDesC &aString,const TPoint &aPosition)
sl@0
   489
	{
sl@0
   490
	if (!iFont)
sl@0
   491
		iOwningWsAnim->Panic(EWservPanicNoFont);
sl@0
   492
	if (iGc)
sl@0
   493
		iGc->DrawText(aString, aPosition);
sl@0
   494
	}
sl@0
   495
sl@0
   496
void CWsAnimGc::DrawText(const TDesC &aString,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz,TInt aLeftMrg)
sl@0
   497
	{
sl@0
   498
	if (!iFont)
sl@0
   499
		iOwningWsAnim->Panic(EWservPanicNoFont);
sl@0
   500
	if (iGc)
sl@0
   501
		iGc->DrawText(aString, aBox, aBaselineOffset, aHoriz, aLeftMrg);	
sl@0
   502
	}
sl@0
   503
sl@0
   504
void CWsAnimGc::MoveTo(const TPoint &aPoint)
sl@0
   505
	{
sl@0
   506
	if (!iUserActive)
sl@0
   507
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   508
	if (iGc)
sl@0
   509
		iGc->MoveTo(aPoint);
sl@0
   510
	}
sl@0
   511
sl@0
   512
void CWsAnimGc::MoveBy(const TPoint &aPoint)
sl@0
   513
	{
sl@0
   514
	if (!iUserActive)
sl@0
   515
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   516
	if (iGc)
sl@0
   517
		iGc->MoveBy(aPoint);
sl@0
   518
	}
sl@0
   519
sl@0
   520
void CWsAnimGc::Plot(const TPoint &aPoint)
sl@0
   521
	{
sl@0
   522
	if (!iUserActive)
sl@0
   523
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   524
	if (iGc)
sl@0
   525
		iGc->Plot(aPoint);
sl@0
   526
	}
sl@0
   527
sl@0
   528
void CWsAnimGc::SetOrigin(const TPoint &aPoint)
sl@0
   529
	{
sl@0
   530
	if (!iUserActive)
sl@0
   531
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   532
	if (iGc)
sl@0
   533
		iGc->SetOrigin(iWin->Origin() + aPoint);
sl@0
   534
	}
sl@0
   535
sl@0
   536
void CWsAnimGc::CopyRect(const TPoint& aOffset,const TRect& aRect)
sl@0
   537
	{
sl@0
   538
	if (!iUserActive)
sl@0
   539
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   540
	if (iGc)
sl@0
   541
		iGc->CopyRect(aOffset, aRect);
sl@0
   542
	}
sl@0
   543
sl@0
   544
void CWsAnimGc::Reset()
sl@0
   545
	{
sl@0
   546
	CloseCurrentFont();
sl@0
   547
	if (!iUserActive)
sl@0
   548
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   549
	if (iGc)
sl@0
   550
		iGc->Reset();
sl@0
   551
	SetOrigin(TPoint(0,0));
sl@0
   552
	CancelClippingRect();
sl@0
   553
	CancelClippingRegion();
sl@0
   554
	}
sl@0
   555
sl@0
   556
void CWsAnimGc::CloseCurrentFont()
sl@0
   557
	{
sl@0
   558
	if (iFont)
sl@0
   559
		{
sl@0
   560
		iFont->Close();
sl@0
   561
		iFont=NULL;
sl@0
   562
		}
sl@0
   563
	}
sl@0
   564
sl@0
   565
/**
sl@0
   566
@see CBitmapContext::AlphaBlendBitmaps()*/
sl@0
   567
TInt CWsAnimGc::AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp,	const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp,	const TPoint& aAlphaPt)	
sl@0
   568
	{
sl@0
   569
	TInt result = KErrNone;
sl@0
   570
	if (!iUserActive)
sl@0
   571
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   572
	if (iGc)
sl@0
   573
		result = iGc->AlphaBlendBitmaps(aDestPt, aSrcBmp, aSrcRect, aAlphaBmp, aAlphaPt);
sl@0
   574
	return result;
sl@0
   575
	}
sl@0
   576
sl@0
   577
/*Body stub implementation. The alternate AlphaBlendBitmap function using CFbsBitmaps should instead be used*/
sl@0
   578
TInt CWsAnimGc::AlphaBlendBitmaps(const TPoint& /*aDestPt*/, const CWsBitmap* /*aSrcBmp*/,	const TRect& /*aSrcRect*/, const CWsBitmap* /*aAlphaBmp*/,	const TPoint& /*aAlphaPt*/)
sl@0
   579
	{
sl@0
   580
	return KErrNone;		
sl@0
   581
	};
sl@0
   582
sl@0
   583
/**
sl@0
   584
@see CGraphicsContext::MapColors()*/
sl@0
   585
void CWsAnimGc::MapColors(const TRect &aRect,const TRgb *aColors,TInt aNumPairs,TBool aMapForwards)
sl@0
   586
	{
sl@0
   587
	if (!iUserActive)
sl@0
   588
		iOwningWsAnim->Panic(EWservPanicAnimLeave);
sl@0
   589
	if (iGc)
sl@0
   590
		iGc->MapColors(aRect, aColors, aNumPairs, aMapForwards);
sl@0
   591
	}
sl@0
   592
	
sl@0
   593
/**
sl@0
   594
@see CGraphicsContext::DrawTextVertical()*/
sl@0
   595
void CWsAnimGc::DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp)
sl@0
   596
	{
sl@0
   597
	if (!iFont) 
sl@0
   598
		iOwningWsAnim->Panic(EWservPanicNoFont);
sl@0
   599
	if (iGc)
sl@0
   600
		iGc->DrawTextVertical(aText, aPos, aUp);
sl@0
   601
	}
sl@0
   602
sl@0
   603
/**
sl@0
   604
@see CGraphicsContext::DrawTextVertical()*/
sl@0
   605
void CWsAnimGc::DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert,TInt aMargin)
sl@0
   606
	{
sl@0
   607
	if (!iFont) 
sl@0
   608
		iOwningWsAnim->Panic(EWservPanicNoFont);
sl@0
   609
	if (iGc)
sl@0
   610
		iGc->DrawTextVertical(aText, aBox, aBaselineOffset, aUp, aVert, aMargin);
sl@0
   611
	}
sl@0
   612