1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
12 namespace TextFactory {
14 /// <summary>Factory that creates images given key string
15 /// The key can be either a full image path, or associated with one. The factory will fallback if key was not matches with an image, and try to load it as a full path.</summary>
16 [Efl.Ui.TextFactory.Images.NativeMethods]
17 public class Images : Efl.Object, Efl.Eo.IWrapper,Efl.Canvas.ITextFactory
19 ///<summary>Pointer to the native class description.</summary>
20 public override System.IntPtr NativeClass
24 if (((object)this).GetType() == typeof(Images))
26 return GetEflClassStatic();
30 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
35 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
36 efl_ui_text_factory_images_class_get();
37 /// <summary>Initializes a new instance of the <see cref="Images"/> class.</summary>
38 /// <param name="parent">Parent instance.</param>
39 public Images(Efl.Object parent= null
40 ) : base(efl_ui_text_factory_images_class_get(), typeof(Images), parent)
42 FinishInstantiation();
45 /// <summary>Initializes a new instance of the <see cref="Images"/> class.
46 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
47 /// <param name="raw">The native pointer to be wrapped.</param>
48 protected Images(System.IntPtr raw) : base(raw)
52 /// <summary>Initializes a new instance of the <see cref="Images"/> class.
53 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
54 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
55 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
56 /// <param name="parent">The Efl.Object parent of this instance.</param>
57 protected Images(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
61 /// <summary>Verifies if the given object is equal to this one.</summary>
62 /// <param name="instance">The object to compare to.</param>
63 /// <returns>True if both objects point to the same native object.</returns>
64 public override bool Equals(object instance)
66 var other = instance as Efl.Object;
71 return this.NativeHandle == other.NativeHandle;
74 /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
75 /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
76 public override int GetHashCode()
78 return this.NativeHandle.ToInt32();
81 /// <summary>Turns the native pointer into a string representation.</summary>
82 /// <returns>A string with the type and the native pointer for this object.</returns>
83 public override String ToString()
85 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
88 /// <summary>Associates given name with a path of an image or EET file.
89 /// This can be used for quick retrieval (instead of providing actual filenames.
91 /// This <c>file</c> is associated with <c>name</c> is considered a full file path.
93 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatchesMmap"/> for mmap version see <see cref="Efl.Ui.TextFactory.Images.DelMatches"/></summary>
94 /// <param name="name">the name associated with filename</param>
95 /// <param name="path">the image or EET file path</param>
96 /// <param name="key">the key to use (in cases of loading an EET file</param>
97 /// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
98 virtual public bool AddMatches(System.String name, System.String path, System.String key) {
99 var _ret_var = Efl.Ui.TextFactory.Images.NativeMethods.efl_ui_text_factory_images_matches_add_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),name, path, key);
100 Eina.Error.RaiseIfUnhandledException();
103 /// <summary>Deletes an association of <c>key</c> with its respective file path.
104 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatches"/></summary>
105 /// <param name="key">the entry's key to delete</param>
106 /// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
107 virtual public bool DelMatches(System.String key) {
108 var _ret_var = Efl.Ui.TextFactory.Images.NativeMethods.efl_ui_text_factory_images_matches_del_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),key);
109 Eina.Error.RaiseIfUnhandledException();
112 /// <summary>Associates given name with a mmap'd image or EET file and key.
113 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatches"/> for string file path version see <see cref="Efl.Ui.TextFactory.Images.DelMatchesMmap"/></summary>
114 /// <param name="name">the name associated with filename</param>
115 /// <param name="file">the image or EET file</param>
116 /// <param name="key">the key to use (in cases of loading an EET file</param>
117 /// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
118 virtual public bool AddMatchesMmap(System.String name, Eina.File file, System.String key) {
119 var _ret_var = Efl.Ui.TextFactory.Images.NativeMethods.efl_ui_text_factory_images_matches_mmap_add_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),name, file, key);
120 Eina.Error.RaiseIfUnhandledException();
123 /// <summary>Deletes an association of <c>key</c> with its respective file.
124 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatchesMmap"/></summary>
125 /// <param name="key">the entry's key to delete</param>
126 /// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
127 virtual public bool DelMatchesMmap(System.String key) {
128 var _ret_var = Efl.Ui.TextFactory.Images.NativeMethods.efl_ui_text_factory_images_matches_mmap_del_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),key);
129 Eina.Error.RaiseIfUnhandledException();
132 /// <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>
133 /// <param name="kw_object">The parent of the created object</param>
134 /// <param name="key">Key that is associated to an item object</param>
135 virtual public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
136 var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),kw_object, key);
137 Eina.Error.RaiseIfUnhandledException();
140 private static IntPtr GetEflClassStatic()
142 return Efl.Ui.TextFactory.Images.efl_ui_text_factory_images_class_get();
144 /// <summary>Wrapper for native methods and virtual method delegates.
145 /// For internal use by generated code only.</summary>
146 public new class NativeMethods : Efl.Object.NativeMethods
148 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
149 /// <summary>Gets the list of Eo operations to override.</summary>
150 /// <returns>The list of Eo operations to be overload.</returns>
151 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
153 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
154 var methods = Efl.Eo.Globals.GetUserMethods(type);
156 if (efl_ui_text_factory_images_matches_add_static_delegate == null)
158 efl_ui_text_factory_images_matches_add_static_delegate = new efl_ui_text_factory_images_matches_add_delegate(matches_add);
161 if (methods.FirstOrDefault(m => m.Name == "AddMatches") != null)
163 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_text_factory_images_matches_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_add_static_delegate) });
166 if (efl_ui_text_factory_images_matches_del_static_delegate == null)
168 efl_ui_text_factory_images_matches_del_static_delegate = new efl_ui_text_factory_images_matches_del_delegate(matches_del);
171 if (methods.FirstOrDefault(m => m.Name == "DelMatches") != null)
173 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_text_factory_images_matches_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_del_static_delegate) });
176 if (efl_ui_text_factory_images_matches_mmap_add_static_delegate == null)
178 efl_ui_text_factory_images_matches_mmap_add_static_delegate = new efl_ui_text_factory_images_matches_mmap_add_delegate(matches_mmap_add);
181 if (methods.FirstOrDefault(m => m.Name == "AddMatchesMmap") != null)
183 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_text_factory_images_matches_mmap_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_mmap_add_static_delegate) });
186 if (efl_ui_text_factory_images_matches_mmap_del_static_delegate == null)
188 efl_ui_text_factory_images_matches_mmap_del_static_delegate = new efl_ui_text_factory_images_matches_mmap_del_delegate(matches_mmap_del);
191 if (methods.FirstOrDefault(m => m.Name == "DelMatchesMmap") != null)
193 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_ui_text_factory_images_matches_mmap_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_mmap_del_static_delegate) });
196 if (efl_canvas_text_factory_create_static_delegate == null)
198 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
201 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
203 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) });
206 descs.AddRange(base.GetEoOps(type));
209 /// <summary>Returns the Eo class for the native methods of this class.</summary>
210 /// <returns>The native class pointer.</returns>
211 public override IntPtr GetEflClass()
213 return Efl.Ui.TextFactory.Images.efl_ui_text_factory_images_class_get();
216 #pragma warning disable CA1707, SA1300, SA1600
218 [return: MarshalAs(UnmanagedType.U1)]
219 private delegate bool efl_ui_text_factory_images_matches_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String path, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
221 [return: MarshalAs(UnmanagedType.U1)]
222 public delegate bool efl_ui_text_factory_images_matches_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String path, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
224 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_add_api_delegate> efl_ui_text_factory_images_matches_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_add_api_delegate>(Module, "efl_ui_text_factory_images_matches_add");
226 private static bool matches_add(System.IntPtr obj, System.IntPtr pd, System.String name, System.String path, System.String key)
228 Eina.Log.Debug("function efl_ui_text_factory_images_matches_add was called");
229 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
232 bool _ret_var = default(bool);
235 _ret_var = ((Images)wrapper).AddMatches(name, path, key);
239 Eina.Log.Warning($"Callback error: {e.ToString()}");
240 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
248 return efl_ui_text_factory_images_matches_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, path, key);
252 private static efl_ui_text_factory_images_matches_add_delegate efl_ui_text_factory_images_matches_add_static_delegate;
254 [return: MarshalAs(UnmanagedType.U1)]
255 private delegate bool efl_ui_text_factory_images_matches_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
257 [return: MarshalAs(UnmanagedType.U1)]
258 public delegate bool efl_ui_text_factory_images_matches_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
260 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_del_api_delegate> efl_ui_text_factory_images_matches_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_del_api_delegate>(Module, "efl_ui_text_factory_images_matches_del");
262 private static bool matches_del(System.IntPtr obj, System.IntPtr pd, System.String key)
264 Eina.Log.Debug("function efl_ui_text_factory_images_matches_del was called");
265 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
268 bool _ret_var = default(bool);
271 _ret_var = ((Images)wrapper).DelMatches(key);
275 Eina.Log.Warning($"Callback error: {e.ToString()}");
276 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
284 return efl_ui_text_factory_images_matches_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key);
288 private static efl_ui_text_factory_images_matches_del_delegate efl_ui_text_factory_images_matches_del_static_delegate;
290 [return: MarshalAs(UnmanagedType.U1)]
291 private delegate bool efl_ui_text_factory_images_matches_mmap_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, Eina.File file, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
293 [return: MarshalAs(UnmanagedType.U1)]
294 public delegate bool efl_ui_text_factory_images_matches_mmap_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, Eina.File file, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
296 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_add_api_delegate> efl_ui_text_factory_images_matches_mmap_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_add_api_delegate>(Module, "efl_ui_text_factory_images_matches_mmap_add");
298 private static bool matches_mmap_add(System.IntPtr obj, System.IntPtr pd, System.String name, Eina.File file, System.String key)
300 Eina.Log.Debug("function efl_ui_text_factory_images_matches_mmap_add was called");
301 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
304 bool _ret_var = default(bool);
307 _ret_var = ((Images)wrapper).AddMatchesMmap(name, file, key);
311 Eina.Log.Warning($"Callback error: {e.ToString()}");
312 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
320 return efl_ui_text_factory_images_matches_mmap_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, file, key);
324 private static efl_ui_text_factory_images_matches_mmap_add_delegate efl_ui_text_factory_images_matches_mmap_add_static_delegate;
326 [return: MarshalAs(UnmanagedType.U1)]
327 private delegate bool efl_ui_text_factory_images_matches_mmap_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
329 [return: MarshalAs(UnmanagedType.U1)]
330 public delegate bool efl_ui_text_factory_images_matches_mmap_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
332 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_del_api_delegate> efl_ui_text_factory_images_matches_mmap_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_del_api_delegate>(Module, "efl_ui_text_factory_images_matches_mmap_del");
334 private static bool matches_mmap_del(System.IntPtr obj, System.IntPtr pd, System.String key)
336 Eina.Log.Debug("function efl_ui_text_factory_images_matches_mmap_del was called");
337 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
340 bool _ret_var = default(bool);
343 _ret_var = ((Images)wrapper).DelMatchesMmap(key);
347 Eina.Log.Warning($"Callback error: {e.ToString()}");
348 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
356 return efl_ui_text_factory_images_matches_mmap_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key);
360 private static efl_ui_text_factory_images_matches_mmap_del_delegate efl_ui_text_factory_images_matches_mmap_del_static_delegate;
362 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
363 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);
365 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
366 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);
368 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");
370 private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
372 Eina.Log.Debug("function efl_canvas_text_factory_create was called");
373 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
376 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
379 _ret_var = ((Images)wrapper).Create(kw_object, key);
383 Eina.Log.Warning($"Callback error: {e.ToString()}");
384 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
392 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);
396 private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;
398 #pragma warning restore CA1707, SA1300, SA1600