uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitehelper.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2008 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "alfperfappsuitehelper.h"
       
    21 
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 void TAlfPerfAppSuiteHelper::AddBorderBrushL( 
       
    26 		CAlfVisual* aVisual,
       
    27 		const TRgb& aColor,
       
    28 		TInt aThicknessWidth,
       
    29 		TInt aThicknessHeight)
       
    30 	{
       
    31 	CAlfBorderBrush* brush = CAlfBorderBrush::NewLC( aVisual->Env(), aThicknessWidth, aThicknessHeight, 0, 0);
       
    32 	aVisual->EnableBrushesL();
       
    33 	brush->SetColor(aColor);
       
    34 	brush->SetLayer( EAlfBrushLayerForeground ); // this will be drawn on top of everything
       
    35     aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
       
    36     CleanupStack::Pop(brush);	
       
    37 	}
       
    38 
       
    39 void TAlfPerfAppSuiteHelper::AddGradientBrushL( 
       
    40 		CAlfVisual* aVisual,
       
    41 		const TRgb& aColor1,
       
    42 		const TRgb& aColor2,
       
    43 		CAlfGradientBrush::TDirection aDirection )
       
    44 	{
       
    45 	CAlfGradientBrush* brush = CAlfGradientBrush::NewLC( aVisual->Env() );
       
    46 	aVisual->EnableBrushesL();
       
    47 	brush->SetDirection( aDirection );
       
    48 	brush->AppendColorL( 0, aColor1 );
       
    49 	brush->AppendColorL( 1, aColor2 );
       
    50     aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
       
    51     CleanupStack::Pop(brush);	
       
    52 	}
       
    53 
       
    54 void TAlfPerfAppSuiteHelper::AddGradientBrushL( 
       
    55 		CAlfVisual* aVisual,
       
    56 		const TRgb& aColor )
       
    57 	{
       
    58 	// This is effectively a solid brush
       
    59 	CAlfGradientBrush* brush = CAlfGradientBrush::NewLC( aVisual->Env() );
       
    60 	aVisual->EnableBrushesL();
       
    61 	brush->SetColor( aColor );
       
    62     aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
       
    63     CleanupStack::Pop(brush);	
       
    64 	}
       
    65 
       
    66 void TAlfPerfAppSuiteHelper::AddDropShadowBrushL(
       
    67 		CAlfVisual* aVisual,
       
    68 		const TRgb& aColor,
       
    69 		TInt aDepth
       
    70 		)
       
    71 	{
       
    72 	CAlfDropShadowBrush* brush = CAlfDropShadowBrush::NewLC( aVisual->Env(), aDepth );
       
    73 	aVisual->EnableBrushesL();
       
    74 	brush->SetColor( aColor );
       
    75     aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
       
    76     CleanupStack::Pop(brush);	
       
    77 	}
       
    78 
       
    79 // end of file