#include <dali/public-api/common/stage.h>
#include <dali/public-api/object/base-object.h>
+#define DALI_WINDOW_H
+#include <dali/integration-api/adaptors/adaptor.h>
+#include <toolkit-adaptor-impl.h>
+
// INTERNAL INCLUDES
#include "test-render-surface.h"
+using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
+
namespace Dali
{
public:
Window( const PositionSize& positionSize )
- : mScene( Dali::Integration::Scene::New( Size( positionSize.width, positionSize.height ) ) ),
- mRenderSurface( new TestRenderSurface( positionSize ) )
+ : mRenderSurface( positionSize ),
+ mScene( Dali::Integration::Scene::New( mRenderSurface ) )
{
- mScene.SetSurface( *mRenderSurface );
}
- virtual ~Window()
- {
- delete mRenderSurface;
- mRenderSurface = nullptr;
- }
+ 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;
- TestRenderSurface* mRenderSurface;
};
} // Adaptor
Dali::Window Window::New( PositionSize windowPosition, const std::string& name, bool isTransparent )
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( windowPosition, name, "", isTransparent );
- return Window( window );
+ return New( windowPosition, name, "", isTransparent );
}
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 newWindow = Window( window );
+ Dali::Adaptor::WindowCreatedSignalType& windowCreatedSignal = AdaptorImpl::Get().WindowCreatedSignal();
+ windowCreatedSignal.Emit( newWindow );
return Window( window );
}
Integration::RenderSurface& Window::GetRenderSurface()
{
- return *GetImplementation( *this ).mRenderSurface;
+ return GetImplementation( *this ).mRenderSurface;
}
namespace DevelWindow
return GetImplementation( window ).mScene.KeyEventSignal();
}
+KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window )
+{
+ return GetImplementation( window ).mScene.KeyEventGeneratedSignal();
+}
+
TouchSignalType& TouchSignal( Window window )
{
return GetImplementation( window ).mScene.TouchSignal();
{
return GetImplementation( window ).mScene.WheelEventSignal();
}
-
} // namespace DevelWindow
} // Dali