2 #pragma warning disable CS1591
4 using System.Runtime.InteropServices;
5 using System.Collections.Generic;
7 using System.Threading;
8 using System.ComponentModel;
11 /// <summary>Event argument wrapper for event <see cref="Efl.LoopMessage.MessageEvt"/>.</summary>
12 [Efl.Eo.BindingEntity]
13 public class LoopMessageMessageEvt_Args : EventArgs {
14 /// <summary>Actual event payload.</summary>
15 /// <value>The message payload data</value>
16 public Efl.LoopMessage arg { get; set; }
18 /// <summary>Base message payload object class. Inherit this and extend for specific message types.</summary>
19 /// <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>
20 [Efl.LoopMessage.NativeMethods]
21 [Efl.Eo.BindingEntity]
22 public class LoopMessage : Efl.Object
24 /// <summary>Pointer to the native class description.</summary>
25 public override System.IntPtr NativeClass
29 if (((object)this).GetType() == typeof(LoopMessage))
31 return GetEflClassStatic();
35 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
40 [System.Runtime.InteropServices.DllImport(efl.Libs.Ecore)] internal static extern System.IntPtr
41 efl_loop_message_class_get();
42 /// <summary>Initializes a new instance of the <see cref="LoopMessage"/> class.</summary>
43 /// <param name="parent">Parent instance.</param>
44 public LoopMessage(Efl.Object parent= null
45 ) : base(efl_loop_message_class_get(), parent)
47 FinishInstantiation();
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 protected LoopMessage(ConstructingHandle ch) : base(ch)
57 /// <summary>Initializes a new instance of the <see cref="LoopMessage"/> class.
58 /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
59 /// <param name="wh">The native pointer to be wrapped.</param>
60 protected LoopMessage(Efl.Eo.Globals.WrappingHandle wh) : base(wh)
64 /// <summary>Initializes a new instance of the <see cref="LoopMessage"/> class.
65 /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
66 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
67 /// <param name="parent">The Efl.Object parent of this instance.</param>
68 protected LoopMessage(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)
72 /// <summary>The message payload data</summary>
73 /// <value><see cref="Efl.LoopMessageMessageEvt_Args"/></value>
74 public event EventHandler<Efl.LoopMessageMessageEvt_Args> MessageEvt
78 lock (eflBindingEventLock)
80 Efl.EventCb callerCb = (IntPtr data, ref Efl.Event.NativeStruct evt) =>
82 var obj = Efl.Eo.Globals.WrapperSupervisorPtrToManaged(data).Target;
85 Efl.LoopMessageMessageEvt_Args args = new Efl.LoopMessageMessageEvt_Args();
86 args.arg = (Efl.Eo.Globals.CreateWrapperFor(evt.Info) as Efl.LoopMessage);
89 value?.Invoke(obj, args);
93 Eina.Log.Error(e.ToString());
94 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
99 string key = "_EFL_LOOP_MESSAGE_EVENT_MESSAGE";
100 AddNativeEventHandler(efl.Libs.Ecore, key, callerCb, value);
106 lock (eflBindingEventLock)
108 string key = "_EFL_LOOP_MESSAGE_EVENT_MESSAGE";
109 RemoveNativeEventHandler(efl.Libs.Ecore, key, value);
113 /// <summary>Method to raise event MessageEvt.</summary>
114 public void OnMessageEvt(Efl.LoopMessageMessageEvt_Args e)
116 var key = "_EFL_LOOP_MESSAGE_EVENT_MESSAGE";
117 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Ecore, key);
118 if (desc == IntPtr.Zero)
120 Eina.Log.Error($"Failed to get native event {key}");
124 IntPtr info = e.arg.NativeHandle;
125 Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
127 private static IntPtr GetEflClassStatic()
129 return Efl.LoopMessage.efl_loop_message_class_get();
131 /// <summary>Wrapper for native methods and virtual method delegates.
132 /// For internal use by generated code only.</summary>
133 public new class NativeMethods : Efl.Object.NativeMethods
135 /// <summary>Gets the list of Eo operations to override.</summary>
136 /// <returns>The list of Eo operations to be overload.</returns>
137 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
139 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
140 descs.AddRange(base.GetEoOps(type));
143 /// <summary>Returns the Eo class for the native methods of this class.</summary>
144 /// <returns>The native class pointer.</returns>
145 public override IntPtr GetEflClass()
147 return Efl.LoopMessage.efl_loop_message_class_get();
150 #pragma warning disable CA1707, CS1591, SA1300, SA1600
152 #pragma warning restore CA1707, CS1591, SA1300, SA1600
159 #pragma warning disable CS1591
160 public static class EflLoopMessage_ExtensionMethods {
162 #pragma warning restore CS1591