windowPosition = PositionSize( 0, 0, mEnvironmentOptions.GetWindowWidth(), mEnvironmentOptions.GetWindowHeight() );
}
- mWindow = Dali::Window::New( windowPosition, mName, mWindowMode == Dali::Application::TRANSPARENT );
-
- // Set the window class name if available
const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
- if( ! windowClassName.empty() )
- {
- mWindow.SetClass( mName, windowClassName );
- }
+ mWindow = Dali::Window::New( windowPosition, mName, windowClassName, mWindowMode == Dali::Application::TRANSPARENT );
}
void Application::CreateAdaptor()
* Create a new Window. This should only be called once by the Application class
* @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
* @return A newly allocated Window
*/
- static Window* New(const PositionSize& posSize, const std::string& name, bool isTransparent = false);
+ static Window* New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent = false);
/**
* Pass the adaptor back to the overlay. This allows the window to access Core's overlay.
/**
* Second stage initialization
*/
- void Initialize(const PositionSize& posSize, const std::string& name);
+ void Initialize(const PositionSize& posSize, const std::string& name, const std::string& className);
/**
* Shows / hides the indicator bar.
namespace Dali
{
-Window Window::New(PositionSize posSize, const std::string name, bool isTransparent)
+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* window = Internal::Adaptor::Window::New(posSize, 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);
return Window(window);
}
* @param[in] isTransparent Whether window is transparent
* @return a new window
*/
- static Window New(PositionSize windowPosition, std::string name, bool isTransparent = false);
+ static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
+
+ /**
+ * @brief Create an initialized handle to a new Window.
+ * @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
+ * @return a new window
+ */
+ static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
/**
* @brief Create an uninitalized handle.
};
-Window* Window::New(const PositionSize& posSize, const std::string& name, bool isTransparent)
+Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name);
+ window->Initialize(posSize, name, className);
return window;
}
delete mSurface;
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name)
+void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
{
// create an Wayland window by default
Any surface;
ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+ SetClass( name, className );
windowSurface->Map();
mSurface = windowSurface;
};
-Window* Window::New(const PositionSize& posSize, const std::string& name, bool isTransparent)
+Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(posSize, name);
+ window->Initialize(posSize, name, className);
return window;
}
delete mSurface;
}
-void Window::Initialize(const PositionSize& windowPosition, const std::string& name)
+void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
{
// create an X11 window by default
Any surface;
ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
+ SetClass( name, className );
windowSurface->Map();
mSurface = windowSurface;
DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
}
+ // Attempt to create a new window
+ try
+ {
+ PositionSize windowPosition(0, 0, 0, 0);
+ Dali::Window window = Dali::Window::New( windowPosition, "test-window", "test-window-class", true );
+
+ tet_result( TET_FAIL );
+ }
+ catch ( DaliException& e )
+ {
+ DALI_TEST_ASSERT( e, "Failed to create X window", TEST_LOCATION );
+ }
+
END_TEST;
}