csharp: Change to new class API.
authorLauro Moura <lauromoura@expertisesolutions.com.br>
Thu, 29 Nov 2018 23:04:37 +0000 (21:04 -0200)
committerHermet Park <hermetpark@gmail.com>
Wed, 5 Dec 2018 05:51:19 +0000 (14:51 +0900)
commit5c1e330ed9bc6e0d52e47d4af6c636e66e35142e
tree62a1c9610e40d85d2806cae5b7f44bc6cc58c5fa
parent8b860b6e1095169de14045a50a8776627ffde214
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
92 files changed:
src/Makefile_Efl_Mono.am
src/bin/eolian_mono/eolian/mono/async_function_definition.hh
src/bin/eolian_mono/eolian/mono/blacklist.hh
src/bin/eolian_mono/eolian/mono/enum_definition.hh
src/bin/eolian_mono/eolian/mono/events.hh
src/bin/eolian_mono/eolian/mono/function_definition.hh
src/bin/eolian_mono/eolian/mono/function_helpers.hh
src/bin/eolian_mono/eolian/mono/function_pointer.hh
src/bin/eolian_mono/eolian/mono/function_registration.hh
src/bin/eolian_mono/eolian/mono/helpers.hh
src/bin/eolian_mono/eolian/mono/klass.hh
src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
src/bin/eolian_mono/eolian/mono/marshall_type.hh
src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
src/bin/eolian_mono/eolian/mono/name_helpers.hh
src/bin/eolian_mono/eolian/mono/parameter.hh
src/bin/eolian_mono/eolian/mono/part_definition.hh
src/bin/eolian_mono/eolian/mono/struct_definition.hh
src/bin/eolian_mono/eolian/mono/type_impl.hh
src/bin/eolian_mono/eolian/mono/using_decl.hh
src/bin/eolian_mono/eolian/mono/utils.hh
src/bin/eolian_mono/eolian_mono.cc
src/bindings/mono/ecore_evas_mono/ecore_evas.cs
src/bindings/mono/efl_mono/efl_all.cs
src/bindings/mono/eina_mono/eina_accessor.cs
src/bindings/mono/eina_mono/eina_array.cs
src/bindings/mono/eina_mono/eina_binbuf.cs
src/bindings/mono/eina_mono/eina_common.cs
src/bindings/mono/eina_mono/eina_config.cs
src/bindings/mono/eina_mono/eina_container_common.cs
src/bindings/mono/eina_mono/eina_error.cs
src/bindings/mono/eina_mono/eina_hash.cs
src/bindings/mono/eina_mono/eina_inarray.cs
src/bindings/mono/eina_mono/eina_inlist.cs
src/bindings/mono/eina_mono/eina_iterator.cs
src/bindings/mono/eina_mono/eina_list.cs
src/bindings/mono/eina_mono/eina_log.cs
src/bindings/mono/eina_mono/eina_promises.cs
src/bindings/mono/eina_mono/eina_slice.cs
src/bindings/mono/eina_mono/eina_strbuf.cs
src/bindings/mono/eina_mono/eina_stringshare.cs
src/bindings/mono/eina_mono/eina_value.cs
src/bindings/mono/eldbus_mono/eldbus_common.cs
src/bindings/mono/eldbus_mono/eldbus_config.cs
src/bindings/mono/eldbus_mono/eldbus_connection.cs
src/bindings/mono/eldbus_mono/eldbus_message.cs
src/bindings/mono/eldbus_mono/eldbus_object.cs
src/bindings/mono/eldbus_mono/eldbus_proxy.cs
src/bindings/mono/eo_mono/iwrapper.cs
src/bindings/mono/eo_mono/workaround.cs
src/examples/ecore.mk
src/examples/ecore/efl_loop_callback_add_event.cs [deleted file]
src/examples/ecore/efl_mono_loop_timer_example.cs [moved from src/examples/ecore/efl_loop_timer_example.cs with 51% similarity]
src/examples/efl_mono/EoInherit01.cs
src/examples/efl_mono/FunctionPointer01.cs
src/examples/eina/EinaArray01.cs
src/examples/eina/EinaBinbuf01.cs
src/examples/eina/EinaError01.cs
src/examples/eina/EinaHash01.cs
src/examples/elementary/efl_ui_slider_mono.cs
src/examples/elementary/efl_ui_unit_converter.cs
src/examples/evas/evas_mono_box.cs
src/examples/evas/evas_mono_image.cs
src/examples/evas/evas_mono_image2.cs
src/examples/evas/evas_mono_rectangle.cs
src/examples/evas/evas_mono_table.cs
src/examples/evas/evas_mono_text.cs
src/lib/eolian_cxx/grammar/klass_def.hpp
src/tests/efl_mono/BasicDirection.cs
src/tests/efl_mono/Eina.cs
src/tests/efl_mono/Eo.cs
src/tests/efl_mono/EoPromises.cs
src/tests/efl_mono/Errors.cs
src/tests/efl_mono/Evas.cs
src/tests/efl_mono/Events.cs
src/tests/efl_mono/FunctionPointerMarshalling.cs
src/tests/efl_mono/FunctionPointers.cs
src/tests/efl_mono/Main.cs
src/tests/efl_mono/Parts.cs
src/tests/efl_mono/Promises.cs
src/tests/efl_mono/Strbuf.cs
src/tests/efl_mono/Strings.cs
src/tests/efl_mono/Structs.cs
src/tests/efl_mono/Value.cs
src/tests/efl_mono/ValueEolian.cs
src/tests/efl_mono/dummy_another_iface.eo [new file with mode: 0644]
src/tests/efl_mono/dummy_child.eo [moved from src/tests/efl_mono/test_child.eo with 66% similarity]
src/tests/efl_mono/dummy_numberwrapper.eo [moved from src/tests/efl_mono/test_numberwrapper.eo with 76% similarity]
src/tests/efl_mono/dummy_test_iface.eo [new file with mode: 0644]
src/tests/efl_mono/dummy_test_object.eo [moved from src/tests/efl_mono/test_testing.eo with 81% similarity]
src/tests/efl_mono/libefl_mono_native_test.c
src/tests/efl_mono/meson.build