-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the new InputGesture feature
supporting Edge Swipe, Edge Drag, Tap, and Palm Cover gestures
- Loading branch information
Showing
11 changed files
with
1,181 additions
and
0 deletions.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
src/Tizen.NUI.WindowSystem/src/internal/Interop/Interop.InputGesture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Tizen.NUI.WindowSystem | ||
{ | ||
internal static partial class Interop | ||
{ | ||
internal static class InputGesture | ||
{ | ||
const string lib = "libcapi-ui-efl-util.so.0"; | ||
|
||
internal static string LogTag = "Tizen.NUI.WindowSystem"; | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_initialize")] | ||
internal static extern IntPtr Initialize(); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_deinitialize")] | ||
internal static extern ErrorCode Deinitialize(IntPtr gestureHandler); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_new")] | ||
internal static extern IntPtr EdgeSwipeNew(IntPtr gestureHandler, int fingers, int edge); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_free")] | ||
internal static extern ErrorCode EdgeSwipeFree(IntPtr gestureHandler, IntPtr gestureData); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_size_set")] | ||
internal static extern ErrorCode EdgeSwipeSizeSet(IntPtr gestureData, int edgeSize, int startPoint, int endPoint); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_new")] | ||
internal static extern IntPtr EdgeDragNew(IntPtr gestureHandler, int fingers, int edge); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_free")] | ||
internal static extern ErrorCode EdgeDragFree(IntPtr gestureHandler, IntPtr gestureData); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_size_set")] | ||
internal static extern ErrorCode EdgeDragSizeSet(IntPtr gestureData, int edgeSize, int startPoint, int endPoint); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_tap_new")] | ||
internal static extern IntPtr TapNew(IntPtr gestureHandler, int fingers, int repeats); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_tap_free")] | ||
internal static extern ErrorCode TapFree(IntPtr gestureHandler, IntPtr gestureData); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_new")] | ||
internal static extern IntPtr PalmCoverNew(IntPtr gestureHandler); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_free")] | ||
internal static extern ErrorCode PalmCoverFree(IntPtr gestureHandler, IntPtr gestureData); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_grab")] | ||
internal static extern ErrorCode GestureGrab(IntPtr gestureHandler, IntPtr gestureData); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_ungrab")] | ||
internal static extern ErrorCode GestureUngrab(IntPtr gestureHandler, IntPtr gestureData); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_swipe_cb_set")] | ||
internal static extern ErrorCode SetEdgeSwipeCb(IntPtr gestureHandler, EdgeSwipeCb cbFunc, IntPtr usergestureData); | ||
|
||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
internal delegate void EdgeSwipeCb(IntPtr usergestureData, int mode, int fingers, int sx, int sy, int edge); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_edge_drag_cb_set")] | ||
internal static extern ErrorCode SetEdgeDragCb(IntPtr gestureHandler, EdgeDragCb cbFunc, IntPtr usergestureData); | ||
|
||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
internal delegate void EdgeDragCb(IntPtr usergestureData, int mode, int fingers, int cx, int cy, int edge); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_tap_cb_set")] | ||
internal static extern ErrorCode SetTapCb(IntPtr gestureHandler, TapCb cbFunc, IntPtr usergestureData); | ||
|
||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
internal delegate void TapCb(IntPtr usergestureData, int mode, int fingers, int repeats); | ||
|
||
[DllImport(lib, EntryPoint = "efl_util_gesture_palm_cover_cb_set")] | ||
internal static extern ErrorCode SetPalmCoverCb(IntPtr gestureHandler, PalmCoverCb cbFunc, IntPtr usergestureData); | ||
|
||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
internal delegate void PalmCoverCb(IntPtr usergestureData, int mode, int duration, int cx, int cy, int size, double pressure); | ||
|
||
internal enum ErrorCode | ||
{ | ||
None = Tizen.Internals.Errors.ErrorCode.None, // Successful | ||
OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, // Out of memory | ||
InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, // Invalid parameter | ||
InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, // Invalid operation | ||
PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, // Permission denied | ||
NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, // NOT supported | ||
}; | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/Tizen.NUI.WindowSystem/src/public/EdgeDragEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright(c) 2024 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; | ||
using System.ComponentModel; | ||
|
||
namespace Tizen.NUI.WindowSystem | ||
{ | ||
/// <summary> | ||
/// This class contains the data related to the EdgeDrag event. | ||
/// </summary> | ||
/// This class is need to be hidden as inhouse API. | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public class EdgeDragEventArgs : EventArgs | ||
{ | ||
internal EdgeDragEventArgs(int mode, int fingers, int cx, int cy, int edge) | ||
{ | ||
Mode = mode; | ||
Fingers = fingers; | ||
Cx = cx; | ||
Cy = cy; | ||
Edge = edge; | ||
} | ||
/// <summary> | ||
/// Mode | ||
/// </summary> | ||
public int Mode{ get; internal set; } | ||
/// <summary> | ||
/// Fingers | ||
/// </summary> | ||
public int Fingers{ get; internal set;} | ||
/// <summary> | ||
/// Cx | ||
/// </summary> | ||
public int Cx{ get; internal set;} | ||
/// <summary> | ||
/// Cy | ||
/// </summary> | ||
public int Cy{ get; internal set;} | ||
/// <summary> | ||
/// Edge | ||
/// </summary> | ||
public int Edge{ get; internal set;} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/Tizen.NUI.WindowSystem/src/public/EdgeSwipeEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright(c) 2024 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; | ||
using System.ComponentModel; | ||
|
||
namespace Tizen.NUI.WindowSystem | ||
{ | ||
/// <summary> | ||
/// This class contains the data related to the EdgeSwipe event. | ||
/// </summary> | ||
/// This class is need to be hidden as inhouse API. | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public class EdgeSwipeEventArgs : EventArgs | ||
{ | ||
internal EdgeSwipeEventArgs(int mode, int fingers, int sx, int sy, int edge) | ||
{ | ||
Mode = mode; | ||
Fingers = fingers; | ||
Sx = sx; | ||
Sy = sy; | ||
Edge = edge; | ||
} | ||
/// <summary> | ||
/// Mode | ||
/// </summary> | ||
public int Mode{ get; internal set; } | ||
/// <summary> | ||
/// Fingers | ||
/// </summary> | ||
public int Fingers{ get; internal set;} | ||
/// <summary> | ||
/// Sx | ||
/// </summary> | ||
public int Sx{ get; internal set;} | ||
/// <summary> | ||
/// Sy | ||
/// </summary> | ||
public int Sy{ get; internal set;} | ||
/// <summary> | ||
/// Edge | ||
/// </summary> | ||
public int Edge{ get; internal set;} | ||
} | ||
} |
Oops, something went wrong.