Commit Graph

96 Commits

Author SHA1 Message Date
Vitor Sousa b530b871bc eolian_csharp: hide struct native representation inside the managed struct
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-26 16:43:25 -03:00
Vitor Sousa 762ae45f05 eolian_csharp: make struct generator use indentation level from context
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-26 16:43:15 -03:00
Vitor Sousa 378ba8ebd1 eolian_csharp: add indentation context
Summary:
Also, use new context class for cleaner constructs.

Also, make functions receive context objects by reference to avoid
unnecessary object copies (since context objects are bigger now).

This commit contains preparation structures for a future overhaul of
white space generation.

Depends on D8467

Test Plan: ninja test

Reviewers: felipealmeida, lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8468
2019-03-26 16:42:36 -03:00
Lauro Moura a4ae92d8dd efl-csharp: Remove spaces from type strings in generator.
Summary:
Previously, the type_impl and marshall_type_impl generators relied on a
type mismatch in the match table to fallback to the else branch in the
match check to actually print the type string. This was achieved by
adding the " " prefix to the type.

This commit changes this behavior to invoke a proper visitor just to
print and makes both generators return trimmed type strings.

This will help conforming to the C# coding conventions.

Test Plan: run test suite

Reviewers: felipealmeida, vitor.sousa

Reviewed By: felipealmeida, vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8441
2019-03-26 14:48:12 -03:00
Lauro Moura 0881d1524b efl-csharp: Add back I prefix for interfaces.
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-21 14:48:33 -03:00
Xavi Artigas 016e4df78b mono-docs: Use @since tags properly
Summary:
Only the number was being used, and in places were it should not be.
Now the Since version appears only in <summary> tags, with proper
context (Since EFL 1.22).

Test Plan: make && gendoc should produce DocFX pages which make more sense.

Reviewers: lauromoura, zmike, bu5hm4n

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8012
2019-03-20 11:23:41 +01:00
Jaehyun Cho a253f502c7 eolian_mono: apply indentation of if scope 2019-03-20 11:38:25 +09:00
Lauro Moura d10ee74b97 csharp: rename add/remove event handler
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-19 16:10:17 +01:00
Lauro Moura 8dca5fe677 csharp: Rename register_event_proxies.
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-17 16:11:55 +01:00
Lauro Moura 2865b7cddb cshar: Remove unused variables.
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-17 16:02:32 +01:00
Lauro Moura 4acc7e0667 csharp: Support Efl.Class for interfaces
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-15 11:38:08 -03:00
Lauro Moura 305749f049 csharp: Fix event names with underscore.
Summary:
names like `focus_geometry,changed` shoud be converted to
FocusGeometryChanged instead of Focus_geometryChanged.

Fixes T7735

Test Plan: run tests

Reviewers: vitor.sousa, felipealmeida, segfaultxavi

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7735

Differential Revision: https://phab.enlightenment.org/D8301
2019-03-11 19:28:02 -03:00
Lauro Moura f29ceef500 efl-csharp: Respect beta for classes and other stuff.
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-11 16:08:04 -03:00
Vitor Sousa 04ccdefb3b eolian_csharp: fix binding of stringshare arguments in events 2019-03-08 13:06:55 -03:00
Daniel Kolesa cf200a7d28 eolian: remove legacy handling API and most of generation
Summary:
This removes all Eolian API that deals with handling of legacy
code. It also removes the code using it in the generator as well
as bindings, but for now keeps generation of .eo.legacy.h types,
as there are still instances in our codebase where things are
otherwise broken. We can remove the rest once that is resolved.

Reviewers: zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8255
2019-03-08 10:12:09 -05:00
Vitor Sousa 00fdbb340f efl_csharp: remove warnings caused by unused or unnecessary code
Reviewers: lauromoura, segfaultxavi, cedric

Reviewed By: lauromoura

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8234
2019-03-07 17:08:20 -03:00
Lauro Moura 116572db5e efl-csharp: Fix uninitialized struct.
Summary:
Could trigger bogus generation with phantom calls thinking beta is
enabled from the want_beta field of the options struct.

