summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh (follow)
AgeCommit message (Collapse)Author
2020-02-18csharp: Add IntPtr to/from IEnumerable conversion for "accessor" typesJoão Paulo Taylor Ienczak Zanette
Adds a special case for "accessor" complex types in `implicit operator` for structs and `IntPtr`s, in which an IEnumerator must be converted to/from an IntPtr. Reviewed-by: YeongJong Lee <cleanlyj@naver.com> Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11210
2020-01-28eolian_mono: make struct immutableYeongjong Lee
Summary: Immutable value type is recommeneded for struct type in cs world. `DO NOT define mutable value types.` (see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/struct) Also, this patch include refactoring of generated struct types. 1. Change field type to property type that have only getter. it will fix CA1051(ref T8397). 2. Remove internal NativeStruct. there is private field for marshalling struct instead. 3. Fix some test cases that change value inside struct. because struct is immutable. Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: woohyun, felipealmeida, Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8397 Differential Revision: https://phab.enlightenment.org/D11146
2020-01-27csharp: Escape contents of struct fields' value tag.João Paulo Taylor Ienczak Zanette
Summary: In structs' definition, field `<value>` tags weren't scaping characters, so characters like "&" would lead to invalid XML errors. Fixes T8588. Test Plan: Run ninja test. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8588 Differential Revision: https://phab.enlightenment.org/D11202
2020-01-23csharp: cleanup concrete classYeongjong Lee
Summary: Concrete class is only used to call static member of NativeMethod. they don't need any inheritance and implementation of c functions. Depends on D9893 Test Plan: ninja test Reviewers: lauromoura, felipealmeida Subscribers: Jaehyun_Cho, woohyun, segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9894
2020-01-14eina_mono: replace eina_list and eina_array with IListYeongjong Lee
Summary: Eina.List<T> => System.Collections.Generic.IList<T> Eina.Array<T> => System.Collections.Generic.IList<T> ref T8486 Depends On D10785 Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: felipealmeida, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486, T8488 Differential Revision: https://phab.enlightenment.org/D10902
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-12-17csharp : add move tag info to EinaAccessor, EinaIterator converterYeongjong Lee
Summary: Included commits in devs/lauromoura/remove_eina_mono-rebased ``` commit ed6679db1901c710cc6ddb50e7001cfd20caa77a Author: Lauro Moura <lauromoura@expertisesolutions.com.br> Date: Mon Dec 2 13:58:04 2019 -0300 csharp: add move information to EnumerableToAccessor Still need to fix the converted accessor ownership, maybe by creating a custom accessor class that released the pinned memory when is freed. ``` ref T8486 Depends On D10878 Co-authored-by: Lauro Moura <lauromoura@expertisesolutions.com.br> Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486 Differential Revision: https://phab.enlightenment.org/D10879
2019-12-17eina_mono: replace EinaAccessor and EinaIerator with IEnumerableYeongjong Lee
Summary: Eina.Accessor<T> => System.Collections.IEnumerable<T> Eina.Iterator<T> => System.Collections.IEnumerable<T> Unit test will work with D10879. ref T8486 Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486 Differential Revision: https://phab.enlightenment.org/D10878
2019-12-12csharp: Implement Deconstruct for structs.João Paulo Taylor Ienczak Zanette
Summary: Usage example: ``` var (x, y) = somePos2D; ``` Not available on Mono environment due to [`mcs` not implementing it](https://github.com/mono/mono/blob/a3de0304a190c54124df3486ce9c34b6262787a8/mcs/mcs/tuples.cs#L590). To keep tests from breaking because of it, a `MONO` preprocessor variable is defined and checked during test compilation. Ref T8489. Reviewers: brunobelo, lauromoura, segfaultxavi Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8489 Differential Revision: https://phab.enlightenment.org/D10809
2019-12-12csharp: Add implicit conversion from tuples to structs.João Paulo Taylor Ienczak Zanette
Summary: Also generates implicit conversion for 1-field structs. Usage examples: ``` // With tuples Point2D p = (1, 2); obj.SetPoint((1, 2)); // With 1-field structs StringWrapper sw = "Must be handled by wrapper."; ``` Due to limitations of MSC compiler, implicit conversions are generated only if struct has 4 fields or less. Ref T8489. Reviewers: brunobelo, cedric, lauromoura, segfaultxavi Reviewed By: lauromoura Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T8489 Differential Revision: https://phab.enlightenment.org/D10801
2019-12-09c#: Suppressing warning for CA1724.Bruno da Silva Belo
Summary: ref T8413 Reviewers: lauromoura, felipealmeida, YOhoho, jptiz Reviewed By: jptiz Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8413 Differential Revision: https://phab.enlightenment.org/D10811
2019-11-20csharp: CA1307 Add CultureInfo to generated code.Lauro Moura
Summary: For the struct fields with strings when implementing `GetHashCode`. Ref T8405 Reviewers: brunobelo, felipealmeida, YOhoho Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8405 Differential Revision: https://phab.enlightenment.org/D10696
2019-11-20csharp: Specifying StringComparison.Bruno da Silva Belo
Summary: ref T8405 Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi Reviewed By: lauromoura Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8405 Differential Revision: https://phab.enlightenment.org/D10650
2019-11-19csharp: Fix CA1815 for generated structs and aliasesLauro Moura
Summary: Adds IEquatable<T> and friends. Reviewers: felipealmeida, YOhoho, brunobelo Reviewed By: brunobelo Subscribers: cedric, #reviewers, segfaultxavi, #committers Tags: #efl Maniphest Tasks: T8418 Differential Revision: https://phab.enlightenment.org/D10694
2019-11-13csharp: Add conversion methods for generated typesLauro Moura
Summary: This also adds a helper method to convert from a value type name to the reference type name. (e.g. int to Int32). Ref T8430 Reviewers: felipealmeida, brunobelo, YOhoho Reviewed By: brunobelo Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8430 Differential Revision: https://phab.enlightenment.org/D10653
2019-11-04csharp: Changing visibility of nested class/structBruno da Silva Belo
Reviewers: felipealmeida, lauromoura, YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8393 Differential Revision: https://phab.enlightenment.org/D10588
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-10-15csharp: Add since documentation to struct and struct fieldsFelipe Magno de Almeida
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D10385
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-20eolian: rename any_value_ptr -> any_value_ref for consistencyDaniel Kolesa
2019-08-28mono-docs: Remove useless semicolon from doc commentsXavi Artigas
2019-08-01csharp: Avoid generating empty <value> tagsLauro Moura
Depends on D9478 Reviewers: segfaultxavi, felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9481
2019-08-01mono-docs: Add misc struct docsXavi Artigas
Summary: Structs have a convenience constructor which was missing parameter documentation. Struct fields need a <value> tag or there is a hole in the generated docs. The documentation for the type of the field has been used, when available. Test Plan: Build docs and look at generated pages for structs. Reviewers: lauromoura, vitor.sousa, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9478
2019-08-01eolian_mono: Fix whitespace in generated cs filesXavi Artigas
Pet peeve of mine.
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-06-28csharp: fix Eina_Stringshare support in containers for manual and generated APIVitor Sousa
Summary: Both C strings and eina stringshares are bound as regular strings in EFL#, as working directly with these types would demand unnecessary hassle from the user viewpoint. But for eina containers this distinction is important, and since C# generics do not provide a convenient way of dealing with the same type requiring a different management based on some other condition (at least not without compromising the usability for other types), we added a simple `System.String` wrapper named `Eina.Stringshare` that works as a placeholder for signaling this distinction. Working with this class should be transparent in most use cases because it converts to and from `System.String` implicitly. It also implements equality/inequality methods for easier comparison with strings and other stringshare objects. Add new methods and a new container element trait for dealing specifically with `Eina_Stringshare` elements. Adapt eolian_mono to identify and generate the proper placeholder in methods that require stringshare containers. Remove some direct uses of DllImport-ed functions in favor of more flexible manual binding methods. Move `Eina.Stringshare` DllImport directives to a static class named `NativeMethods`, in accordance with the code design warning CA1060. Also add a TODO comment to move all other DllImport directives to this class. Change parameter of the method `Efl.Csharp.Application.OnInitialize` from `Eina.Array<System.String>` to `string[]`. This will make this API more similar with the default C# way of receiving command line arguments. Add tests for containers storing stringshare elements. Reviewers: felipealmeida, lauromoura, segfaultxavi, bu5hm4n Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9178
2019-06-27csharp: Update after iterator changesLauro Moura
Summary: Iterator and Accessors are views only, not owning the data they point to. Also updated the tests by handling some test data that were leaking. Fixes T8036 Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers, segfaultxavi, q66 Tags: #efl Maniphest Tasks: T8036 Differential Revision: https://phab.enlightenment.org/D9189
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-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-09csharp: Add some null checks.Lauro Moura
Summary: - Check for nullness when getting stuff from C# to C - We should return null when wrapping a NULL pointer instead of throwing an exception Reviewers: felipealmeida, vitor.sousa, woohyun Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8580
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-26eolian_csharp: hide struct native representation inside the managed structVitor Sousa
Summary: Rework the struct binding generator to declare the native struct nested inside the managed one. This way native structs are less likely to cause confusion; for example with an IDE that supports automatic completion. Get rid of struct conversion class methods in favor of using (the already generated) implicit conversion operators. Depends on D8469 Reviewers: segfaultxavi, lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8470
2019-03-26eolian_csharp: make struct generator use indentation level from contextVitor Sousa
Summary: Make the struct generator (the first one to) extract indentation information from the context, an effort for a future overall consistency in white space generation. Depends on D8468 Reviewers: lauromoura, segfaultxavi, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8469
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
2019-02-28efl-csharp: Remove generated inlist/inarray supportLauro Moura
Summary: To be added again in a later release after rework in Eolian Reviewers: q66, vitor.sousa, felipealmeida Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8056
2019-01-14efl-mono: Fix marshalling of struct in event data.Lauro Moura
Summary: Previously, we just converted through PtrToStructure, which didn't have the full marshalling info converting from the internal one to the external. This fixes the usage of the Efl.Loop.arguments event. Also renamed the ToExternal methods to ToManaged, to make clearer that the output struct is the one intended to be used from the managed code. Also fixed a minor styling in the generated code (making it easier to be inspected). Depends on D7538 Reviewers: segfaultxavi, felipealmeida, bu5hm4n Reviewed By: bu5hm4n Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7539
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-09-26efl-csharp: Fix event struct marshalling.Lauro Moura
Summary: The efl.Event struct has a class field that gets generated normally but can be problematic when marshalling the struct back from C to C#. The compilation works fine but when C# runtime tries to marshall the C data (e.g. accessing the Event.Info field), it becomes erratic, either complaining about missing references to object or even segfault. This commit changes the event handling code to use the "Event_StructInternal" struct as is already done when receiving structs from C code. In order to work with other assemblies, the _StructInternal fields were made publit too. Fixes the events tests and the text editor app. Test Plan: make check and run the text editor app in examples repo. Reviewers: segfaultxavi, vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7106
2018-05-23efl_mono: Fix events after Event_Description rename.Lauro Moura
2018-05-17efl_mono: Add support for Eina.Error/Empty in eina.ValueLauro Moura
Summary: eina.Value.Empty now means that we have an zeroed (empty) eina value. For optional values that are empty use eina.Value.OptionalEmpty. This was required to support the empty values passed with EINA_VALUE_EMPTY in some Ecore futures. Also, returning an eina_value by value is not supported in eolian for safety reasons, so we removed some tests that tried to use this behavior. Depends on D6171 Reviewers: felipealmeida Reviewed By: felipealmeida Subscribers: cedric, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6172
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: Move event generators to its own header.Lauro Moura
Summary: Making it easier to share code between self and inherited events. During this move, the namespace and keyword headers were merged into the name_helpers header. Also added the first seed of a generic namespace reducer function, to be used by other functions in later commits. Depends on D5994 Reviewers: felipealmeida Reviewed By: felipealmeida Subscribers: segfaultxavi, cedric Differential Revision: https://phab.enlightenment.org/D5995
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-04-03csharp: Fix typo in generated code.Lauro Moura
2018-04-03efl_mono: Initial version of Strbuf support.Lauro Moura
Also moved the ValueOwnership enum from eina value to eina.Ownership. It can be shared among the eina structures if needed.
2018-03-16csharp: Fix support for ptr(structs)Lauro Moura
In general, ptr(struct) parameters behavior depends whether the parameter has the @owned modifier or not. If there is no @owned parameter (meaning no transfer of ownership happens) and it is a "complex" struct, with reference type fields (like strings), the struct is converted to the respective <Struct>Internal struct and passed with "ref" to the DllImport'd function. For @in parameters, after the function it returns, this intermediate struct is converted to the public struct type and assigned to the original parameter, updating it to the external world. When we have ownership transfers, the structure is copied to unmanaged memory and given to the callee. We can't send managed memory directly as the callee may try to free it. On the managed side, the original struct is left to be garbage collected normally.
2018-03-08csharp: generate helper constructors for structs.Lauro Moura
Summary: C# does not have a literal form for structs (like C++'s {} aggregate initialization). Before this commit the user would need to explicitly instantiate a struct and assign the required values to it, like: eina.Size2D size; size.W = width; size.H = height; widget.SetSize(size); As a workaround, this commit generates helper constructor with parameters corresponding to the struct fields in the order they are declared. These parameters have default values if one does not want to explicitly initialize all fields directly. With these constructs, the above code could be translated to: widget.SetSize(new eina.Size2D(width, height)); It should be noted that the constructed struct will live on the managed memory (GC) instead of the stack. Test Plan: run "make check" Reviewers: felipealmeida Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5838 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2018-01-25eolian_mono: Fix visibility of generated eventsLauro Moura
Protected members do not make sense in sealed classes like the Concrete ones. Also document the placeholder field in extern structures.