Use WindowData in the constructors of Application and Window 81/294081/9
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Mon, 12 Jun 2023 04:30:59 +0000 (13:30 +0900)
committerDaekwang Ryu <dkdk.ryu@samsung.com>
Wed, 28 Jun 2023 00:38:00 +0000 (09:38 +0900)
This patch makes Internal Application and Window use WindowData.
This doesn't affect existing APIs.
We don't need to add a New function in the Application anymore because of new parameter of Window.

Change-Id: I7d211232f88ec1b3d6eaf6519dc61c79edb2c8ac

28 files changed:
dali/devel-api/adaptor-framework/application-devel.cpp
dali/devel-api/adaptor-framework/window-devel.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/adaptor/tizen-wayland/component-application-impl.cpp
dali/internal/adaptor/tizen-wayland/component-application-impl.h
dali/internal/adaptor/tizen-wayland/component-application.cpp
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h
dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp
dali/internal/system/android/widget-application-impl-android.cpp
dali/internal/system/android/widget-application-impl-android.h
dali/internal/system/common/widget-application-impl.cpp
dali/internal/system/common/widget-application-impl.h
dali/internal/system/macos/widget-application-impl-mac.cpp
dali/internal/system/macos/widget-application-impl-mac.h
dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp
dali/internal/system/tizen-wayland/widget-application-impl-tizen.h
dali/internal/system/ubuntu-x11/widget-application-impl-x.cpp
dali/internal/system/ubuntu-x11/widget-application-impl-x.h
dali/internal/system/windows/widget-application-impl-win.cpp
dali/internal/system/windows/widget-application-impl-win.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/public-api/adaptor-framework/application.cpp
dali/public-api/adaptor-framework/widget-application.cpp
dali/public-api/adaptor-framework/window.cpp
dali/public-api/adaptor-framework/window.h

index 886620a5ac7abb1d3ccb900a5152bf936c04388d..11ab483c39e8c35d03b55ea97d0ac70fb18e3d7e 100644 (file)
@@ -38,14 +38,19 @@ Application New(int* argc, char** argv[], const std::string& stylesheet, Applica
     internal->SetCommandLineOptions(argc, argv);
     internal->SetStyleSheet(stylesheet);
 
-    internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
+    internal->GetWindow().SetTransparency((windowMode == Application::TRANSPARENT));
 
-    //Store only the value before adaptor is created
+    // Store only the value before adaptor is created
     internal->StoreWindowPositionSize(positionSize);
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, type, false);
+    WindowData windowData;
+    windowData.SetPositionSize(positionSize);
+    windowData.SetTransparency(windowMode == Application::TRANSPARENT);
+    windowData.SetWindowType(type);
+
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData);
   }
   return Application(internal.Get());
 }
index 897ea9f29bbb9156b020f23bc1da463dab2a3f40..f39033d3831e57ae39c5ae83aed4968e26ad1ba9 100644 (file)
@@ -48,7 +48,11 @@ Window New(Any surface, PositionSize windowPosition, const std::string& name, co
 
   if(isNewWindowAllowed)
   {
-    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, WindowType::NORMAL, isTransparent);
+    WindowData windowData;
+    windowData.SetPositionSize(windowPosition);
+    windowData.SetTransparency(isTransparent);
+    windowData.SetWindowType(WindowType::NORMAL);
+    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, name, className, windowData);
 
     Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
     if(isAdaptorAvailable)
index 5fb0f6f7abd9de86639bb7af5a01291815342ee3..d6afc6d91b71ba9ccf7effbc8adc704b475eb2b6 100644 (file)
@@ -64,16 +64,14 @@ DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_APPLICATION, true);
 ApplicationPtr Application::gPreInitializedApplication(NULL);
 
 ApplicationPtr Application::New(
-  int*                           argc,
-  char**                         argv[],
-  const std::string&             stylesheet,
-  Dali::Application::WINDOW_MODE windowMode,
-  const PositionSize&            positionSize,
-  Framework::Type                applicationType,
-  WindowType                     type,
-  bool                           useUiThread)
-{
-  ApplicationPtr application(new Application(argc, argv, stylesheet, windowMode, positionSize, applicationType, type, useUiThread));
+  int*               argc,
+  char**             argv[],
+  const std::string& stylesheet,
+  Framework::Type    applicationType,
+  bool               useUiThread,
+  const WindowData&  windowData)
+{
+  ApplicationPtr application(new Application(argc, argv, stylesheet, applicationType, useUiThread, windowData));
   return application;
 }
 
