2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
13 /// <summary>Object factory that creates Efl.Canvas.Object objects.
14 /// 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>
15 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
16 [Efl.Canvas.ITextFactoryConcrete.NativeMethods]
17 [Efl.Eo.BindingEntity]
18 public interface ITextFactory :
19 Efl.Eo.IWrapper, IDisposable
21 /// <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>
22 /// <param name="kw_object">The parent of the created object</param>
23 /// <param name="key">Key that is associated to an item object</param>
24 Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key);
26 /// <summary>Object factory that creates Efl.Canvas.Object objects.
27 /// 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>
28 /// <remarks>This is a <b>BETA</b> class. It can be modified or removed in the future. Do not use it for product development.</remarks>
29 sealed public class ITextFactoryConcrete :
34 /// <summary>Pointer to the native class description.</summary>
35 public override System.IntPtr NativeClass
39 if (((object)this).GetType() == typeof(ITextFactoryConcrete))
41 return GetEflClassStatic();
45 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
50 /// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.
51 /// Do not call this constructor directly.</summary>
52 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
53 private ITextFactoryConcrete(ConstructingHandle ch) : base(ch)
57 [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
58 efl_canvas_text_factory_interface_get();
59 /// <summary>Initializes a new instance of the <see cref="ITextFactory"/> class.
60 /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
61 /// <param name="wh">The native pointer to be wrapped.</param>
62 private ITextFactoryConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
66 /// <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>
67 /// <param name="kw_object">The parent of the created object</param>
68 /// <param name="key">Key that is associated to an item object</param>
69 public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
70 var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate(this.NativeHandle,kw_object, key);
71 Eina.Error.RaiseIfUnhandledException();
74 private static IntPtr GetEflClassStatic()
76 return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
78 /// <summary>Wrapper for native methods and virtual method delegates.
79 /// For internal use by generated code only.</summary>
80 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
82 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
83 /// <summary>Gets the list of Eo operations to override.</summary>
84 /// <returns>The list of Eo operations to be overload.</returns>
85 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
87 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
88 var methods = Efl.Eo.Globals.GetUserMethods(type);
90 if (efl_canvas_text_factory_create_static_delegate == null)
92 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
95 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
97 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) });
102 /// <summary>Returns the Eo class for the native methods of this class.</summary>
103 /// <returns>The native class pointer.</returns>
104 public override IntPtr GetEflClass()
106 return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
109 #pragma warning disable CA1707, CS1591, SA1300, SA1600
111 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
112 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);
114 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
115 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);
117 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");
119 private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
121 Eina.Log.Debug("function efl_canvas_text_factory_create was called");
122 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
125 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
128 _ret_var = ((ITextFactory)ws.Target).Create(kw_object, key);
132 Eina.Log.Warning($"Callback error: {e.ToString()}");
133 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
141 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);
145 private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;
147 #pragma warning restore CA1707, CS1591, SA1300, SA1600
156 #pragma warning disable CS1591
157 public static class Efl_CanvasITextFactoryConcrete_ExtensionMethods {
159 #pragma warning restore CS1591