Commit Graph

709 Commits

Author SHA1 Message Date
Lauro Moura b19953fe3a csharp: Add missing since docs to a bunch of classes.
Summary:
Proper documentation will come in later commits.

ref T8293

Reviewers: woohyun, felipealmeida, segfaultxavi, brunobelo

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10260
2019-10-01 00:10:15 -03:00
Bruno da Silva Belo 5ae7d92a1b csharp: add since 1.23 to eina_accessor.
Summary: updating to  since 1.23.

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10257
2019-09-30 23:23:41 -03:00
Bruno da Silva Belo 33f5167089 mono_docs:adding and updating eina_binbuf.cs.
Summary: Generating docs and setting to 1.23.

Reviewers: lauromoura, felipealmeida

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10252
2019-09-30 23:15:27 -03:00
Bruno da Silva Belo 0194ba8420 mono-docs: adding and updating docs for eina_array.
Summary: Generating docs and setting to 1.23 for eina_array.cs

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10251
2019-09-30 23:13:48 -03:00
Lauro Moura 465b049d5b csharp: Document Eina.List
Summary:
Also added Since 1.23 info

Depends on D10253o

ref T8293

Test Plan: Check docs

Reviewers: segfaultxavi, brunobelo, felipealmeida

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10254
2019-09-30 23:11:53 -03:00
Lauro Moura 74e79b5ae2 csharp: Allow improved cbs in eina comparators
Summary:
Instead of receiving a callback that compares two intptrs (which is
still used internally), expose a more C#-friendly delegate which is
wrapped into the native one.

Test Plan: run test suite

Reviewers: felipealmeida, segfaultxavi, brunobelo

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10253
2019-09-30 23:09:29 -03:00
Lauro Moura 16e21c3314 csharp: Document Eina.Log
Summary: ref T8293

Reviewers: brunobelo, segfaultxavi, felipealmeida

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10255
2019-09-30 23:06:06 -03:00
Lauro Moura 774bc73320 csharp: Add since to Eina.Promise
Summary: ref T8293

Reviewers: segfaultxavi, felipealmeida, brunobelo

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10256
2019-09-30 23:04:34 -03:00
Lauro Moura f3199ba04b eolian-cxx: Release iterators
Summary:
When the iterators advanced, the CXX wrappers null'd them but did not
call eina_value_free.

ref T8280

Reviewers: q66, brunobelo, felipealmeida

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8280

Differential Revision: https://phab.enlightenment.org/D10238
2019-09-30 16:08:24 +02:00
Xavi Artigas 62139f2292 mono-docs: Add some missing docs for workaround.cs
Test Plan: Only docs changed.

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10249
2019-09-30 10:42:36 -03:00
Daniel Kolesa b0ee540ec9 eolian: rename param direction enum and fields for consistency 2019-09-26 16:56:13 +02:00
Daniel Kolesa 6d93dc4cbf eolian: rename event_prefix to event_c_prefix for consistency 2019-09-26 16:47:22 +02:00
Daniel Kolesa 7e10d96d27 eolian: move EOLIAN_TYPE_BUILTIN_HASH into beta section 2019-09-26 16:47:21 +02:00
Cedric Bail 267f8fcfa8 elementary: return an error when unimplemented function on Efl.Ui.Widget_Factory.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10130
2019-09-25 11:31:02 -07:00
Daniel Kolesa 71cd89c580 eolian: expose most API as stable
There is still some TODO with builtin types, parameter
directions and prefixes, which will be resolved in the
next commits.
2019-09-25 18:26:07 +02:00
Lauro Moura 2e7b508312 csharp: Fix wrapping of private classes
Summary:
Sometimes, valid Eo objects of private classes can be returned from
methods. Currently we try to wrap in a minimal `Efl.Object` instance,
but as it is an abstract class, we can't instantiate directly.

This commits adds a dummy `Efl.ObjectRealized` to be instantiated when
wrapping such classes alongside a test case.

Fixes: T8258

Reviewers: felipealmeida, brunobelo, segfaultxavi, Jaehyun_Cho

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10101
2019-09-24 18:00:05 -03:00
Daniel Kolesa 92da64a532 eolian: remove support for globals
This was meant to happen but did not previously happen. It is not
ideal to do it now but better do it while we still can.

In short, this removes one half of the variables API (keeps
constants as they are) and repurposes the API to be only for
constants. This is also better for consistency to match errors.
2019-09-24 18:27:37 +02:00
Lauro Moura 03da60997e cxx: Fix some warnings from -Wextra
Summary:
- As we don't have C++17's [[fallthrough]], rely on GCC'd detection
  of fallthrough comments.

  See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

- Replaced some copy constructors with typecast operators.

  Previously, a constructor with remove_const/remove_cv were used
  to allow const iterators to be constructed from non-const iterators.
  This had the side effect of making these constructors actual copy
  constructors for non const lists. As we did not define other
  special constructors/operators, the rule of 5 were violated for these
  cases.

  This commit replaces these constructors with actual typecast operators
  that promote non const iterators to their const counterparts.

- Cast a Eina_Bool/bool narrowing conversion

- Add a missing break statement from D10050

Reviewers: zmike, brunobelo, felipealmeida

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9934
2019-09-23 13:58:01 -03:00
Jaehyun Cho 01875756eb eolian_mono: add more verbs to generate C# method beginning with verb
Summary:
C# language binding generates C# method name beginning with verb by
checking verb list in name_helpers.hh.

Some verbs used in eo method are missing in the current verb list. So
they are added into the verb list.

