uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstransformation.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2002 - 2007 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:  test functions for alftransformation.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <alf/alftransformation.h>
       
    22 
       
    23 #include "testplatalfvisual.h"
       
    24 
       
    25 
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CTestPlatAlfVisual::TestTransNewL
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 TInt CTestPlatAlfVisual::TestTransNewL( CStifItemParser& /*aItem*/ )
       
    34     {
       
    35     // Print to UI
       
    36     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    37     _LIT( KTestTransNewL, "TestTransNewL" );
       
    38     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransNewL );
       
    39     // Print to log file
       
    40     iLog->Log( KTestTransNewL );
       
    41     
       
    42     CAlfTransformation* alfTrans = CAlfTransformation::NewL( *iAlfEnv );
       
    43     CleanupStack::PushL( alfTrans );
       
    44     STIF_ASSERT_NOT_NULL( alfTrans );
       
    45     CleanupStack::PopAndDestroy( alfTrans );
       
    46     
       
    47     return KErrNone;
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CTestPlatAlfVisual::TestTransNewLCL
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 TInt CTestPlatAlfVisual::TestTransNewLCL( CStifItemParser& /*aItem*/ )
       
    55     {
       
    56     // Print to UI
       
    57     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    58     _LIT( KTestTransNewLCL, "TestTransNewLCL" );
       
    59     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransNewLCL );
       
    60     // Print to log file
       
    61     iLog->Log( KTestTransNewLCL );
       
    62     
       
    63     CAlfTransformation* alfTrans = CAlfTransformation::NewLC( *iAlfEnv );
       
    64     STIF_ASSERT_NOT_NULL( alfTrans );
       
    65     CleanupStack::PopAndDestroy( alfTrans );
       
    66     
       
    67     return KErrNone;
       
    68     }
       
    69 
       
    70 // -----------------------------------------------------------------------------
       
    71 // CTestPlatAlfVisual::TestTransCountL
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 TInt CTestPlatAlfVisual::TestTransCountL( CStifItemParser& /*aItem*/ )
       
    75     {
       
    76     // Print to UI
       
    77     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    78     _LIT( KTestTransCountL, "TestTransCountL" );
       
    79     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransCountL );
       
    80     // Print to log file
       
    81     iLog->Log( KTestTransCountL );
       
    82     
       
    83     iAlfCtrlGroup->EnableTransformationL();
       
    84     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
    85     alfTrans.Count();
       
    86 
       
    87     return KErrNone;
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CTestPlatAlfVisual::TestTransNonIdentityCountL
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TInt CTestPlatAlfVisual::TestTransNonIdentityCountL( CStifItemParser& /*aItem*/ )
       
    95     {
       
    96     // Print to UI
       
    97     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    98     _LIT( KTestTransNonIdentityCountL, "TestTransNonIdentityCountL" );
       
    99     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransNonIdentityCountL );
       
   100     // Print to log file
       
   101     iLog->Log( KTestTransNonIdentityCountL );
       
   102     
       
   103     iAlfCtrlGroup->EnableTransformationL();
       
   104     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   105     alfTrans.NonIdentityCount();
       
   106     
       
   107     return KErrNone;
       
   108     }
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CTestPlatAlfVisual::TestTransStepL
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 TInt CTestPlatAlfVisual::TestTransStepL( CStifItemParser& /*aItem*/ )
       
   115     {
       
   116     // Print to UI
       
   117     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   118     _LIT( KTestTransStepL, "TestTransStepL" );
       
   119     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransStepL );
       
   120     // Print to log file
       
   121     iLog->Log( KTestTransStepL );
       
   122     
       
   123     iAlfCtrlGroup->EnableTransformationL();
       
   124     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   125     alfTrans.Rotate( 0, 0, 1, 0 );
       
   126     alfTrans.Rotate( 0, 1, 0, 0 );
       
   127     alfTrans.Step( 1 );
       
   128     
       
   129     return KErrNone;
       
   130     }
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CTestPlatAlfVisual::TestTransReplaceStepL
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 TInt CTestPlatAlfVisual::TestTransReplaceStepL( CStifItemParser& /*aItem*/ )
       
   137     {
       
   138     // Print to UI
       
   139     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   140     _LIT( KTestTransReplaceStepL, "TestTransReplaceStepL" );
       
   141     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransReplaceStepL );
       
   142     // Print to log file
       
   143     iLog->Log( KTestTransReplaceStepL );
       
   144     
       
   145     iAlfCtrlGroup->EnableTransformationL();
       
   146     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   147     alfTrans.Rotate( 0, 0, 1, 0 );
       
   148     alfTrans.Rotate( 0, 1, 0, 0 );
       
   149     CAlfTransformation::TTransform transStep = alfTrans.Step( 1 );;
       
   150     alfTrans.ReplaceStep( 1, transStep );
       
   151     
       
   152     return KErrNone;
       
   153     }
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CTestPlatAlfVisual::TestTransLoadIdentityL
       
   157 // -----------------------------------------------------------------------------
       
   158 //
       
   159 TInt CTestPlatAlfVisual::TestTransLoadIdentityL( CStifItemParser& /*aItem*/ )
       
   160     {
       
   161     // Print to UI
       
   162     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   163     _LIT( KTestTransLoadIdentityL, "TestTransLoadIdentityL" );
       
   164     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransLoadIdentityL );
       
   165     // Print to log file
       
   166     iLog->Log( KTestTransLoadIdentityL );
       
   167     
       
   168     iAlfCtrlGroup->EnableTransformationL();
       
   169     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   170     alfTrans.LoadIdentity();
       
   171     
       
   172     return KErrNone;
       
   173     }
       
   174 
       
   175 // -----------------------------------------------------------------------------
       
   176 // CTestPlatAlfVisual::TestTransTranslateL
       
   177 // -----------------------------------------------------------------------------
       
   178 //
       
   179 TInt CTestPlatAlfVisual::TestTransTranslateL( CStifItemParser& /*aItem*/ )
       
   180     {
       
   181     // Print to UI
       
   182     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   183     _LIT( KTestTransTranslateL, "TestTransTranslateL" );
       
   184     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransTranslateL );
       
   185     // Print to log file
       
   186     iLog->Log( KTestTransTranslateL );
       
   187     
       
   188     iAlfCtrlGroup->EnableTransformationL();
       
   189     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   190     
       
   191     alfTrans.Translate( 1.0, 1.0 );
       
   192     TAlfTimedValue x, y;
       
   193     alfTrans.Translate( x, y );
       
   194     
       
   195     return KErrNone;
       
   196     }
       
   197 
       
   198 // -----------------------------------------------------------------------------
       
   199 // CTestPlatAlfVisual::TestTransScaleL
       
   200 // -----------------------------------------------------------------------------
       
   201 //
       
   202 TInt CTestPlatAlfVisual::TestTransScaleL( CStifItemParser& /*aItem*/ )
       
   203     {
       
   204     // Print to UI
       
   205     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   206     _LIT( KTestTransScaleL, "TestTransScaleL" );
       
   207     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransScaleL );
       
   208     // Print to log file
       
   209     iLog->Log( KTestTransScaleL );
       
   210     
       
   211     iAlfCtrlGroup->EnableTransformationL();
       
   212     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   213     
       
   214     alfTrans.Scale( 1.0, 2.0 );
       
   215     TAlfTimedValue x, y;
       
   216     alfTrans.Scale( x, y );
       
   217     alfTrans.Scale( 1.0, 2.0, 3.0 );
       
   218     TAlfTimedValue z;
       
   219     alfTrans.Scale( x, y, z );
       
   220     
       
   221     return KErrNone;
       
   222     }
       
   223 
       
   224 // -----------------------------------------------------------------------------
       
   225 // CTestPlatAlfVisual::TestTransRotateL
       
   226 // -----------------------------------------------------------------------------
       
   227 //
       
   228 TInt CTestPlatAlfVisual::TestTransRotateL( CStifItemParser& /*aItem*/ )
       
   229     {
       
   230     // Print to UI
       
   231     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
   232     _LIT( KTestTransRotateL, "TestTransRotateL" );
       
   233     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransRotateL );
       
   234     // Print to log file
       
   235     iLog->Log( KTestTransRotateL );
       
   236     
       
   237     iAlfCtrlGroup->EnableTransformationL();
       
   238     CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
       
   239     
       
   240     TAlfTimedValue angle;
       
   241     alfTrans.Rotate( 1.0 );
       
   242     alfTrans.Rotate( angle );
       
   243     alfTrans.Rotate( 1.0, 2.0, 3.0, 4.0 );
       
   244     alfTrans.Rotate( angle, 1.0, 2.0, 3.0 );
       
   245     
       
   246     return KErrNone;
       
   247     }
       
   248 
       
   249 
       
   250 //  [End of File]