From 2d5c9e260bee41ef6fc143864edc6de9c481353c Mon Sep 17 00:00:00 2001 From: Daekwang Ryu Date: Tue, 13 Jun 2023 11:17:01 +0900 Subject: [PATCH] Revert "Use WindowData in the constructors of Application" This reverts commit bc38155bec5aabefb831b0a40ff592ecc84016eb. --- .../adaptor-framework/application-devel.cpp | 11 ++---- dali/internal/adaptor/common/application-impl.cpp | 30 ++++++++------- dali/internal/adaptor/common/application-impl.h | 15 +++++--- .../tizen-wayland/component-application-impl.cpp | 16 ++++---- .../tizen-wayland/component-application-impl.h | 8 ++-- .../tizen-wayland/component-application.cpp | 5 +-- .../tizen-wearable/watch-application-impl.cpp | 16 ++++---- .../tizen-wearable/watch-application-impl.h | 10 ++--- .../tizen-wearable/watch-application.cpp | 8 +--- .../android/widget-application-impl-android.cpp | 16 ++++---- .../android/widget-application-impl-android.h | 8 ++-- .../system/common/widget-application-impl.cpp | 16 ++++---- .../system/common/widget-application-impl.h | 7 ++-- .../system/macos/widget-application-impl-mac.cpp | 17 ++++----- .../system/macos/widget-application-impl-mac.h | 9 ++--- .../widget-application-impl-tizen.cpp | 30 +++++++-------- .../tizen-wayland/widget-application-impl-tizen.h | 10 ++--- .../ubuntu-x11/widget-application-impl-x.cpp | 16 ++++---- .../system/ubuntu-x11/widget-application-impl-x.h | 8 ++-- .../system/windows/widget-application-impl-win.cpp | 16 ++++---- .../system/windows/widget-application-impl-win.h | 8 ++-- dali/public-api/adaptor-framework/application.cpp | 44 ++++++++-------------- .../adaptor-framework/widget-application.cpp | 5 +-- 23 files changed, 143 insertions(+), 186 deletions(-) diff --git a/dali/devel-api/adaptor-framework/application-devel.cpp b/dali/devel-api/adaptor-framework/application-devel.cpp index 11ab483..886620a 100644 --- a/dali/devel-api/adaptor-framework/application-devel.cpp +++ b/dali/devel-api/adaptor-framework/application-devel.cpp @@ -38,19 +38,14 @@ Application New(int* argc, char** argv[], const std::string& stylesheet, Applica internal->SetCommandLineOptions(argc, argv); internal->SetStyleSheet(stylesheet); - internal->GetWindow().SetTransparency((windowMode == Application::TRANSPARENT)); + internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true)); - // Store only the value before adaptor is created + //Store only the value before adaptor is created internal->StoreWindowPositionSize(positionSize); } else { - 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); + internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, type, false); } return Application(internal.Get()); } diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index 90843da..6590889 100644 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -64,14 +64,16 @@ DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_APPLICATION, true); ApplicationPtr Application::gPreInitializedApplication(NULL); ApplicationPtr Application::New( - 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)); + 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)); return application; } @@ -80,14 +82,14 @@ void Application::PreInitialize(int* argc, char** argv[]) if(!gPreInitializedApplication) { Dali::TextAbstraction::FontClientPreInitialize(); - WindowData windowData; - gPreInitializedApplication = new Application(argc, argv, "", Framework::NORMAL, false, windowData); + + gPreInitializedApplication = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL, WindowType::NORMAL, false); gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED; gPreInitializedApplication->CreateWindow(); // Only create window } } -Application::Application(int* argc, char** argv[], const std::string& stylesheet, Framework::Type applicationType, bool useUiThread, WindowData& windowData) +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) : mInitSignal(), mTerminateSignal(), mPauseSignal(), @@ -102,12 +104,12 @@ Application::Application(int* argc, char** argv[], const std::string& stylesheet mAdaptor(nullptr), mEnvironmentOptions(nullptr), mMainWindow(), - mMainWindowMode(windowData.GetTransparency() ? WINDOW_MODE::TRANSPARENT : WINDOW_MODE::OPAQUE), + mMainWindowMode(windowMode), mMainWindowName(), mStylesheet(stylesheet), - mWindowPositionSize(windowData.GetPositionSize()), + mWindowPositionSize(positionSize), mLaunchpadState(Launchpad::NONE), - mDefaultWindowType(windowData.GetWindowType()), + mDefaultWindowType(type), mUseUiThread(useUiThread), mSlotDelegate(this) { diff --git a/dali/internal/adaptor/common/application-impl.h b/dali/internal/adaptor/common/application-impl.h index 157acc3..a881314 100644 --- a/dali/internal/adaptor/common/application-impl.h +++ b/dali/internal/adaptor/common/application-impl.h @@ -78,12 +78,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] 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, Framework::Type applicationType, bool useUiThread, WindowData& windowData); + static ApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type, bool useUiThread); /** * @copydoc Dali::DevelApplication::PreInitialize() @@ -458,11 +459,13 @@ 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] useUiThread True if the application would create UI thread - * @param[in] windowData The WindowData + * @param[in] type The default window's type. + * @param[in] useUiThread True if the application would create UI thread */ - Application(int* argc, char** argv[], const std::string& stylesheet, Framework::Type applicationType, bool useUiThread, WindowData& windowData); + Application(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type, bool useUiThread); /** * Destructor diff --git a/dali/internal/adaptor/tizen-wayland/component-application-impl.cpp b/dali/internal/adaptor/tizen-wayland/component-application-impl.cpp index a607d56..09f3aa4 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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, - WindowData& windowData) + int* argc, + char** argv[], + const std::string& stylesheet, + Dali::Application::WINDOW_MODE windowMode) { - ComponentApplicationPtr application(new ComponentApplication(argc, argv, stylesheet, windowData)); + ComponentApplicationPtr application(new ComponentApplication(argc, argv, stylesheet, windowMode)); return application; } -ComponentApplication::ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: Application(argc, argv, stylesheet, Framework::COMPONENT, false, windowData) +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) { } diff --git a/dali/internal/adaptor/tizen-wayland/component-application-impl.h b/dali/internal/adaptor/tizen-wayland/component-application-impl.h index fb3f0c4..b84104b 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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] windowData The window data + * @param[in] windowMode A member of WINDOW_MODE * @return A handle to the ComponentApplication */ - static ComponentApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData); + static ComponentApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode); /** * @brief The default constructor. */ - ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData); + ComponentApplication(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode); /** * @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 5e55ea9..a04f8a3 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,8 +35,7 @@ ComponentApplication ComponentApplication::New(int* argc, char** argv[]) ComponentApplication ComponentApplication::New(int* argc, char** argv[], const std::string& stylesheet) { - WindowData windowData; - Internal::Adaptor::ComponentApplicationPtr internal = Internal::Adaptor::ComponentApplication::New(argc, argv, stylesheet, windowData); + Internal::Adaptor::ComponentApplicationPtr internal = Internal::Adaptor::ComponentApplication::New(argc, argv, stylesheet, TRANSPARENT); 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 3e9b43d..7f7a7f1 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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, - WindowData& windowData) + int* argc, + char** argv[], + const std::string& stylesheet, + Dali::WatchApplication::WINDOW_MODE windowMode) { - WatchApplicationPtr watch(new WatchApplication(argc, argv, stylesheet, windowData)); + WatchApplicationPtr watch(new WatchApplication(argc, argv, stylesheet, windowMode)); return watch; } -WatchApplication::WatchApplication(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: Application(argc, argv, stylesheet, Framework::WATCH, false, windowData), +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), 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 c814852..dbae797 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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] windowData The window data + * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE */ - static WatchApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData); + static WatchApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode); /** * 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] windowData The window data + * @param[in] windowMode A member of Dali::Watch::WINDOW_MODE */ - WatchApplication(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData); + WatchApplication(int* argc, char** argv[], const std::string& stylesheet, WINDOW_MODE windowMode); /** * 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 cd0cf6f..9827e37 100644 --- a/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp +++ b/dali/internal/adaptor/tizen-wayland/tizen-wearable/watch-application.cpp @@ -33,17 +33,13 @@ WatchApplication WatchApplication::New() WatchApplication WatchApplication::New(int* argc, char** argv[]) { - WindowData windowData; - windowData.SetTransparency(false); - Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, "", windowData); + Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, "", OPAQUE); return WatchApplication(internal.Get()); } WatchApplication WatchApplication::New(int* argc, char** argv[], const std::string& stylesheet) { - WindowData windowData; - windowData.SetTransparency(false); - Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, stylesheet, windowData); + Internal::Adaptor::WatchApplicationPtr internal = Internal::Adaptor::WatchApplication::New(argc, argv, stylesheet, OPAQUE); 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 59e75bc..65d95a6 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,14 +28,13 @@ namespace Adaptor WidgetApplicationPtr WidgetApplicationAndroid::New( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) + const std::string& stylesheet) { - return new WidgetApplicationAndroid(argc, argv, stylesheet, windowData); + return new WidgetApplicationAndroid(argc, argv, stylesheet); } -WidgetApplicationAndroid::WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: WidgetApplication(argc, argv, stylesheet, windowData) +WidgetApplicationAndroid::WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet) +: WidgetApplication(argc, argv, stylesheet) { DALI_LOG_ERROR("WidgetApplication is not implemented in Android profile.\n"); } @@ -54,11 +53,10 @@ 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, WindowData& windowData) +WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet) { - return WidgetApplicationAndroid::New(argc, argv, stylesheet, windowData); + return WidgetApplicationAndroid::New(argc, argv, stylesheet); } } // 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 aaf0a72..7e93d98 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,9 +45,8 @@ 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, WindowData& windowData); + static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet); public: /** @@ -61,9 +60,8 @@ 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, WindowData& windowData); + WidgetApplicationAndroid(int* argc, char** argv[], const std::string& stylesheet); /** * Destructor diff --git a/dali/internal/system/common/widget-application-impl.cpp b/dali/internal/system/common/widget-application-impl.cpp index 4dc38a6..5c7aef6 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,24 +33,22 @@ 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, WindowData& windowData); +WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet); } // namespace WidgetApplicationFactory WidgetApplicationPtr WidgetApplication::New( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) + const std::string& stylesheet) { - // WidgetApplicationPtr //widgetApplication( new WidgetApplication (argc, argv, stylesheet ) ); - return WidgetApplicationFactory::Create(argc, argv, stylesheet, windowData); + //WidgetApplicationPtr //widgetApplication( new WidgetApplication (argc, argv, stylesheet ) ); + return WidgetApplicationFactory::Create(argc, argv, stylesheet); } -WidgetApplication::WidgetApplication(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: Application(argc, argv, stylesheet, Framework::WIDGET, false, windowData) +WidgetApplication::WidgetApplication(int* argc, char** argv[], const std::string& stylesheet) +: Application(argc, argv, stylesheet, Dali::WidgetApplication::OPAQUE, PositionSize(), Framework::WIDGET, WindowType::NORMAL, false) { 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 ad8cc59..32079ca 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,9 +48,8 @@ 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, WindowData& windowData); + static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet); public: /** @@ -65,7 +64,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, WindowData& windowData); + WidgetApplication(int* argc, char** argv[], const std::string& stylesheet); /** * Destructor diff --git a/dali/internal/system/macos/widget-application-impl-mac.cpp b/dali/internal/system/macos/widget-application-impl-mac.cpp index f053ab7..4bc9bc9 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,18 +28,16 @@ namespace Adaptor WidgetApplicationPtr WidgetApplicationCocoa::New( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) + const std::string& stylesheet) { - return new WidgetApplicationCocoa(argc, argv, stylesheet, windowData); + return new WidgetApplicationCocoa(argc, argv, stylesheet); } WidgetApplicationCocoa::WidgetApplicationCocoa( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) -: WidgetApplication(argc, argv, stylesheet, windowData) + const std::string& stylesheet) +: WidgetApplication(argc, argv, stylesheet) { DALI_LOG_ERROR("WidgetApplication is not implemented in MACOS profile.\n"); } @@ -62,11 +60,10 @@ 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, WindowData& windowData) +WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet) { - return WidgetApplicationCocoa::New(argc, argv, stylesheet, windowData); + return WidgetApplicationCocoa::New(argc, argv, stylesheet); } } // 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 784916d..444933c 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,13 +49,11 @@ 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, - WindowData& windowData); + const std::string& stylesheet); public: /** @@ -71,9 +69,8 @@ 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, WindowData& windowData); + WidgetApplicationCocoa(int* argc, char** argv[], const std::string& stylesheet); /** * 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 652eb99..2faa238 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,14 +265,13 @@ namespace Adaptor WidgetApplicationPtr WidgetApplicationTizen::New( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) + const std::string& stylesheet) { - return new WidgetApplicationTizen(argc, argv, stylesheet, windowData); + return new WidgetApplicationTizen(argc, argv, stylesheet); } -WidgetApplicationTizen::WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: WidgetApplication(argc, argv, stylesheet, windowData), +WidgetApplicationTizen::WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet) +: WidgetApplication(argc, argv, stylesheet), mConnectedKeyEvent(false), mReceivedKeyEvent(false) { @@ -391,7 +390,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; } @@ -437,11 +436,10 @@ 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, WindowData& windowData) +Dali::Internal::Adaptor::WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet) { - return WidgetApplicationTizen::New(argc, argv, stylesheet, windowData); + return WidgetApplicationTizen::New(argc, argv, stylesheet); } } // 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 c39e995..80166bd 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,9 +52,8 @@ 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, WindowData& windowData); + static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet); public: /** @@ -137,9 +136,8 @@ 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, WindowData& windowData); + WidgetApplicationTizen(int* argc, char** argv[], const std::string& stylesheet); /** * 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 b3d8d6d..7502746 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,14 +28,13 @@ namespace Adaptor WidgetApplicationPtr WidgetApplicationUbuntu::New( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) + const std::string& stylesheet) { - return new WidgetApplicationUbuntu(argc, argv, stylesheet, windowData); + return new WidgetApplicationUbuntu(argc, argv, stylesheet); } -WidgetApplicationUbuntu::WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: WidgetApplication(argc, argv, stylesheet, windowData) +WidgetApplicationUbuntu::WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet) +: WidgetApplication(argc, argv, stylesheet) { DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n"); } @@ -56,11 +55,10 @@ 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, WindowData& windowData) +WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet) { - return WidgetApplicationUbuntu::New(argc, argv, stylesheet, windowData); + return WidgetApplicationUbuntu::New(argc, argv, stylesheet); } } // 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 0ed89e0..30ee74e 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,9 +45,8 @@ 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, WindowData& windowData); + static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet); public: /** @@ -61,9 +60,8 @@ 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, WindowData& windowData); + WidgetApplicationUbuntu(int* argc, char** argv[], const std::string& stylesheet); /** * Destructor diff --git a/dali/internal/system/windows/widget-application-impl-win.cpp b/dali/internal/system/windows/widget-application-impl-win.cpp index 59f6d1c..da883da 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,14 +28,13 @@ namespace Adaptor WidgetApplicationPtr WidgetApplicationWin::New( int* argc, char** argv[], - const std::string& stylesheet, - WindowData& windowData) + const std::string& stylesheet) { - return new WidgetApplicationWin(argc, argv, stylesheet, windowData); + return new WidgetApplicationWin(argc, argv, stylesheet); } -WidgetApplicationWin::WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet, WindowData& windowData) -: WidgetApplication(argc, argv, stylesheet, windowData) +WidgetApplicationWin::WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet) +: WidgetApplication(argc, argv, stylesheet) { DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n"); } @@ -56,11 +55,10 @@ 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, WindowData& windowData) +WidgetApplicationPtr Create(int* argc, char** argv[], const std::string& stylesheet) { - return WidgetApplicationWin::New(argc, argv, stylesheet, windowData); + return WidgetApplicationWin::New(argc, argv, stylesheet); } } // 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 dac729a..a9786fe 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,9 +45,8 @@ 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, WindowData& windowData); + static WidgetApplicationPtr New(int* argc, char** argv[], const std::string& stylesheet); public: /** @@ -61,9 +60,8 @@ 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 WindowData& windowData); + WidgetApplicationWin(int* argc, char** argv[], const std::string& stylesheet); /** * Destructor diff --git a/dali/public-api/adaptor-framework/application.cpp b/dali/public-api/adaptor-framework/application.cpp index 5db7add..36db754 100644 --- a/dali/public-api/adaptor-framework/application.cpp +++ b/dali/public-api/adaptor-framework/application.cpp @@ -42,10 +42,7 @@ Application Application::New(int* argc, char** argv[]) } else { - WindowData windowData; - windowData.SetTransparency(false); - - internal = Internal::Adaptor::Application::New(argc, argv, "", Internal::Adaptor::Framework::NORMAL, false, windowData); + internal = Internal::Adaptor::Application::New(argc, argv, "", OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false); } return Application(internal.Get()); } @@ -61,10 +58,7 @@ Application Application::New(int* argc, char** argv[], const std::string& styles } else { - WindowData windowData; - windowData.SetTransparency(false); - - internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData); + internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, OPAQUE, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false); } return Application(internal.Get()); } @@ -78,14 +72,11 @@ Application Application::New(int* argc, char** argv[], const std::string& styles internal->SetCommandLineOptions(argc, argv); internal->SetStyleSheet(stylesheet); - internal->GetWindow().SetTransparency((windowMode == Application::TRANSPARENT)); + internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true)); } else { - WindowData windowData; - windowData.SetTransparency(windowMode == Application::TRANSPARENT); - - internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData); + internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, PositionSize(), Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false); } return Application(internal.Get()); } @@ -99,18 +90,14 @@ Application Application::New(int* argc, char** argv[], const std::string& styles internal->SetCommandLineOptions(argc, argv); internal->SetStyleSheet(stylesheet); - internal->GetWindow().SetTransparency(windowMode == Application::TRANSPARENT); + internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true)); - // Store only the value before adaptor is created + //Store only the value before adaptor is created internal->StoreWindowPositionSize(positionSize); } else { - WindowData windowData; - windowData.SetPositionSize(positionSize); - windowData.SetTransparency(windowMode == Application::TRANSPARENT); - - internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, false, windowData); + internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, false); } return Application(internal.Get()); } @@ -124,18 +111,14 @@ Application Application::New(int* argc, char** argv[], const std::string& styles internal->SetCommandLineOptions(argc, argv); internal->SetStyleSheet(stylesheet); - internal->GetWindow().SetTransparency(windowMode == Application::TRANSPARENT); + internal->GetWindow().SetTransparency((windowMode == Application::OPAQUE ? false : true)); - // Store only the value before adaptor is created + //Store only the value before adaptor is created internal->StoreWindowPositionSize(positionSize); } else { - WindowData windowData; - windowData.SetPositionSize(positionSize); - windowData.SetTransparency(windowMode == Application::TRANSPARENT); - - internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, useUiThread, windowData); + internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, windowMode, positionSize, Internal::Adaptor::Framework::NORMAL, WindowType::NORMAL, useUiThread); } return Application(internal.Get()); } @@ -158,7 +141,12 @@ Application Application::New(int* argc, char** argv[], const std::string& styles } else { - internal = Internal::Adaptor::Application::New(argc, argv, stylesheet, Internal::Adaptor::Framework::NORMAL, useUiThread, windowData); + // 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 } 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 5fca88f..b1f1854 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) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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,8 +32,7 @@ WidgetApplication WidgetApplication::New(int* argc, char** argv[], const std::st preInitializedApplication.Reset(); } - WindowData windowData; - Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New(argc, argv, stylesheet, windowData); + Internal::Adaptor::WidgetApplicationPtr internal = Internal::Adaptor::WidgetApplication::New(argc, argv, stylesheet); return WidgetApplication(internal.Get()); } -- 2.7.4