#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/adaptor-framework/window-enumerations.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/rendering/frame-buffer.h>
#include <thread>
#endif
} // unnamed namespace
-Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
+Window* Window::New(const std::string& name, const std::string& className, const WindowData& windowData)
{
Any surface;
- return Window::New(surface, positionSize, name, className, type, isTransparent);
+ return Window::New(surface, name, className, windowData);
}
-Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
+Window* Window::New(Any surface, const std::string& name, const std::string& className, const WindowData& windowData)
{
Window* window = new Window();
- window->mIsTransparent = isTransparent;
- window->Initialize(surface, positionSize, name, className, type);
+ window->mIsTransparent = windowData.GetTransparency();
+ window->Initialize(surface, windowData.GetPositionSize(), name, className, windowData.GetWindowType());
return window;
}
mMovedSignal(),
mOrientationChangedSignal(),
mMouseInOutEventSignal(),
+ mMouseRelativeEventSignal(),
mMoveCompletedSignal(),
mResizeCompletedSignal(),
+ mInsetsChangedSignal(),
mLastKeyEvent(),
mLastTouchEvent(),
mIsTransparent(false),
mOpaqueState(false),
mWindowRotationAcknowledgement(false),
mFocused(false),
- mIsWindowRotating(false)
+ mIsWindowRotating(false),
+ mIsEnabledUserGeometry(false)
{
}
mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize);
mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage);
mWindowBase->MouseInOutEventSignal().Connect(this, &Window::OnMouseInOutEvent);
+ mWindowBase->MouseRelativeEventSignal().Connect(this, &Window::OnMouseRelativeEvent);
mWindowBase->MoveCompletedSignal().Connect(this, &Window::OnMoveCompleted);
mWindowBase->ResizeCompletedSignal().Connect(this, &Window::OnResizeCompleted);
mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
- AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
+ mWindowBase->InsetsChangedSignal().Connect(this, &Window::OnInsetsChanged);
SetClass(name, className);
mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT;
}
- if(positionSize.width <= 0 || positionSize.height <= 0)
+ mWindowWidth = positionSize.width;
+ mWindowHeight = positionSize.height;
+
+ bool isSetWithScreenSize = false;
+ if(mWindowWidth <= 0 || mWindowHeight <= 0)
{
- mWindowWidth = screenWidth;
- mWindowHeight = screenHeight;
+ mWindowWidth = screenWidth;
+ mWindowHeight = screenHeight;
+ isSetWithScreenSize = true;
+ DALI_LOG_RELEASE_INFO("Window size is set with screen size(%d x %d)\n", mWindowWidth, mWindowHeight);
}
- else
+
+ if(isSetWithScreenSize == false || positionSize.x != 0 || positionSize.y != 0)
{
- mWindowWidth = positionSize.width;
- mWindowHeight = positionSize.height;
+ SetUserGeometryPolicy();
}
// For Debugging
return mScene.GetLayer(depth);
}
-Dali::RenderTaskList Window::GetRenderTaskList() const
+void Window::KeepRendering(float durationSeconds)
{
- return mScene.GetRenderTaskList();
+ mScene.KeepRendering(durationSeconds);
+}
+
+void Window::SetPartialUpdateEnabled(bool enabled)
+{
+ mScene.SetPartialUpdateEnabled(enabled);
+}
+
+bool Window::IsPartialUpdateEnabled() const
+{
+ return mScene.IsPartialUpdateEnabled();
}
std::string Window::GetNativeResourceId() const
newRect.width = size.GetWidth();
newRect.height = size.GetHeight();
+ SetUserGeometryPolicy();
+
// When surface size is updated, inform adaptor of resizing and emit ResizeSignal
if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
{
int32_t newX = position.GetX();
int32_t newY = position.GetY();
+ SetUserGeometryPolicy();
+
mWindowSurface->Move(PositionSize(newX, newY, oldRect.width, oldRect.height));
if((oldRect.x != newX) || (oldRect.y != newY))
PositionSize oldRect = GetPositionSize();
Dali::Window handle(this);
+ SetUserGeometryPolicy();
+
if((oldRect.x != positionSize.x) || (oldRect.y != positionSize.y))
{
moved = true;
void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
{
+ SetUserGeometryPolicy();
mWindowBase->SetLayout(numCols, numRows, column, row, colSpan, rowSpan);
}
mMouseInOutEventSignal.Emit(handle, mouseInOutEvent);
}
+void Window::OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& MouseRelativeEvent)
+{
+ Dali::Window handle(this);
+
+ mMouseRelativeEventSignal.Emit(handle, MouseRelativeEvent);
+}
+
void Window::OnRotation(const RotationEvent& rotation)
{
PositionSize newPositionSize(rotation.x, rotation.y, rotation.width, rotation.height);
mAuxiliaryMessageSignal.Emit(key, value, options);
}
+void Window::OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets)
+{
+ mInsetsChangedSignal.Emit(partType, partState, insets);
+}
+
void Window::OnAccessibilityEnabled()
{
auto bridge = Accessibility::Bridge::GetCurrentBridge();
void Window::RequestMoveToServer()
{
+ SetUserGeometryPolicy();
mWindowBase->RequestMoveToServer();
}
void Window::RequestResizeToServer(WindowResizeDirection direction)
{
+ SetUserGeometryPolicy();
mWindowBase->RequestResizeToServer(direction);
}
mWindowBase->EnableFloatingMode(enable);
}
+bool Window::IsFloatingModeEnabled()
+{
+ return mWindowBase->IsFloatingModeEnabled();
+}
+
void Window::IncludeInputRegion(const Rect<int>& inputRegion)
{
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), IncludeInputRegion, (%d,%d), (%d x %d)\n", this, mNativeWindowId, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height);
return mLastTouchEvent;
}
+void Window::SetUserGeometryPolicy()
+{
+ if(mIsEnabledUserGeometry == true)
+ {
+ return;
+ }
+
+ mIsEnabledUserGeometry = true;
+ AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), window user.geometry is changed\n", this, mNativeWindowId);
+}
+
+bool Window::PointerConstraintsLock()
+{
+ return mWindowBase->PointerConstraintsLock();
+}
+
+bool Window::PointerConstraintsUnlock()
+{
+ return mWindowBase->PointerConstraintsUnlock();
+}
+
+void Window::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ mWindowBase->LockedPointerRegionSet(x, y, width, height);
+}
+
+void Window::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+ mWindowBase->LockedPointerCursorPositionHintSet(x, y);
+}
+
+bool Window::PointerWarp(int32_t x, int32_t y)
+{
+ return mWindowBase->PointerWarp(x, y);
+}
+
} // namespace Adaptor
} // namespace Internal