In this scheme, there is a problem that some words can be used as a verb
in some methods but they also can be used as a noun in other methods.
(e.g. drag_start as a verb / cursor_word_start as a noun)

So "start" and "scroll" are not added to verb list in this patch.
To resolve the above problem, we may need a new eo syntax to rename or
reverse the name in language bindings.

Test Plan: Check C# method names in .eo.cs files if the name begins with verb.

Reviewers: felipealmeida, SanghyeonLee, woohyun, Jaehyun_Cho, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10001
2019-09-20 19:29:08 -03:00
Daniel Kolesa 53a3326ddc eolian: rename any_value_ptr -> any_value_ref for consistency 2019-09-20 18:03:39 +02:00
Mike Blumenkrantz 9dc7643f93 Revert "cxx: Fix some warnings from -Wextra"
This reverts commit bdb8505f3b.

more review pending on this
2019-09-16 14:19:43 -04:00
Lauro Moura bdb8505f3b cxx: Fix some warnings from -Wextra
Summary:
- As we don't have C++17's [[fallthrough]], rely on GCC'd detection
  of fallthrough comments.

See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

- Add some missing copy assignment operators as reported by
  -Wdeprecated-copy

- Cast a Eina_Bool/bool narrowing conversion

Reviewers: zmike, brunobelo, felipealmeida

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9934
2019-09-16 12:41:37 -04:00
Daniel Kolesa d9594dbc9d eolian: drop @ctor_param and the associated APIs
This has been unused for a while, and has been just lingering
around the code, so drop it so it doesn't make it into a release.
2019-09-16 15:37:04 +02:00
Lauro Moura e973b87bf8 csharp: Fix Hash.DelByValue
Summary:
The C function `eina_hash_del_by_data` requires the same value that was
passed to the `add` function. As C# hashes store stuff through pointers
due to marshalling, this makes it hard to pass the same pointer for it.

So this functionality is implemented at C# level instead of relying on
the native function directly.

Fixes T8198

Thanks to @brunobelo and @singh.amitesh for the test case.

Reviewers: singh.amitesh, felipealmeida, brunobelo

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers, singh.amitesh, brunobelo

Tags: #efl

Maniphest Tasks: T8198

Differential Revision: https://phab.enlightenment.org/D9853
2019-09-13 19:22:39 -03:00
Bruno da Silva Belo c681b3a1b3 csharp: Registering events when using Components.Basic.
Summary:
With `Components.Basic`, it isn't registering events,
while `Components.Ui` do with `elm_init`

Fixes T7770
Thanks @lauromoura

Test Plan: Look T7770

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, brunobelo, felipealmeida, #reviewers, lauromoura, #committers

Tags: #efl

Maniphest Tasks: T7770

Differential Revision: https://phab.enlightenment.org/D9909
2019-09-11 17:30:19 -03:00
Yeongjong Lee d7006f6a09 csharp: remove unused delegate and struct
Summary: cleanup workaround.cs

Test Plan: ninja test

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9895
2019-09-10 23:45:34 -03:00
Lauro Moura dfb856158c csharp: Skip non-public members from interfaces
Summary:
Eolian allows non-public members in interfaces and mixins (usually
@protected). As both kinds are converted to C# interfaces, this
causes problem as non-public members are forbidden in C# interfaces.

This commit changes eolian_mono by removing those members from the C#
interfaces. If a generated class implements the interface, the method is
generated as if it were a protected member of the class directly.

