this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8208
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8207
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8183
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8181
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8173
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8171
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree
ref T7724
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8169
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
Summary:
until to today you had to call init functions and a run function which
were static function in a class called Efl.Ui.Config.
However, calling those init functions there is not really OOP style.
Right now things have changed into a manner where you are defining you
application class with inheriting from the Application /
SimpleApplication abstract.
This enables you to call launch() on your application class, calling
launch there leads to a call to the args function, you can call and use
the Efl classes in there, everything is booted up.
Option parsing and dependency start can still be done in the main method
or application constructor, just ensure that you never call any efl
class / function outside the launch function.
A commit that demonstrates the usage can be found at
ref T7204
https://git.enlightenment.org/tools/examples.git/log/?h=devs/bu5hm4n/POC
Reviewers: felipealmeida, segfaultxavi, Jaehyun_Cho, cedric
Reviewed By: segfaultxavi
Subscribers: zmike, woohyun, akanad, lauromoura, #reviewers, #committers
Tags: #efl_language_bindings
Maniphest Tasks: T7204
Differential Revision: https://phab.enlightenment.org/D7495
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:
This file contains both legacy and new API code, this makes it a little
difficult to deploy.
In Makefile_Ecore.am files can be marked either as legacy or public.
If it is not in legacy, make distcheck fails because Ecore_Legacy.h includes
efl_loop_timer.eo.h.
If it is not in public, bindings are not generated for it.
It cannot be in both places, or make install fails, refusing to install the
same file twice.
Fortunately, there is an ugly place to put files like this one, and it's
already full of other outcasts, so...
Fixes T7114
Test Plan: make distcheck still works, and C# bindings are generated for efl_loop_timer.eo
Reviewers: zmike, bu5hm4n, devilhorns
Reviewed By: zmike
Subscribers: vitor.sousa, cedric, #committers
Tags: #efl
Maniphest Tasks: T7114
Differential Revision: https://phab.enlightenment.org/D6527
Summary:
Plain conversion to IEnumerable, which is the base of LINQ
Depends on D6189
Reviewers: felipealmeida, vitor.sousa
Reviewed By: vitor.sousa
Subscribers: cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6190
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:
Promise/Future cleanup:
In the promises, we use a wrapper Eina_Promise_Cancel_Cb to
invalidate the wrapper if it ever gets cancelled from outside. When
invalidating from C#, we can do it directly.
For the futures, likewise, in order to be able to invalidate the
wrapper when the chain it belongs to gets resolved we then() an
internal future with a callback to invalidate the wrapper we return to
C#. The return of this intermediate then() is the future we actually
return to the user.
Also added ECANCELED to the list of default eina.Errors
Depends on D6173
Reviewers: felipealmeida
Reviewed By: felipealmeida
Subscribers: cedric, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6174
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
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).
Function pointers now go through the same argument marshalling pipeline
as normal functions.
This will enable interfaces like Efl.Ui.Format to work properly.
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.
Now the generated DllImport call will have the actual library name
instead of placeholders on Linux. Before we relied on dlsym being able
to search for the symbols on all loaded so's while Windows needed you to
specify the correct library to call GetProcAddress.
This fixes the case when someone call an function from an efl interface
defined in efl.so (e.g. efl_part) and the library is not loaded yet.
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.
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>
Summary: Among them, IO interfaces are needed by the new efl.Task.
Test Plan: Run make check
Reviewers: felipealmeida
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D5821
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.
Fix several integer binding type deduction based in its size on C.
Generation for function pointers no longer use modified argument name
which is different from the parameter name.
New generation context for structs.
bool from UnmanagedType.I1 to UnmanagedType.U1 (correct use
inside structs according to mono documentation).
byte (signed char) and int8 now is correctly represented by
sbyte in C#.
Check parameter direction in some out generators in parameter.hh.
Add efl_libs.csv to gitignore.
Make eina.Value pointer constructor public.
Add missing fields to efl.kw_event.Description struct.
Remove eina.File workaround (let struct gen handle it).
Remove is_function_ptr bool from regular_type_def and
add a typedecl_type enum to it. Also add some helper
methods for easier comparison.
Left some test cases commented for when pointer parameters
are properly working.