1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.Threading;
7 using System.ComponentModel;
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
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);
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 :
30 ///<summary>Pointer to the native class description.</summary>
31 public override System.IntPtr NativeClass
35 if (((object)this).GetType() == typeof(ITextFactoryConcrete))
37 return GetEflClassStatic();
41 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
46 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
47 efl_canvas_text_factory_interface_get();
48 /// <summary>Initializes a new instance of the <see cref="ITextFactory"/> class.
49 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
50 private ITextFactoryConcrete(System.IntPtr raw) : base(raw)
54 /// <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>
55 /// <param name="kw_object">The parent of the created object</param>
56 /// <param name="key">Key that is associated to an item object</param>
57 public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
58 var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate(this.NativeHandle,kw_object, key);
59 Eina.Error.RaiseIfUnhandledException();
62 private static IntPtr GetEflClassStatic()
64 return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
66 /// <summary>Wrapper for native methods and virtual method delegates.
67 /// For internal use by generated code only.</summary>
68 public class NativeMethods : Efl.Eo.NativeClass
70 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
71 /// <summary>Gets the list of Eo operations to override.</summary>
72 /// <returns>The list of Eo operations to be overload.</returns>
73 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
75 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
76 var methods = Efl.Eo.Globals.GetUserMethods(type);
78 if (efl_canvas_text_factory_create_static_delegate == null)
80 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
83 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
85 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) });
90 /// <summary>Returns the Eo class for the native methods of this class.</summary>
91 /// <returns>The native class pointer.</returns>
92 public override IntPtr GetEflClass()
94 return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
97 #pragma warning disable CA1707, CS1591, SA1300, SA1600
99 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
100 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);
102 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
103 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);
105 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");
107 private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
109 Eina.Log.Debug("function efl_canvas_text_factory_create was called");
110 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
113 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
116 _ret_var = ((ITextFactory)ws.Target).Create(kw_object, key);
120 Eina.Log.Warning($"Callback error: {e.ToString()}");
121 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
129 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);
133 private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;
135 #pragma warning restore CA1707, CS1591, SA1300, SA1600