summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/klass.hh (follow)
AgeCommit message (Collapse)Author
2019-10-17mono: remove underscores of Efl_Op_Description, Efl_Object_OpsYeongjong Lee
Summary: C# does not use underscore in type name. ref T8333 Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8333 Differential Revision: https://phab.enlightenment.org/D10422
2019-09-23efl-mono: Additional blank line between all methods.Bruno da Silva Belo
Summary: For better indentation, adding a blank line in the end of methods. Test Plan: using efl_ui_layout.eo.cs, efl_access_object.eo.cs, efl_part.eo.cs and efl_ui_factory_bind.eo.cs as references, apply changes to the code then check the diffs of after and before of the references files Reviewers: lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, felipealmeida, lauromoura Tags: PHID-PROJ-uhnmnvlvunw6jgoqdnd4, #efl_language_bindings, #refactoring Maniphest Tasks: T8167 Differential Revision: https://phab.enlightenment.org/D9712
2019-09-10csharp: Skip non-public members from interfacesLauro Moura
Summary: Eolian allows non-public members in interfaces and mixins (usually @protected). As both kinds are converted to C# interfaces, this causes problem as non-public members are forbidden in C# interfaces. This commit changes eolian_mono by removing those members from the C# interfaces. If a generated class implements the interface, the method is generated as if it were a protected member of the class directly. For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`, the interface has only the public getter and the the implementing class has both the public getter and the protected setter. With this, C# devs won't be able to directly implement protected Eo methods from interfaces. (But this really does not make sense from the C# point of view). ref T7494 Reviewers: segfaultxavi, felipealmeida, YOhoho Reviewed By: YOhoho Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers Tags: #efl Maniphest Tasks: T7494 Differential Revision: https://phab.enlightenment.org/D9800
2019-09-10eolian-mono: Changing order of scope and modifier.Bruno da Silva Belo
Summary: sealed public is now public sealed and virtual public is public virtual Reviewers: lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, brunobelo, felipealmeida, #reviewers, lauromoura, #committers Tags: #refactoring, PHID-PROJ-uhnmnvlvunw6jgoqdnd4, #efl_language_bindings Maniphest Tasks: T8172 Differential Revision: https://phab.enlightenment.org/D9725
2019-09-08eolian_mono: remove redundant code in NativeMethodsYeongjong Lee
Summary: Duplicated interface's NativeMethods code will be removed. they are called in `GetInterfaces`. Size of efl_mono.dll 6,587,392 bytes(6.6MB) -> 4,112,384 bytes (4.1MB) Test Plan: ninja test Reviewers: felipealmeida, lauromoura, vitor.sousa Reviewed By: lauromoura Subscribers: cedric, #reviewers, woohyun, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9752
2019-08-23eolian-mono: Add support for partial classesFelipe Magno de Almeida
Summary: Add the -p command to eolian to create a class as a partial class. Create a list in meson build of Eolian files that should be built with partial classes. This allows creating more specific method overloads for C#, manually, by generating the class as partial and adding in manual binding the partial class with the new methods and properties. T8034 Reviewers: segfaultxavi, lauromoura, woohyun, Jaehyun_Cho Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9690
2019-08-23csharp: Only build extension methods for betaLauro Moura
Reviewers: felipealmeida, SanghyeonLee Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9714
2019-08-19csharp: MVVM parts supportLauro Moura
Summary: Parts binding will follow a similar approach to regular property binding: `var error = factory.PartName().PropertyName().Bind(modelProperty);` * Changed both `Bind()` overloads to return the error code from `efl_ui_property_bind` * Also properties from interfaces implemented didn't have their `Bindable` wrapper methds available. Depends on D9563 Reviewers: felipealmeida, cedric, SanghyeonLee, woohyun Reviewed By: cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D9564
2019-08-05efl-mono: Add Model manual implementation to C# and MVVM factoriesLauro Moura
Summary: Depends on D9273, D9270 Test Plan: Run added testcases. Reviewers: cedric, bu5hm4n, zmike, SanghyeonLee, felipealmeida, segfaultxavi Reviewed By: cedric Subscribers: cedric Tags: #expertise_solutions, #efl_language_bindings Differential Revision: https://phab.enlightenment.org/D8080
2019-08-01eolian_mono: Fix whitespace in generated cs filesXavi Artigas
Pet peeve of mine.
2019-07-25mono-docs: Clearer docs for ConstructingHandleXavi Artigas
Only *slightly* clearer.
2019-07-11csharp: Tag exported API items.Lauro Moura
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
2019-07-11csharp: Skip beta interfaces from the list of interfaces.Lauro Moura
Summary: Interfaces were declaring Beta parent interfaces instead of skipping them. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9282
2019-07-11csharp: Respect beta for implementable functionsLauro Moura
Summary: Build fix (remove warnings) Instead of returning the beta functions in the vector and relying on function generators to skip them, filter them out when filling the implementable methods vector. This will make the code return the actual number of implementable function, skipping some unused fields in places like the NativeMethods implementations. Depends on D9258 Reviewers: vitor.sousa, felipealmeida, segfaultxavi Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl, #expertise_solutions Differential Revision: https://phab.enlightenment.org/D9259
2019-07-08csharp: fix some build warnings related with incorrect and missing documentationVitor Sousa
Summary: Some parameter names, tag names and cref identifiers in the documentation were incorrect and causing warnings during compilation. There were also warnings related with missing documentation in publicly visible elements in the manual binding. This commit fixes these incorrections and adds documentation to the manual binding in order to solve these compilation warnings. Warnings related with missing documentation in `.eo` files are still present. Test Plan: Just compile with mono binding. Reviewers: lauromoura, felipealmeida, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9243
2019-07-05csharp: encapsulate some internal code of EoWrapperVitor Sousa
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
2019-06-28csharp: make inherited C# classes constructible from native CVitor Sousa
Summary: With this commit it is now possible for a class that inherits from a C# binding class to be instantiated from native C code. It only has to provide a constructor that receives an `Efl.Eo.EoWrapper.ConstructingHandle` struct, and which calls the base binding constructor passing it. For example: `private Type(ConstructingHandle ch) : base(ch) {}`. Add some test files to validate the proper behavior of this feature. Add some small fixes in generation contexts in order to properly generate base constructors. Depends on D9070 Test Plan: `meson test` and `make check` Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun, YOhoho Reviewed By: YOhoho Subscribers: YOhoho, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9071
2019-05-31csharp: Refactor wrapper lifetime.Vitor Sousa
Summary: This commit makes use of the `ownership,shared` and `ownership,unique` events from Efl.Object in order to avoid the C# wrapper from being collected while C code holds a reference to the object. For example, creating a list of items in a for loop and attaching events to them would fails without this commit, as the C# GC may collect the wrapper. The basic idea is that we use a `WrapperSupervisor`, which is stored in the Eo data storage, with a GCHandle allocated for the lifetime of the underlying Eo object. This supervisor takes care of holding either a weak C# reference (when in unique mode, allowing the wrapper to be GC'd) or a hard C# reference (when in shared mode, making the wrapper non-collectable while the Eo has extra references). One limitation is that object graphs can leak if a shared object in the graph - an Eo child for example - stores a hard reference to another object in the graph as a C# field. In this example, this causes the parent to always have a hard C# reference (from the child) as the child is non-collectable due to the parent holding an Eo reference to it. Depends on D8678 Test Plan: `ninja test` and `make test` Reviewers: lauromoura, felipealmeida, woohyun, segfaultxavi Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9014
2019-05-03csharp: Some docs improvements.Lauro Moura
Summary: - Silent missing docs warnign for API delegates - Document variables - Better docs for async functions Reviewers: segfaultxavi, vitor.sousa Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8809
2019-04-23csharp: refactor native_inherit into a nested class.Lauro Moura
Summary: Efl.Ui.Button_NativeInherit -> Efl.Ui.Button.NativeMethods Will help using EFL# with completion tools. * Added pragmas around the native function definitions to avoid warnings related to the name of native functions * Updated some style fixes for native function wrappers. Their preamble and epilogue styling will be dealt with in future diffs. As a side effect, concrete classes had to be made public again as they hold the function pointers to the native methods of their interfaces. Thus a third party library class that implements IFoo should be able to access these methods. Fixes T7743 Depends on D8622 Reviewers: vitor.sousa, felipealmeida, segfaultxavi Reviewed By: vitor.sousa, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7743 Differential Revision: https://phab.enlightenment.org/D8645
2019-04-22csharp: klass style changesLauro Moura
Summary: Warnings down to 120k Depends on D8612 Reviewers: vitor.sousa, felipealmeida, segfaultxavi Reviewed By: vitor.sousa, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl_language_bindings Differential Revision: https://phab.enlightenment.org/D8614
2019-04-15csharp: Remove unused variable `methods` warning.Lauro Moura
Summary: Only generate it if there was at least one method registered. Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8608
2019-04-15csharp: Fix free_cb calling under dotnet.Lauro Moura
Summary: dotnet's GC seems to be more agressive, showing some issues that usually do not appear when running under Mono's. This commit uses for free_cb's the same scheme we already use for regular Eo refs, using a GC handle to keep the cleaning callback alive. Reviewers: vitor.sousa, felipealmeida, woohyun Reviewed By: vitor.sousa Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8593
2019-04-15csharp: Make concrete classes internal.Lauro Moura
Summary: They don't need to be public anymore. After merging other changes we can try to actually remove them. Fixes T7801 Reviewers: segfaultxavi, vitor.sousa, felipealmeida Reviewed By: segfaultxavi, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7801 Differential Revision: https://phab.enlightenment.org/D8601
2019-04-12mono-docs: Allow derived classes to have external examplesXavi Artigas
Summary: You can now have external example files for derived classes (Efl.Ui.Button.SetText) as well as for base classes (Efl.IText.SetText). If both files are present, both examples are embedded in the docs. The more examples the better! Examples for classes in-between the hierarchy (Efl.Ui.Widget.SetText) are not picked up. Might be worth examining in the future. Test Plan: Create example files for both `Efl.Ui.Button.AutorepeatEnabled.cs` and `Efl.Ui.IAutorepeat.AutorepeatEnabled.cs`. You should see both examples appearing in the docs. Reviewers: lauromoura, vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8597
2019-04-09efl-mono: Make override of methods only for methods that are defined by the userFelipe Magno de Almeida
Summary: Instead of overriding every method and making the callback to C, we just override the methods that are found by reflection on the type. Reviewers: bu5hm4n, vitor.sousa, segfaultxavi, woohyun, Jaehyun_Cho, YOhoho, lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8579
2019-04-05efl-csharp: fix crash when events trigger after C# object `Dispose`Vitor Sousa
Summary: Rework general event handling to check individually each event call, if the object is not alive then the event will not be propagated. WeakReferences (and lambdas capturing those WeakRefs) are used to ensure this. Dispose methods in object now take care of checking if efl libraries are still initialized and thread-safely unregister each event before performing an efl_unref on the Eo object. Event handling in C# is now centered around a single dictionary inside the object: `EoEvents`. C# event triggers now properly trigger events on C too. Standardize C# event-triggering methods names (remove underscores). Some diminished use of static memory due events no longer requiring static key objects to be registered/unregistered. Some fixing of white space generation for generated events. Depends on D8431 Reviewers: lauromoura, felipealmeida, segfaultxavi Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8564
2019-04-05efl-csharp: fix resource deallocation causing errors everywhereVitor Sousa
Summary: This commit mainly fixes errors caused by deallocating resources in the garbage collector thread. Using `ecore_main_loop_thread_safe_call_async` to queue resource deallocation in the main thread seems to solve it. Also, some `efl_ref` calls are added in places they were missing, mainly objects that unref in the destructor thus taking ownership if efl_ref is not called. Also fix improper resource deallocation in tests that were causing it to crash, enabling it to call Efl.All.Shutdown again. This allocation and the deallocation process was moved from the Eo class constructor to static class methods that are called in the test 'set up' and 'tear down' methods. Queuing resource deallocation in the main thread make it mandatory that tests call `Efl.App.AppMain.Iterate()` if they want to check proper resource deallocation (like TestFunctionPointers.set_callback_inherited_called_from_c). Extras: Remove duplicated declaration of 'eflcustomexportsmono' in meson in order to fix some linking problems. Remove some unused code around deallocation functions that had to be reworked. Object allocation is now supplied with the call site information it expects (file name and line for _efl_add_start). Depends on D8550 Test Plan: meson test Reviewers: felipealmeida, lauromoura, cedric, segfaultxavi Reviewed By: lauromoura Subscribers: segfaultxavi Tags: #efl_language_bindings, #do_not_merge Differential Revision: https://phab.enlightenment.org/D8431
2019-04-05csharp: Make classes abstract and rework castingLauro Moura
Summary: Abstract Eo classes are now proper C# abstract classes. As a side effect, returning Eo instances from native code was reworked to return instances of their actual Eo classes instead of previous behavior of returning a generic Efl.Object and using static_cast. Instead of `var window = Efl.Ui.Win.static_cast(widget.GetParent());` Use `var window = widget.GetParent() as Efl.Ui.Win;` Another side effect was that `efl_constructor` was removed from the list of supported `Efl.Object` overrides. It is invoked inside `efl_add_internal_start`, before the bindings makes the association of the newly created EoId with the C# instance that created it, making the managed delegate meaningless. C# users then can use regular C# constructors to initialize fields. Also changed to set the private data of C#-inherited classes before the call to constructing methods (aka constructor parameters) so C# classes can override them correctly. Fixes T7778 Fixes T7757 Reviewers: vitor.sousa, felipealmeida, segfaultxavi Reviewed By: vitor.sousa, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7778, T7757, T7702 Differential Revision: https://phab.enlightenment.org/D8550
2019-03-21efl-csharp: Add back I prefix for interfaces.Lauro Moura
Summary: Conforming to C# coding conventions. For properties, now we only generate a wrapper if its name does not clash with the name of the class that would be implementing it. Fixes T7751 Reviewers: vitor.sousa, felipealmeida, segfaultxavi Reviewed By: vitor.sousa, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7751 Differential Revision: https://phab.enlightenment.org/D8397
2019-03-19csharp: rename add/remove event handlerLauro Moura
Summary: Conform to C# API conventions. Ref T7752 Reviewers: felipealmeida, vitor.sousa, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7752 Differential Revision: https://phab.enlightenment.org/D8396
2019-03-17csharp: Rename register_event_proxies.Lauro Moura
Summary: To better adhere to C# conventions and state it is for generated code only. Ref T7702 Reviewers: vitor.sousa, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7702 Differential Revision: https://phab.enlightenment.org/D8369
2019-03-17cshar: Remove unused variables.Lauro Moura
Summary: The nativeInherit field was replaced by using a C# attribute to declare the native class. Ref T7702 Reviewers: segfaultxavi, vitor.sousa Reviewed By: segfaultxavi, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7702 Differential Revision: https://phab.enlightenment.org/D8368
2019-03-15csharp: Support Efl.Class for interfacesLauro Moura
Summary: The `GetEflClassStatic` method for interface is in their Concrete sidekick. Previously, passing a valid Eo interface as a type caused the binding to complain that `Type is not an Efl.Object`. Test Plan: run test case Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8360
2019-03-11efl-csharp: Respect beta for classes and other stuff.Lauro Moura
Summary: In order to work around an issue with Efl.App, which is stable but inherits from Efl.Core.Command_Line, @beta interfaces/mixins in the inheritance chain are simply skipped. Also changed the class used int test for inheritance from C# Efl.Loop is stable but internally it uses a @beta class as argument to its Register() method in the constructor. When instantiating a user-defined C# subclass, the binding calls the C# override in the NativeInherit class and the marshalling fails as no code is generated for the beta class. Also moved Efl.Part test to a beta class. Efl.Part is still beta. Regarding parts, they are skipped if its class is @beta too. Also rejected all elm_* files in elm public eo files. They should get back in as they are converted to Efl.Ui.* api. An exception is elm_interface_scrollable.eo, as efl_ui_panel depends on it. Fixes T7730 Test Plan: Run tests Reviewers: vitor.sousa, segfaultxavi, felipealmeida, cedric, bu5hm4n, zmike Reviewed By: vitor.sousa Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7730 Differential Revision: https://phab.enlightenment.org/D8268
2019-03-07efl_csharp: remove warnings caused by unused or unnecessary codeVitor Sousa
Reviewers: lauromoura, segfaultxavi, cedric Reviewed By: lauromoura Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8234
2019-03-07efl-csharp: Respect beta in constructor parameters.Lauro Moura
Summary: Fixes compilation after Efl.Ui.Win parameter changes. Also removed an unused var and now we pass the beta option to the eolian mono invocation for the tests. Fixes T7723 Reviewers: segfaultxavi, felipealmeida, vitor.sousa Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7723 Differential Revision: https://phab.enlightenment.org/D8150
2019-03-01efl-mono: Add support for dotnet coreFelipe Magno de Almeida
Summary: This commits adds dotnet as a supported C# platform for EFL# bindings. Due to differences between Mono and Dotnet regarding DllImport, the bindings now are using an imperative approach to load the function pointers through the NativeModule and FunctionWrapper classes. These classes handle the dlopen/LoadLibrary and dlsym/GetProcAddress calls. Also, the previous caching of non-owned strings returned to native code was removed until further memory checks. We also had to create workaround for bool and chars in Structs for C# marshaling. Going through System.Byte instead and Marshaling manually to their respective types. In order to actually build efl_mono.dll with dotnet right now, issue #4782 from Meson should be fixed to make it properly detect and used the Dotnet compiler. Also use "-Ddotnet=true" when running meson. Fixes T7394 Reviewers: felipealmeida, vitor.sousa, bu5hm4n Reviewed By: vitor.sousa Subscribers: cedric Tags: #efl Maniphest Tasks: T7394 Differential Revision: https://phab.enlightenment.org/D8069
2019-03-01efl-mono: Add support for Efl.ClassLauro Moura
Efl.Class (in practice, the return from the *_class_get() functions) can be used as argument to functions, like in Efl.Object.provider_find and Efl.Ui.Widget_Factory.item_class(get/set). This commits adds support by representing Efl.Class instances as System.Type in the C# API, allowing someone to do things like: `factory.ItemClass == typeof(MyFramework.MyButton)` It also supports user-defined classes that inherit from efl classes.
2019-02-06efl-mono: Remove uneeded declaration from classes.Lauro Moura
Summary: The constructing method is not used anymore after D7789 landed. Test Plan: run tests Reviewers: segfaultxavi, felipealmeida, vitor.sousa Reviewed By: segfaultxavi, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7875
2019-02-01eolian-mono: Provide constructor parameters based on the constructorsFelipe Magno de Almeida
section of the Eo files. Reviewers: woohyun, segfaultxavi, bu5hm4n, felipealmeida Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7789
2019-01-17efl-mono: Enable selecting to build @beta itemsLauro Moura
Summary: For autotools, use --enable-csharp-beta to enable the generation of beta methods and properties, for meson use -Dmono-beta=true. By default, no beta method or property is generated. Reviewers: woohyun, segfaultxavi, bu5hm4n, lauromoura Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7637
2019-01-17eolian-mono: Add interface registration to inherited classesFelipe Magno de Almeida
Summary: Depends on D7635, D7634 Reviewers: woohyun, bu5hm4n, segfaultxavi, lauromoura Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7636
2019-01-17eolian_mono: fix inheriting from efl types not considering additional interfacesVitor Sousa
Reviewers: segfaultxavi, bu5hm4n, Jaehyun_Cho, lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7635
2019-01-15efl-mono: Only raise exception for managed errors.Lauro Moura
Summary: Previously, any unhandled Eina_Error would cause an exception to be thrown when the control returned to C#. This commit changes this behavior to only raise it when an exception went unhandled from a C# callback back to C, like in an event handler, for example. Test Plan: run tests Reviewers: segfaultxavi, Jaehyun_Cho, felipealmeida Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7537
2018-12-17eolian_mono: use System.Type explicitlyJaehyun Cho
Previously, "Type" was used with "using System". However, it caused ambiguity if some classes had "Type" property. Therefore, "System.Type" is used explicitly to remove ambiguity.
2018-12-14efl-mono: Fix call of virtual methods after new APILauro Moura
Summary: After the new API, the virtual wrapper classes (*NativeInherit) just declared the wrappers for the current class. But as they didn't have any inheritance information, reimplementing methods from a parent Eo class wouldn't work. (e.g. Efl.Ui.Button reimplementing Efl.Object FinalizeAdd). This commit changes these NativeInherit classes to mimic the inheritance chain of their regular/abstract counterparts, reusing the virtual wrapper implementations. In order to access the correct Eo class created, the methods on it were changed from static to instance methods. The instance will be held as a class member of the regular/abstract API class to keep the delegates alive and allow getting C Function pointers from them. The class_initializer method was also split in two. The method collecting the wrapper delegates was extracted in order to call the parent ones. Also avoid exception in cached strings queries as TryGetValue requires non-null keys. Test Plan: Run test suite. Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7460
2018-12-14eolian_mono: Add support for C# style propertiesLauro Moura
Summary: Syntatic sugar around the Get/Set functions for now. Test Plan: Run efl-mono-suite Reviewers: vitor.sousa, segfaultxavi, felipealmeida, Jaehyun_Cho Reviewed By: vitor.sousa Subscribers: cedric Tags: #efl_language_bindings Differential Revision: https://phab.enlightenment.org/D7394
2018-11-29csharp: Change to new class API.Lauro Moura
Summary: As discussed in T7204: - Eo Interfaces/mixins -> C# Interfaces with concrete class implementations - Eo Regular/Abstracts -> Proper C# classes - Added some new generators and helper methods. - Refactored the class generator, splitting into helper methods Eo handles now are stored only in the "root" class in any given inheritance tree (generally, Efl.Object), and accessible to each child. Methods also are defined in a single place instead of repeatedly generated in everyfile, reducing the size of the generated .dll from 30MB to around 4.5MB. Mixins are generated as C# interfaces but any regular class it inherits from is lost, as we can't have interfaces inheriting from regular classes. This will be dealt with in a later commit. Summary of API Changes: - Merged Inherit/Concrete classes. (These suffixes disappear from regular classes). - Interface still have implementations with 'Concrete' suffix for when they are returned from methods. - Removed 'I' from interface names. - Removed interfaces for regular/abstract Eo classes. - Concrete classes for interfaces/mixins hold the event argument struct. - Removed '_' from classes, enums, structs, etc, as indicated in C# naming conventions. - Namespaces are now Camel.Cased. - Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass Also renamed the test classes as after the namespace change, the test namespace Test can conflict with the helper Test namespace. (And use more meaningful names than Test.Testing...) Also Fixes T7336 by removing a deprecated example and adding efl_loop_timer_example to build system. Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper fields. The native handlers are used in the manual binding. Still need to work: - As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize" from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on the interface and implemented "namespaced" in the classes, requiring the cast to the interface to access the event. - The Mixin Conundrum. Mixin inheritance will be dealt in a future commit. Depends on D7260 Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7451, T7336 Differential Revision: https://phab.enlightenment.org/D7262
2018-11-05efl-mono: Typos in generated code commentsXavi Artigas
These comments end up in the API reference docs, so typos look bad.