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>Internal factory for fallback cases.
15 /// This wraps some internal functionality: - Contains 2 factories: image and emoticon - Strips off "file://" prefix for image items, to be used with the image factory.</summary>
16 [Efl.Ui.TextFactory.Fallback.NativeMethods]
17 public class Fallback : Efl.Object, Efl.Canvas.ITextFactory
19 ///<summary>Pointer to the native class description.</summary>
20 public override System.IntPtr NativeClass
24 if (((object)this).GetType() == typeof(Fallback))
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_fallback_class_get();
37 /// <summary>Initializes a new instance of the <see cref="Fallback"/> class.</summary>
38 /// <param name="parent">Parent instance.</param>
39 public Fallback(Efl.Object parent= null
40 ) : base(efl_ui_text_factory_fallback_class_get(), typeof(Fallback), parent)
42 FinishInstantiation();
45 /// <summary>Initializes a new instance of the <see cref="Fallback"/> 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 Fallback(System.IntPtr raw) : base(raw)
52 /// <summary>Initializes a new instance of the <see cref="Fallback"/> 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 Fallback(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
61 /// <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>
62 /// <param name="kw_object">The parent of the created object</param>
63 /// <param name="key">Key that is associated to an item object</param>
64 virtual public Efl.Canvas.Object Create(Efl.Canvas.Object kw_object, System.String key) {
65 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);
66 Eina.Error.RaiseIfUnhandledException();
69 private static IntPtr GetEflClassStatic()
71 return Efl.Ui.TextFactory.Fallback.efl_ui_text_factory_fallback_class_get();
73 /// <summary>Wrapper for native methods and virtual method delegates.
74 /// For internal use by generated code only.</summary>
75 public new class NativeMethods : Efl.Object.NativeMethods
77 private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Elementary);
78 /// <summary>Gets the list of Eo operations to override.</summary>
79 /// <returns>The list of Eo operations to be overload.</returns>
80 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
82 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
83 var methods = Efl.Eo.Globals.GetUserMethods(type);
85 if (efl_canvas_text_factory_create_static_delegate == null)
87 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
90 if (methods.FirstOrDefault(m => m.Name == "Create") != null)
92 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) });
95 descs.AddRange(base.GetEoOps(type));
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.Ui.TextFactory.Fallback.efl_ui_text_factory_fallback_class_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 = ((Fallback)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