/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/integration-api/scene.h>
#include <test-application.h>
#include <toolkit-adaptor-impl.h>
+#include <toolkit-application.h>
#include <toolkit-async-task-manager.h>
#include <toolkit-scene-holder-impl.h>
#include <toolkit-test-application.h>
AddWindow(&GetImplementation(window));
}
+void Adaptor::Stop()
+{
+ if(mTestApplication)
+ {
+ Integration::Core& core = mTestApplication->GetCore();
+ tet_printf("Adaptor::UnregisterProcessors\n");
+ core.UnregisterProcessors();
+ }
+
+ mStopped = true;
+}
+
Integration::Scene Adaptor::GetScene(Dali::Window window)
{
return window.GetScene();
bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
{
- if(hasReturnValue)
- {
- mReturnCallbacks.PushBack(callback);
- }
- else
+ if(ToolkitApplication::ADD_IDLE_SUCCESS)
{
- mCallbacks.PushBack(callback);
+ if(hasReturnValue)
+ {
+ mReturnCallbacks.PushBack(callback);
+ }
+ else
+ {
+ mCallbacks.PushBack(callback);
+ }
}
- return true;
+ return ToolkitApplication::ADD_IDLE_SUCCESS;
}
void Adaptor::RemoveIdle(CallbackBase* callback)
{
- mCallbacks.Erase(std::remove_if(mCallbacks.Begin(), mCallbacks.End(), [&callback](CallbackBase* current) { return callback == current; }), mCallbacks.End());
- mReturnCallbacks.Erase(std::remove_if(mReturnCallbacks.Begin(), mReturnCallbacks.End(), [&callback](CallbackBase* current) { return callback == current; }), mReturnCallbacks.End());
+ mCallbacks.Erase(std::remove_if(mCallbacks.Begin(), mCallbacks.End(), [&callback](CallbackBase* current)
+ { return callback == current; }),
+ mCallbacks.End());
+ mReturnCallbacks.Erase(std::remove_if(mReturnCallbacks.Begin(), mReturnCallbacks.End(), [&callback](CallbackBase* current)
+ { return callback == current; }),
+ mReturnCallbacks.End());
}
void Adaptor::RunIdles()
mReturnCallbacks.Swap(reusedCallbacks);
}
-Dali::RenderSurfaceInterface& Adaptor::GetSurface()
+void Adaptor::RequestUpdateOnce()
+{
+ if(mTestApplication)
+ {
+ auto scene = mTestApplication->GetScene();
+ if(scene)
+ {
+ tet_printf("Adaptor::RequestUpdateOnce()\n");
+ scene.KeepRendering(0.0f);
+ }
+ }
+}
+
+Dali::Integration::RenderSurfaceInterface& Adaptor::GetSurface()
{
DALI_ASSERT_ALWAYS(!mWindows.empty());
- return reinterpret_cast<Dali::RenderSurfaceInterface&>(mWindows.front()->GetRenderSurface());
+ return reinterpret_cast<Dali::Integration::RenderSurfaceInterface&>(mWindows.front()->GetRenderSurface());
}
Dali::WindowContainer Adaptor::GetWindows()
core.UnregisterProcessor(processor, postProcessor);
}
+void Adaptor::RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+ Integration::Core& core = mTestApplication->GetCore();
+ tet_printf("Adaptor::RegisterProcessorOnce : %s\n", processor.GetProcessorName().data());
+ core.RegisterProcessorOnce(processor, postProcessor);
+}
+
+void Adaptor::UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+ Integration::Core& core = mTestApplication->GetCore();
+ tet_printf("Adaptor::UnregisterProcessorOnce : %s\n", processor.GetProcessorName().data());
+ core.UnregisterProcessorOnce(processor, postProcessor);
+}
+
void Adaptor::SetApplication(Dali::TestApplication& testApplication)
{
mTestApplication = &testApplication;
void Adaptor::Stop()
{
+ mImpl->Stop();
}
bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
mImpl->RemoveIdle(callback);
}
-void Adaptor::ReplaceSurface(Window window, Dali::RenderSurfaceInterface& surface)
+void Adaptor::ReplaceSurface(Window window, Dali::Integration::RenderSurfaceInterface& surface)
{
}
-void Adaptor::ReplaceSurface(Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface)
+void Adaptor::ReplaceSurface(Dali::Integration::SceneHolder window, Dali::Integration::RenderSurfaceInterface& surface)
{
}
return mImpl->WindowCreatedSignal();
}
-Dali::RenderSurfaceInterface& Adaptor::GetSurface()
+Dali::Integration::RenderSurfaceInterface& Adaptor::GetSurface()
{
return mImpl->GetSurface();
}
bool Adaptor::IsAvailable()
{
- return Internal::Adaptor::gAdaptor;
+ return Internal::Adaptor::gAdaptor && (!Internal::Adaptor::Adaptor::GetImpl(*Internal::Adaptor::gAdaptor).IsStopped());
}
void Adaptor::NotifySceneCreated()
mImpl->UnregisterProcessor(processor, postProcessor);
}
+void Adaptor::RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+ mImpl->RegisterProcessorOnce(processor, postProcessor);
+}
+
+void Adaptor::UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+ mImpl->UnregisterProcessorOnce(processor, postProcessor);
+}
+
} // namespace Dali