windowing/windowserver/nonnga/SERVER/SERVER.CPP
branchGCC_SURGE
changeset 125 0fecfaa711d2
parent 110 7f25ef56562d
equal deleted inserted replaced
101:8b609b439da2 125:0fecfaa711d2
    17 
    17 
    18 #include "server.h"
    18 #include "server.h"
    19 #include "panics.h"
    19 #include "panics.h"
    20 #include "wstop.h"
    20 #include "wstop.h"
    21 #include "EVENT.H"
    21 #include "EVENT.H"
    22 #include <Graphics/WSGRAPHICDRAWERINTERFACE.H>
       
    23 #include <bitdraw.h>
    22 #include <bitdraw.h>
    24 #include <hal.h>
    23 #include <hal.h>
    25 #include "inifile.h"
    24 #include "inifile.h"
    26 #include "wspluginmanager.h"
    25 #include "wspluginmanager.h"
    27 
    26 
    80 	void Invalidate(const TGraphicDrawerId& aId);
    79 	void Invalidate(const TGraphicDrawerId& aId);
    81 	void OnInactive();
    80 	void OnInactive();
    82 	void OnActive();
    81 	void OnActive();
    83 	void ScheduleRedraw(MWsScreen& aScreen,const TTime& aWhen);
    82 	void ScheduleRedraw(MWsScreen& aScreen,const TTime& aWhen);
    84 	void DoRedrawNow(MWsScreen& aScreen);
    83 	void DoRedrawNow(MWsScreen& aScreen);
       
    84 	void DoRedrawNow(MWsScreen& aScreen, MWsAnimationScheduler::MScreenUpdateObserver& aObserver);
       
    85 	void ClearScreenUpdateObserver(const MWsAnimationScheduler::MScreenUpdateObserver& /*aObserver*/) {}
    85 	TInt RemoveGraphicDrawer(const TGraphicDrawerId &aId);
    86 	TInt RemoveGraphicDrawer(const TGraphicDrawerId &aId);
    86 	
    87 	
    87 private:
    88 private:
    88 	static TBool OnIdleCallBack(TAny* aAny);
    89 	static TBool OnIdleCallBack(TAny* aAny);
    89 	void OnIdleCallBack(TBool aForceRedraw);
    90 	void OnIdleCallBack(TBool aForceRedraw);
   323 	
   324 	
   324 void CWindowServer::CDefaultAnimationScheduler::DoRedrawNow(MWsScreen& /*aScreen*/)
   325 void CWindowServer::CDefaultAnimationScheduler::DoRedrawNow(MWsScreen& /*aScreen*/)
   325 	{
   326 	{
   326 	OnIdleCallBack(ETrue);
   327 	OnIdleCallBack(ETrue);
   327 	}
   328 	}
       
   329 	
       
   330 void CWindowServer::CDefaultAnimationScheduler::DoRedrawNow(MWsScreen& /*aScreen*/, MWsAnimationScheduler::MScreenUpdateObserver& aObserver)
       
   331 	{
       
   332 	OnIdleCallBack(ETrue);
       
   333 	aObserver.ScreenUpdateComplete(KErrNone);
       
   334 	}	
   328 	
   335 	
   329 void CWindowServer::CDefaultAnimationScheduler::ScheduleAnimation(MWsScreen& aScreen,const TTime& aWhen)
   336 void CWindowServer::CDefaultAnimationScheduler::ScheduleAnimation(MWsScreen& aScreen,const TTime& aWhen)
   330 	{
   337 	{
   331 	TSchedule schedule;
   338 	TSchedule schedule;
   332 	schedule.iScreen = &aScreen;
   339 	schedule.iScreen = &aScreen;
   644 	WS_ASSERT_DEBUG(iDrawerMasterIndex.IsEmpty(), EWsPanicWsGraphic);
   651 	WS_ASSERT_DEBUG(iDrawerMasterIndex.IsEmpty(), EWsPanicWsGraphic);
   645 	iDrawerMasterIndex.Close();
   652 	iDrawerMasterIndex.Close();
   646 	
   653 	
   647 	delete iDefaultAnimationScheduler;
   654 	delete iDefaultAnimationScheduler;
   648 	iDefaultAnimationScheduler = NULL; // might be called from clients during server destruction
   655 	iDefaultAnimationScheduler = NULL; // might be called from clients during server destruction
   649 	iCustomAnimationScheduler = NULL; // not owned
       
   650 	delete iPluginManager;
   656 	delete iPluginManager;
   651 	}
   657 	}
   652 	
   658 	
   653 void CWindowServer::ConstructL()
   659 void CWindowServer::ConstructL()
   654 	{
   660 	{
   712 	}
   718 	}
   713 	
   719 	
   714 /**
   720 /**
   715 Custom Animation Scheduler
   721 Custom Animation Scheduler
   716 */
   722 */
   717 TBool CWindowServer::SetCustomAnimationScheduler(MWsAnimationScheduler* aScheduler)
   723 TBool CWindowServer::SetCustomAnimationScheduler(MWsAnimationScheduler* /*aScheduler*/)
   718 	{
   724 	{
   719 	if(!iCustomAnimationScheduler && aScheduler)
       
   720 		{
       
   721 		iCustomAnimationScheduler = aScheduler;
       
   722 		return ETrue;
       
   723 		}
       
   724 	return EFalse;
   725 	return EFalse;
   725 	}
   726 	}
   726 
   727 
   727 TBool CWindowServer::HasCustomAnimationScheduler() const
   728 TBool CWindowServer::HasCustomAnimationScheduler() const
   728 	{
   729 	{
   729 	return !!iCustomAnimationScheduler;
       
   730 	}
       
   731 
       
   732 TBool CWindowServer::ClearCustomAnimationScheduler(MWsAnimationScheduler* aCurrentScheduler)
       
   733 	{
       
   734 	if(iCustomAnimationScheduler && (iCustomAnimationScheduler == aCurrentScheduler))
       
   735 		{
       
   736 		iCustomAnimationScheduler = NULL;
       
   737 		return ETrue;
       
   738 		}
       
   739 	return EFalse;
   730 	return EFalse;
   740 	}
   731 	}
       
   732 
       
   733 TBool CWindowServer::ClearCustomAnimationScheduler(MWsAnimationScheduler* /*aCurrentScheduler*/)
       
   734 	{
       
   735 	return EFalse;
       
   736 	}
   741 	
   737 	
   742 MWsAnimationScheduler* CWindowServer::AnimationScheduler()
   738 MWsAnimationScheduler* CWindowServer::AnimationScheduler()
   743 	{
   739 	{
   744 	if(iCustomAnimationScheduler)
       
   745 		{
       
   746 		return iCustomAnimationScheduler;
       
   747 		}
       
   748 	return iDefaultAnimationScheduler;
   740 	return iDefaultAnimationScheduler;
   749 	}
   741 	}
   750 
   742 
   751 TInt CWindowServer::RegisterEventHandler(CWsGraphicDrawer* aDrawer, MWsEventHandler* aHandler, TUint32 aEventMask)
   743 TInt CWindowServer::RegisterEventHandler(CWsGraphicDrawer* aDrawer, MWsEventHandler* aHandler, TUint32 aEventMask)
   752 	{
   744 	{