svgtopt/SVG/SVGImpl/src/SVGAnimateTransformElementImpl.cpp
changeset 46 88edb906c587
equal deleted inserted replaced
-1:000000000000 46:88edb906c587
       
     1 /*
       
     2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  SVG Implementation source file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #if !defined(__E32BASE_H__)
       
    20 #include <e32base.h>
       
    21 #endif
       
    22 
       
    23 
       
    24 #include "SVGAnimateTransformElementImpl.h"
       
    25 
       
    26 #include "SVGElementImpl.h"
       
    27 #include "SVGDocumentImpl.h"
       
    28 #include "SVGSchemaData.h"
       
    29 
       
    30 #include "SVGPointLexer.h"
       
    31 #include "SVGStringTokenizer.h"
       
    32 
       
    33 #include "GfxAffineTransform.h"
       
    34 
       
    35 _LIT( SEMICOLON, ";" );
       
    36 
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 // ---------------------------------------------------------------------------
       
    41 CSvgAnimateTransformElementImpl* CSvgAnimateTransformElementImpl::NewL(  const TUint8 aElemID,
       
    42 																		CSvgDocumentImpl* aDoc )
       
    43 	{
       
    44 	CSvgAnimateTransformElementImpl*self    = new ( ELeave )
       
    45 											  CSvgAnimateTransformElementImpl( aDoc );
       
    46 
       
    47 	CleanupStack::PushL( self );
       
    48 	self->ConstructL(  aElemID );
       
    49 	CleanupStack::Pop();
       
    50 
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 // ---------------------------------------------------------------------------
       
    57 CSvgAnimateTransformElementImpl* CSvgAnimateTransformElementImpl::NewLC(  const TUint8 aElemID,
       
    58 																		 CSvgDocumentImpl* aDoc )
       
    59 	{
       
    60 	CSvgAnimateTransformElementImpl*self    = new ( ELeave )
       
    61 											  CSvgAnimateTransformElementImpl( aDoc );
       
    62 
       
    63 	CleanupStack::PushL( self );
       
    64 	self->ConstructL(  aElemID );
       
    65 
       
    66 	return self;
       
    67 	}
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 // ---------------------------------------------------------------------------
       
    72 void CSvgAnimateTransformElementImpl::ConstructL(  const TUint8 aElemID)
       
    73 	{
       
    74 	CSvgAnimationBase::ConstructL( aElemID );
       
    75 
       
    76 	// Initial length of values is 2 (from and to)
       
    77 	iTransformValues = new ( ELeave ) RArray<TMatrixData>( 2 );
       
    78     TMatrixData mtrx;
       
    79     iTransformValues->AppendL( mtrx );
       
    80     iTransformValues->AppendL( mtrx );
       
    81 
       
    82     iOrgTransformValues = new ( ELeave ) RArray<TMatrixData>( 2 );
       
    83 
       
    84     iOrgTransformValues->AppendL( mtrx );
       
    85     iOrgTransformValues->AppendL( mtrx );
       
    86 
       
    87 
       
    88 	iAccumMatrixData.iData[0] = 0;
       
    89 	iAccumMatrixData.iData[1] = 0;
       
    90 	iAccumMatrixData.iData[2] = 0;
       
    91 
       
    92 	iReqAttrFlag=KSVG_ANIMATETRANSFORM_ELEMFLAG;
       
    93 
       
    94 
       
    95 
       
    96 	}
       
    97 
       
    98 
       
    99 
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 //
       
   103 // ---------------------------------------------------------------------------
       
   104 CSvgAnimateTransformElementImpl::~CSvgAnimateTransformElementImpl()
       
   105     {
       
   106     if ( iTransformValues )
       
   107 		{
       
   108         iTransformValues->Close();
       
   109 	    delete iTransformValues;
       
   110 	    iTransformValues = NULL;
       
   111 		}
       
   112 	if ( iOrgTransformValues )
       
   113 		{
       
   114         iOrgTransformValues->Close();
       
   115 	    delete iOrgTransformValues;
       
   116 	    iOrgTransformValues = NULL;
       
   117 
       
   118 		}
       
   119     }
       
   120 
       
   121 // ---------------------------------------------------------------------------
       
   122 // Private
       
   123 
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 //
       
   127 // ---------------------------------------------------------------------------
       
   128 CSvgAnimateTransformElementImpl::CSvgAnimateTransformElementImpl( CSvgDocumentImpl* aDoc ) : CSvgAnimationBase( aDoc ),
       
   129 
       
   130                                                                                              iMatrixDataSize( 2 ),
       
   131 																							 iMultipleRendering (EFalse)
       
   132     {
       
   133     iDataType = KSvgTypeTranslate;
       
   134     }
       
   135 
       
   136 // ---------------------------------------------------------------------------
       
   137 // From MSvgEventReceiver
       
   138 // ---------------------------------------------------------------------------
       
   139 void CSvgAnimateTransformElementImpl::ResetReferenceElementL()
       
   140     {
       
   141     if(iTargetElement != NULL )
       
   142     	{
       
   143     	if( ((iTargetElement->iAnimateAttrSet == NULL) || (iTargetElement->iAnimateAttrSet->Find(iAttrId) == KErrNotFound) ) )
       
   144     		{
       
   145     		if ( iInitDone )
       
   146     			{
       
   147     			iCheckFirstAnim= ETrue;
       
   148     			SetToOriginalL();
       
   149     			if( !(iTargetElement->iAnimateAttrSet) )
       
   150     				{
       
   151                     iTargetElement->iAnimateAttrSet = new (ELeave) RArray<TUint32>(1);
       
   152                     }
       
   153                 iTargetElement->iAnimateAttrSet->AppendL((TUint32)iAttrId);
       
   154                 }
       
   155     		}
       
   156         }
       
   157     }
       
   158 
       
   159 // ---------------------------------------------------------------------------
       
   160 // From MXmlElement
       
   161 // ---------------------------------------------------------------------------
       
   162 TInt CSvgAnimateTransformElementImpl::SetAttributeL( const TDesC& aName,
       
   163                                                      const TDesC& aValue )
       
   164     {
       
   165     _LIT( KTmpAttrName, "attributeName" );
       
   166     _LIT( KTmpTransform, "transform" );
       
   167     _LIT( KTmpFrom, "from" );
       
   168     _LIT( KTmpTo, "to" );
       
   169     _LIT( KTmpBy, "by" );
       
   170     _LIT( KTmpType, "type" );
       
   171     _LIT( KTmpScale, "scale" );
       
   172     _LIT( KTmpRotate, "rotate" );
       
   173     _LIT( KTmpSkewX, "skewX" );
       
   174     _LIT( KTmpSkewY, "skewY" );
       
   175     _LIT( KTmpValues, "values" );
       
   176     _LIT( KTmpGradientTransform, "gradientTransform");
       
   177 
       
   178     	if ( !iTargetSet )
       
   179 			{
       
   180 			iTargetElement = ( CSvgElementImpl * ) ParentNode();// default is parent element
       
   181 			iTargetSet = ETrue;
       
   182 			}
       
   183 		   	TUint16 lElementId = 0;
       
   184 		if (iTargetElement)
       
   185 		    lElementId = iTargetElement->ElemID();
       
   186        if ( aName == KTmpAttrName )
       
   187 	        {
       
   188 
       
   189 			if(iReqAttrFlag == KAtrSVGTrf)
       
   190 				{
       
   191 				iReqAttrFlag = KAtrType;
       
   192 				}
       
   193 			else
       
   194 				{
       
   195 				iReqAttrFlag = 0;
       
   196 				}
       
   197 	    	if( aValue == KTmpTransform &&
       
   198 				!(lElementId == KSvgRadialGradientElement || lElementId
       
   199 				 == KSvgLinearGradientElement)
       
   200 				 )
       
   201 				{
       
   202 				iAttrId = KAtrAnimateTransformAttrId;
       
   203 	       		return KErrNone;
       
   204 				}
       
   205 			else if (aValue == KTmpGradientTransform &&
       
   206 				(lElementId == KSvgRadialGradientElement || lElementId
       
   207 				 == KSvgLinearGradientElement))
       
   208 				{
       
   209 				 iAttrId = KAtrAnimateTransformAttrId;
       
   210 	       		 return KErrNone;
       
   211 				}
       
   212 			else if(aValue == KTmpGradientTransform) // Specifically for Xlink:href case
       
   213 				{
       
   214 				 iAttrId = KAtrGradientTransform;
       
   215 				 return KErrNone;
       
   216 				}
       
   217 			else
       
   218 	            {
       
   219 	            // value must be not be 'transform'
       
   220 	            iAttrId = 0xffff;
       
   221 	            return KErrNone;
       
   222 	            }
       
   223 	        }
       
   224     else if ( aName == KTmpType )
       
   225         {
       
   226 
       
   227 		if(iReqAttrFlag == KAtrSVGTrf)
       
   228 			{
       
   229 			iReqAttrFlag = KAtrAttributeName;
       
   230 			}
       
   231 		else
       
   232 			{
       
   233 			iReqAttrFlag = 0;
       
   234 			}
       
   235 
       
   236         // Use iDataType to keep transformation type
       
   237         if ( aValue == KTmpScale )
       
   238             {
       
   239             iDataType = KSvgTypeScale;
       
   240             iMatrixDataSize = 2;
       
   241             }
       
   242         else if ( aValue == KTmpRotate )
       
   243             {
       
   244             iDataType = KSvgTypeRotate;
       
   245             iMatrixDataSize = 3;
       
   246             }
       
   247         else if ( aValue == KTmpSkewX )
       
   248             {
       
   249             iDataType = KSvgTypeSkewX;
       
   250             iMatrixDataSize = 1;
       
   251             }
       
   252         else if ( aValue == KTmpSkewY )
       
   253             {
       
   254             iDataType = KSvgTypeSkewY;
       
   255             iMatrixDataSize = 1;
       
   256             }
       
   257         else
       
   258             {
       
   259             iDataType = KSvgTypeTranslate;  // default transformation
       
   260             iMatrixDataSize = 2;
       
   261             }
       
   262         return KErrNone;
       
   263         }
       
   264     else if ( aName == KTmpFrom )
       
   265         {
       
   266         iNoFrom = EFalse;
       
   267         // Processing for semi-colon separated data is needed
       
   268         DesToMatrixData( aValue, ( *iTransformValues )[0] );
       
   269         return KErrNone;
       
   270         }
       
   271     else if ( aName == KTmpTo )
       
   272         {
       
   273         iHaveTo = ETrue;
       
   274 
       
   275         if ( iNoFrom )
       
   276             {
       
   277             iAdditive = KAdditiveSum;
       
   278             iAdditiveOrg = KAdditiveSum;
       
   279             }
       
   280 
       
   281         // Processing for semi-colon separated data is needed
       
   282         DesToMatrixData( aValue, ( *iTransformValues )[1] );
       
   283 		iAccumMatrixData.iData[0] = (*iTransformValues)[1].iData[0];
       
   284 		iAccumMatrixData.iData[1] = (*iTransformValues)[1].iData[1];
       
   285 		iAccumMatrixData.iData[2] = (*iTransformValues)[1].iData[2];
       
   286         return KErrNone;
       
   287         }
       
   288     else if ( aName == KTmpBy )
       
   289         {
       
   290         if ( !iHaveTo )
       
   291             {
       
   292             TInt32  i;
       
   293             DesToMatrixData( aValue, ( *iTransformValues )[1] );
       
   294             iHaveBy = ETrue;
       
   295 
       
   296             if(iNoFrom)
       
   297                 {
       
   298                 iAdditive = KAdditiveSum;
       
   299                 iAdditiveOrg = KAdditiveSum;
       
   300                 }
       
   301             for ( i = 0; i < 3; i++ )
       
   302                 {
       
   303                 ( *iTransformValues )[1].iData[i] = ( *iTransformValues )[1].iData[i] +
       
   304                                                     ( *iTransformValues )[0].iData[i];
       
   305                 }
       
   306 
       
   307             }
       
   308         return KErrNone;
       
   309         }
       
   310     else if ( aName == KTmpValues )
       
   311         {
       
   312         TStringTokenizer    tkn ( aValue, SEMICOLON );
       
   313         iTransformValues->Reset();
       
   314 
       
   315    		iHaveValues = ETrue;
       
   316 
       
   317         iNoFrom = EFalse;
       
   318 
       
   319         while ( tkn.HasMoreTokens() )
       
   320             {
       
   321             TMatrixData mtrx;
       
   322             DesToMatrixData( tkn.NextToken(), mtrx );
       
   323             iTransformValues->AppendL( mtrx );
       
   324             }
       
   325         TInt lTransformValuesCount = iTransformValues->Count();
       
   326 		if(lTransformValuesCount > 0)
       
   327 			{
       
   328 			iAccumMatrixData.iData[0] = (*iTransformValues)[lTransformValuesCount - 1].iData[0];
       
   329 			iAccumMatrixData.iData[1] = (*iTransformValues)[lTransformValuesCount - 1].iData[1];
       
   330 			iAccumMatrixData.iData[2] = (*iTransformValues)[lTransformValuesCount - 1].iData[2];
       
   331 			}
       
   332 
       
   333         return KErrNone;
       
   334         }
       
   335 
       
   336     return CSvgAnimationBase::SetAttributeL( aName, aValue );
       
   337     }
       
   338 
       
   339 // ---------------------------------------------------------------------------
       
   340 // From MSvgEventReceiver
       
   341 // ---------------------------------------------------------------------------
       
   342 TBool CSvgAnimateTransformElementImpl::ReceiveEventL( MSvgEvent* aEvent )
       
   343     {
       
   344     return CSvgAnimationBase::ReceiveEventProcL( aEvent, this );
       
   345     }
       
   346 
       
   347 // ---------------------------------------------------------------------------
       
   348 // From CSvgAnimationBase
       
   349 // ---------------------------------------------------------------------------
       
   350 
       
   351 TBool CSvgAnimateTransformElementImpl::AnimProcL( MSvgTimerEvent* aEvent )
       
   352 
       
   353     {
       
   354 
       
   355 
       
   356   if((iAnimStatus != KAnimActive) || iDoFreeze)
       
   357 	   {
       
   358 	   if(iFill== KAnimFillFreeze && !iDoFreeze && iAnimStatus == KAnimFinished)
       
   359 	   		{
       
   360 
       
   361 	   		}
       
   362 	   else
       
   363 		   {
       
   364 		   CSvgAnimationBase::CheckForEndTimesAndFreezeL(this );
       
   365 		   return EFalse;
       
   366 		   }
       
   367 	   }
       
   368     // No animation if 'from' or 'to' is not available
       
   369     if ( iTransformValues->Count() < 2 )
       
   370 		{
       
   371         return EFalse;
       
   372 		}
       
   373 
       
   374     // Calc alpha from time [0-255]
       
   375     TInt32  alpha;
       
   376     TInt32  valix1, valix2, subanimtime;
       
   377     TMatrixData mdata;
       
   378 
       
   379     iAnimTime->GetAnimTime((aEvent->Time()-iNegativeBeginTime), alpha, valix1, subanimtime );
       
   380 
       
   381  // check for the range of valix
       
   382 	if ( valix1 >= iTransformValues->Count() )
       
   383 		{
       
   384         valix1 = iTransformValues->Count() - 1;
       
   385 		}
       
   386 
       
   387 
       
   388     if ( iNoFrom && !iHaveBy ) //. This is to emulate Adobe.
       
   389         {
       
   390         if ( alpha > ( KTimeMax >> 1 ) )
       
   391             {
       
   392             subanimtime = KTimeMax;
       
   393             }
       
   394         else
       
   395             {
       
   396             subanimtime = 0;
       
   397             return ETrue;
       
   398             }
       
   399         }
       
   400 
       
   401     if ( valix1 >= iTransformValues->Count() - 1 )
       
   402 		{
       
   403         valix2 = valix1;
       
   404 		}
       
   405 
       
   406     else
       
   407 		{
       
   408         valix2 = valix1 + 1;
       
   409 		}
       
   410 
       
   411 	mdata.iData[0] = BlendFloat( subanimtime,
       
   412 							   ( *iTransformValues )[valix1].iData[0],
       
   413 							   ( *iTransformValues )[valix2].iData[0] );
       
   414 	mdata.iData[1] = BlendFloat( subanimtime,
       
   415 							   ( *iTransformValues )[valix1].iData[1],
       
   416 							   ( *iTransformValues )[valix2].iData[1] );
       
   417 	mdata.iData[2] = BlendFloat( subanimtime,
       
   418 							   ( *iTransformValues )[valix1].iData[2],
       
   419 							   ( *iTransformValues )[valix2].iData[2] );
       
   420     // Additive
       
   421     /*
       
   422      * !!!! Additive="replace" is not supported
       
   423      * !!!! Additional implementation needed in MSvgTransformList
       
   424      */
       
   425 
       
   426     // Set value
       
   427     TGfxAffineTransform deltaTr;
       
   428     switch ( iDataType )
       
   429         {
       
   430         case KSvgTypeTranslate:
       
   431         deltaTr = TGfxAffineTransform::GetTranslateInstance( mdata.iData[0],
       
   432                                                              mdata.iData[1] );
       
   433         break;
       
   434         case KSvgTypeScale:
       
   435         deltaTr = TGfxAffineTransform::GetScaleInstance( mdata.iData[0],
       
   436                                                          mdata.iData[1] );
       
   437         break;
       
   438         case KSvgTypeRotate:
       
   439         deltaTr = TGfxAffineTransform::GetRotateInstance( ( TReal32 )
       
   440                                                           mdata.iData[0] * 3.1415926f /
       
   441                                                           180.0f,
       
   442                                                           mdata.iData[1],
       
   443                                                           mdata.iData[2] );
       
   444         break;
       
   445         case KSvgTypeSkewX:
       
   446         deltaTr = TGfxAffineTransform::GetShearInstance( ( TReal32 )
       
   447                                                          mdata.iData[0]* 3.1415926f /
       
   448                                                          180.0f,
       
   449                                                          0.0f );
       
   450         break;
       
   451         case KSvgTypeSkewY:
       
   452         deltaTr = TGfxAffineTransform::GetShearInstance( 0.0f,
       
   453                                                          ( TReal32 )
       
   454                                                          mdata.iData[0]* 3.1415926f /
       
   455                                                          180.0f );
       
   456         break;
       
   457         }
       
   458     MSvgTransformList*  trList;
       
   459     ( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   460     TInt32 matrixIndex;
       
   461     ( ( CSvgElementImpl * ) iTargetElement )->GetAttributeIntL( KAtrAnimTransformMatrixIndex, matrixIndex );
       
   462    if ( iAdditive == KAdditiveSum ) //.
       
   463         {
       
   464         if(iNoFrom && subanimtime == KTimeMax && !iHaveBy)
       
   465 	        {
       
   466 	        iTargetElement->SetOverwriteTransforms( ETrue );
       
   467 	        }
       
   468 		/*else
       
   469 	        {
       
   470 	        //if additive = sum and there is a from or a by then dont overwrite the transform
       
   471 	        iTargetElement->iOverwriteTransforms = EFalse;
       
   472 	        }*/
       
   473 	    if(iHaveTo && iNoFrom)
       
   474 	    {
       
   475 	    	iTargetElement->SetOverwriteTransforms(ETrue);
       
   476 	    	trList->ReplaceItem(deltaTr, matrixIndex);
       
   477 	    }
       
   478 	    else 
       
   479 	    {
       
   480         TGfxAffineTransform curMatrix = trList->GetItem( matrixIndex );
       
   481         curMatrix.Concatenate( deltaTr );
       
   482         trList->ReplaceItem( curMatrix, matrixIndex );
       
   483 	    }
       
   484 
       
   485         }
       
   486     else
       
   487         {
       
   488         iTargetElement->SetOverwriteTransforms( ETrue );
       
   489         trList->ReplaceItem( deltaTr, matrixIndex );
       
   490 
       
   491         }
       
   492     if(iFill == KAnimFillFreeze)
       
   493 	    {
       
   494 	    iEndMatrix = deltaTr;
       
   495 	    }
       
   496 	CSvgAnimationBase::CheckForEndTimesAndFreezeL(this );
       
   497     return ETrue;
       
   498     }
       
   499 
       
   500 //
       
   501 // ---------------------------------------------------------------------------
       
   502 //
       
   503 // ---------------------------------------------------------------------------
       
   504 void CSvgAnimateTransformElementImpl::SetFillValueL()
       
   505     {
       
   506     MSvgTransformList*  trList;
       
   507     ( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   508      TInt32              matrixIndex;
       
   509      iTargetElement->GetAttributeIntL( KAtrAnimTransformMatrixIndex, matrixIndex );
       
   510     iFillMatrix = trList->GetItem(matrixIndex);
       
   511     }
       
   512 
       
   513 //
       
   514 // ---------------------------------------------------------------------------
       
   515 //
       
   516 // ---------------------------------------------------------------------------
       
   517 void CSvgAnimateTransformElementImpl::SetToOriginalL()
       
   518     {
       
   519     MSvgTransformList*  trList;
       
   520 	TInt32 matrixIndex;
       
   521 	iTargetElement->GetAttributeIntL( KAtrAnimTransformMatrixIndex, matrixIndex );
       
   522     ( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   523 
       
   524     trList->ReplaceItem( iFillMatrix /*TGfxAffineTransform()*/,
       
   525                              matrixIndex );
       
   526     iTargetElement->SetOverwriteTransforms( EFalse );
       
   527     }
       
   528 
       
   529 // ---------------------------------------------------------------------------
       
   530 //
       
   531 // ---------------------------------------------------------------------------
       
   532 void CSvgAnimateTransformElementImpl::SetToInitialValueL()
       
   533     {
       
   534     MSvgTransformList*  trList;
       
   535     ( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   536     TInt32 matrixIndex;
       
   537     iTargetElement->GetAttributeIntL( KAtrAnimTransformMatrixIndex, matrixIndex );
       
   538 
       
   539     if( iAdditive == KAdditiveSum)
       
   540     	{
       
   541 
       
   542         TGfxAffineTransform curMatrix = trList->GetItem( matrixIndex );
       
   543         curMatrix.Concatenate(iFillMatrix);
       
   544        	trList->ReplaceItem( curMatrix, matrixIndex );
       
   545     	}
       
   546     else
       
   547     	{
       
   548     //	iTargetElement->iOverwriteTransforms = ETrue;
       
   549          trList->ReplaceItem( iFillMatrix, matrixIndex );
       
   550     	}
       
   551 
       
   552 
       
   553     }
       
   554 
       
   555 // ---------------------------------------------------------------------------
       
   556 //
       
   557 // ---------------------------------------------------------------------------
       
   558 void CSvgAnimateTransformElementImpl::SetToEndValueL()
       
   559     {
       
   560     MSvgTransformList*  trList;
       
   561     ( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   562     TInt32 matrixIndex;
       
   563  	iTargetElement->GetAttributeIntL( KAtrAnimTransformMatrixIndex, matrixIndex );
       
   564 
       
   565 	 if( iAdditive == KAdditiveSum)
       
   566     	{
       
   567 		if(iNoFrom &&  !iHaveBy)
       
   568 	        {
       
   569 	        iTargetElement->SetOverwriteTransforms( ETrue );
       
   570 	        }
       
   571 	        if(iHaveTo && iNoFrom)
       
   572 	        {
       
   573 	        	iTargetElement->SetOverwriteTransforms(ETrue);
       
   574 	        	trList->ReplaceItem(iEndMatrix, matrixIndex);
       
   575 	        }
       
   576             else 
       
   577             {
       
   578         TGfxAffineTransform curMatrix = trList->GetItem( matrixIndex );
       
   579         curMatrix.Concatenate(iEndMatrix);
       
   580        	trList->ReplaceItem( curMatrix, matrixIndex );
       
   581             }
       
   582     	}
       
   583     else
       
   584     	{
       
   585     	iTargetElement->SetOverwriteTransforms( ETrue );
       
   586         trList->ReplaceItem( iEndMatrix, matrixIndex );
       
   587     	}
       
   588 
       
   589   }
       
   590 
       
   591 //
       
   592 // ---------------------------------------------------------------------------
       
   593 //
       
   594 // ---------------------------------------------------------------------------
       
   595 void CSvgAnimateTransformElementImpl::InitAnimationL()
       
   596     {
       
   597 
       
   598     if(!iTargetElement)
       
   599 		{
       
   600 		// if target element is not found then remove it.
       
   601 		((CSvgDocumentImpl*)iOwnerDocument)->RemoveFromEventReceiverList(this);
       
   602 		((CSvgDocumentImpl*)iOwnerDocument)->Engine()->UpdatePresentation(1);
       
   603 		return;
       
   604 		}
       
   605 
       
   606 	if (!iHaveValues)
       
   607 		{
       
   608 		if (!iHaveTo && !iHaveBy)
       
   609 			{
       
   610 			((CSvgDocumentImpl*)iOwnerDocument)->RemoveFromEventReceiverList(this );
       
   611             ((CSvgDocumentImpl*)iOwnerDocument)->Engine()->UpdatePresentation(1);
       
   612 			}
       
   613 		}
       
   614 
       
   615 
       
   616     CSvgAnimationBase::InitAnimationL();
       
   617 
       
   618 	if(iMultipleRendering)
       
   619 		{
       
   620 		return;
       
   621 		}
       
   622 
       
   623     // Set keytime
       
   624 	iValuesFloat->Reset();
       
   625     TInt count = iTransformValues->Count();
       
   626     for ( TInt i = 0; i < count; i++ )
       
   627         {
       
   628         iValuesFloat->AppendL( TFloatFixPt( i ) ); // create dummy scalar array
       
   629         }
       
   630     if(!iKeyTimesPresent)
       
   631     iAnimTime->CreateKeyTime( iValuesFloat->Count() );
       
   632     iAnimTime->PrepareTimeL( iValuesFloat );
       
   633 	SetFillValueL();
       
   634 
       
   635     }
       
   636 
       
   637 // ---------------------------------------------------------------------------
       
   638 //
       
   639 // ---------------------------------------------------------------------------
       
   640 void CSvgAnimateTransformElementImpl::SetAccumulateValues()
       
   641     {
       
   642 
       
   643 	if ( !iNoFrom)
       
   644         {
       
   645 
       
   646         if (  iHaveBy )
       
   647 	        {
       
   648 	        TMatrixData delta;
       
   649 
       
   650 			//0
       
   651 	        delta.iData[0] = ( *iTransformValues )[1].iData[0] -
       
   652 	                             ( *iTransformValues )[0].iData[0];
       
   653 
       
   654 	        ( *iTransformValues )[0].iData[0] = ( *iTransformValues )[1].iData[0];
       
   655 
       
   656 	        ( *iTransformValues )[1].iData[0] += delta.iData[0];
       
   657 
       
   658 			//1
       
   659 	        delta.iData[1] = ( *iTransformValues )[1].iData[1] -
       
   660 	                             ( *iTransformValues )[0].iData[1];
       
   661 
       
   662 	        ( *iTransformValues )[0].iData[1] = ( *iTransformValues )[1].iData[1];
       
   663 
       
   664 	        ( *iTransformValues )[1].iData[1] += delta.iData[1];
       
   665 
       
   666 			//2
       
   667 	        delta.iData[2] = ( *iTransformValues )[1].iData[2] -
       
   668 	                             ( *iTransformValues )[0].iData[2];
       
   669 
       
   670 	        ( *iTransformValues )[0].iData[2] = ( *iTransformValues )[1].iData[2];
       
   671 
       
   672 	        ( *iTransformValues )[1].iData[2] += delta.iData[2];
       
   673 
       
   674 	        }
       
   675 	        else
       
   676 		        {
       
   677 				TInt lTransformValuesCount = (*iTransformValues).Count();
       
   678 				for(int i=0;i<lTransformValuesCount;i++)
       
   679 					{
       
   680 					(*iTransformValues)[i].iData[0] += iAccumMatrixData.iData[0];
       
   681 					(*iTransformValues)[i].iData[1] += iAccumMatrixData.iData[1];
       
   682 					(*iTransformValues)[i].iData[2] += iAccumMatrixData.iData[2];
       
   683 					}
       
   684 				}
       
   685         }
       
   686 	else
       
   687 		{
       
   688 		if (  iHaveBy )
       
   689 	        {
       
   690 	        TMatrixData delta;
       
   691 
       
   692 			//0
       
   693 	        delta.iData[0] = ( *iTransformValues )[1].iData[0] -
       
   694 	                             ( *iTransformValues )[0].iData[0];
       
   695 
       
   696 	        ( *iTransformValues )[0].iData[0] = ( *iTransformValues )[1].iData[0];
       
   697 
       
   698 	        ( *iTransformValues )[1].iData[0] += delta.iData[0];
       
   699 
       
   700 			//1
       
   701 	        delta.iData[1] = ( *iTransformValues )[1].iData[1] -
       
   702 	                             ( *iTransformValues )[0].iData[1];
       
   703 
       
   704 	        ( *iTransformValues )[0].iData[1] = ( *iTransformValues )[1].iData[1];
       
   705 
       
   706 	        ( *iTransformValues )[1].iData[1] += delta.iData[1];
       
   707 
       
   708 			//2
       
   709 	        delta.iData[2] = ( *iTransformValues )[1].iData[2] -
       
   710 	                             ( *iTransformValues )[0].iData[2];
       
   711 
       
   712 	        ( *iTransformValues )[0].iData[2] = ( *iTransformValues )[1].iData[2];
       
   713 
       
   714 	        ( *iTransformValues )[1].iData[2] += delta.iData[2];
       
   715 
       
   716 	        }
       
   717 
       
   718 		}
       
   719 
       
   720     }
       
   721 
       
   722 
       
   723 // *******************************************************
       
   724 // AnimateTransformElementImpl specific methods
       
   725 // ---------------------------------------------------------------------------
       
   726 //
       
   727 // ---------------------------------------------------------------------------
       
   728 void CSvgAnimateTransformElementImpl::DesToMatrixData( const TDesC& aDes,
       
   729                                                        TMatrixData& aMatrixData )
       
   730     {
       
   731     TSvgPointLexer  svgplex ( aDes );
       
   732     TInt            i       = 0;
       
   733 
       
   734     while ( !svgplex.IsDone() && i < 3 )
       
   735         {
       
   736         TChar   com;
       
   737         TFloatFixPt  data;
       
   738         TInt32  rslt    = svgplex.GetNext( com, data );
       
   739         if ( rslt != KErrNone )
       
   740             break;
       
   741         aMatrixData.iData[i] = data;
       
   742         i++;
       
   743         }
       
   744     svgplex.Cleanup();
       
   745 
       
   746     // Support shortened data expression
       
   747     if ( i < iMatrixDataSize )
       
   748         {
       
   749         TFloatFixPt  zero    ( 0 );
       
   750         switch ( iDataType )
       
   751             {
       
   752             case KSvgTypeTranslate:
       
   753             aMatrixData.iData[1] = zero;
       
   754             break;
       
   755             case KSvgTypeScale:
       
   756             aMatrixData.iData[1] = aMatrixData.iData[0];
       
   757             break;
       
   758             case KSvgTypeRotate:
       
   759 
       
   760             if ( (i + 1) < iMatrixDataSize )
       
   761 				{
       
   762                 aMatrixData.iData[1] = zero;
       
   763 				}
       
   764 
       
   765             aMatrixData.iData[2] = zero;
       
   766             break;
       
   767             }
       
   768         }
       
   769      if( i > iMatrixDataSize)
       
   770      	{
       
   771      	// reset back everything. this is invalid value.
       
   772      	TFloatFixPt  zero    ( 0 );
       
   773      	aMatrixData.iData[0] = zero;
       
   774      	aMatrixData.iData[1] = zero;
       
   775      	aMatrixData.iData[2] = zero;
       
   776      	}
       
   777     }
       
   778 
       
   779 // ---------------------------------------------------------------------------
       
   780 //
       
   781 // ---------------------------------------------------------------------------
       
   782 void CSvgAnimateTransformElementImpl::ResetAnimationL()
       
   783     {
       
   784     }
       
   785 
       
   786 // ---------------------------------------------------------------------------
       
   787 // Functions used by Decoder
       
   788 // ---------------------------------------------------------------------------
       
   789 
       
   790 void  CSvgAnimateTransformElementImpl::SetMatrixDataSize(TUint8 aValue)
       
   791 	{
       
   792 	iMatrixDataSize= aValue;
       
   793 	}
       
   794 // ---------------------------------------------------------------------------
       
   795 // Functions used by Decoder
       
   796 // ---------------------------------------------------------------------------
       
   797 TBool  CSvgAnimateTransformElementImpl::SetMatrixData( TInt aIndex, TMatrixData& aMatrix)
       
   798 	{
       
   799 	if ( iTransformValues && aIndex < iTransformValues->Count() )
       
   800 		{
       
   801 		for (TInt i=0; i<3; i++)
       
   802 			{
       
   803 			(iTransformValues->operator[](aIndex)).iData[i]= aMatrix.iData[i];
       
   804 			}
       
   805 		return ETrue;
       
   806 		}
       
   807 	else
       
   808 		{
       
   809 		return EFalse;
       
   810 		}
       
   811 	}
       
   812 // ---------------------------------------------------------------------------
       
   813 // Functions used by Decoder
       
   814 // ---------------------------------------------------------------------------
       
   815 void  CSvgAnimateTransformElementImpl::SetTransformValues(RArray<TMatrixData>*&	aValues)
       
   816 	{
       
   817 	if (iTransformValues)
       
   818 		{
       
   819 		iTransformValues->Close();
       
   820 		delete iTransformValues;
       
   821 		iTransformValues= NULL;
       
   822 		}
       
   823 	iTransformValues= aValues;
       
   824 	}
       
   825 // ---------------------------------------------------------------------------
       
   826 // Functions used by Decoder
       
   827 // ---------------------------------------------------------------------------
       
   828 TInt CSvgAnimateTransformElementImpl::SetAttributeIntL( const TInt aNameId,const TInt32 aValue )
       
   829 	{
       
   830 	if(aNameId == KAtrType)
       
   831 		{
       
   832 		if ( aValue == KSvgTypeScale )
       
   833             {
       
   834             iDataType = KSvgTypeScale;
       
   835             iMatrixDataSize = 2;
       
   836             }
       
   837         else if ( aValue == KSvgTypeRotate )
       
   838             {
       
   839             iDataType = KSvgTypeRotate;
       
   840             iMatrixDataSize = 3;
       
   841             }
       
   842         else if ( aValue == KSvgTypeSkewX )
       
   843             {
       
   844             iDataType = KSvgTypeSkewX;
       
   845             iMatrixDataSize = 1;
       
   846             }
       
   847         else if ( aValue == KSvgTypeSkewY )
       
   848             {
       
   849             iDataType = KSvgTypeSkewY;
       
   850             iMatrixDataSize = 1;
       
   851             }
       
   852         else
       
   853             {
       
   854             iDataType = KSvgTypeTranslate;  // default transformation
       
   855             iMatrixDataSize = 2;
       
   856             }
       
   857 		return KErrNone;
       
   858 		}
       
   859 	return CSvgAnimationBase::SetAttributeIntL(aNameId,aValue);
       
   860 	}
       
   861 // ---------------------------------------------------------------------------
       
   862 // Functions used by Decoder
       
   863 // ---------------------------------------------------------------------------
       
   864 TInt CSvgAnimateTransformElementImpl::GetAttributeIntL( const TInt aNameId, TInt32& aValue )
       
   865 	{
       
   866 	if(aNameId == KAtrType)
       
   867 		{
       
   868 		aValue = iDataType;
       
   869 		return KErrNone;
       
   870 		}
       
   871 	return CSvgAnimationBase::GetAttributeIntL(aNameId,aValue);
       
   872 	}
       
   873 // ---------------------------------------------------------------------------
       
   874 // Functions used by Decoder
       
   875 // ---------------------------------------------------------------------------
       
   876 TInt CSvgAnimateTransformElementImpl::GetAttributeFloat(const TInt aNameId,TFloatFixPt& aValue )
       
   877 {
       
   878 	return CSvgAnimationBase::GetAttributeFloat(aNameId,aValue);
       
   879 }
       
   880 // ---------------------------------------------------------------------------
       
   881 // Functions used by Decoder
       
   882 // ---------------------------------------------------------------------------
       
   883 TInt CSvgAnimateTransformElementImpl::SetAttributeFloatL(const TInt aNameId,TFloatFixPt aValue )
       
   884 {
       
   885 	return CSvgAnimationBase::SetAttributeFloatL(aNameId,aValue);
       
   886 }
       
   887 // ---------------------------------------------------------------------------
       
   888 // Functions used by Decoder
       
   889 // ---------------------------------------------------------------------------
       
   890 // this function is for binary discrepancies
       
   891 void CSvgAnimateTransformElementImpl::SetAccumMatrix()
       
   892 {
       
   893 	if(iHaveTo)
       
   894 		{
       
   895 		iAccumMatrixData.iData[0] = (*iTransformValues)[1].iData[0];
       
   896 		iAccumMatrixData.iData[1] = (*iTransformValues)[1].iData[1];
       
   897 		iAccumMatrixData.iData[2] = (*iTransformValues)[1].iData[2];
       
   898 		}
       
   899 	else
       
   900 		{
       
   901 		if(!iNoFrom)
       
   902 			{
       
   903 			TInt lTransformValuesCount = iTransformValues->Count();
       
   904 			if(lTransformValuesCount > 0)
       
   905 				{
       
   906 				iAccumMatrixData.iData[0] = (*iTransformValues)[lTransformValuesCount - 1].iData[0];
       
   907 				iAccumMatrixData.iData[1] = (*iTransformValues)[lTransformValuesCount - 1].iData[1];
       
   908 				iAccumMatrixData.iData[2] = (*iTransformValues)[lTransformValuesCount - 1].iData[2];
       
   909 				}
       
   910 			}
       
   911 		}
       
   912 }
       
   913 // ---------------------------------------------------------------------------
       
   914 // Functions used by Decoder
       
   915 // ---------------------------------------------------------------------------
       
   916 void CSvgAnimateTransformElementImpl::ReInitializeAnimation()
       
   917     {
       
   918 
       
   919 	if ( iAttrId == 0xffff )
       
   920         return;
       
   921 
       
   922     // Do not set Multiple Rendering flag if animation is not
       
   923     // initialised. This allows the Key Times array in the anim
       
   924     // time controller to be set correctly so that the 
       
   925     // interpolation happens correctly.
       
   926     if ( iInitDone )
       
   927         {
       
   928 	    iMultipleRendering=  ETrue;        
       
   929         }
       
   930 
       
   931 	if( iCurrentRepeatCount > 0 && iAccumulate == KAccumSum )
       
   932 		{
       
   933 		SetTransValues_DOMReuse();
       
   934 		}
       
   935 
       
   936 
       
   937 	CSvgAnimationBase::ReInitializeAnimation();
       
   938 
       
   939     if(iTargetElement)
       
   940 	{
       
   941 		TInt32 matrixIndex = -1;
       
   942 		MSvgTransformList*  trList;
       
   943 		( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   944 
       
   945 		TGfxAffineTransform affineTransform;
       
   946  		TRAPD(error,iTargetElement->GetAttributeIntL( KAtrAnimTransformMatrixIndex, matrixIndex ));
       
   947 	    if(error == KErrNone)
       
   948 		    {
       
   949 		    ( ( CSvgElementImpl * ) iTargetElement )->GetTransform( trList );
       
   950 			if( trList && (trList->NumberOfItems() >  matrixIndex) )
       
   951 				{
       
   952 				trList->ReplaceItem(affineTransform,matrixIndex);
       
   953 				}
       
   954 			}
       
   955 
       
   956 		}
       
   957 
       
   958 		iFillMatrix= TGfxAffineTransform();
       
   959 
       
   960 	}
       
   961 // ---------------------------------------------------------------------------
       
   962 //
       
   963 // ---------------------------------------------------------------------------
       
   964 void  CSvgAnimateTransformElementImpl::SetTransValues_DOMReuse()
       
   965 	{
       
   966 	if(iOrgTransformValues && iTransformValues)
       
   967 		{
       
   968         iTransformValues->Reset();
       
   969         
       
   970         TInt orgTransformValCnt = iOrgTransformValues->Count();
       
   971 		for(TInt i=0; i<orgTransformValCnt; i++)
       
   972 			{
       
   973 			 TMatrixData lMatrix;
       
   974 			lMatrix.iData[0] = (*iOrgTransformValues)[i].iData[0];
       
   975      		lMatrix.iData[1] = (*iOrgTransformValues)[i].iData[1];
       
   976 			lMatrix.iData[2] = (*iOrgTransformValues)[i].iData[2];
       
   977 
       
   978 			iTransformValues->Append((TMatrixData) lMatrix);
       
   979 			}
       
   980 		}
       
   981 	}
       
   982 // ---------------------------------------------------------------------------
       
   983 // Functions used by Decoder
       
   984 // ---------------------------------------------------------------------------
       
   985 void  CSvgAnimateTransformElementImpl::SetOriginalValues_DOMReuse()
       
   986 	{
       
   987 
       
   988 	if(  iAccumulate == KAccumSum )
       
   989 		{
       
   990 		if(iTransformValues && iOrgTransformValues)
       
   991 			{
       
   992 			iOrgTransformValues->Reset();
       
   993 			
       
   994 			TInt transformValCnt = iTransformValues->Count();
       
   995 			for(TInt i=0; i<transformValCnt; i++)
       
   996 				{
       
   997 				 TMatrixData lMatrix;
       
   998 				lMatrix.iData[0] = (*iTransformValues)[i].iData[0];
       
   999      			lMatrix.iData[1] = (*iTransformValues)[i].iData[1];
       
  1000 				lMatrix.iData[2] = (*iTransformValues)[i].iData[2];
       
  1001 
       
  1002 				iOrgTransformValues->Append((TMatrixData) lMatrix);
       
  1003 				}
       
  1004 			}
       
  1005 		}
       
  1006 
       
  1007     // calling base class function.
       
  1008 	CSvgAnimationBase::SetOriginalValues_DOMReuse();
       
  1009 	}
       
  1010 // ---------------------------------------------------------------------------
       
  1011 //
       
  1012 // ---------------------------------------------------------------------------
       
  1013 CGfxGeneralPath* CSvgAnimateTransformElementImpl::GetPathAttribute(TInt aAttributeId)
       
  1014 	{
       
  1015 	return CSvgAnimationBase::GetPathAttribute(aAttributeId);
       
  1016 
       
  1017 	}
       
  1018 // ---------------------------------------------------------------------------
       
  1019 //
       
  1020 // ---------------------------------------------------------------------------
       
  1021 void CSvgAnimateTransformElementImpl::SetPathAttribute(TInt aAttributeId, CGfxGeneralPath* aPathHandle)
       
  1022 {
       
  1023 
       
  1024 		CSvgAnimationBase::SetPathAttribute(aAttributeId, aPathHandle);
       
  1025 
       
  1026 }
       
  1027 // ---------------------------------------------------------------------------
       
  1028 // Set the values in the dom .
       
  1029 // ---------------------------------------------------------------------------
       
  1030 void CSvgAnimateTransformElementImpl::Reset(MSvgEvent* aEvent)
       
  1031 {
       
  1032 
       
  1033 		iIsUserSeek  = ETrue;
       
  1034 		// first call the animation base function.
       
  1035 		TSvgTimerEvent* timerEvent  = ( TSvgTimerEvent* ) aEvent;
       
  1036 
       
  1037 	if((TInt32)timerEvent->Time() < iAbsoluteBeginTime)
       
  1038 		{
       
  1039 		// let it come to initial position.
       
  1040 		((CSvgDocumentImpl*)iOwnerDocument)->iInitialDrawFlag = ETrue;
       
  1041 		ReInitializeAnimation();
       
  1042 		return;
       
  1043 		}
       
  1044 
       
  1045 	TRAPD(error,CSvgAnimationBase::ResetL( aEvent, this));
       
  1046 
       
  1047 	if (error != KErrNone)
       
  1048 	{
       
  1049 					// error processing not processed
       
  1050 					return;
       
  1051 	}
       
  1052 
       
  1053 
       
  1054 }
       
  1055 // ---------------------------------------------------------------------------
       
  1056 //
       
  1057 // ---------------------------------------------------------------------------
       
  1058 /////////////////////////////////////////////
       
  1059 MXmlElement* CSvgAnimateTransformElementImpl::CloneL(MXmlElement*
       
  1060 aParentElement)
       
  1061 	{
       
  1062 
       
  1063 		CSvgAnimateTransformElementImpl* newElement = CSvgAnimateTransformElementImpl::NewL(  this->ElemID(),((CSvgDocumentImpl*)iOwnerDocument) );
       
  1064 		CleanupStack::PushL( newElement );
       
  1065 		newElement->iParentNode = aParentElement;
       
  1066 		// copy the data
       
  1067 		// end copying data from this class.
       
  1068 		// this will get cloned setting the parent element to aParentElement;
       
  1069 
       
  1070 		newElement->iOwnerDocument = this->iOwnerDocument;
       
  1071 
       
  1072 		// set the target element this needs to be modified.
       
  1073 		newElement->iTargetElement = (CSvgElementImpl*)aParentElement;
       
  1074 		this->CopyL(newElement);
       
  1075 		CleanupStack::Pop();
       
  1076 		return newElement;
       
  1077 	}
       
  1078 
       
  1079 // ---------------------------------------------------------------------------
       
  1080 //
       
  1081 // ---------------------------------------------------------------------------
       
  1082 void CSvgAnimateTransformElementImpl::CopyL(CSvgAnimateTransformElementImpl* aDestElement )
       
  1083     {
       
  1084     // copy stuff from superclass
       
  1085     if(aDestElement)
       
  1086     {
       
  1087 
       
  1088 
       
  1089     this->CSvgAnimationBase::CopyL(aDestElement);
       
  1090     // copy the reference to idoc (CSvgDocumentImpl)
       
  1091     aDestElement->iOwnerDocument = this->iOwnerDocument;
       
  1092 
       
  1093 	aDestElement->iMultipleRendering = this->iMultipleRendering;
       
  1094 	aDestElement->iMatrixDataSize = this->iMatrixDataSize;
       
  1095 	aDestElement->iFillMatrix = this->iFillMatrix;
       
  1096 	aDestElement->iEndMatrix = this->iEndMatrix;
       
  1097 	TMatrixData lTemp;
       
  1098 
       
  1099 	TInt count = this->iTransformValues->Count() ;
       
  1100 	aDestElement->iTransformValues->Reset();
       
  1101 	for(TInt i=0; i<count; i++)
       
  1102 		{
       
  1103         aDestElement->iTransformValues->AppendL(lTemp);
       
  1104 		aDestElement->iTransformValues->operator[](i).iData[0] =
       
  1105 this->iTransformValues->operator[](i).iData[0];
       
  1106 		aDestElement->iTransformValues->operator[](i).iData[1] =
       
  1107 this->iTransformValues->operator[](i).iData[1];
       
  1108 		aDestElement->iTransformValues->operator[](i).iData[2] =
       
  1109 this->iTransformValues->operator[](i).iData[2];
       
  1110 		}
       
  1111 	TInt count2 = this->iOrgTransformValues->Count();
       
  1112 	aDestElement->iOrgTransformValues->Reset();
       
  1113 	for(TInt i=0; i<count2; i++)
       
  1114         {
       
  1115         aDestElement->iOrgTransformValues->AppendL(lTemp);
       
  1116         aDestElement->iOrgTransformValues->operator[](i).iData[0] =
       
  1117 this->iOrgTransformValues->operator[](i).iData[0];
       
  1118 		aDestElement->iOrgTransformValues->operator[](i).iData[1] =
       
  1119 this->iOrgTransformValues->operator[](i).iData[1];
       
  1120 		aDestElement->iOrgTransformValues->operator[](i).iData[2] =
       
  1121 this->iOrgTransformValues->operator[](i).iData[2];
       
  1122 		}
       
  1123 	aDestElement->iAccumMatrixData.iData[0] = this->iAccumMatrixData.iData[0];
       
  1124 	aDestElement->iAccumMatrixData.iData[1] = this->iAccumMatrixData.iData[1];
       
  1125 	aDestElement->iAccumMatrixData.iData[2] = this->iAccumMatrixData.iData[2];
       
  1126     }
       
  1127    }
       
  1128 
       
  1129 // ---------------------------------------------------------------------------
       
  1130 //
       
  1131 // ---------------------------------------------------------------------------
       
  1132 void CSvgAnimateTransformElementImpl::DeactivateAnimation()
       
  1133 {
       
  1134 CSvgAnimationBase::DeactivateAnimation(this);
       
  1135 }
       
  1136 
       
  1137 // ---------------------------------------------------------------------------
       
  1138 //
       
  1139 // ---------------------------------------------------------------------------
       
  1140 TBool CSvgAnimateTransformElementImpl::DoAnimProcL(MSvgEvent* aEvent)
       
  1141 {
       
  1142 return this->AnimProcL((MSvgTimerEvent*)aEvent);
       
  1143 }
       
  1144 
       
  1145 // ---------------------------------------------------------------------------
       
  1146 //
       
  1147 // ---------------------------------------------------------------------------
       
  1148 void CSvgAnimateTransformElementImpl::SetAccumulateValuesForSetMediaTime()
       
  1149 {
       
  1150 if(iAccumulate == KAccumSum )
       
  1151 		{
       
  1152 
       
  1153 		SetTransValues_DOMReuse();
       
  1154 
       
  1155 		SetAccumMatrix();
       
  1156 		TInt i=0;
       
  1157 		while(i < iCurrentRepeatCount )
       
  1158 			{
       
  1159 			// take care of the accum = sum.
       
  1160 			SetAccumulateValues();
       
  1161 			i++;
       
  1162 			}
       
  1163 		}
       
  1164 }
       
  1165 
       
  1166 void CSvgAnimateTransformElementImpl::Print( TBool aIsEncodeOn )
       
  1167 {
       
  1168 	if (!aIsEncodeOn)
       
  1169 	{
       
  1170 		#ifdef _DEBUG
       
  1171 		RDebug::Printf("<animateTransform attributeName=\"hmm\" attributeType=\"hmm\" type=\"%d\" from=\"%d\" to=\"%d\" dur=\"hmm\" additive=\"hmm\" />",
       
  1172 		/*iDataType,*/ (int)iFromFloat, (int)iToFloat /*,iAccumulate*/);
       
  1173 		#endif
       
  1174 	}
       
  1175 }