summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/mono/eo_mono')
-rw-r--r--src/bindings/mono/eo_mono/workaround.cs82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs
index 9f22b90..49a6e1e 100644
--- a/src/bindings/mono/eo_mono/workaround.cs
+++ b/src/bindings/mono/eo_mono/workaround.cs
@@ -108,6 +108,88 @@ public struct EventDescription
108 } 108 }
109}; 109};
110 110
111/// <summary>
112/// A parameter passed in event callbacks holding extra event parameters.
113/// This is the full event information passed to callbacks in C.
114/// (Since EFL 1.22)
115/// </summary>
116[StructLayout(LayoutKind.Sequential)]
117[Efl.Eo.BindingEntity]
118public struct Event
119{
120 /// <summary>The object the callback was called on.
121 /// (Since EFL 1.22)</summary>
122 public Efl.Object Object;
123
124 /// <summary>The event description.
125 /// (Since EFL 1.22)</summary>
126 public Efl.EventDescription Desc;
127
128 /// <summary>Extra event information passed by the event caller.
129 /// Must be cast to the event type declared in the EO file. Keep in mind that:
130 /// 1) Objects are passed as a normal Eo*. Event subscribers can call functions on these objects.
131 /// 2) Structs, built-in types and containers are passed as const pointers, with one level of indirection.
132 /// (Since EFL 1.22)</summary>
133 public System.IntPtr Info;
134
135 /// <summary>Constructor for Event.</summary>
136 public Event(
137 Efl.Object obj = default(Efl.Object),
138 Efl.EventDescription desc = default(Efl.EventDescription),
139 System.IntPtr info = default(System.IntPtr))
140 {
141 this.Object = obj;
142 this.Desc = desc;
143 this.Info = info;
144 }
145
146 /// <summary>Implicit conversion to the managed representation from a native pointer.</summary>
147 /// <param name="ptr">Native pointer to be converted.</param>
148 public static implicit operator Event(IntPtr ptr)
149 {
150 var tmp = (Event.NativeStruct) Marshal.PtrToStructure(ptr, typeof(Event.NativeStruct));
151 return tmp;
152 }
153
154 /// <summary>Internal wrapper for struct Event.</summary>
155 [StructLayout(LayoutKind.Sequential)]
156 public struct NativeStruct
157 {
158 /// <summary>Internal wrapper for field Object</summary>
159 public System.IntPtr Object;
160
161 /// <summary>Internal wrapper for field Desc</summary>
162 public System.IntPtr Desc;
163
164 /// <summary>Internal wrapper for field Info</summary>
165 public System.IntPtr Info;
166
167 /// <summary>Implicit conversion to the internal/marshalling representation.</summary>
168 /// <param name="externalStruct">Managed struct to be converted.</param>
169 /// <returns>Native representation of the managed struct.</returns>
170 public static implicit operator Event.NativeStruct(Event externalStruct)
171 {
172 var internalStruct = new Event.NativeStruct();
173 internalStruct.Object = externalStruct.Object?.NativeHandle ?? System.IntPtr.Zero;
174 internalStruct.Desc = Eina.PrimitiveConversion.ManagedToPointerAlloc(externalStruct.Desc);
175 internalStruct.Info = externalStruct.Info;
176 return internalStruct;
177 }
178
179 /// <summary>Implicit conversion to the managed representation.</summary>
180 /// <param name="internalStruct">Native struct to be converted.</param>
181 /// <returns>Managed representation of the native struct.</returns>
182 public static implicit operator Event(Event.NativeStruct internalStruct)
183 {
184 var externalStruct = new Event();
185 externalStruct.Object = (Efl.Object) Efl.Eo.Globals.CreateWrapperFor(internalStruct.Object);
186 externalStruct.Desc = Eina.PrimitiveConversion.PointerToManaged<Efl.EventDescription>(internalStruct.Desc);
187 externalStruct.Info = internalStruct.Info;
188 return externalStruct;
189 }
190 }
191}
192
111public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt); 193public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt);
112public delegate void FreeWrapperSupervisorCb(System.IntPtr obj); 194public delegate void FreeWrapperSupervisorCb(System.IntPtr obj);
113 195