Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NUI] Add RelativeMotionGrab and RelativeMotionUnGrab #6224

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,14 @@ internal static partial class Window
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_IsAlwaysOnTop")]
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool IsAlwaysOnTop(global::System.Runtime.InteropServices.HandleRef window);

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_RelativeMotionGrab")]
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool RelativeMotionGrab(global::System.Runtime.InteropServices.HandleRef window, uint boundary);

[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_RelativeMotionUnGrab")]
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool RelativeMotionUnGrab(global::System.Runtime.InteropServices.HandleRef window);
}
}
}
62 changes: 62 additions & 0 deletions src/Tizen.NUI/src/public/Window/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,44 @@ public enum ResizeDirection
BottomRight = 8,
}

/// <summary>
/// The Pointer edge boundary for grab.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public enum PointerBoundary
{
/// <summary>
/// Default value
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
None = 0,

/// <summary>
/// Top
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Top = 1,

/// <summary>
/// Right
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Right = 2,

/// <summary>
/// Bottom
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Bottom = 3,

/// <summary>
/// Left
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Left = 4,

}

/// <summary>
/// The stage instance property (read-only).<br />
/// Gets the current window.<br />
Expand Down Expand Up @@ -2549,6 +2587,30 @@ public bool IsAlwaysOnTop
}
}

/// <summary>
/// Requests relative motion grab
/// </summary>
/// <returns>True if RelativeMotionGrab succeeds.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool RelativeMotionGrab(PointerBoundary boundary)
{
bool ret = Interop.Window.RelativeMotionGrab(SwigCPtr, (uint)boundary);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

/// <summary>
/// Requests relative motion ungrab
/// </summary>
/// <returns>True if RelativeMotionGrab succeeds.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool RelativeMotionUnGrab()
{
bool ret = Interop.Window.RelativeMotionUnGrab(SwigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}

IntPtr IWindowProvider.WindowHandle => GetNativeWindowHandler();
float IWindowProvider.X => WindowPosition.X;
float IWindowProvider.Y => WindowPosition.Y;
Expand Down
Loading