if(!as_generator
(
+ "[Efl.Eo.BindingEntity]\n"
"public enum " << string << "\n{\n"
)
.generate(sink, name_helpers::typedecl_managed_name(enum_), context))
return as_generator("///<summary>Event argument wrapper for event <see cref=\""
<< join_namespaces(evt.klass.namespaces, '.', managed_namespace)
<< klass_interface_name(evt.klass) << "." << evt_name << "\"/>.</summary>\n"
+ << "[Efl.Eo.BindingEntity]\n"
<< "public class " << name_helpers::managed_event_args_short_name(evt) << " : EventArgs {\n"
<< scope_tab << "///<summary>Actual event payload.</summary>\n"
<< scope_tab << "public " << type << " arg { get; set; }\n"
// C# visible delegate
if (!as_generator(documentation
+ << "[Efl.Eo.BindingEntity]\n"
<< "public delegate " << type << " " << string
<< "(" << (parameter % ", ") << ");\n")
.generate(sink, std::make_tuple(f, f.return_type, f_name, f.parameters), funcptr_ctx))
.generate(sink, attributes::unused, iface_cxt))
return false;
+ if(!as_generator("[Efl.Eo.BindingEntity]\n").generate(sink, attributes::unused, iface_cxt))
+ return false;
+
if(!as_generator
(
"public " /*<< class_type*/ "interface" /*<<*/ " " << string << " : "
(
documentation
<< "[" << name_helpers::klass_full_native_inherit_name(cls) << "]\n"
+ << "[Efl.Eo.BindingEntity]\n"
<< "public " << class_type << " " << name_helpers::klass_concrete_name(cls) << " : "
<< (klass_full_concrete_or_interface_name % ",") // classes
<< (root ? "Efl.Eo.EoWrapper" : "") // ... or root
// For constructors with arguments, the parent is also required, as optional parameters can't come before non-optional paramenters.
<< scope_tab << "public " << inherit_name << "(Efl.Object parent" << ((constructors.size() > 0) ? "" : "= null") << "\n"
<< scope_tab << scope_tab << scope_tab << *(", " << constructor_param ) << ") : "
- << "base(" << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n"
+ << "base(" << name_helpers::klass_get_name(cls) << "(), parent)\n"
<< scope_tab << "{\n"
<< (*(scope_tab << scope_tab << constructor_invocation << "\n"))
<< scope_tab << scope_tab << "FinishInstantiation();\n"
scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
<< scope_tab << "/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>\n"
<< scope_tab << "/// <param name=\"baseKlass\">The pointer to the base native Eo class.</param>\n"
- << scope_tab << "/// <param name=\"managedType\">The managed type of the public constructor that originated this call.</param>\n"
<< scope_tab << "/// <param name=\"parent\">The Efl.Object parent of this instance.</param>\n"
- << scope_tab << "protected " << inherit_name << "(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)\n"
+ << scope_tab << "protected " << inherit_name << "(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)\n"
<< scope_tab << "{\n"
<< scope_tab << "}\n\n"
).generate(sink, attributes::unused, context);
if(!as_generator
(
indent << "[StructLayout(LayoutKind.Sequential)]\n"
+ << indent << "[Efl.Eo.BindingEntity]\n"
<< indent << "public struct " << string << "\n"
<< indent << "{\n"
)
/// Internal usage: Constructor to actually call the native library constructors. C# subclasses
/// must use the public constructor only.</summary>
/// <param name="baseKlass">The pointer to the base native Eo class.</param>
- /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
/// <param name="parent">The Efl.Object parent of this instance.</param>
/// <param name="file">Name of the file from where the constructor is called.</param>
/// <param name="line">Number of the line from where the constructor is called.</param>
- protected EoWrapper(IntPtr baseKlass, System.Type managedType, Efl.Object parent,
+ protected EoWrapper(IntPtr baseKlass, Efl.Object parent,
[CallerFilePath] string file = null,
[CallerLineNumber] int line = 0)
{
- generated = ((object)this).GetType() == managedType;
+ generated = Efl.Eo.BindingEntity.IsBindingEntity(((object)this).GetType());
IntPtr actual_klass = baseKlass;
if (!generated)
{
}
}
+[System.AttributeUsage(System.AttributeTargets.Class |
+ System.AttributeTargets.Interface |
+ System.AttributeTargets.Enum |
+ System.AttributeTargets.Delegate |
+ System.AttributeTargets.Struct,
+ AllowMultiple = false,
+ Inherited = false)
+]
+public class BindingEntity: System.Attribute
+{
+ public static bool IsBindingEntity(System.Type t)
+ {
+ return Attribute.GetCustomAttribute(t, typeof(BindingEntity), false) != null;
+ }
+}
+
public interface IWrapper
{
/// <summary>Pointer to internal Eo instance.</summary>