#include <dali/devel-api/events/key-event-devel.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/actors/layer.h>
mMovedSignal(),
mOrientationChangedSignal(),
mMouseInOutEventSignal(),
+ mMouseRelativeEventSignal(),
mMoveCompletedSignal(),
mResizeCompletedSignal(),
mInsetsChangedSignal(),
+ mPointerConstraintsSignal(),
mLastKeyEvent(),
- mLastTouchEvent(),
mIsTransparent(false),
mIsFocusAcceptable(true),
mIconified(false),
mWindowRotationAcknowledgement(false),
mFocused(false),
mIsWindowRotating(false),
- mIsEnabledUserGeometry(false)
+ mIsEnabledUserGeometry(false),
+ mIsEmittedWindowCreatedEvent(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);
+ mWindowBase->PointerConstraintsSignal().Connect(this, &Window::OnPointerConstraints);
mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
mEventHandler = EventHandlerPtr(new EventHandler(mWindowSurface->GetWindowBase(), *mAdaptor));
mEventHandler->AddObserver(*this);
- // Add Window to bridge for ATSPI
- auto bridge = Accessibility::Bridge::GetCurrentBridge();
- if(bridge->IsUp())
+ if(mWindowBase->GetType() == WindowType::IME)
{
- auto rootLayer = mScene.GetRootLayer();
- auto accessible = Accessibility::Accessible::Get(rootLayer);
- bridge->AddTopLevelWindow(accessible);
-
- // Emit Window create event
- // Create and Destory signal only emit in multi-window environment, so it does not emit on default layer.
- bridge->Emit(accessible, Accessibility::WindowEvent::CREATE);
+ mWindowBase->InitializeIme();
+ mWindowSurface->InitializeImeSurface();
}
+ // Add Window to bridge for ATSPI
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+
bridge->EnabledSignal().Connect(this, &Window::OnAccessibilityEnabled);
bridge->DisabledSignal().Connect(this, &Window::OnAccessibilityDisabled);
+ if(bridge->IsUp())
+ {
+ OnAccessibilityEnabled();
+ }
+ else
+ {
+ OnAccessibilityDisabled();
+ }
+
// If you call the 'Show' before creating the adaptor, the application cannot know the app resource id.
// The show must be called after the adaptor is initialized.
Show();
void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
{
- mLastTouchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
FeedTouchPoint(point, timeStamp);
}
mMouseInOutEventSignal.Emit(handle, mouseInOutEvent);
}
+void Window::OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& mouseRelativeEvent)
+{
+ Dali::Window handle(this);
+
+ mMouseRelativeEventSignal.Emit(handle, mouseRelativeEvent);
+}
+
+void Window::OnPointerConstraints(const Dali::Int32Pair& position, bool locked, bool confined)
+{
+ Dali::Window handle(this);
+
+ Vector2 newPosition = RecalculatePosition(Vector2(position.GetX(), position.GetY()));
+ Dali::DevelWindow::PointerConstraintsEvent pointerConstraintsEvent(static_cast<int32_t>(newPosition.x), static_cast<int32_t>(newPosition.y), locked, confined);
+
+ mPointerConstraintsSignal.Emit(handle, pointerConstraintsEvent);
+}
+
void Window::OnRotation(const RotationEvent& rotation)
{
PositionSize newPositionSize(rotation.x, rotation.y, rotation.width, rotation.height);
auto accessible = Accessibility::Accessible::Get(rootLayer);
bridge->AddTopLevelWindow(accessible);
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is enabled\n", this, mNativeWindowId);
+
+ Dali::Window handle(this);
+ if(!mIsEmittedWindowCreatedEvent)
+ {
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Emit Accessbility Window Created Event\n", this, mNativeWindowId);
+ bridge->WindowCreated(handle);
+ mIsEmittedWindowCreatedEvent = true;
+ }
+
if(!mVisible || mIconified)
{
return;
}
- Dali::Window handle(this);
bridge->WindowShown(handle);
if(mFocused)
{
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Emit Accessbility Window Focused Event\n", this, mNativeWindowId);
bridge->WindowFocused(handle);
}
}
auto rootLayer = mScene.GetRootLayer();
auto accessible = Accessibility::Accessible::Get(rootLayer);
bridge->RemoveTopLevelWindow(accessible);
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is disabled\n", this, mNativeWindowId);
}
void Window::OnMoveCompleted(Dali::Window::WindowPosition& position)
return mLastKeyEvent;
}
-const Dali::TouchEvent& Window::GetLastTouchEvent() const
-{
- return mLastTouchEvent;
-}
-
void Window::SetUserGeometryPolicy()
{
if(mIsEnabledUserGeometry == true)
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);
+}
+
+void Window::CursorVisibleSet(bool visible)
+{
+ mWindowBase->CursorVisibleSet(visible);
+}
+
+bool Window::KeyboardGrab(Device::Subclass::Type deviceSubclass)
+{
+ return mWindowBase->KeyboardGrab(deviceSubclass);
+}
+
+bool Window::KeyboardUnGrab()
+{
+ return mWindowBase->KeyboardUnGrab();
+}
+
+void Window::SetFullScreen(bool fullscreen)
+{
+ mWindowBase->SetFullScreen(fullscreen);
+}
+
+bool Window::GetFullScreen()
+{
+ return mWindowBase->GetFullScreen();
+}
+
+void Window::SetFrontBufferRendering(bool enable)
+{
+ mWindowBase->SetFrontBufferRendering(enable);
+ mWindowSurface->SetFrontBufferRendering(enable);
+}
+
+bool Window::GetFrontBufferRendering()
+{
+ return mWindowBase->GetFrontBufferRendering();
+}
+
} // namespace Adaptor
} // namespace Internal