-#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) 2014 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 <memory>
+
// INTERNAL INCLUDES
#include <dali-test-suite-utils.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <toolkit-adaptor-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
+#include "test-application.h"
-#include "toolkit-orientation.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( false, surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
+ float verticalDpi = DEFAULT_VERTICAL_DPI );
+
+ ~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();
+
+ Dali::Window GetWindow()
{
- Initialize();
+ return mMainWindow;
}
- ~ToolkitTestApplication()
+ Dali::Adaptor& GetAdaptor()
{
- // Need to delete core before we delete the adaptor.
- delete mCore;
- mCore = NULL;
+ return *mAdaptor;
}
- //ToolkitOrientation& GetOrientation()
- //{
- //return mOrientation;
- //}
-
private:
- //ToolkitOrientation mOrientation;
+ Dali::Window mMainWindow;
+ std::unique_ptr< Adaptor > mAdaptor;
};
} // namespace Dali
-inline ImageActor CreateSolidColorImageActor(ToolkitTestApplication& application, const Vector4& color, int width, int height)
-{
- ImageActor actor = ImageActor::New(CreateBitmapImage(width, height, color));
- application.SendNotification();
- application.Render();
- return actor;
-}
-
-
-#endif // __DALI_TOOLKIT_TEST_APPLICATION_H__
+#endif // DALI_TOOLKIT_TEST_APPLICATION_H