Commit Graph

5 Commits

Author SHA1 Message Date
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
Lauro Moura 89a537b4d1 efl-csharp: Add copy constructor for eina.Value.
Summary: This will allow deep copying the given value from C#.

Reviewers: felipealmeida, vitor.sousa, segfaultxavi

Reviewed By: vitor.sousa, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7017
2018-09-11 11:41:38 -03:00
Lauro Moura f8a033fd70 efl_mono: Add support for Eina.Error/Empty in eina.Value
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-17 16:56:11 -03:00
Lauro Moura 3fd1566a08 csharp: Provisionally fix conversion of eina.Value
When we have an eina.Value_Native (representing an Eina_Value passed by
value) and assign it to an eina.Value (a class with an IntPtr to an
underlying Eina_Value) we copy it so the eina.Value can take ownership
and free the data normally.

A possibly better alternative would be adding an extra flag to
eina.Value (something like OwnsPointer) to check whether we should free
the struct we point to or not.
2018-04-03 17:29:41 -03:00
Lauro Moura 345336c46d efl_mono: Added test files for the C# bindings.
Buildsystem integration will come in a future commit.
2017-12-04 15:47:50 -03:00