-#ifndef __DALI_TOOLKIT_TEST_APPLICATION_H__
-#define __DALI_TOOLKIT_TEST_APPLICATION_H__
+#ifndef DALI_TOOLKIT_TEST_APPLICATION_H
+#define DALI_TOOLKIT_TEST_APPLICATION_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * 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.
*
*/
+// EXTERNAL INCLUDES
+#include <memory>
+
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
#include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/integration-api/adaptors/adaptor.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <toolkit-adaptor-impl.h>
-#include <toolkit-singleton-service.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include "test-application.h"
+
+//#undef assert
namespace Dali
{
+class Adaptor;
+class Window;
+
/**
* Adds some functionality on top of TestApplication that is required by the Toolkit.
+ *
+ * This includes creation and destruction of the Adaptor and Window classes.
*/
class ToolkitTestApplication : public TestApplication
{
ToolkitTestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
- float verticalDpi = DEFAULT_VERTICAL_DPI )
- : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
- {
- auto singletonService = SingletonService::Get();
- Test::SetApplication( singletonService, *this );
-
- // set the DPI value for font rendering
- Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
- if( fontClient )
- {
- fontClient.SetDpi( mDpi.x, mDpi.y );
- }
- }
-
- ~ToolkitTestApplication()
- {
- // Need to delete core before we delete the adaptor.
- delete mCore;
- mCore = NULL;
- }
+ float verticalDpi = DEFAULT_VERTICAL_DPI );
- //ToolkitOrientation& GetOrientation()
- //{
- //return mOrientation;
- //}
-
- /**
- * @brief Creates an adaptor implementation for those controls like the
- * text-field and the text-editor which connects a callback to the idle signal.
- */
- void CreateAdaptor()
- {
- Adaptor::Get();
- }
+ ~ToolkitTestApplication() override;
/**
* @brief Executes the idle callbacks.
* Some controls like the text-field and the text-editor connect callbacks to the
* idle signal.
*/
- void RunIdles()
- {
- if( Adaptor::IsAvailable() )
- {
- for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
- endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
- it != endIt;
- ++it )
- {
- CallbackBase* callback = *it;
-
- CallbackBase::Execute( *callback );
- }
-
- Internal::Adaptor::Adaptor::mCallbacks.Clear();
- }
- }
+ void RunIdles();
private:
- //ToolkitOrientation mOrientation;
+
+ std::unique_ptr<Dali::Window> mMainWindow;
+ std::unique_ptr< Adaptor > mAdaptor;
};
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEST_APPLICATION_H__
+#endif // DALI_TOOLKIT_TEST_APPLICATION_H