+void Adaptor::RunIdles()
+{
+ for( auto& callback : mCallbacks )
+ {
+ CallbackBase::Execute( *callback );
+ }
+
+ mCallbacks.Clear();
+}
+
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
+{
+ DALI_ASSERT_ALWAYS( ! mWindows.empty() );
+
+ return reinterpret_cast < Dali::RenderSurfaceInterface& >( mWindows.front()->GetRenderSurface() );
+}
+
+Dali::WindowContainer Adaptor::GetWindows()
+{
+ Dali::WindowContainer windows;
+
+ for ( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter )
+ {
+ // Downcast to Dali::Window
+ Dali::Window window( dynamic_cast<Dali::Internal::Adaptor::Window*>( *iter ) );
+ if ( window )
+ {
+ windows.push_back( window );
+ }
+ }
+
+ return windows;
+}
+
+Dali::SceneHolderList Adaptor::GetSceneHolders()
+{
+ Dali::SceneHolderList sceneHolderList;
+
+ for( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter )
+ {
+ sceneHolderList.push_back( Dali::Integration::SceneHolder( *iter ) );
+ }
+
+ return sceneHolderList;
+}
+
+Dali::Internal::Adaptor::SceneHolder* Adaptor::GetWindow( Dali::Actor& actor )
+{
+ Dali::Integration::Scene scene = Dali::Integration::Scene::Get( actor );
+
+ for( auto window : mWindows )
+ {
+ if ( scene == window->GetScene() )
+ {
+ return window;
+ }
+ }
+
+ return nullptr;
+}
+
+void Adaptor::AddWindow( Internal::Adaptor::SceneHolder* window )
+{
+ if ( window )
+ {
+ mWindows.push_back( window );
+
+ Dali::Integration::SceneHolder newWindow( window );
+ mWindowCreatedSignal.Emit( newWindow );
+ }
+}
+
+void Adaptor::RemoveWindow( Internal::Adaptor::SceneHolder* window )
+{
+ auto iter = std::find( mWindows.begin(), mWindows.end(), window );
+ if( iter != mWindows.end() )
+ {
+ mWindows.erase( iter );
+ }
+}
+
+void Adaptor::RegisterProcessor( Integration::Processor& processor, bool postProcessor )
+{
+ Integration::Core& core = mTestApplication->GetCore();
+ core.RegisterProcessor( processor, postProcessor );
+}
+
+void Adaptor::UnregisterProcessor( Integration::Processor& processor, bool postProcessor )
+{
+ Integration::Core& core = mTestApplication->GetCore();
+ core.UnregisterProcessor( processor, postProcessor );
+}
+
+void Adaptor::SetApplication( Dali::TestApplication& testApplication )
+{
+ mTestApplication = &testApplication;
+}
+
+Dali::Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
+{
+ return mResizedSignal;
+}
+
+Dali::Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
+{
+ return mLanguageChangedSignal;
+}
+
+Dali::Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+ return mWindowCreatedSignal;
+}
+
+} // namespace Adaptor
+} // namespace Internal
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Dali::Adaptor Stub
+//
+///////////////////////////////////////////////////////////////////////////////
+
+Adaptor::Adaptor()
+: mImpl( new Internal::Adaptor::Adaptor )