X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.cpp;h=7c6ebfc22c4b97e313ea9be58e820cb00cf9ce08;hb=6b609829e437193b41eddfa934124fe9a42dea7f;hp=ae3a1175749f067bd5e9db61725bf62e26065365;hpb=bd0526397602e2273a458b4f59a11508fc8b497a;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index ae3a117..7c6ebfc 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -68,6 +67,7 @@ Window* Window::New(Any surface, const std::string& name, const std::string& cla { Window* window = new Window(); window->mIsTransparent = windowData.GetTransparency(); + window->mIsFrontBufferRendering = windowData.GetFrontBufferRendering(); window->Initialize(surface, windowData.GetPositionSize(), name, className, windowData.GetWindowType()); return window; } @@ -96,8 +96,8 @@ Window::Window() mMoveCompletedSignal(), mResizeCompletedSignal(), mInsetsChangedSignal(), + mPointerConstraintsSignal(), mLastKeyEvent(), - mLastTouchEvent(), mIsTransparent(false), mIsFocusAcceptable(true), mIconified(false), @@ -106,7 +106,9 @@ Window::Window() mWindowRotationAcknowledgement(false), mFocused(false), mIsWindowRotating(false), - mIsEnabledUserGeometry(false) + mIsEnabledUserGeometry(false), + mIsEmittedWindowCreatedEvent(false), + mIsFrontBufferRendering(false) { } @@ -167,6 +169,7 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std 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); @@ -208,6 +211,11 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std // For Debugging mNativeWindowId = mWindowBase->GetNativeWindowId(); + + if(mIsFrontBufferRendering) + { + SetFrontBufferRendering(mIsFrontBufferRendering); + } } void Window::SetRenderNotification(TriggerEventInterface* renderNotification) @@ -225,22 +233,27 @@ void Window::OnAdaptorSet(Dali::Adaptor& adaptor) 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(); @@ -1059,7 +1072,6 @@ void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize) void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp) { - mLastTouchEvent = Dali::Integration::NewTouchEvent(timeStamp, point); FeedTouchPoint(point, timeStamp); } @@ -1081,11 +1093,21 @@ void Window::OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseIn mMouseInOutEventSignal.Emit(handle, mouseInOutEvent); } -void Window::OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& MouseRelativeEvent) +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); - mMouseRelativeEventSignal.Emit(handle, MouseRelativeEvent); + Vector2 newPosition = RecalculatePosition(Vector2(position.GetX(), position.GetY())); + Dali::DevelWindow::PointerConstraintsEvent pointerConstraintsEvent(static_cast(newPosition.x), static_cast(newPosition.y), locked, confined); + + mPointerConstraintsSignal.Emit(handle, pointerConstraintsEvent); } void Window::OnRotation(const RotationEvent& rotation) @@ -1156,16 +1178,26 @@ void Window::OnAccessibilityEnabled() 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); } } @@ -1176,6 +1208,7 @@ void Window::OnAccessibilityDisabled() 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) @@ -1388,11 +1421,6 @@ const Dali::KeyEvent& Window::GetLastKeyEvent() const return mLastKeyEvent; } -const Dali::TouchEvent& Window::GetLastTouchEvent() const -{ - return mLastTouchEvent; -} - void Window::SetUserGeometryPolicy() { if(mIsEnabledUserGeometry == true) @@ -1430,6 +1458,42 @@ 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