END_TEST;
}
-int UtcDaliApplicationMainLoop02N(void)
-{
- Application application;
-
- try
- {
- application.MainLoop( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
- DALI_TEST_CHECK( false ); // Should not get here
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
- END_TEST;
-}
int UtcDaliApplicationLowerN(void)
{
// INTERNAL INCLUDES
#include <dali/public-api/adaptor-framework/window.h>
-#include <dali/public-api/adaptor-framework/application-configuration.h>
#include <dali/public-api/dali-adaptor-common.h>
#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
static Adaptor& New( Window window );
/**
- * @brief Create a new adaptor using the window.
- *
- * @param[in] window The window to draw onto
- * @param[in] configuration The context loss configuration.
- * @return a reference to the adaptor handle
- */
- static Adaptor& New( Window window, Configuration::ContextLoss configuration );
-
- /**
* @brief Create a new adaptor using render surface.
*
* @param[in] window The window to draw onto
static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface );
/**
- * @brief Create a new adaptor using render surface.
- *
- * @param[in] window The window to draw onto
- * @param[in] surface The surface to draw onto
- * @param[in] configuration The context loss configuration.
- * @return a reference to the adaptor handle
- */
- static Adaptor& New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
-
- /**
* @brief Create a new adaptor using the SceneHolder.
*
* @param[in] sceneHolder The SceneHolder to draw onto
static Adaptor& New( Dali::Integration::SceneHolder sceneHolder );
/**
- * @brief Create a new adaptor using the SceneHolder.
- *
- * @param[in] sceneHolder The SceneHolder to draw onto
- * @param[in] configuration The context loss configuration.
- * @return a reference to the adaptor handle
- */
- static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, Configuration::ContextLoss configuration );
-
- /**
* @brief Create a new adaptor using render surface.
*
* @param[in] sceneHolder The SceneHolder to draw onto
static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface );
/**
- * @brief Create a new adaptor using render surface.
- *
- * @param[in] sceneHolder The SceneHolder to draw onto
- * @param[in] surface The surface to draw onto
- * @param[in] configuration The context loss configuration.
- * @return a reference to the adaptor handle
- */
- static Adaptor& New( Dali::Integration::SceneHolder sceneHolder, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
-
- /**
* @brief Virtual Destructor.
*/
virtual ~Adaptor();
} // unnamed namespace
-Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor;
Adaptor* impl = new Adaptor( window, *adaptor, surface, environmentOptions );
Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder = new AdaptorBuilder();
auto graphicsFactory = mAdaptorBuilder->GetGraphicsFactory();
- impl->Initialize( graphicsFactory, configuration );
+ impl->Initialize( graphicsFactory );
delete mAdaptorBuilder; // Not needed anymore as the graphics interface has now been created
return adaptor;
}
-Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Dali::Integration::SceneHolder window, EnvironmentOptions* environmentOptions )
{
Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( window );
- Dali::Adaptor* adaptor = New( window, windowImpl.GetSurface(), configuration, environmentOptions );
+ Dali::Adaptor* adaptor = New( window, windowImpl.GetSurface(), environmentOptions );
windowImpl.SetAdaptor( *adaptor );
return adaptor;
}
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface *surface, EnvironmentOptions* environmentOptions )
{
Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
Adaptor* impl = new Adaptor( window, *adaptor, surface, environmentOptions ); // Impl adaptor
adaptor->mImpl = impl;
- impl->Initialize( graphicsFactory, configuration );
+ impl->Initialize( graphicsFactory );
return adaptor;
} // Called second
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Dali::Integration::SceneHolder window, EnvironmentOptions* environmentOptions )
{
Internal::Adaptor::SceneHolder& windowImpl = Dali::GetImplementation( window );
- Dali::Adaptor* adaptor = New( graphicsFactory, window, windowImpl.GetSurface(), configuration, environmentOptions );
+ Dali::Adaptor* adaptor = New( graphicsFactory, window, windowImpl.GetSurface(), environmentOptions );
windowImpl.SetAdaptor( *adaptor );
return adaptor;
} // Called first
-void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration )
+void Adaptor::Initialize( GraphicsFactory& graphicsFactory )
{
// all threads here (event, update, and render) will send their logs to TIZEN Platform's LogMessage handler.
Dali::Integration::Log::LogFunction logFunction( Dali::TizenPlatform::LogMessage );
* @param[in] surface A render surface can be one of the following
* - Pixmap, adaptor will use existing Pixmap to draw on to
* - Window, adaptor will use existing Window to draw on to
- * @param[in] configuration The context loss configuration ( to choose resource discard policy )
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
static Dali::Adaptor* New( Dali::Integration::SceneHolder window,
Dali::RenderSurfaceInterface* surface,
- Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
/**
* Creates a New Adaptor
* @param[in] window The window handle
- * @param[in] configuration The context loss configuration ( to choose resource discard policy )
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
static Dali::Adaptor* New( Dali::Integration::SceneHolder window,
- Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
/**
* @param[in] surface A render surface can be one of the following
* - Pixmap, adaptor will use existing Pixmap to draw on to
* - Window, adaptor will use existing Window to draw on to
- * @param[in] configuration The context loss configuration ( to choose resource discard policy )
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
Dali::Integration::SceneHolder window,
Dali::RenderSurfaceInterface* surface,
- Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
/**
* Creates a New Adaptor
* @param[in] graphicsFactory A factory that creates the graphics interface
* @param[in] window The window handle
- * @param[in] configuration The context loss configuration ( to choose resource discard policy )
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
Dali::Integration::SceneHolder window,
- Dali::Configuration::ContextLoss configuration,
EnvironmentOptions* environmentOptions );
/**
* 2-step initialisation, this should be called after creating an adaptor instance.
* @param[in] graphicsFactory A factory that creates the graphics interface
- * @param[in] configuration The context loss configuration ( to choose resource discard policy )
*/
- void Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration::ContextLoss configuration );
+ void Initialize( GraphicsFactory& graphicsFactory );
/**
* Virtual destructor.
Adaptor& Adaptor::New( Window window )
{
- return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
-{
Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), configuration, NULL );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), NULL );
return *adaptor;
}
Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
{
- return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
-{
Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation( window );
Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, configuration, NULL );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( Dali::Integration::SceneHolder( sceneHolder ), pSurface, NULL );
return *adaptor;
}
Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
{
- return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
-{
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, NULL );
return *adaptor;
}
Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
{
- return New( window, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
-}
-
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
-{
Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, configuration, NULL );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, pSurface, NULL );
return *adaptor;
}
mRegionChangedSignal(),
mEventLoop( nullptr ),
mFramework( nullptr ),
- mContextLossConfiguration( Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS ),
mCommandLineOptions( nullptr ),
mAdaptorBuilder( nullptr ),
mAdaptor( nullptr ),
Integration::SceneHolder sceneHolder = Integration::SceneHolder( &Dali::GetImplementation( mMainWindow ) );
- mAdaptor = Adaptor::New( graphicsFactory, sceneHolder, mContextLossConfiguration, &mEnvironmentOptions );
+ mAdaptor = Adaptor::New( graphicsFactory, sceneHolder, &mEnvironmentOptions );
Adaptor::GetImplementation( *mAdaptor ).SetUseRemoteSurface( mUseRemoteSurface );
}
mAdaptorBuilder = new AdaptorBuilder();
}
-void Application::MainLoop(Dali::Configuration::ContextLoss configuration)
+void Application::MainLoop()
{
- mContextLossConfiguration = configuration;
-
// Run the application
mFramework->Run();
}
/**
* @copydoc Dali::Application::MainLoop()
*/
- void MainLoop(Dali::Configuration::ContextLoss configuration);
+ void MainLoop();
/**
* @copydoc Dali::Application::Lower()
EventLoop* mEventLoop;
Framework* mFramework;
- Dali::Configuration::ContextLoss mContextLossConfiguration;
CommandLineOptions* mCommandLineOptions;
Dali::Internal::Adaptor::AdaptorBuilder* mAdaptorBuilder; ///< The adaptor builder
+++ /dev/null
-#ifndef DALI_APPLICATION_CONFIGURATION_H
-#define DALI_APPLICATION_CONFIGURATION_H
-
-/*
- * Copyright (c) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-namespace Dali
-{
-/**
- * @addtogroup dali_adaptor_framework
- * @{
- */
-
-/**
- * @brief Enumeration for Application configuration.
- * @SINCE_1_0.0
- */
-namespace Configuration
-{
-
-/**
- * @brief Enumeration for application context loss policy.
- * @SINCE_1_0.0
- */
-enum ContextLoss
-{
- APPLICATION_HANDLES_CONTEXT_LOSS, ///< Application will tear down and recreate UI on context loss and context regained signals. Dali doesn't need to retain data. @SINCE_1_0.0
- APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS, ///< Application expects Dali to retain data ( increased memory footprint ) @SINCE_1_0.0
-};
-
-} // Configuration
-
-/**
- * @}
- */
-
-} // namespace Dali
-
-#endif // DALI_APPLICATION_CONFIGURATION_H
void Application::MainLoop()
{
- Internal::Adaptor::GetImplementation(*this).MainLoop(Configuration::APPLICATION_HANDLES_CONTEXT_LOSS);
-}
-
-void Application::MainLoop(Configuration::ContextLoss configuration)
-{
- Internal::Adaptor::GetImplementation(*this).MainLoop(configuration);
+ Internal::Adaptor::GetImplementation(*this).MainLoop();
}
void Application::Lower()
#include <dali/public-api/signals/callback.h>
// INTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/application-configuration.h>
#include <dali/public-api/adaptor-framework/device-status.h>
#include <dali/public-api/adaptor-framework/window.h>
/**
* @brief This starts the application.
*
- * Choosing this form of main loop indicates that the default
- * application configuration of APPLICATION_HANDLES_CONTEXT_LOSS is used. On platforms where
- * context loss can occur, the application is responsible for tearing down and re-loading UI.
- * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
- * @SINCE_1_0.0
- */
- void MainLoop();
-
- /**
- * @brief This starts the application, and allows the app to choose a different configuration.
+ * On platforms where context loss can occur, the application is responsible for tearing down and
+ * re-loading UI. The application should listen to Stage::ContextLostSignal and
+ * Stage::ContextRegainedSignal.
*
- * The application should listen to Stage::ContextLostSignal and Stage::ContextRegainedSignal.
* @SINCE_1_0.0
- * @param[in] configuration The context loss configuration
*/
- void MainLoop(Configuration::ContextLoss configuration);
+ void MainLoop();
/**
* @brief This lowers the application to bottom without actually quitting it.
SET( public_api_adaptor_framework_header_files
${adaptor_public_api_dir}/adaptor-framework/application.h
- ${adaptor_public_api_dir}/adaptor-framework/application-configuration.h
${adaptor_public_api_dir}/adaptor-framework/device-status.h
${adaptor_public_api_dir}/adaptor-framework/input-method.h
${adaptor_public_api_dir}/adaptor-framework/key.h