For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`,
the interface has only the public getter and the the implementing class has both
the public getter and the protected setter.

With this, C# devs won't be able to directly implement protected Eo
methods from interfaces. (But this really does not make sense from the
C# point of view).

ref T7494

Reviewers: segfaultxavi, felipealmeida, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers

Tags: #efl

Maniphest Tasks: T7494

Differential Revision: https://phab.enlightenment.org/D9800
2019-09-10 19:30:47 -03:00
Bruno da Silva Belo 50a1572c09 csharp: Adding ToString methods to Strbuf and custommarshaler.
Summary:
WIN32 should use a allocator and deallocator different from EFL, sometimes, when
freeing a pointer, it should use win32_free. To stardardize, A custommarshaler
is used to fix this problem.

Fixes T8201

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, brunobelo, felipealmeida, #reviewers, lauromoura, #committers

Tags: #efl

Maniphest Tasks: T8201

Differential Revision: https://phab.enlightenment.org/D9842
2019-09-10 17:42:19 -03:00
Daniel Kolesa 267c57d0f1 eolian: remove second parameter for eolian_type_c_type_get
This has been replaced by newer APIs.
2019-09-09 18:26:49 +02:00
Yeongjong Lee f4d9188ca7 eolian_mono: remove redundant code in NativeMethods
Summary:
Duplicated interface's NativeMethods code will be removed. they are called in
`GetInterfaces`.

Size of efl_mono.dll
6,587,392 bytes(6.6MB) -> 4,112,384 bytes (4.1MB)

Test Plan: ninja test

Reviewers: felipealmeida, lauromoura, vitor.sousa

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, woohyun, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9752
2019-09-08 22:14:21 -03:00
Bruno da Silva Belo b36e159d31 eolian-mono: Removing I prefix from classes.
Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, brunobelo, felipealmeida, #reviewers, lauromoura, #committers

Tags: #efl

Maniphest Tasks: T8166

Differential Revision: https://phab.enlightenment.org/D9816
2019-09-06 16:06:09 +02:00
Bruno da Silva Belo 353524e1b8 eolian-mono: Renaming suffix for event and event args
Summary: suffix _Args to Args, Evt to Event

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: Jaehyun_Cho, woohyun, segfaultxavi, cedric, felipealmeida, #reviewers, lauromoura, #committers

Tags: #refactoring, PHID-PROJ-uhnmnvlvunw6jgoqdnd4, #efl_language_bindings

Maniphest Tasks: T8164, T8163

Differential Revision: https://phab.enlightenment.org/D9692
2019-09-06 15:55:17 +02:00
Daniel Kolesa 6751f011c1 eolian: remove the expression eval_type API
This is unnecessary because for all contexts where type is
relevant the validator already makes sure the type and expression
match correctly, so you don't ever need to re-validate it. If you
are doing a generic case and are not sure, just use MASK_ALL.
2019-09-04 18:02:47 +02:00
Daniel Kolesa b530670058 elua: remove old is_owned api bindings 2019-09-02 15:24:14 +02:00
Jaehyun Cho 595a0c0b2f Revert "eolian_mono: remove underscore of Evt_Args"
This reverts commit ac99e2ac94.

This patch is reverted because D9692 covers this patch.
2019-09-02 21:41:20 +09:00
Jaehyun Cho b7bab9aa8e csharp: add SetKeyValue and GetKeyValue to EoWrapper
Summary:
SetKeyValue adds a value object associated with a key object to hash
table.
GetKeyValue returns a value object associated with a key object from
hash table.

Reviewers: felipealmeida, lauromoura, vitor.sousa, woohyun, cedric

Subscribers: zmike, bu5hm4n, segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9622
2019-09-02 21:35:23 +09:00
Jaehyun Cho ac99e2ac94 eolian_mono: remove underscore of Evt_Args
Since C# does not use underscore in type name, the underscore of
Evt_Args is removed.
2019-09-02 21:14:44 +09:00
Daniel Kolesa 7ef3c112d4 elua: add eolian bindings for type_is_move 2019-08-31 02:14:04 +02:00
Daniel Kolesa 37e5befd6b elua: expose new tags via eolian bindings 2019-08-30 17:14:09 +02:00
Lauro Moura 7291c684fb csharp: Fix factory inheritance.
Summary:
C#'s factory must inherit from `LayoutFactory` so we can access its
implementation of `FactoryBind`.

Depends on D9759 to avoid test failure on PropertyBound events.

Reviewers: felipealmeida, cedric, SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9760
2019-08-30 15:08:53 +09:00
Yeongjong Lee 17b0a2634c csharp: add legacy eo in mono blacklist
Summary: It is unnecessary to generate cs file of legacy class.

Test Plan: meson setup -Dbindings=mono,cxx

Reviewers: felipealmeida, lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9638
2019-08-23 14:33:20 -03:00
Felipe Magno de Almeida 2f0a20b688 eolian-mono: Add support for partial classes
Summary:
Add the -p command to eolian to create a class as a partial
class. Create a list in meson build of Eolian files that should be
built with partial classes.

This allows creating more specific method overloads for C#, manually,
by generating the class as partial and adding in manual binding the
partial class with the new methods and properties.

T8034

Reviewers: segfaultxavi, lauromoura, woohyun, Jaehyun_Cho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9690
2019-08-23 14:28:00 -03:00
Lauro Moura f3d9238e15 csharp: Add bindable factory parts support
Summary:
This commit makes parts that implement `Efl.IContent` use BindFactory
instead of property binding.

```
var factory = new Efl.Ui.ItemFactory<Efl.Ui.ListDefaultItem>();
var iconFactory = new Efl.Ui.ImageFactory(null);
iconFactory.PropertyBind("filename", "modelProperty");
factory.IconPart().BindFactory(iconFactory);
```

Fixes T7628

Reviewers: cedric, felipealmeida, SanghyeonLee

Reviewed By: felipealmeida

Tags: #efl

Maniphest Tasks: T7628

Differential Revision: https://phab.enlightenment.org/D9653
2019-08-23 14:17:44 -03:00
Lauro Moura cc49c1034b csharp: MVVM parts support
Summary:
Parts binding will follow a similar approach to regular property
binding:

`var error = factory.PartName().PropertyName().Bind(modelProperty);`

* Changed both `Bind()` overloads to return the error code from
  `efl_ui_property_bind`
* Also properties from interfaces implemented didn't have their `Bindable`
  wrapper methds available.

Depends on D9563

Reviewers: felipealmeida, cedric, SanghyeonLee, woohyun

Reviewed By: cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9564
2019-08-19 21:41:29 -03:00
Daniel Kolesa 2f147f2725 eolian: rename is_class api for functions to is_static
Still needs restriction to classes only etc to be done later.

Ref https://phab.enlightenment.org/T8118
Ref https://phab.enlightenment.org/T7675
2019-08-16 16:33:37 +02:00
Vitor Sousa c1b76d3008 csharp: fix ownership of value types in arrays and lists
Summary:
`eolian_mono` now considers the implicit ownership of value types in arrays and
lists when generating ownership flags.

Also, update manual bindings for arrays and lists to no longer free elements
in the `Dispose` method when the container has ownership of the elements
but C# itself does not have ownership of the container; the elements will be
freed by whoever owns the container.
Modifying and removing elements will still free them though.

Re-enabled unit tests that required ownership of value type elements.

Reviewers: felipealmeida, q66, vitor.sousa

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9457
2019-08-05 19:15:35 -03:00
Lauro Moura 40def3eac9 efl-mono: Add Model manual implementation to C# and MVVM factories
Summary: Depends on D9273, D9270

Test Plan: Run added testcases.

Reviewers: cedric, bu5hm4n, zmike, SanghyeonLee, felipealmeida, segfaultxavi

Reviewed By: cedric

Subscribers: cedric

Tags: #expertise_solutions, #efl_language_bindings

Differential Revision: https://phab.enlightenment.org/D8080
2019-08-05 10:18:18 -04:00
Daniel Kolesa 1c5fa59ee8 eolian: remove __builtin_free_cb
This has long been unused. If we need to replace this eventually,
it should be done correctly.
2019-08-01 16:55:31 +02:00
Felipe Magno de Almeida dccd68491c eolian-cxx: Generate eot files
Summary:
Eolian Type files were not being generated, which made some template
specialization to not be defined, for example for function_wrappers.

Reviewers: bu5hm4n, woohyun, lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9468
2019-07-31 18:38:02 -03:00
Lauro Moura 29d24aa409 csharp: Add marshal support for Eina.ValueType
Summary:
It uses a custom marshaler and a helper boxing class to convert between
the managed enum values and the native Eina_Value_Type pointers.

To be used by future MVVM machinery.

Reviewers: vitor.sousa, felipealmeida

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9443
2019-07-30 11:47:07 -03:00
Yeongjong Lee 41aa680c85 efl_mono: update docs of CreateWrapperFor
Reviewers: lauromoura, felipealmeida, segfaultxavi, vitor.sousa

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9084
2019-07-26 20:51:46 +02:00
Vitor Sousa 8d1bd770df csharp: fix EFL# by updating it to reflect the newest changes in Eolian
Summary:
`Efl.Event` became a builtin type that is no longer declared in `efl_object.eo`,
and therefore it is no longer automatically generated in EFL#.
Given that, we define a struct manually to reflect the memory layout of the
native struct.

Containers of value types are now allowed in eolian, so tests that were disabled
because of the restriction on `ptr` were re-enabled using the plain type.

But since these containers have just arrived, handling of ownership for value
types is currently undefined in bindings.
Hence, tests that used `ptr(int) @owned` as elements were left disable.
This will be solved in a future patch.

`void_pr` is now deprecated, so we remove it from tests also.

Reviewers: q66, segfaultxavi, lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9417
2019-07-26 15:47:33 -03:00
Vitor Sousa f331d1c6cc cxx: remove a compilation warning for g++ 7.x
Remove a compilation warning about an unsupported warning category for g++ 7.x.

A `#pragma` directive was used to suppress a `-Wcast-function-type` warning
in g++.
Versions older than 8.x do not have this warning category and raises a warning
because of this directive.

