} // unnamed namespace
-Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
{
Any surface;
- return Window::New(surface, positionSize, name, className, isTransparent);
+ return Window::New(surface, positionSize, name, className, type, isTransparent);
}
-Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
{
Window* window = new Window();
window->mIsTransparent = isTransparent;
- window->Initialize(surface, positionSize, name, className);
+ window->Initialize(surface, positionSize, name, className, type);
return window;
}
mIsFocusAcceptable(true),
mIconified(false),
mOpaqueState(false),
- mResizeEnabled(false),
- mType(WindowType::NORMAL),
mParentWindow(NULL),
mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
mRotationAngle(0),
{
if(mAdaptor)
{
- auto bridge = Accessibility::Bridge::GetCurrentBridge();
- auto accessible2 = mScene.GetRootLayer();
- auto accessible = Accessibility::Accessible::Get(accessible2);
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto rootLayer = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get(rootLayer);
bridge->RemoveTopLevelWindow(accessible);
mAdaptor->RemoveWindow(this);
}
}
-void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className)
+void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type)
{
// Create a window render surface
auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
// Get a window base
mWindowBase = mWindowSurface->GetWindowBase();
+ // Set Window Type
+ mWindowBase->SetType(type);
+
+ // Initialize for Ime window type
+ if(type == WindowType::IME)
+ {
+ mWindowBase->InitializeIme();
+ mWindowSurface->InitializeImeSurface();
+ }
+
// Connect signals
mWindowBase->IconifyChangedSignal().Connect(this, &Window::OnIconifyChanged);
mWindowBase->FocusChangedSignal().Connect(this, &Window::OnFocusChanged);
mWindowBase->TransitionEffectEventSignal().Connect(this, &Window::OnTransitionEffectEvent);
mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect(this, &Window::OnKeyboardRepeatSettingsChanged);
mWindowBase->WindowRedrawRequestSignal().Connect(this, &Window::OnWindowRedrawRequest);
+ mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize);
mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
- if(!positionSize.IsEmpty())
- {
- AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
- mResizeEnabled = true;
- }
+ AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
SetClass(name, className);
mEventHandler->AddObserver(*this);
auto bridge = Accessibility::Bridge::GetCurrentBridge();
- auto v = mScene.GetRootLayer();
- auto accessible = Accessibility::Accessible::Get(v, true);
+ auto rootLayer = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get(rootLayer, true);
bridge->AddTopLevelWindow(accessible);
// If you call the 'Show' before creating the adaptor, the application cannot know the app resource id.
return preferredOrientation;
}
+void Window::SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation)
+{
+ int angle = ConvertToAngle(orientation);
+ mWindowBase->SetPositionSizeWithAngle(positionSize, angle);
+}
+
void Window::SetAvailableAnlges(const std::vector<int>& angles)
{
if(angles.size() > 4)
if(!mIconified)
{
- WindowVisibilityObserver* observer(mAdaptor);
- observer->OnWindowShown();
-
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, true);
+
+ WindowVisibilityObserver* observer(mAdaptor);
+ observer->OnWindowShown();
}
mSurface->SetFullSwapNextFrame();
if(!mIconified)
{
- WindowVisibilityObserver* observer(mAdaptor);
- observer->OnWindowHidden();
-
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, false);
+
+ WindowVisibilityObserver* observer(mAdaptor);
+ observer->OnWindowHidden();
}
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
void Window::SetType(WindowType type)
{
- if(type != mType)
- {
- mWindowBase->SetType(type);
-
- mType = type;
- }
+ mWindowBase->SetType(type);
}
WindowType Window::GetType() const
{
- return mType;
+ return mWindowBase->GetType();
}
WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level)
{
- if(mType != WindowType::NOTIFICATION)
+ WindowType type = mWindowBase->GetType();
+ if(type != WindowType::NOTIFICATION)
{
- DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType);
+ DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", type);
return WindowOperationResult::INVALID_OPERATION;
}
WindowNotificationLevel Window::GetNotificationLevel() const
{
- if(mType != WindowType::NOTIFICATION)
+ WindowType type = mWindowBase->GetType();
+ if(type != WindowType::NOTIFICATION)
{
- DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType);
+ DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", type);
return WindowNotificationLevel::NONE;
}
void Window::SetSize(Dali::Window::WindowSize size)
{
- if(!mResizeEnabled)
- {
- AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
- mResizeEnabled = true;
- }
-
PositionSize oldRect = mSurface->GetPositionSize();
mWindowSurface->MoveResize(PositionSize(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
}
mSurface->SetFullSwapNextFrame();
+
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer(), true)->EmitBoundsChanged(Dali::Rect<>(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
}
Dali::Window::WindowSize Window::GetSize() const
void Window::SetPosition(Dali::Window::WindowPosition position)
{
- if(!mResizeEnabled)
- {
- AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
- mResizeEnabled = true;
- }
-
PositionSize oldRect = mSurface->GetPositionSize();
mWindowSurface->MoveResize(PositionSize(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
mSurface->SetFullSwapNextFrame();
+
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer(), true)->EmitBoundsChanged(Dali::Rect<>(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
}
Dali::Window::WindowPosition Window::GetPosition() const
return Dali::Window::WindowPosition(positionSize.x, positionSize.y);
}
-void Window::SetPositionSize(PositionSize positionSize)
+PositionSize Window::GetPositionSize() const
{
- if(!mResizeEnabled)
- {
- AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
- mResizeEnabled = true;
- }
+ return mSurface->GetPositionSize();
+}
+void Window::SetPositionSize(PositionSize positionSize)
+{
PositionSize oldRect = mSurface->GetPositionSize();
mWindowSurface->MoveResize(positionSize);
}
mSurface->SetFullSwapNextFrame();
-}
-PositionSize Window::GetPositionSize() const
-{
- return mSurface->GetPositionSize();
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer(), true)->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
}
Dali::Layer Window::GetRootLayer() const
if(mVisible)
{
- WindowVisibilityObserver* observer(mAdaptor);
- observer->OnWindowHidden();
-
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, false);
+
+ WindowVisibilityObserver* observer(mAdaptor);
+ observer->OnWindowHidden();
}
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible);
if(mVisible)
{
- WindowVisibilityObserver* observer(mAdaptor);
- observer->OnWindowShown();
-
Dali::Window handle(this);
mVisibilityChangedSignal.Emit(handle, true);
+
+ WindowVisibilityObserver* observer(mAdaptor);
+ observer->OnWindowShown();
}
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible);
mSurface->SetFullSwapNextFrame();
- if(auto b = Dali::Accessibility::Bridge::GetCurrentBridge())
+ if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
{
if(focusIn)
{
- b->ApplicationShown();
+ bridge->WindowShown();
}
else
{
- b->ApplicationHidden();
+ bridge->WindowHidden();
}
}
}
mAdaptor->RenderOnce();
}
+void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
+{
+ SetPositionSize(positionSize);
+}
+
void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
{
FeedTouchPoint(point, timeStamp);
{
Dali::DevelWindow::Unparent(parent);
}
- mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase);
+ mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, false);
+ }
+}
+
+void Window::SetParent(Dali::Window& parent, bool belowParent)
+{
+ if(DALI_UNLIKELY(parent))
+ {
+ mParentWindow = parent;
+ Dali::Window self = Dali::Window(this);
+ // check circular parent window setting
+ if(Dali::DevelWindow::GetParent(parent) == self)
+ {
+ Dali::DevelWindow::Unparent(parent);
+ }
+ mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, belowParent);
}
}
void Window::Unparent()
{
- mWindowBase->SetParent(nullptr);
+ mWindowBase->SetParent(nullptr, false);
mParentWindow.Reset();
}
return mWindowBase->GetNativeWindowId();
}
+void Window::RequestMoveToServer()
+{
+ mWindowBase->RequestMoveToServer();
+}
+
+void Window::RequestResizeToServer(WindowResizeDirection direction)
+{
+ mWindowBase->RequestResizeToServer(direction);
+}
+
+void Window::EnableFloatingMode(bool enable)
+{
+ mWindowBase->EnableFloatingMode(enable);
+}
+
+void Window::IncludeInputRegion(const Rect<int>& inputRegion)
+{
+ mWindowBase->IncludeInputRegion(inputRegion);
+}
+
+void Window::ExcludeInputRegion(const Rect<int>& inputRegion)
+{
+ mWindowBase->ExcludeInputRegion(inputRegion);
+}
+
} // namespace Adaptor
} // namespace Internal