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
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());
}
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)
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;
}
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(),
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)
{
void Application::CreateWindow()
{
Internal::Adaptor::Window* window;
+ WindowData windowData;
+ windowData.SetTransparency(mMainWindowMode);
+ windowData.SetWindowType(mDefaultWindowType);
WindowSystem::Initialize();
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);
* @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()
* @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
/*
- * 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.
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)
{
}
#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.
* @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.
/*
- * 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.
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());
}
/*
- * 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.
} // 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)
{
}
#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.
* @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
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());
}
/*
- * 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.
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");
}
* @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
#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.
* @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:
/**
* @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
/*
- * 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.
* @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");
}
#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.
* @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:
/**
* @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
/*
- * 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.
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");
}
* @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
#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.
* @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:
/**
* @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
/*
- * 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>
* 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);
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)
{
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)
{
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;
}
* @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
#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.
*/
// 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>
* @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:
/**
* @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
/*
- * 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.
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");
}
* @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
#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.
* @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:
/**
* @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
/*
- * 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.
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");
}
* @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
#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.
* @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:
/**
* @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
#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;
}
/**
* @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()
}
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());
}
}
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());
}
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());
}
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());
}
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());
}
}
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());
}
/*
- * 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.
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());
}
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;
const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
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);
*/
// 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>
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.
*
* This can be initialized using Dali::Application::GetWindow() or