@@ -82,14 +80,14 @@ void Application::PreInitialize(int* argc, char** argv[])
   if(!gPreInitializedApplication)
   {
     Dali::TextAbstraction::FontClientPreInitialize();
-
-    gPreInitializedApplication                  = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL, WindowType::NORMAL, false);
+    WindowData windowData;
+    gPreInitializedApplication                  = new Application(argc, argv, "", Framework::NORMAL, false, windowData);
     gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED;
     gPreInitializedApplication->CreateWindow(); // Only create window
   }
 }
 
-Application::Application(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type, bool useUiThread)
+Application::Application(int* argc, char** argv[], const std::string& stylesheet, Framework::Type applicationType, bool useUiThread, const WindowData& windowData)
 : mInitSignal(),
   mTerminateSignal(),
   mPauseSignal(),
@@ -104,12 +102,12 @@ Application::Application(int* argc, char** argv[], const std::string& stylesheet
   mAdaptor(nullptr),
   mEnvironmentOptions(nullptr),
   mMainWindow(),
-  mMainWindowMode(windowMode),
+  mMainWindowMode(windowData.GetTransparency() ? WINDOW_MODE::TRANSPARENT : WINDOW_MODE::OPAQUE),
   mMainWindowName(),
   mStylesheet(stylesheet),
-  mWindowPositionSize(positionSize),
+  mWindowPositionSize(windowData.GetPositionSize()),
   mLaunchpadState(Launchpad::NONE),
-  mDefaultWindowType(type),
+  mDefaultWindowType(windowData.GetWindowType()),
   mUseUiThread(useUiThread),
   mSlotDelegate(this)
 {
@@ -208,6 +206,9 @@ void Application::ChangePreInitializedWindowInfo()
 void Application::CreateWindow()
 {
   Internal::Adaptor::Window* window;
+  WindowData                 windowData;
+  windowData.SetTransparency(mMainWindowMode);
+  windowData.SetWindowType(mDefaultWindowType);
 
   WindowSystem::Initialize();
 
@@ -236,13 +237,15 @@ void Application::CreateWindow()
       mMainWindowName = windowName;
     }
 
-    window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
+    windowData.SetPositionSize(mWindowPositionSize);
+    window = Internal::Adaptor::Window::New(mMainWindowName, windowClassName, windowData);
   }
   else
   {
     // The position, size and the window name of the pre-initialized application will be updated in ChangePreInitializedWindowInfo()
     // when the real application is launched.
-    window = Internal::Adaptor::Window::New(mWindowPositionSize, "", "", mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
+    windowData.SetPositionSize(mWindowPositionSize);
+    window = Internal::Adaptor::Window::New("", "", windowData);
   }
 
   mMainWindow = Dali::Window(window);
index a881314226445f8a96bac0e2743e715a871f54b7..6eeb016742c6bcbd714a967399fe3adb3211e081 100644 (file)
@@ -78,13 +78,12 @@ public:
    * @param[in]  argc              A pointer to the number of arguments
    * @param[in]  argv              A pointer to the argument list
    * @param[in]  stylesheet        The path to user defined theme file
-   * @param[in]  windowMode        A member of Dali::Application::WINDOW_MODE
-   * @param[in]  positionSize      A position and a size of the window
    * @param[in]  applicationType   A member of Dali::Framework::Type
-   * @param[in]  type              It is window type for default window.
    * @param[in]  useUiThread       True if the application would create a UI thread
+   * @param[in]  windowData        The window data
+   *
    */
-  static ApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type, bool useUiThread);
+  static ApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, Framework::Type applicationType, bool useUiThread, const WindowData& windowData);
 
   /**
    * @copydoc Dali::DevelApplication::PreInitialize()
@@ -459,13 +458,11 @@ protected:
    * @param[in]  argc               A pointer to the number of arguments
    * @param[in]  argv               A pointer to the argument list
    * @param[in]  stylesheet         The path to user defined theme file
-   * @param[in]  windowMode         A member of Dali::Application::WINDOW_MODE
-   * @param[in]  positionSize       A position and a size of the window
    * @param[in]  applicationType    A member of Dali::Framework::Type
-   * @param[in]  type               The default window's type.
-   * @param[in]  useUiThread         True if the application would create UI thread
+   * @param[in]  useUiThread        True if the application would create UI thread
+   * @param[in]  windowData         The WindowData
    */
