/*
- * Copyright (c) 2021 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.
const std::string& stylesheet,
Dali::Application::WINDOW_MODE windowMode,
const PositionSize& positionSize,
- Framework::Type applicationType)
+ Framework::Type applicationType,
+ WindowType type)
{
- ApplicationPtr application(new Application(argc, argv, stylesheet, windowMode, positionSize, applicationType));
+ ApplicationPtr application(new Application(argc, argv, stylesheet, windowMode, positionSize, applicationType, type));
return application;
}
{
Dali::TextAbstraction::FontClientPreInitialize();
- gPreInitializedApplication = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL);
+ gPreInitializedApplication = new Application(argc, argv, "", Dali::Application::OPAQUE, PositionSize(), Framework::NORMAL, WindowType::NORMAL);
gPreInitializedApplication->CreateWindow(); // Only create window
gPreInitializedApplication->mLaunchpadState = Launchpad::PRE_INITIALIZED;
}
}
-Application::Application(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType)
+Application::Application(int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode, const PositionSize& positionSize, Framework::Type applicationType, WindowType type)
: mInitSignal(),
mTerminateSignal(),
mPauseSignal(),
mEnvironmentOptions(),
mWindowPositionSize(positionSize),
mLaunchpadState(Launchpad::NONE),
+ mDefaultWindowType(type),
mSlotDelegate(this)
{
// Get mName from environment options
const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mMainWindowMode == Dali::Application::TRANSPARENT);
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(mWindowPositionSize, mMainWindowName, windowClassName, mDefaultWindowType, mMainWindowMode == Dali::Application::TRANSPARENT);
mMainWindow = Dali::Window(window);
// Quit the application when the window is closed
mFramework->SetCommandLineOptions(argc, argv);
}
-ApplicationPtr Application::GetPreInitializedApplication()
+void Application::SetDefaultWindowType(WindowType type)
{
- return gPreInitializedApplication;
+ mDefaultWindowType = type;
+ mMainWindow.SetType(type);
}
-Graphics::Controller& Application::GetController()
+ApplicationPtr Application::GetPreInitializedApplication()
{
- auto& adaptor = Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor);
- return adaptor.GetGraphicsInterface().GetController();
+ // Reset the handle to decrease the reference count
+ ApplicationPtr application = gPreInitializedApplication;
+ gPreInitializedApplication.Reset();
+
+ return application;
}
} // namespace Adaptor