Reviewers: vitor.sousa

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8151
2019-03-07 13:11:51 -03:00
Lauro Moura c67f199b2f efl-csharp: Respect beta in constructor parameters.
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-07 13:03:33 +01:00
Felipe Magno de Almeida f392c5a436 efl-mono: Add support for dotnet core
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-01 23:58:56 -03:00
Lauro Moura dd89eb2fd1 efl-mono: Add support for Efl.Class
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-03-01 23:04:08 -03:00
Lauro Moura c3ed0791a6 efl-csharp: Fix variable generation for Roslyn
Summary:
Mono's old compiler (mcs) accepts LL as suffix for longs while Roslyn
(csc) is strict, allowing only a single L.

Test Plan: Run tests

Reviewers: vitor.sousa, felipealmeida

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8061
2019-02-28 17:20:53 -03:00
Xavi Artigas 7269fdc1e2 eolian_mono: Generate proper doc refs for Constants
Summary:
Support for global constant variables has been recently added to the C# bindings.
This patch fixes doc references so they use the proper name.
This brings the mono doc warnings from 71 down to 29.

Depends on D8048

Test Plan:
Just build and see less doc warnings when building the C# bindings.
Also, doc refs to constants are links now.

Reviewers: lauromoura, vitor.sousa

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8051
2019-02-28 16:40:04 +01:00
Lauro Moura bf4280e915 efl-csharp: Remove generated inlist/inarray support
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-02-28 12:21:56 -03:00
Vitor Sousa f78be36dfe efl_csharp: add constant variable generation to C# binding (constants)
Reviewers: lauromoura, q66, bu5hm4n, zmike, cedric, felipealmeida, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_language_bindings

Differential Revision: https://phab.enlightenment.org/D8048
2019-02-28 12:05:36 -03:00
Lauro Moura 7943a69b0d efl-csharp: Add support for containers in events.
Summary: Using a simple wrapper as event parameters are not ownable.

Reviewers: vitor.sousa

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7981
2019-02-22 14:07:24 -03:00
Xavi Artigas a152ba6d5b mono-docs: Add <value> tags to properties
eolian_mono now generates properties (which simply wrap the setter and getter
methods when both ara available), but they were missing docs, because
properties require a special <value> tag instead of <returns> or <param> which
we are already implementing.
This commit adds <value> tags only if docs can be retrieved from the setter or
the getter methods.
2019-02-21 08:56:13 +01:00
Marcel Hollerbach 37d2d378ec eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.

After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.

This also means a change to the syntax created by eo:

Calling before:
  class_function(CLASS_A);
Calling after:
   class_function();

Implementation before:
   class_function(const Eo *obj, void *pd) { ... }
Implementation after:
   class_function(void) { ... }

This fixes T7675.

Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
2019-02-13 16:59:58 +01:00
Lauro Moura 9277586fd8 efl-csharp: Fix self in iface concrete functions
Summary:
It was mistakenly being called as static functions.

Fixes T7619

Test Plan: See attached testcase.

Reviewers: segfaultxavi, bu5hm4n, vitor.sousa

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7619

Differential Revision: https://phab.enlightenment.org/D7904
2019-02-11 16:59:10 -02:00
Lauro Moura 9bea248d3c efl-mono: Remove uneeded declaration from classes.
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-06 19:52:45 -02:00
Felipe Magno de Almeida 0223bb29df eolian-mono: Provide constructor parameters based on the constructors
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-02-01 14:03:02 -05:00
Felipe Magno de Almeida 50c41b1100 efl-mono: Fix calling non-static methods with garbage collectable NativeInherits
This fixes intermittent errors in C# classes with inheritance from Eo,
just like a lot of unit tests.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7683
2019-01-18 14:06:16 +01:00
Lauro Moura 586bc5207e efl-mono: Enable selecting to build @beta items
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-17 21:45:49 +09:00
Felipe Magno de Almeida adc2e674af eolian-mono: Add interface registration to inherited classes
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-17 21:36:27 +09:00
Vitor Sousa 7b342e8fdd eolian_mono: fix inheriting from efl types not considering additional interfaces
Reviewers: segfaultxavi, bu5hm4n, Jaehyun_Cho, lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7635
2019-01-17 21:36:27 +09:00
Lauro Moura e2589e3b48 efl-mono: Only raise exception for managed errors.
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
2019-01-15 17:51:20 +09:00
Lauro Moura ede219c453 efl-mono: Fix marshalling of struct in event data.
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
2019-01-14 16:18:05 +09:00
Jaehyun Cho 81317305e0 efl_mono: remove '_' from type for C# naming convention
Summary:
"type" in .eo is converted to "struct" in .eo.cs.
Since the type name in .eo is the same with the struct name .eo.cs,
'_' is removed from the converted struct in .eo.cs for C# naming
convention.

