-
Notifications
You must be signed in to change notification settings - Fork 247
/
Gesture.cs
executable file
·231 lines (215 loc) · 7.64 KB
/
Gesture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
/*
* Copyright(c) 2019 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
{
/// <summary>
/// Base structure for different gestures that an application can receive.<br />
/// A Gesture is an event that is produced from a combination of several touch events
/// in a particular order or within a certain time frame (for example, pinch).<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Gesture : Disposable
{
/// <summary>
/// swigCMemOwn.
/// </summary>
/// <since_tizen> 3 </since_tizen>
protected bool swigCMemOwn;
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
/// <summary>
/// The Copy constructor.
/// </summary>
/// <param name="rhs">A reference to the copied handle</param>
/// <since_tizen> 3 </since_tizen>
public Gesture(Gesture rhs) : this(Interop.Gesture.new_Gesture(Gesture.getCPtr(rhs)), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn)
{
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
/// <summary>
/// Enumeration for type of gesture.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public enum GestureType
{
/// <summary>
/// When two touch points move away or towards each other.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Pinch = 1 << 0,
/// <summary>
/// When the user drags their finger(s) in a particular direction.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Pan = 1 << 1,
/// <summary>
/// When the user taps the screen.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Tap = 1 << 2,
/// <summary>
/// When the user continues to touch the same area on the screen for the device configured time.
/// </summary>
/// <since_tizen> 3 </since_tizen>
LongPress = 1 << 3
}
/// <summary>
/// Enumeration for state of the gesture.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public enum StateType
{
/// <summary>
/// There is no state associated with this gesture.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Clear,
/// <summary>
/// The touched points on the screen have moved enough to be considered a gesture.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Started,
/// <summary>
/// The gesture is continuing.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Continuing,
/// <summary>
/// The user has lifted a finger or touched an additional point on the screen.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Finished,
/// <summary>
/// The gesture has been cancelled.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Cancelled,
/// <summary>
/// A gesture is possible.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Possible
}
/// <summary>
/// The gesture type.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public Gesture.GestureType Type
{
get
{
return type;
}
}
/// <summary>
/// The gesture state.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public Gesture.StateType State
{
get
{
return state;
}
}
/// <summary>
/// The time the gesture took place.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public uint Time
{
get
{
return time;
}
}
private Gesture.GestureType type
{
set
{
Interop.Gesture.Gesture_type_set(swigCPtr, (int)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
Gesture.GestureType ret = (Gesture.GestureType)Interop.Gesture.Gesture_type_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private Gesture.StateType state
{
set
{
Interop.Gesture.Gesture_state_set(swigCPtr, (int)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
Gesture.StateType ret = (Gesture.StateType)Interop.Gesture.Gesture_state_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
private uint time
{
set
{
Interop.Gesture.Gesture_time_set(swigCPtr, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
get
{
uint ret = Interop.Gesture.Gesture_time_get(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
/// <summary>
/// Dispose.
/// </summary>
/// <since_tizen> 3 </since_tizen>
protected override void Dispose(DisposeTypes type)
{
if (disposed)
{
return;
}
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
Interop.Gesture.delete_Gesture(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
base.Dispose(type);
}
}
}