2 * Copyright(c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
22 /// A PinchGesture is emitted when the user moves two fingers towards or away from each other.<br />
23 /// A pinch gesture will continue to be sent to the actor under the center point of the pinch until the pinch ends.<br />
25 /// <since_tizen> 3 </since_tizen>
26 public class PinchGesture : Gesture
28 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PinchGesture_SWIGUpcast(cPtr), cMemoryOwn)
32 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
35 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGesture obj)
37 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
43 /// <since_tizen> 3 </since_tizen>
44 protected override void Dispose(DisposeTypes type)
51 if(type == DisposeTypes.Explicit)
54 //Release your own managed resources here.
55 //You should release all of your own disposable objects here.
58 //Release your own unmanaged resources here.
59 //You should not access any managed member here except static instance.
60 //because the execution order of Finalizes is non-deterministic.
62 if (swigCPtr.Handle != global::System.IntPtr.Zero)
67 NDalicPINVOKE.delete_PinchGesture(swigCPtr);
69 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
76 internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
78 PinchGesture ret = new PinchGesture(cPtr, false);
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84 /// The scale factor from the start of the pinch gesture till the latest pinch gesture.<br />
85 /// If the user is moving their fingers away from each other, then
86 /// this value increases. Conversely, if the user is moving their
87 /// fingers towards each other, this value will decrease.<br />
89 /// <since_tizen> 3 </since_tizen>
99 /// The speed at which the user is moving their fingers.<br />
100 /// This is the pixel movement per second.<br />
102 /// <since_tizen> 3 </since_tizen>
112 /// The center point of the two points that caused the pinch gesture in screen coordinates.
114 /// <since_tizen> 3 </since_tizen>
115 public Vector2 ScreenCenterPoint
119 return screenCenterPoint;
124 /// The center point of the two points that caused the pinch gesture in local actor coordinates.
126 /// <since_tizen> 3 </since_tizen>
127 public Vector2 LocalCenterPoint
131 return localCenterPoint;
136 /// The default constructor.
138 /// <param name="state">The state of the gesture.</param>
139 internal PinchGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PinchGesture__SWIG_0((int)state), true)
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
148 NDalicPINVOKE.PinchGesture_scale_set(swigCPtr, value);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 float ret = NDalicPINVOKE.PinchGesture_scale_get(swigCPtr);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 NDalicPINVOKE.PinchGesture_speed_set(swigCPtr, value);
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168 float ret = NDalicPINVOKE.PinchGesture_speed_get(swigCPtr);
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 private Vector2 screenCenterPoint
178 NDalicPINVOKE.PinchGesture_screenCenterPoint_set(swigCPtr, Vector2.getCPtr(value));
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 global::System.IntPtr cPtr = NDalicPINVOKE.PinchGesture_screenCenterPoint_get(swigCPtr);
184 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 private Vector2 localCenterPoint
194 NDalicPINVOKE.PinchGesture_localCenterPoint_set(swigCPtr, Vector2.getCPtr(value));
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 global::System.IntPtr cPtr = NDalicPINVOKE.PinchGesture_localCenterPoint_get(swigCPtr);
200 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
201 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();