/*
- * Copyright (c) 2018 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.
*/
// CLASS HEADER
-#include <dali/integration-api/adaptor.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/public-api/object/object-registry.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
#include <dali/devel-api/adaptor-framework/style-monitor.h>
-#include <dali/integration-api/render-surface.h>
+#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
+#include <dali/integration-api/adaptor-framework/scene-holder.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/thread-controller-interface.h>
+#include <dali/internal/window-system/common/window-impl.h>
namespace Dali
{
-
-Adaptor& Adaptor::New( Window window )
+Adaptor& Adaptor::New(Window window)
{
- return New( window, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+ Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation(window);
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New(Dali::Integration::SceneHolder(sceneHolder), NULL);
+ return *adaptor;
}
-Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New(Window window, const Dali::RenderSurfaceInterface& surface)
{
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( window, configuration, NULL );
+ 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, NULL, Dali::Internal::Adaptor::ThreadMode::NORMAL);
return *adaptor;
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
+Adaptor& Adaptor::New(Dali::Integration::SceneHolder window)
{
- return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New(window, NULL);
+ return *adaptor;
}
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New(Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface)
{
- Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
- Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
+ Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface*>(&surface);
+ Adaptor* adaptor = Internal::Adaptor::Adaptor::New(window, pSurface, NULL, Dali::Internal::Adaptor::ThreadMode::NORMAL);
return *adaptor;
}
mImpl->Stop();
}
-bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
+bool Adaptor::AddIdle(CallbackBase* callback, bool hasReturnValue)
+{
+ DALI_ASSERT_ALWAYS(IsAvailable() && "Adaptor not instantiated");
+ return mImpl->AddIdle(callback, hasReturnValue);
+}
+
+bool Adaptor::AddWindow(Dali::Integration::SceneHolder childWindow)
+{
+ DALI_ASSERT_ALWAYS(IsAvailable() && "Adaptor not instantiated");
+ return mImpl->AddWindow(childWindow);
+}
+
+void Adaptor::RemoveIdle(CallbackBase* callback)
{
- return mImpl->AddIdle( callback, hasReturnValue, false );
+ DALI_ASSERT_ALWAYS(IsAvailable() && "Adaptor not instantiated");
+ mImpl->RemoveIdle(callback);
}
-void Adaptor::RemoveIdle( CallbackBase* callback )
+void Adaptor::ProcessIdle()
{
- mImpl->RemoveIdle( callback );
+ DALI_ASSERT_ALWAYS(IsAvailable() && "Adaptor not instantiated");
+ mImpl->ProcessIdle();
}
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface(Window window, Dali::RenderSurfaceInterface& surface)
{
- mImpl->ReplaceSurface(nativeWindow, surface);
+ Internal::Adaptor::SceneHolder* sceneHolder = &Dali::GetImplementation(window);
+ mImpl->ReplaceSurface(Dali::Integration::SceneHolder(sceneHolder), surface);
+}
+
+void Adaptor::ReplaceSurface(Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface)
+{
+ mImpl->ReplaceSurface(window, surface);
}
Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
return mImpl->LanguageChangedSignal();
}
-RenderSurface& Adaptor::GetSurface()
+Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+{
+ return mImpl->WindowCreatedSignal();
+}
+
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
{
return mImpl->GetSurface();
}
return mImpl->GetNativeWindowHandle();
}
+Any Adaptor::GetNativeWindowHandle(Actor actor)
+{
+ return mImpl->GetNativeWindowHandle(actor);
+}
+
Any Adaptor::GetGraphicsDisplay()
{
return mImpl->GetGraphicsDisplay();
mImpl->ReleaseSurfaceLock();
}
-void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
-{
- mImpl->SetRenderRefreshRate( numberOfVSyncsPerRender );
-}
-
-void Adaptor::SetPreRenderCallback( CallbackBase* callback )
+void Adaptor::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender)
{
- mImpl->SetPreRenderCallback( callback );
+ mImpl->SetRenderRefreshRate(numberOfVSyncsPerRender);
}
-void Adaptor::SetUseHardwareVSync(bool useHardware)
+void Adaptor::SetPreRenderCallback(CallbackBase* callback)
{
- mImpl->SetUseHardwareVSync( useHardware );
+ mImpl->SetPreRenderCallback(callback);
}
Adaptor& Adaptor::Get()
mImpl->NotifyLanguageChanged();
}
-void Adaptor::SetMinimumPinchDistance(float distance)
-{
- mImpl->SetMinimumPinchDistance(distance);
-}
-
-void Adaptor::FeedTouchPoint( TouchPoint& point, int timeStamp )
+void Adaptor::FeedTouchPoint(TouchPoint& point, int timeStamp)
{
mImpl->FeedTouchPoint(point, timeStamp);
}
-void Adaptor::FeedWheelEvent( WheelEvent& wheelEvent )
+void Adaptor::FeedWheelEvent(WheelEvent& wheelEvent)
{
mImpl->FeedWheelEvent(wheelEvent);
}
-void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
+void Adaptor::FeedKeyEvent(KeyEvent& keyEvent)
{
mImpl->FeedKeyEvent(keyEvent);
}
mImpl->SceneCreated();
}
+void Adaptor::SurfaceResizePrepare(Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize)
+{
+ mImpl->SurfaceResizePrepare(surface, surfaceSize);
+}
+
+void Adaptor::SurfaceResizeComplete(Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize)
+{
+ mImpl->SurfaceResizeComplete(surface, surfaceSize);
+}
+
void Adaptor::RenderOnce()
{
mImpl->RenderOnce();
}
+void Adaptor::FlushUpdateMessages()
+{
+ mImpl->FlushUpdateMessages();
+}
+
+void Adaptor::RequestProcessEventsOnIdle()
+{
+ mImpl->RequestProcessEventsOnIdle();
+}
+
const LogFactoryInterface& Adaptor::GetLogFactory()
{
return mImpl->GetLogFactory();
}
-void Adaptor::RegisterProcessor( Integration::Processor& processor )
+const TraceFactoryInterface& Adaptor::GetTraceFactory()
+{
+ return mImpl->GetTraceFactory();
+}
+
+void Adaptor::RegisterProcessor(Integration::Processor& processor, bool postProcessor)
+{
+ mImpl->RegisterProcessor(processor, postProcessor);
+}
+
+void Adaptor::UnregisterProcessor(Integration::Processor& processor, bool postProcessor)
+{
+ mImpl->UnregisterProcessor(processor, postProcessor);
+}
+
+Dali::WindowContainer Adaptor::GetWindows() const
+{
+ return mImpl->GetWindows();
+}
+
+SceneHolderList Adaptor::GetSceneHolders() const
+{
+ return mImpl->GetSceneHolders();
+}
+
+Dali::ObjectRegistry Adaptor::GetObjectRegistry() const
+{
+ return mImpl->GetObjectRegistry();
+}
+
+void Adaptor::OnWindowShown()
{
- mImpl->RegisterProcessor( processor );
+ mImpl->OnWindowShown();
}
-void Adaptor::UnregisterProcessor( Integration::Processor& processor )
+void Adaptor::OnWindowHidden()
{
- mImpl->UnregisterProcessor( processor );
+ mImpl->OnWindowHidden();
}
Adaptor::Adaptor()
-: mImpl( NULL )
+: mImpl(NULL)
{
}