X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.cpp;h=1bc3188c62fc0e438d6c407b8b3d530d96d9ca44;hb=2a78611579429fd810dbbada3b6dff2f222ea592;hp=a5917bdf11b147fbecb2333b8f0380694d05225e;hpb=0d4adf79c0991f674775be199b1f6be17f525ce0;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 a5917bd..1bc3188 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -58,17 +58,17 @@ Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "L } // 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; } @@ -79,7 +79,6 @@ Window::Window() mIsFocusAcceptable(true), mIconified(false), mOpaqueState(false), - mType(WindowType::NORMAL), mParentWindow(NULL), mPreferredAngle(static_cast(WindowOrientation::NO_ORIENTATION_PREFERENCE)), mRotationAngle(0), @@ -100,9 +99,9 @@ Window::~Window() { 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); @@ -114,7 +113,7 @@ Window::~Window() } } -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(); @@ -124,6 +123,16 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std // 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); @@ -162,8 +171,8 @@ void Window::OnAdaptorSet(Dali::Adaptor& adaptor) 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. @@ -298,6 +307,12 @@ WindowOrientation Window::GetPreferredOrientation() return preferredOrientation; } +void Window::SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation) +{ + int angle = ConvertToAngle(orientation); + mWindowBase->SetPositionSizeWithAngle(positionSize, angle); +} + void Window::SetAvailableAnlges(const std::vector& angles) { if(angles.size() > 4) @@ -418,11 +433,11 @@ void Window::Show() if(!mIconified) { - WindowVisibilityObserver* observer(mAdaptor); - observer->OnWindowShown(); - Dali::Window handle(this); mVisibilityChangedSignal.Emit(handle, true); + + WindowVisibilityObserver* observer(mAdaptor); + observer->OnWindowShown(); } mSurface->SetFullSwapNextFrame(); @@ -438,11 +453,11 @@ void Window::Hide() 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); @@ -498,24 +513,20 @@ void Window::SetInputRegion(const Rect& inputRegion) 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; } @@ -524,9 +535,10 @@ WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level 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; } @@ -599,6 +611,8 @@ void Window::SetSize(Dali::Window::WindowSize size) } 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 @@ -615,6 +629,8 @@ void Window::SetPosition(Dali::Window::WindowPosition position) 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 @@ -624,6 +640,11 @@ Dali::Window::WindowPosition Window::GetPosition() const return Dali::Window::WindowPosition(positionSize.x, positionSize.y); } +PositionSize Window::GetPositionSize() const +{ + return mSurface->GetPositionSize(); +} + void Window::SetPositionSize(PositionSize positionSize) { PositionSize oldRect = mSurface->GetPositionSize(); @@ -648,11 +669,8 @@ void Window::SetPositionSize(PositionSize 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 @@ -693,11 +711,11 @@ void Window::OnIconifyChanged(bool iconified) 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); @@ -708,11 +726,11 @@ void Window::OnIconifyChanged(bool iconified) 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); @@ -728,15 +746,15 @@ void Window::OnFocusChanged(bool focusIn) mSurface->SetFullSwapNextFrame(); - if(auto b = Dali::Accessibility::Bridge::GetCurrentBridge()) + if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge()) { if(focusIn) { - b->ApplicationShown(); + bridge->ApplicationShown(); } else { - b->ApplicationHidden(); + bridge->ApplicationHidden(); } } } @@ -962,6 +980,31 @@ int32_t Window::GetNativeId() const 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& inputRegion) +{ + mWindowBase->IncludeInputRegion(inputRegion); +} + +void Window::ExcludeInputRegion(const Rect& inputRegion) +{ + mWindowBase->ExcludeInputRegion(inputRegion); +} + } // namespace Adaptor } // namespace Internal