summaryrefslogtreecommitdiff
path: root/src/bindings/mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-07-11 15:50:33 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-07-11 15:51:38 -0300
commita19bb21edf75256e8dfe043d591d05bbf23a29a3 (patch)
tree789cd6ca9f52637b1fd1889a15a58998c70c7cb3 /src/bindings/mono
parent89399672b7a90451071d03b9403d8c8b698d67e1 (diff)
csharp: Tag exported API items.
Summary: Attributes to be used by the API export tool. For end users, no changes in the public API (except for a new attribute in generated classes). Also simplifies constructor forwarding by not needing to pass the type of the first "generated" class to compare. Currently only automatically generated items are tagged. Depends: D9259 Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9270
Diffstat (limited to 'src/bindings/mono')
-rw-r--r--src/bindings/mono/eo_mono/EoWrapper.cs5
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs16
2 files changed, 18 insertions, 3 deletions
diff --git a/src/bindings/mono/eo_mono/EoWrapper.cs b/src/bindings/mono/eo_mono/EoWrapper.cs
index 03edea0..c2ee5e2 100644
--- a/src/bindings/mono/eo_mono/EoWrapper.cs
+++ b/src/bindings/mono/eo_mono/EoWrapper.cs
@@ -67,15 +67,14 @@ public abstract class EoWrapper : IWrapper, IDisposable
67 /// Internal usage: Constructor to actually call the native library constructors. C# subclasses 67 /// Internal usage: Constructor to actually call the native library constructors. C# subclasses
68 /// must use the public constructor only.</summary> 68 /// must use the public constructor only.</summary>
69 /// <param name="baseKlass">The pointer to the base native Eo class.</param> 69 /// <param name="baseKlass">The pointer to the base native Eo class.</param>
70 /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
71 /// <param name="parent">The Efl.Object parent of this instance.</param> 70 /// <param name="parent">The Efl.Object parent of this instance.</param>
72 /// <param name="file">Name of the file from where the constructor is called.</param> 71 /// <param name="file">Name of the file from where the constructor is called.</param>
73 /// <param name="line">Number of the line from where the constructor is called.</param> 72 /// <param name="line">Number of the line from where the constructor is called.</param>
74 protected EoWrapper(IntPtr baseKlass, System.Type managedType, Efl.Object parent, 73 protected EoWrapper(IntPtr baseKlass, Efl.Object parent,
75 [CallerFilePath] string file = null, 74 [CallerFilePath] string file = null,
76 [CallerLineNumber] int line = 0) 75 [CallerLineNumber] int line = 0)
77 { 76 {
78 generated = ((object)this).GetType() == managedType; 77 generated = Efl.Eo.BindingEntity.IsBindingEntity(((object)this).GetType());
79 IntPtr actual_klass = baseKlass; 78 IntPtr actual_klass = baseKlass;
80 if (!generated) 79 if (!generated)
81 { 80 {
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index 833ae78..09c82a7 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -775,6 +775,22 @@ public class PrivateNativeClass : NativeClass
775 } 775 }
776} 776}
777 777
778[System.AttributeUsage(System.AttributeTargets.Class |
779 System.AttributeTargets.Interface |
780 System.AttributeTargets.Enum |
781 System.AttributeTargets.Delegate |
782 System.AttributeTargets.Struct,
783 AllowMultiple = false,
784 Inherited = false)
785]
786public class BindingEntity: System.Attribute
787{
788 public static bool IsBindingEntity(System.Type t)
789 {
790 return Attribute.GetCustomAttribute(t, typeof(BindingEntity), false) != null;
791 }
792}
793
778public interface IWrapper 794public interface IWrapper
779{ 795{
780 /// <summary>Pointer to internal Eo instance.</summary> 796 /// <summary>Pointer to internal Eo instance.</summary>