-  Application(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type, bool useUiThread);
+  Application(int* argc, char** argv[], const std::string& stylesheet, Framework::Type applicationType, bool useUiThread, const WindowData& windowData);
 
   /**
    * Destructor
index 09f3aa4bf2bb03eda8e12009cd7876c5f9e61844..b69a99fc56939b99e69b711f676f6e4f6dac17f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -25,17 +25,17 @@ namespace Internal
 namespace Adaptor
 {
 ComponentApplicationPtr ComponentApplication::New(
-  int*                           argc,
-  char**                         argv[],
-  const std::string&             stylesheet,
-  Dali::Application::WINDOW_MODE windowMode)
+  int*               argc,
+  char**             argv[],
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  ComponentApplicationPtr application(new ComponentApplication(argc, argv, stylesheet, windowMode));
+  ComponentApplicationPtr application(new ComponentApplication(argc, argv, stylesheet, windowData));
   return application;
 }
 
-ComponentApplication::ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode)
-: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::COMPONENT, WindowType::NORMAL, false)
+ComponentApplication::ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: Application(argc, argv, stylesheet, Framework::COMPONENT, false, windowData)
 {
 }
 
index b84104bad4cce11fcffdf62d06b8fe6146d6f186..10b7fb054dac890e2a51b32d25622f221cede673 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_COMPONENT_APPLICATION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -47,15 +47,15 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
-   * @param[in]  windowMode   A member of WINDOW_MODE
+   * @param[in]  windowData   The window data
    * @return A handle to the ComponentApplication
    */
-  static ComponentApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode);
+  static ComponentApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * @brief The default constructor.
    */
-  ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode);
+  ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * @brief Undefined copy constructor.
index a04f8a3397cfea3a6dc4e7214f8ac4d4085291a7..9c790c69e83a9221f2b3208ab9cc192ae8cfbaa0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -35,7 +35,10 @@ ComponentApplication ComponentApplication::New(int* argc, char** argv[])
 
 ComponentApplication ComponentApplication::New(int* argc, char** argv[], const std::string& stylesheet)
 {
-  Internal::Adaptor::ComponentApplicationPtr internal = Internal::Adaptor::ComponentApplication::New(argc, argv, stylesheet, TRANSPARENT);
+  WindowData windowData;
+  windowData.SetTransparency(true);
+
+  Internal::Adaptor::ComponentApplicationPtr internal = Internal::Adaptor::ComponentApplication::New(argc, argv, stylesheet, windowData);
   return ComponentApplication(internal.Get());
 }
 
index 7f7a7f1c1639d85c17b3de7225f39250dbb36633..49d06f6e0d3f783de70c5dd15873b496004a8fe3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -40,17 +40,17 @@ unsigned int GetEnvWatchRenderRefreshRate()
 } // unnamed namespace
 
 WatchApplicationPtr WatchApplication::New(
-  int*                                argc,
-  char**                              argv[],
-  const std::string&                  stylesheet,
-  Dali::WatchApplication::WINDOW_MODE windowMode)
+  int*               argc,
+  char**             argv[],
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  WatchApplicationPtr watch(new WatchApplication(argc, argv, stylesheet, windowMode));
+  WatchApplicationPtr watch(new WatchApplication(argc, argv, stylesheet, windowData));
   return watch;
 }
 
-WatchApplication::WatchApplication(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode)
-: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH, WindowType::NORMAL, false),
+WatchApplication::WatchApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: Application(argc, argv, stylesheet, Framework::WATCH, false, windowData),
   mState(UNINITIALIZED)
 {
 }
index dbae797b5b9fc16c28df05478a801acc79a6b71f..6079d6417ca7090448a7266cec49e139047543d4 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WATCH_APPLICATION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -56,18 +56,18 @@ public:
    * @param[in]  argc        A pointer to the number of arguments
    * @param[in]  argv        A pointer to the argument list
    * @param[in]  stylesheet  The path to user defined theme file
-   * @param[in]  windowMode  A member of Dali::Watch::WINDOW_MODE
+   * @param[in]  windowData  The window data
    */
