summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono/workaround.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/mono/eo_mono/workaround.cs')
-rw-r--r--src/bindings/mono/eo_mono/workaround.cs262
1 files changed, 237 insertions, 25 deletions
diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs
index 30759d1..de8ab97 100644
--- a/src/bindings/mono/eo_mono/workaround.cs
+++ b/src/bindings/mono/eo_mono/workaround.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#pragma warning disable 1591 16#pragma warning disable 1591
2 17
3using System; 18using System;
@@ -6,42 +21,91 @@ using System.Collections.Generic;
6 21
7///<summary>Eo class description, passed to efl_class_new.</summary> 22///<summary>Eo class description, passed to efl_class_new.</summary>
8[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] 23[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
9public struct ClassDescription 24internal struct ClassDescription : IEquatable<ClassDescription>
10{ 25{
11 ///<summary>Current Eo version.</summary> 26 ///<summary>Current Eo version.</summary>
12 public uint version; 27 internal uint version;
13 ///<summary>Name of the class.</summary> 28 ///<summary>Name of the class.</summary>
14 [MarshalAs(UnmanagedType.LPStr)] public String name; 29 [MarshalAs(UnmanagedType.LPStr)] internal String name;
15 ///<summary>Class type.</summary> 30 ///<summary>Class type.</summary>
16 public int class_type; 31 internal int class_type;
17 ///<summary>Size of data (private + protected + public) per instance.</summary> 32 ///<summary>Size of data (private + protected + public) per instance.</summary>
18 public UIntPtr data_size; 33 internal UIntPtr data_size;
19 ///<summary>Initializer for the class.</summary> 34 ///<summary>Initializer for the class.</summary>
20 public IntPtr class_initializer; 35 internal IntPtr class_initializer;
21 ///<summary>Constructor of the class.</summary> 36 ///<summary>Constructor of the class.</summary>
22 public IntPtr class_constructor; 37 internal IntPtr class_constructor;
23 ///<summary>Destructor of the class.</summary> 38 ///<summary>Destructor of the class.</summary>
24 public IntPtr class_destructor; 39 internal IntPtr class_destructor;
40
41 /// <summary>
42 /// Gets a hash for <see cref="ClassDescription" />.
43 /// <para>Since EFL 1.24.</para>
44 /// </summary>
45 /// <returns>A hash code.</returns>
46 public override int GetHashCode()
47 => version.GetHashCode() ^ name.GetHashCode(StringComparison.Ordinal)
48 ^ class_type ^ data_size.GetHashCode();
49
50 /// <summary>Returns whether this <see cref="ClassDescription" />
51 /// is equal to the given <see cref="object" />.
52 /// <para>Since EFL 1.24.</para>
53 /// </summary>
54 /// <param name="other">The <see cref="object" /> to be compared to.</param>
55 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
56 public override bool Equals(object other)
57 => (!(other is ClassDescription)) ? false
58 : Equals((ClassDescription)other);
59
60
61 /// <summary>Returns whether this <see cref="ClassDescription" /> is equal
62 /// to the given <see cref="ClassDescription" />.
63 /// <para>Since EFL 1.24.</para>
64 /// </summary>
65 /// <param name="other">The <see cref="ClassDescription" /> to be compared to.</param>
66 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
67 public bool Equals(ClassDescription other)
68 => (name == other.name) && (class_type == other.class_type);
69
70 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
71 /// <para>Since EFL 1.24.</para>
72 /// </summary>
73 /// <param name="lhs">The left hand side of the operator.</param>
74 /// <param name="rhs">The right hand side of the operator.</param>
75 /// <returns><c>true</c> if <c>lhs</c> is equal
76 /// to <c>rhs</c>.</returns>
77 public static bool operator==(ClassDescription lhs, ClassDescription rhs)
78 => lhs.Equals(rhs);
79
80 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
81 /// <para>Since EFL 1.24.</para>
82 /// </summary>
83 /// <param name="lhs">The left hand side of the operator.</param>
84 /// <param name="rhs">The right hand side of the operator.</param>
85 /// <returns><c>true</c> if <c>lhs</c> is not equal
86 /// to <c>rhs</c>.</returns>
87 public static bool operator!=(ClassDescription lhs, ClassDescription rhs)
88 => !(lhs == rhs);
25} 89}
26 90
27///<summary>Description of an Eo API operation.</summary> 91///<summary>Description of an Eo API operation.</summary>
28[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] 92[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
29public struct EflOpDescription 93internal struct EflOpDescription
30{ 94{
31 ///<summary>The EAPI function offering this op. (String with the name of the function on Windows)</summary> 95 ///<summary>The EAPI function offering this op. (String with the name of the function on Windows)</summary>
32 public IntPtr api_func; 96 internal IntPtr api_func;
33 ///<summary>The static function to be called for this op</summary> 97 ///<summary>The static function to be called for this op</summary>
34 public IntPtr func; 98 internal IntPtr func;
35} 99}
36 100
37///<summary>List of operations on a given Object.</summary> 101///<summary>List of operations on a given Object.</summary>
38[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] 102[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
39public struct EflObjectOps 103internal struct EflObjectOps
40{ 104{
41 ///<summary>The op descriptions array of size count.</summary> 105 ///<summary>The op descriptions array of size count.</summary>
42 public IntPtr descs; 106 internal IntPtr descs;
43 ///<summary>Number of op descriptions.</summary> 107 ///<summary>Number of op descriptions.</summary>
44 public UIntPtr count; 108 internal UIntPtr count;
45}; 109};
46 110
47namespace Efl 111namespace Efl
@@ -49,7 +113,7 @@ namespace Efl
49 113
50///<summary>This struct holds the description of a specific event (Since EFL 1.22).</summary> 114///<summary>This struct holds the description of a specific event (Since EFL 1.22).</summary>
51[StructLayout(LayoutKind.Sequential)] 115[StructLayout(LayoutKind.Sequential)]
52public struct EventDescription 116internal struct EventDescription
53{ 117{
54 ///<summary>Name of the event.</summary> 118 ///<summary>Name of the event.</summary>
55 public IntPtr Name; 119 public IntPtr Name;
@@ -104,7 +168,7 @@ public struct EventDescription
104/// </summary> 168/// </summary>
105[StructLayout(LayoutKind.Sequential)] 169[StructLayout(LayoutKind.Sequential)]
106[Efl.Eo.BindingEntity] 170[Efl.Eo.BindingEntity]
107public struct Event 171internal struct Event
108{ 172{
109 /// <summary>The object the callback was called on. 173 /// <summary>The object the callback was called on.
110 /// (Since EFL 1.22)</summary> 174 /// (Since EFL 1.22)</summary>
@@ -179,43 +243,191 @@ public struct Event
179 } 243 }
180} 244}
181 245
182public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt); 246internal delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt);
183public delegate void FreeWrapperSupervisorCb(System.IntPtr obj); 247internal delegate void FreeWrapperSupervisorCb(System.IntPtr obj);
184 248
185[StructLayout(LayoutKind.Sequential)] 249[StructLayout(LayoutKind.Sequential)]
186public struct TextCursorCursor 250public struct TextCursorCursor : IEquatable<TextCursorCursor>
187{ 251{
188 IntPtr obj; 252 IntPtr obj;
189 UIntPtr pos; // UIntPtr to automatically change size_t between 32/64 253 UIntPtr pos; // UIntPtr to automatically change size_t between 32/64
190 IntPtr node; 254 IntPtr node;
191 [MarshalAsAttribute(UnmanagedType.U1)]bool changed; 255 [MarshalAsAttribute(UnmanagedType.U1)]bool changed;
256
257 /// <summary>
258 /// Gets a hash for <see cref="TextCursorCursor" />.
259 /// <para>Since EFL 1.24.</para>
260 /// </summary>
261 /// <returns>A hash code.</returns>
262 public override int GetHashCode()
263 => obj.GetHashCode() ^ pos.GetHashCode()
264 ^ node.GetHashCode() ^ changed.GetHashCode();
265
266 /// <summary>Returns whether this <see cref="TextCursorCursor" />
267 /// is equal to the given <see cref="object" />.
268 /// <para>Since EFL 1.24.</para>
269 /// </summary>
270 /// <param name="other">The <see cref="object" /> to be compared to.</param>
271 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
272 public override bool Equals(object other)
273 => (!(other is TextCursorCursor)) ? false
274 : Equals((TextAnnotateAnnotation)other);
275
276
277 /// <summary>Returns whether this <see cref="TextCursorCursor" /> is equal
278 /// to the given <see cref="TextCursorCursor" />.
279 /// <para>Since EFL 1.24.</para>
280 /// </summary>
281 /// <param name="other">The <see cref="TextCursorCursor" /> to be compared to.</param>
282 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
283 public bool Equals(TextCursorCursor other)
284 => (obj == other.obj) && (pos == other.pos)
285 && (node == other.node) && (changed == other.changed);
286
287 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
288 /// <para>Since EFL 1.24.</para>
289 /// </summary>
290 /// <param name="lhs">The left hand side of the operator.</param>
291 /// <param name="rhs">The right hand side of the operator.</param>
292 /// <returns><c>true</c> if <c>lhs</c> is equal
293 /// to <c>rhs</c>.</returns>
294 public static bool operator==(TextCursorCursor lhs, TextCursorCursor rhs)
295 => lhs.Equals(rhs);
296
297 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
298 /// <para>Since EFL 1.24.</para>
299 /// </summary>
300 /// <param name="lhs">The left hand side of the operator.</param>
301 /// <param name="rhs">The right hand side of the operator.</param>
302 /// <returns><c>true</c> if <c>lhs</c> is not equal
303 /// to <c>rhs</c>.</returns>
304 public static bool operator!=(TextCursorCursor lhs, TextCursorCursor rhs)
305 => !(lhs == rhs);
192} 306}
193 307
194[StructLayout(LayoutKind.Sequential)] 308[StructLayout(LayoutKind.Sequential)]
195public struct TextAnnotateAnnotation 309public struct TextAnnotateAnnotation : IEquatable<TextAnnotateAnnotation>
196{ 310{
197 IntPtr list; 311 IntPtr list;
198 IntPtr obj; 312 IntPtr obj;
199 IntPtr start_node; 313 IntPtr start_node;
200 IntPtr end_node; 314 IntPtr end_node;
201 [MarshalAsAttribute(UnmanagedType.U1)]bool is_item; 315 [MarshalAsAttribute(UnmanagedType.U1)]bool is_item;
316
317 /// <summary>
318 /// Gets a hash for <see cref="TextAnnotateAnnotation" />.
319 /// <para>Since EFL 1.24.</para>
320 /// </summary>
321 /// <returns>A hash code.</returns>
322 public override int GetHashCode()
323 => list.GetHashCode() ^ obj.GetHashCode()
324 ^ start_node.GetHashCode() ^ end_node.GetHashCode()
325 ^ is_item.GetHashCode();
326
327 /// <summary>Returns whether this <see cref="TextAnnotateAnnotation" />
328 /// is equal to the given <see cref="object" />.
329 /// <para>Since EFL 1.24.</para>
330 /// </summary>
331 /// <param name="other">The <see cref="object" /> to be compared to.</param>
332 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
333 public override bool Equals(object other)
334 => (!(other is TextAnnotateAnnotation)) ? false
335 : Equals((TextAnnotateAnnotation)other);
336
337
338 /// <summary>Returns whether this <see cref="TextAnnotateAnnotation" /> is equal
339 /// to the given <see cref="TextAnnotateAnnotation" />.
340 /// <para>Since EFL 1.24.</para>
341 /// </summary>
342 /// <param name="other">The <see cref="TextAnnotateAnnotation" /> to be compared to.</param>
343 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
344 public bool Equals(TextAnnotateAnnotation other)
345 => (list == other.list) && (obj == other.obj)
346 && (start_node == other.start_node) && (is_item == other.is_item);
347
348 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
349 /// <para>Since EFL 1.24.</para>
350 /// </summary>
351 /// <param name="lhs">The left hand side of the operator.</param>
352 /// <param name="rhs">The right hand side of the operator.</param>
353 /// <returns><c>true</c> if <c>lhs</c> is equal
354 /// to <c>rhs</c>.</returns>
355 public static bool operator==(TextAnnotateAnnotation lhs, TextAnnotateAnnotation rhs)
356 => lhs.Equals(rhs);
357
358 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
359 /// <para>Since EFL 1.24.</para>
360 /// </summary>
361 /// <param name="lhs">The left hand side of the operator.</param>
362 /// <param name="rhs">The right hand side of the operator.</param>
363 /// <returns><c>true</c> if <c>lhs</c> is not equal
364 /// to <c>rhs</c>.</returns>
365 public static bool operator!=(TextAnnotateAnnotation lhs, TextAnnotateAnnotation rhs)
366 => !(lhs == rhs);
202} 367}
203 368
204namespace Access 369namespace Access
205{ 370{
206 371
207public struct ActionData 372public struct ActionData : IEquatable<ActionData>
208{ 373{
209 public IntPtr name; 374 public IntPtr name;
210 public IntPtr action; 375 public IntPtr action;
211 public IntPtr param; 376 public IntPtr param;
212 public IntPtr func; 377 public IntPtr func;
378
379
380 /// <summary>
381 /// Gets a hash for <see cref="ActionData" />.
382 /// <para>Since EFL 1.24.</para>
383 /// </summary>
384 /// <returns>A hash code.</returns>
385 public override int GetHashCode()
386 => name.GetHashCode() ^ action.GetHashCode()
387 ^ param.GetHashCode() ^ func.GetHashCode();
388
389 /// <summary>Returns whether this <see cref="ActionData" />
390 /// is equal to the given <see cref="object" />.
391 /// <para>Since EFL 1.24.</para>
392 /// </summary>
393 /// <param name="other">The <see cref="object" /> to be compared to.</param>
394 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
395 public override bool Equals(object other)
396 => (!(other is ActionData)) ? false
397 : Equals((ActionData)other);
398
399
400 /// <summary>Returns whether this <see cref="ActionData" /> is equal
401 /// to the given <see cref="ActionData" />.
402 /// <para>Since EFL 1.24.</para>
403 /// </summary>
404 /// <param name="other">The <see cref="ActionData" /> to be compared to.</param>
405 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
406 public bool Equals(ActionData other)
407 => (name == other.name) && (action == other.action)
408 && (param == other.param) && (func == other.func);
409
410 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
411 /// <para>Since EFL 1.24.</para>
412 /// </summary>
413 /// <param name="lhs">The left hand side of the operator.</param>
414 /// <param name="rhs">The right hand side of the operator.</param>
415 /// <returns><c>true</c> if <c>lhs</c> is equal
416 /// to <c>rhs</c>.</returns>
417 public static bool operator==(ActionData lhs, ActionData rhs)
418 => lhs.Equals(rhs);
419
420 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
421 /// <para>Since EFL 1.24.</para>
422 /// </summary>
423 /// <param name="lhs">The left hand side of the operator.</param>
424 /// <param name="rhs">The right hand side of the operator.</param>
425 /// <returns><c>true</c> if <c>lhs</c> is not equal
426 /// to <c>rhs</c>.</returns>
427 public static bool operator!=(ActionData lhs, ActionData rhs)
428 => !(lhs == rhs);
213} 429}
214 430
215} // namespace Access 431} // namespace Access
216 432
217} // namespace Efl 433} // namespace Efl
218
219// Global delegates
220public delegate void EinaFreeCb(IntPtr data);
221public delegate void EvasSmartCb(IntPtr data, IntPtr obj, IntPtr event_info);