/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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 <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/public-api/events/key-event.h>
-#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/events/wheel-event.h>
// INTERNAL INCLUDES
namespace Dali
{
-
namespace DevelWindow
{
-
Window New(Any surface, PositionSize windowPosition, const std::string& name, bool isTransparent)
{
return DevelWindow::New(surface, windowPosition, name, "", isTransparent);
Window newWindow;
const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
- bool isNewWindowAllowed = true;
+ bool isNewWindowAllowed = true;
- if (isAdaptorAvailable)
+ if(isAdaptorAvailable)
{
Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
- isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
+ isNewWindowAllowed = Internal::Adaptor::Adaptor::GetImplementation(adaptor).IsMultipleWindowSupported();
}
- if (isNewWindowAllowed)
+ if(isNewWindowAllowed)
{
- Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, isTransparent);
+ Internal::Adaptor::Window* window = Internal::Adaptor::Window::New(surface, windowPosition, name, className, WindowType::NORMAL, isTransparent);
Integration::SceneHolder sceneHolder = Integration::SceneHolder(window);
- if (isAdaptorAvailable)
+ if(isAdaptorAvailable)
{
Dali::Adaptor& adaptor = Internal::Adaptor::Adaptor::Get();
- Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder, name, className, isTransparent);
+ Internal::Adaptor::Adaptor::GetImplementation(adaptor).AddWindow(sceneHolder);
}
newWindow = Window(window);
}
return newWindow;
}
-void SetPositionSize( Window window, PositionSize positionSize )
+void SetPositionSize(Window window, PositionSize positionSize)
+{
+ GetImplementation(window).SetPositionSize(positionSize);
+}
+
+Window Get(Actor actor)
+{
+ return Internal::Adaptor::Window::Get(actor);
+}
+
+EventProcessingFinishedSignalType& EventProcessingFinishedSignal(Window window)
+{
+ return GetImplementation(window).EventProcessingFinishedSignal();
+}
+
+WheelEventSignalType& WheelEventSignal(Window window)
+{
+ return GetImplementation(window).WheelEventSignal();
+}
+
+VisibilityChangedSignalType& VisibilityChangedSignal(Window window)
+{
+ return GetImplementation(window).VisibilityChangedSignal();
+}
+
+TransitionEffectEventSignalType& TransitionEffectEventSignal(Window window)
+{
+ return GetImplementation(window).TransitionEffectEventSignal();
+}
+
+KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window)
+{
+ return GetImplementation(window).KeyboardRepeatSettingsChangedSignal();
+}
+
+AuxiliaryMessageSignalType& AuxiliaryMessageSignal(Window window)
+{
+ return GetImplementation(window).AuxiliaryMessageSignal();
+}
+
+void SetParent(Window window, Window parent)
+{
+ GetImplementation(window).SetParent(parent);
+}
+
+void SetParent(Window window, Window parent, bool belowParent)
+{
+ GetImplementation(window).SetParent(parent, belowParent);
+}
+
+void Unparent(Window window)
+{
+ GetImplementation(window).Unparent();
+}
+
+Window GetParent(Window window)
+{
+ return GetImplementation(window).GetParent();
+}
+
+Window DownCast(BaseHandle handle)
+{
+ return Window(dynamic_cast<Dali::Internal::Adaptor::Window*>(handle.GetObjectPtr()));
+}
+
+WindowOrientation GetCurrentOrientation(Window window)
+{
+ return GetImplementation(window).GetCurrentOrientation();
+}
+
+int GetPhysicalOrientation(Window window)
{
- GetImplementation( window ).SetPositionSize( positionSize );
+ return GetImplementation(window).GetPhysicalOrientation();
}
-Dali::RenderTaskList GetRenderTaskList( Window window )
+void SetAvailableOrientations(Window window, const Dali::Vector<WindowOrientation>& orientations)
{
- return GetImplementation( window ).GetRenderTaskList();
+ GetImplementation(window).SetAvailableOrientations(orientations);
}
-Window Get( Actor actor )
+int32_t GetNativeId(Window window)
{
- return Internal::Adaptor::Window::Get( actor );
+ return GetImplementation(window).GetNativeId();
}
-EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
+void AddFrameRenderedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
- return GetImplementation( window ).EventProcessingFinishedSignal();
+ GetImplementation(window).AddFrameRenderedCallback(std::move(callback), frameId);
}
-KeyEventSignalType& KeyEventSignal( Window window )
+void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId)
{
- return GetImplementation( window ).KeyEventSignal();
+ GetImplementation(window).AddFramePresentedCallback(std::move(callback), frameId);
}
-TouchSignalType& TouchSignal( Window window )
+void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation)
{
- return GetImplementation( window ).TouchSignal();
+ GetImplementation(window).SetPositionSizeWithOrientation(positionSize, orientation);
}
-WheelEventSignalType& WheelEventSignal( Window window )
+void RequestMoveToServer(Window window)
{
- return GetImplementation( window ).WheelEventSignal();
+ GetImplementation(window).RequestMoveToServer();
}
-VisibilityChangedSignalType& VisibilityChangedSignal( Window window )
+void RequestResizeToServer(Window window, WindowResizeDirection direction)
{
- return GetImplementation( window ).VisibilityChangedSignal();
+ GetImplementation(window).RequestResizeToServer(direction);
}
-TransitionEffectEventSignalType& TransitionEffectEventSignal( Window window )
+void EnableFloatingMode(Window window, bool enable)
{
- return GetImplementation( window ).TransitionEffectEventSignal();
+ GetImplementation(window).EnableFloatingMode(enable);
}
-void SetParent( Window window, Window parent )
+void IncludeInputRegion(Window window, const Rect<int>& inputRegion)
{
- GetImplementation( window ).SetParent( parent );
+ GetImplementation(window).IncludeInputRegion(inputRegion);
}
-void Unparent( Window window )
+void ExcludeInputRegion(Window window, const Rect<int>& inputRegion)
{
- GetImplementation( window ).Unparent();
+ GetImplementation(window).ExcludeInputRegion(inputRegion);
}
-Window GetParent( Window window )
+void SetNeedsRotationCompletedAcknowledgement(Window window, bool needAcknowledgement)
{
- return GetImplementation( window ).GetParent();
+ GetImplementation(window).SetNeedsRotationCompletedAcknowledgement(needAcknowledgement);
}
-Window DownCast( BaseHandle handle )
+void SendRotationCompletedAcknowledgement(Window window)
{
- return Window( dynamic_cast<Dali::Internal::Adaptor::Window*>( handle.GetObjectPtr()) );
+ GetImplementation(window).SendRotationCompletedAcknowledgement();
}
-Dali::Window::WindowOrientation GetCurrentOrientation( Window window )
+bool IsWindowRotating(Window window)
{
- return GetImplementation( window ).GetCurrentOrientation();
+ return GetImplementation(window).IsWindowRotating();
}
-void SetAvailableOrientations( Window window, const Dali::Vector<Dali::Window::WindowOrientation>& orientations )
+void FeedTouchPoint(Window window, const Dali::TouchPoint& point, int32_t timeStamp)
{
- GetImplementation( window ).SetAvailableOrientations( orientations );
+ Integration::Point convertedPoint(point);
+ GetImplementation(window).FeedTouchPoint(convertedPoint, timeStamp);
}
-int32_t GetNativeId( Window window )
+void FeedWheelEvent(Window window, const Dali::WheelEvent& wheelEvent)
{
- return GetImplementation( window ).GetNativeId();
+ Integration::WheelEvent convertedEvent(static_cast<Integration::WheelEvent::Type>(wheelEvent.GetType()), wheelEvent.GetDirection(), wheelEvent.GetModifiers(), wheelEvent.GetPoint(), wheelEvent.GetDelta(), wheelEvent.GetTime());
+ GetImplementation(window).FeedWheelEvent(convertedEvent);
}
-void SetDamagedAreas(Window window, std::vector<Dali::Rect<int>>& areas)
+void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent)
{
- GetImplementation(window).SetDamagedAreas(areas);
+ Integration::KeyEvent convertedEvent(keyEvent.GetKeyName(), keyEvent.GetLogicalKey(), keyEvent.GetKeyString(), keyEvent.GetKeyCode(), keyEvent.GetKeyModifier(), keyEvent.GetTime(), static_cast<Integration::KeyEvent::State>(keyEvent.GetState()), keyEvent.GetCompose(), keyEvent.GetDeviceName(), keyEvent.GetDeviceClass(), keyEvent.GetDeviceSubclass());
+ GetImplementation(window).FeedKeyEvent(convertedEvent);
}
} // namespace DevelWindow