1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
21 /// A PinchGesture is emitted when the user moves two fingers towards or away from each other.<br>
22 /// A pinch gesture will continue to be sent to the actor under the center point of the pinch until the pinch ends.<br>
24 public class PinchGesture : Gesture
26 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
28 internal PinchGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PinchGesture_SWIGUpcast(cPtr), cMemoryOwn)
30 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
33 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGesture obj)
35 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
38 protected override void Dispose(DisposeTypes type)
45 if(type == DisposeTypes.Explicit)
48 //Release your own managed resources here.
49 //You should release all of your own disposable objects here.
52 //Release your own unmanaged resources here.
53 //You should not access any managed member here except static instance.
54 //because the execution order of Finalizes is non-deterministic.
56 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61 NDalicPINVOKE.delete_PinchGesture(swigCPtr);
63 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70 internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
72 PinchGesture ret = new PinchGesture(cPtr, false);
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78 /// The scale factor from the start of the pinch gesture till the latest pinch gesture.<br>
79 /// If the user is moving their fingers away from each other, then
80 /// this value increases. Conversely, if the user is moving their
81 /// fingers towards each other, this value will decrease.<br>
92 /// The speed at which the user is moving their fingers.<br>
93 /// This is the pixel movement per second.<br>
104 /// The center point of the two points that caused the pinch gesture in screen coordinates.
106 public Vector2 ScreenCenterPoint
110 return screenCenterPoint;
115 /// The center point of the two points that caused the pinch gesture in local actor coordinates.
117 public Vector2 LocalCenterPoint
121 return localCenterPoint;
126 /// The default constructor.
128 /// <param name="state">The state of the gesture.</param>
129 internal PinchGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PinchGesture__SWIG_0((int)state), true)
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 NDalicPINVOKE.PinchGesture_scale_set(swigCPtr, value);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 float ret = NDalicPINVOKE.PinchGesture_scale_get(swigCPtr);
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 NDalicPINVOKE.PinchGesture_speed_set(swigCPtr, value);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 float ret = NDalicPINVOKE.PinchGesture_speed_get(swigCPtr);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 private Vector2 screenCenterPoint
168 NDalicPINVOKE.PinchGesture_screenCenterPoint_set(swigCPtr, Vector2.getCPtr(value));
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 global::System.IntPtr cPtr = NDalicPINVOKE.PinchGesture_screenCenterPoint_get(swigCPtr);
174 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 private Vector2 localCenterPoint
184 NDalicPINVOKE.PinchGesture_localCenterPoint_set(swigCPtr, Vector2.getCPtr(value));
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 global::System.IntPtr cPtr = NDalicPINVOKE.PinchGesture_localCenterPoint_get(swigCPtr);
190 Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false);
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();