diff -r f5050f1da672 -r 04becd199f91 javauis/lcdui_akn/lcdgd/inc/calctransform.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/lcdui_akn/lcdgd/inc/calctransform.h Tue Apr 27 16:30:29 2010 +0300 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef CALCTRANSFORM_H +#define CALCTRANSFORM_H + +#include +#include +#include "lcdgdrvif.h" +#include "lcdtransform.h" + + +/** + * Compute the TLcdTransform mapping between aSrcRect and aDstRect with transform type + * aSrcTransform. + */ +IMPORT_C TLcdTransform CalcTransform +( + const TRect& aDstRect, // unclipped + const TRect& aSrcRect, // unclipped + TTransformType aSrcTransform +); + +/** + * Calculate clipped source and destination rectangles for + * src to dst transform aSrcTransform. This function calculates + * the largest corresponding subrectangles of aDstRect and aSrcRect + * that also lie within aDstClipRect and aSrcClipRect respectively. + */ +IMPORT_C void ClipTransformRect +( + TRect& aDstRect, // in/out + TRect& aSrcRect, // in/out + const TRect& aDstClipRect, // input + const TRect& aSrcClipRect, // input + TLcdTransform& aSrcTransform // src to target transform +); + +/** + * Clip source and dst rects against source and dst clip rects, maintaining mapping (i.e. no stretch) + */ +IMPORT_C void ClipRects(TRect& aDstRect, const TRect& aDstClip, TRect& aSrcRect, const TRect& aSrcClip); + +/** + *@return ETrue if aSrcRect and aDstRect correspond under transformation aTransform + */ +IMPORT_C TBool CheckTransform(const TRect& aDstRect, const TRect& aSrcRect, const TLcdTransform aTransform); + +/** + *@return ETrue if aDstRect is completely contained within rectangle of size aDstSize, and + * aDstRect transformed by aTransform is completely contained within rectangle of size aSrcSize. + */ +IMPORT_C TBool CheckBounds(const TSize& aDstSize, const TSize& aSrcSize, const TRect& aDstRect, const TLcdTransform& aTransform); + +#endif // CALCTRANSFORM_H