summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/part_definition.hh (follow)
AgeCommit message (Collapse)Author
2020-01-22Revert "efl_mono: remove class ExtensionTag"Jaehyun Cho
Extension Methods' classes have methods with same names and parameters. e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) Although the where clause contains different classes, they cannot be identified as different methods by C# compiler. e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) where T : Efl.Ui.Button e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) where T : Efl.Ui.Check As a result, to avoid ambiguous methods, ExtensionTag should be used as a second parameter of each method. e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac, ExtensionTag<Efl.Ui.Button, T>magic = null) where T : Efl.Ui.Button e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac, ExtensionTag<Efl.Ui.Check, T>magic = null) where T : Efl.Ui.Check This reverts commit 76631f502a8234c04ed8124bfdebe62ed5bdf954.
2020-01-15efl_mono: remove class ExtensionTagJaehyun Cho
Summary: Since class BindablePart and class BindableProperty use generic type constraint as "where T : <class name>", class ExtensionTag is no longer needed. Reviewers: SanghyeonLee, felipealmeida, YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11101
2020-01-13eolian_mono: add 1 tab inside the namespaceYeongjong Lee
Summary: Also, this patch will fix indentation of enum, struct. ### Before ``` namespace Efl.Ui { /// <summary>Define the move or resize mode of a window. /// /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed. ... [Efl.Eo.BindingEntity] public enum WinMoveResizeMode { /// <summary>Start moving window<br/>Since EFL 1.22.</summary> Move = 1, /// <summary>Start resizing window to the top<br/>Since EFL 1.22.</summary> Top = 2, ... } } ``` ### After ``` namespace Efl.Ui { /// <summary>Define the move or resize mode of a window. /// /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed. ... [Efl.Eo.BindingEntity] public enum WinMoveResizeMode { /// <summary>Start moving window<br/>Since EFL 1.22.</summary> Move = 1, /// <summary>Start resizing window to the top<br/>Since EFL 1.22.</summary> Top = 2, ... } } ``` Reviewers: Jaehyun_Cho, felipealmeida Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11032
2019-11-06csharp:comma have whitespace after and none beforeBruno da Silva Belo
Reviewers: felipealmeida, lauromoura, YOhoho Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10575
2019-10-24csharp: Add licensing information.Lauro Moura
Summary: C# bindings will be lincensed under Apache Sofware License 2.0. This commit adds the license text to the licenses folder and a copyright notice to the binding files. Fixes T8039 Reviewers: woohyun, felipealmeida, vitor.sousa Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8039 Differential Revision: https://phab.enlightenment.org/D9414
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-08-23csharp: Add bindable factory parts supportLauro Moura
Summary: This commit makes parts that implement `Efl.IContent` use BindFactory instead of property binding. ``` var factory = new Efl.Ui.ItemFactory<Efl.Ui.ListDefaultItem>(); var iconFactory = new Efl.Ui.ImageFactory(null); iconFactory.PropertyBind("filename", "modelProperty"); factory.IconPart().BindFactory(iconFactory); ``` Fixes T7628 Reviewers: cedric, felipealmeida, SanghyeonLee Reviewed By: felipealmeida Tags: #efl Maniphest Tasks: T7628 Differential Revision: https://phab.enlightenment.org/D9653
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-05-06csharp: Fix property helper doc indentLauro Moura
Summary: Documentation generators must received their indentation as parameter instead of explicit scope_tabs Fixes T7794 Reviewers: segfaultxavi, felipealmeida, vitor.sousa Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7794 Differential Revision: https://phab.enlightenment.org/D8818
2019-04-22csharp: Small style changesLauro Moura
Summary: - Marshal annotations - Parameters - Structs - Parts Depends on D8614 Reviewers: segfaultxavi, vitor.sousa Reviewed By: segfaultxavi, vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8622
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-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-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
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-05-24efl_mono: Fixes after efl_part/del changes.Lauro Moura
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-05-03efl_mono: Change generated classes naming schemeLauro Moura
Summary: Now the generated classes use an approach more familiar to C# developers: Interfaces: efl.Object -> efl.IObject Concrete (implementation) classes: efl.ObjectConcrete -> efl.Object. During this change, some methods that could clash with the implementation class name (CS0542) had the prefix "Do" added (like in efl.Duplicate.Duplicate() and efl.Pack.Pack()). Depends on D6049 Reviewers: felipealmeida, vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D6050
2018-05-03efl_mono: More uniformization of the handling of namesLauro Moura
Summary: Uses a common helper to open and close namespaces, to get the managed and unmanaged name of things, the interface, concrete and inherit class names, etc. eolian_cxx: Add namespace information to func_def, as it'll avoid eolian-cxx clients dealing with the eolian C api directly when trying to access a function pointer namespace. Depends on D6048 Reviewers: felipealmeida, vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D6049
2018-04-26efl_mono: Reorganize utility functions.Lauro Moura
Summary: Blacklist functions are all in the header/namespace blacklist. Helper functions returning strings (names) are in the name_helpers header. They act somewhat like "mini-generators". Helpers.hh was left with other kind of helper functions (checks, etc) that do not return strings. Depends on D5992 Reviewers: felipealmeida Reviewed By: felipealmeida Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5993
2018-04-12efl_mono: Add namespace on helpers.Lauro Moura
Make it easier on finding where those functions are coming from.
2018-03-20csharp: Add support for efl parts as PropertiesLauro Moura
Instead of var bg = efl.ui.Background.static_cast(myobj.Part("background")); Now do var bg = myobj.Background; Also a couple helper functions were added.