From: joogab.yun Date: Tue, 8 Aug 2023 06:54:00 +0000 (+0900) Subject: [NUI] Add api about RelativeMove X-Git-Tag: accepted/tizen/unified/20231205.024657~195 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddacfd5402fc3431836212b0c9909ae04ccf43d8;hp=8024def7eb53ab6c88704ac719a607ff7ab7f396;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add api about RelativeMove 1. PointerConstraintsLock 2. PointerConstraintsUnlock 3. LockedPointerRegionSet 4. LockedPointerCursorPositionHintSet 5. RelativeMoveEvent refer : https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-adaptor/+/296968/ https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-csharp-binder/+/296969/ --- diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.MouseReleative.cs b/src/Tizen.NUI/src/internal/Interop/Interop.MouseReleative.cs new file mode 100755 index 0000000..8752d2d --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.MouseReleative.cs @@ -0,0 +1,52 @@ +/* + * 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. + * + */ + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class MouseRelative + { + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_MouseRelativeEvent__SWIG_0")] + public static extern global::System.IntPtr NewMouseRelative(int jarg1, uint jarg2, uint jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, global::System.Runtime.InteropServices.HandleRef jarg5); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_MouseRelativeEvent")] + public static extern void DeleteMouseRelative(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_type_get")] + public static extern int TypeGet(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_modifiers_get")] + public static extern uint ModifiersGet(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_diff_position_get")] + public static extern global::System.IntPtr DiffPositionGet(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_unaccelated_position_get")] + public static extern global::System.IntPtr UnaccelatedPositionGet(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_timeStamp_get")] + public static extern uint TimeStampGet(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_GetDeviceClass")] + public static extern int DeviceClassGet(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_MouseRelativeEvent_GetDeviceSubClass")] + public static extern int DeviceSubClassGet(global::System.Runtime.InteropServices.HandleRef jarg1); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs index 644cbe2..e6a0384 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Window.cs @@ -342,6 +342,24 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_KeepRendering")] public static extern void KeepRendering(global::System.Runtime.InteropServices.HandleRef window, float durationSeconds); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_PointerConstraintsLock")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool PointerConstraintsLock(global::System.Runtime.InteropServices.HandleRef window); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_PointerConstraintsUnlock")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool PointerConstraintsUnlock(global::System.Runtime.InteropServices.HandleRef window); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_LockedPointerRegionSet")] + public static extern void LockedPointerRegionSet(global::System.Runtime.InteropServices.HandleRef window, int x, int y, int w, int h); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_LockedPointerCursorPositionHintSet")] + public static extern void LockedPointerCursorPositionHintSet(global::System.Runtime.InteropServices.HandleRef window, int x, int y); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_PointerWarp")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool PointerWarp(global::System.Runtime.InteropServices.HandleRef window, int x, int y); } } } diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WindowMouseRelativeEventSignal.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WindowMouseRelativeEventSignal.cs new file mode 100755 index 0000000..b4a08e8 --- /dev/null +++ b/src/Tizen.NUI/src/internal/Interop/Interop.WindowMouseRelativeEventSignal.cs @@ -0,0 +1,50 @@ +/* + * 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. + * + */ + +namespace Tizen.NUI +{ + internal static partial class Interop + { + internal static partial class WindowMouseRelativeEventSignal + { + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowMouseRelativeEventSignal")] + public static extern global::System.IntPtr GetSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowMouseRelativeEventSignal_Empty")] + [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] + public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowMouseRelativeEventSignal_GetConnectionCount")] + public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowMouseRelativeEventSignal_Connect")] + public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowMouseRelativeEventSignal_Disconnect")] + public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_WindowMouseRelativeEventSignal_Emit")] + public static extern void Emit(global::System.Runtime.InteropServices.HandleRef signalType, global::System.Runtime.InteropServices.HandleRef window, global::System.Runtime.InteropServices.HandleRef mouseEvent); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_WindowMouseRelativeEventSignal")] + public static extern global::System.IntPtr NewWindowMouseRelativeEventSignal(); + + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_WindowMouseRelativeEventSignal")] + public static extern void DeleteWindowMouseRelativeEventSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + } + } +} diff --git a/src/Tizen.NUI/src/internal/Window/WindowMouseRelativeEventSignal.cs b/src/Tizen.NUI/src/internal/Window/WindowMouseRelativeEventSignal.cs new file mode 100755 index 0000000..5d33f5d --- /dev/null +++ b/src/Tizen.NUI/src/internal/Window/WindowMouseRelativeEventSignal.cs @@ -0,0 +1,102 @@ +/* + * 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. + * + */ +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI +{ + internal class WindowMouseRelativeEventSignal : Disposable + { + internal WindowMouseRelativeEventSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// + /// Dispose + /// + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.WindowMouseRelativeEventSignal.DeleteWindowMouseRelativeEventSignal(swigCPtr); + } + + /// + /// Queries whether there are any connected slots. + /// + /// True if there are any slots connected to the signal + public bool Empty() + { + bool ret = Interop.WindowMouseRelativeEventSignal.Empty(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Queries the number of slots. + /// + /// The number of slots connected to this signal + public uint GetConnectionCount() + { + uint ret = Interop.WindowMouseRelativeEventSignal.GetConnectionCount(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Connects a function. + /// + /// The function to connect + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.WindowMouseRelativeEventSignal.Connect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Disconnects a function. + /// + /// The function to disconnect + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + Interop.WindowMouseRelativeEventSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Emits the signal. + /// + /// The first value to pass to callbacks + /// The second value to pass to callbacks + public void Emit(Window window, MouseRelative MouseRelative) + { + Interop.WindowMouseRelativeEventSignal.Emit(SwigCPtr, Window.getCPtr(window), MouseRelative.getCPtr(MouseRelative)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + public WindowMouseRelativeEventSignal(Window window) : this(Interop.WindowMouseRelativeEventSignal.GetSignal(Window.getCPtr(window)), false) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } +} diff --git a/src/Tizen.NUI/src/public/Window/MouseRelative.cs b/src/Tizen.NUI/src/public/Window/MouseRelative.cs new file mode 100755 index 0000000..8ec7a99 --- /dev/null +++ b/src/Tizen.NUI/src/public/Window/MouseRelative.cs @@ -0,0 +1,245 @@ +/* + * 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. + * + */ +using System.ComponentModel; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI +{ + /// + /// MouseRelative is used when relative mouse movement occurs in the window. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class MouseRelative : Disposable + { + + /// + /// The default constructor. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public MouseRelative() : this(Interop.MouseRelative.NewMouseRelative((int)MouseRelative.StateType.None, 0, 0, Vector2.getCPtr(new Vector2(0, 0)), Vector2.getCPtr(new Vector2(0, 0))), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The state of the event. + /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl). + /// The time the event is being started. + /// The coordinates of the cursor relative to the top-left of the screen. + /// The coordinates of the cursor relative to the top-left of the screen. + [EditorBrowsable(EditorBrowsableState.Never)] + public MouseRelative(MouseRelative.StateType state, uint modifiers, uint timeStamp, Vector2 diffPosition, Vector2 unaccelatedPosition) : this(Interop.MouseRelative.NewMouseRelative((int)state, modifiers, timeStamp, Vector2.getCPtr(diffPosition), Vector2.getCPtr(unaccelatedPosition)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal MouseRelative(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + } + + /// + /// The state of the mouse event. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public enum StateType + { + /// + /// Default value + /// + [EditorBrowsable(EditorBrowsableState.Never)] + None, + + /// + /// Mouse exited + /// + [EditorBrowsable(EditorBrowsableState.Never)] + RelativeMove + } + + /// + /// Gets the state of the mouse relative event. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public MouseRelative.StateType State + { + get + { + return state; + } + } + + /// + /// Gets the modifier keys pressed during the event (such as Shift, Alt, and Ctrl). + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint Modifiers + { + get + { + return modifiers; + } + } + + /// + /// Gets the diff postion (accelated - default) + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 DiffPosition + { + get + { + return diffPosition; + } + } + + /// + /// Gets the unaccelated postion (accelated - default) + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 UnaccelatedPosition + { + get + { + return unaccelatedPosition; + } + } + + /// + /// Gets the time the mouse relative evnet is being started + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public uint TimeStamp + { + get + { + return timeStamp; + } + } + + /// + /// Gets the device class the mouse relative event originated from. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public DeviceClassType DeviceClass + { + get + { + return deviceClass; + } + } + + /// + /// Gets the device subclass the mouse relative event originated from. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public DeviceSubClassType DeviceSubClass + { + get + { + return deviceSubClass; + } + } + + private MouseRelative.StateType state + { + get + { + MouseRelative.StateType ret = (MouseRelative.StateType)Interop.MouseRelative.TypeGet(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + private uint modifiers + { + get + { + uint ret = Interop.MouseRelative.ModifiersGet(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + private Vector2 diffPosition + { + get + { + global::System.IntPtr cPtr = Interop.MouseRelative.DiffPositionGet(SwigCPtr); + Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + private Vector2 unaccelatedPosition + { + get + { + global::System.IntPtr cPtr = Interop.MouseRelative.UnaccelatedPositionGet(SwigCPtr); + Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + private uint timeStamp + { + get + { + uint ret = Interop.MouseRelative.TimeStampGet(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + private DeviceClassType deviceClass + { + get + { + int ret = Interop.MouseRelative.DeviceClassGet(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (DeviceClassType)ret; + } + } + + private DeviceSubClassType deviceSubClass + { + get + { + int ret = Interop.MouseRelative.DeviceSubClassGet(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (DeviceSubClassType)ret; + } + } + + internal static MouseRelative GetMouseRelativeFromPtr(global::System.IntPtr cPtr) + { + MouseRelative ret = new MouseRelative(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// This will not be public opened. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) + { + Interop.MouseRelative.DeleteMouseRelative(swigCPtr); + } + } +} diff --git a/src/Tizen.NUI/src/public/Window/Window.cs b/src/Tizen.NUI/src/public/Window/Window.cs index 4854286..6afb8c6 100755 --- a/src/Tizen.NUI/src/public/Window/Window.cs +++ b/src/Tizen.NUI/src/public/Window/Window.cs @@ -1761,6 +1761,70 @@ namespace Tizen.NUI } /// + /// Sets the pointer constraints lock. + /// + /// True if PointerConstraintsLock succeeds. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PointerConstraintsLock() + { + bool ret = Interop.Window.PointerConstraintsLock(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the pointer constraints unlock. + /// + /// True if PointerConstraintsUnlock succeeds. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PointerConstraintsUnlock() + { + bool ret = Interop.Window.PointerConstraintsUnlock(SwigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the locked pointer region. + /// + /// The x position. + /// The y position. + /// The width. + /// The height. + [EditorBrowsable(EditorBrowsableState.Never)] + public void LockedPointerRegionSet(int x, int y, int width, int height) + { + Interop.Window.LockedPointerRegionSet(SwigCPtr, x, y, width, height); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the locked pointer cursor position hintset + /// + /// The x position. + /// The y position. + [EditorBrowsable(EditorBrowsableState.Never)] + public void LockedPointerCursorPositionHintSet(int x, int y) + { + Interop.Window.LockedPointerCursorPositionHintSet(SwigCPtr, x, y); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the pointer warp. The pointer moves to the set coordinates. + /// + /// The x position. + /// The y position. + /// True if PointerWarp succeeds. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PointerWarp(int x, int y) + { + bool ret = Interop.Window.PointerWarp(SwigCPtr, x, y); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// /// Maximizes window's size. /// If this function is called with true, window will be resized with screen size. /// Otherwise window will be resized with previous size. diff --git a/src/Tizen.NUI/src/public/Window/WindowEvent.cs b/src/Tizen.NUI/src/public/Window/WindowEvent.cs index 37866f7..05aebbd 100755 --- a/src/Tizen.NUI/src/public/Window/WindowEvent.cs +++ b/src/Tizen.NUI/src/public/Window/WindowEvent.cs @@ -52,6 +52,7 @@ namespace Tizen.NUI private KeyboardRepeatSettingsChangedEventCallbackType keyboardRepeatSettingsChangedEventCallback; private AuxiliaryMessageEventCallbackType auxiliaryMessageEventCallback; private WindowMouseInOutEventCallbackType windowMouseInOutEventCallback; + private WindowMouseRelativeEventCallbackType windowMouseRelativeEventCallback; private MoveCompletedEventCallbackType moveCompletedEventCallback; private ResizeCompletedEventCallbackType resizeCompletedEventCallback; [UnmanagedFunctionPointer(CallingConvention.Cdecl)] @@ -79,6 +80,8 @@ namespace Tizen.NUI [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void WindowMouseInOutEventCallbackType(IntPtr window, IntPtr mouseEvent); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + private delegate void WindowMouseRelativeEventCallbackType(IntPtr window, IntPtr mouseEvent); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void MoveCompletedEventCallbackType(IntPtr window, IntPtr position); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private delegate void ResizeCompletedEventCallbackType(IntPtr window, IntPtr size); @@ -571,6 +574,34 @@ namespace Tizen.NUI } } + /// + /// Emits the event when relative mouse movement occurs in the window.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler MouseRelativeEvent + { + add + { + if (windowMouseRelativeEventHandler == null) + { + windowMouseRelativeEventCallback = OnWindowMouseRelativeEvent; + using WindowMouseRelativeEventSignal signal = new WindowMouseRelativeEventSignal(Interop.WindowMouseRelativeEventSignal.GetSignal(SwigCPtr), false); + signal?.Connect(windowMouseRelativeEventCallback); + } + windowMouseRelativeEventHandler += value; + } + remove + { + windowMouseRelativeEventHandler -= value; + if (windowMouseRelativeEventHandler == null && windowMouseRelativeEventCallback != null) + { + using WindowMouseRelativeEventSignal signal = new WindowMouseRelativeEventSignal(Interop.WindowMouseRelativeEventSignal.GetSignal(SwigCPtr), false); + signal?.Disconnect(windowMouseRelativeEventCallback); + windowMouseRelativeEventCallback = null; + } + } + } + private event EventHandler windowFocusChangedEventHandler; private event EventHandler rootLayerTouchDataEventHandler; private ReturnTypeEventHandler rootLayerInterceptTouchDataEventHandler; @@ -587,6 +618,7 @@ namespace Tizen.NUI private event EventHandler keyboardRepeatSettingsChangedHandler; private event EventHandler auxiliaryMessageEventHandler; private event EventHandler windowMouseInOutEventHandler; + private event EventHandler windowMouseRelativeEventHandler; private event EventHandler moveCompletedHandler; private event EventHandler resizeCompletedHandler; @@ -853,6 +885,13 @@ namespace Tizen.NUI windowMouseInOutEventCallback = null; } + if (windowMouseRelativeEventCallback != null) + { + using WindowMouseRelativeEventSignal signal = new WindowMouseRelativeEventSignal(Interop.WindowMouseRelativeEventSignal.GetSignal(GetBaseHandleCPtrHandleRef), false); + signal?.Disconnect(windowMouseRelativeEventCallback); + windowMouseRelativeEventCallback = null; + } + if (moveCompletedEventCallback != null) { using WindowMoveCompletedSignal signal = new WindowMoveCompletedSignal(Interop.WindowMoveCompletedSignal.GetSignal(GetBaseHandleCPtrHandleRef), false); @@ -1144,6 +1183,22 @@ namespace Tizen.NUI return; } + private void OnWindowMouseRelativeEvent(IntPtr view, IntPtr mouseEvent) + { + if (mouseEvent == global::System.IntPtr.Zero) + { + NUILog.Error("mouseEvent should not be null!"); + return; + } + + if (windowMouseRelativeEventHandler != null) + { + MouseRelativeEventArgs e = new MouseRelativeEventArgs(); + e.MouseRelative = Tizen.NUI.MouseRelative.GetMouseRelativeFromPtr(mouseEvent); + windowMouseRelativeEventHandler(this, e); + } + } + /// /// The focus changed event argument. /// @@ -1288,6 +1343,31 @@ namespace Tizen.NUI } /// + /// MouseRelative evnet arguments. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public class MouseRelativeEventArgs : EventArgs + { + private MouseRelative mouseEvent; + + /// + /// MouseRelative event. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public MouseRelative MouseRelative + { + get + { + return mouseEvent; + } + set + { + mouseEvent = value; + } + } + } + + /// /// Do not use this, that will be deprecated. /// /// 3