/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return Internal::Adaptor::GetImplementation( application ).AddIdle( callback, true );
}
-Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode )
-{
- auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
-
- Dali::Window childWindow = Dali::Window::New( childPosSize, childWindowName, childWindowClassName, childWindowMode );
- Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &childWindow, childWindowName, childWindowClassName, childWindowMode );
- return childWindow;
-}
-
-bool DestroyWindow( Application application, Dali::Window* childWindow )
-{
- auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
-
- return Internal::Adaptor::Adaptor::GetImplementation( adaptor ).RemoveWindow( childWindow );
-}
-
-bool DestroyWindow( Application application, const std::string& childWindowName )
-{
- auto& adaptor = Internal::Adaptor::GetImplementation( application ).GetAdaptor();
-
- return Internal::Adaptor::Adaptor::GetImplementation( adaptor ).RemoveWindow( childWindowName );
-}
-
std::string GetDataPath()
{
return Internal::Adaptor::Application::GetDataPath();
#define DALI_APPLICATION_DEVEL_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DALI_ADAPTOR_API bool AddIdleWithReturnValue( Application application, CallbackBase* callback );
/**
- * @brief Create and Add a child window to the application instance
- * @param[in] application A handle to the Application
- * @param[in] childPosSize The position and size of the child window to be created
- * @param[in] childWindowName The title of the child window
- * @param[in] childWindowClassName The class name of the child window
- * @param[in] childWindowMode The mode of the newly created child window
- * @return @c a window handle if added successfully, @c null otherwise
- *
- * @note Function must be called from main event thread only
- */
-DALI_ADAPTOR_API Dali::Window CreateWindow( Application application, PositionSize childPosSize, const std::string& childWindowName, const std::string& childWindowClassName, bool childWindowMode );
-
-/**
- * @brief Removes a previously created Window instance from the Adaptor internal list
- * @note Function must be called from the main event thread only.
- * @param[in] application A handle to the Application
- * @param[in] childWindow The created Window instance
- * @return true if removed successfully, false otherwise
- */
-DALI_ADAPTOR_API bool DestroyWindow( Application application, Dali::Window* childWindow );
-
-/**
- * @brief Removes a previously created Window instance from the Adaptor internal list
- * @note Function must be called from the main event thread only.
- * @param[in] application A handle to the Application
- * @param[in] childWindowName The title of the window
- * @return true if removed successfully, false otherwise
- */
-DALI_ADAPTOR_API bool DestroyWindow( Application application, const std::string& childWindowName );
-
-/**
* @brief Gets the absolute path to the application's data directory which is used to store private data of the application.
* @return The absolute path to the application's data directory
*/
}
const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
- mMainWindow = Dali::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
GetImplementation( mMainWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
{
// Changed to return a different window handle after ReplaceWindow is called
// just for backward compatibility to make the test case pass
- return mMainWindowReplaced ? Dali::Window::New( PositionSize(), "ReplacedWindow" ) : mMainWindow;
+ if ( mMainWindowReplaced )
+ {
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( PositionSize(), "ReplacedWindow", "", false );
+ return Dali::Window( window );
+ }
+ else
+ {
+ return mMainWindow;
+ }
}
// Stereoscopy
Window Window::New(PositionSize posSize, const std::string& name, bool isTransparent)
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
+ Internal::Adaptor::Window* windowImpl = Internal::Adaptor::Window::New(posSize, name, "", isTransparent);
+
+ Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+ Dali::Window window = Dali::Window( windowImpl );
+ Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &window, name, "", isTransparent );
+
return Window(window);
}
Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
+ Internal::Adaptor::Window* windowImpl = Internal::Adaptor::Window::New(posSize, name, className, isTransparent);
+
+ Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
+ Dali::Window window = Dali::Window( windowImpl );
+ Internal::Adaptor::Adaptor::GetImplementation( adaptor ).AddWindow( &window, name, className, isTransparent );
+
return Window(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
*/
static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
* @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
*/
static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);