Supports some tizne window features.
1. Window resized and moved by disply server.
Supports window is resized or moved by display server.
This APIs should be called in mouse down event.
After that, the window is moved or resized with mouse move event.
When mouse up event happens, the job will be finished.
2. floating window mode.
The floating mode is to support making partial size window easliy.
It is useful to make popup style window and this window is always upper than the other normal window.
In addition, it is easy to change between popup style and normal style window.
Change-Id: I2f936a6e28740e061e32c172b7fe90121ecb9e33
GetImplementation(window).SetPositionSizeWithOrientation(positionSize, orientation);
}
+void RequestMoveToServer(Window window)
+{
+ GetImplementation(window).RequestMoveToServer();
+}
+
+void RequestResizeToServer(Window window, WindowResizeDirection direction)
+{
+ GetImplementation(window).RequestResizeToServer(direction);
+}
+
+void EnableFloatingMode(Window window, bool enable)
+{
+ GetImplementation(window).EnableFloatingMode(enable);
+}
+
} // namespace DevelWindow
} // namespace Dali
*/
DALI_ADAPTOR_API void AddFramePresentedCallback(Window window, std::unique_ptr<CallbackBase> callback, int32_t frameId);
- /**
- * @brief Sets window position and size for specific orientation.
- * This api reserves the position and size per orientation to display server.
- * When the device is rotated, the window is moved/resized with the reserved position/size by display server.
- *
- * @param[in] window The window instance
- * @param[in] positionSize The reserved position and size for the orientation
- * @param[in] orientation The orientation
- *
- * @note Currently, it only works when the window's type is WindowType::IME.
- * @note To set WindowType::IME, use Application New(... WindowType type), not Window::SetType().
- * @note This function is only useful in Tizen world.
- */
+/**
+ * @brief Sets window position and size for specific orientation.
+ * This api reserves the position and size per orientation to display server.
+ * When the device is rotated, the window is moved/resized with the reserved position/size by display server.
+ *
+ * @param[in] window The window instance
+ * @param[in] positionSize The reserved position and size for the orientation
+ * @param[in] orientation The orientation
+ *
+ * @note Currently, it only works when the window's type is WindowType::IME.
+ * @note To set WindowType::IME, use Application New(... WindowType type), not Window::SetType().
+ * @note This function is only useful in Tizen world.
+ */
DALI_ADAPTOR_API void SetPositionSizeWithOrientation(Window window, PositionSize positionSize, WindowOrientation orientation);
+/**
+ * @brief Requests to display server for the window is moved by display server.
+ *
+ * This function should be called in mouse down event callback function.
+ * After this function is called in mouse down event callback function, the window is moved with mouse move event.
+ * When mouse up event happens, the window moved work is finished.
+ *
+ * @param[in] window The window instance
+ */
+DALI_ADAPTOR_API void RequestMoveToServer(Window window);
+
+/**
+ * @brief Requests to display server for the window is resized by display server.
+ *
+ * This function should be called in mouse down event callback function.
+ * After this function is called in mouse down event callback function, the window is resized with mouse move event.
+ * The direction is selected one of eight ways.
+ * When mouse up event happens, the window resized work is finished.
+ *
+ * @param[in] window The window instance
+ * @param[in] direction it is indicated the window's side or edge for starting point.
+ */
+DALI_ADAPTOR_API void RequestResizeToServer(Window window, WindowResizeDirection direction);
+
+/**
+ * @brief Enables the floating mode of window.
+ *
+ * The floating mode is to support making partial size window easliy.
+ * It is useful to make popup style window and this window is always upper than the other normal window.
+ * In addition, it is easy to change between popup style and normal style window.
+ *
+ * A special display server(as a Tizen display server) supports this mode.
+ *
+ * @param[in] window The window instance.
+ * @param[in] enable Enable floating mode or not.
+ */
+DALI_ADAPTOR_API void EnableFloatingMode(Window window, bool enable);
+
} // namespace DevelWindow
} // namespace Dali
{
}
+void WindowBaseAndroid::RequestMoveToServer()
+{
+}
+
+void WindowBaseAndroid::RequestResizeToServer(WindowResizeDirection direction)
+{
+}
+
+void WindowBaseAndroid::EnableFloatingMode(bool enable)
+{
+}
+
+bool WindowBaseAndroid::IsFloatingModeEnabled() const
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ImeWindowReadyToRender() override;
+ /**
+ *
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
private:
/**
* Second stage initialization
virtual void WindowRotationCompleted(int degree, int width, int height) = 0;
/**
+ * @brief starts the window is moved by display server
+ */
+ virtual void RequestMoveToServer() = 0;
+
+ /**
+ * @brief starts the window is resized by display server
+ *
+ * @param[in] direction It is direction of the started edge/side.
+ */
+ virtual void RequestResizeToServer(WindowResizeDirection direction) = 0;
+
+ /**
+ * @brief Enables the floating mode of window.
+ *
+ * The floating mode is to support making partial size window easliy.
+ * It is useful to make popup style window
+ * and this window is always upper than the other normal window.
+ *
+ * A special display server(as a Tizen display server) supports this mode.
+ *
+ * @param[in] enable Enable floating mode or not.
+ */
+ virtual void EnableFloatingMode(bool enable) = 0;
+
+ /**
+ * @brief Gets whether floating mode is enabled or not.
+ */
+ virtual bool IsFloatingModeEnabled() const = 0;
+
+ /**
* @copydoc Dali::Window::SetTransparency()
*/
virtual void SetTransparency(bool transparent) = 0;
return Dali::Window::WindowPosition(positionSize.x, positionSize.y);
}
+PositionSize Window::GetPositionSize() const
+{
+ return mSurface->GetPositionSize();
+}
+
void Window::SetPositionSize(PositionSize positionSize)
{
PositionSize oldRect = mSurface->GetPositionSize();
Dali::Accessibility::Accessible::Get(mScene.GetRootLayer(), true)->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
}
-PositionSize Window::GetPositionSize() const
-{
- return mSurface->GetPositionSize();
-}
-
Dali::Layer Window::GetRootLayer() const
{
return mScene.GetRootLayer();
return mWindowBase->GetNativeWindowId();
}
+void Window::RequestMoveToServer()
+{
+ mWindowBase->RequestMoveToServer();
+}
+
+void Window::RequestResizeToServer(WindowResizeDirection direction)
+{
+ mWindowBase->RequestResizeToServer(direction);
+}
+
+void Window::EnableFloatingMode(bool enable)
+{
+ mWindowBase->EnableFloatingMode(enable);
+}
+
} // namespace Adaptor
} // namespace Internal
*/
int32_t GetNativeId() const;
+ /**
+ * @copydoc Dali::DevelWindow::RequestMoveToServer()
+ */
+ void RequestMoveToServer();
+
+ /**
+ * @copydoc Dali::DevelWindow::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction);
+
+ /**
+ * @copydoc Dali::DevelWindow::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable);
+
private:
/**
* @brief Enumeration for orietation mode.
*/
void ImeWindowReadyToRender() override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
private:
// Undefined
WindowBaseCocoa(const WindowBaseCocoa&) = delete;
{
}
+void WindowBaseCocoa::RequestMoveToServer()
+{
+}
+
+void WindowBaseCocoa::RequestResizeToServer(WindowResizeDirection direction)
+{
+}
+
+void WindowBaseCocoa::EnableFloatingMode(bool enable)
+{
+}
+
+bool WindowBaseCocoa::IsFloatingModeEnabled() const
+{
+ return false;
+}
+
} // namespace Dali::Internal::Adaptor
@implementation CocoaView
{
}
+void WindowBaseEcoreWl::RequestMoveToServer()
+{
+}
+
+void WindowBaseEcoreWl::RequestResizeToServer(WindowResizeDirection direction)
+{
+}
+
+void WindowBaseEcoreWl::EnableFloatingMode(bool enable)
+{
+}
+
+bool WindowBaseEcoreWl::IsFloatingModeEnabled() const
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ImeWindowReadyToRender() override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
private:
/**
* Second stage initialization
InitializeEcoreElDBus();
Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
- mDisplay = ecore_wl2_display_get(display);
+ mDisplay = ecore_wl2_display_get(display);
if(mDisplay)
{
rotationEvent.angle = ev->angle;
rotationEvent.winResize = 0;
- if(ev->w == 0 || ev->h ==0)
+ if(ev->w == 0 || ev->h == 0)
{
// Use previous client side window's size.
if(mWindowRotationAngle == 90 || mWindowRotationAngle == 270)
}
}
- mWindowRotationAngle = ev->angle;
+ mWindowRotationAngle = ev->angle;
if(ev->angle == 0 || ev->angle == 180)
{
wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
}
+void WindowBaseEcoreWl2::RequestMoveToServer()
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ if(!display)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get ecore_wl2_display\n");
+ return;
+ }
+
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ if(!input)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get default Ecore_Wl2_Input\n");
+ return;
+ }
+
+ ecore_wl2_window_move(mEcoreWindow, input);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestMoveToServer, starts the window[%p] is moved by server\n", mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::RequestResizeToServer(WindowResizeDirection direction)
+{
+ Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
+ if(!display)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get ecore_wl2_display\n");
+ return;
+ }
+
+ Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
+ if(!input)
+ {
+ DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get default Ecore_Wl2_Input\n");
+ return;
+ }
+
+ int location = 0;
+ switch(direction)
+ {
+ case WindowResizeDirection::TOP_LEFT:
+ {
+ location = 5;
+ break;
+ }
+ case WindowResizeDirection::TOP:
+ {
+ location = 1;
+ break;
+ }
+ case WindowResizeDirection::TOP_RIGHT:
+ {
+ location = 9;
+ break;
+ }
+ case WindowResizeDirection::LEFT:
+ {
+ location = 4;
+ break;
+ }
+ case WindowResizeDirection::RIGHT:
+ {
+ location = 8;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM_LEFT:
+ {
+ location = 6;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM:
+ {
+ location = 2;
+ break;
+ }
+ case WindowResizeDirection::BOTTOM_RIGHT:
+ {
+ location = 10;
+ break;
+ }
+ default:
+ {
+ location = 0;
+ break;
+ }
+ }
+
+ ecore_wl2_window_resize(mEcoreWindow, input, location);
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestResizeToServer, starts the window[%p] is resized by server, mode:%d\n", mEcoreWindow, location);
+}
+
+void WindowBaseEcoreWl2::EnableFloatingMode(bool enable)
+{
+ DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::EnableFloatingMode, floating mode flag: [%p], enable [%d]\n", mEcoreWindow, enable);
+ if(enable == true)
+ {
+ ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_TRUE);
+ }
+ else
+ {
+ ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_FALSE);
+ }
+}
+
+bool WindowBaseEcoreWl2::IsFloatingModeEnabled() const
+{
+ return ecore_wl2_window_floating_mode_get(mEcoreWindow);
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ImeWindowReadyToRender() override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
private:
/**
* Second stage initialization
{
}
+void WindowBaseEcoreX::RequestMoveToServer()
+{
+}
+
+void WindowBaseEcoreX::RequestResizeToServer(WindowResizeDirection direction)
+{
+}
+
+void WindowBaseEcoreX::EnableFloatingMode(bool enable)
+{
+}
+
+bool WindowBaseEcoreX::IsFloatingModeEnabled() const
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ImeWindowReadyToRender() override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
private:
/**
* Second stage initialization
{
}
+void WindowBaseWin::RequestMoveToServer()
+{
+}
+
+void WindowBaseWin::RequestResizeToServer(WindowResizeDirection direction)
+{
+}
+
+void WindowBaseWin::EnableFloatingMode(bool enable)
+{
+}
+
+bool WindowBaseWin::IsFloatingModeEnabled() const
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ImeWindowReadyToRender() override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
+ */
+ void RequestMoveToServer() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
+ */
+ void RequestResizeToServer(WindowResizeDirection direction) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
+ */
+ void EnableFloatingMode(bool enable) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
+ */
+ bool IsFloatingModeEnabled() const override;
+
private:
/**
* Second stage initialization
INVALID_OPERATION, ///< The operation is invalid. (e.g. Try to operate to the wrong window)
};
+/**
+ * @brief Enumeration of direction for window resized by display server.
+ */
+enum class WindowResizeDirection
+{
+ TOP_LEFT = 1, ///< Start resizing window to the top-left edge.
+ TOP = 2, ///< Start resizing window to the top side.
+ TOP_RIGHT = 3, ///< Start resizing window to the top-right edge.
+ LEFT = 4, ///< Start resizing window to the left side.
+ RIGHT = 5, ///< Start resizing window to the right side.
+ BOTTOM_LEFT = 6, ///< Start resizing window to the bottom-left edge.
+ BOTTOM = 7, ///< Start resizing window to the bottom side.
+ BOTTOM_RIGHT = 8 ///< Start resizing window to the bottom-right edge.
+};
+
} // namespace Dali
#endif // DALI_WINDOW_ENUMERATIONS_H