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 [Efl.Eo.BindingEntity]
16 public interface ITextFactory :
17 Efl.Eo.IWrapper, IDisposable
19 /// <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>
20 /// <param name="kw_object">The parent of the created object</param>
21 /// <param name="key">Key that is associated to an item object</param>
22 Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key);
24 /// <summary>Object factory that creates Efl.Canvas.Object objects.
25 /// 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>
26 sealed public class ITextFactoryConcrete :
31 ///<summary>Pointer to the native class description.</summary>
32 public override System.IntPtr NativeClass
36 if (((object)this).GetType() == typeof(ITextFactoryConcrete))
38 return GetEflClassStatic();
42 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
47 /// <summary>Constructor to be used when objects are expected to be constructed from native code.</summary>
48 /// <param name="ch">Tag struct storing the native handle of the object being constructed.</param>
49 private ITextFactoryConcrete(ConstructingHandle ch) : base(ch)
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 /// <param name="wh">The native pointer to be wrapped.</param>
58 private ITextFactoryConcrete(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
62 /// <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>
63 /// <param name="kw_object">The parent of the created object</param>
64 /// <param name="key">Key that is associated to an item object</param>
65 public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
66 var _ret_var = Efl.Canvas.ITextFactoryConcrete.NativeMethods.efl_canvas_text_factory_create_ptr.Value.Delegate(this.NativeHandle,kw_object, key);
67 Eina.Error.RaiseIfUnhandledException();
70 private static IntPtr GetEflClassStatic()
72 return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
74 /// <summary>Wrapper for native methods and virtual method delegates.
75 /// For internal use by generated code only.</summary>
76 public new class NativeMethods : Efl.Eo.EoWrapper.NativeMethods
78 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Evas);
79 /// <summary>Gets the list of Eo operations to override.</summary>
80 /// <returns>The list of Eo operations to be overload.</returns>
81 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
83 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
84 var methods = Efl.Eo.Globals.GetUserMethods(type);
86 if (efl_canvas_text_factory_create_static_delegate == null)
88 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
91 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
93 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) });
98 /// <summary>Returns the Eo class for the native methods of this class.</summary>
99 /// <returns>The native class pointer.</returns>
100 public override IntPtr GetEflClass()
102 return Efl.Canvas.ITextFactoryConcrete.efl_canvas_text_factory_interface_get();
105 #pragma warning disable CA1707, CS1591, SA1300, SA1600
107 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
108 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);
110 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalEo<Efl.Eo.OwnTag>))]
111 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);
113 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");
115 private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
117 Eina.Log.Debug("function efl_canvas_text_factory_create was called");
118 var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
121 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
124 _ret_var = ((ITextFactory)ws.Target).Create(kw_object, key);
128 Eina.Log.Warning($"Callback error: {e.ToString()}");
129 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
137 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);
141 private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;
143 #pragma warning restore CA1707, CS1591, SA1300, SA1600