1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
8 /// <summary>Markup data that populates the text object's style and format</summary>
9 [ITextMarkupNativeInherit]
10 public interface ITextMarkup :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Markup property</summary>
14 /// <returns>The markup-text representation set to this text.</returns>
15 System.String GetMarkup();
16 /// <summary>Markup property</summary>
17 /// <param name="markup">The markup-text representation set to this text.</param>
18 /// <returns></returns>
19 void SetMarkup( System.String markup);
20 /// <summary>Markup property</summary>
21 /// <value>The markup-text representation set to this text.</value>
22 System.String Markup {
27 /// <summary>Markup data that populates the text object's style and format</summary>
28 sealed public class ITextMarkupConcrete :
33 ///<summary>Pointer to the native class description.</summary>
34 public System.IntPtr NativeClass {
36 if (((object)this).GetType() == typeof (ITextMarkupConcrete))
37 return Efl.ITextMarkupNativeInherit.GetEflClassStatic();
39 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
42 private System.IntPtr handle;
43 ///<summary>Pointer to the native instance.</summary>
44 public System.IntPtr NativeHandle {
45 get { return handle; }
47 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
48 efl_text_markup_interface_get();
49 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
50 private ITextMarkupConcrete(System.IntPtr raw)
53 RegisterEventProxies();
55 ///<summary>Destructor.</summary>
56 ~ITextMarkupConcrete()
60 ///<summary>Releases the underlying native instance.</summary>
61 void Dispose(bool disposing)
63 if (handle != System.IntPtr.Zero) {
64 Efl.Eo.Globals.efl_unref(handle);
65 handle = System.IntPtr.Zero;
68 ///<summary>Releases the underlying native instance.</summary>
72 GC.SuppressFinalize(this);
74 ///<summary>Verifies if the given object is equal to this one.</summary>
75 public override bool Equals(object obj)
77 var other = obj as Efl.Object;
80 return this.NativeHandle == other.NativeHandle;
82 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
83 public override int GetHashCode()
85 return this.NativeHandle.ToInt32();
87 ///<summary>Turns the native pointer into a string representation.</summary>
88 public override String ToString()
90 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
92 ///<summary>Register the Eo event wrappers making the bridge to C# events. Internal usage only.</summary>
93 void RegisterEventProxies()
96 /// <summary>Markup property</summary>
97 /// <returns>The markup-text representation set to this text.</returns>
98 public System.String GetMarkup() {
99 var _ret_var = Efl.ITextMarkupNativeInherit.efl_text_markup_get_ptr.Value.Delegate(this.NativeHandle);
100 Eina.Error.RaiseIfUnhandledException();
103 /// <summary>Markup property</summary>
104 /// <param name="markup">The markup-text representation set to this text.</param>
105 /// <returns></returns>
106 public void SetMarkup( System.String markup) {
107 Efl.ITextMarkupNativeInherit.efl_text_markup_set_ptr.Value.Delegate(this.NativeHandle, markup);
108 Eina.Error.RaiseIfUnhandledException();
110 /// <summary>Markup property</summary>
111 /// <value>The markup-text representation set to this text.</value>
112 public System.String Markup {
113 get { return GetMarkup(); }
114 set { SetMarkup( value); }
116 private static IntPtr GetEflClassStatic()
118 return Efl.ITextMarkupConcrete.efl_text_markup_interface_get();
121 public class ITextMarkupNativeInherit : Efl.Eo.NativeClass{
122 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
123 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
125 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
126 var methods = Efl.Eo.Globals.GetUserMethods(type);
127 if (efl_text_markup_get_static_delegate == null)
128 efl_text_markup_get_static_delegate = new efl_text_markup_get_delegate(markup_get);
129 if (methods.FirstOrDefault(m => m.Name == "GetMarkup") != null)
130 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_text_markup_get"), func = Marshal.GetFunctionPointerForDelegate(efl_text_markup_get_static_delegate)});
131 if (efl_text_markup_set_static_delegate == null)
132 efl_text_markup_set_static_delegate = new efl_text_markup_set_delegate(markup_set);
133 if (methods.FirstOrDefault(m => m.Name == "SetMarkup") != null)
134 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_text_markup_set"), func = Marshal.GetFunctionPointerForDelegate(efl_text_markup_set_static_delegate)});
137 public override IntPtr GetEflClass()
139 return Efl.ITextMarkupConcrete.efl_text_markup_interface_get();
141 public static IntPtr GetEflClassStatic()
143 return Efl.ITextMarkupConcrete.efl_text_markup_interface_get();
147 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] private delegate System.String efl_text_markup_get_delegate(System.IntPtr obj, System.IntPtr pd);
150 [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] public delegate System.String efl_text_markup_get_api_delegate(System.IntPtr obj);
151 public static Efl.Eo.FunctionWrapper<efl_text_markup_get_api_delegate> efl_text_markup_get_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_get_api_delegate>(_Module, "efl_text_markup_get");
152 private static System.String markup_get(System.IntPtr obj, System.IntPtr pd)
154 Eina.Log.Debug("function efl_text_markup_get was called");
155 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
156 if(wrapper != null) {
157 System.String _ret_var = default(System.String);
159 _ret_var = ((ITextMarkup)wrapper).GetMarkup();
160 } catch (Exception e) {
161 Eina.Log.Warning($"Callback error: {e.ToString()}");
162 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
166 return efl_text_markup_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
169 private static efl_text_markup_get_delegate efl_text_markup_get_static_delegate;
172 private delegate void efl_text_markup_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
175 public delegate void efl_text_markup_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String markup);
176 public static Efl.Eo.FunctionWrapper<efl_text_markup_set_api_delegate> efl_text_markup_set_ptr = new Efl.Eo.FunctionWrapper<efl_text_markup_set_api_delegate>(_Module, "efl_text_markup_set");
177 private static void markup_set(System.IntPtr obj, System.IntPtr pd, System.String markup)
179 Eina.Log.Debug("function efl_text_markup_set was called");
180 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
181 if(wrapper != null) {
184 ((ITextMarkup)wrapper).SetMarkup( markup);
185 } catch (Exception e) {
186 Eina.Log.Warning($"Callback error: {e.ToString()}");
187 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
190 efl_text_markup_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), markup);
193 private static efl_text_markup_set_delegate efl_text_markup_set_static_delegate;