[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_canvas_text_factory.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Canvas {
11
12 /// <summary>Object factory that creates Efl.Canvas.Object objects.
13 /// Translates a given key to an object (item), to be later placed in a text for higher level usages. The translation implementation is left to be decided by the inheriting class, whether it is by treating the <c>key</c> as an image path, or a key associated with a real-path in a hashtable or something else entirely.</summary>
14 [Efl.Canvas.ITextFactoryConcrete.NativeMethods]
15 public interface ITextFactory : 
16     Efl.Eo.IWrapper, IDisposable
17 {
18     /// <summary>Translates a given <c>key</c> to an item object, and returns the object. The returned object should be owned by the passed <c>object</c>.</summary>
19 /// <param name="kw_object">The parent of the created object</param>
20 /// <param name="key">Key that is associated to an item object</param>
21 Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key);
22     }
23 /// <summary>Object factory that creates Efl.Canvas.Object objects.
24 /// Translates a given key to an object (item), to be later placed in a text for higher level usages. The translation implementation is left to be decided by the inheriting class, whether it is by treating the <c>key</c> as an image path, or a key associated with a real-path in a hashtable or something else entirely.</summary>
25 sealed public class ITextFactoryConcrete : 
26
27 ITextFactory
28     
29 {
30     ///<summary>Pointer to the native class description.</summary>
31     public System.IntPtr NativeClass
32     {
33         get
34         {
35             if (((object)this).GetType() == typeof(ITextFactoryConcrete))
36             {
37                 return GetEflClassStatic();
38             }
39             else
40             {
41                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
42             }
43         }
44     }
45
46     private  System.IntPtr handle;
47     ///<summary>Pointer to the native instance.</summary>
48     public System.IntPtr NativeHandle
49     {
50         get { return handle; }
51     }
52
53     [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
54         efl_canvas_text_factory_interface_get();
55     /// <summary>Initializes a new instance of the <see cref="ITextFactory"/> class.
56     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
57     private ITextFactoryConcrete(System.IntPtr raw)
58     {
59         handle = raw;
60     }
61     ///<summary>Destructor.</summary>
62     ~ITextFactoryConcrete()
63     {
64         Dispose(false);
65     }
66
67     ///<summary>Releases the underlying native instance.</summary>
68     private void Dispose(bool disposing)
69     {
70         if (handle != System.IntPtr.Zero)
71         {
72             IntPtr h = handle;
73             handle = IntPtr.Zero;
74
75             IntPtr gcHandlePtr = IntPtr.Zero;
76             if (disposing)
77             {
78                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
79             }
80             else
81             {
82                 Monitor.Enter(Efl.All.InitLock);
83                 if (Efl.All.MainLoopInitialized)
84                 {
85                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
86                 }
87
88                 Monitor.Exit(Efl.All.InitLock);
89             }
90         }
91
92     }
93
94     ///<summary>Releases the underlying native instance.</summary>
95     public void Dispose()
96     {
97         Dispose(true);
98         GC.SuppressFinalize(this);
99     }
100
101     /// <summary>Verifies if the given object is equal to this one.</summary>
102     /// <param name="instance">The object to compare to.</param>
103     /// <returns>True if both objects point to the same native object.</returns>
104     public override bool Equals(object instance)
105     {
106         var other = instance as Efl.Object;
107         if (other == null)
108         {
109             return false;
110         }
111         return this.NativeHandle == other.NativeHandle;
112     }
113
114     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
115     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
116     public override int GetHashCode()
117     {
118         return this.NativeHandle.ToInt32();
119     }
120
121     /// <summary>Turns the native pointer into a string representation.</summary>
122     /// <returns>A string with the type and the native pointer for this object.</returns>
123     public override String ToString()
124     {
125         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
126     }
127
128     /// <summary>Translates a given <c>key</c> to an item object, and returns the object. The returned object should be owned by the passed <c>object</c>.</summary>
129     /// <param name="kw_object">The parent of the created object</param>
130     /// <param name="key">Key that is associated to an item object</param>
131     public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
132                                                          var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate(this.NativeHandle,kw_object, key);
133         Eina.Error.RaiseIfUnhandledException();
134                                         return _ret_var;
135  }
136     private static IntPtr GetEflClassStatic()
137     {
138         return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
139     }
140     /// <summary>Wrapper for native methods and virtual method delegates.
141     /// For internal use by generated code only.</summary>
142     public class NativeMethods  : Efl.Eo.NativeClass
143     {
144         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Evas);
145         /// <summary>Gets the list of Eo operations to override.</summary>
146         /// <returns>The list of Eo operations to be overload.</returns>
147         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
148         {
149             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
150             var methods = Efl.Eo.Globals.GetUserMethods(type);
151
152             if (efl_canvas_text_factory_create_static_delegate == null)
153             {
154                 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
155             }
156
157             if (methods.FirstOrDefault(m => m.Name == "Create") != null)
158             {
159                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_text_factory_create"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_text_factory_create_static_delegate) });
160             }
161
162             return descs;
163         }
164         /// <summary>Returns the Eo class for the native methods of this class.</summary>
165         /// <returns>The native class pointer.</returns>
166         public override IntPtr GetEflClass()
167         {
168             return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
169         }
170
171         #pragma warning disable CA1707, SA1300, SA1600
172
173         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
174         private delegate Efl.Canvas.Object efl_canvas_text_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
175
176         [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
177         public delegate Efl.Canvas.Object efl_canvas_text_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.NonOwnTag>))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
178
179         public static Efl.Eo.FunctionWrapper<efl_canvas_text_factory_create_api_delegate> efl_canvas_text_factory_create_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_text_factory_create_api_delegate>(Module, "efl_canvas_text_factory_create");
180
181         private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
182         {
183             Eina.Log.Debug("function efl_canvas_text_factory_create was called");
184             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
185             if (wrapper != null)
186             {
187                                                             Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
188                 try
189                 {
190                     _ret_var = ((ITextFactory)wrapper).Create(kw_object, key);
191                 }
192                 catch (Exception e)
193                 {
194                     Eina.Log.Warning($"Callback error: {e.ToString()}");
195                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
196                 }
197
198                                         return _ret_var;
199
200             }
201             else
202             {
203                 return efl_canvas_text_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), kw_object, key);
204             }
205         }
206
207         private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;
208
209         #pragma warning restore CA1707, SA1300, SA1600
210
211 }
212 }
213 }
214
215 }
216