Now this directive is only enabled for g++ version 8.x or newer.
2019-07-17 19:32:32 -03:00
Daniel Kolesa fbdbf6b132 eolian: add builtin binbuf and event types
Binbuf is like strbuf and allows not using the Eina opaque wrapper
now, which will remove some ptr(). And event translates to
Efl.Event because otherwise there would be no way to get rid
of void_ptr.
2019-07-17 15:52:39 +02:00
Vitor Sousa b1e44484a5 cxx: remove compilation warnings in C++ code, from both gcc and clang
Summary:
Remove almost all the compilation warnings from C++ code. Only explicit
warnings using the `#warning` preprocessor directive remain.

Some warnings had to be suppressed with `#pragma` directives because the
behavior they were warning about is intended in some specific places.
Code comments were added in such situations.

Added a generator that creates `#pragma` directives in order to suppress
warnings in all generated C++ headers.
Currently `-Wignored-qualifiers` is the only warning category being suppressed.
The innocuous const qualifiers that it points are inoffensive and have
no effect in compilation at all.
They are also hard to track in generation since they can emerge from different
types in many places.

To ease the generation of the warning suppressors an utility constructor was
added to `efl::eolian::grammar::attributes::unused_type`.

Add constructors to `eolian_mono::class_context` to default initialize its
internal string and avoid field initialization warnings.

Test Plan: `meson test`

Reviewers: lauromoura, felipealmeida, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl_language_bindings

Differential Revision: https://phab.enlightenment.org/D9275
2019-07-12 09:07:27 -04:00
Lauro Moura 3b5d050353 csharp: Enable conversion of container Eina.Values
Summary:
When creating a new Value with any IEnumerable of a supported type, the IEnumerable
will be copied into an Eina.Value of type EINA_VALUE_ARRAY_TYPE.

Similarly, `Unwrap()` on a Eina.Value container will create a new
System.Collections.List<T> and return it.

Depends on D9272

Reviewers: felipealmeida, vitor.sousa, segfaultxavi

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl, #expertise_solutions

Differential Revision: https://phab.enlightenment.org/D9273
2019-07-11 15:57:32 -03:00
Lauro Moura 6be38caeae csharp: Add helpers to get/set Values from Objects
Summary:
The user can construct an `Eina.Value` from a plain C# `object`, using
reflection to get the correct type of object and construct the correct
underlying C value.

Also added the `Unwrap()` method to return a C# object representing the
wrapped value.

Both operations are useful when using `Eina.Value` to
Get/Set values from `PropertyInfo` targets as in

```
var v = new Eina.Value(propInfo.GetValue(sourceObj));
...
propInfo.SetValue(targetObj, v.Unwrap());
```

Currently, containers are not supported. It will be added in a following
commit.

Depends on D9270

