uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimage.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 alfvisual.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // [INCLUDE FILES]
       
    21 #include <e32svr.h>
       
    22 #include <stifparser.h>
       
    23 #include <stiftestinterface.h>
       
    24 #include <aknsconstants.h>
       
    25 
       
    26 #include "testplatalfvisual.h"
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CTestPlatAlfVisual::TestAlfImageConstructorL
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 TInt CTestPlatAlfVisual::TestAlfImageConstructorL( CStifItemParser& /*aItem*/ )
       
    35     {
       
    36     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    37     _LIT( KTestAlfImageConstructorL, "TestAlfImageConstructorL" );
       
    38     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageConstructorL );
       
    39     // Print to log file
       
    40     iLog->Log( KTestAlfImageConstructorL );
       
    41     
       
    42     TAlfImage vImage1;
       
    43     TUid vUid = { 0x00000000 };
       
    44     CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
       
    45     const CAlfTexture* vText = vTextManager->Texture( 0 );
       
    46     TAlfImage vImage2( *vText );
       
    47     TAlfImage vImage3( KAknsIIDNone, TSize( 1, 1) );
       
    48     TAlfImage vImage4( NULL, TSize( 1, 1), EAspectRatioPreservedAndUnusedSpaceRemoved,
       
    49            NULL, 0, 0, 0, 0, 0, 0, EAlfTextureFlagDefault, 0, NULL );
       
    50     TAlfImage vImage5( vUid, EAknsAppIconTypeList, 
       
    51             TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
       
    52     
       
    53     return KErrNone;
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CTestPlatAlfVisual::TestAlfImageSetAttributesL
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 TInt CTestPlatAlfVisual::TestAlfImageSetAttributesL( CStifItemParser& /*aItem*/ )
       
    61     {
       
    62     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    63     _LIT( KTestAlfImageSetAttributesL, "TestAlfImageSetAttributesL" );
       
    64     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageSetAttributesL );
       
    65     // Print to log file
       
    66     iLog->Log( KTestAlfImageSetAttributesL );
       
    67     
       
    68     TAlfImage vImage;
       
    69     TUid vUid = { 0x00000000 };
       
    70     CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
       
    71     CAlfTexture* vText = &( vTextManager->BlankTexture() );
       
    72     vImage.SetTexture( *vText );
       
    73     vImage.Translate( 0, 0 );
       
    74     vImage.Scale( 1, 1 );
       
    75 
       
    76     vImage.SetTexCoords();
       
    77     
       
    78     return KErrNone;
       
    79     }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CTestPlatAlfVisual::TestAlfImageGetAttributesL
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 TInt CTestPlatAlfVisual::TestAlfImageGetAttributesL( CStifItemParser& /*aItem*/ )
       
    86     {
       
    87     _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
       
    88     _LIT( KTestAlfImageGetAttributesL, "TestAlfImageGetAttributesL" );
       
    89     TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageGetAttributesL );
       
    90     // Print to log file
       
    91     iLog->Log( KTestAlfImageGetAttributesL );
       
    92     
       
    93     TAlfImage vImage;
       
    94     TUid vUid = { 0x00000000 };
       
    95     CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
       
    96     CAlfTexture* vText = &( vTextManager->BlankTexture() );
       
    97     vImage.SetTexture( *vText );
       
    98     vImage.HasTexture();
       
    99     vImage.BottomRight();
       
   100     vImage.TopLeft();
       
   101     vImage.Texture();
       
   102     
       
   103     return KErrNone;
       
   104     }
       
   105 
       
   106 
       
   107 // End of file
       
   108