}
END_TEST;
}
+
+int UtcDaliWindowMoveCompletedSignalNegative(void)
+{
+ Dali::Window instance;
+ try
+ {
+ DevelWindow::MoveCompletedSignal(instance);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliWindowResizeCompletedSignalNegative(void)
+{
+ Dali::Window instance;
+ try
+ {
+ DevelWindow::ResizeCompletedSignal(instance);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
return GetImplementation(window).OrientationChangedSignal();
}
+MoveCompletedSignalType& MoveCompletedSignal(Window window)
+{
+ return GetImplementation(window).MoveCompletedSignal();
+}
+
+ResizeCompletedSignalType& ResizeCompletedSignal(Window window)
+{
+ return GetImplementation(window).ResizeCompletedSignal();
+}
+
void SetParent(Window window, Window parent)
{
GetImplementation(window).SetParent(parent);
typedef Signal<void(Window, Dali::Window::WindowPosition)> MovedSignalType; ///< Window Moved signal type
typedef Signal<void(Window, Dali::WindowOrientation)> OrientationChangedSignalType; ///< Window orientation changed signal type
typedef Signal<void(Window, const Dali::DevelWindow::MouseInOutEvent&)> MouseInOutEventSignalType; ///< MouseInOutEvent signal type
+typedef Signal<void(Window, Dali::Window::WindowPosition)> MoveCompletedSignalType; ///< Window Moved by Server signal type
+typedef Signal<void(Window, Dali::Window::WindowSize)> ResizeCompletedSignalType; ///< Window Resized by Server signal type
/**
* @brief Creates an initialized handle to a new Window.
*/
DALI_ADAPTOR_API MouseInOutEventSignalType& MouseInOutEventSignal(Window window);
+/**
+ * @brief This signal is emitted when window has been moved by the display server.
+ * To make the window move by display server, RequestMoveToServer() should be called.
+ * After the moving job is completed, this function will be called.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, Dali::Window::WindowPosition position );
+ * @endcode
+ * The parameters are the moved x and y coordinates.
+ * and window means this signal was called from what window
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API MoveCompletedSignalType& MoveCompletedSignal(Window window);
+
+/**
+ * @brief This signal is emitted when window has been resized by the display server.
+ * To make the window move by display server, RequestResizeToServer() should be called.
+ * After the resizing job is completed, this function will be called.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, Dali::Window::WindowPosition position );
+ * @endcode
+ * The parameters are the resized width and height coordinates.
+ * and window means this signal was called from what window
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API ResizeCompletedSignalType& ResizeCompletedSignal(Window window);
+
} // namespace DevelWindow
} // namespace Dali
mKeyboardRepeatSettingsChangedSignal(),
mUpdatePositionSizeSignal(),
mAuxiliaryMessageSignal(),
- mMouseInOutEventSignal()
+ mMouseInOutEventSignal(),
+ mMoveCompletedSignal(),
+ mResizeCompletedSignal()
{
}
return mMouseInOutEventSignal;
}
+WindowBase::MoveCompletedSignalType& WindowBase::MoveCompletedSignal()
+{
+ return mMoveCompletedSignal;
+}
+
+WindowBase::ResizeCompletedSignalType& WindowBase::ResizeCompletedSignal()
+{
+ return mResizeCompletedSignal;
+}
+
} // namespace Adaptor
} // namespace Internal
typedef Signal<void(Dali::PositionSize&)> UpdatePositionSizeType;
typedef Signal<void(const std::string&, const std::string&, const Property::Array&)> AuxiliaryMessageSignalType;
typedef Signal<void(const Dali::DevelWindow::MouseInOutEvent&)> MouseInOutEventSignalType;
+ typedef Signal<void(Dali::Int32Pair&)> MoveCompletedSignalType;
+ typedef Signal<void(Dali::Uint16Pair&)> ResizeCompletedSignalType;
// Input events
typedef Signal<void(Integration::Point&, uint32_t)> TouchEventSignalType;
WindowRedrawRequestSignalType& WindowRedrawRequestSignal();
/**
- * @brief This signal is emitted when the window is resized or moved by display server.
+ * @brief This signal is emitted when the window's geometry data is changed by display server or client.
+ * It is based on configure noification event.
*/
UpdatePositionSizeType& UpdatePositionSizeSignal();
*/
MouseInOutEventSignalType& MouseInOutEventSignal();
+ /**
+ * @brief This signal is emitted when window has been moved by then display server.
+ * To be moved the window by display server, RequestMoveToServer() should be called.
+ * After the moving job is finished, this function will be called.
+ */
+ MoveCompletedSignalType& MoveCompletedSignal();
+
+ /**
+ * @brief This signal is emitted when window has been resized by then display server.
+ * To be resized the window by display server, RequestResizeToServer() should be called.
+ * After the resizing job is finished, this function will be called.
+ */
+ ResizeCompletedSignalType& ResizeCompletedSignal();
+
protected:
// Undefined
WindowBase(const WindowBase&) = delete;
UpdatePositionSizeType mUpdatePositionSizeSignal;
AuxiliaryMessageSignalType mAuxiliaryMessageSignal;
MouseInOutEventSignalType mMouseInOutEventSignal;
+ MoveCompletedSignalType mMoveCompletedSignal;
+ ResizeCompletedSignalType mResizeCompletedSignal;
};
} // namespace Adaptor
mMovedSignal(),
mOrientationChangedSignal(),
mMouseInOutEventSignal(),
+ mMoveCompletedSignal(),
+ mResizeCompletedSignal(),
mLastKeyEvent(),
mLastTouchEvent(),
mIsTransparent(false),
mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize);
mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage);
mWindowBase->MouseInOutEventSignal().Connect(this, &Window::OnMouseInOutEvent);
+ mWindowBase->MoveCompletedSignal().Connect(this, &Window::OnMoveCompleted);
+ mWindowBase->ResizeCompletedSignal().Connect(this, &Window::OnResizeCompleted);
mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
mNativeWindowId = mWindowBase->GetNativeWindowId();
}
-void Window::SetRenderNotification(TriggerEventInterface *renderNotification)
+void Window::SetRenderNotification(TriggerEventInterface* renderNotification)
{
if(!mWindowSurface)
{
void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
{
- mWindowBase->SetLayout(numCols, numRows, column, row, colSpan, rowSpan);
+ mWindowBase->SetLayout(numCols, numRows, column, row, colSpan, rowSpan);
}
Dali::Layer Window::GetRootLayer() const
bridge->RemoveTopLevelWindow(accessible);
}
+void Window::OnMoveCompleted(Dali::Window::WindowPosition& position)
+{
+ Dali::Window handle(this);
+ mMoveCompletedSignal.Emit(handle, position);
+}
+
+void Window::OnResizeCompleted(Dali::Window::WindowSize& size)
+{
+ Dali::Window handle(this);
+ mResizeCompletedSignal.Emit(handle, size);
+}
+
Vector2 Window::RecalculatePosition(const Vector2& position)
{
Vector2 convertedPosition;
typedef Dali::DevelWindow::MovedSignalType MovedSignalType;
typedef Dali::DevelWindow::OrientationChangedSignalType OrientationChangedSignalType;
typedef Dali::DevelWindow::MouseInOutEventSignalType MouseInOutEventSignalType;
+ typedef Dali::DevelWindow::MoveCompletedSignalType MoveCompletedSignalType;
+ typedef Dali::DevelWindow::ResizeCompletedSignalType ResizeCompletedSignalType;
typedef Signal<void()> SignalType;
/**
void OnWindowRedrawRequest();
/**
- * @brief Called when the window is resized or moved by display server.
+ * @brief Called when the window's geometry data is changed by display server or client.
+ * It is based on configure noification event.
*
* @param[in] positionSize the updated window's position and size.
*/
void OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent);
/**
+ * @brief Called when the window is moved by display server.
+ *
+ * @param[in] position the moved window's position.
+ */
+ void OnMoveCompleted(Dali::Window::WindowPosition& position);
+
+ /**
+ * @brief Called when the window is resized by display server.
+ *
+ * @param[in] positionSize the resized window's size.
+ */
+ void OnResizeCompleted(Dali::Window::WindowSize& size);
+
+ /**
* @brief Set available orientation to window base.
*/
void SetAvailableAnlges(const std::vector<int>& angles);
return mMouseInOutEventSignal;
}
+ /**
+ * @copydoc Dali::DevelWindow::MoveCompletedSignal()
+ */
+ MoveCompletedSignalType& MoveCompletedSignal()
+ {
+ return mMoveCompletedSignal;
+ }
+
+ /**
+ * @copydoc Dali::DevelWindow::ResizeCompletedSignal()
+ */
+ ResizeCompletedSignalType& ResizeCompletedSignal()
+ {
+ return mResizeCompletedSignal;
+ }
+
private:
WindowRenderSurface* mWindowSurface; ///< The window rendering surface
WindowBase* mWindowBase;
std::vector<int> mAvailableAngles;
int mPreferredAngle;
- int mRotationAngle; ///< The angle of the rotation
- int mWindowWidth; ///< The width of the window
- int mWindowHeight; ///< The height of the window
- int mNativeWindowId; ///< The Native Window Id
+ int mRotationAngle; ///< The angle of the rotation
+ int mWindowWidth; ///< The width of the window
+ int mWindowHeight; ///< The height of the window
+ int mNativeWindowId; ///< The Native Window Id
EventHandlerPtr mEventHandler; ///< The window events handler
OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
MovedSignalType mMovedSignal;
OrientationChangedSignalType mOrientationChangedSignal;
MouseInOutEventSignalType mMouseInOutEventSignal;
+ MoveCompletedSignalType mMoveCompletedSignal;
+ ResizeCompletedSignalType mResizeCompletedSignal;
Dali::KeyEvent mLastKeyEvent;
Dali::TouchEvent mLastTouchEvent;
return ECORE_CALLBACK_RENEW;
}
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// Window is Moved/Resized By Server Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+static Eina_Bool EcoreEventWindowMoveCompleted(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnMoveCompleted(event);
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
+static Eina_Bool EcoreEventWindowResizeCompleted(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnResizeCompleted(event);
+ }
+ return ECORE_CALLBACK_RENEW;
+}
+
static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
{
WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
vconf_notify_key_changed_for_ui_thread(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this);
#endif
+ // Register Window is moved and resized done event.
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_MOVE_DONE, EcoreEventWindowMoveCompleted, this));
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_RESIZE_DONE, EcoreEventWindowResizeCompleted, this));
+
Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
mDisplay = ecore_wl2_display_get(display);
}
}
+void WindowBaseEcoreWl2::OnMoveCompleted(void* event)
+{
+ Ecore_Wl2_Event_Window_Interactive_Move_Done* movedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Move_Done*>(event);
+ if(movedDoneEvent)
+ {
+ Dali::PositionSize orgPositionSize(movedDoneEvent->x, movedDoneEvent->y, movedDoneEvent->w, movedDoneEvent->h);
+ Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
+ Dali::Int32Pair newPosition(newPositionSize.x, newPositionSize.y);
+ DALI_LOG_RELEASE_INFO("window(%p) has been moved by server[%d, %d]\n", mEcoreWindow, newPositionSize.x, newPositionSize.y);
+ mMoveCompletedSignal.Emit(newPosition);
+ }
+}
+
+void WindowBaseEcoreWl2::OnResizeCompleted(void* event)
+{
+ Ecore_Wl2_Event_Window_Interactive_Resize_Done* resizedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Resize_Done*>(event);
+ if(resizedDoneEvent)
+ {
+ Dali::PositionSize orgPositionSize(resizedDoneEvent->x, resizedDoneEvent->y, resizedDoneEvent->w, resizedDoneEvent->h);
+ Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
+ Dali::Uint16Pair newSize(newPositionSize.width, newPositionSize.height);
+ DALI_LOG_RELEASE_INFO("window(%p) has been resized by server[%d, %d]\n", mEcoreWindow, newPositionSize.width, newPositionSize.height);
+ mResizeCompletedSignal.Emit(newSize);
+ }
+}
+
void WindowBaseEcoreWl2::RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
{
if(strcmp(interface, tizen_policy_interface.name) == 0)
void OnEcoreEventWindowAuxiliaryMessage(void* event);
/**
+ * @brief Called when window has been moved by then display server.
+ * To move the window by display server, RequestMoveToServer() should be called.
+ * After the moving job is completed, this function will be called.
+ *
+ * @param[in] the completed event's data. It has the latest window geometry data.
+ */
+ void OnMoveCompleted(void* event);
+
+ /**
+ * @brief Called when window has been resized by then display server.
+ * To resize the window by display server, RequestResizeToServer() should be called.
+ * After the resizing job is completed, this function will be called.
+ *
+ * @param[in] the completed event's data. It has the latest window geometry data.
+ */
+ void OnResizeCompleted(void* event);
+
+ /**
* @brief Called when a keymap is changed.
*/
void KeymapChanged(void* data, int type, void* event);