/** Copyright (c) 2017 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 Dali { public class Layer : Animatable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Layer_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Layer() { DisposeQueue.Instance.Add(this); } public virtual void Dispose() { if (!Window.IsInstalled()) { DisposeQueue.Instance.Add(this); return; } lock (this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicPINVOKE.delete_Layer(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); } } public class Property : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } ~Property() { Dispose(); } public virtual void Dispose() { lock (this) { if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicPINVOKE.delete_Layer_Property(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } global::System.GC.SuppressFinalize(this); } } public Property() : this(NDalicPINVOKE.new_Layer_Property(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public static readonly int CLIPPING_ENABLE = NDalicPINVOKE.Layer_Property_CLIPPING_ENABLE_get(); public static readonly int CLIPPING_BOX = NDalicPINVOKE.Layer_Property_CLIPPING_BOX_get(); public static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get(); } public Layer() : this(NDalicPINVOKE.Layer_New(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public new static Layer DownCast(BaseHandle handle) { Layer ret = new Layer(NDalicPINVOKE.Layer_DownCast(BaseHandle.getCPtr(handle)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public Layer(Layer copy) : this(NDalicPINVOKE.new_Layer__SWIG_1(Layer.getCPtr(copy)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Layer Assign(Layer rhs) { Layer ret = new Layer(NDalicPINVOKE.Layer_Assign(swigCPtr, Layer.getCPtr(rhs)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public View FindChildById(uint id) { View ret = new View(NDalicPINVOKE.Actor_FindChildById(swigCPtr, id), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void Add(View child) { NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Remove(View child) { NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public uint GetDepth() { uint ret = NDalicPINVOKE.Layer_GetDepth(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void Raise() { NDalicPINVOKE.Layer_Raise(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void Lower() { NDalicPINVOKE.Layer_Lower(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void RaiseAbove(Layer target) { NDalicPINVOKE.Layer_RaiseAbove(swigCPtr, Layer.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void LowerBelow(Layer target) { NDalicPINVOKE.Layer_LowerBelow(swigCPtr, Layer.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void RaiseToTop() { NDalicPINVOKE.Layer_RaiseToTop(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void LowerToBottom() { NDalicPINVOKE.Layer_LowerToBottom(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void MoveAbove(Layer target) { NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void MoveBelow(Layer target) { NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void SetBehavior(Layer.LayerBehavior behavior) { NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Layer.LayerBehavior GetBehavior() { Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetClipping(bool enabled) { NDalicPINVOKE.Layer_SetClipping(swigCPtr, enabled); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public bool IsClipping() { bool ret = NDalicPINVOKE.Layer_IsClipping(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetClippingBox(int x, int y, int width, int height) { NDalicPINVOKE.Layer_SetClippingBox__SWIG_0(swigCPtr, x, y, width, height); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void SetClippingBox(Rectangle box) { NDalicPINVOKE.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(box)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public Rectangle GetClippingBox() { Rectangle ret = new Rectangle(NDalicPINVOKE.Layer_GetClippingBox(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetDepthTestDisabled(bool disable) { NDalicPINVOKE.Layer_SetDepthTestDisabled(swigCPtr, disable); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public bool IsDepthTestDisabled() { bool ret = NDalicPINVOKE.Layer_IsDepthTestDisabled(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function) { NDalicPINVOKE.Layer_SetSortFunction(swigCPtr, SWIGTYPE_p_f_r_q_const__Dali__Vector3__float.getCPtr(function)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public void SetTouchConsumed(bool consume) { NDalicPINVOKE.Layer_SetTouchConsumed(swigCPtr, consume); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public bool IsTouchConsumed() { bool ret = NDalicPINVOKE.Layer_IsTouchConsumed(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public void SetHoverConsumed(bool consume) { NDalicPINVOKE.Layer_SetHoverConsumed(swigCPtr, consume); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } public bool IsHoverConsumed() { bool ret = NDalicPINVOKE.Layer_IsHoverConsumed(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } public enum LayerBehavior { LAYER_2D, LAYER_UI = LAYER_2D, LAYER_3D } public enum TreeDepthMultiplier { TREE_DEPTH_MULTIPLIER = 10000 } public bool ClippingEnable { get { bool temp = false; GetProperty(Layer.Property.CLIPPING_ENABLE).Get(ref temp); return temp; } set { SetProperty(Layer.Property.CLIPPING_ENABLE, new Dali.Property.Value(value)); } } public Rectangle ClippingBox { get { Rectangle temp = new Rectangle(0, 0, 0, 0); GetProperty(Layer.Property.CLIPPING_BOX).Get(temp); return temp; } set { SetProperty(Layer.Property.CLIPPING_BOX, new Dali.Property.Value(value)); } } public Layer.LayerBehavior Behavior { get { return GetBehavior(); } set { SetBehavior(value); } } } }