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
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
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
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
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
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.
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
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
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
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.
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
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
Summary:
Use the native event loaded from dlsym directly instead of wrapping it
in a Event_Description structure.
Fixes: T7355
Reviewers: felipealmeida, vitor.sousa, segfaultxavi
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl_language_bindings
Differential Revision: https://phab.enlightenment.org/D6981
Summary:
efl_finalize override is called inside efl_add_end. Previously by this
time the constructor still hadn't saved the C# wrapper handle into the
Eo instance private data, to be recovered in the static delegates that
call the C# overrides.
This commit just changes the order to save the C# handle *before*
calling efl_add_end.
Test Plan: added unit test to be run with make check
Reviewers: felipealmeida, vitor.sousa, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6956
Summary:
The binding user should be able to register to events inside the initialization callback given to the constructor.
Fixes T7346
Reviewers: segfaultxavi, felipealmeida, vitor.sousa
Reviewed By: segfaultxavi, vitor.sousa
Subscribers: cedric, #reviewers, #committers, zmike
Tags: #efl
Maniphest Tasks: T7346
Differential Revision: https://phab.enlightenment.org/D6908
Summary:
It was missing setting the 'is_ref' parameter to 1 to mirror the
internal_start call.
Test Plan: make check
Reviewers: cedric
Subscribers: #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6193
Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
Besides the normal methods returning Futures, we now generate
a wrapper with the "Async" suffix. This wrapper returns a
Systems.Threading.Tasks.Task which can be awaited on and reflect the
status of the Future.
When an eina.Future fails with ECANCELED, TaskCanceledException is
raised in the Task. Otherwise, an efl.FutureException(eina.Error) is
raised.
Depends on D6174
Reviewers: felipealmeida
Reviewed By: felipealmeida
Subscribers: cedric, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6175
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
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
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
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
Summary:
To deal with events with the same name as some methods (Del, Invalidate,
etc), the suffix Evt was added.
Thus, now we use
obj.ButtonClickedEvt += callback;
Instead of
obj.BUTTON_CLICKED += cal
The argument classes use the same scheme, being called <Evt name>_Args.
Depends on D5991
Reviewers: felipealmeida
Reviewed By: felipealmeida
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5992
Previously, class methods were implemented as regular instance methods.
This commits generates C# static methods for @class methods on the
*Concrete classes (and their childs).
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.
This commit adds the "documentation" generator, which gets the
documentation_def attribute of the given item and generates xml comments
to be exported by MCS.
For items requiring some customization of the generated comments (e.g.
functions and its parameters), the helpers to generate the preamble
(summary), body (paragraphs) and epilogue (currently just the @since
tag) were added.
Currently we do not support converting Eolian references into xmldoc
references.
As we explicitly generate Get/Set methods for properties, for now the
generator tries to get the get/set specific documentation first. If it
is not present, fallback to the common docs.
Later this could be changed to generate the common one as paragraphs of
the Get/Set.
Also some generated code like the wrappers for calling C# methods
from C can be private. This will cleanup the introspection results
and warnings when generating documentation.
Due to this visibility change, the binbuf tests had to be changed
to add redirect calls to the native methods instead of directly
calling the DllImport'd methods.