END_TEST;
}
+int UtcDaliWindowMouseRelativeSignalNegative(void)
+{
+ Dali::Window instance;
+ try
+ {
+ DevelWindow::MouseRelativeEventSignal(instance);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
int UtcDaliWindowMoveCompletedSignalNegative(void)
{
Dali::Window instance;
--- /dev/null
+#ifndef DALI_WINDOW_DEVEL_MOUSE_RELATIVE_EVENT_H
+#define DALI_WINDOW_DEVEL_MOUSE_RELATIVE_EVENT_H
+
+/*
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/events/device.h>
+#include <dali/public-api/math/vector2.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
+namespace Dali
+{
+namespace DevelWindow
+{
+/**
+ * @brief MouseRelativeEvent occurs when relative mouse movement occurs in the window.
+ *
+ * A signal is emitted when relative mouse movement occurs in the window.
+ */
+struct DALI_ADAPTOR_API MouseRelativeEvent
+{
+ enum class Type
+ {
+ NONE = 0,
+ RELATIVE_MOVE
+ };
+
+ /**
+ * @brief Constructor which creates a MouseRelativeEvent instance
+ * @param[in] type The type of the event.
+ * @param[in] modifiers The modifier keys pressed during the event (such as shift, alt and control).
+ * @param[in] timeStamp The time when the event being started.
+ * @param[in] diffPosition The co-ordinates of the cursor relative to the top-left of the screen
+ * @param[in] unaccelatedPosition The co-ordinates of the cursor relative to the top-left of the screen
+ * @param[in] deviceClass The device class the event originated from.
+ * @param[in] deviceSubclass The device subclass the event originated from.
+ */
+ MouseRelativeEvent(Type type, uint32_t modifiers, uint32_t timeStamp, Vector2 diffPosition, Vector2 unaccelatedPosition, const Device::Class::Type deviceClass, const Device::Subclass::Type deviceSubclass)
+ : type(type),
+ modifiers(modifiers),
+ timeStamp(timeStamp),
+ diffPosition(diffPosition),
+ unaccelatedPosition(unaccelatedPosition),
+ deviceClass(deviceClass),
+ deviceSubclass(deviceSubclass)
+ {
+ }
+
+ Type type;
+ uint32_t modifiers;
+ uint32_t timeStamp;
+ Vector2 diffPosition;
+ Vector2 unaccelatedPosition;
+ const Device::Class::Type deviceClass;
+ const Device::Subclass::Type deviceSubclass;
+};
+
+} // namespace DevelWindow
+
+} // namespace Dali
+
+#endif // DALI_WINDOW_DEVEL_MOUSE_RELATIVE_EVENT_H
return GetImplementation(window).GetLastTouchEvent();
}
+bool PointerConstraintsLock(Window window)
+{
+ return GetImplementation(window).PointerConstraintsLock();
+}
+
+bool PointerConstraintsUnlock(Window window)
+{
+ return GetImplementation(window).PointerConstraintsUnlock();
+}
+
+void LockedPointerRegionSet(Window window, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ GetImplementation(window).LockedPointerRegionSet(x, y, width, height);
+}
+
+void LockedPointerCursorPositionHintSet(Window window, int32_t x, int32_t y)
+{
+ GetImplementation(window).LockedPointerCursorPositionHintSet(x, y);
+}
+
+bool PointerWarp(Window window, int32_t x, int32_t y)
+{
+ return GetImplementation(window).PointerWarp(x, y);
+}
+
InterceptKeyEventSignalType& InterceptKeyEventSignal(Window window)
{
return GetImplementation(window).InterceptKeyEventSignal();
return GetImplementation(window).InsetsChangedSignal();
}
+MouseRelativeEventSignalType& MouseRelativeEventSignal(Window window)
+{
+ return GetImplementation(window).MouseRelativeEventSignal();
+}
+
} // namespace DevelWindow
} // namespace Dali
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/mouse-in-out-event.h>
+#include <dali/devel-api/adaptor-framework/mouse-relative-event.h>
#include <dali/public-api/adaptor-framework/window-enumerations.h>
#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/common/vector-wrapper.h>
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, const Dali::DevelWindow::MouseRelativeEvent&)> MouseRelativeEventSignalType; ///< MouseRelativeEvent 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
typedef Signal<void(WindowInsetsPartType, WindowInsetsPartState, const Extents&)> InsetsChangedSignalType; ///< InsetsChanged signal type
DALI_ADAPTOR_API const TouchEvent& GetLastTouchEvent(Window window);
/**
+ * @brief Sets the pointer constraints lock.
+ *
+ * @param[in] window The window instance.
+ * @return Returns true if PointerConstraintsLock succeeds.
+ */
+DALI_ADAPTOR_API bool PointerConstraintsLock(Window window);
+
+/**
+ * @brief Sets the pointer constraints unlock.
+ *
+ * @param[in] window The window instance.
+ * @return Returns true if PointerConstraintsUnlock succeeds.
+ */
+DALI_ADAPTOR_API bool PointerConstraintsUnlock(Window window);
+
+/**
+ * @brief Sets the locked pointer region
+ *
+ * @param[in] window The window instance.
+ * @param[in] x The x position.
+ * @param[in] y The y position.
+ * @param[in] width The width.
+ * @param[in] height The height
+ */
+DALI_ADAPTOR_API void LockedPointerRegionSet(Window window, int32_t x, int32_t y, int32_t width, int32_t height);
+
+/**
+ * @brief Sets the locked pointer cursor position hintset
+ *
+ * @param[in] window The window instance.
+ * @param[in] x The x position.
+ * @param[in] y The y position.
+ */
+DALI_ADAPTOR_API void LockedPointerCursorPositionHintSet(Window window, int32_t x, int32_t y);
+
+/**
+ * @brief Sets the pointer warp. The pointer moves to the set coordinates.
+ *
+ * @param[in] window The window instance.
+ * @param[in] x The x position.
+ * @param[in] y The y position.
+ * @return Returns true if PointerWarp succeeds.
+ */
+DALI_ADAPTOR_API bool PointerWarp(Window window, int32_t x, int32_t y);
+
+/**
* @brief The user would connect to this signal to intercept a KeyEvent at window.
*
* Intercepts KeyEvents in the window before dispatching KeyEvents to the control.
DALI_ADAPTOR_API MouseInOutEventSignalType& MouseInOutEventSignal(Window window);
/**
+ * @brief This signal is emitted when the mouse relative event is received.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ * void YourCallbackName( Window window, Dali::MouseRelativeEvent event );
+ * @endcode
+ *
+ * @param[in] window The window instance.
+ * @return The signal to connect to
+ */
+DALI_ADAPTOR_API MouseRelativeEventSignalType& MouseRelativeEventSignal(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.
${adaptor_devel_api_dir}/adaptor-framework/keyboard.h
${adaptor_devel_api_dir}/adaptor-framework/lifecycle-controller.h
${adaptor_devel_api_dir}/adaptor-framework/mouse-in-out-event.h
+ ${adaptor_devel_api_dir}/adaptor-framework/mouse-relative-event.h
${adaptor_devel_api_dir}/adaptor-framework/native-image-source-devel.h
${adaptor_devel_api_dir}/adaptor-framework/native-image-source-queue.h
${adaptor_devel_api_dir}/adaptor-framework/orientation.h
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
+bool WindowBaseAndroid::PointerConstraintsLock()
+{
+ return false;
+}
+
+bool WindowBaseAndroid::PointerConstraintsUnlock()
+{
+ return false;
+}
+
+void WindowBaseAndroid::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+void WindowBaseAndroid::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+}
+
+bool WindowBaseAndroid::PointerWarp(int32_t x, int32_t y)
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
#define DALI_INTERNAL_WINDOWSYSTEM_ANDROID_WINDOW_BASE_ANDROID_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
void MoveResize(PositionSize positionSize) override;
- /**
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
*/
void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
/**
* Second stage initialization
mUpdatePositionSizeSignal(),
mAuxiliaryMessageSignal(),
mMouseInOutEventSignal(),
+ mMouseRelativeEventSignal(),
mMoveCompletedSignal(),
mResizeCompletedSignal(),
mInsetsChangedSignal()
return mMouseInOutEventSignal;
}
+WindowBase::MouseRelativeEventSignalType& WindowBase::MouseRelativeEventSignal()
+{
+ return mMouseRelativeEventSignal;
+}
+
WindowBase::MoveCompletedSignalType& WindowBase::MoveCompletedSignal()
{
return mMoveCompletedSignal;
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(const Dali::DevelWindow::MouseRelativeEvent&)> MouseRelativeEventSignalType;
typedef Signal<void(Dali::Int32Pair&)> MoveCompletedSignalType;
typedef Signal<void(Dali::Uint16Pair&)> ResizeCompletedSignalType;
typedef Signal<void(WindowInsetsPartType, WindowInsetsPartState, const Extents&)> InsetsChangedSignalType;
*/
virtual void ExcludeInputRegion(const Rect<int>& inputRegion) = 0;
+ /**
+ * @brief Sets the pointer constraints lock.
+ * @return Returns true if PointerConstraintsLock succeeds.
+ */
+ virtual bool PointerConstraintsLock() = 0;
+
+ /**
+ * @brief Sets the pointer constraints unlock.
+ * @return Returns true if PointerConstraintsUnlock succeeds.
+ */
+ virtual bool PointerConstraintsUnlock() = 0;
+
+ /**
+ * @brief Sets the locked pointer region
+ *
+ * @param[in] x The x position.
+ * @param[in] y The y position.
+ * @param[in] width The width.
+ * @param[in] height The height
+ */
+ virtual void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) = 0;
+
+ /**
+ * @brief Sets the locked pointer cursor position hintset
+ *
+ * @param[in] x The x position.
+ * @param[in] y The y position.
+ */
+ virtual void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) = 0;
+
+ /**
+ * @brief Sets the pointer warp. The pointer moves to the set coordinates.
+ *
+ * @param[in] x The x position.
+ * @param[in] y The y position.
+ * @return Returns true if PointerWarp succeeds.
+ */
+ virtual bool PointerWarp(int32_t x, int32_t y) = 0;
+
// Signals
/**
MouseInOutEventSignalType& MouseInOutEventSignal();
/**
+ * @brief This signal is emitted when a mouse relative event is recevied.
+ */
+ MouseRelativeEventSignalType& MouseRelativeEventSignal();
+
+ /**
* @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.
UpdatePositionSizeType mUpdatePositionSizeSignal;
AuxiliaryMessageSignalType mAuxiliaryMessageSignal;
MouseInOutEventSignalType mMouseInOutEventSignal;
+ MouseRelativeEventSignalType mMouseRelativeEventSignal;
MoveCompletedSignalType mMoveCompletedSignal;
ResizeCompletedSignalType mResizeCompletedSignal;
InsetsChangedSignalType mInsetsChangedSignal;
mMovedSignal(),
mOrientationChangedSignal(),
mMouseInOutEventSignal(),
+ mMouseRelativeEventSignal(),
mMoveCompletedSignal(),
mResizeCompletedSignal(),
mInsetsChangedSignal(),
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);
mMouseInOutEventSignal.Emit(handle, mouseInOutEvent);
}
+void Window::OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& MouseRelativeEvent)
+{
+ Dali::Window handle(this);
+
+ mMouseRelativeEventSignal.Emit(handle, MouseRelativeEvent);
+}
+
void Window::OnRotation(const RotationEvent& rotation)
{
PositionSize newPositionSize(rotation.x, rotation.y, rotation.width, rotation.height);
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);
+}
+
} // namespace Adaptor
} // namespace Internal
class WindowBase;
class Window;
-using WindowPtr = IntrusivePtr<Window>;
-using OrientationPtr = IntrusivePtr<Orientation>;
-using MouseInOutEventPtr = IntrusivePtr<Dali::DevelWindow::MouseInOutEvent>;
-using EventHandlerPtr = IntrusivePtr<EventHandler>;
+using WindowPtr = IntrusivePtr<Window>;
+using OrientationPtr = IntrusivePtr<Orientation>;
+using MouseInOutEventPtr = IntrusivePtr<Dali::DevelWindow::MouseInOutEvent>;
+using MouseRelativeEventPtr = IntrusivePtr<Dali::DevelWindow::MouseRelativeEvent>;
+using EventHandlerPtr = IntrusivePtr<EventHandler>;
/**
* Window provides a surface to render onto with orientation & indicator properties.
typedef Dali::DevelWindow::MovedSignalType MovedSignalType;
typedef Dali::DevelWindow::OrientationChangedSignalType OrientationChangedSignalType;
typedef Dali::DevelWindow::MouseInOutEventSignalType MouseInOutEventSignalType;
+ typedef Dali::DevelWindow::MouseRelativeEventSignalType MouseRelativeEventSignalType;
typedef Dali::DevelWindow::MoveCompletedSignalType MoveCompletedSignalType;
typedef Dali::DevelWindow::ResizeCompletedSignalType ResizeCompletedSignalType;
typedef Dali::DevelWindow::InsetsChangedSignalType InsetsChangedSignalType;
*/
const Dali::TouchEvent& GetLastTouchEvent() const;
+ /**
+ * @copydoc Dali::DevelWindow::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock();
+
+ /**
+ * @copydoc Dali::DevelWindow::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock();
+
+ /**
+ * @copydoc Dali::DevelWindow::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height);
+
+ /**
+ * @copydoc Dali::DevelWindow::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y);
+
+ /**
+ * @copydoc Dali::DevelWindow::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y);
+
private:
/**
* @brief Enumeration for orietation mode.
void OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent);
/**
+ * @brief Called when the mouse relative event is received.
+ * @param[in] MouseRelativeEvent the mouse event
+ */
+ void OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& MouseRelativeEvent);
+
+ /**
* @brief Called when the window is moved by display server.
*
* @param[in] position the moved window's position.
*/
void OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets);
-
private: // Dali::Internal::Adaptor::SceneHolder
/**
* @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
}
/**
+ * @copydoc Dali::DevelWindow::MouseRelativeEventSignal()
+ */
+ MouseRelativeEventSignalType& MouseRelativeEventSignal()
+ {
+ return mMouseRelativeEventSignal;
+ }
+
+ /**
* @copydoc Dali::DevelWindow::MoveCompletedSignal()
*/
MoveCompletedSignalType& MoveCompletedSignal()
MovedSignalType mMovedSignal;
OrientationChangedSignalType mOrientationChangedSignal;
MouseInOutEventSignalType mMouseInOutEventSignal;
+ MouseRelativeEventSignalType mMouseRelativeEventSignal;
MoveCompletedSignalType mMoveCompletedSignal;
ResizeCompletedSignalType mResizeCompletedSignal;
InsetsChangedSignalType mInsetsChangedSignal;
#pragma once
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
void MoveResize(PositionSize positionSize) override;
- /**
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
*/
void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
// Undefined
WindowBaseCocoa(const WindowBaseCocoa&) = delete;
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
+bool WindowBaseCocoa::PointerConstraintsLock()
+{
+ return false;
+}
+
+bool WindowBaseCocoa::PointerConstraintsUnlock()
+{
+ return false;
+}
+
+void WindowBaseCocoa::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+void WindowBaseCocoa::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+}
+
+bool WindowBaseCocoa::PointerWarp(int32_t x, int32_t y)
+{
+ return false;
+}
+
} // namespace Dali::Internal::Adaptor
@implementation CocoaView
[NSApp stop:nil];
}
@end
-
#define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
void MoveResize(PositionSize positionSize) override;
- /**
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
*/
void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
/**
* Second stage initialization
}
/**
+ * Called when a touch motion is received.
+ */
+static Eina_Bool EcoreEventMouseButtonRelativeMove(void* data, int type, void* event)
+{
+ WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+ if(windowBase)
+ {
+ windowBase->OnMouseButtonRelativeMove(data, type, event);
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+/**
* Called when a touch is canceled.
*/
static Eina_Bool EcoreEventMouseButtonCancel(void* data, int type, void* event)
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this));
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this));
+ mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_RELATIVE_MOVE, EcoreEventMouseButtonRelativeMove, this));
// Register Mouse wheel events
mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this));
}
}
+void WindowBaseEcoreWl2::OnMouseButtonRelativeMove(void* data, int type, void* event)
+{
+ Ecore_Event_Mouse_Relative_Move* relativeMoveEvent = static_cast<Ecore_Event_Mouse_Relative_Move*>(event);
+
+ if(relativeMoveEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_RELATIVE_MOVE");
+
+ Device::Class::Type deviceClass;
+ Device::Subclass::Type deviceSubclass;
+
+ GetDeviceClass(ecore_device_class_get(relativeMoveEvent->dev), deviceClass);
+ GetDeviceSubclass(ecore_device_subclass_get(relativeMoveEvent->dev), deviceSubclass);
+
+ Dali::DevelWindow::MouseRelativeEvent MouseRelativeEvent(Dali::DevelWindow::MouseRelativeEvent::Type::RELATIVE_MOVE, relativeMoveEvent->modifiers, relativeMoveEvent->timestamp, Vector2(relativeMoveEvent->dx, relativeMoveEvent->dy), Vector2(relativeMoveEvent->dx_unaccel, relativeMoveEvent->dy_unaccel), deviceClass, deviceSubclass);
+
+ mMouseRelativeEventSignal.Emit(MouseRelativeEvent);
+ }
+}
+
void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
{
Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
int w = 0;
int h = 0;
- switch (ev->part_type)
+ switch(ev->part_type)
{
case ECORE_WL2_INDICATOR_PART:
{
WindowInsetsPartState partState = WindowInsetsPartState::INVISIBLE;
- int left = 0;
- int right = 0;
- int top = 0;
+ int left = 0;
+ int right = 0;
+ int top = 0;
int bottom = 0;
// Insets are applied only if system UI(e.g. virtual keyboard) satisfies the following 2 conditions.
{
if((y <= winY) && (y + h >= winY) && (y + h <= winY + winH))
{
- top = y + h - winY;
+ top = y + h - winY;
applyInsets = true;
}
else if((y + h >= winY + winH) && (y >= winY) && (y <= winY + winH))
{
- bottom = winY + winH - y;
+ bottom = winY + winH - y;
applyInsets = true;
}
}
{
if((x <= winX) && (x + w >= winX) && (x + w <= winX + winW))
{
- left = x + w - winX;
+ left = x + w - winX;
applyInsets = true;
}
else if((x + w >= winX + winW) && (x >= winX) && (x <= winX + winW))
{
- right = winX + winW - x;
+ right = winX + winW - x;
applyInsets = true;
}
}
void WindowBaseEcoreWl2::TizenPolicyConformantArea(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
{
- int originalX, originalY, originalWidth, originalHeight;
+ int originalX, originalY, originalWidth, originalHeight;
bool changed = false;
if(!surface)
* The given state is based on the visibility value of indicator.
* Thus we need to add 1 to it before comparing with indicator state.
*/
- Ecore_Wl2_Indicator_State indState = ecore_wl2_window_indicator_state_get(mEcoreWindow);
+ Ecore_Wl2_Indicator_State indState = ecore_wl2_window_indicator_state_get(mEcoreWindow);
if((state + 1) != indState)
{
ecore_wl2_window_indicator_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Indicator_State>(state + 1));
if(changed)
{
- Ecore_Wl2_Event_Conformant_Change *ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change)));
+ Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change)));
if(!ev)
{
return;
}
- ev->win = GetNativeWindowId();
+ ev->win = GetNativeWindowId();
ev->part_type = static_cast<Ecore_Wl2_Conformant_Part_Type>(conformantPart);
- ev->state = state;
+ ev->state = state;
ecore_event_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
}
ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
}
+bool WindowBaseEcoreWl2::PointerConstraintsLock()
+{
+ return ecore_wl2_window_pointer_constraints_lock_pointer(mEcoreWindow);
+}
+
+bool WindowBaseEcoreWl2::PointerConstraintsUnlock()
+{
+ return ecore_wl2_window_pointer_constraints_unlock_pointer(mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ ecore_wl2_window_locked_pointer_region_set(mEcoreWindow, x, y, width, height);
+}
+
+void WindowBaseEcoreWl2::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+ ecore_wl2_window_locked_pointer_cursor_position_hint_set(mEcoreWindow, x, y);
+}
+
+bool WindowBaseEcoreWl2::PointerWarp(int32_t x, int32_t y)
+{
+ return ecore_wl2_window_pointer_warp(mEcoreWindow, x, y);
+}
+
} // namespace Adaptor
} // namespace Internal
void OnMouseButtonMove(void* data, int type, void* event);
/**
+ * @brief Called when a touch motion is received.
+ */
+ void OnMouseButtonRelativeMove(void* data, int type, void* event);
+
+ /**
* @brief Called when a touch is canceled.
*/
void OnMouseButtonCancel(void* data, int type, void* event);
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
/**
* Second stage initialization
{
}
+bool WindowBaseEcoreX::PointerConstraintsLock()
+{
+ return false;
+}
+
+bool WindowBaseEcoreX::PointerConstraintsUnlock()
+{
+ return false;
+}
+
+void WindowBaseEcoreX::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+void WindowBaseEcoreX::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+}
+
+bool WindowBaseEcoreX::PointerWarp(int32_t x, int32_t y)
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
/**
* Second stage initialization
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
+bool WindowBaseWin::PointerConstraintsLock()
+{
+ return false;
+}
+
+bool WindowBaseWin::PointerConstraintsUnlock()
+{
+ return false;
+}
+
+void WindowBaseWin::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+void WindowBaseWin::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+}
+
+bool WindowBaseWin::PointerWarp(int32_t x, int32_t y)
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
#define DALI_INTERNAL_WINDOWSYSTEM_WINDOW_BASE_WIN_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
/**
* Second stage initialization
{
}
+bool WindowBaseX::PointerConstraintsLock()
+{
+ return false;
+}
+
+bool WindowBaseX::PointerConstraintsUnlock()
+{
+ return false;
+}
+
+void WindowBaseX::LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+
+void WindowBaseX::LockedPointerCursorPositionHintSet(int32_t x, int32_t y)
+{
+}
+
+bool WindowBaseX::PointerWarp(int32_t x, int32_t y)
+{
+ return false;
+}
+
} // namespace Adaptor
} // namespace Internal
*/
void MoveResize(PositionSize positionSize) override;
- /**
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetLayout()
*/
void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan) override;
*/
void ExcludeInputRegion(const Rect<int>& inputRegion) override;
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsLock()
+ */
+ bool PointerConstraintsLock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerConstraintsUnlock()
+ */
+ bool PointerConstraintsUnlock() override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerRegionSet()
+ */
+ void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::LockedPointerCursorPositionHintSet()
+ */
+ void LockedPointerCursorPositionHintSet(int32_t x, int32_t y) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::PointerWarp()
+ */
+ bool PointerWarp(int32_t x, int32_t y) override;
+
private:
/**
* Second stage initialization