From: Daekwang Ryu Date: Mon, 12 Jun 2023 04:30:59 +0000 (+0900) Subject: Use WindowData in the constructors of Application X-Git-Tag: dali_2.2.31~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F49%2F294049%2F2;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Use WindowData in the constructors of Application This patch makes Internal Application 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: Ie3a67b49080650c0ffb5f71d87f4fc7f88bf54af --- diff --git a/dali/devel-api/adaptor-framework/application-devel.cpp b/dali/devel-api/adaptor-framework/application-devel.cpp index 886620a..11ab483 100644 --- a/dali/devel-api/adaptor-framework/application-devel.cpp +++ b/dali/devel-api/adaptor-framework/application-devel.cpp @@ -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()); } diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index 6590889..90843da 100644 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -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, + 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, 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) { diff --git a/dali/internal/adaptor/common/application-impl.h b/dali/internal/adaptor/common/application-impl.h index a881314..157acc3 100644 --- a/dali/internal/adaptor/common/application-impl.h +++ b/dali/internal/adaptor/common/application-impl.h @@ -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, 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/adaptor/tizen-wayland/component-application-impl.cpp b/dali/internal/adaptor/tizen-wayland/component-application-impl.cpp index 09f3aa4..a607d56 100644 --- a/dali/internal/adaptor/tizen-wayland/component-application-impl.cpp +++ b/dali/internal/adaptor/tizen-wayland/component-application-impl.cpp @@ -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, + 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, WindowData& windowData) +: Application(argc, argv, stylesheet, Framework::COMPONENT, false, windowData) { } diff --git a/dali/internal/adaptor/tizen-wayland/component-application-impl.h b/dali/internal/adaptor/tizen-wayland/component-application-impl.h index b84104b..fb3f0c4 100644 --- a/dali/internal/adaptor/tizen-wayland/component-application-impl.h +++ b/dali/internal/adaptor/tizen-wayland/component-application-impl.h @@ -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, 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, WindowData& windowData); /** * @brief Undefined copy constructor. diff --git a/dali/internal/adaptor/tizen-wayland/component-application.cpp b/dali/internal/adaptor/tizen-wayland/component-application.cpp index a04f8a3..5e55ea9 100644 --- a/dali/internal/adaptor/tizen-wayland/component-application.cpp +++ b/dali/internal/adaptor/tizen-wayland/component-application.cpp @@ -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,8 @@ 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; + Internal::Adaptor::ComponentApplicationPtr internal = Internal::Adaptor::ComponentApplication::New(argc, argv, stylesheet, windowData); return ComponentApplication(internal.Get()); } diff --git a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp index 7f7a7f1..3e9b43d 100644 --- a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp +++ b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.cpp @@ -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, + 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, WindowData& windowData) +: Application(argc, argv, stylesheet, Framework::WATCH, false, windowData), mState(UNINITIALIZED) { } diff --git a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h index dbae797..c814852 100644 --- a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h +++ b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application-impl.h @@ -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, 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp index 9827e37..cd0cf6f 100644 --- a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp +++ b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp @@ -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()); } diff --git a/dali/internal/system/android/widget-application-impl-android.cpp b/dali/internal/system/android/widget-application-impl-android.cpp index 65d95a6..59e75bc 100644 --- a/dali/internal/system/android/widget-application-impl-android.cpp +++ b/dali/internal/system/android/widget-application-impl-android.cpp @@ -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, + 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, 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, WindowData& windowData) { - return WidgetApplicationAndroid::New(argc, argv, stylesheet); + return WidgetApplicationAndroid::New(argc, argv, stylesheet, windowData); } } // namespace WidgetApplicationFactory diff --git a/dali/internal/system/android/widget-application-impl-android.h b/dali/internal/system/android/widget-application-impl-android.h index 7e93d98..aaf0a72 100644 --- a/dali/internal/system/android/widget-application-impl-android.h +++ b/dali/internal/system/android/widget-application-impl-android.h @@ -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, 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/system/common/widget-application-impl.cpp b/dali/internal/system/common/widget-application-impl.cpp index 5c7aef6..4dc38a6 100644 --- a/dali/internal/system/common/widget-application-impl.cpp +++ b/dali/internal/system/common/widget-application-impl.cpp @@ -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, WindowData& windowData); } // namespace WidgetApplicationFactory WidgetApplicationPtr WidgetApplication::New( int* argc, char** argv[], - const std::string& stylesheet) + const std::string& stylesheet, + 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, WindowData& windowData) +: Application(argc, argv, stylesheet, Framework::WIDGET, false, windowData) { DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n"); } diff --git a/dali/internal/system/common/widget-application-impl.h b/dali/internal/system/common/widget-application-impl.h index 32079ca..ad8cc59 100644 --- a/dali/internal/system/common/widget-application-impl.h +++ b/dali/internal/system/common/widget-application-impl.h @@ -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, 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/system/macos/widget-application-impl-mac.cpp b/dali/internal/system/macos/widget-application-impl-mac.cpp index 4bc9bc9..f053ab7 100644 --- a/dali/internal/system/macos/widget-application-impl-mac.cpp +++ b/dali/internal/system/macos/widget-application-impl-mac.cpp @@ -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, + 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, + 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, WindowData& windowData) { - return WidgetApplicationCocoa::New(argc, argv, stylesheet); + return WidgetApplicationCocoa::New(argc, argv, stylesheet, windowData); } } // namespace WidgetApplicationFactory diff --git a/dali/internal/system/macos/widget-application-impl-mac.h b/dali/internal/system/macos/widget-application-impl-mac.h index 444933c..784916d 100644 --- a/dali/internal/system/macos/widget-application-impl-mac.h +++ b/dali/internal/system/macos/widget-application-impl-mac.h @@ -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, + 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp index 2faa238..652eb99 100644 --- a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp +++ b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp @@ -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. @@ -19,12 +19,12 @@ #include // INTERNAL INCLUDE +#include #include #include #include #include #include -#include // EXTERNAL INCLUDES #include @@ -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(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, + 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, 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, WindowData& windowData) { - return WidgetApplicationTizen::New(argc, argv, stylesheet); + return WidgetApplicationTizen::New(argc, argv, stylesheet, windowData); } } // namespace WidgetApplicationFactory diff --git a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.h b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.h index 80166bd..c39e995 100644 --- a/dali/internal/system/tizen-wayland/widget-application-impl-tizen.h +++ b/dali/internal/system/tizen-wayland/widget-application-impl-tizen.h @@ -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 #include +#include // INTERNAL INCLUDES #include @@ -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, 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/system/ubuntu-x11/widget-application-impl-x.cpp b/dali/internal/system/ubuntu-x11/widget-application-impl-x.cpp index 7502746..b3d8d6d 100644 --- a/dali/internal/system/ubuntu-x11/widget-application-impl-x.cpp +++ b/dali/internal/system/ubuntu-x11/widget-application-impl-x.cpp @@ -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, + 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, 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, WindowData& windowData) { - return WidgetApplicationUbuntu::New(argc, argv, stylesheet); + return WidgetApplicationUbuntu::New(argc, argv, stylesheet, windowData); } } // namespace WidgetApplicationFactory diff --git a/dali/internal/system/ubuntu-x11/widget-application-impl-x.h b/dali/internal/system/ubuntu-x11/widget-application-impl-x.h index 30ee74e..0ed89e0 100644 --- a/dali/internal/system/ubuntu-x11/widget-application-impl-x.h +++ b/dali/internal/system/ubuntu-x11/widget-application-impl-x.h @@ -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, 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, WindowData& windowData); /** * Destructor diff --git a/dali/internal/system/windows/widget-application-impl-win.cpp b/dali/internal/system/windows/widget-application-impl-win.cpp index da883da..59f6d1c 100644 --- a/dali/internal/system/windows/widget-application-impl-win.cpp +++ b/dali/internal/system/windows/widget-application-impl-win.cpp @@ -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, + 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, 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, WindowData& windowData) { - return WidgetApplicationWin::New(argc, argv, stylesheet); + return WidgetApplicationWin::New(argc, argv, stylesheet, windowData); } } // namespace WidgetApplicationFactory diff --git a/dali/internal/system/windows/widget-application-impl-win.h b/dali/internal/system/windows/widget-application-impl-win.h index a9786fe..dac729a 100644 --- a/dali/internal/system/windows/widget-application-impl-win.h +++ b/dali/internal/system/windows/widget-application-impl-win.h @@ -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, 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 WindowData& windowData); /** * Destructor diff --git a/dali/public-api/adaptor-framework/application.cpp b/dali/public-api/adaptor-framework/application.cpp index 36db754..5db7add 100644 --- a/dali/public-api/adaptor-framework/application.cpp +++ b/dali/public-api/adaptor-framework/application.cpp @@ -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()); } diff --git a/dali/public-api/adaptor-framework/widget-application.cpp b/dali/public-api/adaptor-framework/widget-application.cpp index b1f1854..5fca88f 100644 --- a/dali/public-api/adaptor-framework/widget-application.cpp +++ b/dali/public-api/adaptor-framework/widget-application.cpp @@ -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()); }