Update contrib.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "tsmallwindowzoom.h"
25 const TRect KMinimumZoomRect(TSize(20, 20));
27 CTSmallWindowZoom::CTSmallWindowZoom(const TPoint& aStartingPoint, const TSize& aWindowSize):
28 CTSmallWindowRaster(aStartingPoint, aWindowSize)
33 CTSmallWindowZoom::~CTSmallWindowZoom()
38 CTWindow* CTSmallWindowZoom::NewL(RWsSession &aWs,
39 const RWindowTreeNode &aParent,
40 const TPoint& aStartingPoint,
41 const TSize& aWindowSize)
43 CTSmallWindowZoom* self = new (ELeave)CTSmallWindowZoom(aStartingPoint, aWindowSize);
44 CleanupStack::PushL(self);
45 self->ConstructL(aWs, aParent);
46 CleanupStack::Pop(self);
50 void CTSmallWindowZoom::ConstructL(RWsSession &aWs, const RWindowTreeNode &aParent)
52 CTSmallWindowRaster::ConstructL(aWs, aParent);
57 void CTSmallWindowZoom::LoadL(CSurfaceUtility* aUtility, TPtrC aFileName)
59 CTSmallWindowRaster::LoadL(aUtility, aFileName);
60 iZoomRect = iSourceRect;
63 void CTSmallWindowZoom::RenderL()
68 DrawBitmap(iZoomRect);
71 iZoomRect.Shrink(iDelta, iDelta);
72 if (iZoomRect.Width() <= KMinimumZoomRect.Width())
79 iZoomRect.Grow(iDelta, iDelta);
80 if (iZoomRect.Width() >= iSourceRect.Width())