Reviewers: felipealmeida, vitor.sousa, segfaultxavi

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9272
2019-07-11 15:55:04 -03:00
Lauro Moura a19bb21edf csharp: Tag exported API items.
Summary:
Attributes to be used by the API export tool. For end users, no changes
in the public API (except for a new attribute in generated classes).

Also simplifies constructor forwarding by not needing to pass the type
of the first "generated" class to compare.

Currently only automatically generated items are tagged.

Depends: D9259

Reviewers: vitor.sousa, felipealmeida

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9270
2019-07-11 15:51:38 -03:00
Xavi Artigas 3f42180611 efl-mono: Treat Warnings as Errors
Now that there are 0 documentation warnings, let's make sure we stay this way.
2019-07-09 10:40:21 +02:00
Vitor Sousa ec501a6623 csharp: fix some build warnings related with incorrect and missing documentation
Summary:
Some parameter names, tag names and cref identifiers in the documentation were
incorrect and causing warnings during compilation.
There were also warnings related with missing documentation in publicly
visible elements in the manual binding.

This commit fixes these incorrections and adds documentation to the manual
binding in order to solve these compilation warnings.

Warnings related with missing documentation in `.eo` files are still present.

Test Plan: Just compile with mono binding.

Reviewers: lauromoura, felipealmeida, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9243
2019-07-08 17:20:08 +02:00
Daniel Kolesa 61f39eef49 eolian: remove API to get freefunc of type
This is not supported anymore. For now, the syntax is kept
around because of broken C++ tests, but afterwards it will
also be removed.
2019-07-08 16:06:42 +02:00
Daniel Kolesa 9c249d0467 elua: add error api into eolian bindings 2019-07-08 16:06:42 +02:00
Lauro Moura 00a1a203a5 csharp: Fix Future callback lifetime
Assigning a method directly to a field expecting a delegate creates a
delegate on the fly. This delegate can be collected normally as any
collectable object. In dotnet the GC is more aggressive, causing this
delegate to be collected and C trying to call an invalid function.

To avoid this, we create a static delegate that will be passed to C. Its
lifetime will be tied to the static method it wraps.
2019-07-05 09:57:23 +09:00
Vitor Sousa 73df0d47ff csharp: encapsulate some internal code of EoWrapper
Summary:
Encapsulate some parts of EoWrapper making them less accessible to lib users.
This can avoid unnecessary and risky usage of code that is only intended for
internal usage.

`inherited` field was made private and renamed to `generated`. Now its value
can only be obtained through the `IsGeneratedBindingClass` property.

`handle` field was made private.

`eventLock` was renamed to `eflBindingEventLock`

`ConstructingHandle` property set was made private.

Constructors that are used to create new EFL# managed objects by wrapping a
preexisting eo handle now receive a specific struct wrapping the handle pointer.
This can avoid faulty interactions with the Reflection engine used only for
generated classes that implement this constructor.

Test Plan: meson test

Reviewers: lauromoura, felipealmeida, YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9212
2019-07-05 09:57:23 +09:00
Vitor Sousa 229b363f01 csharp: fix some compilation warnings
Fix unused variable warnings in eina_mono and unit test files.
2019-06-28 10:58:24 -03:00
Vitor Sousa 4496022a3c csharp: fix Eina_Stringshare support in containers for manual and generated API
Summary:
Both C strings and eina stringshares are bound as regular strings in EFL#, as
working directly with these types would demand unnecessary hassle from the user
viewpoint.
But for eina containers this distinction is important, and since C# generics
do not provide a convenient way of dealing with the same type requiring a
different management based on some other condition (at least not without
compromising the usability for other types), we added a simple `System.String`
wrapper named `Eina.Stringshare` that works as a placeholder for signaling
this distinction.

Working with this class should be transparent in most use cases because it
converts to and from `System.String` implicitly.
It also implements equality/inequality methods for easier comparison with
strings and other stringshare objects.

Add new methods and a new container element trait for dealing specifically
with `Eina_Stringshare` elements.

Adapt eolian_mono to identify and generate the proper placeholder in methods
that require stringshare containers.

Remove some direct uses of DllImport-ed functions in favor of more flexible
manual binding methods.

Move `Eina.Stringshare` DllImport directives to a static class named
`NativeMethods`, in accordance with the code design warning CA1060.
Also add a TODO comment to move all other DllImport directives to this class.

Change parameter of the method `Efl.Csharp.Application.OnInitialize` from
`Eina.Array<System.String>` to `string[]`.
This will make this API more similar with the default C# way of receiving
command line arguments.

Add tests for containers storing stringshare elements.

Reviewers: felipealmeida, lauromoura, segfaultxavi, bu5hm4n

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9178
2019-06-28 10:44:52 -03:00
Vitor Sousa b7fa7d48ac csharp: make inherited C# classes constructible from native C
Summary:
With this commit it is now possible for a class that inherits from a C# binding
class to be instantiated from native C code. It only has to provide a
constructor that receives an `Efl.Eo.EoWrapper.ConstructingHandle` struct,
and which calls the base binding constructor passing it.
For example:

`private Type(ConstructingHandle ch) : base(ch) {}`.

Add some test files to validate the proper behavior of this feature.

Add some small fixes in generation contexts in order to properly
generate base constructors.

Depends on D9070

Test Plan: `meson test` and `make check`

Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun, YOhoho

Reviewed By: YOhoho

Subscribers: YOhoho, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9071
2019-06-28 10:38:57 -03:00
Lauro Moura ef185e5e28 efl-mono: Fix value forwarding in promises/async
Summary:
Values returned from C# Then callbacks must release ownership of the
underlying native value, so Eina code can clean it up nicely and avoid
the Wrapper flushing it early.

