Exemplo n.º 1
0
EXPORT_C TInt AknsUtils::GetCachedColor(
    MAknsSkinInstance* aInstance, TRgb& aRgb, const TAknsItemID& aID,
    const TInt aIndex )
    {
    if( !aInstance )
        {
        return KErrNotSupported;
        }

    // Check backward compatibility first
    if( AknsScalabilityUtils::GetBackwardCompatibilityColor(
        aInstance, aRgb, aID, aIndex ) )
        {
        // Found and assigned
        return KErrNone;
        }

    CAknsColorTableItemData* colorData = static_cast<CAknsColorTableItemData*>(
        aInstance->GetCachedItemData( aID, EAknsITColorTable ) );
    if( !colorData)
        {
        return KErrNotFound;
        }

    TRAPD( err, colorData->GetColorL( aIndex, aRgb ) );
    return err;
    }
Exemplo n.º 2
0
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestCTIDSetColorsL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestCTIDSetColorsL( CStifItemParser& /*aItem*/ )
    {
    CAknsColorTableItemData* itemData = CAknsColorTableItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    TAknsColorTableEntry* color = new (ELeave) TAknsColorTableEntry[1];
    color->iIndex = 0;
    color->iRgb = 0x00020408;
    itemData->SetColorsL( 1, color );

    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }