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.
20 public class Layer : Animatable
22 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
24 internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Layer_SWIGUpcast(cPtr), cMemoryOwn)
26 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj)
31 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36 DisposeQueue.Instance.Add(this);
39 public virtual void Dispose()
41 if (!Stage.IsInstalled())
43 DisposeQueue.Instance.Add(this);
49 if (swigCPtr.Handle != global::System.IntPtr.Zero)
54 NDalicPINVOKE.delete_Layer(swigCPtr);
56 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58 global::System.GC.SuppressFinalize(this);
63 public class Property : global::System.IDisposable
65 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
66 protected bool swigCMemOwn;
68 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
70 swigCMemOwn = cMemoryOwn;
71 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
74 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
76 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
84 public virtual void Dispose()
88 if (swigCPtr.Handle != global::System.IntPtr.Zero)
93 NDalicPINVOKE.delete_Layer_Property(swigCPtr);
95 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
97 global::System.GC.SuppressFinalize(this);
101 public Property() : this(NDalicPINVOKE.new_Layer_Property(), true)
103 if (NDalicPINVOKE.SWIGPendingException.Pending)
104 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
107 public static readonly int CLIPPING_ENABLE = NDalicPINVOKE.Layer_Property_CLIPPING_ENABLE_get();
108 public static readonly int CLIPPING_BOX = NDalicPINVOKE.Layer_Property_CLIPPING_BOX_get();
109 public static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get();
113 public Layer() : this(NDalicPINVOKE.Layer_New(), true)
115 if (NDalicPINVOKE.SWIGPendingException.Pending)
116 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120 public new static Layer DownCast(BaseHandle handle)
122 Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true);
123 if (NDalicPINVOKE.SWIGPendingException.Pending)
124 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 public Layer(Layer copy) : this(NDalicPINVOKE.new_Layer__SWIG_1(Layer.getCPtr(copy)), true)
130 if (NDalicPINVOKE.SWIGPendingException.Pending)
131 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 public Layer Assign(Layer rhs)
136 Layer ret = new Layer(NDalicPINVOKE.Layer_Assign(swigCPtr, Layer.getCPtr(rhs)), false);
137 if (NDalicPINVOKE.SWIGPendingException.Pending)
138 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 public View FindChildById(uint id)
144 View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
145 if (NDalicPINVOKE.SWIGPendingException.Pending)
146 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public void Add(View child)
152 NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
153 if (NDalicPINVOKE.SWIGPendingException.Pending)
154 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 public void Remove(View child)
159 NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
160 if (NDalicPINVOKE.SWIGPendingException.Pending)
161 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 public uint GetDepth()
166 uint ret = NDalicPINVOKE.Layer_GetDepth(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending)
168 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 NDalicPINVOKE.Layer_Raise(swigCPtr);
175 if (NDalicPINVOKE.SWIGPendingException.Pending)
176 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 NDalicPINVOKE.Layer_Lower(swigCPtr);
182 if (NDalicPINVOKE.SWIGPendingException.Pending)
183 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 public void RaiseAbove(Layer target)
188 NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target));
189 if (NDalicPINVOKE.SWIGPendingException.Pending)
190 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 public void LowerBelow(Layer target)
195 NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target));
196 if (NDalicPINVOKE.SWIGPendingException.Pending)
197 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public void RaiseToTop()
202 NDalicPINVOKE.Layer_RaiseToTop(swigCPtr);
203 if (NDalicPINVOKE.SWIGPendingException.Pending)
204 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 public void LowerToBottom()
209 NDalicPINVOKE.Layer_LowerToBottom(swigCPtr);
210 if (NDalicPINVOKE.SWIGPendingException.Pending)
211 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 public void MoveAbove(Layer target)
216 NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
217 if (NDalicPINVOKE.SWIGPendingException.Pending)
218 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 public void MoveBelow(Layer target)
223 NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
224 if (NDalicPINVOKE.SWIGPendingException.Pending)
225 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public void SetBehavior(Layer.LayerBehavior behavior)
230 NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior);
231 if (NDalicPINVOKE.SWIGPendingException.Pending)
232 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 public Layer.LayerBehavior GetBehavior()
237 Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr);
238 if (NDalicPINVOKE.SWIGPendingException.Pending)
239 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 public void SetClipping(bool enabled)
245 NDalicPINVOKE.Layer_SetClipping(swigCPtr, enabled);
246 if (NDalicPINVOKE.SWIGPendingException.Pending)
247 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 public bool IsClipping()
252 bool ret = NDalicPINVOKE.Layer_IsClipping(swigCPtr);
253 if (NDalicPINVOKE.SWIGPendingException.Pending)
254 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
258 public void SetClippingBox(int x, int y, int width, int height)
260 NDalicPINVOKE.Layer_SetClippingBox__SWIG_0(swigCPtr, x, y, width, height);
261 if (NDalicPINVOKE.SWIGPendingException.Pending)
262 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 public void SetClippingBox(Rectangle box)
267 NDalicPINVOKE.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(box));
268 if (NDalicPINVOKE.SWIGPendingException.Pending)
269 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
272 public Rectangle GetClippingBox()
274 Rectangle ret = new Rectangle(NDalicPINVOKE.Layer_GetClippingBox(swigCPtr), true);
275 if (NDalicPINVOKE.SWIGPendingException.Pending)
276 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 public void SetDepthTestDisabled(bool disable)
282 NDalicPINVOKE.Layer_SetDepthTestDisabled(swigCPtr, disable);
283 if (NDalicPINVOKE.SWIGPendingException.Pending)
284 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public bool IsDepthTestDisabled()
289 bool ret = NDalicPINVOKE.Layer_IsDepthTestDisabled(swigCPtr);
290 if (NDalicPINVOKE.SWIGPendingException.Pending)
291 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 public void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
297 NDalicPINVOKE.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
298 if (NDalicPINVOKE.SWIGPendingException.Pending)
299 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
302 public void SetTouchConsumed(bool consume)
304 NDalicPINVOKE.Layer_SetTouchConsumed(swigCPtr, consume);
305 if (NDalicPINVOKE.SWIGPendingException.Pending)
306 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
309 public bool IsTouchConsumed()
311 bool ret = NDalicPINVOKE.Layer_IsTouchConsumed(swigCPtr);
312 if (NDalicPINVOKE.SWIGPendingException.Pending)
313 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
317 public void SetHoverConsumed(bool consume)
319 NDalicPINVOKE.Layer_SetHoverConsumed(swigCPtr, consume);
320 if (NDalicPINVOKE.SWIGPendingException.Pending)
321 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 public bool IsHoverConsumed()
326 bool ret = NDalicPINVOKE.Layer_IsHoverConsumed(swigCPtr);
327 if (NDalicPINVOKE.SWIGPendingException.Pending)
328 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332 public enum LayerBehavior
339 public enum TreeDepthMultiplier
341 TREE_DEPTH_MULTIPLIER = 10000
344 public bool ClippingEnable
349 GetProperty(Layer.Property.CLIPPING_ENABLE).Get(ref temp);
354 SetProperty(Layer.Property.CLIPPING_ENABLE, new Dali.Property.Value(value));
358 public Rectangle ClippingBox
362 Rectangle temp = new Rectangle(0, 0, 0, 0);
363 GetProperty(Layer.Property.CLIPPING_BOX).Get(temp);
368 SetProperty(Layer.Property.CLIPPING_BOX, new Dali.Property.Value(value));
372 public Layer.LayerBehavior Behavior
376 return GetBehavior();