../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp
- ../dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder.cpp
../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
../dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-video-player.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-virtual-keyboard.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp
- ../dali-toolkit/dali-toolkit-test-utils/toolkit-scene-holder.cpp
../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
../dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
Dali::RenderSurfaceInterface& GetSurface();
Dali::WindowContainer GetWindows();
- Dali::SceneHolderList GetSceneHolders();
Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
void AddWindow( Internal::Adaptor::SceneHolder* window );
private:
Vector<CallbackBase*> mCallbacks;
- std::vector<Internal::Adaptor::SceneHolder*> mWindows;
+ Dali::WindowContainer mWindows;
Dali::Adaptor::AdaptorSignalType mResizedSignal;
Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal;
Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal;
#include <dali/integration-api/adaptors/adaptor.h>
#include <dali/integration-api/adaptors/scene-holder.h>
-#include <toolkit-scene-holder-impl.h>
#include <toolkit-adaptor-impl.h>
#include <dali/integration-api/debug.h>
void Adaptor::Start( Dali::Window window )
{
- AddWindow( &GetImplementation( window ) );
+ if ( window )
+ {
+ mWindows.push_back( window );
+ mWindowCreatedSignal.Emit( window );
+ }
}
Integration::Scene Adaptor::GetScene( Dali::Window 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 );
- }
-}
-
Dali::Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
{
return mResizedSignal;
return mImpl->GetWindows();
}
-Dali::SceneHolderList Adaptor::GetSceneHolders() const
-{
- return mImpl->GetSceneHolders();
-}
-
Any Adaptor::GetNativeWindowHandle()
{
Any window;
*
*/
-#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/adaptors/scene-holder.h>
-#include <toolkit-scene-holder-impl.h>
-
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/base-object.h>
-#include <dali/integration-api/adaptors/adaptor.h>
-#include <toolkit-adaptor-impl.h>
-
-using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
-
namespace Dali
{
-///////////////////////////////////////////////////////////////////////////////
-//
-// Dali::Internal::Adaptor::SceneHolder Stub
-//
-///////////////////////////////////////////////////////////////////////////////
-
namespace Internal
{
namespace Adaptor
{
-SceneHolder::SceneHolder( const Dali::Rect<int>& positionSize )
-: mRenderSurface( positionSize ),
- mScene( Dali::Integration::Scene::New( mRenderSurface ) )
-{
-}
-
-SceneHolder::~SceneHolder()
-{
- if ( Dali::Adaptor::IsAvailable() )
- {
- AdaptorImpl::GetImpl( AdaptorImpl::Get() ).RemoveWindow( this );
- }
-}
-
-void SceneHolder::Add( Dali::Actor actor )
-{
- mScene.Add( actor );
-}
-
-void SceneHolder::Remove( Dali::Actor actor )
-{
- mScene.Remove( actor );
-}
-
-Dali::Layer SceneHolder::GetRootLayer() const
+class SceneHolder: public Dali::BaseObject
{
- return mScene.GetRootLayer();
-}
-void SceneHolder::SetBackgroundColor( Vector4 color )
-{
- return mScene.SetBackgroundColor( color );
-}
-
-Vector4 SceneHolder::GetBackgroundColor() const
-{
- return mScene.GetBackgroundColor();
-}
+};
-void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
-{
-}
+} // Adaptor
-void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
-{
-}
-
-void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
-{
-}
-
-Dali::Integration::SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
-{
- return mScene.KeyEventSignal();
-}
-
-Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
-{
- return mScene.KeyEventGeneratedSignal();
-}
-
-Dali::Integration::SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
-{
- return mScene.TouchSignal();
-}
-
-Dali::Integration::SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
-{
- return mScene.WheelEventSignal();
-}
-
-Integration::Scene SceneHolder::GetScene()
-{
- return mScene;
-}
-
-Integration::RenderSurface& SceneHolder::GetRenderSurface()
-{
- return mRenderSurface;
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Dali::Integration::SceneHolder Stub
-//
-///////////////////////////////////////////////////////////////////////////////
+} // Internal
namespace Integration
{
SceneHolder::SceneHolder()
{
- // Dali::Internal::Adaptor::Adaptor::Get().WindowCreatedSignal().Emit( *this );
}
SceneHolder::~SceneHolder()
GetImplementation( *this ).Remove( actor );
}
-Dali::Layer SceneHolder::GetRootLayer() const
+Layer SceneHolder::GetRootLayer() const
{
return GetImplementation( *this ).GetRootLayer();
}
void SceneHolder::SetBackgroundColor( Vector4 color )
{
- GetImplementation( *this ).SetBackgroundColor( color );
}
Vector4 SceneHolder::GetBackgroundColor() const
{
- return GetImplementation( *this ).GetBackgroundColor();
+ return Dali::Stage::GetCurrent().GetBackgroundColor();
}
void SceneHolder::FeedTouchPoint( Dali::TouchPoint& point, int timeStamp )
{
- GetImplementation( *this ).FeedTouchPoint( point, timeStamp );
}
void SceneHolder::FeedWheelEvent( Dali::WheelEvent& wheelEvent )
{
- GetImplementation( *this ).FeedWheelEvent( wheelEvent );
}
void SceneHolder::FeedKeyEvent( Dali::KeyEvent& keyEvent )
{
- GetImplementation( *this ).FeedKeyEvent( keyEvent );
-}
-
-SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal()
-{
- return GetImplementation( *this ).KeyEventSignal();
-}
-
-SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal()
-{
- return GetImplementation( *this ).KeyEventGeneratedSignal();
-}
-
-SceneHolder::TouchSignalType& SceneHolder::TouchSignal()
-{
- return GetImplementation( *this ).TouchSignal();
-}
-
-SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal()
-{
- return GetImplementation( *this ).WheelEventSignal();
}
} // Integration
{
namespace Adaptor
{
-
-Window::Window( const PositionSize& positionSize )
-: SceneHolder( positionSize )
+class Window : public Dali::BaseObject
{
-}
+public:
-Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
-{
- return new Window( positionSize );
-}
+ Window( const PositionSize& positionSize )
+ : mRenderSurface( positionSize ),
+ mScene( Dali::Integration::Scene::New( mRenderSurface ) )
+ {
+ }
+
+ virtual ~Window() = default;
+
+ static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+ {
+ return new Window( positionSize );
+ }
+
+ TestRenderSurface mRenderSurface;
+ Integration::Scene mScene;
+};
} // Adaptor
} // Internal
Dali::Window Window::New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent )
{
Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( windowPosition, name, className, isTransparent );
-
- Dali::Window result( window );
-
- // This will also emit the window created signals
- AdaptorImpl::GetImpl( AdaptorImpl::Get() ).AddWindow( window );
-
- return result;
+ Dali::Window newWindow = Window( window );
+ Dali::Adaptor::WindowCreatedSignalType& windowCreatedSignal = AdaptorImpl::Get().WindowCreatedSignal();
+ windowCreatedSignal.Emit( newWindow );
+ return Window( window );
}
Window::Window( Internal::Adaptor::Window* window )
Integration::Scene Window::GetScene()
{
- return GetImplementation( *this ).GetScene();
+ return GetImplementation( *this ).mScene;
}
Integration::RenderSurface& Window::GetRenderSurface()
{
- return GetImplementation( *this ).GetRenderSurface();
+ return GetImplementation( *this ).mRenderSurface;
}
void Window::Add( Actor actor )
EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
{
- return GetImplementation( window ).GetScene().EventProcessingFinishedSignal();
+ return GetImplementation( window ).mScene.EventProcessingFinishedSignal();
}
KeyEventSignalType& KeyEventSignal( Window window )
{
- return GetImplementation( window ).KeyEventSignal();
+ return GetImplementation( window ).mScene.KeyEventSignal();
}
KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window )
{
- return GetImplementation( window ).KeyEventGeneratedSignal();
+ return GetImplementation( window ).mScene.KeyEventGeneratedSignal();
}
TouchSignalType& TouchSignal( Window window )
{
- return GetImplementation( window ).TouchSignal();
+ return GetImplementation( window ).mScene.TouchSignal();
}
WheelEventSignalType& WheelEventSignal( Window window )
{
- return GetImplementation( window ).WheelEventSignal();
+ return GetImplementation( window ).mScene.WheelEventSignal();
}
} // namespace DevelWindow
#include <cstring> // for strcmp
#include <dali/public-api/actors/layer.h>
#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/devel-api/adaptor-framework/lifecycle-controller.h>
#include <dali/public-api/animation/constraints.h>
#include <dali/public-api/common/stage.h>
{
if( Adaptor::IsAvailable() )
{
- // Retrieve all the existing scene holders
- Dali::SceneHolderList sceneHolders = Adaptor::Get().GetSceneHolders();
- for( auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter )
+ // Retrieve all the existing widnows
+ Dali::WindowContainer windows = Adaptor::Get().GetWindows();
+ for ( auto iter = windows.begin(); iter != windows.end(); ++iter )
{
- ( *iter ).KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent );
- ( *iter ).TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
- Dali::Window window = DevelWindow::DownCast( *iter );
- if( window )
- {
- window.FocusChangeSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnWindowFocusChanged);
- }
+ DevelWindow::KeyEventSignal( *iter ).Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
+ DevelWindow::TouchSignal( *iter ).Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch);
}
- // Get notified when any new scene holder is created afterwards
- Adaptor::Get().WindowCreatedSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnSceneHolderCreated );
+ // Get notified when any new window is created afterwards
+ Adaptor::Get().WindowCreatedSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnWindowCreated);
}
}
-void KeyboardFocusManager::OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder )
+void KeyboardFocusManager::OnWindowCreated( Dali::Window& window )
{
- sceneHolder.KeyEventSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent );
- sceneHolder.TouchSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch );
- Dali::Window window = DevelWindow::DownCast( sceneHolder );
- if( window )
- {
- window.FocusChangeSignal().Connect( mSlotDelegate, &KeyboardFocusManager::OnWindowFocusChanged);
- }
+ DevelWindow::KeyEventSignal( window ).Connect( mSlotDelegate, &KeyboardFocusManager::OnKeyEvent);
+ DevelWindow::TouchSignal( window ).Connect( mSlotDelegate, &KeyboardFocusManager::OnTouch);
}
KeyboardFocusManager::~KeyboardFocusManager()
namespace Dali
{
-namespace Integration
-{
-
-class SceneHolder;
-
-} // namespace Integration
+class Window;
namespace Toolkit
{
void OnAdaptorInit();
/**
- * This will be called when a new scene holder is created
- * @param sceneHolder The new scene holder
+ * This will be called when a new wndow is created
+ * @param window The new window
*/
- void OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder );
+ void OnWindowCreated( Dali::Window& window );
/**
* Get configuration from StyleManager.
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/common/stage.h>
#include <dali/devel-api/common/stage-devel.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
#include <dali/integration-api/adaptors/adaptor.h>
-#include <dali/integration-api/adaptors/scene-holder.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
mCurrentFocusControl()
{
// Retrieve all the existing widnows
- Dali::SceneHolderList sceneHolders = Adaptor::Get().GetSceneHolders();
- for( auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter )
+ Dali::WindowContainer windows = Adaptor::Get().GetWindows();
+ for ( auto iter = windows.begin(); iter != windows.end(); ++iter )
{
- ( *iter ).KeyEventGeneratedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnKeyEvent );
+ DevelWindow::KeyEventGeneratedSignal( *iter ).Connect( mSlotDelegate, &KeyInputFocusManager::OnKeyEvent);
}
- // Get notified when any new scene holder is created afterwards
- Adaptor::Get().WindowCreatedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnSceneHolderCreated );
+ // Get notified when any new window is created afterwards
+ Adaptor::Get().WindowCreatedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnWindowCreated);
}
KeyInputFocusManager::~KeyInputFocusManager()
{
}
-void KeyInputFocusManager::OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder )
+void KeyInputFocusManager::OnWindowCreated( Dali::Window& window )
{
- sceneHolder.KeyEventGeneratedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnKeyEvent );
+ DevelWindow::KeyEventGeneratedSignal( window ).Connect( mSlotDelegate, &KeyInputFocusManager::OnKeyEvent);
}
void KeyInputFocusManager::SetFocus( Toolkit::Control control )
namespace Dali
{
-namespace Integration
-{
-
-class SceneHolder;
-
-} // namespace Integration
+class Window;
namespace Toolkit
{
private:
/**
- * This will be called when a new scene holder is created
- * @param sceneHolder The new scene holder
+ * This will be called when a new window is created
+ * @param window The new window
*/
- void OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder );
+ void OnWindowCreated( Dali::Window& window );
/**
* Callback for the key event when no actor in the stage has gained the key input focus