The same issue applied to the Async wrappers. In this case the value
passed as the Task parameter could be released by an `using` block
awaiting the value.

Also Future creation was then-ing the wrong handle.

Also add better exception messages.

Reviewers: vitor.sousa, felipealmeida

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9197
2019-06-27 19:31:55 -03:00
Lauro Moura accaaa1ff7 csharp: Add missing prefix to enable interpolation
Reviewers: vitor.sousa

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl, #expertise_solutions

Differential Revision: https://phab.enlightenment.org/D9195
2019-06-27 19:24:41 -03:00
Lauro Moura 967e32d27a csharp: Update after iterator changes
Summary:
Iterator and Accessors are views only, not owning the data they point
to.

Also updated the tests by handling some test data that were leaking.

Fixes T8036

Reviewers: vitor.sousa, felipealmeida

Reviewed By: vitor.sousa

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

Tags: #efl

Maniphest Tasks: T8036

Differential Revision: https://phab.enlightenment.org/D9189
2019-06-27 14:07:33 -03:00
Felipe Magno de Almeida 907bdad065 efl-mono: Add object type support for Eina.Value
Summary:
C# `Eina.Value` now has builtin support for `EINA_VALUE_TYPE_OBJECT`.

To avoid ambiguity with the `Set` method overloads, explicit casting
operators were used for wrapping/unwrapping `Efl.Object` instead of
implicit ones like for other value types.

Thus, to initialize an `Eina.Value` from an object, you can use the
following:

`var v = (Eina.Value)myObj;`

Reviewers: felipealmeida, vitor.sousa, segfaultxavi, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9164
2019-06-25 19:11:23 +09:00
Yeongjong Lee e712261e14 efl_mono: support multilevel inheritance of NativeClass
Summary:
When it creates multilevel class of NativeClass, internal c function is not
called because eo vtables aren't created

Test Plan:
Check "MyBox2 UpdateLayout" printed.
```
//mcs test_box.cs -out:test_box.exe `pkg-config --libs efl-mono`
//mono test_box.exe
using System;

public class MyBox2 : MyBox
{
   public MyBox2(Efl.Object parent, string style = null) : base(parent, style)
   {
   }
   public override void UpdateLayout()
   {
       Eina.Log.Error("MyBox2 UpdateLayout");
       base.UpdateLayout();
   }
}

public class MyBox : Efl.Ui.Box
{
   public MyBox(Efl.Object parent, string style = null) : base(parent, style)
   {
   }
   public override void UpdateLayout()
   {
       Eina.Log.Error("MyBox UpdateLayout");
       base.UpdateLayout();
   }
}

public class Example : Efl.Csharp.Application
{
    protected override void OnInitialize(Eina.Array<System.String> args)
    {
        Efl.Ui.Win win = new Efl.Ui.Win(Efl.App.AppMain);

        var box = new MyBox(win);
        box.SetHintSizeMin(new Eina.Size2D(360, 240));
        win.SetContent(box);

        var box2 = new MyBox2(win);
        box2.SetHintSizeMin(new Eina.Size2D(360, 240));
        box2.Pack(box);

        var button = new Efl.Ui.Button(box);
        button.SetText("Click");
        button.ClickedEvt += (object sender, Efl.Ui.IClickableClickedEvt_Args e) =>
        {
           box.CalculateGroup();
           box2.CalculateGroup();
        };
        box.Pack(button);
    }

    public static void Main()
    {
        var example = new Example();
        example.Launch();
    }
}
```

Reviewers: segfaultxavi, vitor.sousa, felipealmeida, lauromoura, woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9079
2019-06-19 15:59:54 +09:00
Lauro Moura d83d89e882 csharp: Do some iterations on exit.
So we can kinda properly clean up things before shutting down.
2019-05-31 18:01:04 -03:00
Vitor Sousa fcf5f1d2e2 csharp: Refactor wrapper lifetime.
Summary:
This commit makes use of the `ownership,shared` and `ownership,unique`
events from Efl.Object in order to avoid the C# wrapper from being
collected while C code holds a reference to the object.

For example, creating a list of items in a for loop and attaching events to
them would fails without this commit, as the C# GC may collect the wrapper.

The basic idea is that we use a `WrapperSupervisor`, which is stored in
the Eo data storage, with a GCHandle allocated for the lifetime of the
underlying Eo object. This supervisor takes care of holding either a
weak C# reference (when in unique mode, allowing the wrapper to be GC'd)
or a hard C# reference (when in shared mode, making the wrapper
non-collectable while the Eo has extra references).

One limitation is that object graphs can leak if a shared object in the
graph - an Eo child for example - stores a hard reference to another
object in the graph as a C# field. In this example, this causes the
parent to always have a hard C# reference (from the child) as the child
is non-collectable due to the parent holding an Eo reference to it.

Depends on D8678

Test Plan: `ninja test` and `make test`

Reviewers: lauromoura, felipealmeida, woohyun, segfaultxavi

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9014
2019-05-31 17:44:12 -03:00
Daniel Kolesa 223c0a0fdc eolian: add runtime API to get file format version
This is useful for FFI based bindings (like the Lua or Python ones)
and so on.
2019-05-26 18:35:48 +02:00
Daniel Kolesa 891396897b elua: add version_get API for units in eolian bindings 2019-05-26 18:21:27 +02:00
Daniel Kolesa 13ddc5dbc1 eolian: rename @warn_unused and its associated API
@warn_unused in syntax is now called @no_unused - this is because
"warning about unused" is a C thing (or rather, an extension to C)
and various languages might want to use stricter behavior for this.