-  static WatchApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode);
+  static WatchApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Private Constructor
    * @param[in]  argc        A pointer to the number of arguments
    * @param[in]  argv        A pointer to the argument list
    * @param[in]  stylesheet  The path to user defined theme file
-   * @param[in]  windowMode  A member of Dali::Watch::WINDOW_MODE
+   * @param[in]  windowData  The window data
    */
-  WatchApplication(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode);
+  WatchApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Destructor
index 9827e3725e9979f8f8f7fcde959b974f7f7388cc..cd0cf6f687c3d780443dd22b19e38526f5cf1d37 100644 (file)
@@ -33,13 +33,17 @@ WatchApplication WatchApplication::New()
 
 WatchApplication WatchApplication::New(int* argc, char** argv[])
 {
-  Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, "", OPAQUE);
+  WindowData windowData;
+  windowData.SetTransparency(false);
+  Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, "", windowData);
   return WatchApplication(internal.Get());
 }
 
 WatchApplication WatchApplication::New(int* argc, char** argv[], const std::string& stylesheet)
 {
-  Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, stylesheet, OPAQUE);
+  WindowData windowData;
+  windowData.SetTransparency(false);
+  Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, stylesheet, windowData);
   return WatchApplication(internal.Get());
 }
 
index 65d95a63c48ff39b0a3982caab15e365ef6d27fc..6686c62ea92cf22a764bb475b53ea8049b953c25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -28,13 +28,14 @@ namespace Adaptor
 WidgetApplicationPtr WidgetApplicationAndroid::New(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  return new WidgetApplicationAndroid(argc, argv, stylesheet);
+  return new WidgetApplicationAndroid(argc, argv, stylesheet, windowData);
 }
 
-WidgetApplicationAndroid::WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet)
-: WidgetApplication(argc, argv, stylesheet)
+WidgetApplicationAndroid::WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: WidgetApplication(argc, argv, stylesheet, windowData)
 {
   DALI_LOG_ERROR("WidgetApplication is not implemented in Android profile.\n");
 }
@@ -53,10 +54,11 @@ namespace WidgetApplicationFactory
  * @param[in]  argc         A pointer to the number of arguments
  * @param[in]  argv         A pointer to the argument list
  * @param[in]  stylesheet   The path to user defined theme file
+ * @param[in]  windowData   The window data
  */
-WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet)
+WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
 {
-  return WidgetApplicationAndroid::New(argc, argv, stylesheet);
+  return WidgetApplicationAndroid::New(argc, argv, stylesheet, windowData);
 }
 
 } // namespace WidgetApplicationFactory
index 7e93d98c37dcae5147d8f57d5858855350fd5f49..22fe8c859e01a4d95fd38a1d2dc5826c0e2fbb8c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_ANDROID_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -45,8 +45,9 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet);
+  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
 public:
   /**
@@ -60,8 +61,9 @@ protected:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet);
+  WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Destructor
index 5c7aef68245cde3474c1ee11722b1635ad6f7b12..0586aca82e681f09d8b900663643ef3307655307 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -33,22 +33,24 @@ namespace WidgetApplicationFactory
  * @param[in]  argc         A pointer to the number of arguments
  * @param[in]  argv         A pointer to the argument list
  * @param[in]  stylesheet   The path to user defined theme file
+ * @param[in]  windowData   The window data
  */
-WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet);
+WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
 } // namespace WidgetApplicationFactory
 
 WidgetApplicationPtr WidgetApplication::New(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  //WidgetApplicationPtr //widgetApplication( new WidgetApplication (argc, argv, stylesheet ) );
-  return WidgetApplicationFactory::Create(argc, argv, stylesheet);
+  // WidgetApplicationPtr //widgetApplication( new WidgetApplication (argc, argv, stylesheet ) );
+  return WidgetApplicationFactory::Create(argc, argv, stylesheet, windowData);
 }
 
-WidgetApplication::WidgetApplication(int* argc, char** argv[], const std::string& stylesheet)
-: Application(argc, argv, stylesheet, Dali::WidgetApplication::OPAQUE, PositionSize(), Framework::WIDGET, WindowType::NORMAL, false)
+WidgetApplication::WidgetApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: Application(argc, argv, stylesheet, Framework::WIDGET, false, windowData)
 {
   DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n");
 }
index 32079ca1bffaedc016327fec9dabbfb0864505ff..3e0274aa7b1e2c202be09905758ff676594ad144 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -48,8 +48,9 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet);
+  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
 public:
   /**
@@ -64,7 +65,7 @@ protected:
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
    */
