From 73df0d47ff914211ee0a0b5fe46a381f1cd30f10 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Fri, 28 Jun 2019 18:20:01 -0300 Subject: csharp: encapsulate some internal code of EoWrapper Summary: Encapsulate some parts of EoWrapper making them less accessible to lib users. This can avoid unnecessary and risky usage of code that is only intended for internal usage. `inherited` field was made private and renamed to `generated`. Now its value can only be obtained through the `IsGeneratedBindingClass` property. `handle` field was made private. `eventLock` was renamed to `eflBindingEventLock` `ConstructingHandle` property set was made private. Constructors that are used to create new EFL# managed objects by wrapping a preexisting eo handle now receive a specific struct wrapping the handle pointer. This can avoid faulty interactions with the Reflection engine used only for generated classes that implement this constructor. Test Plan: meson test Reviewers: lauromoura, felipealmeida, YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9212 --- src/bin/eolian_mono/eolian/mono/klass.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bin/eolian_mono/eolian/mono/klass.hh') diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 8b018f6..8f99326 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -214,7 +214,7 @@ struct klass << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n" << scope_tab << "/// Initializes a new instance of the class.\n" << scope_tab << "/// Internal usage: This is used when interacting with C code and should not be used directly.\n" - << scope_tab << "private " << concrete_name << "(System.IntPtr raw) : base(raw)\n" + << scope_tab << "private " << concrete_name << "(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" << scope_tab << "{\n" << scope_tab << "}\n\n" ) @@ -511,7 +511,7 @@ struct klass << scope_tab << "/// Initializes a new instance of the class.\n" << scope_tab << "/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.\n" << scope_tab << "/// The native pointer to be wrapped.\n" - << scope_tab << "protected " << inherit_name << "(System.IntPtr raw) : base(raw)\n" + << scope_tab << "protected " << inherit_name << "(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" << scope_tab << "{\n" << scope_tab << "}\n\n" ).generate(sink, std::make_tuple(constructors, constructors, constructors), context)) @@ -526,7 +526,7 @@ struct klass scope_tab << "[Efl.Eo.PrivateNativeClass]\n" << scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n" << scope_tab << "{\n" - << scope_tab << scope_tab << "private " << inherit_name << "Realized(IntPtr ptr) : base(ptr)\n" + << scope_tab << scope_tab << "private " << inherit_name << "Realized(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" << scope_tab << scope_tab << "{\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" -- cgit v1.1