Its associated API does the reverse now - it lets you query whether
being unused is allowed at all. This is to match future behavior
of Eolian (once it supports versioning) that will likely reverse it.

@feature
2019-05-26 17:41:22 +02:00
Daniel Kolesa d0fed247bb eolian: remove param @nonull
This has been deprecated for a while and is not strictly necessary
- as a part of an effort to stabilize Eolian, remove this. Eolian
will eventually gain support for versioning and use a reversed
behavior (i.e. no NULL by default), but the API it wlll use for
that will be very different. Features can always be added, it's
much harder to drop them.

@feature
2019-05-26 17:25:15 +02:00
Daniel Kolesa 5ea0195661 eolian: remove @nullable keyword
This was an experiment that never properly took off and was never
used by any generator. Its use was highly variable, so it could
not be relied upon. We will still want to reverse the current
behavior eventually (no null by default), but that will be
done with eo file versioning in the future.

@feature
2019-05-21 16:04:35 +02:00
Jaehyun Cho a55777c925 efl_mono: generate efl_canvas_text.eo.cs
To use canvas text in efl csharp bindings, it is permitted to generate
efl_canvas_text.eo.cs.
2019-05-17 19:54:48 +09:00
Daniel Kolesa e5c9f5e76f eolian: rename eolian_event_c_name_get
This is for consistency with the new eolian_class_c_macro_get
as well as for better clarity, as c_name_get is already provided
by Object and refers to something else.
2019-05-16 15:57:39 +02:00
Daniel Kolesa b3a870c7bb eolian: rename eolian_typedecl_enum_field_c_name_get
This is to allow for better object oriented APIs, as the `c_name`
field would be inherited from Object. This also makes it more
clear in C.
2019-05-16 15:52:46 +02:00
Daniel Kolesa 4ab1f2388e eolian: add API to retrieve the C name of an object
This is to prepare for type/class renaming support. This adds
the necessary API to retrieve C-specific names. Other refactoring
is necessary elsewhere for now.

This also renames the old API eolian_class_c_name_get to
eolian_class_c_macro_get to avoid conflict as well as clarify
the intention.
2019-05-16 15:43:52 +02:00
Xavi Artigas 7f907ecd9d efl-mono: Use Efl.Ui.Win API instead of Elm.Policy
Summary:
This removes another bit of legacy API from the C# bindings.
This also reverts "elm: Put back Policy and Policy_Quit in EO files"
(a9132a9a66) so that these two Elm enums are
definitely out of the EO files.

Test Plan:
Everything, including mono bindings, continue to build.
At runtime, C# apps still exit when all windows are closed.

Reviewers: lauromoura, vitor.sousa, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8890
2019-05-14 14:33:21 +02:00
Jaehyun Cho 9d28d91626 efl_mono: generate efl_canvas_vg_object.eo.cs by meson
This commit is the same as 0e8f289d7d
but this commit is for meson.

To use vector graphics in efl csharp bindings, it is permitted to
generate efl_canvas_vg_object.eo.cs.

Other efl_canvas_vg .eo.cs files have already been generated because the
file names were changed from efl_vg to efl_canvas_vg.
2019-05-13 13:30:14 +09:00
Jaehyun Cho ecce35c555 efl_mono: move libeflcustomexportsmono.so to lib with versions by meson
meson generates libeflcustomexportsmono.so to lib/efl-mono-1/ directory
unlike other so files.
Moreover, the so file does not have versions in the file name unlike
other so files.

Like other so files, libeflcustomexportsmono.so is moved to lib
directory with versions in the file name.
2019-05-13 13:30:08 +09:00
Daniel Kolesa db57523e78 eolian: refactor parsing API and path handling
This splits the eolian_file_parse API into two, one for parsing
files already present in the database (always by filename) and
one for parsing paths.

It fixes several bugs/leaks on the way (incorrect use of
stringshare etc.) as well as adds checking for whether there
are no conflicting filenames at scan time, for free. That means
it is now no longer possible to scan two paths which have an eo
or eot file of the same name in them.

It should also be faster now.

It also fixes T7820.

@fix
2019-05-03 17:06:49 +02:00
Jaehyun Cho 588dc4d0af efl_mono: fix to load libevas.so based on efl.Libs.Evas
libevas.so is loaded based on efl.Libs.Evas in efl_libs.cs.
Therefore, the hard coded string "evas" is replaced with efl.Libs.Evas.
2019-05-03 16:45:15 +09:00
Lauro Moura e38fc2264c cxx: Rename Elementary.hh into Efl_Ui.hh
Also include Efl_Ui.h alongside Elementary.h (the latter is still needed
by some widgets).
2019-05-02 21:00:57 +02:00
Marcel Hollerbach e881f936e8 meson: unbreak cxx header installation
Summary:
before we had *correct* fileds in the subdir: keyword. However,
install_dir: was wrong, so *this* time, this seems right.

Reviewers: cedric, zmike, segfaultxavi, raster

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8634
2019-04-18 12:30:22 -04:00
Lauro Moura cacbd9e58d cxx: Fix eldbus meta include name
Summary:
It should not conflict with Eldbus_Model header

Fixes T7805

Reviewers: vtorri

Reviewed By: vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7805