-  WidgetApplication(int* argc, char** argv[], const std::string& stylesheet);
+  WidgetApplication(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Destructor
index 4bc9bc92974c91a77ba512dac2e64fc21de671ce..27cd69322a949754cedbec4e704e061d867d5c49 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -28,16 +28,18 @@ namespace Adaptor
 WidgetApplicationPtr WidgetApplicationCocoa::New(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  return new WidgetApplicationCocoa(argc, argv, stylesheet);
+  return new WidgetApplicationCocoa(argc, argv, stylesheet, windowData);
 }
 
 WidgetApplicationCocoa::WidgetApplicationCocoa(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
-: WidgetApplication(argc, argv, stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
+: WidgetApplication(argc, argv, stylesheet, windowData)
 {
   DALI_LOG_ERROR("WidgetApplication is not implemented in MACOS profile.\n");
 }
@@ -60,10 +62,11 @@ namespace WidgetApplicationFactory
  * @param[in]  argc         A pointer to the number of arguments
  * @param[in]  argv         A pointer to the argument list
  * @param[in]  stylesheet   The path to user defined theme file
+ * @param[in]  windowData   The window data
  */
-WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet)
+WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
 {
-  return WidgetApplicationCocoa::New(argc, argv, stylesheet);
+  return WidgetApplicationCocoa::New(argc, argv, stylesheet, windowData);
 }
 
 } // namespace WidgetApplicationFactory
index 444933cd8ec6cac5327a077358848fe3b4ae2475..7f5dbf4e7402d6d4d37e1fb7c747518c405e05f1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_WIN_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -49,11 +49,13 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
   static WidgetApplicationPtr New(
     int*               argc,
     char**             argv[],
-    const std::string& stylesheet);
+    const std::string& stylesheet,
+    const WindowData&  windowData);
 
 public:
   /**
@@ -69,8 +71,9 @@ protected:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  WidgetApplicationCocoa(int* argc, char** argv[], const std::string& stylesheet);
+  WidgetApplicationCocoa(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Destructor
index 2faa238d6b6cc6d9666da61b5199bbbd569a99f1..bd76bf4ab72e458fd7ff4622e526cb3e667d7f14 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
 #include <dali/internal/system/tizen-wayland/widget-application-impl-tizen.h>
 
 // INTERNAL INCLUDE
+#include <dali/devel-api/events/key-event-devel.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
 #include <dali/internal/system/common/environment-variables.h>
 #include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
 #include <dali/public-api/adaptor-framework/widget-impl.h>
 #include <dali/public-api/adaptor-framework/widget.h>
-#include <dali/devel-api/events/key-event-devel.h>
 
 // EXTERNAL INCLUDES
 #include <bundle.h>
@@ -42,7 +42,7 @@ namespace
  * Finally widget framework receive feedback from widget.
  */
 #ifdef OVER_TIZEN_VERSION_7
