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 (!Window.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);
64 public static readonly int CLIPPING_ENABLE = NDalicPINVOKE.Layer_Property_CLIPPING_ENABLE_get();
65 public static readonly int CLIPPING_BOX = NDalicPINVOKE.Layer_Property_CLIPPING_BOX_get();
66 public static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get();
69 public Layer() : this(NDalicPINVOKE.Layer_New(), true)
71 if (NDalicPINVOKE.SWIGPendingException.Pending)
72 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
76 internal new static Layer DownCast(BaseHandle handle)
78 Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true);
79 if (NDalicPINVOKE.SWIGPendingException.Pending)
80 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84 public View FindChildById(uint id)
86 View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true);
87 if (NDalicPINVOKE.SWIGPendingException.Pending)
88 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 public void Add(View child)
94 NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child));
95 if (NDalicPINVOKE.SWIGPendingException.Pending)
96 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 public void Remove(View child)
101 NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child));
102 if (NDalicPINVOKE.SWIGPendingException.Pending)
103 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106 public uint GetDepth()
108 uint ret = NDalicPINVOKE.Layer_GetDepth(swigCPtr);
109 if (NDalicPINVOKE.SWIGPendingException.Pending)
110 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 NDalicPINVOKE.Layer_Raise(swigCPtr);
117 if (NDalicPINVOKE.SWIGPendingException.Pending)
118 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 NDalicPINVOKE.Layer_Lower(swigCPtr);
124 if (NDalicPINVOKE.SWIGPendingException.Pending)
125 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 public void RaiseAbove(Layer target)
130 NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target));
131 if (NDalicPINVOKE.SWIGPendingException.Pending)
132 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 public void LowerBelow(Layer target)
137 NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target));
138 if (NDalicPINVOKE.SWIGPendingException.Pending)
139 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
142 public void RaiseToTop()
144 NDalicPINVOKE.Layer_RaiseToTop(swigCPtr);
145 if (NDalicPINVOKE.SWIGPendingException.Pending)
146 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
149 public void LowerToBottom()
151 NDalicPINVOKE.Layer_LowerToBottom(swigCPtr);
152 if (NDalicPINVOKE.SWIGPendingException.Pending)
153 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public void MoveAbove(Layer target)
158 NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target));
159 if (NDalicPINVOKE.SWIGPendingException.Pending)
160 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 public void MoveBelow(Layer target)
165 NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target));
166 if (NDalicPINVOKE.SWIGPendingException.Pending)
167 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 private void SetBehavior(Layer.LayerBehavior behavior)
172 NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior);
173 if (NDalicPINVOKE.SWIGPendingException.Pending)
174 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 private Layer.LayerBehavior GetBehavior()
179 Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr);
180 if (NDalicPINVOKE.SWIGPendingException.Pending)
181 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function)
187 NDalicPINVOKE.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function));
188 if (NDalicPINVOKE.SWIGPendingException.Pending)
189 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
192 public void SetTouchConsumed(bool consume)
194 NDalicPINVOKE.Layer_SetTouchConsumed(swigCPtr, consume);
195 if (NDalicPINVOKE.SWIGPendingException.Pending)
196 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 public bool IsTouchConsumed()
201 bool ret = NDalicPINVOKE.Layer_IsTouchConsumed(swigCPtr);
202 if (NDalicPINVOKE.SWIGPendingException.Pending)
203 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 public void SetHoverConsumed(bool consume)
209 NDalicPINVOKE.Layer_SetHoverConsumed(swigCPtr, consume);
210 if (NDalicPINVOKE.SWIGPendingException.Pending)
211 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 public bool IsHoverConsumed()
216 bool ret = NDalicPINVOKE.Layer_IsHoverConsumed(swigCPtr);
217 if (NDalicPINVOKE.SWIGPendingException.Pending)
218 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 public enum LayerBehavior
229 public enum TreeDepthMultiplier
231 TREE_DEPTH_MULTIPLIER = 10000
234 public Layer.LayerBehavior Behavior
238 return GetBehavior();