os/graphics/windowing/windowserver/nonnga/graphicdrawer/graphicdrawerenvironment.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/nonnga/graphicdrawer/graphicdrawerenvironment.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,108 @@
     1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include "Graphics/WSGRAPHICDRAWER.H"
    1.20 +#include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
    1.21 +#include "Graphics/wsgraphicdrawerinternal.h"
    1.22 +
    1.23 +// TGraphicDrawerId \\\\\\\\\\\\\\\\\\\\\\\\
    1.24 +
    1.25 +EXPORT_C TInt TGraphicDrawerId::Compare(const TGraphicDrawerId& aOther) const
    1.26 +/** Compares another ID with this for equality.
    1.27 +@param aOther the ID to be compared with this.
    1.28 +@return 0 if identical, -1 if this is less than aOther and 1 if this is greater than aOther
    1.29 +*/	{
    1.30 +	// id is expected to differ most 99.99% of the time
    1.31 +	if(iId < aOther.iId)
    1.32 +		{
    1.33 +		return -1;
    1.34 +		}
    1.35 +	else if(iId > aOther.iId)
    1.36 +		{
    1.37 +		return 1;
    1.38 +		}
    1.39 +	// else we have to compare the iIsUid flag too; again, expect it to be a match 99.99% of these times
    1.40 +	else if(iIsUid == aOther.iIsUid)
    1.41 +		{
    1.42 +		return 0;
    1.43 +		}
    1.44 +	// collisions of id but not iIsUid are going to be really really rare
    1.45 +	else if(iIsUid)
    1.46 +		{
    1.47 +		return 1;
    1.48 +		}
    1.49 +	else
    1.50 +		{
    1.51 +		return -1;
    1.52 +		}
    1.53 +	}
    1.54 +	
    1.55 +EXPORT_C TInt TGraphicDrawerId::Compare(const TGraphicDrawerId& aFirst,const TGraphicDrawerId& aSecond)
    1.56 +/** Compares two IDs for equality.
    1.57 +@param aFirst the ID to be compared with aSecond
    1.58 +@param aSecond the ID to be compared with aFirst
    1.59 +@return 0 if identical, -1 if aFirst is less than aSecond and 1 if aFirst is greater than aSecond
    1.60 +*/	{
    1.61 +	return aFirst.Compare(aSecond);
    1.62 +	}
    1.63 +
    1.64 +// MWsAnimationScheduler \\\\\\\\\\\\\\\\\\\\\\\\
    1.65 +
    1.66 +EXPORT_C void MWsAnimationScheduler::Animate(MWsScreen& aScreen)
    1.67 +/** Calls the screen's OnAnimation() callback
    1.68 +	@param aScreen the screen to be called back
    1.69 +*/	{
    1.70 +	aScreen.OnAnimation();
    1.71 +	}
    1.72 +
    1.73 +EXPORT_C void MWsAnimationScheduler::Animate(MWsScreen& aScreen, TRequestStatus* aFinished)
    1.74 +/** This method is only here to keep compatibility with NGA Window Server.
    1.75 +	Please use Animate(MWsScreen&) instead!
    1.76 +	@internalTechnology
    1.77 +*/	{
    1.78 +	aScreen.OnAnimation();
    1.79 +
    1.80 +	if(aFinished)
    1.81 +		{
    1.82 +		*aFinished = KRequestPending;
    1.83 +		User::RequestComplete(aFinished, KErrNone);
    1.84 +		}
    1.85 +	}
    1.86 +
    1.87 +EXPORT_C void MWsAnimationScheduler::Redraw(MWsScreen& aScreen)
    1.88 +/** Calls the screen's Redraw() method
    1.89 +	@param aScreen the screen to be redrawn
    1.90 +*/	{
    1.91 +	aScreen.Redraw();
    1.92 +	}
    1.93 +
    1.94 +EXPORT_C TBool MWsAnimationScheduler::RedrawInvalid(MWsScreen& aScreen,const TArray<TGraphicDrawerId>& aInvalid)
    1.95 +/** Calls the screen's RedrawInvalid() method
    1.96 +	@param aScreen the screen to be signalled to redraw any affected areas
    1.97 +	@param the list of graphic IDs that are invalid
    1.98 +	@return whether the screen drew anything
    1.99 +*/	{
   1.100 +	return aScreen.RedrawInvalid(aInvalid);
   1.101 +	}
   1.102 +	
   1.103 +// MWsObjectProvider \\\\\\\\\\\\\\\\\\\\\\\\
   1.104 +	
   1.105 +EXPORT_C TAny* MWsObjectProvider::ResolveObjectInterface(TUint /*aTypeId*/)
   1.106 +	{
   1.107 +	return NULL;
   1.108 +	}
   1.109 +
   1.110 +// MWsGraphicDrawerEnvironment \\\\\\\\\\\\\\\\\\\\\\\\
   1.111 +