-bool OnKeyEventCallback(const char *id, screen_connector_event_type_e eventType, int keyCode, const char *keyName, long long cls, long long subcls, const char* identifier, long long timestamp, void *userData)
+bool OnKeyEventCallback(const char* id, screen_connector_event_type_e eventType, int keyCode, const char* keyName, long long cls, long long subcls, const char* identifier, long long timestamp, void* userData)
 {
   Dali::Internal::Adaptor::WidgetApplicationTizen* application = static_cast<Dali::Internal::Adaptor::WidgetApplicationTizen*>(userData);
 
@@ -57,13 +57,13 @@ bool OnKeyEventCallback(const char *id, screen_connector_event_type_e eventType,
     state = Dali::KeyEvent::UP;
   }
 
-  bool consumed = true;
-  std::string keyEventName = std::string(keyName);
-  Dali::KeyEvent event = Dali::DevelKeyEvent::New(keyEventName, "", "", keyCode, 0, timestamp, state, "", "", Device::Class::NONE, Device::Subclass::NONE);
+  bool           consumed     = true;
+  std::string    keyEventName = std::string(keyName);
+  Dali::KeyEvent event        = Dali::DevelKeyEvent::New(keyEventName, "", "", keyCode, 0, timestamp, state, "", "", Device::Class::NONE, Device::Subclass::NONE);
 
   if(application)
   {
-    std::string widgetId = std::string(id);
+    std::string            widgetId       = std::string(id);
     widget_base_instance_h instanceHandle = application->GetWidgetInstanceFromWidgetId(widgetId);
     if(instanceHandle)
     {
@@ -265,13 +265,14 @@ namespace Adaptor
 WidgetApplicationPtr WidgetApplicationTizen::New(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  return new WidgetApplicationTizen(argc, argv, stylesheet);
+  return new WidgetApplicationTizen(argc, argv, stylesheet, windowData);
 }
 
-WidgetApplicationTizen::WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet)
-: WidgetApplication(argc, argv, stylesheet),
+WidgetApplicationTizen::WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: WidgetApplication(argc, argv, stylesheet, windowData),
   mConnectedKeyEvent(false),
   mReceivedKeyEvent(false)
 {
@@ -390,7 +391,7 @@ void WidgetApplicationTizen::ConnectKeyEvent(Dali::Window window)
 
 void WidgetApplicationTizen::OnWindowKeyEvent(const Dali::KeyEvent& event)
 {
-  //If Widget Application consume key event, this api is not called.
+  // If Widget Application consume key event, this api is not called.
   mReceivedKeyEvent = true;
 }
 
@@ -436,10 +437,11 @@ namespace WidgetApplicationFactory
  * @param[in]  argc         A pointer to the number of arguments
  * @param[in]  argv         A pointer to the argument list
  * @param[in]  stylesheet   The path to user defined theme file
+ * @param[in]  windowData   The window data
  */
-Dali::Internal::Adaptor::WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet)
+Dali::Internal::Adaptor::WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
 {
-  return WidgetApplicationTizen::New(argc, argv, stylesheet);
+  return WidgetApplicationTizen::New(argc, argv, stylesheet, windowData);
 }
 
 } // namespace WidgetApplicationFactory
index 80166bd0468d5270cd64f4cccff74e55ccd25ea7..8b20e8042a5b9977402568dc97415efdf4cec443 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_TIZEN_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -19,8 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <widget_base.h>
 #include <screen_connector_provider.h>
+#include <widget_base.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/window-devel.h>
@@ -52,8 +52,9 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet);
+  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
 public:
   /**
@@ -136,8 +137,9 @@ protected:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet);
+  WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Destructor
index 7502746f937640b31a93121150f17ef30ff91f48..a0ca7c4e1e4fb4226cfa9d8fa2e7f2a1879a60ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -28,13 +28,14 @@ namespace Adaptor
 WidgetApplicationPtr WidgetApplicationUbuntu::New(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  return new WidgetApplicationUbuntu(argc, argv, stylesheet);
+  return new WidgetApplicationUbuntu(argc, argv, stylesheet, windowData);
 }
 
-WidgetApplicationUbuntu::WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet)
-: WidgetApplication(argc, argv, stylesheet)
+WidgetApplicationUbuntu::WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: WidgetApplication(argc, argv, stylesheet, windowData)
 {
   DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n");
 }
@@ -55,10 +56,11 @@ namespace WidgetApplicationFactory
  * @param[in]  argc         A pointer to the number of arguments
  * @param[in]  argv         A pointer to the argument list
  * @param[in]  stylesheet   The path to user defined theme file
+ * @param[in]  windowData   The window data
  */
-WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet)
+WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
 {
-  return WidgetApplicationUbuntu::New(argc, argv, stylesheet);
+  return WidgetApplicationUbuntu::New(argc, argv, stylesheet, windowData);
 }
 
 } // namespace WidgetApplicationFactory
index 30ee74e23c77e9cd2c540bfa826ad86b37d8e7ee..640e907c5426616f7d32d992c071fcf7f5bda633 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_UBUNTU_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -45,8 +45,9 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet);
+  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
 public:
   /**
@@ -60,8 +61,9 @@ protected:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet);
+  WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
   /**
    * Destructor
index da883da70fa2942321ff97ba413e349f21428400..22e5fc8ea5e68242dd6e5b923878da8a85b1a528 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -28,13 +28,14 @@ namespace Adaptor
 WidgetApplicationPtr WidgetApplicationWin::New(
   int*               argc,
   char**             argv[],
-  const std::string& stylesheet)
+  const std::string& stylesheet,
+  const WindowData&  windowData)
 {
-  return new WidgetApplicationWin(argc, argv, stylesheet);
+  return new WidgetApplicationWin(argc, argv, stylesheet, windowData);
 }
 
-WidgetApplicationWin::WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet)
-: WidgetApplication(argc, argv, stylesheet)
+WidgetApplicationWin::WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
+: WidgetApplication(argc, argv, stylesheet, windowData)
 {
   DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n");
 }
@@ -55,10 +56,11 @@ namespace WidgetApplicationFactory
  * @param[in]  argc         A pointer to the number of arguments
  * @param[in]  argv         A pointer to the argument list
  * @param[in]  stylesheet   The path to user defined theme file
+ * @param[in]  windowData   The window data
  */
-WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet)
+WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData)
 {
-  return WidgetApplicationWin::New(argc, argv, stylesheet);
+  return WidgetApplicationWin::New(argc, argv, stylesheet, windowData);
 }
 
 } // namespace WidgetApplicationFactory
index a9786fe0de7a43d3674dc4b09381b8fadefdcef2..8bef0c48726759dbfd05d27dd601fa37ae5bbb31 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_WIN_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -45,8 +45,9 @@ public:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet);
+  static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, const WindowData& windowData);
 
 public:
   /**
@@ -60,8 +61,9 @@ protected:
    * @param[in]  argc         A pointer to the number of arguments
    * @param[in]  argv         A pointer to the argument list
    * @param[in]  stylesheet   The path to user defined theme file
+   * @param[in]  windowData   The window data
    */
-  WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet);
+  WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet const WindowData& windowData);
 
   /**
    * Destructor
index f1b62f806e6f3987d43ae3da47ecfcef3ee9fbb8..371e4aa56f97842f0eb057ad79a1e4401055fbc9 100644 (file)
@@ -58,17 +58,17 @@ Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "L
 #endif
 } // unnamed namespace
 
-Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
+Window* Window::New(const std::string& name, const std::string& className, const WindowData& windowData)
 {
   Any surface;
-  return Window::New(surface, positionSize, name, className, type, isTransparent);
+  return Window::New(surface, name, className, windowData);
 }
 
-Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
+Window* Window::New(Any surface, const std::string& name, const std::string& className, const WindowData& windowData)
 {
   Window* window         = new Window();
-  window->mIsTransparent = isTransparent;
-  window->Initialize(surface, positionSize, name, className, type);
+  window->mIsTransparent = windowData.GetTransparency();
+  window->Initialize(surface, windowData.GetPositionSize(), name, className, windowData.GetWindowType());
   return window;
 }
 
index e78d32bfe509bc2d046fa2b6c0b4fe615ba54c3d..331ea052e99d1fec519401d02c58041818fec17b 100644 (file)
@@ -76,26 +76,22 @@ public:
 
   /**
    * @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
-   * @param[in] type Window type.
-   * @param[in] isTransparent Whether window is transparent
+   * @param[in] windowData The window data
    * @return A newly allocated Window
    */
-  static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent = false);
+  static Window* New(const std::string& name, const std::string& className, const WindowData& windowData);
 
   /**
    * @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] type Window type.
-   * @param[in] isTransparent Whether window is transparent
+   * @param[in] windowData The window data
    * @return A newly allocated Window
    */