Differential Revision: https://phab.enlightenment.org/D8611
2019-04-15 19:20:10 -03:00
Lauro Moura b6529a65c6 csharp: Rename MarshalTest to MarshalEo
Summary: To better reflect its intent

Reviewers: segfaultxavi, vitor.sousa, felipealmeida

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8607
2019-04-15 15:36:22 -03:00
Lauro Moura d775b58a63 csharp: Fix free_cb calling under dotnet.
Summary:
dotnet's GC seems to be more agressive, showing some issues that usually
do not appear when running under Mono's.

This commit uses for free_cb's the same scheme we already use for
regular Eo refs, using a GC handle to keep the cleaning callback alive.

Reviewers: vitor.sousa, felipealmeida, woohyun

Reviewed By: vitor.sousa

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8593
2019-04-15 15:24:29 -03:00
Daniel Kolesa 37eee70d56 elua: add all missing eolian api bindings 2019-04-12 15:53:26 +02:00
Xavi Artigas 04a41a3712 mono-docs: Allow embedding external examples
Summary:
New option added to eolian_gen: -e <dir>
This specifies a directory to search for examples. If a file is found with the
same name as an EFL C# class (e.g. Efl.Ui.Button.cs) or as an EFL C# method or
property (e.g. Efl.IText.Text.cs, Efl.IText.SetText.cs) its full
contents will be embedded in the documentation for that class or method within
<example> and <code> tags. This is, in turn, is parsed by DocFX and shown
in Example boxes in the generated pages.
If an example file is not found, no examples are embedded for that object.
If -e is not used, no examples are embedded for any object.

New option added to meson: mono-examples-dir to point to the examples directory.
This directory is then passed to eolian_mono through -e.
Do not use it (or define it to nothing) to disable example embedding.

No performance drop has been observed because of these extra tests.

Right now examples can only be given for base classes, not for derived ones
(i.e. Efl.IText.Text but not Efl.Ui.Button.Text). This will be addressed in a
later commit.

Feature
Depends on D8587

Test Plan:
Create an examples folder and put some files in it:
```
mkdir /tmp/examples
echo 'var button = new Efl.Ui.Button();' > /tmp/examples/Efl.Ui.Button.cs
echo 'button.AutoRepeatEnabled = true;' > /tmp/examples/Efl.Ui.IAutorepeat.AutorepeatEnabled.cs
echo 'button.SetAutoRepeatEnabled(true);' > /tmp/examples/Efl.Ui.IAutorepeat.SetAutorepeatEnabled.cs
```
Configure meson to embed examples and build:
```
meson configure -Dmono-examples-dir=/tmp/examples
ninja
```
Examine the generated efl_ui_button.eo.cs file to see embedded <example> tags,
or run DocFX and bask in the glory of documentation pages with examples:
```
cd doc/docfx
./gendoc.sh
```

Reviewers: lauromoura, felipealmeida, vitor.sousa, zmike, bu5hm4n

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8592
2019-04-11 10:39:09 +02:00
Lauro Moura feaf0e9299 csharp: Fix GetUserMethods and NativeClass
Summary:
- Should only search for methods locally.
- dotnet requires passing false to GetAttributes
- Also added a check when the class overrides no Eo ops.

Reviewers: felipealmeida, vitor.sousa, woohyun

Reviewed By: felipealmeida, vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8588
2019-04-10 15:12:47 -03:00
Felipe Magno de Almeida 0afd19ba62 efl-mono: Add test and fix problem with private dynamic types passed as parameters
Summary:
The code that searches the type dynamically fails instead of falling
back to Efl.Object. Now it fallbacks to Efl.Object.

Fixes T7783

Reviewers: bu5hm4n, vitor.sousa, segfaultxavi, woohyun, Jaehyun_Cho, YOhoho, lauromoura

Reviewed By: vitor.sousa, lauromoura

Subscribers: lauromoura, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7783

Differential Revision: https://phab.enlightenment.org/D8574
2019-04-09 18:40:00 -03:00
Lauro Moura e7e1d777f1 csharp: Add some null checks.
Summary:
- Check for nullness when getting stuff from C# to C
- We should return null when wrapping a NULL pointer instead of throwing
  an exception

Reviewers: felipealmeida, vitor.sousa, woohyun

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8580
2019-04-09 16:26:50 -03:00
Felipe Magno de Almeida df3b28b0ab efl-mono: Make override of methods only for methods that are defined by the user
Summary:
Instead of overriding every method and making the callback to C, we
just override the methods that are found by reflection on the type.

Reviewers: bu5hm4n, vitor.sousa, segfaultxavi, woohyun, Jaehyun_Cho, YOhoho, lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8579
2019-04-09 11:18:10 -03:00
Vitor Sousa 7c28762f15 efl-csharp: fix crash when events trigger after C# object `Dispose`
Summary:
Rework general event handling to check individually each event call, if the
object is not alive then the event will not be propagated.
WeakReferences (and lambdas capturing those WeakRefs) are used to ensure this.

Dispose methods in object now take care of checking if efl libraries are still
initialized and thread-safely unregister each event before performing an
efl_unref on the Eo object.

Event handling in C# is now centered around a single dictionary inside the
object: `EoEvents`.

C# event triggers now properly trigger events on C too.

Standardize C# event-triggering methods names (remove underscores).

Some diminished use of static memory due events no longer requiring static key
objects to be registered/unregistered.

Some fixing of white space generation for generated events.

Depends on D8431

Reviewers: lauromoura, felipealmeida, segfaultxavi

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8564
2019-04-05 19:59:47 -03:00