1 //------------------------------------------------------------------------------
4 // This file was automatically generated by SWIG (http://www.swig.org).
7 // Do not make changes to this file unless you know what you are doing--modify
8 // the SWIG interface file instead.
9 //------------------------------------------------------------------------------
15 /// Sets whether the actor should be focusable by keyboard navigation.<br>
16 /// Visuals reuse geometry, shader etc. across controls. They ensure that the renderer and texture sets exist only when control is on-stage.<br>
17 /// Each visual also responds to actor size and color change, and provides clipping at the renderer level.<br>
18 /// Note: The visual responds to the the Actor::COLOR by blending it with the 'Multiply' operator.<br>
20 public class VisualBase : BaseHandle
22 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
24 internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualBase_SWIGUpcast(cPtr), cMemoryOwn)
26 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualBase 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 override void Dispose()
41 if (!Stage.IsInstalled())
43 DisposeQueue.Instance.Add(this);
48 if (swigCPtr.Handle != global::System.IntPtr.Zero)
53 NDalicPINVOKE.delete_VisualBase(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
63 /// Create an empty Visual Handle
65 public VisualBase() : this(NDalicPINVOKE.new_VisualBase__SWIG_0(), true)
67 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 internal VisualBase(VisualBase handle) : this(NDalicPINVOKE.new_VisualBase__SWIG_1(VisualBase.getCPtr(handle)), true)
72 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
75 internal VisualBase Assign(VisualBase handle)
77 VisualBase ret = new VisualBase(NDalicPINVOKE.VisualBase_Assign(swigCPtr, VisualBase.getCPtr(handle)), false);
78 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
83 /// name of the visual
97 internal void SetName(string name)
99 NDalicPINVOKE.VisualBase_SetName(swigCPtr, name);
100 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103 internal string GetName()
105 string ret = NDalicPINVOKE.VisualBase_GetName(swigCPtr);
106 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 /// Sets the transform and the control size
113 /// <param name="transform">A property map describing the transform</param>
114 /// <param name="controlSize">The size of the parent control for visuals that need to scale internally.</param>
115 public void SetTransformAndSize(PropertyMap transform, Vector2 controlSize)
117 NDalicPINVOKE.VisualBase_SetTransformAndSize(swigCPtr, PropertyMap.getCPtr(transform), Vector2.getCPtr(controlSize));
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 /// Returns the height for a given width.
124 /// <param name="width">Width to use.</param>
125 /// <returns>The height based on the width.</returns>
126 public float GetHeightForWidth(float width)
128 float ret = NDalicPINVOKE.VisualBase_GetHeightForWidth(swigCPtr, width);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// Returns the width for a given height.
136 /// <param name="height">Height to use.</param>
137 /// <returns>The width based on the height.</returns>
138 public float GetWidthForHeight(float height)
140 float ret = NDalicPINVOKE.VisualBase_GetWidthForHeight(swigCPtr, height);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 /// Return the natural size of the visual.<br>
147 /// Deriving classes stipulate the natural size and by default a visual has a ZERO natural size.<br>
148 /// A visual may not actually have a natural size until it has been placed on stage and acquired all it's resources.<br>
150 /// <param name="naturalSize">The visual's natural size</param>
151 public void GetNaturalSize(Size2D naturalSize)
153 NDalicPINVOKE.VisualBase_GetNaturalSize(swigCPtr, Size2D.getCPtr(naturalSize));
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 /// the depth index of this visual.
160 public float DepthIndex
164 SetDepthIndex(value);
168 return GetDepthIndex();
171 internal void SetDepthIndex(float index)
173 NDalicPINVOKE.VisualBase_SetDepthIndex(swigCPtr, index);
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 internal float GetDepthIndex()
179 float ret = NDalicPINVOKE.VisualBase_GetDepthIndex(swigCPtr);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 /// Create the property map representing this visual.
187 public PropertyMap Creation
191 CreatePropertyMap(value);
194 internal void CreatePropertyMap(PropertyMap map)
196 NDalicPINVOKE.VisualBase_CreatePropertyMap(swigCPtr, PropertyMap.getCPtr(map));
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 internal VisualBase(SWIGTYPE_p_Dali__Toolkit__Internal__Visual__Base impl) : this(NDalicPINVOKE.new_VisualBase__SWIG_2(SWIGTYPE_p_Dali__Toolkit__Internal__Visual__Base.getCPtr(impl)), true)
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();