idlehomescreen/xmluirendering/uiengine/src/xncontroladapterimpl.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:32:46 +0100
branchRCL_3
changeset 34 5456b4e8b3a8
child 35 3321d3e205b6
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:  Xuikon control adapter source file
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
// System includes
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
#include <utf.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
#include <SVGEngineInterfaceImpl.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include <s32file.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
#include <mifconvdefs.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
//skinning support
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <AknsFrameBackgroundControlContext.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <AknsDrawUtils.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <aknconsts.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <AknUtils.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <AknsListBoxBackgroundControlContext.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <gulicon.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <aknpointereventsuppressor.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#ifdef RD_TACTILE_FEEDBACK
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <touchfeedback.h>
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#endif // RD_TACTILE_FEEDBACK
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
// User includes
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
#include "xnappuiadapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include "xnviewadapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include "xnviewmanager.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include "xncontroladapterimpl.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include "xncontroladapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
#include "xnmenuadapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
#include "xnviewcontroladapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
#include "xncomponentnodeimpl.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
#include "xntype.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
#include "xnnodepluginif.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
#include "xnuiengine.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
#include "xnviewnodeimpl.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
#include "c_xnutils.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
#include "xndomdocument.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
#include "xndomattribute.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
#include "xndomnode.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#include "xnproperty.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
#include "xndomlist.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
#include "xnodt.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
#include "xnresource.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
#include "xnplugindata.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
#include "xnnode.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
#include "xnpanic.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
#include "xnviewdata.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
#include "xnscrollablecontroladapter.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
#include "xnfocuscontrol.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
#include "xneditmode.h"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
_LIT8(KScrollableBoxNodeName, "scrollablebox");
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
_LIT8( KView, "view" );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
// Constants
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
const TInt KSkinGfxInnerRectShrink = 5;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
const TInt KFocusGrowValue = 3;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
const TInt KLongTapStartShortDelay( 150000 ); // 0.15s for Sk
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
const TInt KLongTapStartLongDelay( 500000 ); // 0.5s
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
const TInt KLongTapTimeShortDelay( 600000 ); // 0.6s for SK
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
const TInt KLongTapTimeLongDelay( 1500000 ); // 1.5s
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
const TInt KDragThreshold = 100; // pixels
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
const TInt KMaxTapMove = 100; //100x100 pixels
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
const TReal KEps( 3e-16 ); // proximite EPS value for double FP numbers
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
// LOCAL FUNCTION PROTOTYPES
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
static TRgb ConvertHslToRgb( TInt aHue, TInt aSaturation, TInt aLightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
static void ConvertRgbToHsl( TRgb aRGB, TUint& aHue, TUint& aSaturation,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
    TUint& aLightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
static void LoadFbsBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    CXnResource& aResource, CFbsBitmap*& aTarget, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
static void LoadMbmBitmapL( CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
    TInt aBitmapIndex, CFbsBitmap*& aTarget, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
static void LoadSVGBitmapL( CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
    CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
    TRect aRect, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
static TBool GetBitmapL( CXnUiEngine& aEngine, CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
    const TDesC& aResourceFileName, TInt& aBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
    CFbsBitmap*& aTarget, CFbsBitmap*& aBitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
    CXnControlAdapterImpl::TIconProvider*& aIconProvider,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
    TRect aRect, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
static void LimitRectToPaddingRect( CXnNode& aNode, TRect& aRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
static void DrawSpaceBackgroundY( CWindowGc& aGc, TInt aYRepeatCount,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    CXnNode& aNode, TRect& aRect, CFbsBitmap* aBitmap, TRect aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    TRect aImageRect, TInt& aYOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
static void DrawRepeatBackgroundY( CWindowGc& aGc, TInt aYRepeatCount,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    CXnNode& aNode, TRect& aRect, CFbsBitmap* aBitmap, TRect aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
    TRect aImageRect, TInt& aYOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
static void StripQuotes( HBufC*& aString );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
static void DrawBackgroundColorL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
    const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
static void GetBackroundRepeatValuesL( CXnNode& aNode, TBool& aRepeatX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
    TBool& aRepeatY, TBool& aSpaceX, TBool& aSpaceY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
static void DrawRepeatedBackgroundImage( CWindowGc& aGc, CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
    TRect& aRect, TRect aImageRect, TRect aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
    CFbsBitmap* aBitmap, TBool aRepeatX, TBool aRepeatY, TBool aSpaceX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    TBool aSpaceY, TInt aXRepeatCount, TInt aYRepeatCount );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
static TBool GetBackgroundPositionFromPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
    CXnNode& aNode, TBool aScaleImage, TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
    TRect aImageRect, CFbsBitmap* aBitmap, TBool& aHeightSet );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
static TBool GetBackgroundSizeFromPropertyL( TRect& aRect, CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
    CFbsBitmap* aBitmap, TBool& aScaleImage );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
static TRgb LighterColor( const TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
static TRgb DarkerColor( const TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
static void DrawSolidTopBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
static void SplitTopBorderPolygonL( CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
    CArrayFix< TPoint >*& aUpperPart, CArrayFix< TPoint >*& aLowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
static void DrawRidgeTopBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
static void DrawGrooveTopBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
static void DrawInsetTopBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
static void DrawOutsetTopBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
static TBool GetBorderColorL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
    const TDesC8& aPropertyName, CXnNode& aNode, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
static void DrawTopBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
    const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
static void DrawBottomBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
    const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
static void DrawSolidBottomBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
static void SplitBottomBorderPolygonL( CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
    CArrayFix< TPoint >*& aUpperPart, CArrayFix< TPoint >*& aLowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
static void DrawRidgeBottomBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
static void DrawGrooveBottomBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
static void DrawInsetBottomBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
static void DrawOutsetBottomBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
static void DrawSolidLeftBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
    CArrayFix< TPoint >* aArray, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
static void SplitLeftBorderPolygonL( CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
    CArrayFix< TPoint >*& aLeftPart, CArrayFix< TPoint >*& aRightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
static void DrawRidgeLeftBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
static void DrawGrooveLeftBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
static void DrawInsetLeftBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
static void DrawOutsetLeftBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
static void DrawLeftBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
    const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
static void DrawRightBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
    const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
static void DrawSolidRightBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
    CArrayFix< TPoint >* aArray, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
static void SplitRightBorderPolygonL( CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
    CArrayFix< TPoint >*& aLeftPart, CArrayFix< TPoint >*& aRightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
static void DrawRidgeRightBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
static void DrawGrooveRightBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
static void DrawInsetRightBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
static void DrawOutsetRightBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
    CArrayFix< TPoint >* aArray, CWindowGc& aGc, TRgb& aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
static void DrawBorderImagesL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
    const TRect& /*aRect*/, CXnNode& aNode, CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
    CFbsBitmap* aBitmap, TInt aBorderBitmapDividerTop,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
    TInt aBorderBitmapDividerRight,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
    TInt aBorderBitmapDividerBottom, TInt aBorderBitmapDividerLeft );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
static TBool IsPropertyNone( CXnProperty& aProperty );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
static void DrawBordersL( const TRect& aRect, CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
static void SwapChildArrays( RPointerArray< CXnControlAdapter >& originalArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
    RPointerArray< CXnControlAdapter >& sortedArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
static CXnProperty* GetZIndexL( CXnControlAdapter* aAdapter );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
static void InsertChildToSortedArrayL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
    RPointerArray< CXnControlAdapter >& aTargetArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
    CXnControlAdapter* aChild );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
static void InitializeBackgroundBitmapL( CXnUiEngine& aEngine, CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
    TInt& aBitmapIndex, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
    CXnControlAdapterImpl::TIconProvider*& aIconProvider, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
static HBufC* GetBackgroundImagePathLC( CXnNode& aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
static CFbsBitmap* InitializeBorderBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
    CXnUiEngine& aEngine, CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
    TInt& aBitmapIndex, TInt& aBorderBitmapDividerTop,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
    TInt& aBorderBitmapDividerRight, TInt& aBorderBitmapDividerBottom,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
    TInt& aBorderBitmapDividerLeft,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
    CXnControlAdapterImpl::TIconProvider*& aIconProvider, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
static void DrawDottedBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
    TRect aBorderRect, CWindowGc& aGc, TRgb& aRgb, TBool aHorizontal );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
static HBufC* GetBackgroundImageMaskPathLC( CXnNode& aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
static CFbsBitmap* CreateBitmapFromColorL( TSize aSize, TRgb aColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
static TBool CreateGestureHelperL( CXnNode& aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
static TInt AccessResourceFileL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
    CXnResource& aResource, RFile& aFile, RFs& aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
static void DrawFocusAppearance( CXnNode& aNode, CWindowGc& aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
static CXnDomNode* HasHoldTrigger( CXnDomNode* aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
static void CancelFocusRefusalL( CXnUiEngine& aUiEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
// ============================= LOCAL FUNCTIONS ===============================
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
static CXnScrollableControlAdapter* IsChildOfScrollableControl( CXnNode& aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
    CXnNode* parent = aNode.Parent();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
    while( parent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
        if( parent->Type()->Type() == KScrollableBoxNodeName )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
            CXnScrollableControlAdapter* ret = static_cast<CXnScrollableControlAdapter*>(parent->Control());
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
            return ret;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
        parent = parent->Parent();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    return NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
// SetControlContext
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
static void SetControlContext(CXnControlAdapter& aChild, CXnNode& aNode)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
    CXnScrollableControlAdapter* scrollableControl = IsChildOfScrollableControl( aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
    if(scrollableControl)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
        aNode.SetScrollableControl(scrollableControl);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
        aChild.CopyControlContextFrom(scrollableControl);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
        }        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
// AccessResourceFileL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
// Opens a resource file for accessing. The caller must close the file.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
static TInt AccessResourceFileL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
    CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    RFile& aFile,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
    RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
    TInt err = KErrNone;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
    // parse file name and extension
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
    const TDesC& fileName = aResource.FileName();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
    TParsePtrC fileParser( fileName );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
    TPtrC filepath = fileParser.DriveAndPath();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
    // open resource file
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
    aFsSession.SetSessionPath( filepath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
    aFsSession.ShareProtected();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
    err = aFile.Open( aFsSession, fileName, EFileShareReadersOnly );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
    if ( err != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
        aFile.Close();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
    return err;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
// LoadFbsBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
// Loads a bitmap file from the theme server and creates a CFbsBitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
static void LoadFbsBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
    CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
    CFbsBitmap*& aTarget,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
    RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
     RFile file;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
     TInt ret = AccessResourceFileL( aResource, file, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
     if ( ret == KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
        CleanupClosePushL( file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
        aTarget = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
        if ( !aTarget )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
            CleanupStack::PopAndDestroy();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
            return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
        RFileReadStream readStream( file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
        CleanupClosePushL( readStream );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
        aTarget->InternalizeL( readStream );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
        CleanupStack::PopAndDestroy( &readStream );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
        CleanupStack::PopAndDestroy( &file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
// LoadMifBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
// Loads a bitmap file from the theme server and creates a CFbsBitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
static void LoadMifBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
    CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
    TInt aBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
    CFbsBitmap*& aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
    CFbsBitmap*& aMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
    CXnControlAdapterImpl::TIconProvider*& aIconProvider,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
    RFs& aFsSession,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
    const TRect& aRect )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
    RFile file;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
    TInt ret = AccessResourceFileL( aResource, file, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
    if ( ret == KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
        aIconProvider = new ( ELeave ) CXnControlAdapterImpl::TIconProvider( file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
    if ( ret == KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
        // Mask is next after bitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
        AknIconUtils::CreateIconL( aBitmap, aMask, *aIconProvider,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
            aBitmapIndex + KMifIdFirst, aBitmapIndex + KMifIdFirst + 1 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
        AknIconUtils::SetSize( aBitmap, aRect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
// LoadMbmBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
// Loads a bitmap file from the theme server and creates a CFbsBitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
static void LoadMbmBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
    CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
    TInt aBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
    CFbsBitmap*& aTarget,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
    RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
    RFile file;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
    TInt ret = AccessResourceFileL( aResource, file, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
    if ( ret == KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
        CleanupClosePushL( file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
        aTarget = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
        aTarget->Load( file, aBitmapIndex );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
        CleanupStack::PopAndDestroy();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
// LoadSVGBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
// Loads an SVG file from the theme server and creates a CFbsBitmap.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
static void LoadSVGBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
    CXnResource& aResource,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
    CFbsBitmap*& aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
    CFbsBitmap*& aBitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
    TRect aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
    RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
    RFile file;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
    TInt ret = AccessResourceFileL( aResource, file, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
    if ( ret == KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
        CleanupClosePushL( file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
        CFbsBitmap* frameBuffer = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
        CleanupStack::PushL( frameBuffer );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
        TSize contentSize( aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
        frameBuffer->Create( contentSize, EColor16M );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
        TFontSpec fontSpec;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
        CSvgEngineInterfaceImpl* svgEngine =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
            CSvgEngineInterfaceImpl::NewL( frameBuffer, NULL, fontSpec );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
        CleanupStack::PushL( svgEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
        svgEngine->Load( file );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
        TInt domHandle;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
        svgEngine->PrepareDom( file, domHandle );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
        CFbsBitmap* target = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
        target->Create( contentSize, EColor16M );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
        svgEngine->RenderDom( domHandle, target );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
        aBitmap = target;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
        CFbsBitmap* mask = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
        mask->Create( contentSize, EGray256 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
        svgEngine->GenerateMask( mask );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
        aBitmapMask = mask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
        CleanupStack::PopAndDestroy( 3, &file ); // frameBuffer, svgEngine, file
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
// ResolveMifIDL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
// Resolves a mif id from a given string.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
static TBool ResolveMifIDL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
    const TDesC& aMifId,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
    TInt& aMifID )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
    HBufC* str = aMifId.AllocL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
    TPtr ptrMif = str->Des();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
    ptrMif.TrimAll();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
    TInt pos( ptrMif.FindF( KMif ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
    if ( KErrNotFound != pos )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
        pos += KMif().Length();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
        TPtr ptr = ptrMif.MidTPtr( pos, ( ptrMif.Length() - pos ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
        ptr.TrimAll();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
        TInt offset( ptr.Locate( KRightParenthesis ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
        if ( KErrNotFound != offset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
            TLex lex( ptr.Left( offset ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
            lex.SkipSpace();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
            lex.Val( aMifID );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
            delete str;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
    delete str;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
// LoadSkinBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
// Loads a skin bitmap and creates a CFbsBitmap from it.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
static TBool LoadSkinBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
    const TDesC& aSkinId,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
    CFbsBitmap*& aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
    CFbsBitmap*& aBitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
    TRect aRect )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
    TAknsItemID itemID;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
    MAknsSkinInstance* skin( AknsUtils::SkinInstance() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
    TInt mifId( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
    TInt mifFound( ResolveMifIDL( aSkinId, mifId ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
    TInt colorIndex( KErrNotFound );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
    if ( skin && CXnUtils::ResolveSkinItemIDL( aSkinId, itemID, colorIndex ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
        if ( itemID.iMajor == EAknsMajorAppIcon ) // Check if appl. icon request
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
            TUid applUid;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
            applUid = TUid::Uid( itemID.iMinor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
            AknsUtils::CreateAppIconLC(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
                skin, applUid, EAknsAppIconTypeList, aBitmap, aBitmapMask );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
            AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
                aBitmap, aRect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
            CleanupStack::Pop( 2 ); //aBitmap, aBitmapMask
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
            TInt error( KErrNone );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
            // if we have a color index, then we create a colored icon
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
            if ( colorIndex != KErrNotFound )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
                TRgb defaultColor( 0, 0, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
                TRAP( error, AknsUtils::CreateColorIconL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
                    skin, itemID, KAknsIIDQsnTextColors,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
                    colorIndex, aBitmap, aBitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
                    KNullDesC, mifId, mifId + 1, defaultColor ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
                TRAP( error, AknsUtils::CreateIconL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
                    skin, itemID, aBitmap, aBitmapMask, KNullDesC,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
                    mifId, mifId + 1 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
                error = KErrNone;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
                TRAP( error, AknsUtils::CreateIconL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
                    skin, itemID, aBitmap, KNullDesC, mifId ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
            if ( error == KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   511
                AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   512
                    aBitmap, aRect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   513
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   514
                return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   515
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   516
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   517
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   518
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   519
    if ( mifFound )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   520
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   521
        AknIconUtils::CreateIconL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   522
            aBitmap, aBitmapMask, KAvkonBitmapFile, mifId, mifId + 1 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   523
        AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   524
            aBitmap, aRect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   525
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   526
        return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   527
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   528
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   529
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   530
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   531
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   532
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   533
// GetBitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   534
// Fetches a bitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   535
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   536
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   537
static TBool GetBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   538
    CXnUiEngine& aEngine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   539
    CXnNode& /*aNode*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   540
    const TDesC& aResourceFileName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   541
    TInt& aBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   542
    CFbsBitmap*& aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   543
    CFbsBitmap*& aBitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   544
    CXnControlAdapterImpl::TIconProvider*& aIconProvider,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   545
    TRect aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   546
    RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   547
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   548
    if ( LoadSkinBitmapL( aResourceFileName, aBitmap, aBitmapMask, aRect ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   549
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   550
        return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   551
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   552
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   553
    CXnResource* resource( CXnUtils::FindResource(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   554
        aEngine.Resources(), aResourceFileName, aBitmapIndex ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   555
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   556
    if ( resource )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   557
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   558
        if ( resource->ResourceType() == EResourceSVG )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   559
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   560
            LoadSVGBitmapL( *resource, aBitmap, aBitmapMask, aRect, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   561
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   562
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   563
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   564
        else if ( resource->ResourceType() == EResourceMIF )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   565
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   566
            LoadMifBitmapL( *resource, aBitmapIndex, aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   567
                aBitmapMask, aIconProvider, aFsSession, aRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   568
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   569
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   570
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   571
        else if ( resource->ResourceType() == EResourceMBM )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   572
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   573
            LoadMbmBitmapL( *resource, aBitmapIndex, aBitmap, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   574
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   575
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   576
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   577
        else if ( resource->ResourceType() == EResourceFBS )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   578
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   579
            LoadFbsBitmapL( *resource, aBitmap, aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   580
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   581
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   582
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   583
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   584
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   585
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   586
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   587
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   588
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   589
// DrawBackgroundColorL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   590
// Draws background color to the padding rect
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   591
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   592
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   593
static void DrawBackgroundColorL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   594
    const TRect& /*aRect*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   595
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   596
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   597
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   598
    CXnProperty* colorProperty( aNode.BackgroundColorL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   599
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   600
    if ( colorProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   601
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   602
        TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   603
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   604
        CXnDomPropertyValue* value =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   605
            static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   606
                colorProperty->Property()->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   607
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   608
        if ( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   609
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   610
            TRgb rgb( value->RgbColorValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   611
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   612
            aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   613
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   614
            aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   615
            aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   616
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   617
            aGc.DrawRect( paddingRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   618
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   619
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   620
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   621
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   622
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   623
// StripQuotes
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   624
// Strips enclosing quotes from a string
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   625
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   626
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   627
static void StripQuotes( HBufC*& aString )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   628
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   629
    TInt pos1 = aString->Locate( '\"' );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   630
    TInt pos2 = aString->Locate( '\'' );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   631
    // check, if the first character is " or '
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   632
    if ( pos1 == 0 || pos2 == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   633
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   634
        TInt len = aString->Length() - 2;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   635
        TPtr ptr = aString->Des();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   636
        TPtrC16 newString( aString->Mid( 1, len ).Ptr(), len );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   637
        ptr = newString;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   638
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   639
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   640
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   641
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   642
// DrawRepeatBackgroundY
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   643
// Draws repeated background in the vertical direction
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   644
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   645
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   646
static void DrawRepeatBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   647
    CWindowGc& aGc, TInt aYRepeatCount, CXnNode& aNode, TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   648
    CFbsBitmap* aBitmap, TRect aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   649
    TRect aImageRect, TInt& aYOffset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   650
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   651
    for (TInt i = 0; i <= aYRepeatCount && aRect.iTl.iY < aNode.PaddingRect().iBr.iY;)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   652
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   653
        TRect newRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   654
        newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   655
            aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   656
            TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   657
                aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   658
                aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   659
        aGc.DrawBitmap( newRect, aBitmap, aBitmapRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   660
        aRect.Move( 0, newRect.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   661
        aYOffset += newRect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   662
        if ( ++i == aYRepeatCount || aYRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   663
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   664
            break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   665
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   666
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   667
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   668
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   669
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   670
// DrawSpaceBackgroundY
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   671
// Draws spaced background in the vertical direction
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   672
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   673
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   674
static void DrawSpaceBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   675
    CWindowGc& aGc, TInt aYRepeatCount, CXnNode& aNode, TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   676
    CFbsBitmap* aBitmap, TRect aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   677
    TRect aImageRect, TInt& aYOffset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   678
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   679
    for (TInt j = 0; j <= aYRepeatCount && aRect.iTl.iY < aNode.PaddingRect().iBr.iY;)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   680
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   681
        TRect newRect = aRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   682
        newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   683
            aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   684
            TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   685
                aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   686
                aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   687
        aGc.DrawBitmap( newRect, aBitmap, aBitmapRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   688
        aRect.Move( 0, newRect.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   689
        aYOffset += newRect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   690
        if ( ++j == aYRepeatCount || aYRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   691
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   692
            break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   693
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   694
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   695
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   696
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   697
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   698
// LimitRectToPaddingRect
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   699
// Limits a rect so that it does not exceed padding rect
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   700
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   701
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   702
static void LimitRectToPaddingRect( CXnNode& aNode, TRect& aRect )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   703
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   704
    TRect tmpRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   705
    if ( aRect.iTl.iX < tmpRect.iTl.iX )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   706
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   707
        aRect.SetRect( tmpRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   708
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   709
    if ( aRect.iTl.iY < tmpRect.iTl.iY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   710
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   711
        aRect.SetRect( aRect.iTl.iX, tmpRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   712
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   713
    if ( aRect.iBr.iX > tmpRect.iBr.iX )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   714
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   715
        aRect.SetRect( aRect.iTl.iX, aRect.iTl.iY, tmpRect.iBr.iX, aRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   716
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   717
    if ( aRect.iBr.iY > tmpRect.iBr.iY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   718
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   719
        aRect.SetRect( aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, tmpRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   720
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   721
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   722
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   723
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   724
// GetBackroundRepeatValuesL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   725
// Gets background repeat information from node properties
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   726
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   727
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   728
static void GetBackroundRepeatValuesL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   729
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   730
    TBool& aRepeatX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   731
    TBool& aRepeatY,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   732
    TBool& aSpaceX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   733
    TBool& aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   734
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   735
    CXnProperty* backgroundRepeatProperty = aNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   736
        XnPropertyNames::appearance::common::KBackGroundRepeat );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   737
    if ( backgroundRepeatProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   738
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   739
        CXnDomList& propertyValueList =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   740
            backgroundRepeatProperty->Property()->PropertyValueList();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   741
        TInt valueCount = propertyValueList.Length();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   742
        for ( TInt i = 0; i < valueCount; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   743
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   744
            CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   745
                propertyValueList.Item( i ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   746
            if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   747
                 value->PrimitiveValueType() == CXnDomPropertyValue::EIdent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   748
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   749
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   750
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   751
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   752
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   753
                        if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   754
                             XnPropertyNames::appearance::common::backgroundrepeat::KRepeat )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   755
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   756
                            aRepeatX = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   757
                            aRepeatY = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   758
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   759
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   760
                                  XnPropertyNames::appearance::common::backgroundrepeat::KSpace )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   761
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   762
                            aSpaceX = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   763
                            aSpaceY = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   764
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   765
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   766
                                  XnPropertyNames::appearance::common::backgroundrepeat::KRepeatX )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   767
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   768
                            aRepeatX = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   769
                            aRepeatY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   770
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   771
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   772
                                  XnPropertyNames::appearance::common::backgroundrepeat::KRepeatY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   773
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   774
                            aRepeatX = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   775
                            aRepeatY = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   776
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   777
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   778
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   779
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   780
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   781
                        if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   782
                             XnPropertyNames::appearance::common::backgroundrepeat::KRepeat )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   783
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   784
                            aRepeatY = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   785
                            aSpaceY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   786
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   787
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   788
                                  XnPropertyNames::appearance::common::backgroundrepeat::KSpace )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   789
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   790
                            aRepeatY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   791
                            aSpaceY = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   792
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   793
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   794
                                  XnPropertyNames::appearance::common::backgroundrepeat::KNoRepeat )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   795
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   796
                            aRepeatY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   797
                            aSpaceY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   798
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   799
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   800
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   801
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   802
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   803
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   804
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   805
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   806
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   807
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   808
// DrawRepeatedBackgroundImage
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   809
// Draws a repeated background image
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   810
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   811
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   812
static void DrawRepeatedBackgroundImage(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   813
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   814
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   815
    TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   816
    TRect aImageRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   817
    TRect aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   818
    CFbsBitmap* aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   819
    TBool aRepeatX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   820
    TBool aRepeatY,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   821
    TBool aSpaceX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   822
    TBool aSpaceY,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   823
    TInt aXRepeatCount,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   824
    TInt aYRepeatCount )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   825
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   826
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   827
    if ( aRepeatX && !aRepeatY && !aSpaceX && !aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   828
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   829
        aRect.SetRect( TPoint( paddingRect.iTl.iX, aRect.iTl.iY ), aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   830
        for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   831
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   832
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   833
                aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   834
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   835
                    aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   836
                    aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   837
            aGc.DrawBitmap( newRect, aBitmap, aBitmapRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   838
            aRect.Move( newRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   839
            if ( ++i == aXRepeatCount || aXRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   840
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   841
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   842
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   843
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   844
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   845
    else if ( !aRepeatX && !aRepeatY && aSpaceX && !aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   846
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   847
        aRect.SetRect( TPoint( paddingRect.iTl.iX, aRect.iTl.iY ), aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   848
        if ( aImageRect.Width() < paddingRect.Width() && aXRepeatCount > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   849
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   850
            aRect.Move(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   851
                ( paddingRect.Width() - aImageRect.Width() * aXRepeatCount ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   852
                0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   853
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   854
        for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   855
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   856
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   857
                aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   858
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   859
                    aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   860
                    aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   861
            aGc.DrawBitmap( newRect, aBitmap, aBitmapRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   862
            aRect.Move( newRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   863
            if ( ++i == aXRepeatCount || aXRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   864
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   865
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   866
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   867
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   868
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   869
    else if ( !aRepeatX && aRepeatY && !aSpaceX && !aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   870
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   871
        aRect.SetRect( TPoint( aRect.iTl.iX, paddingRect.iTl.iY ), aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   872
        TInt yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   873
        DrawRepeatBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   874
            aGc, aYRepeatCount, aNode, aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   875
            aBitmap, aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   876
            aImageRect, yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   877
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   878
    else if ( !aRepeatX && !aRepeatY && !aSpaceX && aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   879
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   880
        aRect.SetRect( TPoint( aRect.iTl.iX, paddingRect.iTl.iY ), aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   881
        if ( aImageRect.Height() < paddingRect.Height() && aYRepeatCount > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   882
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   883
            aRect.Move(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   884
                0,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   885
                ( paddingRect.Height() - aImageRect.Height() * aYRepeatCount ) / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   886
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   887
        TInt yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   888
        DrawSpaceBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   889
            aGc, aYRepeatCount, aNode, aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   890
            aBitmap, aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   891
            aImageRect, yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   892
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   893
    else if ( aRepeatX && aRepeatY && !aSpaceX && !aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   894
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   895
        aRect.SetRect( paddingRect.iTl, aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   896
        TInt yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   897
        for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   898
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   899
            aRect.Move( 0, -yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   900
            yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   901
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   902
                aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   903
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   904
                    aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   905
                    aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   906
            aRect = newRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   907
            DrawRepeatBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   908
                aGc, aYRepeatCount, aNode, aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   909
                aBitmap, aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   910
                aImageRect, yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   911
            aRect.Move( newRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   912
            if ( ++i == aXRepeatCount || aXRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   913
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   914
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   915
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   916
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   917
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   918
    else if ( !aRepeatX && !aRepeatY && aSpaceX && aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   919
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   920
        aRect.SetRect( paddingRect.iTl, aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   921
        if ( aImageRect.Width() < paddingRect.Width() && aXRepeatCount > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   922
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   923
            aRect.Move(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   924
                ( paddingRect.Width() - aImageRect.Width() * aXRepeatCount ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   925
                0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   926
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   927
        if ( aImageRect.Height() < paddingRect.Height() && aYRepeatCount > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   928
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   929
            aRect.Move(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   930
                0,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   931
                ( paddingRect.Height() - aImageRect.Height() * aYRepeatCount ) / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   932
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   933
        TInt yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   934
        for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   935
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   936
            aRect.Move( 0, -yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   937
            yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   938
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   939
                aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   940
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   941
                    aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   942
                    aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   943
            aRect = newRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   944
            DrawSpaceBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   945
                aGc, aYRepeatCount, aNode, aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   946
                aBitmap, aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   947
                aImageRect, yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   948
            aRect.Move( newRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   949
            if ( ++i == aXRepeatCount || aXRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   950
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   951
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   952
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   953
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   954
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   955
    else if ( aRepeatX && !aRepeatY && !aSpaceX && aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   956
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   957
        aRect.SetRect( paddingRect.iTl, aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   958
        if ( aImageRect.Height() < paddingRect.Height() && aYRepeatCount > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   959
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   960
            aRect.Move(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   961
                0,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   962
                ( paddingRect.Height() - aImageRect.Height() * aYRepeatCount ) / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   963
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   964
        TInt yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   965
        for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   966
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   967
            aRect.Move( 0, -yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   968
            yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   969
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   970
                aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   971
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   972
                    aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   973
                    aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   974
            aRect = newRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   975
            DrawSpaceBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   976
                aGc, aYRepeatCount, aNode, aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   977
                aBitmap, aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   978
                aImageRect, yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   979
            aRect.Move( newRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   980
            if ( ++i == aXRepeatCount || aXRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   981
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   982
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   983
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   984
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   985
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   986
    else if ( !aRepeatX && aRepeatY && aSpaceX && !aSpaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   987
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   988
        aRect.SetRect( paddingRect.iTl, aRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   989
        TInt yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   990
        if ( aImageRect.Width() < paddingRect.Width() && aXRepeatCount > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   991
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   992
            aRect.Move(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   993
                ( paddingRect.Width() - aImageRect.Width() * aXRepeatCount ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   994
                -yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   995
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   996
        for ( TInt i = 0; i <= aXRepeatCount && aRect.iTl.iX < paddingRect.iBr.iX; )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   997
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   998
            aRect.Move( 0, -yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   999
            yOffset = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1000
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1001
                aRect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1002
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1003
                    aRect.iTl.iX + aImageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1004
                    aRect.iTl.iY + aImageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1005
            aRect = newRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1006
            DrawRepeatBackgroundY(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1007
                aGc, aYRepeatCount, aNode, aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1008
                aBitmap, aBitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1009
                aImageRect, yOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1010
            aRect.Move( newRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1011
            if ( ++i == aXRepeatCount || aXRepeatCount == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1012
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1013
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1014
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1015
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1016
       }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1017
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1018
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1019
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1020
// GetBackgroundPositionFromPropertyL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1021
// Gets background position information from node properties
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1022
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1023
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1024
static TBool GetBackgroundPositionFromPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1025
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1026
    TBool aScaleImage,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1027
    TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1028
    TRect aImageRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1029
    CFbsBitmap* aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1030
    TBool& aHeightSet )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1031
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1032
    CXnProperty* backgroundPositionProperty = aNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1033
        XnPropertyNames::appearance::common::KBackGroundPosition );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1034
    TBool centerHorizontal = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1035
    if ( backgroundPositionProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1036
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1037
        CXnDomList& propertyValueList =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1038
            backgroundPositionProperty->Property()->PropertyValueList();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1039
        TSize size;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1040
        for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1041
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1042
            CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1043
                propertyValueList.Item( i ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1044
            if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1045
                 value->PrimitiveValueType() == CXnDomPropertyValue::EIdent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1046
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1047
                if ( aScaleImage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1048
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1049
                    size = aImageRect.Size();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1050
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1051
                else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1052
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1053
                    size = aBitmap->SizeInPixels();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1054
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1055
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1056
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1057
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1058
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1059
                        // StringValueL will not leave, we check the type first
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1060
                        if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1061
                             XnPropertyNames::appearance::common::backgroundposition::KRight )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1062
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1063
                            centerHorizontal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1064
                            aRect.Move( aRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1065
                            aRect.Move( -size.iWidth, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1066
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1067
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1068
                                  XnPropertyNames::appearance::common::backgroundposition::KLeft )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1069
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1070
                            centerHorizontal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1071
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1072
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1073
                                  XnPropertyNames::appearance::common::backgroundposition::KBottom )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1074
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1075
                            aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1076
                            aRect.Move( 0, aRect.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1077
                            aRect.Move( 0, -size.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1078
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1079
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1080
                                  XnPropertyNames::appearance::common::backgroundposition::KTop )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1081
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1082
                            aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1083
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1084
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1085
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1086
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1087
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1088
                        // StringValueL will not leave, we check the type first
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1089
                        if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1090
                             XnPropertyNames::appearance::common::backgroundposition::KRight )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1091
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1092
                            aRect.Move( aRect.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1093
                            aRect.Move( -size.iWidth, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1094
                            centerHorizontal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1095
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1096
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1097
                                  XnPropertyNames::appearance::common::backgroundposition::KLeft )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1098
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1099
                            centerHorizontal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1100
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1101
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1102
                                  XnPropertyNames::appearance::common::backgroundposition::KBottom )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1103
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1104
                            aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1105
                            aRect.Move( 0, aRect.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1106
                            aRect.Move( 0, -size.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1107
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1108
                        else if ( value->StringValueL() ==
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1109
                                  XnPropertyNames::appearance::common::backgroundposition::KTop )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1110
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1111
                            aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1112
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1113
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1114
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1115
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1116
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1117
           else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EPercentage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1118
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1119
                // FloatValueL will not leave, we check the type first
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1120
                TReal percentage = value->FloatValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1121
                if ( percentage > 100 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1122
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1123
                    percentage = 100;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1124
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1125
                TSize size = aImageRect.Size();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1126
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1127
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1128
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1129
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1130
                        TInt rectOffset = ( percentage / 100.0 ) * aRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1131
                        TInt bitmapOffset = ( percentage / 100.0 ) * size.iWidth;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1132
                        aRect.Move( rectOffset, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1133
                        aRect.Move( -bitmapOffset, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1134
                        centerHorizontal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1135
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1136
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1137
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1138
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1139
                        aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1140
                        TInt rectOffset = ( percentage / 100.0 ) * aRect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1141
                        TInt bitmapOffset = ( percentage / 100.0 ) * size.iHeight;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1142
                        aRect.Move( 0, rectOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1143
                        aRect.Move( 0, -bitmapOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1144
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1145
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1146
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1147
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1148
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1149
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1150
                CXnDomPropertyValue* tmpValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1151
                TRAPD( error, tmpValue = value->CloneL(); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1152
                if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1153
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1154
                    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1155
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1156
                CXnProperty* tmpProperty = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1157
                TRAP( error, tmpProperty = CXnProperty::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1158
                    KNullDesC8,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1159
                    tmpValue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1160
                    *aNode.UiEngine()->ODT()->DomDocument().StringPool() ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1161
                if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1162
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1163
                    delete tmpValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1164
                    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1165
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1166
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1167
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1168
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1169
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1170
                        TInt intValue = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1171
                        TRAP( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1172
                            intValue = aNode.UiEngine()->HorizontalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1173
                                tmpProperty, 0 ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1174
                        if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1175
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1176
                            delete tmpProperty;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1177
                            return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1178
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1179
                        aRect.Move( intValue, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1180
                        centerHorizontal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1181
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1182
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1183
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1184
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1185
                        aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1186
                        TInt intValue = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1187
                        TRAP( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1188
                            intValue = aNode.UiEngine()->VerticalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1189
                                tmpProperty, 0 ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1190
                        if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1191
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1192
                            delete tmpProperty;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1193
                            return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1194
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1195
                        aRect.Move( 0, intValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1196
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1197
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1198
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1199
                delete tmpProperty;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1200
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1201
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1202
        if ( centerHorizontal )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1203
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1204
            aRect.Move( aRect.Width() / 2, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1205
            aRect.Move( -size.iWidth / 2, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1206
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1207
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1208
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1209
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1210
        aHeightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1211
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1212
    return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1213
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1214
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1215
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1216
// GetBackgroundSizeFromPropertyL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1217
// Gets background size information from node properties
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1218
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1219
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1220
static TBool GetBackgroundSizeFromPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1221
    TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1222
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1223
    CFbsBitmap* aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1224
    TBool& aScaleImage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1225
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1226
    CXnProperty* backgroundSizeProperty = aNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1227
        XnPropertyNames::appearance::common::KBackGroundSize );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1228
    TBool widthAuto = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1229
    TBool heightAuto = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1230
    TBool heightSet = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1231
    TSize size = aBitmap->SizeInPixels();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1232
    if ( backgroundSizeProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1233
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1234
        widthAuto = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1235
        heightAuto = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1236
        CXnDomList& propertyValueList =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1237
            backgroundSizeProperty->Property()->PropertyValueList();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1238
        for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1239
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1240
            CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1241
                propertyValueList.Item( i ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1242
            if ( value->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1243
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1244
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1245
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1246
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1247
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1248
                        widthAuto = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1249
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1250
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1251
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1252
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1253
                        heightAuto = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1254
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1255
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1256
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1257
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1258
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1259
        for ( TInt i = propertyValueList.Length() - 1; i >= 0; --i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1260
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1261
            CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1262
                propertyValueList.Item( i ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1263
            if ( value->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1264
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1265
                continue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1266
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1267
            else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EPercentage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1268
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1269
                // FloatValueL will not leave, we check the type first
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1270
                TReal percentage = 100;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1271
                TRAP_IGNORE( percentage = value->FloatValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1272
                if ( percentage > 100 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1273
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1274
                    percentage = 100;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1275
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1276
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1277
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1278
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1279
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1280
                        TInt widthOffset = ( 1 - ( percentage / 100.0 ) ) * aRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1281
                        if ( heightAuto )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1282
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1283
                            TReal aspectRatio =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1284
                                static_cast< TReal >( size.iHeight ) /
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1285
                                static_cast< TReal >( size.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1286
                            aRect.Resize( -widthOffset, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1287
                            aRect.SetHeight(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1288
                                static_cast< TInt >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1289
                                    static_cast< TReal >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1290
                                        aRect.Width() ) * aspectRatio + 0.5 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1291
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1292
                            heightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1293
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1294
                        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1295
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1296
                            aRect.Resize( -widthOffset, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1297
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1298
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1299
                        if ( !heightSet )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1300
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1301
                            TInt heightOffset = ( 1 - ( percentage / 100.0 ) ) * aRect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1302
                            aRect.Resize( 0, -heightOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1303
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1304
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1305
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1306
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1307
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1308
                        TInt heightOffset = ( 1 - ( percentage / 100.0 ) ) * aRect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1309
                        if ( widthAuto )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1310
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1311
                            TReal aspectRatio =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1312
                                static_cast< TReal >( size.iHeight ) /
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1313
                                static_cast< TReal >( size.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1314
                            aRect.Resize( 0, -heightOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1315
                            aRect.SetWidth(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1316
                                static_cast< TInt >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1317
                                    static_cast< TReal >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1318
                                        aRect.Height() ) / aspectRatio + 0.5 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1319
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1320
                            heightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1321
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1322
                        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1323
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1324
                            aRect.Resize( 0, -heightOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1325
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1326
                            heightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1327
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1328
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1329
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1330
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1331
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1332
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1333
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1334
                CXnDomPropertyValue* tmpValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1335
                TRAPD( error, tmpValue = value->CloneL(); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1336
                if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1337
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1338
                    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1339
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1340
                CXnProperty* tmpProperty = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1341
                TRAP( error, tmpProperty = CXnProperty::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1342
                    KNullDesC8, tmpValue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1343
                    *aNode.UiEngine()->ODT()->DomDocument().StringPool() ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1344
                if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1345
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1346
                    delete tmpValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1347
                    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1348
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1349
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1350
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1351
                    case 0:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1352
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1353
                        TInt intValue = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1354
                        TRAP( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1355
                            intValue = aNode.UiEngine()->HorizontalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1356
                                tmpProperty, 0 ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1357
                        TInt widthOffset = aRect.Width() - intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1358
                        if ( heightAuto )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1359
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1360
                            TReal aspectRatio =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1361
                                static_cast< TReal >( size.iHeight ) /
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1362
                                static_cast< TReal >( size.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1363
                            aRect.Resize( -widthOffset, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1364
                            aRect.SetHeight(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1365
                                static_cast< TInt >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1366
                                    static_cast< TReal >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1367
                                        aRect.Width() ) * aspectRatio + 0.5 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1368
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1369
                            heightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1370
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1371
                        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1372
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1373
                            aRect.Resize( -widthOffset, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1374
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1375
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1376
                        if ( !heightSet )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1377
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1378
                            TInt heightOffset = aRect.Height() - intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1379
                            aRect.Resize( 0, -heightOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1380
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1381
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1382
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1383
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1384
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1385
                        TInt intValue = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1386
                        TRAP( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1387
                            intValue = aNode.UiEngine()->VerticalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1388
                                tmpProperty, 0 ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1389
                        TInt heightOffset = aRect.Height() - intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1390
                        if ( widthAuto )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1391
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1392
                            TReal aspectRatio =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1393
                                static_cast< TReal >( size.iHeight ) /
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1394
                                static_cast< TReal >( size.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1395
                            aRect.Resize( 0, -heightOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1396
                            aRect.SetWidth(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1397
                                static_cast< TInt >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1398
                                    static_cast< TReal >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1399
                                        aRect.Height() ) / aspectRatio + 0.5 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1400
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1401
                            heightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1402
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1403
                        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1404
                            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1405
                            aRect.Resize( 0, -heightOffset );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1406
                            aScaleImage = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1407
                            heightSet = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1408
                            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1409
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1410
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1411
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1412
                delete tmpProperty;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1413
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1414
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1415
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1416
    if ( widthAuto && heightAuto )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1417
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1418
        if ( size.iHeight < aRect.Height() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1419
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1420
            aRect.SetHeight( size.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1421
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1422
        if ( size.iWidth < aRect.Width() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1423
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1424
            aRect.SetWidth( size.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1425
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1426
        aScaleImage = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1427
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1428
    return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1429
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1430
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1431
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1432
// LighterColor
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1433
// Gets a color that has more HSL lightness (used for border effects)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1434
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1435
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1436
static TRgb LighterColor( const TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1437
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1438
    TUint hue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1439
    TUint saturation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1440
    TUint lightness;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1441
    ConvertRgbToHsl( aRgb, hue, saturation, lightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1442
    if ( ( static_cast< TInt >( lightness ) + 10 ) <= 100 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1443
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1444
        lightness += 10;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1445
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1446
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1447
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1448
        lightness = 100;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1449
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1450
    return ConvertHslToRgb( hue, saturation, lightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1451
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1452
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1453
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1454
// DarkerColor
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1455
// Gets a color that has less HSL lightness (used for border effects)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1456
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1457
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1458
static TRgb DarkerColor( const TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1459
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1460
    TUint hue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1461
    TUint saturation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1462
    TUint lightness;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1463
    ConvertRgbToHsl( aRgb, hue, saturation, lightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1464
    if ( ( static_cast< TInt >( lightness ) - 10 ) >= 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1465
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1466
        lightness -= 10;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1467
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1468
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1469
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1470
        lightness = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1471
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1472
    return ConvertHslToRgb( hue, saturation, lightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1473
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1474
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1475
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1476
// DrawSolidTopBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1477
// Draw a top border with solid style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1478
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1479
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1480
static void DrawSolidTopBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1481
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1482
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1483
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1484
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1485
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1486
// SplitTopBorderPolygonL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1487
// Split top border to two parts for border effect drawing
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1488
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1489
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1490
static void SplitTopBorderPolygonL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1491
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1492
    CArrayFix< TPoint >*& aUpperPart,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1493
    CArrayFix< TPoint >*& aLowerPart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1494
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1495
    TPoint leftHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1496
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1497
            ( *aArray )[0].iX + ( ( *aArray )[3].iX - ( *aArray )[0].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1498
            ( *aArray )[0].iY + ( ( *aArray )[3].iY - ( *aArray )[0].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1499
    TPoint rightHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1500
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1501
            ( *aArray )[2].iX + ( ( *aArray )[1].iX - ( *aArray )[2].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1502
            ( *aArray )[1].iY + ( ( *aArray )[2].iY - ( *aArray )[1].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1503
    aUpperPart->AppendL( ( *aArray )[0] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1504
    aUpperPart->AppendL( ( *aArray )[1] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1505
    aUpperPart->AppendL( rightHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1506
    aUpperPart->AppendL( leftHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1507
    aLowerPart->AppendL( leftHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1508
    aLowerPart->AppendL( rightHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1509
    aLowerPart->AppendL( ( *aArray )[2] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1510
    aLowerPart->AppendL( ( *aArray )[3] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1511
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1512
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1513
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1514
// DrawRidgeTopBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1515
// Draw top border with ridge style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1516
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1517
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1518
static void DrawRidgeTopBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1519
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1520
    CWindowGc& aGc, TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1521
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1522
    CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1523
    CleanupStack::PushL( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1524
    CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1525
    CleanupStack::PushL( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1526
    SplitTopBorderPolygonL( aArray, upperPart, lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1527
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1528
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1529
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1530
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1531
    aGc.DrawPolygon( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1532
    rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1533
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1534
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1535
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1536
    aGc.DrawPolygon( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1537
    CleanupStack::PopAndDestroy( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1538
    CleanupStack::PopAndDestroy( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1539
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1540
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1541
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1542
// DrawGrooveTopBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1543
// Draw top border with groove style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1544
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1545
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1546
static void DrawGrooveTopBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1547
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1548
    CWindowGc& aGc, TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1549
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1550
    CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1551
    CleanupStack::PushL( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1552
    CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1553
    CleanupStack::PushL( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1554
    SplitTopBorderPolygonL( aArray, upperPart, lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1555
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1556
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1557
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1558
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1559
    aGc.DrawPolygon( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1560
    rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1561
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1562
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1563
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1564
    aGc.DrawPolygon( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1565
    CleanupStack::PopAndDestroy( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1566
    CleanupStack::PopAndDestroy( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1567
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1568
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1569
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1570
// DrawInsetTopBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1571
// Draw top border with inset style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1572
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1573
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1574
static void DrawInsetTopBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1575
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1576
    CWindowGc& aGc, TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1577
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1578
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1579
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1580
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1581
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1582
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1583
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1584
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1585
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1586
// DrawOutsetTopBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1587
// Draw top border with outset style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1588
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1589
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1590
static void DrawOutsetTopBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1591
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1592
    CWindowGc& aGc, TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1593
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1594
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1595
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1596
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1597
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1598
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1599
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1600
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1601
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1602
// GetBorderColorL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1603
// Get border color from properties
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1604
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1605
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1606
static TBool GetBorderColorL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1607
    const TDesC8& aPropertyName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1608
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1609
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1610
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1611
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1612
    CXnProperty* colorProperty = aNode.GetPropertyL( aPropertyName );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1613
    CXnProperty* currentColorProperty = aNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1614
        XnPropertyNames::appearance::common::KColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1615
    CXnProperty* borderColorProperty = aNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1616
        XnPropertyNames::appearance::common::KBorderColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1617
    if ( colorProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1618
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1619
        CXnDomProperty* domProperty = colorProperty->Property();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1620
        CXnDomPropertyValue* propertyValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1621
        propertyValue = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1622
            domProperty->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1623
        if ( propertyValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1624
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1625
            MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1626
            TInt error = AknsUtils::GetCachedColor(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1627
                skinInstance,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1628
                aRgb,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1629
                KAknsIIDQsnLineColors,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1630
                EAknsCIQsnLineColorsCG4 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1631
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1632
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1633
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1634
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1635
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1636
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1637
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1638
            TRAPD( error, aRgb = propertyValue->RgbColorValueL(); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1639
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1640
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1641
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1642
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1643
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1644
        aGc.SetPenColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1645
        aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1646
        aGc.SetBrushColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1647
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1648
    else if ( borderColorProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1649
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1650
        CXnDomProperty* domProperty = borderColorProperty->Property();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1651
        CXnDomPropertyValue* propertyValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1652
        propertyValue = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1653
            domProperty->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1654
        if ( propertyValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1655
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1656
            MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1657
            TInt error = AknsUtils::GetCachedColor(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1658
                skinInstance,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1659
                aRgb,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1660
                KAknsIIDQsnLineColors,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1661
                EAknsCIQsnLineColorsCG4 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1662
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1663
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1664
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1665
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1666
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1667
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1668
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1669
            TRAPD( error, aRgb = propertyValue->RgbColorValueL(); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1670
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1671
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1672
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1673
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1674
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1675
        aGc.SetPenColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1676
        aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1677
        aGc.SetBrushColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1678
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1679
    else if ( currentColorProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1680
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1681
        CXnDomProperty* domProperty = currentColorProperty->Property();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1682
        CXnDomPropertyValue* propertyValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1683
        propertyValue = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1684
            domProperty->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1685
        if ( propertyValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1686
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1687
            MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1688
            TInt error = AknsUtils::GetCachedColor(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1689
                skinInstance,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1690
                aRgb,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1691
                KAknsIIDQsnLineColors,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1692
                EAknsCIQsnLineColorsCG4 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1693
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1694
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1695
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1696
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1697
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1698
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1699
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1700
            TRAPD( error, aRgb = propertyValue->RgbColorValueL(); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1701
            if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1702
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1703
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1704
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1705
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1706
        aGc.SetPenColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1707
        aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1708
        aGc.SetBrushColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1709
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1710
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1711
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1712
        return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1713
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1714
    return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1715
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1716
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1717
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1718
// DrawTopBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1719
// Draw top border
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1720
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1721
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1722
static void DrawTopBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1723
    const TRect& /*aRect*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1724
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1725
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1726
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1727
    TRect borderRect = aNode.BorderRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1728
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1729
    TRgb rgb;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1730
    if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderTopColor, aNode, aGc, rgb ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1731
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1732
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1733
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1734
    TPoint tl = borderRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1735
    TPoint bl = paddingRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1736
    bl.iY -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1737
    bl.iX -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1738
    TPoint tr = borderRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1739
    tr.iX += borderRect.Width()-1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1740
    TPoint br = paddingRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1741
    br.iX += paddingRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1742
    br.iY -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1743
    CArrayFix< TPoint >* array = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1744
    array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1745
    TRAPD( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1746
        array->AppendL( tl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1747
        array->AppendL( tr );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1748
        array->AppendL( br );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1749
        array->AppendL( bl ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1750
    if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1751
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1752
        delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1753
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1754
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1755
    CXnProperty* borderTopStyle = aNode.BorderTopStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1756
    CXnProperty* borderStyle = aNode.BorderStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1757
    const TDesC8& borderStyleString = ( borderTopStyle ) ?
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1758
        borderTopStyle->StringValue() :
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1759
        ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1760
    if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1761
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1762
        DrawSolidTopBorder( array, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1763
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1764
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1765
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1766
        DrawInsetTopBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1767
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1768
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1769
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1770
        DrawOutsetTopBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1771
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1772
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1773
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1774
        TRAP_IGNORE( DrawRidgeTopBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1775
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1776
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1777
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1778
        TRAP_IGNORE( DrawGrooveTopBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1779
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1780
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1781
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1782
        TPoint end( borderRect.iBr.iX, paddingRect.iTl.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1783
        TRect rect( borderRect.iTl, end );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1784
        DrawDottedBorder( rect, aGc, rgb, ETrue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1785
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1786
    delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1787
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1788
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1789
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1790
// DrawSolidBottomBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1791
// Draw bottom border with solid style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1792
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1793
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1794
static void DrawSolidBottomBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1795
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1796
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1797
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1798
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1799
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1800
// SplitBottomBorderPolygonL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1801
// Split bottom border to two parts for border effect drawing
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1802
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1803
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1804
static void SplitBottomBorderPolygonL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1805
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1806
    CArrayFix< TPoint >*& aUpperPart,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1807
    CArrayFix< TPoint >*& aLowerPart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1808
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1809
    TPoint leftHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1810
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1811
            ( *aArray )[3].iX +  ( ( *aArray )[0].iX - ( *aArray )[3].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1812
            ( *aArray )[3].iY + ( ( *aArray )[0].iY - ( *aArray )[3].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1813
    TPoint rightHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1814
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1815
            ( *aArray )[1].iX + ( ( *aArray )[2].iX - ( *aArray )[1].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1816
            ( *aArray )[2].iY + ( ( *aArray )[1].iY - ( *aArray )[2].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1817
    aUpperPart->AppendL( ( *aArray )[0] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1818
    aUpperPart->AppendL( ( *aArray )[1] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1819
    aUpperPart->AppendL( rightHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1820
    aUpperPart->AppendL( leftHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1821
    aLowerPart->AppendL( leftHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1822
    aLowerPart->AppendL( rightHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1823
    aLowerPart->AppendL( ( *aArray )[2] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1824
    aLowerPart->AppendL( ( *aArray )[3] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1825
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1826
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1827
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1828
// DrawRidgeBottomBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1829
// Draw bottom border with ridge style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1830
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1831
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1832
static void DrawRidgeBottomBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1833
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1834
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1835
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1836
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1837
    CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1838
    CleanupStack::PushL( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1839
    CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1840
    CleanupStack::PushL( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1841
    SplitBottomBorderPolygonL( aArray, upperPart, lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1842
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1843
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1844
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1845
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1846
    aGc.DrawPolygon( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1847
    rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1848
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1849
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1850
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1851
    aGc.DrawPolygon( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1852
    CleanupStack::PopAndDestroy( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1853
    CleanupStack::PopAndDestroy( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1854
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1855
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1856
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1857
// DrawGrooveBottomBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1858
// Draw bottom border with groove style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1859
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1860
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1861
static void DrawGrooveBottomBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1862
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1863
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1864
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1865
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1866
    CArrayFix< TPoint >* upperPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1867
    CleanupStack::PushL( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1868
    CArrayFix< TPoint >* lowerPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1869
    CleanupStack::PushL( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1870
    SplitBottomBorderPolygonL( aArray, upperPart, lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1871
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1872
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1873
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1874
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1875
    aGc.DrawPolygon( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1876
    rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1877
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1878
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1879
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1880
    aGc.DrawPolygon( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1881
    CleanupStack::PopAndDestroy( lowerPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1882
    CleanupStack::PopAndDestroy( upperPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1883
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1884
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1885
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1886
// DrawInsetBottomBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1887
// Draw bottom border with inset style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1888
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1889
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1890
static void DrawInsetBottomBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1891
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1892
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1893
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1894
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1895
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1896
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1897
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1898
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1899
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1900
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1901
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1902
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1903
// DrawOutsetBottomBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1904
// Draw bottom border with outset style
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1905
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1906
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1907
static void DrawOutsetBottomBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1908
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1909
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1910
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1911
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1912
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1913
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1914
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1915
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1916
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1917
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1918
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1919
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1920
// DrawDottedBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1921
// Draw dotted border
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1922
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1923
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1924
static void DrawDottedBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1925
    TRect aBorderRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1926
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1927
    TRgb& aRgb,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1928
    TBool aHorizontal )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1929
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1930
    TInt height( aBorderRect.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1931
    TInt width( aBorderRect.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1932
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1933
    TInt squareSide( Min( height, width ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1934
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1935
    if ( !squareSide )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1936
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1937
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1938
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1939
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1940
    // Square size 1, 2 and 3 can be drawn with pen patterns
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1941
    if ( squareSide < 4 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1942
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1943
        aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1944
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1945
        aGc.SetPenColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1946
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1947
        for ( TInt i = 0; i < squareSide; i++ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1948
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1949
            TPoint start;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1950
            TPoint end;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1951
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1952
            if ( aHorizontal )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1953
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1954
                start = TPoint( aBorderRect.iTl.iX, aBorderRect.iTl.iY + i );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1955
                end = TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1956
                    aBorderRect.iTl.iX + aBorderRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1957
                    aBorderRect.iTl.iY + i );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1958
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1959
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1960
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1961
                start = TPoint( aBorderRect.iTl.iX + i, aBorderRect.iTl.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1962
                end = TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1963
                    aBorderRect.iTl.iX + i,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1964
                    aBorderRect.iTl.iY + aBorderRect.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1965
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1966
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1967
            if ( squareSide == 3 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1968
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1969
                // dashed pen pattern 111000...
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1970
                aGc.SetPenStyle( CGraphicsContext::EDashedPen );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1971
                aGc.DrawLine( start, end );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1972
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1973
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1974
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1975
                // dotted pen pattern 1000...
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1976
                aGc.SetPenStyle( CGraphicsContext::EDottedPen );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1977
                aGc.DrawLine( start, end );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1978
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1979
                if ( aHorizontal )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1980
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1981
                    start.iX += ( squareSide == 1 ) ? 2 : 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1982
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1983
                else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1984
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1985
                    start.iY += ( squareSide == 1 ) ? 2 : 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1986
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1987
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1988
                aGc.SetPenStyle( CGraphicsContext::EDottedPen );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1989
                aGc.DrawLine( start, end );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1990
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1991
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1992
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1993
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1994
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1995
        aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1996
        aGc.SetPenStyle( CGraphicsContext::ENullPen );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1997
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1998
        aGc.SetBrushColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  1999
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2000
        TInt divideCount( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2001
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2002
        if ( aHorizontal )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2003
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2004
            divideCount = width / squareSide;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2005
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2006
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2007
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2008
            divideCount = height / squareSide;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2009
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2010
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2011
        TRect drawingRect( aBorderRect.iTl, TSize( squareSide, squareSide ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2012
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2013
        // every other is drawn
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2014
        TInt count( divideCount / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2015
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2016
        for ( TInt i = 0; i <= count; i++ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2017
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2018
            aGc.DrawRect( drawingRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2019
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2020
            if ( aHorizontal )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2021
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2022
                drawingRect.Move( squareSide * 2, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2023
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2024
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2025
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2026
                drawingRect.Move( 0, squareSide * 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2027
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2028
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2029
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2030
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2031
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2032
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2033
// DrawBottomBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2034
// Draw bottom border
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2035
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2036
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2037
static void DrawBottomBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2038
    const TRect& /*aRect*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2039
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2040
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2041
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2042
    TRect borderRect = aNode.BorderRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2043
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2044
    TRgb rgb;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2045
    if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderBottomColor, aNode, aGc, rgb ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2046
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2047
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2048
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2049
    TPoint tl = paddingRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2050
    tl.iX -= paddingRect.Width() + 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2051
    TPoint bl = borderRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2052
    bl.iX -= borderRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2053
    bl.iY-= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2054
    TPoint tr = paddingRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2055
    TPoint br = borderRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2056
    br.iY -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2057
    br.iX -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2058
    CArrayFix< TPoint >* array = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2059
    array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2060
    TRAPD( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2061
        array->AppendL( tl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2062
        array->AppendL( tr );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2063
        array->AppendL( br );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2064
        array->AppendL( bl ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2065
    if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2066
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2067
        delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2068
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2069
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2070
    CXnProperty* borderBottomStyle = aNode.BorderBottomStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2071
    CXnProperty* borderStyle = aNode.BorderStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2072
    const TDesC8& borderStyleString = ( borderBottomStyle ) ?
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2073
        borderBottomStyle->StringValue() :
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2074
        ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2075
    if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2076
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2077
        DrawSolidBottomBorder( array, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2078
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2079
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2080
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2081
        DrawInsetBottomBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2082
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2083
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2084
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2085
        DrawOutsetBottomBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2086
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2087
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2088
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2089
        TRAP_IGNORE( DrawRidgeBottomBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2090
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2091
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2092
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2093
        TRAP_IGNORE( DrawGrooveBottomBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2094
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2095
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2096
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2097
        TPoint origo( borderRect.iTl.iX, paddingRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2098
        TRect rect( origo, borderRect.iBr );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2099
        DrawDottedBorder( rect, aGc, rgb, ETrue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2100
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2101
    delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2102
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2103
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2104
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2105
// DrawSolidLeftBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2106
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2107
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2108
static void DrawSolidLeftBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2109
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2110
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2111
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2112
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2113
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2114
// SplitLeftBorderPolygonL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2115
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2116
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2117
static void SplitLeftBorderPolygonL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2118
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2119
    CArrayFix< TPoint >*& aLeftPart,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2120
    CArrayFix< TPoint >*& aRightPart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2121
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2122
    TPoint upHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2123
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2124
            ( *aArray )[0].iX + ( ( *aArray )[1].iX - ( *aArray )[0].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2125
            ( *aArray )[0].iY + ( ( *aArray )[1].iY - ( *aArray )[0].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2126
    TPoint downHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2127
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2128
            ( *aArray )[3].iX + ( ( *aArray )[2].iX - ( *aArray )[3].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2129
            ( *aArray )[2].iY + ( ( *aArray )[3].iY - ( *aArray )[2].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2130
    aLeftPart->AppendL( ( *aArray )[0] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2131
    aLeftPart->AppendL( upHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2132
    aLeftPart->AppendL( downHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2133
    aLeftPart->AppendL( ( *aArray )[3] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2134
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2135
    aRightPart->AppendL( upHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2136
    aRightPart->AppendL( ( *aArray )[1] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2137
    aRightPart->AppendL( ( *aArray )[2]) ;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2138
    aRightPart->AppendL( downHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2139
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2140
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2141
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2142
// DrawRidgeLeftBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2143
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2144
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2145
static void DrawRidgeLeftBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2146
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2147
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2148
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2149
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2150
    CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2151
    CleanupStack::PushL( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2152
    CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2153
    CleanupStack::PushL( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2154
    SplitLeftBorderPolygonL( aArray, leftPart, rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2155
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2156
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2157
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2158
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2159
    aGc.DrawPolygon( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2160
    rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2161
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2162
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2163
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2164
    aGc.DrawPolygon( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2165
    CleanupStack::PopAndDestroy( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2166
    CleanupStack::PopAndDestroy( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2167
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2168
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2169
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2170
// DrawGrooveLeftBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2171
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2172
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2173
static void DrawGrooveLeftBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2174
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2175
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2176
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2177
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2178
    CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2179
    CleanupStack::PushL( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2180
    CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2181
    CleanupStack::PushL( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2182
    SplitLeftBorderPolygonL( aArray, leftPart, rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2183
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2184
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2185
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2186
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2187
    aGc.DrawPolygon( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2188
    rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2189
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2190
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2191
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2192
    aGc.DrawPolygon( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2193
    CleanupStack::PopAndDestroy( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2194
    CleanupStack::PopAndDestroy( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2195
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2196
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2197
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2198
// DrawInsetLeftBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2199
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2200
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2201
static void DrawInsetLeftBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2202
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2203
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2204
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2205
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2206
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2207
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2208
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2209
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2210
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2211
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2212
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2213
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2214
// DrawOutsetLeftBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2215
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2216
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2217
static void DrawOutsetLeftBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2218
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2219
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2220
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2221
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2222
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2223
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2224
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2225
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2226
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2227
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2228
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2229
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2230
// DrawLeftBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2231
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2232
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2233
static void DrawLeftBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2234
    const TRect& /*aRect*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2235
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2236
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2237
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2238
    TRect borderRect = aNode.BorderRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2239
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2240
    TRgb rgb;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2241
    if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderLeftColor, aNode, aGc, rgb ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2242
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2243
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2244
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2245
    TPoint tl = borderRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2246
    TPoint bl = borderRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2247
    bl.iX -= borderRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2248
    TPoint tr = paddingRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2249
    tr.iX -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2250
    tr.iY -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2251
    TPoint br = paddingRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2252
    br.iX -= paddingRect.Width() + 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2253
    CArrayFix< TPoint >* array = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2254
    array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2255
    TRAPD( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2256
        array->AppendL( tl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2257
        array->AppendL( tr );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2258
        array->AppendL( br );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2259
        array->AppendL( bl ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2260
    if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2261
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2262
        delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2263
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2264
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2265
    CXnProperty* borderLeftStyle = aNode.BorderLeftStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2266
    CXnProperty* borderStyle = aNode.BorderStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2267
    const TDesC8& borderStyleString = ( borderLeftStyle ) ?
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2268
        borderLeftStyle->StringValue() :
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2269
        ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2270
    if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2271
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2272
        DrawSolidLeftBorder( array, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2273
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2274
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2275
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2276
        DrawInsetLeftBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2277
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2278
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2279
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2280
        DrawOutsetLeftBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2281
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2282
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2283
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2284
        TRAP_IGNORE( DrawRidgeLeftBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2285
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2286
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2287
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2288
        TRAP_IGNORE( DrawGrooveLeftBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2289
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2290
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2291
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2292
        TPoint origo( borderRect.iTl.iX, paddingRect.iTl.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2293
        TPoint end( paddingRect.iTl.iX, paddingRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2294
        TRect rect( origo, end );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2295
        DrawDottedBorder( rect, aGc, rgb, EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2296
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2297
    delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2298
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2299
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2300
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2301
// DrawSolidRightBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2302
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2303
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2304
static void DrawSolidRightBorder( CArrayFix< TPoint >* aArray, CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2305
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2306
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2307
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2308
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2309
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2310
// SplitRightBorderPolygonL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2311
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2312
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2313
static void SplitRightBorderPolygonL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2314
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2315
    CArrayFix< TPoint >*& aLeftPart,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2316
    CArrayFix< TPoint >*& aRightPart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2317
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2318
    TPoint upHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2319
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2320
            ( *aArray )[0].iX + ( ( *aArray )[1].iX - ( *aArray )[0].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2321
            ( *aArray )[1].iY + ( ( *aArray )[0].iY - ( *aArray )[1].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2322
    TPoint downHalf =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2323
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2324
            ( *aArray )[3].iX + ( ( *aArray )[2].iX - ( *aArray )[3].iX ) / 2,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2325
            ( *aArray )[3].iY + ( ( *aArray )[2].iY - ( *aArray )[3].iY ) / 2);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2326
    aLeftPart->AppendL( ( *aArray )[0] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2327
    aLeftPart->AppendL( upHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2328
    aLeftPart->AppendL( downHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2329
    aLeftPart->AppendL( ( *aArray )[3] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2330
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2331
    aRightPart->AppendL( upHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2332
    aRightPart->AppendL( ( *aArray )[1] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2333
    aRightPart->AppendL( ( *aArray )[2]) ;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2334
    aRightPart->AppendL( downHalf );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2335
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2336
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2337
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2338
// DrawRidgeRightBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2339
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2340
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2341
static void DrawRidgeRightBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2342
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2343
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2344
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2345
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2346
    CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2347
    CleanupStack::PushL( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2348
    CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2349
    CleanupStack::PushL( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2350
    SplitRightBorderPolygonL( aArray, leftPart, rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2351
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2352
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2353
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2354
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2355
    aGc.DrawPolygon( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2356
    rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2357
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2358
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2359
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2360
    aGc.DrawPolygon( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2361
    CleanupStack::PopAndDestroy( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2362
    CleanupStack::PopAndDestroy( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2363
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2364
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2365
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2366
// DrawGrooveRightBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2367
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2368
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2369
static void DrawGrooveRightBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2370
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2371
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2372
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2373
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2374
    CArrayFix< TPoint >* leftPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2375
    CleanupStack::PushL( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2376
    CArrayFix< TPoint >* rightPart = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2377
    CleanupStack::PushL( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2378
    SplitRightBorderPolygonL( aArray, leftPart, rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2379
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2380
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2381
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2382
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2383
    aGc.DrawPolygon( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2384
    rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2385
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2386
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2387
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2388
    aGc.DrawPolygon( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2389
    CleanupStack::PopAndDestroy( rightPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2390
    CleanupStack::PopAndDestroy( leftPart );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2391
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2392
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2393
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2394
// DrawInsetRightBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2395
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2396
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2397
static void DrawInsetRightBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2398
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2399
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2400
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2401
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2402
    TRgb rgb = LighterColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2403
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2404
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2405
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2406
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2407
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2408
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2409
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2410
// DrawOutsetRightBorder
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2411
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2412
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2413
static void DrawOutsetRightBorder(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2414
    CArrayFix< TPoint >* aArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2415
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2416
    TRgb& aRgb )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2417
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2418
    TRgb rgb = DarkerColor( aRgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2419
    aGc.SetPenColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2420
    aGc.SetBrushStyle( CGraphicsContext::ESolidBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2421
    aGc.SetBrushColor( rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2422
    aGc.DrawPolygon( aArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2423
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2424
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2425
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2426
// DrawRightBorderL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2427
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2428
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2429
static void DrawRightBorderL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2430
    const TRect& /*aRect*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2431
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2432
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2433
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2434
    TRect borderRect = aNode.BorderRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2435
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2436
    TRgb rgb;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2437
    if ( !GetBorderColorL( XnPropertyNames::appearance::common::KBorderRightColor, aNode, aGc, rgb ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2438
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2439
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2440
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2441
    TPoint tl = paddingRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2442
    tl.iX += paddingRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2443
    TPoint bl = paddingRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2444
    TPoint tr = borderRect.iTl;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2445
    tr.iX += borderRect.Width()-1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2446
    TPoint br = borderRect.iBr;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2447
    br.iX -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2448
    br.iY -= 1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2449
    CArrayFix< TPoint >* array = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2450
    array = new ( ELeave ) CArrayFixFlat< TPoint >( 3 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2451
    TRAPD( error,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2452
        array->AppendL( tl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2453
        array->AppendL( tr );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2454
        array->AppendL( br );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2455
        array->AppendL( bl ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2456
    if ( error != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2457
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2458
        delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2459
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2460
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2461
    CXnProperty* borderRightStyle = aNode.BorderRightStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2462
    CXnProperty* borderStyle = aNode.BorderStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2463
    const TDesC8& borderStyleString = ( borderRightStyle ) ?
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2464
        borderRightStyle->StringValue() :
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2465
        ( borderStyle ) ? borderStyle->StringValue() : KNullDesC8;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2466
    if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KSolid )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2467
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2468
        DrawSolidRightBorder( array, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2469
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2470
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KInset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2471
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2472
        DrawInsetRightBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2473
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2474
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KOutset )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2475
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2476
        DrawOutsetRightBorder( array, aGc, rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2477
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2478
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KRidge )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2479
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2480
        TRAP_IGNORE( DrawRidgeRightBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2481
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2482
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KGroove )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2483
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2484
        TRAP_IGNORE( DrawGrooveRightBorderL( array, aGc, rgb ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2485
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2486
    else if ( borderStyleString == XnPropertyNames::appearance::common::borderstyle::KDotted )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2487
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2488
        TPoint origo( paddingRect.iBr.iX, paddingRect.iTl.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2489
        TPoint end( borderRect.iBr.iX, paddingRect.iBr.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2490
        TRect rect( origo, end );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2491
        DrawDottedBorder( rect, aGc, rgb, EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2492
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2493
    delete array;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2494
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2495
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2496
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2497
// DrawBorderImagesL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2498
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2499
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2500
static void DrawBorderImagesL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2501
    const TRect& /*aRect*/,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2502
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2503
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2504
    CFbsBitmap* aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2505
    TInt aBorderBitmapDividerTop,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2506
    TInt aBorderBitmapDividerRight,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2507
    TInt aBorderBitmapDividerBottom,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2508
    TInt aBorderBitmapDividerLeft )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2509
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2510
    CXnProperty* pathProperty = aNode.BorderImageL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2511
    if ( !pathProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2512
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2513
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2514
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2515
    TRect borderRect = aNode.BorderRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2516
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2517
    TRect topLeft = TRect( borderRect.iTl, paddingRect.iTl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2518
    TRect topLeftSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2519
        TPoint( 0, 0 ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2520
        TPoint( aBorderBitmapDividerLeft, aBorderBitmapDividerTop ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2521
    aGc.DrawBitmap( topLeft, aBitmap, topLeftSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2522
    TRect bottomLeft = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2523
        TPoint( borderRect.iTl.iX, paddingRect.iTl.iY + paddingRect.Height() ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2524
        TPoint( paddingRect.iTl.iX, borderRect.iTl.iY + borderRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2525
    TSize imageSize = aBitmap->SizeInPixels();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2526
    TRect bottomLeftSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2527
        TPoint( 0, imageSize.iHeight - aBorderBitmapDividerBottom ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2528
        TPoint( aBorderBitmapDividerLeft, imageSize.iHeight ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2529
    aGc.DrawBitmap( bottomLeft, aBitmap, bottomLeftSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2530
    TRect topRight = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2531
        TPoint( paddingRect.iBr.iX, borderRect.iTl.iY ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2532
        TPoint( borderRect.iBr.iX, paddingRect.iTl.iY ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2533
    TRect topRightSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2534
        TPoint( imageSize.iWidth - aBorderBitmapDividerRight, 0 ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2535
        TPoint( imageSize.iWidth, aBorderBitmapDividerTop ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2536
    aGc.DrawBitmap( topRight, aBitmap, topRightSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2537
    TRect bottomRight = TRect( paddingRect.iBr, borderRect.iBr );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2538
    TRect bottomRightSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2539
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2540
            imageSize.iWidth - aBorderBitmapDividerRight,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2541
            imageSize.iHeight - aBorderBitmapDividerBottom ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2542
        TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2543
            imageSize.iWidth,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2544
            imageSize.iHeight ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2545
    aGc.DrawBitmap( bottomRight, aBitmap, bottomRightSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2546
    TBool xStretch = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2547
    TBool xRepeat = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2548
    TBool xRound = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2549
    TBool yStretch = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2550
    TBool yRepeat = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2551
    TBool yRound = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2552
    if ( pathProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2553
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2554
        CXnDomList& propertyValueList = pathProperty->Property()->PropertyValueList();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2555
        TBool xHandled = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2556
        TInt count = propertyValueList.Length();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2557
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2558
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2559
            CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2560
                propertyValueList.Item( i ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2561
            if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2562
                 value->PrimitiveValueType() == CXnDomPropertyValue::EIdent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2563
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2564
                const TDesC8& stringValue = value->StringValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2565
                if ( !xHandled )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2566
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2567
                    xHandled = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2568
                    if ( stringValue == XnPropertyNames::appearance::common::borderimage::KStretch )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2569
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2570
                        xStretch = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2571
                        yStretch = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2572
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2573
                    else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRepeat )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2574
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2575
                        xStretch = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2576
                        yStretch = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2577
                        xRepeat = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2578
                        yRepeat = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2579
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2580
                    else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRound )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2581
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2582
                        xStretch = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2583
                        yStretch = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2584
                        xRound = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2585
                        yRound = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2586
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2587
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2588
                else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2589
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2590
                    if ( stringValue == XnPropertyNames::appearance::common::borderimage::KStretch )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2591
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2592
                        yStretch = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2593
                        yRepeat = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2594
                        yRound = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2595
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2596
                    else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRepeat )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2597
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2598
                        yStretch = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2599
                        yRepeat = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2600
                        yRound = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2601
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2602
                    else if ( stringValue == XnPropertyNames::appearance::common::borderimage::KRound )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2603
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2604
                        yStretch = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2605
                        yRepeat = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2606
                        yRound = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2607
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2608
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2609
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2610
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2611
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2612
    TRect top = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2613
        TPoint( paddingRect.iTl.iX, borderRect.iTl.iY ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2614
        TPoint( paddingRect.iBr.iX, paddingRect.iTl.iY ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2615
    TRect topSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2616
        TPoint( aBorderBitmapDividerLeft, 0 ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2617
        TPoint( imageSize.iWidth - aBorderBitmapDividerRight, aBorderBitmapDividerTop ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2618
    if ( xStretch )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2619
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2620
        aGc.DrawBitmap( top, aBitmap, topSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2621
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2622
    else if ( xRepeat && topSource.Width() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2623
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2624
        TInt count = top.Width() / topSource.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2625
        TInt topWidth = top.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2626
        top.SetWidth( topSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2627
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2628
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2629
            aGc.DrawBitmap( top, aBitmap, topSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2630
            top.Move( topSource.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2631
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2632
        top.SetWidth( topWidth -  count * topSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2633
        aGc.DrawBitmap( top, aBitmap, topSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2634
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2635
    else if ( xRound && topSource.Width() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2636
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2637
        TInt count = top.Width() / topSource.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2638
        TInt topWidth = top.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2639
        //top.Move((topWidth - count * topSource.Width()) / 2, 0);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2640
        if ( ( count * topSource.Width() ) < topWidth )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2641
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2642
            ++count;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2643
            top.SetWidth( topWidth / count );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2644
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2645
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2646
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2647
            top.SetWidth( topSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2648
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2649
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2650
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2651
            aGc.DrawBitmap( top, aBitmap, topSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2652
            top.Move( top.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2653
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2654
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2655
    TRect right = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2656
        TPoint( paddingRect.iBr.iX, paddingRect.iTl.iY ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2657
        TPoint( borderRect.iBr.iX, paddingRect.iBr.iY ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2658
    TRect rightSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2659
        TPoint( imageSize.iWidth - aBorderBitmapDividerRight, aBorderBitmapDividerTop ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2660
        TPoint( imageSize.iWidth, imageSize.iHeight - aBorderBitmapDividerBottom ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2661
    if ( yStretch )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2662
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2663
        aGc.DrawBitmap( right, aBitmap, rightSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2664
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2665
    else if ( yRepeat && rightSource.Height() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2666
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2667
        TInt count = right.Height() / rightSource.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2668
        TInt rightHeight = right.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2669
        right.SetHeight( rightSource.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2670
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2671
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2672
            aGc.DrawBitmap( right, aBitmap, rightSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2673
            right.Move( 0, rightSource.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2674
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2675
        right.SetHeight( rightHeight - count * rightSource.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2676
        aGc.DrawBitmap( right, aBitmap, rightSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2677
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2678
    else if ( yRound && rightSource.Height() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2679
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2680
        TInt count = right.Height() / rightSource.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2681
        TInt rightHeight = right.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2682
        if ( ( count * rightSource.Height() ) < rightHeight )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2683
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2684
            ++count;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2685
            right.SetHeight( rightHeight / count );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2686
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2687
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2688
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2689
            right.SetHeight( rightSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2690
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2691
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2692
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2693
            aGc.DrawBitmap( right, aBitmap, rightSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2694
            right.Move( 0, right.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2695
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2696
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2697
    TRect bottom = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2698
        TPoint( paddingRect.iTl.iX, paddingRect.iBr.iY ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2699
        TPoint( paddingRect.iBr.iX, borderRect.iBr.iY ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2700
    TRect bottomSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2701
        TPoint( aBorderBitmapDividerLeft, imageSize.iHeight - aBorderBitmapDividerBottom ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2702
        TPoint( imageSize.iWidth - aBorderBitmapDividerRight, imageSize.iHeight ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2703
    if ( xStretch )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2704
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2705
        aGc.DrawBitmap( bottom, aBitmap, bottomSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2706
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2707
    else if ( xRepeat && bottomSource.Width() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2708
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2709
        TInt count = bottom.Width() / bottomSource.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2710
        TInt bottomWidth = bottom.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2711
        bottom.SetWidth( bottomSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2712
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2713
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2714
            aGc.DrawBitmap( bottom, aBitmap, bottomSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2715
            bottom.Move( bottomSource.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2716
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2717
        bottom.SetWidth( bottomWidth - count * bottomSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2718
        aGc.DrawBitmap( bottom, aBitmap, bottomSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2719
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2720
    else if ( xRound && bottomSource.Width() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2721
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2722
        TInt count = bottom.Width() / bottomSource.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2723
        TInt bottomWidth = bottom.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2724
        if ( ( count * bottomSource.Width() ) < bottomWidth )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2725
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2726
            ++count;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2727
            bottom.SetWidth( bottomWidth / count );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2728
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2729
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2730
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2731
            bottom.SetWidth( bottomSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2732
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2733
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2734
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2735
            aGc.DrawBitmap( bottom, aBitmap, bottomSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2736
            bottom.Move( bottom.Width(), 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2737
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2738
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2739
    TRect left = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2740
        TPoint( borderRect.iTl.iX, paddingRect.iTl.iY ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2741
        TPoint( paddingRect.iTl.iX, paddingRect.iBr.iY ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2742
    TRect leftSource = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2743
        TPoint( 0, aBorderBitmapDividerTop ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2744
        TPoint( aBorderBitmapDividerLeft, imageSize.iHeight - aBorderBitmapDividerBottom ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2745
    if ( yStretch )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2746
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2747
        aGc.DrawBitmap( left, aBitmap, leftSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2748
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2749
    else if ( yRepeat && leftSource.Height() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2750
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2751
        TInt count = left.Height() / leftSource.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2752
        TInt leftHeight = left.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2753
        left.SetHeight( leftSource.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2754
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2755
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2756
            aGc.DrawBitmap( left, aBitmap, leftSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2757
            left.Move( 0, leftSource.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2758
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2759
        left.SetHeight( leftHeight - count * leftSource.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2760
        aGc.DrawBitmap( left, aBitmap, leftSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2761
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2762
    else if ( yRound && leftSource.Height() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2763
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2764
        TInt count = left.Height() / leftSource.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2765
        TInt leftHeight = left.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2766
        if ( ( count * leftSource.Height() ) < leftHeight )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2767
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2768
            ++count;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2769
            left.SetHeight( leftHeight / count );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2770
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2771
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2772
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2773
            left.SetHeight( leftSource.Width() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2774
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2775
        for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2776
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2777
            aGc.DrawBitmap( left, aBitmap, leftSource );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2778
            left.Move( 0, left.Height() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2779
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2780
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2781
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2782
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2783
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2784
// IsPropertyNone
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2785
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2786
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2787
static TBool IsPropertyNone( CXnProperty& aProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2788
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2789
    if ( &aProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2790
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2791
        TInt index = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2792
        CXnDomProperty* domProperty = aProperty.Property();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2793
        CXnDomPropertyValue* domPropertyValue =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2794
            static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2795
                domProperty->PropertyValueList().Item( index ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2796
        return domPropertyValue->IsNoneIdent();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2797
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2798
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2799
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2800
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2801
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2802
// DrawBordersL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2803
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2804
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2805
static void DrawBordersL( const TRect& aRect, CXnNode& aNode, CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2806
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2807
    TRect borderRect( aNode.BorderRect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2808
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2809
    if( aNode.PaddingRect() == borderRect )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2810
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2811
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2812
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2813
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2814
    CXnProperty* commonBorderStyle( aNode.BorderStyleL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2815
    CXnProperty* borderStyle( aNode.BorderTopStyleL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2816
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2817
    if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2818
         ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2819
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2820
        DrawTopBorderL( aRect, aNode, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2821
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2822
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2823
    borderStyle = aNode.BorderLeftStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2824
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2825
    if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2826
         ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2827
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2828
        DrawLeftBorderL( aRect, aNode, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2829
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2830
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2831
    borderStyle = aNode.BorderRightStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2832
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2833
    if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2834
         ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2835
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2836
        DrawRightBorderL( aRect, aNode, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2837
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2838
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2839
    borderStyle = aNode.BorderBottomStyleL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2840
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2841
    if ( ( borderStyle && !IsPropertyNone( *borderStyle ) ) ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2842
         ( commonBorderStyle && !IsPropertyNone( *commonBorderStyle ) ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2843
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2844
        DrawBottomBorderL( aRect, aNode, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2845
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2846
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2847
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2848
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2849
// SwapChildArrays
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2850
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2851
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2852
static void SwapChildArrays(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2853
    RPointerArray< CXnControlAdapter >& originalArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2854
    RPointerArray< CXnControlAdapter >& sortedArray )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2855
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2856
    originalArray.Reset();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2857
    TInt count = sortedArray.Count();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2858
    for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2859
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2860
        originalArray.Append( sortedArray[i] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2861
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2862
    sortedArray.Reset();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2863
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2864
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2865
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2866
// IsChildZIndexLowerThanCandidateZIndexL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2867
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2868
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2869
static TBool IsChildZIndexLowerThanCandidateZIndexL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2870
    CXnProperty* aChildZIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2871
    CXnDomPropertyValue* aChildZIndexValue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2872
    CXnProperty* aCandidateZIndex )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2873
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2874
    if ( !aChildZIndex && !aCandidateZIndex )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2875
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2876
        return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2877
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2878
    if ( !aChildZIndex )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2879
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2880
        CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2881
            aCandidateZIndex->Property()->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2882
        if ( value->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2883
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2884
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2885
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2886
        TReal num = value->FloatValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2887
        if ( num > 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2888
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2889
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2890
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2891
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2892
    else if ( !aCandidateZIndex )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2893
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2894
        if ( aChildZIndexValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2895
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2896
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2897
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2898
        TReal num = aChildZIndexValue->FloatValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2899
        if ( num < 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2900
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2901
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2902
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2903
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2904
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2905
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2906
        CXnDomPropertyValue* candidateValue =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2907
            static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2908
                aCandidateZIndex->Property()->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2909
        if ( aChildZIndexValue->IsAutoIdent() && candidateValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2910
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2911
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2912
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2913
        else if ( aChildZIndexValue->IsAutoIdent() && !candidateValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2914
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2915
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2916
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2917
        else if ( !aChildZIndexValue->IsAutoIdent() && candidateValue->IsAutoIdent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2918
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2919
            return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2920
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2921
        TReal childNum = aChildZIndexValue->FloatValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2922
        TReal candidateNum = candidateValue->FloatValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2923
        if ( childNum <= candidateNum )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2924
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2925
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2926
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2927
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2928
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2929
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2930
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2931
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2932
// GetZIndex
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2933
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2934
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2935
static CXnProperty* GetZIndexL( CXnControlAdapter* aAdapter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2936
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2937
    CXnComponent* component = aAdapter->Component();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2938
    if ( !component )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2939
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2940
        return NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2941
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2942
    CXnNode& node = component->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2943
    return node.ZIndexL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2944
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2945
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2946
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2947
// InsertChildToSortedArrayL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2948
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2949
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2950
static void InsertChildToSortedArrayL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2951
    RPointerArray< CXnControlAdapter >& aTargetArray,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2952
    CXnControlAdapter* aChild )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2953
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2954
    CXnProperty* childZIndex = GetZIndexL( aChild );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2955
    CXnDomPropertyValue* childValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2956
    if ( childZIndex )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2957
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2958
        childValue = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2959
            childZIndex->Property()->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2960
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2961
    TInt count = aTargetArray.Count();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2962
    for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2963
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2964
        CXnControlAdapter* candidate = aTargetArray[i];
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2965
        if ( IsChildZIndexLowerThanCandidateZIndexL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2966
                 childZIndex, childValue, GetZIndexL( candidate ) ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2967
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2968
            aTargetArray.Insert( aChild, i );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2969
            return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2970
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2971
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2972
    aTargetArray.Append( aChild );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2973
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2974
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2975
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2976
// InitializeBackgroundBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2977
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2978
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2979
static void InitializeBackgroundBitmapL( CXnUiEngine& aEngine, CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2980
    TInt& aBitmapIndex, CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2981
    CXnControlAdapterImpl::TIconProvider*& aIconProvider, RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2982
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2983
    HBufC* bgPath( GetBackgroundImagePathLC( aNode ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2984
    TPtr ptr( bgPath->Des() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2985
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2986
    GetBitmapL( aEngine, aNode, ptr, aBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2987
                aBitmap, aMask, aIconProvider, aNode.PaddingRect(), aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2988
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2989
    CleanupStack::PopAndDestroy( bgPath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2990
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2991
    if ( !aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2992
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2993
        HBufC* bgMaskPath( GetBackgroundImageMaskPathLC( aNode ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2994
        TPtr ptr( bgMaskPath->Des() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2995
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2996
        if ( ptr != KNullDesC )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2997
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2998
            CFbsBitmap* tmpMask( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  2999
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3000
            TRAP_IGNORE( GetBitmapL( aEngine, aNode, ptr, aBitmapIndex, aMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3001
                tmpMask, aIconProvider, aNode.PaddingRect(), aFsSession ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3002
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3003
            delete tmpMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3004
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3005
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3006
        CleanupStack::PopAndDestroy( bgMaskPath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3007
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3008
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3009
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3010
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3011
// GetBackgroundImagePathLC
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3012
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3013
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3014
static HBufC* GetBackgroundImagePathLC( CXnNode& aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3015
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3016
    CXnProperty* pathProperty( aNode.BackgroundImageL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3017
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3018
    if ( pathProperty && pathProperty->StringValue() != KNullDesC8 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3019
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3020
        HBufC* path( pathProperty->StringValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3021
        CleanupStack::PushL( path );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3022
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3023
        CXnUtils::StripQuotes( path );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3024
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3025
        return path;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3026
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3027
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3028
    return KNullDesC().AllocLC();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3029
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3030
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3031
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3032
// GetBackgroundImageMaskPathLC
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3033
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3034
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3035
static HBufC* GetBackgroundImageMaskPathLC( CXnNode& aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3036
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3037
    CXnProperty* pathProperty( aNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3038
        XnPropertyNames::common::KBackgroundMask ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3039
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3040
    if ( pathProperty && pathProperty->StringValue() != KNullDesC8 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3041
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3042
        HBufC* path( pathProperty->StringValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3043
        CleanupStack::PushL( path );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3044
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3045
        CXnUtils::StripQuotes( path );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3046
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3047
        return path;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3048
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3049
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3050
    return KNullDesC().AllocLC();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3051
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3052
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3053
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3054
// InitializeBorderBitmapL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3055
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3056
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3057
static CFbsBitmap* InitializeBorderBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3058
    CXnUiEngine& aEngine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3059
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3060
    TInt& aBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3061
    TInt& aBorderBitmapDividerTop,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3062
    TInt& aBorderBitmapDividerRight,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3063
    TInt& aBorderBitmapDividerBottom,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3064
    TInt& aBorderBitmapDividerLeft,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3065
    CXnControlAdapterImpl::TIconProvider*& aIconProvider,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3066
    RFs& aFsSession )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3067
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3068
    CXnProperty* pathProperty = aNode.BorderImageL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3069
    CFbsBitmap* returnValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3070
    CFbsBitmap* bitmapMask = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3071
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3072
    if ( !pathProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3073
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3074
        return NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3075
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3076
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3077
    CXnDomList& propertyValueList = pathProperty->Property()->PropertyValueList();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3078
    TInt count = propertyValueList.Length();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3079
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3080
    for ( TInt i = 0; i < count; ++i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3081
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3082
        CXnDomPropertyValue* value = static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3083
            propertyValueList.Item( i ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3084
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3085
        if ( value->PrimitiveValueType() == CXnDomPropertyValue::EUri )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3086
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3087
            const TDesC8& path = value->StringValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3088
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3089
            HBufC* utfPath = HBufC::NewL( path.Length() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3090
            TPtr16 ptr = utfPath->Des();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3091
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3092
            CnvUtfConverter::ConvertToUnicodeFromUtf8( ptr, path );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3093
            CleanupStack::PushL( utfPath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3094
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3095
            StripQuotes( utfPath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3096
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3097
            GetBitmapL( aEngine, aNode, *utfPath, aBitmapIndex, returnValue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3098
                    bitmapMask, aIconProvider, aNode.BorderRect(), aFsSession );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3099
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3100
            delete bitmapMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3101
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3102
            CleanupStack::PopAndDestroy( utfPath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3103
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3104
       else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EPercentage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3105
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3106
            if ( returnValue )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3107
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3108
                CXnDomPropertyValue* tmpValue = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3109
                tmpValue = value->CloneL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3110
                CXnProperty* tmpProperty = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3111
                CleanupStack::PushL( tmpValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3112
                tmpProperty = CXnProperty::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3113
                    KNullDesC8,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3114
                    tmpValue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3115
                *aNode.UiEngine()->ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3116
                CleanupStack::Pop( tmpValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3117
                TSize imageSize = returnValue->SizeInPixels();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3118
                CleanupStack::PushL( tmpProperty );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3119
                TInt intValue = static_cast< TInt >( value->FloatValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3120
                TInt dividerValue = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3121
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3122
                switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3123
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3124
                    case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3125
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3126
                        dividerValue = aNode.UiEngine()->VerticalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3127
                            tmpProperty, imageSize.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3128
                        aBorderBitmapDividerTop = dividerValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3129
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3130
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3131
                    case 2:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3132
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3133
                        dividerValue = aNode.UiEngine()->HorizontalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3134
                            tmpProperty, imageSize.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3135
                        aBorderBitmapDividerRight = dividerValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3136
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3137
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3138
                    case 3:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3139
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3140
                        dividerValue = aNode.UiEngine()->VerticalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3141
                            tmpProperty, imageSize.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3142
                        aBorderBitmapDividerBottom = dividerValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3143
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3144
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3145
                    case 4:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3146
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3147
                        dividerValue = aNode.UiEngine()->HorizontalPixelValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3148
                            tmpProperty, imageSize.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3149
                        aBorderBitmapDividerLeft = dividerValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3150
                        break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3151
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3152
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3153
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3154
                CleanupStack::PopAndDestroy( tmpProperty );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3155
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3156
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3157
       else if ( value->PrimitiveValueType() == CXnDomPropertyValue::EString ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3158
                 value->PrimitiveValueType() == CXnDomPropertyValue::EIdent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3159
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3160
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3161
       else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3162
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3163
            TInt intValue = static_cast< TInt >( value->FloatValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3164
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3165
            switch ( i )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3166
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3167
                case 1:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3168
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3169
                    aBorderBitmapDividerTop = intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3170
                    break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3171
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3172
                case 2:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3173
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3174
                    aBorderBitmapDividerRight = intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3175
                    break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3176
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3177
                case 3:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3178
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3179
                    aBorderBitmapDividerBottom = intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3180
                    break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3181
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3182
                case 4:
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3183
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3184
                    aBorderBitmapDividerLeft = intValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3185
                    break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3186
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3187
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3188
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3189
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3190
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3191
    return returnValue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3192
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3193
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3194
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3195
// BuildTriggerTypeNodeL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3196
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3197
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3198
static CXnNode* BuildTriggerTypeNodeL( const TDesC8& aName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3199
    const TDesC8& aValue, CXnUiEngine& aUiEngine )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3200
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3201
    CXnNode* node = CXnNode::NewL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3202
    CleanupStack::PushL( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3203
    CXnType* type = CXnType::NewL( XnPropertyNames::action::KProperty );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3204
    CleanupStack::PushL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3205
    CXnNodeImpl* impl = CXnNodeImpl::NewL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3206
    CleanupStack::Pop( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3207
    node->SetImpl( impl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3208
    node->SetUiEngine( aUiEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3209
    CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3210
        aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3211
    CleanupStack::PushL( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3212
    nameValue->SetStringValueL( CXnDomPropertyValue::EString, aName );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3213
    CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::KName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3214
        nameValue, *aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3215
    CleanupStack::Pop( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3216
    CleanupStack::PushL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3217
    node->SetPropertyL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3218
    CleanupStack::Pop( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3219
    CXnDomPropertyValue* valueValue = CXnDomPropertyValue::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3220
        aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3221
    CleanupStack::PushL( valueValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3222
    valueValue->SetStringValueL( CXnDomPropertyValue::EString, aValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3223
    CXnProperty* value = CXnProperty::NewL( XnPropertyNames::action::KValue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3224
        valueValue, *aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3225
    CleanupStack::Pop( valueValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3226
    CleanupStack::PushL( value );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3227
    node->SetPropertyL( value );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3228
    CleanupStack::Pop( value );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3229
    CleanupStack::Pop( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3230
    return node;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3231
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3232
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3233
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3234
// BuildTriggerNodeL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3235
// Builds a trigger node
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3236
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3237
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3238
static CXnNode* BuildTriggerNodeL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3239
    CXnUiEngine& aUiEngine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3240
    const TDesC8& aTriggerName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3241
    const TDesC8& aTriggerValueName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3242
    const TDesC8& aTriggerValue )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3243
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3244
    CXnNode* node = CXnNode::NewL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3245
    CleanupStack::PushL( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3246
    CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3247
    CleanupStack::PushL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3248
    CXnNodeImpl* impl = CXnNodeImpl::NewL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3249
    CleanupStack::Pop( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3250
    node->SetImpl( impl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3251
    node->SetUiEngine( aUiEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3252
    CXnDomPropertyValue* nameValue =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3253
        CXnDomPropertyValue::NewL( aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3254
    CleanupStack::PushL( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3255
    nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3256
    CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3257
        nameValue, *aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3258
    CleanupStack::Pop( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3259
    CleanupStack::PushL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3260
    node->SetPropertyL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3261
    CleanupStack::Pop( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3262
    CXnNode* triggerType = BuildTriggerTypeNodeL( aTriggerValueName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3263
        aTriggerValue, aUiEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3264
    CleanupStack::PushL( triggerType );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3265
    node->AddChildL( triggerType );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3266
    CleanupStack::Pop( triggerType );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3267
    CleanupStack::Pop( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3268
    return node;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3269
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3270
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3271
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3272
// BuildTriggerNodeL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3273
// Builds a trigger node
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3274
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3275
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3276
static CXnNode* BuildTriggerNodeL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3277
    CXnUiEngine& aUiEngine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3278
    const TDesC8& aTriggerName )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3279
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3280
    CXnNode* node = CXnNode::NewL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3281
    CleanupStack::PushL( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3282
    CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3283
    CleanupStack::PushL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3284
    CXnNodeImpl* impl = CXnNodeImpl::NewL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3285
    CleanupStack::Pop( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3286
    node->SetImpl( impl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3287
    node->SetUiEngine( aUiEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3288
    CXnDomPropertyValue* nameValue =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3289
        CXnDomPropertyValue::NewL( aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3290
    CleanupStack::PushL( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3291
    nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3292
    CXnProperty* name = CXnProperty::NewL( XnPropertyNames::action::trigger::KName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3293
        nameValue, *aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3294
    CleanupStack::Pop( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3295
    CleanupStack::PushL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3296
    node->SetPropertyL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3297
    CleanupStack::Pop( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3298
    CleanupStack::Pop( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3299
    return node;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3300
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3301
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3302
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3303
// SoftkeyNode
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3304
// Gets the node of softkey according to pointer location
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3305
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3306
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3307
static CXnNode* SoftkeyNode( CXnNode* aMenuBarNode, const TPoint aPosition )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3308
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3309
    if ( aMenuBarNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3310
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3311
        CXnMenuAdapter* adapter = static_cast< CXnMenuAdapter* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3312
            aMenuBarNode->ComponentNodeImpl()->Component()->ControlAdapter() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3313
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3314
        CXnNodePluginIf* node( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3315
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3316
        if ( adapter->FindSoftKeyNodeByPosition( aPosition, node ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3317
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3318
            return &node->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3319
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3320
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3321
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3322
    return NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3323
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3324
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3325
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3326
// DrawFocusAppearance
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3327
// Draws focus appearance
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3328
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3329
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3330
static void DrawFocusAppearance( CXnNode& aNode, CWindowGc& aGc )    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3331
    {    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3332
    TBool grow( EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3333
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3334
    const TDesC8& name( aNode.DomNode()->Name() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3335
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3336
    if( name == XnPropertyNames::KPlugin )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3337
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3338
        grow = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3339
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3340
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3341
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3342
        TRect marginRect( aNode.MarginRect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3343
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3344
        CXnNode* parent( aNode.Parent() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3345
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3346
        for( ; parent; parent = parent->Parent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3347
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3348
            if( parent->DomNode()->Name() == XnPropertyNames::KPlugin )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3349
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3350
                if( parent->Rect() == marginRect )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3351
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3352
                    grow = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3353
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3354
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3355
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3356
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3357
            }                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3358
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3359
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3360
    TRect rect( aNode.PaddingRect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3361
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3362
    if( grow )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3363
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3364
        rect.Grow( KFocusGrowValue, KFocusGrowValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3365
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3366
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3367
    CXnAppUiAdapter* appui( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3368
        static_cast< CXnAppUiAdapter* >( iAvkonAppUi ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3369
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3370
    appui->ViewAdapter().FocusControl().Draw( rect, aGc );    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3371
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3372
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3373
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3374
// HasHoldTrigger
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3375
// Queries whether this node has a hold trigger defined
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3376
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3377
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3378
static CXnDomNode* HasHoldTrigger( CXnDomNode* aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3379
    {    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3380
    if ( !aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3381
        {        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3382
        return NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3383
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3384
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3385
    if ( aNode->Name() == XnPropertyNames::action::KTrigger )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3386
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3387
        CXnDomList& list( aNode->AttributeList() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3388
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3389
        CXnDomAttribute* name( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3390
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3391
        name = static_cast< CXnDomAttribute* >(  
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3392
            list.FindByName( XnPropertyNames::action::KName ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3393
                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3394
        if ( name && name->Value() == XnPropertyNames::action::trigger::name::KHold )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3395
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3396
            return aNode;            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3397
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3398
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3399
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3400
    CXnDomList& list( aNode->ChildNodes() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3401
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3402
    for ( TInt i = 0; i < list.Length(); i++ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3403
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3404
        CXnDomNode* retval( HasHoldTrigger(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3405
            static_cast< CXnDomNode* >( list.Item( i ) ) ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3406
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3407
        if ( retval )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3408
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3409
            return retval;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3410
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3411
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3412
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3413
    return NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3414
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3415
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3416
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3417
// CancelFocusRefusalL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3418
// Cancels focus refusal
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3419
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3420
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3421
static void CancelFocusRefusalL( CXnUiEngine& aUiEngine )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3422
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3423
    CXnNode* focused( aUiEngine.FocusedNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3424
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3425
    if ( focused )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3426
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3427
        CXnControlAdapter* control( focused->Control() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3428
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3429
        if ( control && control->RefusesFocusLoss() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3430
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3431
            focused->HideTooltipsL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3432
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3433
            // It is now time to give up holding focus
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3434
            focused->UnsetStateL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3435
                XnPropertyNames::style::common::KFocus );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3436
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3437
        }    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3438
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3439
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3440
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3441
// Calculates scaled bitmap size (rect)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3442
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3443
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3444
void CalculateScaledBitmapRect( TSize& aScaledSize, const TSize& aDrawSize,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3445
    const TSize& aImageSize )    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3446
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3447
    //no scaling as default
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3448
    TReal scaleRatio( 1.0f ); 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3449
    aScaledSize.SetSize( aDrawSize.iWidth, aDrawSize.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3450
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3451
    //If any dimension is 0, then we do not bother to scale
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3452
    if ( aDrawSize.iWidth == 0 || aDrawSize.iHeight == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3453
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3454
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3455
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3456
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3457
    TReal xRatio = 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3458
        ( ( TReal )aImageSize.iWidth / ( TReal )aDrawSize.iWidth );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3459
    TReal yRatio = 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3460
        ( ( TReal )aImageSize.iHeight / ( TReal )aDrawSize.iHeight );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3461
    //Find out appropriate scaling factor
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3462
    xRatio > yRatio ? ( scaleRatio = xRatio ) : ( scaleRatio = yRatio );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3463
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3464
    // ratio is too small (can be considered as division by zero)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3465
    if ( scaleRatio < KEps && scaleRatio > -KEps )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3466
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3467
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3468
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3469
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3470
    // Otherwise scaling can be done
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3471
    aScaledSize.iWidth = ( TInt )( ( TReal )aImageSize.iWidth / scaleRatio );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3472
    aScaledSize.iHeight = 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3473
        ( TInt )( ( TReal )aImageSize.iHeight / scaleRatio );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3474
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3475
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3476
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3477
// BuildSwipeTriggerNodeLC
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3478
// Build trigger node for swipe event
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3479
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3480
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3481
CXnNode* CXnControlAdapterImpl::BuildSwipeTriggerNodeLC(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3482
    CXnUiEngine& aUiEngine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3483
    const TDesC8& aDirection )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3484
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3485
    CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3486
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3487
    CXnNode* node = CXnNode::NewL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3488
    CleanupStack::PushL( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3489
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3490
    CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3491
    CleanupStack::PushL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3492
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3493
    CXnNodeImpl* impl = CXnNodeImpl::NewL( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3494
    CleanupStack::Pop( type );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3495
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3496
    node->SetImpl( impl );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3497
    node->SetUiEngine( aUiEngine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3498
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3499
    CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( sp );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3500
    CleanupStack::PushL( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3501
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3502
    nameValue->SetStringValueL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3503
        CXnDomPropertyValue::EString,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3504
        XnPropertyNames::action::trigger::name::KSwipe );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3505
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3506
    CXnProperty* name = CXnProperty::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3507
        XnPropertyNames::action::trigger::KName,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3508
        nameValue, *sp );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3509
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3510
    CleanupStack::Pop( nameValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3511
    CleanupStack::PushL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3512
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3513
    node->SetPropertyL( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3514
    CleanupStack::Pop( name );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3515
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3516
    CXnDomPropertyValue* reasonValue = CXnDomPropertyValue::NewL( sp );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3517
    CleanupStack::PushL( reasonValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3518
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3519
    reasonValue->SetStringValueL( CXnDomPropertyValue::EString, aDirection );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3520
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3521
    CXnProperty* reason = CXnProperty::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3522
        XnPropertyNames::action::trigger::name::swipe::KDirection,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3523
        reasonValue, *sp );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3524
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3525
    CleanupStack::Pop( reasonValue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3526
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3527
    CleanupStack::PushL( reason );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3528
    node->SetPropertyL( reason );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3529
    CleanupStack::Pop( reason );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3530
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3531
    return node;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3532
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3533
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3534
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3535
// CreateGestureHelperL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3536
// Checks whether gesture is needed to be detected for this node
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3537
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3538
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3539
static TBool CreateGestureHelperL( CXnNode& aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3540
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3541
    if ( AknLayoutUtils::PenEnabled() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3542
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3543
        CXnProperty* prop( aNode.GetPropertyL( XnPropertyNames::common::KSwipe ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3544
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3545
        if ( prop && prop->StringValue() == XnPropertyNames::KTrue )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3546
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3547
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3548
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3549
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3550
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3551
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3552
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3553
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3554
// ============================ MEMBER FUNCTIONS ===============================
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3555
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3556
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3557
// CXnControlAdapterImpl::NewL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3558
// Two-phased constructor. Can leave.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3559
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3560
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3561
CXnControlAdapterImpl* CXnControlAdapterImpl::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3562
    CXnNodePluginIf& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3563
    CXnControlAdapter& aAdapter,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3564
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3565
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3566
    CXnControlAdapterImpl* self = new ( ELeave ) CXnControlAdapterImpl( aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3567
    CleanupStack::PushL( self );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3568
    self->ConstructL( aNode, aAdapter, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3569
    CleanupStack::Pop();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3570
    return self;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3571
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3572
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3573
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3574
// CXnControlAdapterImpl::~CXnControlAdapterImpl
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3575
// Destructor.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3576
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3577
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3578
CXnControlAdapterImpl::~CXnControlAdapterImpl()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3579
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3580
    delete iBackgroundBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3581
    delete iBackgroundMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3582
    delete iBorderBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3583
    delete iContentBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3584
    delete iContentMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3585
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3586
    iChildren.Reset();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3587
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3588
    if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3589
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3590
        iAnimation->Stop();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3591
        delete iAnimation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3592
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3593
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3594
    delete iGestureFw;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3595
    delete iSuppressor;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3596
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3597
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3598
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3599
// CXnControlAdapterImpl::CXnControlAdapterImpl
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3600
// C++ default constructor. Must not leave.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3601
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3602
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3603
CXnControlAdapterImpl::CXnControlAdapterImpl( CXnNodePluginIf& aNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3604
    : iNode( aNode ), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3605
      iBackgrondInitialized ( EFalse ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3606
      iBorderInitialized ( EFalse )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3607
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3608
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3609
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3610
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3611
// CXnControlAdapterImpl::SetComponent
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3612
// Sets component object to adapter.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3613
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3614
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3615
void CXnControlAdapterImpl::SetComponent( CXnComponent* aComponent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3616
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3617
    iComponent = aComponent;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3618
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3619
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3620
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3621
// CXnControlAdapterImpl::Component
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3622
// Gets component object from adapter.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3623
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3624
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3625
CXnComponent* CXnControlAdapterImpl::Component()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3626
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3627
    return iComponent;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3628
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3629
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3630
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3631
// CXnControlAdapterImpl::Component
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3632
// Gets component object from adapter.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3633
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3634
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3635
CXnComponent* CXnControlAdapterImpl::Component() const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3636
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3637
    return iComponent;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3638
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3639
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3640
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3641
// CXnControlAdapterImpl::OfferKeyEventL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3642
// Handles key events.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3643
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3644
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3645
TKeyResponse CXnControlAdapterImpl::OfferKeyEventL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3646
    const TKeyEvent& aKeyEvent,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3647
    TEventCode aType )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3648
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3649
    CXnNode* node( &iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3650
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3651
    // Need to get softkey nodes
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3652
    CXnUiEngine* engine( node->UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3653
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3654
    CXnNode* menuBar( engine->MenuBarNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3655
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3656
    CXnNode* temp( node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3657
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3658
    for ( ; temp; temp = temp->Parent() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3659
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3660
        if ( temp == menuBar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3661
            {            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3662
            // This is softkey node        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3663
            XnMenuInterface::MXnMenuInterface* menuIf( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3664
            XnComponentInterface::MakeInterfaceL( menuIf, menuBar->AppIfL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3665
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3666
            if ( menuIf )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3667
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3668
                CXnNodePluginIf* eventNode( menuIf->KeyEventNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3669
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3670
                if ( eventNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3671
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3672
                    node = &eventNode->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3673
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3674
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3675
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3676
            break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3677
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3678
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3679
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3680
    if ( !node )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3681
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3682
        return EKeyWasNotConsumed;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3683
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3684
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3685
    if ( aKeyEvent.iScanCode == EStdKeyDevice0 || // RSK
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3686
         aKeyEvent.iScanCode == EStdKeyDevice1 || // LSK
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3687
         aKeyEvent.iScanCode == EStdKeyDevice3 || // MSK
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3688
         aKeyEvent.iCode == EKeyEnter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3689
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3690
        if ( aType == EEventKeyDown )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3691
            {            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3692
            iLongtap = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3693
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3694
            if ( aKeyEvent.iScanCode == EStdKeyDevice3 ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3695
                 aKeyEvent.iCode == EKeyEnter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3696
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3697
                if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3698
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3699
                    // Set "pressed down"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3700
                    node->SetStateL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3701
                        XnPropertyNames::style::common::KPressedDown );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3702
                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3703
                    node->UiEngine()->RenderUIL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3704
                    }                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3705
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3706
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3707
            _LIT8( KDown, "3" ); // EEventKeyDown == 3
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3708
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3709
            CXnNode* keydown( BuildTriggerNodeL( *engine,                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3710
                XnPropertyNames::action::trigger::name::KActivate,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3711
                XnPropertyNames::action::trigger::name::keyevent::KEventType, KDown ) );                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3712
            CleanupStack::PushL( keydown );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3713
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3714
            node->ReportXuikonEventL( *keydown );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3715
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3716
            CleanupStack::PopAndDestroy( keydown );                              
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3717
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3718
        else if( aType == EEventKey )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3719
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3720
            if ( aKeyEvent.iRepeats == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3721
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3722
                if ( !HasHoldTrigger( node->DomNode() ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3723
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3724
                    // If node doesn't define hold trigger, then report activate
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3725
                    // immediately. Otherwise activate is triggered with keyup event
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3726
                    node->SetStateL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3727
                        XnPropertyNames::style::common::KActive );                     
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3728
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3729
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3730
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3731
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3732
                CXnNode* hold( BuildTriggerNodeL( *engine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3733
                    XnPropertyNames::action::trigger::name::KHold ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3734
                CleanupStack::PushL( hold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3735
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3736
                node->ReportXuikonEventL( *hold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3737
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3738
                CleanupStack::PopAndDestroy( hold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3739
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3740
                iLongtap = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3741
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3742
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3743
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3744
        else if ( aType == EEventKeyUp )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3745
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3746
            if ( !iLongtap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3747
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3748
                if ( HasHoldTrigger( node->DomNode() ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3749
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3750
                    // Hold trigger defined, report activate event here                   
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3751
                    node->SetStateL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3752
                        XnPropertyNames::style::common::KActive );                     
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3753
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3754
                else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3755
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3756
                    _LIT8( KUp, "2" ); // EEventKeyUp == 2
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3757
                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3758
                    CXnNode* keyup( BuildTriggerNodeL( *engine,                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3759
                        XnPropertyNames::action::trigger::name::KActivate,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3760
                        XnPropertyNames::action::trigger::name::keyevent::KEventType, KUp ) );                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3761
                    CleanupStack::PushL( keyup );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3762
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3763
                    node->ReportXuikonEventL( *keyup );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3764
                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3765
                    CleanupStack::PopAndDestroy( keyup );                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3766
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3767
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3768
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3769
            if ( aKeyEvent.iScanCode == EStdKeyDevice3 ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3770
                 aKeyEvent.iCode == EKeyEnter )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3771
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3772
                // Reset "pressed down"
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3773
                node->UnsetStateL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3774
                    XnPropertyNames::style::common::KPressedDown );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3775
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3776
                node->UiEngine()->RenderUIL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3777
                }                                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3778
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3779
            iLongtap = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3780
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3781
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3782
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3783
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3784
        // Other than softkey node
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3785
        node->OfferKeyEventL( aKeyEvent, aType );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3786
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3787
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3788
    CXnNode* viewNode( engine->ActiveView() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3789
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3790
    if ( viewNode && node != viewNode )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3791
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3792
        viewNode->OfferKeyEventL( aKeyEvent, aType );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3793
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3794
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3795
    return EKeyWasConsumed;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3796
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3797
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3798
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3799
// CXnControlAdapterImpl::HandleLongTapEventL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3800
// Handles the long tap events.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3801
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3802
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3803
void CXnControlAdapterImpl::HandleLongTapEventL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3804
    const TPoint& /*aPenEventLocation*/, const TPoint& aPenEventScreenLocation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3805
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3806
    CXnNode* node( &iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3807
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3808
    CXnUiEngine* engine( node->UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3809
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3810
    TBool menuBar( node == engine->MenuBarNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3811
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3812
    if ( menuBar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3813
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3814
        // Need to update node to match to the real softkey node
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3815
        node = SoftkeyNode( engine->MenuBarNode(), aPenEventScreenLocation );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3816
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3817
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3818
    if ( node )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3819
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3820
        CXnProperty* prop( node->GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3821
            XnPropertyNames::common::KLongTap ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3822
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3823
        if ( prop && prop->StringValue() == XnPropertyNames::KTrue )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3824
            {                        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3825
            CXnUiEngine* engine( node->UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3826
            CXnAppUiAdapter& appui( engine->AppUiAdapter() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3827
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3828
            CancelFocusRefusalL( *engine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3829
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3830
            appui.HideFocus();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3831
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3832
            if ( !menuBar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3833
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3834
                CXnViewControlAdapter* control = static_cast< CXnViewControlAdapter* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3835
                    appui.ViewManager().ActiveViewData().ViewNode()->Control() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3836
                                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3837
                control->ResetGrabbing();                      
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3838
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3839
#ifdef RD_TACTILE_FEEDBACK            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3840
                MTouchFeedback* feedback( MTouchFeedback::Instance() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3841
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3842
                if ( feedback )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3843
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3844
                    feedback->InstantFeedback( iAdapter, ETouchFeedbackBasic, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3845
                       ETouchFeedbackVibra, TPointerEvent() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3846
                                               
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3847
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3848
#endif                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3849
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3850
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3851
          	// Indicate long tap has taken place
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3852
            iLongtap = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3853
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3854
            CXnNode* hold = BuildTriggerNodeL( *engine,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3855
                XnPropertyNames::action::trigger::name::KHold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3856
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3857
            CleanupStack::PushL( hold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3858
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3859
            node->ReportXuikonEventL( *hold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3860
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3861
            CleanupStack::PopAndDestroy( hold );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3862
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3863
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3864
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3865
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3866
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3867
// CXnControlAdapterImpl::IsDragThresholdExceeded
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3868
// Checks if drag threshold is exceeded
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3869
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3870
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3871
TBool CXnControlAdapterImpl::IsDragThresholdExceeded( const TPoint& aPoint )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3872
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3873
    TBool ret = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3874
    TPoint distance = aPoint - iButtonDownStartPoint;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3875
    if ( Abs( distance.iX ) >= KDragThreshold ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3876
         Abs( distance.iY ) >= KDragThreshold )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3877
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3878
        ret = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3879
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3880
    return ret;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3881
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3882
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3883
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3884
// CXnControlAdapterImpl::HandlePointerEventL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3885
// Handle pointer events
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3886
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3887
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3888
TBool CXnControlAdapterImpl::HandlePointerEventL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3889
    const TPointerEvent& aPointerEvent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3890
    {    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3891
    const TPointerEvent& event( aPointerEvent );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3892
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3893
    CXnNode* node( &iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3894
    CXnUiEngine* engine( node->UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3895
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3896
    if ( !engine->IsPartialInputActive() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3897
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3898
        InitializeGestureL( aPointerEvent );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3899
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3900
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3901
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3902
        // reset destination
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3903
        iGestureDestination = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3904
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3905
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3906
    TBool menuBar( node == engine->MenuBarNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3907
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3908
    if ( menuBar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3909
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3910
        // Need to update node to match to the real softkey node
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3911
        node = SoftkeyNode( engine->MenuBarNode(), event.iParentPosition );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3912
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3913
        if ( !node )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3914
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3915
            // No softkey node found, consume event
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3916
            return ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3917
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3918
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3919
    else if ( iSuppressor &&
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3920
              iSuppressor->SuppressPointerEvent( aPointerEvent ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3921
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3922
        // if view does not handle swipe we have to pass event to children
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3923
        return ( iGestureDestination == node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3924
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3925
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3926
    CAknLongTapDetector* detector( iAdapter->LongTapDetector() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3927
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3928
    if ( ( detector && ( !engine->IsPartialInputActive() || 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3929
        event.iType == TPointerEvent::EButton1Up ) ) ) 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3930
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3931
        if ( menuBar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3932
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3933
            // CXnMenuAdapter owns the longtap detector, but only
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3934
            // softkey nodes can have longtap functionality, so
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3935
            // need to check whether this softkey node has a longtap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3936
            // property defined
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3937
            CXnProperty* prop(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3938
                node->GetPropertyL( XnPropertyNames::common::KLongTap ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3939
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3940
            if ( prop && prop->StringValue() == XnPropertyNames::KTrue )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3941
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3942
                iAdapter->SetLongTapDelays( KLongTapStartShortDelay,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3943
                                            KLongTapTimeShortDelay );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3944
                detector->PointerEventL( event );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3945
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3946
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3947
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3948
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3949
            iAdapter->SetLongTapDelays( KLongTapStartLongDelay,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3950
                                        KLongTapTimeLongDelay );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3951
            detector->PointerEventL( event );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3952
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3953
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3954
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3955
    CXnProperty* focusable( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3956
        node->GetPropertyL( XnPropertyNames::common::KFocusable ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3957
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3958
    if ( !menuBar && ( !focusable ||  
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3959
        focusable->StringValue() == XnPropertyNames::KFalse ) ) 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3960
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3961
        iLongtap = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3962
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3963
        return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3964
        }                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3965
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3966
    if ( event.iType == TPointerEvent::EButton1Down )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3967
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3968
        iLongtap = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3969
        node->HideTooltipsL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3970
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3971
        if ( !menuBar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3972
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3973
            CancelFocusRefusalL( *engine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3974
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3975
                        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3976
        if ( !menuBar && !engine->FocusedNode() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3977
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3978
            // save starting point
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3979
            iButtonDownStartPoint = event.iPosition;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3980
            // Require focus to be shown
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3981
            engine->AppUiAdapter().ShowFocus();                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3982
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3983
#ifdef RD_TACTILE_FEEDBACK            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3984
            MTouchFeedback* feedback( MTouchFeedback::Instance() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3985
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3986
            if ( feedback )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3987
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3988
                feedback->InstantFeedback( ETouchFeedbackBasic );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3989
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3990
#endif                           
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3991
            node->SetStateL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3992
                XnPropertyNames::style::common::KFocus, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3993
                XnEventSource::EStylus );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3994
            }        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3995
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3996
    else if ( event.iType == TPointerEvent::EDrag )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3997
        {        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3998
        if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  3999
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4000
            if ( IsDragThresholdExceeded( event.iPosition ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4001
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4002
                // Remove focus
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4003
                node->UnsetStateL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4004
                    XnPropertyNames::style::common::KFocus );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4005
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4006
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4007
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4008
    else if ( event.iType == TPointerEvent::EButton1Up )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4009
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4010
        if ( !iLongtap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4011
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4012
            if ( menuBar ) 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4013
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4014
                node->SetStateL( XnPropertyNames::style::common::KActive );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4015
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4016
            else if ( node->IsStateSet( XnPropertyNames::style::common::KFocus ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4017
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4018
#ifdef RD_TACTILE_FEEDBACK            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4019
                MTouchFeedback* feedback( MTouchFeedback::Instance() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4020
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4021
                if ( feedback )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4022
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4023
                    feedback->InstantFeedback( iAdapter, ETouchFeedbackBasic, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4024
                		                       ETouchFeedbackVibra,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4025
                		                       aPointerEvent );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4026
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4027
#endif
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4028
                node->SetStateL( XnPropertyNames::style::common::KActive );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4029
                }                      
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4030
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4031
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4032
        // Remove focus
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4033
        engine->AppUiAdapter().HideFocus();                                           
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4034
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4035
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4036
    return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4037
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4038
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4039
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4040
// CXnControlAdapterImpl::DoDrawL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4041
// Leaving draw function.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4042
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4043
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4044
void CXnControlAdapterImpl::DoDrawL( const TRect& aRect, CWindowGc& aGc ) const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4045
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4046
    CXnNode& node = iComponent->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4047
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4048
    DrawBordersL( aRect, node, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4049
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4050
    const_cast< CXnControlAdapterImpl* >( this )->DrawBackgroundDataL( aRect, node, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4051
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4052
    if ( iAdapter->IsFocused() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4053
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4054
        DrawFocusAppearance( node, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4055
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4056
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4057
    // Draw plus sign for empty plugins in edit mode.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4058
    if( node.UiEngine()->EditMode()->EditState() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4059
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4060
        const_cast< CXnControlAdapterImpl* >( this )->DrawPlusSign( node, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4061
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4062
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4063
    if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4064
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4065
        TRect rect = iComponent->Node()->Rect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4066
        iAnimation->Render( aGc, rect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4067
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4068
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4069
    if ( iBorderBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4070
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4071
        DrawBorderImagesL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4072
            aRect, node, aGc, iBorderBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4073
            iBorderBitmapDividerTop, iBorderBitmapDividerRight,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4074
            iBorderBitmapDividerBottom, iBorderBitmapDividerLeft );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4075
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4076
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4077
    DrawContentImageL( aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4078
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4079
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4080
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4081
// CXnControlAdapterImpl::DrawBackgroundDataL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4082
// Draws the background (color and image)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4083
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4084
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4085
void CXnControlAdapterImpl::DrawBackgroundDataL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4086
    const TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4087
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4088
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4089
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4090
    if( aNode.UiEngine()->EditMode()->EditState() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4091
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4092
        DrawEditModeBgData( aNode, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4093
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4094
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4095
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4096
    if ( !iBackgroundBitmap && iBackgroundMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4097
        // mask, but no bitmap: draw masked color (if available)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4098
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4099
        DrawTransparentColorL( aNode, aGc, iBackgroundMask );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4100
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4101
    else if ( !iBackgroundBitmap || !iBackgroundMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4102
        // no mask or no bitmap: draw color (if available)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4103
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4104
        DrawBackgroundColorL( aRect, aNode, aGc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4105
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4106
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4107
    CXnProperty* colorProperty( aNode.BackgroundColorL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4108
    DrawBackgroundSkinL( aNode, iBackgroundMask, aGc, colorProperty );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4109
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4110
    if ( !iBackgroundBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4111
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4112
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4113
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4114
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4115
    CXnProperty* pathProperty( aNode.BackgroundImageL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4116
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4117
    if ( pathProperty && pathProperty->StringValue() != KNullDesC8 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4118
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4119
        if ( iBackgroundMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4120
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4121
            // draw transparent background image
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4122
            DrawBackgroundImageL( aRect, aNode, aGc, iBackgroundBitmap, iBackgroundMask );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4123
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4124
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4125
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4126
            // draw background image without mask
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4127
            DrawBackgroundImageL( aRect, aNode, aGc, iBackgroundBitmap, NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4128
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4129
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4130
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4131
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4132
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4133
// CXnControlAdapterImpl::DrawEditModeBgDataL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4134
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4135
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4136
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4137
void CXnControlAdapterImpl::DrawEditModeBgData(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4138
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4139
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4140
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4141
    // Draw rastered background for plugins    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4142
    const TDesC8& widgetType = aNode.DomNode()->Name();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4143
    if( widgetType == XnPropertyNames::KPlugin )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4144
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4145
        TRect rect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4146
        DrawBackgroundSkin( KAknsIIDQgnHomeEditBgWidget, aGc, rect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4147
        }    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4148
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4149
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4150
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4151
// CXnControlAdapterImpl::DrawPlusSign
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4152
// 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4153
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4154
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4155
void CXnControlAdapterImpl::DrawPlusSign( CXnNode& aNode, CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4156
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4157
    const TDesC8& widgetType = aNode.DomNode()->Name();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4158
    if( widgetType == XnPropertyNames::KPlugin )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4159
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4160
        CXnPluginData* data( aNode.UiEngine()->ViewManager()->ActiveViewData().Plugin( &aNode ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4161
        if( data && !data->Occupied() ) // Empty widget
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4162
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4163
            // Draw + -icon
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4164
            // Make rect as 50% of the widget's height.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4165
            // It needs to be square in order to keep aspect ratio.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4166
            TRect rect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4167
            TInt w = rect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4168
            TInt h = rect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4169
            rect.Shrink( ( w - h * 0.5 ) * 0.5, h * 0.25 );            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4170
            DrawBackgroundSkin( KAknsIIDQgnHomeAdd, aGc, rect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4171
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4172
        }    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4173
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4174
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4175
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4176
// CXnControlAdapterImpl::DrawTransparentColorL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4177
// Draws masked background by RGB color.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4178
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4179
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4180
void CXnControlAdapterImpl::DrawTransparentColorL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4181
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4182
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4183
    CFbsBitmap* aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4184
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4185
    CXnProperty* colorProperty( aNode.BackgroundColorL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4186
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4187
    if ( colorProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4188
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4189
        // check value type
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4190
        CXnDomPropertyValue* value =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4191
            static_cast< CXnDomPropertyValue* >(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4192
                colorProperty->Property()->PropertyValueList().Item( 0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4193
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4194
        if ( value->PrimitiveValueType() == CXnDomPropertyValue::ERgbColor )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4195
            {            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4196
            CFbsBitmap* bitmap( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4197
            TRgb rgb( value->RgbColorValueL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4198
            bitmap = CreateBitmapFromColorL( aMask->SizeInPixels(), rgb );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4199
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4200
            aGc.DrawBitmapMasked( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4201
                aNode.PaddingRect(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4202
                bitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4203
                TRect( TPoint( 0, 0 ), bitmap->SizeInPixels() ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4204
                aMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4205
                EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4206
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4207
            delete bitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4208
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4209
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4210
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4211
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4212
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4213
// CXnControlAdapterImpl::DrawBackgroundSkin
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4214
// Draws a skin item to the given rect
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4215
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4216
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4217
void CXnControlAdapterImpl::DrawBackgroundSkin(const TAknsItemID& aSkinId, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4218
    CWindowGc& aGc, TRect aRect)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4219
    {            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4220
    TRect shrunkRect = aRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4221
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4222
    shrunkRect.Shrink(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4223
        KSkinGfxInnerRectShrink,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4224
        KSkinGfxInnerRectShrink );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4225
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4226
    AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), aGc, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4227
        aRect, shrunkRect, aSkinId, KAknsIIDDefault );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4228
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4229
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4230
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4231
// CXnControlAdapterImpl::DrawBackgroundSkinL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4232
// Draws a skin item to the padding rect
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4233
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4234
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4235
void CXnControlAdapterImpl::DrawBackgroundSkinL(CXnNode& aNode, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4236
    CFbsBitmap* aMask, CWindowGc& aGc, CXnProperty* aBgColor,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4237
    TRect aRect)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4238
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4239
    if( aRect == TRect::EUninitialized )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4240
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4241
        aRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4242
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4243
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4244
    CXnProperty* colorProperty( aBgColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4245
    if ( colorProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4246
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4247
        HBufC* skinID = colorProperty->StringValueL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4248
        CleanupStack::PushL( skinID );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4249
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4250
        if ( skinID->Length() != 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4251
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4252
            TAknsItemID itemID;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4253
            StripQuotes( skinID );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4254
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4255
            if ( CXnUtils::ResolveSkinItemIDL( *skinID, itemID ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4256
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4257
                if ( aMask ) // If there is a mask, draw masked.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4258
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4259
                    TRect paddingRect = aRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4260
                    TRect outerRect = TRect( paddingRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4261
                    TRect innerRect = outerRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4262
                    innerRect.Shrink(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4263
                        KSkinGfxInnerRectShrink,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4264
                        KSkinGfxInnerRectShrink );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4265
                    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4266
                    if ( !iBackgroundBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4267
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4268
                        iBackgroundBitmap = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4269
                        iBackgroundBitmap->Create( aMask->SizeInPixels(), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4270
                                aGc.Device()->DisplayMode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4271
                        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4272
                        CFbsBitmapDevice* device = 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4273
                                CFbsBitmapDevice::NewL( iBackgroundBitmap );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4274
                        CleanupStack::PushL( device );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4275
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4276
                        CBitmapContext* bc( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4277
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4278
                        User::LeaveIfError( device->CreateBitmapContext( bc ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4279
                        CleanupStack::PushL( bc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4280
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4281
                        CAknsFrameBackgroundControlContext* frameContext =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4282
                            CAknsFrameBackgroundControlContext::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4283
                            itemID, outerRect, innerRect, EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4284
                        CleanupStack::PushL( frameContext );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4285
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4286
                        AknsDrawUtils::Background( AknsUtils::SkinInstance(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4287
                            frameContext, NULL,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4288
                            static_cast< CWindowGc& >( *bc ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4289
                            outerRect, KAknsDrawParamNoClearUnderImage );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4290
                        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4291
                        CleanupStack::PopAndDestroy( 3, device );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4292
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4293
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4294
                    aGc.DrawBitmapMasked( paddingRect, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4295
                        iBackgroundBitmap, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4296
                        TRect(TPoint(0, 0), iBackgroundBitmap->SizeInPixels()), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4297
                        aMask, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4298
                        ETrue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4299
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4300
                else // draw background skin graphics without mask
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4301
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4302
	                TRect paddingRect = aRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4303
                    TRect shrunkRect = paddingRect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4304
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4305
                    shrunkRect.Shrink(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4306
                        KSkinGfxInnerRectShrink,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4307
                        KSkinGfxInnerRectShrink );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4308
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4309
                    CAknsFrameBackgroundControlContext* frameContext =
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4310
                        CAknsFrameBackgroundControlContext::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4311
                        itemID, paddingRect, shrunkRect, EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4312
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4313
                    CleanupStack::PushL( frameContext );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4314
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4315
                    AknsDrawUtils::Background( AknsUtils::SkinInstance(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4316
                        frameContext,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4317
                        NULL,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4318
                        aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4319
                        paddingRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4320
                        KAknsDrawParamNoClearUnderImage );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4321
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4322
                    CleanupStack::PopAndDestroy( frameContext );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4323
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4324
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4325
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4326
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4327
        CleanupStack::PopAndDestroy( skinID );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4328
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4329
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4330
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4331
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4332
// DrawBackgroundImageL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4333
// Draws the background image
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4334
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4335
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4336
void CXnControlAdapterImpl::DrawBackgroundImageL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4337
    const TRect& aRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4338
    CXnNode& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4339
    CWindowGc& aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4340
    CFbsBitmap* aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4341
    CFbsBitmap* aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4342
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4343
    if ( !aBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4344
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4345
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4346
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4347
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4348
    TRect rect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4349
    TBool scaleImage = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4350
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4351
    if (!GetBackgroundSizeFromPropertyL( rect, aNode, aBitmap, scaleImage ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4352
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4353
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4354
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4355
    if ( AknIconUtils::IsMifIcon( aBitmap ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4356
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4357
        if ( scaleImage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4358
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4359
            AknIconUtils::SetSize( aBitmap, rect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4360
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4361
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4362
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4363
            AknIconUtils::SetSize( aBitmap, rect.Size(), EAspectRatioPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4364
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4365
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4366
    TRect imageRect = rect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4367
    rect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4368
    TBool heightSet = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4369
    TBool backgroundPosFound = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4370
    TRAP_IGNORE( backgroundPosFound = GetBackgroundPositionFromPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4371
        aNode, scaleImage, rect, imageRect, aBitmap, heightSet ); );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4372
    if ( !backgroundPosFound )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4373
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4374
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4375
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4376
    if ( !heightSet )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4377
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4378
        rect.Move( 0, rect.Height() / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4379
        if ( scaleImage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4380
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4381
            rect.Move( 0, -imageRect.Height() / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4382
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4383
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4384
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4385
            rect.Move( 0, -aBitmap->SizeInPixels().iHeight / 2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4386
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4387
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4388
    TRect tmpRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4389
    LimitRectToPaddingRect( aNode, rect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4390
    TBool repeatX = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4391
    TBool repeatY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4392
    TBool spaceX = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4393
    TBool spaceY = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4394
    TRAP_IGNORE( GetBackroundRepeatValuesL( aNode, repeatX, repeatY, spaceX, spaceY ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4395
    TRect bitmapRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4396
        TPoint( 0, 0 ),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4397
        TPoint( aBitmap->SizeInPixels().iWidth, aBitmap->SizeInPixels().iHeight ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4398
    TInt xRepeatCount = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4399
    TInt yRepeatCount = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4400
    TRect paddingRect = aNode.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4401
    if ( scaleImage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4402
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4403
        if ( imageRect.Width() && imageRect.Height() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4404
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4405
            xRepeatCount = paddingRect.Width() / imageRect.Width();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4406
            yRepeatCount = paddingRect.Height() / imageRect.Height();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4407
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4408
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4409
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4410
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4411
        TSize size = aBitmap->SizeInPixels();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4412
        if ( size.iWidth == 0 || size.iHeight == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4413
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4414
            return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4415
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4416
        xRepeatCount = paddingRect.Width() / size.iWidth;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4417
        yRepeatCount = paddingRect.Height() / size.iHeight;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4418
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4419
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4420
    if ( xRepeatCount == 0 && yRepeatCount == 0 ||
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4421
         !repeatX && !repeatY && !spaceX && !spaceY )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4422
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4423
        TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4424
            rect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4425
            TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4426
                rect.iTl.iX + imageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4427
                rect.iTl.iY + imageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4428
        aGc.SetClippingRect( aRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4429
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4430
        if ( aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4431
            {           
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4432
            aGc.DrawBitmapMasked( newRect, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4433
                aBitmap, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4434
                TRect(TPoint(0, 0), aBitmap->SizeInPixels()), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4435
                aMask, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4436
                EFalse );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4437
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4438
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4439
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4440
            TRect newRect = TRect(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4441
                rect.iTl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4442
                TPoint(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4443
                    rect.iTl.iX + imageRect.Width(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4444
                    rect.iTl.iY + imageRect.Height() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4445
            aGc.SetClippingRect( aRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4446
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4447
            aGc.DrawBitmap( newRect, aBitmap, bitmapRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4448
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4449
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4450
        aGc.CancelClippingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4451
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4452
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4453
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4454
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4455
    DrawRepeatedBackgroundImage(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4456
        aGc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4457
        aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4458
        rect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4459
        imageRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4460
        bitmapRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4461
        aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4462
        repeatX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4463
        repeatY,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4464
        spaceX,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4465
        spaceY,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4466
        xRepeatCount,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4467
        yRepeatCount );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4468
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4469
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4470
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4471
// CXnControlAdapterImpl::Draw
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4472
// Draws the control
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4473
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4474
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4475
void CXnControlAdapterImpl::Draw( const TRect& aRect ) const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4476
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4477
    if ( iBlank )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4478
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4479
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4480
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4481
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4482
    CWindowGc& gc = iAdapter->SystemGc();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4483
    //gc.SetClippingRect(aRect);
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4484
#ifdef _XN_DEBUG_
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4485
    CXnComponent* comp = Component();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4486
    CXnNode& node = comp->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4487
    TRect contentRect = node.Rect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4488
    TRect marginRect = node.MarginRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4489
    TRect paddingRect = node.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4490
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4491
    gc.SetBrushStyle( CGraphicsContext::ENullBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4492
    gc.SetPenColor( KRgbBlue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4493
    gc.DrawRect( marginRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4494
    gc.SetPenColor( KRgbGray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4495
    gc.DrawRect( paddingRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4496
    gc.SetPenColor( KRgbRed );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4497
    gc.DrawRect( contentRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4498
#endif
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4499
    TRAP_IGNORE( DoDrawL( aRect, gc ));
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4500
    //gc.CancelClippingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4501
    RPointerArray< CXnControlAdapter > sortedArray;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4502
    TBool needsSorting = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4503
    for ( TInt count = iChildren.Count() - 1; count >= 0; --count )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4504
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4505
        needsSorting = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4506
        CXnControlAdapter* child = iChildren[count];
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4507
        TRAP_IGNORE( InsertChildToSortedArrayL( sortedArray, child ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4508
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4509
    if ( !needsSorting )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4510
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4511
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4512
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4513
    SwapChildArrays( iChildren, sortedArray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4514
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4515
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4516
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4517
// CXnControlAdapterImpl::Draw
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4518
// Draws the control
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4519
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4520
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4521
void CXnControlAdapterImpl::Draw( const TRect& aRect, CWindowGc& aGc ) const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4522
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4523
    if ( iBlank )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4524
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4525
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4526
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4527
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4528
//    aGc.SetClippingRect( aRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4529
#ifdef _XN_DEBUG_
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4530
    CXnComponent* comp = Component();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4531
    CXnNode& node = comp->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4532
    TRect contentRect = node.Rect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4533
    TRect marginRect = node.MarginRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4534
    TRect paddingRect = node.PaddingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4535
    aGc.SetBrushStyle( CGraphicsContext::ENullBrush );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4536
    aGc.SetPenColor( KRgbBlue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4537
    aGc.DrawRect( marginRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4538
    aGc.SetPenColor( KRgbGray );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4539
    aGc.DrawRect( paddingRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4540
    aGc.SetPenColor( KRgbRed );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4541
    aGc.DrawRect( contentRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4542
#endif
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4543
    TRAP_IGNORE( DoDrawL( aRect, aGc ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4544
//    aGc.CancelClippingRect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4545
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4546
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4547
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4548
// CXnControlAdapterImpl::ComponentControl
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4549
// Return a child control by index
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4550
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4551
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4552
CCoeControl* CXnControlAdapterImpl::ComponentControl( TInt aIndex ) const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4553
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4554
    return iChildren[aIndex];
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4555
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4556
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4557
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4558
// CXnControlAdapterImpl::CountComponentControls
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4559
// Return count of children
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4560
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4561
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4562
TInt CXnControlAdapterImpl::CountComponentControls() const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4563
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4564
    return iChildren.Count();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4565
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4566
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4567
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4568
// CXnControlAdapterImpl::AppendChildL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4569
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4570
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4571
void CXnControlAdapterImpl::AppendChildL(CXnControlAdapter& aChild, CXnNode& aNode)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4572
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4573
    if( !aChild.OwnsWindow() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4574
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4575
        SetControlContext( aChild, aNode );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4576
        if( iChildren.Append( &aChild ) != KErrNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4577
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4578
            User::Leave( KXnErrAppendingChildToControlAdapterFailed );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4579
            }   
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4580
        aChild.SetContainerWindowL( *iAdapter );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4581
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4582
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4583
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4584
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4585
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4586
// ConvertHslToRgb
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4587
// Converts a HSL color to RGB color
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4588
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4589
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4590
static TRgb ConvertHslToRgb(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4591
    TInt aHue, TInt aSaturation, TInt aLightness )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4592
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4593
    TRgb rgb( 0, 0, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4594
    TReal h( aHue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4595
    h /= 360;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4596
    TReal s( aSaturation );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4597
    s /= 100;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4598
    TReal l( aLightness );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4599
    l /= 100;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4600
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4601
    if ( 0 == aSaturation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4602
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4603
        rgb.SetRed( TInt( l * 255 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4604
        rgb.SetGreen( TInt( l * 255 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4605
        rgb.SetBlue( TInt( l * 255 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4606
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4607
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4608
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4609
        TReal m1( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4610
        TReal m2( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4611
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4612
        // l<=0.5: PUT l*(s+1) IN m2
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4613
        if ( aLightness < 0.5 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4614
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4615
            m2 = l * ( s + 1.0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4616
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4617
        // PUT l+s-l*s IN m2
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4618
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4619
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4620
            m2 = l + s - ( l * s );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4621
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4622
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4623
        // PUT l*2-m2 IN m1
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4624
        m1 = l * 2.0 - m2;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4625
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4626
        TReal helperH( h );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4627
        TReal helperM1( m1 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4628
        TReal helperM2( m2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4629
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4630
        // calculate Red
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4631
        helperH = h + ( 1.0 / 3.0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4632
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4633
        // IF h<0: PUT h+1 IN h
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4634
        if ( helperH < 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4635
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4636
            helperH += 1.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4637
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4638
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4639
        // IF h>1: PUT h-1 IN h
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4640
        else if ( helperH > 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4641
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4642
            helperH -= 1.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4643
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4644
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4645
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4646
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4647
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4648
        TReal val( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4649
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4650
        // IF h*6<1: RETURN m1+(m2-m1)*h*6
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4651
        if ( ( helperH * 6 ) < 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4652
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4653
            val = ( 255 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4654
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4655
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4656
        // IF h*2<1: RETURN m2 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4657
        else if ( ( helperH * 2.0 ) < 1.0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4658
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4659
            val = ( 255.0 * helperM2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4660
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4661
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4662
        // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4663
        else if ( ( helperH * 3.0 ) < 2.0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4664
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4665
            val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) *
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4666
                            ( 2.0 / 3.0 - helperH ) * 6.0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4667
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4668
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4669
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4670
            val = 255.0 * helperM1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4671
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4672
        TInt tmpVal = TInt( val + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4673
        rgb.SetRed( ( tmpVal >= 0) ? tmpVal : -tmpVal );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4674
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4675
        // calculate Green
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4676
        // PUT hue.to.rgb(m1, m2, h    ) IN g
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4677
        helperH = h;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4678
        helperM1 = m1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4679
        helperM2 = m2;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4680
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4681
        // IF h<0: PUT h+1 IN h
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4682
        if ( helperH < 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4683
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4684
            helperH += 1.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4685
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4686
        // IF h>1: PUT h-1 IN h
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4687
        else if ( helperH > 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4688
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4689
            helperH -= 1.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4690
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4691
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4692
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4693
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4694
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4695
        // IF h*6<1: RETURN m1+(m2-m1)*h*6
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4696
        if ( ( helperH * 6 ) < 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4697
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4698
            val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4699
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4700
        // IF h*2<1: RETURN m2
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4701
        else if ( ( helperH * 2 ) < 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4702
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4703
            val = ( 255.0 * helperM2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4704
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4705
        // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4706
        else if ( ( helperH * 3 ) < 2 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4707
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4708
            val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) *
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4709
                            ( 2.0 / 3.0 - helperH ) * 6.0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4710
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4711
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4712
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4713
            val = 255.0 * helperM1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4714
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4715
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4716
        tmpVal = TInt( val + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4717
        rgb.SetGreen( ( tmpVal >= 0) ? tmpVal : tmpVal );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4718
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4719
        // calculate Blue
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4720
        // PUT hue.to.rgb(m1, m2, h-1/3) IN b
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4721
        helperH = h - ( 1.0 / 3.0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4722
        helperM1 = m1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4723
        helperM2 = m2;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4724
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4725
        // IF h<0: PUT h+1 IN h
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4726
        if ( helperH < 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4727
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4728
            helperH += 1.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4729
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4730
        // IF h>1: PUT h-1 IN h
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4731
        else if ( helperH > 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4732
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4733
            helperH -= 1.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4734
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4735
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4736
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4737
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4738
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4739
        // IF h*6<1: RETURN m1+(m2-m1)*h*6
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4740
        if ( ( helperH * 6 ) < 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4741
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4742
            val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) * helperH * 6.0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4743
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4744
        // IF h*2<1: RETURN m2
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4745
        else if ( ( helperH * 2 ) < 1 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4746
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4747
            val = ( 255.0 * helperM2 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4748
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4749
        // IF h*3<2: RETURN m1+(m2-m1)*(2/3-h)*6
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4750
        else if ( ( helperH * 3 ) < 2 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4751
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4752
            val = ( 255.0 * ( helperM1 + ( helperM2 - helperM1 ) *
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4753
                            ( 2.0 / 3.0 - helperH ) * 6.0 ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4754
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4755
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4756
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4757
            val = 255.0 * helperM1;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4758
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4759
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4760
        tmpVal = TInt( val + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4761
        rgb.SetBlue( ( tmpVal >= 0) ? tmpVal : -tmpVal );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4762
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4763
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4764
    return rgb;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4765
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4766
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4767
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4768
// ConvertRgbToHsl
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4769
// Converts a RGB color to HSL color
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4770
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4771
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4772
static void ConvertRgbToHsl(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4773
    TRgb aRGB,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4774
    TUint& aHue,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4775
    TUint& aSaturation,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4776
    TUint& aLightness )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4777
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4778
    TReal red = static_cast< TReal >( aRGB.Red() ) / 255.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4779
    TReal green = static_cast< TReal >( aRGB.Green() ) / 255.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4780
    TReal blue = static_cast< TReal >( aRGB.Blue() ) / 255.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4781
    TReal maxColor = ( red > green && red > blue ) ?
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4782
        red : ( green > red && green > blue ) ? green : blue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4783
    TReal minColor = ( red <= green && red <= blue ) ?
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4784
        red : ( green <= red && green <= blue ) ? green : blue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4785
    TReal lightness = ( maxColor + minColor ) / 2.0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4786
    if ( maxColor == minColor )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4787
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4788
        aSaturation = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4789
        aHue = 0;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4790
        aLightness = static_cast< TInt >( 100.0 * lightness + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4791
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4792
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4793
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4794
    if ( lightness < 0.5 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4795
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4796
        TReal saturation = ( maxColor - minColor ) / ( maxColor + minColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4797
        aSaturation = static_cast< TInt >( 100.0 * saturation + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4798
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4799
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4800
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4801
        TReal saturation = ( maxColor - minColor ) / ( 2.0 - maxColor - minColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4802
        aSaturation = static_cast< TInt >( 100.0 * saturation + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4803
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4804
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4805
    if ( red == maxColor )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4806
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4807
        TReal hue = ( green - blue ) / ( maxColor - minColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4808
        TInt tmp = static_cast< TInt >( 60.0 * hue + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4809
        aHue = ( tmp >= 0 ) ? tmp : tmp + 360;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4810
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4811
    else if ( green == maxColor )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4812
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4813
        TReal hue = 2.0 + ( ( blue - red ) / ( maxColor - minColor ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4814
        TInt tmp = static_cast< TInt >( 60.0 * hue + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4815
        aHue = ( tmp >= 0 ) ? tmp : tmp + 360;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4816
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4817
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4818
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4819
        TReal hue = 4.0 + ( ( red - green ) / ( maxColor - minColor ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4820
        TInt tmp = static_cast< TInt >( 60.0 * hue + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4821
        aHue = ( tmp >= 0 ) ? tmp : tmp + 360;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4822
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4823
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4824
    aLightness = static_cast< TInt >( 100.0 * lightness + 0.5 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4825
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4826
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4827
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4828
// CXnControlAdapterImpl::IsDrawingAllowed
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4829
// Checks whether drawing is allowed
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4830
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4831
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4832
TBool CXnControlAdapterImpl::IsDrawingAllowed() const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4833
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4834
    TBool retVal = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4835
    CXnNode& node = Component()->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4836
    CXnProperty* propVisibility = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4837
    TRAP_IGNORE( propVisibility = node.VisibilityL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4838
    if ( propVisibility )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4839
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4840
        const TDesC8& visibility = propVisibility->StringValue();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4841
        if ( visibility != KNullDesC8 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4842
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4843
            if ( visibility == XnPropertyNames::style::common::visibility::KHidden )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4844
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4845
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4846
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4847
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4848
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4849
                retVal = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4850
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4851
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4852
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4853
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4854
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4855
        // default value for visibility
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4856
        retVal = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4857
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4858
    CXnProperty* propDisplay = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4859
    TRAP_IGNORE( propDisplay = node.DisplayL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4860
    if ( propDisplay )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4861
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4862
        const TDesC8& display = propDisplay->StringValue();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4863
        if ( display != KNullDesC8 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4864
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4865
            if ( display == XnPropertyNames::style::common::display::KNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4866
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4867
                return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4868
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4869
            else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4870
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4871
                retVal = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4872
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4873
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4874
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4875
    if ( node.IsDropped() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4876
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4877
        return EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4878
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4879
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4880
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4881
        retVal = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4882
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4883
    return retVal;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4884
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4885
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4886
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4887
// CXnControlAdapterImpl::ContentBitmaps
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4888
// Gets content bitmaps
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4889
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4890
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4891
void CXnControlAdapterImpl::ContentBitmaps(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4892
    CFbsBitmap*& aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4893
    CFbsBitmap*& aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4894
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4895
    aBitmap = iContentBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4896
    aMask = iContentMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4897
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4898
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4899
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4900
// CXnControlAdapterImpl::SetContentBitmaps
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4901
// Sets content bitmaps
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4902
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4903
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4904
void CXnControlAdapterImpl::SetContentBitmaps(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4905
    CFbsBitmap* aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4906
    CFbsBitmap* aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4907
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4908
    delete iContentBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4909
    iContentBitmap = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4910
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4911
    delete iContentMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4912
    iContentMask = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4913
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4914
    iContentBitmap = aBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4915
    iContentMask = aMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4916
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4917
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4918
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4919
// CXnControlAdapterImpl::SetContentBitmapsL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4920
// Sets content bitmaps
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4921
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4922
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4923
void CXnControlAdapterImpl::SetContentBitmapsL( const TDesC& aBitmapUrl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4924
    const TDesC& aMaskUrl )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4925
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4926
    delete iContentBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4927
    iContentBitmap = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4928
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4929
    delete iContentMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4930
    iContentMask = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4931
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4932
    CXnNode& node( iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4933
    CXnUiEngine* engine( node.UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4934
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4935
    TRect rect( node.Rect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4936
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4937
    GetBitmapL( *engine, node, aBitmapUrl, iContentBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4938
        iContentBitmap, iContentMask, iIconProvider, rect, FsSession() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4939
    if ( !iContentBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4940
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4941
        CXnProperty* prop( node.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4942
            XnPropertyNames::appearance::common::KFallBackImage ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4943
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4944
        if ( prop )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4945
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4946
            HBufC* fallBackImage( prop->StringValueL( ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4947
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4948
            CleanupStack::PushL( fallBackImage );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4949
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4950
            if ( *fallBackImage != KNullDesC )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4951
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4952
                StripQuotes( fallBackImage );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4953
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4954
                GetBitmapL( *engine, node, *fallBackImage, iContentBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4955
                    iContentBitmap, iContentMask, iIconProvider, rect, FsSession() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4956
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4957
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4958
            CleanupStack::PopAndDestroy( fallBackImage );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4959
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4960
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4961
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4962
    if ( !iContentMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4963
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4964
        if ( aMaskUrl != KNullDesC )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4965
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4966
            CFbsBitmap* bitmapMask( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4967
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4968
            GetBitmapL( *engine, node, aMaskUrl, iContentMaskIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4969
                iContentMask, bitmapMask, iIconProvider, rect, FsSession() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4970
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4971
            delete bitmapMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4972
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4973
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4974
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4975
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4976
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4977
// CXnControlAdapterImpl::DrawContentImage
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4978
// Draws content image
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4979
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4980
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4981
void CXnControlAdapterImpl::DrawContentImage() const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4982
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4983
    TRAP_IGNORE( DrawContentImageL( *iGc ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4984
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4985
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4986
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4987
// CXnControlAdapterImpl::DrawContentImage
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4988
// Draws content image
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4989
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4990
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4991
void CXnControlAdapterImpl::DrawContentImageL( CWindowGc& aGc ) const
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4992
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4993
    if ( !iContentBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4994
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4995
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4996
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4997
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4998
    TRect rect = iComponent->Node()->Node().Rect();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  4999
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5000
    // Check if the node has a property "preserve image aspect ratio".
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5001
    TBool preserveAspectRatio = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5002
    CXnNode& currentNode = iComponent->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5003
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5004
    CXnProperty* aspectProperty = currentNode.GetPropertyL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5005
        XnPropertyNames::image::KS60AspectRatio );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5006
    if ( aspectProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5007
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5008
        const TDesC8& value = aspectProperty->StringValue();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5009
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5010
        if ( value.CompareF( XnPropertyNames::image::KNone ) == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5011
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5012
            preserveAspectRatio = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5013
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5014
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5015
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5016
    TRect bitmapRect = rect;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5017
    bitmapRect.Move( -rect.iTl.iX, -rect.iTl.iY );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5018
    // Finds appropriate method of scaling
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5019
    if ( AknIconUtils::IsMifIcon( iContentBitmap ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5020
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5021
        if ( preserveAspectRatio )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5022
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5023
            AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5024
                iContentBitmap, bitmapRect.Size(), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5025
                EAspectRatioPreservedAndUnusedSpaceRemoved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5026
            AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5027
                iContentMask, bitmapRect.Size(), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5028
                EAspectRatioPreservedAndUnusedSpaceRemoved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5029
            // In some cases resizing might fail with previous settings
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5030
            if ( iContentBitmap->SizeInPixels().iHeight == 0 || 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5031
                iContentBitmap->SizeInPixels().iWidth == 0 )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5032
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5033
                AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5034
                    iContentBitmap, bitmapRect.Size(), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5035
                    EAspectRatioPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5036
                AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5037
                    iContentMask, bitmapRect.Size(), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5038
                    EAspectRatioPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5039
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5040
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5041
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5042
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5043
            AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5044
                iContentBitmap, bitmapRect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5045
            AknIconUtils::SetSize(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5046
                iContentMask, bitmapRect.Size(), EAspectRatioNotPreserved );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5047
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5048
        // Set a new bitmap size
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5049
        bitmapRect.SetSize( iContentBitmap->SizeInPixels() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5050
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5051
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5052
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5053
        if ( preserveAspectRatio )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5054
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5055
            TSize newBitmapSize;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5056
            // scaling is done in bitmap drawing routine, here only the
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5057
            // sacling rect is calculated
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5058
            CalculateScaledBitmapRect( newBitmapSize, rect.Size(), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5059
                iContentBitmap->SizeInPixels() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5060
            bitmapRect.SetSize( newBitmapSize );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5061
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5062
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5063
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5064
    // Calculate new point to start draw 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5065
    // in order to center bitmap to drawing area
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5066
    rect.iTl.iY +=
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5067
        ( rect.Height() - bitmapRect.Height() ) / 2;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5068
    rect.iTl.iX +=
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5069
        ( rect.Width() - bitmapRect.Width() ) / 2;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5070
    // sets a new size to draw
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5071
    rect.SetSize( bitmapRect.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5072
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5073
    if ( iContentBitmap && iContentMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5074
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5075
        aGc.DrawBitmapMasked( rect, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5076
            iContentBitmap, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5077
            TRect(TPoint(0, 0), iContentBitmap->SizeInPixels()), 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5078
            iContentMask, 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5079
            ETrue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5080
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5081
    else if ( iContentBitmap )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5082
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5083
        aGc.DrawBitmap( rect, iContentBitmap );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5084
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5085
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5086
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5087
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5088
// CXnControlAdapterImpl::SizeChanged
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5089
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5090
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5091
void CXnControlAdapterImpl::SizeChanged()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5092
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5093
    TRAP_IGNORE( InitializeBackgroundAndBorderBitmapsL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5094
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5095
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5096
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5097
// CXnControlAdapterImpl::SkinChanged
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5098
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5099
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5100
void CXnControlAdapterImpl::SkinChanged()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5101
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5102
    TRAP_IGNORE( InitializeBackgroundAndBorderBitmapsL( ETrue ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5103
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5104
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5105
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5106
// CXnControlAdapterImpl::FocusChangedL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5107
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5108
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5109
void CXnControlAdapterImpl::FocusChangedL( TBool aFocused )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5110
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5111
    CXnNode& node( iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5112
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5113
    CXnUiEngine* engine( node.UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5114
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5115
    CXnNode* menubar( engine->MenuBarNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5116
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5117
    if ( engine->IsEditMode() || !node.IsLayoutCapable() || !menubar )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5118
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5119
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5120
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5121
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5122
    XnMenuInterface::MXnMenuInterface* menuIf( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5123
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5124
    XnComponentInterface::MakeInterfaceL( menuIf, menubar->AppIfL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5125
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5126
    if ( !menuIf )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5127
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5128
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5129
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5130
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5131
    CXnViewManager* manager( engine->ViewManager() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5132
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5133
    const TDesC8& ns( node.Namespace() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5134
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5135
    CXnPluginData* data( manager->ActiveViewData().Plugin( ns ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5136
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5137
    if ( !data )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5138
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5139
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5140
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5141
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5142
    CXnNode* plugin( data->Node()->LayoutNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5143
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5144
    CXnNode* extension( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5145
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5146
    if ( plugin == engine->ActiveView() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5147
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5148
        // Pretend that this node is extension
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5149
        extension = &node;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5150
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5151
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5152
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5153
        RPointerArray< CXnNode >& children( plugin->Children() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5154
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5155
        for ( TInt i = 0; i < children.Count(); i++ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5156
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5157
            CXnNode* child( children[i] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5158
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5159
            const TDesC8& type( child->Type()->Type() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5160
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5161
            if ( type == XnPropertyNames::menu::KMenuExtension )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5162
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5163
                extension = child;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5164
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5165
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5166
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5167
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5168
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5169
    if ( !extension )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5170
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5171
        // No extension available     
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5172
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5173
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5174
         
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5175
    // Find proper softkey from extension
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5176
    RPointerArray< CXnNode >& children( extension->Children() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5177
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5178
    for ( TInt i = 0; i < children.Count(); i++ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5179
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5180
        CXnNode* child( children[i] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5181
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5182
        const TDesC8& type( child->Type()->Type() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5183
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5184
        if ( type == XnPropertyNames::softkey::KNodeName )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5185
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5186
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5187
            CXnProperty* prop( child->GetPropertyL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5188
                    XnPropertyNames::softkey::KTypeAttribute ) ); 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5189
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5190
            if ( prop )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5191
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5192
                const TDesC8& type( prop->StringValue() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5193
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5194
                XnMenuInterface::MXnMenuInterface::TSoftKeyPosition pos;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5195
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5196
                if ( type == XnPropertyNames::softkey::type::KLeft )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5197
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5198
                    pos = XnMenuInterface::MXnMenuInterface::ELeft;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5199
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5200
                else if ( type == XnPropertyNames::softkey::type::KMiddle )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5201
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5202
                    pos = XnMenuInterface::MXnMenuInterface::ECenter;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5203
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5204
                else if ( type == XnPropertyNames::softkey::type::KRight )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5205
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5206
                    pos = XnMenuInterface::MXnMenuInterface::ERight;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5207
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5208
                else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5209
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5210
                    // Declaration error
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5211
                    __ASSERT_DEBUG( EFalse, Panic( EXnInvalidState ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5212
                    break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5213
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5214
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5215
                if ( aFocused )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5216
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5217
                    // Set softkey
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5218
                    menuIf->SetSoftKeyL( &child->PluginIfL(), pos );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5219
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5220
                else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5221
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5222
                    // Remove softkey
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5223
                    menuIf->SetSoftKeyL( NULL, pos );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5224
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5225
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5226
                // This is not a correct way to do dirty setting,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5227
                // but here in case of menubar it is acceptable
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5228
                engine->AddDirtyNodeL( menubar, XnDirtyLevel::ERender );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5229
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5230
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5231
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5232
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5233
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5234
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5235
// CXnControlAdapterImpl::InitializeBackgroundandBorderBitmapsL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5236
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5237
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5238
void CXnControlAdapterImpl::InitializeBackgroundAndBorderBitmapsL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5239
        TBool aForceRecreate )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5240
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5241
    CXnNode& node( iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5242
    CXnUiEngine* engine( node.UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5243
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5244
    CXnProperty* backgroundImageProperty( node.BackgroundImageL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5245
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5246
    // if skin changed we need recreate icons
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5247
    if ( backgroundImageProperty && aForceRecreate )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5248
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5249
        iBackgrondInitialized = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5250
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5251
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5252
    if ( backgroundImageProperty && !iBackgrondInitialized )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5253
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5254
        delete iBackgroundBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5255
        iBackgroundBitmap = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5256
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5257
        delete iBackgroundMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5258
        iBackgroundMask = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5259
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5260
        InitializeBackgroundBitmapL( *engine, node, iBackgroundBitmapIndex,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5261
            iBackgroundBitmap, iBackgroundMask, iIconProvider, FsSession() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5262
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5263
        HBufC* bgPath( GetBackgroundImagePathLC( node ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5264
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5265
        if ( *bgPath != KNullDesC )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5266
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5267
            iAnimIDResolved = CXnUtils::ResolveSkinItemIDL( *bgPath, iAnimIID );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5268
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5269
        CleanupStack::PopAndDestroy( bgPath );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5270
        iBackgrondInitialized = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5271
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5272
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5273
    CXnProperty* borderImageProperty( node.BorderImageL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5274
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5275
    // if skin changed we need recreate icons
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5276
    if ( borderImageProperty && aForceRecreate )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5277
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5278
        iBorderInitialized = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5279
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5280
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5281
    if ( borderImageProperty && !iBorderInitialized )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5282
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5283
        delete iBorderBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5284
        iBorderBitmap = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5285
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5286
        iBorderBitmap = InitializeBorderBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5287
            *engine, node,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5288
            iBorderBitmapIndex, iBorderBitmapDividerTop,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5289
            iBorderBitmapDividerRight,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5290
            iBorderBitmapDividerBottom, iBorderBitmapDividerLeft,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5291
            iIconProvider, FsSession() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5292
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5293
        iBorderInitialized = ETrue;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5294
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5295
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5296
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5297
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5298
// CXnControlAdapterImpl::ConstructL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5299
// 2nd phase constructor. Can leave.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5300
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5301
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5302
void CXnControlAdapterImpl::ConstructL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5303
    CXnNodePluginIf& aNode,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5304
    CXnControlAdapter& aAdapter,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5305
    CWindowGc& aGc )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5306
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5307
    iGc = &aGc;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5308
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5309
    iAdapter = &aAdapter;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5310
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5311
    if ( CreateGestureHelperL( aNode.Node() ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5312
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5313
        iGestureFw = CAknTouchGestureFw::NewL( *this, aAdapter );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5314
        iGestureFw->SetGestureInterestL( EAknTouchGestureFwGroupFlick );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5315
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5316
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5317
    if ( aNode.Type()->Type() == KView )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5318
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5319
        iSuppressor = CAknPointerEventSuppressor::NewL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5320
        iSuppressor->SetMaxTapMove( TSize( KMaxTapMove, KMaxTapMove) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5321
        iSuppressor->SetMaxTapDuration( KLongTapTimeLongDelay );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5322
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5323
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5324
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5325
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5326
// CXnControlAdapterImpl::LoadBitmap
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5327
// Load a bitmap from the server. Ownership is transferred.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5328
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5329
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5330
CFbsBitmap* CXnControlAdapterImpl::LoadBitmap( const TDesC& aBitmapUrl )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5331
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5332
    CXnNode& node( iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5333
    CXnUiEngine* engine( node.UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5334
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5335
    CFbsBitmap* bitmap( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5336
    CFbsBitmap* mask( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5337
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5338
    TRect rect( node.Rect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5339
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5340
    TInt index( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5341
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5342
    TRAP_IGNORE( GetBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5343
        *engine, node,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5344
        aBitmapUrl, index,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5345
        bitmap, mask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5346
        iIconProvider, rect, FsSession() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5347
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5348
    delete mask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5349
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5350
    return bitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5351
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5352
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5353
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5354
// CXnControlAdapterImpl::GetBitmapAndMask
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5355
// Load a bitmap and mask from the server. Ownership is transferred.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5356
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5357
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5358
void CXnControlAdapterImpl::GetBitmapAndMask(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5359
    const TDesC& aBitmapUrl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5360
    const TDesC& aMaskUrl,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5361
    CFbsBitmap*& aBitmap,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5362
    CFbsBitmap*& aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5363
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5364
    CXnNode& node( iNode.Node() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5365
    CXnUiEngine* engine( node.UiEngine() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5366
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5367
    TRect rect( node.Rect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5368
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5369
    TInt index( 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5370
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5371
    TRAP_IGNORE( GetBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5372
        *engine, node,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5373
        aBitmapUrl, index,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5374
        aBitmap, aMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5375
        iIconProvider, rect, FsSession() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5376
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5377
    if ( !aMask )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5378
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5379
        if ( aMaskUrl != KNullDesC )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5380
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5381
            CFbsBitmap* bitmapMask( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5382
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5383
            TRAP_IGNORE( GetBitmapL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5384
                *engine, node,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5385
                aMaskUrl, index,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5386
                aMask, bitmapMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5387
                iIconProvider, rect, FsSession() ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5388
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5389
            delete bitmapMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5390
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5391
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5392
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5393
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5394
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5395
// CXnControlAdapterImpl::AnimFrameReady
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5396
// Callback of the animated skin background.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5397
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5398
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5399
void CXnControlAdapterImpl::AnimFrameReady( TInt aError, TInt /* aAnimId */ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5400
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5401
    if ( !aError )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5402
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5403
        iAdapter->DrawNow();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5404
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5405
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5406
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5407
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5408
// CXnControlAdapterImpl::CreateAnimationL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5409
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5410
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5411
void CXnControlAdapterImpl::CreateAnimationL( /* TDesC& aPath */ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5412
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5413
    if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5414
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5415
        delete iAnimation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5416
        iAnimation = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5417
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5418
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5419
    iAnimation = CAknsEffectAnim::NewL( this );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5420
    TBool ok = iAnimation->ConstructFromSkinL( iAnimIID );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5421
    if ( !ok )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5422
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5423
        delete iAnimation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5424
        iAnimation = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5425
        User::Leave( KErrNotSupported );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5426
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5427
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5428
    CXnNode& node = iComponent->Node()->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5429
    if ( !node.IsLaidOut() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5430
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5431
        // Animation is created before layout of nodes has been calculated
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5432
        node.UiEngine()->LayoutUIL( &node );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5433
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5434
    TRect rect( node.Rect() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5435
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5436
    iAnimation->BeginConfigInputLayersL( rect.Size(), ETrue );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5437
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5438
    if ( iAnimation->InputRgbGc() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5439
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5440
        TRect mainPane;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5441
        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5442
        TRect mainPaneRect( mainPane.Size() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5443
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5444
        MAknsSkinInstance* skin = AknsUtils::SkinInstance();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5445
        MAknsControlContext* cc = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5446
        const TAknsItemID* id = &KAknsIIDNone;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5447
        if ( AknsUtils::AvkonSkinEnabled() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5448
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5449
            cc = CAknsListBoxBackgroundControlContext::NewL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5450
                KAknsIIDQsnBgAreaMainListGene,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5451
                mainPaneRect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5452
                EFalse,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5453
                *id,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5454
                mainPaneRect );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5455
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5456
            AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5457
                cc,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5458
                NULL,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5459
                *iAnimation->InputRgbGc(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5460
                TPoint(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5461
                rect,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5462
                KAknsDrawParamBottomLevelRGBOnly );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5463
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5464
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5465
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5466
    iAnimation->EndConfigInputLayersL();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5467
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5468
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5469
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5470
// CXnControlAdapterImpl::StartHighlightAnimation()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5471
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5472
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5473
void CXnControlAdapterImpl::StartHighlightAnimation( TBool aAnimRestart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5474
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5475
    TBool focused = EFalse;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5476
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5477
    // No need to start animation again if already running
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5478
    if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5479
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5480
        if ( iAnimation->State() == EAknsAnimStateRunning && !aAnimRestart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5481
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5482
            return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5483
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5484
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5485
    // Check control's focus
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5486
    if ( iComponent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5487
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5488
        CXnNodePluginIf* pluginIf = iComponent->Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5489
        if ( pluginIf )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5490
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5491
            focused = pluginIf->IsFocusedState();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5492
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5493
        else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5494
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5495
            return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5496
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5497
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5498
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5499
    // If the node is not focused or no Anim ID, return.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5500
    if ( !focused || !iAnimIDResolved )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5501
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5502
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5503
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5504
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5505
    // Restart animation
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5506
    if ( aAnimRestart )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5507
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5508
        if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5509
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5510
            iAnimation->Stop();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5511
            delete iAnimation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5512
            iAnimation = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5513
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5514
            TRAPD( error, CreateAnimationL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5515
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5516
            if ( !error )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5517
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5518
                iAnimation->Start();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5519
                return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5520
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5521
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5522
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5523
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5524
    // Node is focused. Try to start animation.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5525
    if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5526
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5527
        iAnimation->Start();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5528
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5529
    else
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5530
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5531
        TRAPD( error, CreateAnimationL() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5532
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5533
        if ( !error )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5534
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5535
            iAnimation->Start();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5536
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5537
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5538
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5539
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5540
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5541
// CXnControlAdapterImpl::StopHighlightAnimation()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5542
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5543
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5544
void CXnControlAdapterImpl::StopHighlightAnimation()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5545
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5546
    if ( iAnimation )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5547
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5548
        // Stop animation and delete.
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5549
        iAnimation->Stop();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5550
        delete iAnimation;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5551
        iAnimation = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5552
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5553
        iAdapter->DrawNow();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5554
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5555
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5556
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5557
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5558
// CXnControlAdapterImpl::MeasureAdaptiveContentL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5559
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5560
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5561
TSize CXnControlAdapterImpl::MeasureAdaptiveContentL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5562
    const TSize& /* aAvailableSize */ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5563
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5564
    // By default the size is 0
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5565
    return TSize( 0, 0 );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5566
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5567
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5568
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5569
// CXnControlAdapterImpl::SetBlank
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5570
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5571
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5572
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5573
void CXnControlAdapterImpl::SetBlank( TBool aBlank )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5574
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5575
    iBlank = aBlank;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5576
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5577
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5578
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5579
// CXnControlAdapterImpl::DoHandlePropertyChangeL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5580
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5581
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5582
void CXnControlAdapterImpl::DoHandlePropertyChangeL( CXnProperty* /*aProperty*/ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5583
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5584
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5585
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5586
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5587
// CXnControlAdapterImpl::UpdateBackgroundImageL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5588
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5589
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5590
CXnControlAdapterImpl::TPropertyChangeResponse CXnControlAdapterImpl::UpdateBackgroundImageL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5591
    CXnProperty* aProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5592
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5593
    if ( aProperty )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5594
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5595
        const TDesC8& name( aProperty->Property()->Name() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5596
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5597
        if ( name == XnPropertyNames::appearance::common::KBackGroundImage )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5598
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5599
            delete iBackgroundBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5600
            iBackgroundBitmap = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5601
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5602
            delete iBackgroundMask;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5603
            iBackgroundMask = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5604
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5605
            InitializeBackgroundBitmapL( *( iNode.Node().UiEngine() ), iNode.Node(),
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5606
                iBackgroundBitmapIndex, iBackgroundBitmap, iBackgroundMask,
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5607
                iIconProvider, FsSession());
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5608
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5609
            return EPropertyChangeConsumed;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5610
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5611
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5612
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5613
    return EPropertyChangeNotConsumed;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5614
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5615
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5616
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5617
// CXnControlAdapterImpl::HandleScreenDeviceChangedL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5618
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5619
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5620
void CXnControlAdapterImpl::HandleScreenDeviceChangedL()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5621
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5622
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5623
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5624
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5625
// CreateBitmapFromColorL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5626
// Creates a bitmap object with the given size and fill color
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5627
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5628
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5629
static CFbsBitmap* CreateBitmapFromColorL( TSize aSize, TRgb aColor )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5630
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5631
    CFbsBitmap* newBitmap = new ( ELeave ) CFbsBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5632
    newBitmap->Create( aSize, EColor16M );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5633
    CleanupStack::PushL( newBitmap );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5634
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5635
    CFbsBitmapDevice* bitmapDev = CFbsBitmapDevice::NewL( newBitmap );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5636
    CleanupStack::PushL( bitmapDev );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5637
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5638
    CFbsBitGc* bc = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5639
    User::LeaveIfError( bitmapDev->CreateContext( bc ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5640
    CleanupStack::PushL( bc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5641
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5642
    bc->SetBrushColor( aColor );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5643
    bc->Clear(); // area is filled with the brush color
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5644
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5645
    CleanupStack::PopAndDestroy( bc );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5646
    CleanupStack::PopAndDestroy( bitmapDev );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5647
    CleanupStack::Pop( newBitmap );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5648
    return newBitmap;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5649
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5650
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5651
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5652
// InitializeGestureL
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5653
// Sets up gesture
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5654
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5655
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5656
void CXnControlAdapterImpl::InitializeGestureL(
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5657
    const TPointerEvent& aPointerEvent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5658
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5659
    if ( !iGestureFw || aPointerEvent.iType != TPointerEvent::EButton1Down )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5660
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5661
        return;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5662
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5663
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5664
    CXnUiEngine* engine( iNode.Node().UiEngine() );                               
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5665
    // Set default destination                     
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5666
    iGestureDestination = &iNode.Node();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5667
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5668
    RPointerArray< CXnPluginData >& plugins( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5669
        engine->ViewManager()->ActiveViewData().PluginData() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5670
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5671
    for ( TInt i = 0; i < plugins.Count(); i++ )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5672
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5673
        CXnPluginData* plugin( plugins[i] );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5674
                                   
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5675
        if ( plugin->Occupied() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5676
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5677
            CXnNode* widget( plugin->Node()->LayoutNode() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5678
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5679
            if ( widget->MarginRect().Contains( aPointerEvent.iPosition ) )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5680
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5681
                // Resolve swipe destination
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5682
                CXnProperty* prop( widget->GetPropertyL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5683
                    XnPropertyNames::common::KSwipeDestination ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5684
                
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5685
                if ( prop )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5686
                    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5687
                    const TDesC8& value( prop->StringValue() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5688
                        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5689
                    if( value == XnPropertyNames::KWidget )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5690
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5691
                        // Set widget as destination    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5692
                        iGestureDestination = widget;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5693
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5694
                    else if( value == XnPropertyNames::KNone )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5695
                        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5696
                        // Set no destination    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5697
                        iGestureDestination = NULL;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5698
                        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5699
                    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5700
                break;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5701
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5702
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5703
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5704
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5705
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5706
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5707
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5708
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5709
void CXnControlAdapterImpl::RemoveChildAdapters()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5710
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5711
    iChildren.Reset();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5712
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5713
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5714
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5715
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5716
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5717
RPointerArray< CXnControlAdapter >& CXnControlAdapterImpl::ChildAdapters()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5718
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5719
    return iChildren;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5720
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5721
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5722
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5723
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5724
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5725
RFs& CXnControlAdapterImpl::FsSession()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5726
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5727
    return iAdapter->ControlEnv()->FsSession();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5728
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5729
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5730
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5731
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5732
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5733
void CXnControlAdapterImpl::HandleTouchGestureL( MAknTouchGestureFwEvent& aEvent )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5734
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5735
    if ( aEvent.Group() == EAknTouchGestureFwGroupFlick )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5736
        {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5737
        TAknTouchGestureFwType type = aEvent.Type();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5738
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5739
        const TDesC8* swipe( NULL );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5740
    
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5741
        if ( type == EAknTouchGestureFwFlickLeft )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5742
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5743
            swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KLeft;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5744
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5745
        else if ( type == EAknTouchGestureFwFlickRight )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5746
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5747
            swipe = &XnPropertyNames::action::trigger::name::swipe::direction::KRight;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5748
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5749
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5750
        if ( swipe && iGestureDestination )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5751
            {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5752
            CXnUiEngine* engine = iNode.Node().UiEngine();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5753
            if ( iGestureDestination == &iNode.Node() )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5754
                {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5755
                CancelFocusRefusalL( *engine );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5756
                }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5757
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5758
            // Remove focus
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5759
            engine->AppUiAdapter().HideFocus();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5760
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5761
            CXnNode* trigger( BuildSwipeTriggerNodeLC( *engine, *swipe ) );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5762
            iGestureDestination->ReportXuikonEventL( *trigger );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5763
            CleanupStack::PopAndDestroy( trigger );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5764
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5765
            CXnAppUiAdapter& appui( engine->AppUiAdapter() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5766
            CXnViewData& data( appui.ViewManager().ActiveViewData() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5767
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5768
            CXnViewControlAdapter* control = 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5769
                static_cast< CXnViewControlAdapter* >( data.ViewNode()->Control() );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5770
            
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5771
            control->ResetGrabbing();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5772
            }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5773
        }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5774
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5775
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5776
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5777
// ============================= TIconProvider ===============================
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5778
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5779
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5780
// Constructor
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5781
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5782
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5783
CXnControlAdapterImpl::TIconProvider::TIconProvider( RFile& aFile ) :
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5784
    iFile( aFile )
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5785
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5786
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5787
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5788
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5789
// Destructor
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5790
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5791
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5792
CXnControlAdapterImpl::TIconProvider::~TIconProvider()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5793
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5794
    iFile.Close();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5795
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5796
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5797
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5798
// Retreive Icon handle
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5799
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5800
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5801
void CXnControlAdapterImpl::TIconProvider::RetrieveIconFileHandleL( 
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5802
    RFile& aFile, const TIconFileType /*aType*/)
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5803
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5804
    aFile.Duplicate( iFile );
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5805
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5806
        
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5807
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5808
// Finish
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5809
// -----------------------------------------------------------------------------
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5810
//
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5811
void CXnControlAdapterImpl::TIconProvider::Finished()
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5812
    {
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5813
    iFile.Close();
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5814
    delete this;
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5815
    }
5456b4e8b3a8 Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
  5816