uiaccelerator_plat/alf_core_toolkit_api/tsrc/src/testuiaifcoretoolkitblockssegmentedtexture.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:16:53 +0100
branchRCL_3
changeset 52 31fccae4f8a7
parent 22 7c5dd702d6d3
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  test api of alf_core_toolkit
*
*/


// [INCLUDE FILES]
#include <e32svr.h>
#include <gdi.h>
#include <stifparser.h>
#include <stiftestinterface.h>
#include <uiacceltk/huienv.h>
#include <uiacceltk/huistatic.h>
#include <uiacceltk/huidropshadow.h>
#include <uiacceltk/huisegmentedtexture.h>

#include "testuiaifcoretoolkit.h"
#include "testuiaifblockstexturechild.h"
#include "testuiaifblocksmanagerchild.h"

// -----------------------------------------------------------------------------
// CTestUiAifCoreToolkit::TestHuisegmentedTextureHandleL
// -----------------------------------------------------------------------------
//
TInt CTestUiAifCoreToolkit::TestHuisegmentedTextureHandleL( CStifItemParser& /*aItem*/ )
    {

    // Print to UI
    _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" );
    _LIT( KTestHuisegmentedTextureHandleL, "In TestHuisegmentedTextureHandleL" );
    TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit,
            KTestHuisegmentedTextureHandleL );
    // Print to log file 
    iLog->Log( KTestHuisegmentedTextureHandleL );
    
    CTestUiAifBlocksManagerChild* managerChild =new ( ELeave ) CTestUiAifBlocksManagerChild;
    STIF_ASSERT_NOT_NULL( managerChild );
    CleanupStack::PushL( managerChild );
    CTestUiAifBlocksTextureChild* textureChild = CTestUiAifBlocksTextureChild::NewL( *managerChild );
    STIF_ASSERT_NOT_NULL( textureChild );
    
    TInt segment = 0;
    TInt number = 1;
    textureChild->SetSegmentCountL( number );
    MHuiSegmentedTexture* segmentedTeexture  = textureChild->SegmentedTexture();
    segmentedTeexture->Handle( segment );
    
    CleanupStack::PushL( textureChild );
    CleanupStack::PopAndDestroy( textureChild );
    
    return KErrNone;
    
    }

// -----------------------------------------------------------------------------
// CTestUiAifCoreToolkit::TestHuisegmentedTextureBindL
// -----------------------------------------------------------------------------
//
TInt CTestUiAifCoreToolkit::TestHuisegmentedTextureBindL( CStifItemParser& /*aItem*/ )
    {

    // Print to UI
    _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" );
    _LIT( KTestHuisegmentedTextureBindL, "In TestHuisegmentedTextureBindL" );
    TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit,
            KTestHuisegmentedTextureBindL );
    // Print to log file 
    iLog->Log( KTestHuisegmentedTextureBindL );
    
    CTestUiAifBlocksManagerChild* managerChild =new ( ELeave ) CTestUiAifBlocksManagerChild;
    STIF_ASSERT_NOT_NULL( managerChild );
    CleanupStack::PushL( managerChild );
    CTestUiAifBlocksTextureChild* textureChild = CTestUiAifBlocksTextureChild::NewL( *managerChild );
    STIF_ASSERT_NOT_NULL( textureChild );
    
    TInt number = 1;
    textureChild->SetSegmentCountL( number );
    MHuiSegmentedTexture* segmentedTeexture  = textureChild->SegmentedTexture();
    segmentedTeexture->Bind();
    
    CleanupStack::PushL( textureChild );
    CleanupStack::PopAndDestroy( textureChild );
    
    return KErrNone;
    
    }

//  [End of File]