For example, Efl.Callback_Priority is defined in efl_object.eo and
the name is converted to Efl.CallbackPriority in efl_object.eo.cs.

Efl.Access.StateSet in workaround.cs causes duplicated definition
with this patch so Efl.Access.StateSet in workaround.cs is removed.

Test Plan: Compile with autogen.sh --enable-csharp-bindings

Reviewers: lauromoura, segfaultxavi, felipealmeida

Reviewed By: felipealmeida

Subscribers: segfaultxavi, cedric, #reviewers, #committers, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7597
2019-01-14 15:36:14 +09:00
Lauro Moura c998af19fc efl-csharp: Temporarily blacklist forwarder function.
Depends on support for constants that will come with T7506
Differential Revision: https://phab.enlightenment.org/D7596
2019-01-11 11:40:35 +01:00
Lauro Moura a5b338ded3 cxx: Add class get name attribute.
Summary:
C# generator was mistakenly reimplementing it assuming everything was
*_class_get.

Test Plan: run cxx/csharp tests

Reviewers: felipealmeida, cedric, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7522
2019-01-10 12:47:58 +01:00
Xavi Artigas 9b1cc1d80a efl-mono: automatic code refs for event wrappers docs
Summary:
Event wrappers have a comment saying:
///<summary>Event argument wrapper for event XxxEvt</summary>"

This patch simply adds a link to that comment:
///<summary>Event argument wrapper for event <see cref="Fully.Qualified.XxxEvt"/></summary>"

Test Plan: Generate the C# files and enjoy fully-linked doc comments for event wrappers.

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7525
2018-12-28 17:47:47 +01:00
Xavi Artigas 47728f0c89 efl-mono: Remove trailing () from doc references
Summary:
Some EO docs include () after a @method reference (some don't).
When the method reference is redered by DocFX it already includes
the trailing parenthese (and it even includes the parameter types),
so it looks very weird: Efl.Gfx.Stack.Raise()()

This patch removes the "()" string from any text comment following
an @ reference.

Test Plan:
Check DocFX docs for Efl.Gfx.Stack.Lower before and after this patch.
There are references to other methods which include the double parentheses.

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7504
2018-12-21 18:02:29 +01:00
Lauro Moura 8fa3f39e31 efl-mono: Remove warnings
Test Plan: run tests

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7501
2018-12-21 16:09:37 +01:00
Xavi Artigas c84580cc05 doc: Turn comments from EO to C# XML syntax
Summary:
This allows them to be nicely rendered by IDEs and automatic
documentation generators like DocFX.
The conversion includes things like turning $name to <c>name</c>
or solving references to objects, which in turn requires converting
from EO object names to C# names.

It uses the same helper methods used to generate the C# object names,
so if these change in the future, the references in the comments
will change too.

Additionally, this patch fixes some minor bugs, like <para> tags
outside <summary> tags, misspelled <returns> tags or missing <returns>
documentation for getter methods.

Fixes T7453

Reviewers: lauromoura, vitor.sousa

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7453

Differential Revision: https://phab.enlightenment.org/D7467
2018-12-21 14:52:49 +01:00
Jaehyun Cho 01864e166b eolian_mono: use System.Type explicitly
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-17 19:38:45 +09:00
Lauro Moura 9603cc07eb efl-mono: Fix call of virtual methods after new API
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-14 20:47:46 -02:00
Lauro Moura a83c3cdba4 eolian_mono: Add support for C# style properties
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-12-14 18:30:59 -02:00
Lauro Moura 3623753c1d csharp: Change to new class API.
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-29 21:29:48 -02:00
Xavi Artigas edae5021bc efl-mono: Typos in generated code comments
These comments end up in the API reference docs, so typos look bad.
2018-11-05 11:14:37 +01:00
Lauro Moura 7cb0770d04 csharp: Temporarily disable missing docs warning
Summary:
Too many warnings about missing docs in generated code makes difficult
to see "real" warnings.

Reviewers: vitor.sousa, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7135
2018-10-04 10:09:40 +02:00
Lauro Moura 8a4bac15e7 efl-csharp: Fix event struct marshalling.
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-09-26 12:16:09 -03:00