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 /// VisualFactory is a singleton object that provides and shares visuals between views
23 public class VisualFactory : BaseHandle
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal VisualFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualFactory_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualFactory obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 if(type == DisposeTypes.Explicit)
47 //Release your own managed resources here.
48 //You should release all of your own disposable objects here.
51 //Release your own unmanaged resources here.
52 //You should not access any managed member here except static instance.
53 //because the execution order of Finalizes is non-deterministic.
55 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61 //Unreference this instance from Registry.
62 Registry.Unregister(this);
64 NDalicPINVOKE.delete_VisualFactory(swigCPtr);
66 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
74 /// Create or retrieve VisualFactory singleton.
76 /// <returns>A handle to the VisualFactory control.</returns>
77 public static VisualFactory Get()
79 VisualFactory ret = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true);
80 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84 internal VisualFactory() : this(NDalicPINVOKE.new_VisualFactory__SWIG_0(), true)
86 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
91 /// Request the visual
93 /// <param name="propertyMap">The map contains the properties required by the visual. The content of the map determines the type of visual that will be returned.</param>
94 /// <returns>The handle to the created visual</returns>
95 public VisualBase CreateVisual(PropertyMap propertyMap)
97 VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_0(swigCPtr, PropertyMap.getCPtr(propertyMap)), true);
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 internal VisualBase CreateVisual(Image image)
104 VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_1(swigCPtr, Image.getCPtr(image)), true);
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109 private static readonly VisualFactory instance = VisualFactory.Get();
112 /// retrieve VisualFactory singleton.
114 public static VisualFactory Instance