* Can receive a surface where to render as a parameter.
The surface can be created outside a DALi application and
be passed to DALi to render on it.
Change-Id: Ia0c582be359972ea93a8cae064710cea1161b07e
Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
namespace DevelWindow
{
+Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent)
+{
+ return DevelWindow::New(surface, windowPosition, name, "", isTransparent);
+}
+
+Window New(Any surface, PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent)
+{
+ Window newWindow;
+
+ const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
+ bool isNewWindowAllowed = true;
+
+ if (isAdaptorAvailable)
+ {
+ Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+ isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
+ }
+
+ if (isNewWindowAllowed)
+ {
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, isTransparent);
+
+ Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
+ if (isAdaptorAvailable)
+ {
+ Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+ Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent);
+ }
+ newWindow = Window(window);
+ }
+ else
+ {
+ DALI_LOG_ERROR("This device can't support multiple windows.\n");
+ }
+
+ return newWindow;
+}
+
void SetPositionSize( Window window, PositionSize positionSize )
{
GetImplementation( window ).SetPositionSize( positionSize );
typedef Signal< void (Window, EffectState, EffectType) > TransitionEffectEventSignalType; ///< Effect signal type and state
/**
+ * @brief Creates an initialized handle to a new Window.
+ *
+ * @param[in] surface Can be a window or pixmap.
+ * @param[in] windowPosition The position and size of the Window
+ * @param[in] name The Window title
+ * @param[in] isTransparent Whether Window is transparent
+ * @return A new window
+ * @note This creates an extra window in addition to the default main window
+*/
+DALI_ADAPTOR_API Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent = false);
+
+/**
+ * @brief Creates an initialized handle to a new Window.
+ *
+ * @param[in] surface Can be a window or pixmap.
+ * @param[in] windowPosition The position and size of the Window
+ * @param[in] name The Window title
+ * @param[in] className The Window class name
+ * @param[in] isTransparent Whether Window is transparent
+ * @note This creates an extra window in addition to the default main window
+ * @return A new Window
+ */
+DALI_ADAPTOR_API Window New(Any surface, PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
+
+/**
* @brief Sets position and size of the window. This API guarantees that both moving and resizing of window will appear on the screen at once.
*
* @param[in] window The window instance
const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( mWindowPositionSize, mMainWindowName, windowClassName, mMainWindowMode == Dali::Application::TRANSPARENT );
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mMainWindowMode == Dali::Application::TRANSPARENT);
mMainWindow = Dali::Window( window );
// Quit the application when the window is closed
// just for backward compatibility to make the test case pass
if ( mMainWindowReplaced )
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( PositionSize(), "ReplacedWindow", "", false );
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(PositionSize(), "ReplacedWindow", "", false);
return Dali::Window( window );
}
else
} // unnamed namespace
-Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
+Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+{
+ Any surface;
+ return Window::New(surface, positionSize, name, className, isTransparent);
+}
+
+Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize( positionSize, name, className );
+ window->Initialize(surface, positionSize, name, className);
return window;
}
}
}
-void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
+void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className)
{
// Create a window render surface
- Any surface;
auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
mWindowSurface = static_cast<WindowRenderSurface*>( mSurface.get() );
typedef Signal< void () > SignalType;
/**
- * Create a new Window. This should only be called once by the Application class
+ * @brief Create a new Window. This should only be called once by the Application class
* @param[in] positionSize The position and size of the window
* @param[in] name The window title
* @param[in] className The window class name
static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
/**
+ * @brief Create a new Window. This should only be called once by the Application class
+ * @param[in] surface The surface used to render on.
+ * @param[in] positionSize The position and size of the window
+ * @param[in] name The window title
+ * @param[in] className The window class name
+ * @param[in] isTransparent Whether window is transparent
+ * @return A newly allocated Window
+ */
+ static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
+
+ /**
* @copydoc Dali::Window::ShowIndicator()
*/
void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode );
/**
* Second stage initialization
*/
- void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
+ void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className);
/**
* Called when the window becomes iconified or deiconified.