-  static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent = false);
+  static Window* New(Any surface, const std::string& name, const std::string& className, const WindowData& windowData);
 
   /**
    * @copydoc Dali::Window::SetClass()
index 36db754111e4d1584463fa1d5e3d83a0f20e8e86..5db7add00f66b3b6697ef02b2903db6fc4f872f6 100644 (file)
@@ -42,7 +42,10 @@ Application Application::New(int* argc, char** argv[])
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, "", OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false);
+    WindowData windowData;
+    windowData.SetTransparency(false);
+
+    internal = Internal::Adaptor::Application::New(argc, argv, "", Internal::Adaptor::Framework::NORMAL, false, windowData);
   }
   return Application(internal.Get());
 }
@@ -58,7 +61,10 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false);
+    WindowData windowData;
+    windowData.SetTransparency(false);
+
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData);
   }
   return Application(internal.Get());
 }
@@ -72,11 +78,14 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
     internal->SetCommandLineOptions(argc, argv);
     internal->SetStyleSheet(stylesheet);
 
-    internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
+    internal->GetWindow().SetTransparency((windowMode == Application::TRANSPARENT));
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false);
+    WindowData windowData;
+    windowData.SetTransparency(windowMode == Application::TRANSPARENT);
+
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData);
   }
   return Application(internal.Get());
 }
@@ -90,14 +99,18 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
     internal->SetCommandLineOptions(argc, argv);
     internal->SetStyleSheet(stylesheet);
 
-    internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
+    internal->GetWindow().SetTransparency(windowMode == Application::TRANSPARENT);
 
-    //Store only the value before adaptor is created
+    // Store only the value before adaptor is created
     internal->StoreWindowPositionSize(positionSize);
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false);
+    WindowData windowData;
+    windowData.SetPositionSize(positionSize);
+    windowData.SetTransparency(windowMode == Application::TRANSPARENT);
+
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData);
   }
   return Application(internal.Get());
 }
@@ -111,14 +124,18 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
     internal->SetCommandLineOptions(argc, argv);
     internal->SetStyleSheet(stylesheet);
 
-    internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true));
+    internal->GetWindow().SetTransparency(windowMode == Application::TRANSPARENT);
 
-    //Store only the value before adaptor is created
+    // Store only the value before adaptor is created
     internal->StoreWindowPositionSize(positionSize);
   }
   else
   {
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, useUiThread);
+    WindowData windowData;
+    windowData.SetPositionSize(positionSize);
+    windowData.SetTransparency(windowMode == Application::TRANSPARENT);
+
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, useUiThread, windowData);
   }
   return Application(internal.Get());
 }
@@ -141,12 +158,7 @@ Application Application::New(int* argc, char** argv[], const std::string& styles
   }
   else
   {
-    // clang-format off
-    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet,
-                  windowData.GetTransparency() ? WINDOW_MODE::TRANSPARENT : WINDOW_MODE::OPAQUE,
-                  windowData.GetPositionSize(), Internal::Adaptor::Framework::NORMAL,
-                  windowData.GetWindowType(), useUiThread);
-    // clang-format on
+    internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, useUiThread, windowData);
   }
   return Application(internal.Get());
 }
index b1f1854b0de506aab129a0fce62bd073bd9f582b..5fca88f2fd3ecb17d9246a77d7de1ee565e2878c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -32,7 +32,8 @@ WidgetApplication WidgetApplication::New(int* argc, char** argv[], const std::st
     preInitializedApplication.Reset();
   }
 
-  Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New(argc, argv, stylesheet);
+  WindowData                              windowData;
+  Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New(argc, argv, stylesheet, windowData);
   return WidgetApplication(internal.Get());
 }
 
index 069b57eb5b318f26d1513c8834b665aa66cdd794..5e750a831dd0e34a61a595cb56e047834d94b355 100644 (file)
@@ -35,6 +35,15 @@ Window Window::New(PositionSize posSize, const std::string& name, bool isTranspa
 }
 
 Window Window::New(PositionSize posSize, const std::string& name, const std::string& className, bool isTransparent)
+{
+  WindowData windowData;
+  windowData.SetPositionSize(posSize);
+  windowData.SetTransparency(isTransparent);
+  windowData.SetWindowType(WindowType::NORMAL);
+  return Dali::Window::New(name, "", windowData);
+}
+
+Window Window::New(const std::string& name, const std::string& className, const WindowData& windowData)
 {
   Window newWindow;
 
@@ -49,7 +58,7 @@ Window Window::New(PositionSize posSize, const std::string& name, const std::str
 
   if(isNewWindowAllowed)
   {
-    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(posSize, name, className, WindowType::NORMAL, isTransparent);
+    Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(name, className, windowData);
 
     Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
 
index 64d191a71dd17397b09c38b6c553199d36aaf230..6959335ac23f40827dfbbad8b69e7b90f1de79bf 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/window-data.h>
 #include <dali/public-api/adaptor-framework/window-enumerations.h>
 #include <dali/public-api/math/int-pair.h>
 #include <dali/public-api/math/rect.h>
@@ -105,6 +106,17 @@ public:
    */
   static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
 
+  /**
+   * @brief Creates an initialized handle to a new Window.
+   * @SINCE_2_2.33
+   * @param[in] name The Window title
+   * @param[in] className The Window class name
+   * @param[in] windowData The window data
+   * @note This creates an extra window in addition to the default main window
+   * @return A new Window
+   */
+  static Window New(const std::string& name, const std::string& className, const WindowData& windowData);
+
   /**
    * @brief Creates an uninitialized handle.
    *