windowing/windowserver/nonnga/graphicdrawer/graphicdrawerenvironment.cpp
changeset 0 5d03bc08d59c
child 26 15986eb6c500
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 1995-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "Graphics/WSGRAPHICDRAWER.H"
       
    17 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
       
    18 
       
    19 // TGraphicDrawerId \\\\\\\\\\\\\\\\\\\\\\\\
       
    20 
       
    21 EXPORT_C TInt TGraphicDrawerId::Compare(const TGraphicDrawerId& aOther) const
       
    22 /** Compares another ID with this for equality.
       
    23 @param aOther the ID to be compared with this.
       
    24 @return 0 if identical, -1 if this is less than aOther and 1 if this is greater than aOther
       
    25 */	{
       
    26 	// id is expected to differ most 99.99% of the time
       
    27 	if(iId < aOther.iId)
       
    28 		{
       
    29 		return -1;
       
    30 		}
       
    31 	else if(iId > aOther.iId)
       
    32 		{
       
    33 		return 1;
       
    34 		}
       
    35 	// else we have to compare the iIsUid flag too; again, expect it to be a match 99.99% of these times
       
    36 	else if(iIsUid == aOther.iIsUid)
       
    37 		{
       
    38 		return 0;
       
    39 		}
       
    40 	// collisions of id but not iIsUid are going to be really really rare
       
    41 	else if(iIsUid)
       
    42 		{
       
    43 		return 1;
       
    44 		}
       
    45 	else
       
    46 		{
       
    47 		return -1;
       
    48 		}
       
    49 	}
       
    50 	
       
    51 EXPORT_C TInt TGraphicDrawerId::Compare(const TGraphicDrawerId& aFirst,const TGraphicDrawerId& aSecond)
       
    52 /** Compares two IDs for equality.
       
    53 @param aFirst the ID to be compared with aSecond
       
    54 @param aSecond the ID to be compared with aFirst
       
    55 @return 0 if identical, -1 if aFirst is less than aSecond and 1 if aFirst is greater than aSecond
       
    56 */	{
       
    57 	return aFirst.Compare(aSecond);
       
    58 	}
       
    59 
       
    60 // MWsAnimationScheduler \\\\\\\\\\\\\\\\\\\\\\\\
       
    61 
       
    62 EXPORT_C void MWsAnimationScheduler::Animate(MWsScreen& aScreen)
       
    63 /** Calls the screen's OnAnimation() callback
       
    64 	@param aScreen the screen to be called back
       
    65 */	{
       
    66 	aScreen.OnAnimation();
       
    67 	}
       
    68 
       
    69 EXPORT_C void MWsAnimationScheduler::Animate(MWsScreen& aScreen, TRequestStatus* aFinished)
       
    70 /** This method is only here to keep compatibility with NGA Window Server.
       
    71 	Please use Animate(MWsScreen&) instead!
       
    72 	@internalTechnology
       
    73 */	{
       
    74 	aScreen.OnAnimation();
       
    75 
       
    76 	if(aFinished)
       
    77 		{
       
    78 		*aFinished = KRequestPending;
       
    79 		User::RequestComplete(aFinished, KErrNone);
       
    80 		}
       
    81 	}
       
    82 
       
    83 EXPORT_C void MWsAnimationScheduler::Redraw(MWsScreen& aScreen)
       
    84 /** Calls the screen's Redraw() method
       
    85 	@param aScreen the screen to be redrawn
       
    86 */	{
       
    87 	aScreen.Redraw();
       
    88 	}
       
    89 
       
    90 EXPORT_C TBool MWsAnimationScheduler::RedrawInvalid(MWsScreen& aScreen,const TArray<TGraphicDrawerId>& aInvalid)
       
    91 /** Calls the screen's RedrawInvalid() method
       
    92 	@param aScreen the screen to be signalled to redraw any affected areas
       
    93 	@param the list of graphic IDs that are invalid
       
    94 	@return whether the screen drew anything
       
    95 */	{
       
    96 	return aScreen.RedrawInvalid(aInvalid);
       
    97 	}
       
    98 	
       
    99 // MWsObjectProvider \\\\\\\\\\\\\\\\\\\\\\\\
       
   100 	
       
   101 EXPORT_C TAny* MWsObjectProvider::ResolveObjectInterface(TUint /*aTypeId*/)
       
   102 	{
       
   103 	return NULL;
       
   104 	}
       
   105 
       
   106 // MWsGraphicDrawerEnvironment \\\\\\\\\\\\\\\\\\\\\\\\
       
   107