Commit Graph

124 Commits

Author SHA1 Message Date
Elyes HAOUAS 2c8baa76f1 Fix typos - (Part #3)
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12017
2020-07-06 10:52:51 +02:00
Lucas Cavalcante de Sousa 117450e3fa C#: Update C# code-generation to use a new ICustomMarshaler in some string usages that were leaking
When `C` calls a function that return/has an out string and it was overwritten by `C#` inherit class the `C` portion
wasn't cleaning its copy. Now, when a `C` calls a `C#` delegate function, `Strings` that are `out` values or `return`
values use a new marshaler (specific to this case) that uses Eina short lived strings (`Eina_Slstr`) instead of
duplicating it with `strdup`, so at some point, the string passed to `C` is deleted.

To do so, a `direction_context` (a new `Context` at `generation_contexts.hh`) was created. It is only used when a C#
delegate is being called from C (so this context is only set in `function_definition.hh` and `property_definition.hh`,
where it is set to `native_to_manage` to indicate that it is a native call to a managed function).

When this `direction_context` is set and the `String` being marshaled is not marked with an `@move` tag and it is an
`out` or `return` value, the new `StringOutMarshaler` (implemented at `iwrapper.cs`) is used (instead of
`StringKeepOwnershipMarshaler`).

When marshaling a managed data to native this marshaler uses eina short lived string (`Eina_Slstr`) that will be
automatically deleted. This delete is bounded to "the loop of the current thread or until the clear function is called
explicitly" as said at `src/lib/eina/eina_slstr.h`.

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11434
2020-03-23 14:18:16 -03:00
Lucas Cavalcante de Sousa 4f3b3a33f5 efl_mono: Create insert list/array c# wrapper for eina_value.
Implements Insert() method to eina.Value containers (array/list). The
Insert() (src/bindings/mono/eina_mono/eina_value.cs) method wraps native functions implemented with c
(src/lib/eina/eina_inline_value.x).
Resolves T7402

Differential Revision: https://phab.enlightenment.org/D11298
2020-02-13 15:26:50 -03:00
Yeongjong Lee 97098dcc50 csharp: cleanup concrete class
Summary:
Concrete class is only used to call static member of NativeMethod. they don't
need any inheritance and implementation of c functions.

Depends on D9893

Test Plan: ninja test

Reviewers: lauromoura, felipealmeida

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9894
2020-01-23 07:30:14 +09:00
Yeongjong Lee 278376df90 csharp: rename ExtensionMethods
Summary:
This patch will rename `ExtensionMethods` to `Extensions` that is commonly used
in csharp project.

Depends on D10972

Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura, Jaehyun_Cho, felipealmeida

Reviewed By: Jaehyun_Cho, felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10913
2020-01-06 19:08:44 +09:00
Bruno da Silva Belo cf37047a7c c#: Checking null for parameters.
Checking for non-generated code.
ref T8399

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10959
2019-12-26 14:46:16 -03:00
Yeongjong Lee 5679a5d2a2 eina_mono: make internal classes internal
This hide internal classes..

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10912
2019-12-23 15:02:31 -03:00
Bruno da Silva Belo b90c50ad17 c#: Fixing ca2208 for Eina.List.
Some ca's warning reactivated.
ref T8428

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10911
2019-12-23 13:17:04 -03:00
Bruno da Silva Belo 47407478e8 c#: Implement IList to Eina.Array.
ref T8488

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10785
2019-12-22 11:31:35 -03:00
Lauro Moura 81b94b3e35 csharp: Fix passing acessor with ownership
Summary:
When passing an owned acessor from a converted collection we need a way
to unpin the passed data when the accessor is freed.

This commits adds a thin wrapper around the CArray accessor that unpins
the data when freed.

Depends on D10900

Reviewers: YOhoho, felipealmeida

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers, jptiz, brunobelo

Tags: #efl

Maniphest Tasks: T8486

Differential Revision: https://phab.enlightenment.org/D10901
2019-12-18 10:40:53 -03:00
Lauro Moura 5befca9a10 csharp: Fix accessor IEnumerable implementation.
Summary:
Fixed after `data_get` marshalling changed (correctly) the data
parameter to `out IntPtr` instead of manually marshalling the double
pointer.

The existing test (`basic_accessor_list`) passed due to the empty
enumerable behavior, which made the `foreach` running no iterations.

Reviewers: brunobelo, jptiz, felipealmeida, YOhoho

Reviewed By: jptiz, YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10900
2019-12-18 10:40:53 -03:00
Yeongjong Lee f90a97470d eina_mono: replace EinaAccessor and EinaIerator with IEnumerable
Summary:
Eina.Accessor<T> => System.Collections.IEnumerable<T>
Eina.Iterator<T> => System.Collections.IEnumerable<T>

Unit test will work with D10879.

ref T8486

Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8486

Differential Revision: https://phab.enlightenment.org/D10878
2019-12-17 11:34:30 -03:00
Bruno da Silva Belo b6521cc279 csharp: Suppressing non-events Raise methods.
Summary: ref T8390

Reviewers: lauromoura, felipealmeida, YOhoho, jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8390

Differential Revision: https://phab.enlightenment.org/D10717
2019-12-17 11:26:57 -03:00
Bruno da Silva Belo c40e948270 csharp:Suppressing Warning and Add suffix collection.
Summary: ref T8408

Reviewers: lauromoura, felipealmeida, YOhoho, jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8408

Differential Revision: https://phab.enlightenment.org/D10669
2019-12-17 11:26:23 -03:00
Jaehyun Cho bfc095104c csharp: apply same form of "Since EFL" to all manual bindings .cs files
The following form of "Since EFL" is applied to descriptions of all
manual bindings .cs files.
/// <para>Since EFL 1.XX.</para>
2019-12-17 20:18:54 +09:00
Bruno da Silva Belo 8fabc422b6 c#: Implement IList<T> to Eina.List.
Summary:
Container can have three configuration over `Own` and `OwnContent`:
`Own = true` and `OwnContent = true`;
`Own = true` and `OwnContent = false`;
`Own = false`and `OwnContent = false;
If someone try to instanciate the container with `Own = false` and `OwnContent = true`, a exception raises.

There is two Ownerships' behaviours in c#, where `IsReadOnly` is responsible and `IsReadOnly = !OwnContent`:
Full Ownership: User can use modify/Add/Remove operations over the container, this is implemented with `OwnContent = true`.
No Ownership: User **cannot** use modify/Add/Remove operations, this is implemented with `OwnContent = false`.

For the memory, `Own` frees the node, while `OwnContent` frees the data portion.
ref T8487

Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi, jptiz

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8487

Differential Revision: https://phab.enlightenment.org/D10742
2019-12-11 18:58:20 -03:00
Lauro Moura 25e2ed3b2f csharp: changing string literal with nameof.
Summary: ref T8407

Reviewers: lauromoura, felipealmeida, YOhoho, jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8407

Differential Revision: https://phab.enlightenment.org/D10668
2019-12-09 08:33:00 -03:00
Bruno da Silva Belo 6772a78d02 csharp: Specifying StringComparison.
Summary: ref T8405

Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi

Reviewed By: lauromoura

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8405

Differential Revision: https://phab.enlightenment.org/D10650
2019-11-20 17:47:44 -03:00
Lauro Moura 2c5ea739e7 csharp: Add IEquatable on classes.
Summary: ref T8418

Reviewers: lauromoura, felipealmeida, segfaultxavi, YOhoho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8418

Differential Revision: https://phab.enlightenment.org/D10647
2019-11-19 01:34:15 -03:00
Lauro Moura 600163320b csharp: Some missing conversions
Summary:
Ref T8430

Depends on D10616

Reviewers: brunobelo, segfaultxavi, felipealmeida, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8430

Differential Revision: https://phab.enlightenment.org/D10652
2019-11-13 10:05:27 -03:00
Bruno da Silva Belo fee55857e4 csharp: Add To and From methods for implicit conversion.
Summary: ref T8430

Reviewers: lauromoura, felipealmeida, segfaultxavi, YOhoho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8430

Differential Revision: https://phab.enlightenment.org/D10616
2019-11-12 18:59:02 -03:00
Bruno da Silva Belo 0a2c9f57ef csharp: Localization strings with CultureInfo.
Summary: ref T8404

Reviewers: lauromoura, felipealmeida, YOhoho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8404

Differential Revision: https://phab.enlightenment.org/D10608
2019-11-07 23:33:33 -03:00
Lauro Moura 77207f9b58 csharp: Fix running headless tests in dotnet
Summary:
CoreCLR, the runtime of dotnet, has some issues regarding storing
environment variables (see dotnet/coreclr issue #15812), keeping them in
a local cache instead of flushing to the native `setenv`.

This commit replaces the usage of
`System.Environment.SetEnvironmentVariable` with a `setenv` wrapper.

Test Plan: Run without DISPLAY set and with dotnet.

Reviewers: felipealmeida, brunobelo, segfaultxavi, YOhoho

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10619
2019-11-07 22:46:15 -03:00
Bruno da Silva Belo 0e6e983808 csharp: Changing visibility of nested class/struct
Reviewers: felipealmeida, lauromoura, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8393

Differential Revision: https://phab.enlightenment.org/D10588
2019-11-04 14:53:54 -03:00
Bruno da Silva Belo 72a5367f8d csharp: space after keywords.
Reviewers: felipealmeida, lauromoura, YOhoho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10576
2019-10-31 07:53:00 -03:00
Bruno da Silva Belo ba34325f43 csharp: Add comparables operator to eina_error.
Summary: ref T8394

Reviewers: lauromoura, felipealmeida, segfaultxavi, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8394

Differential Revision: https://phab.enlightenment.org/D10456
2019-10-28 20:34:55 -03:00
Bruno da Silva Belo 19588be0b9 csharp: Add comparables operators to eina_value.
Summary: ref T8394

Reviewers: lauromoura, felipealmeida, segfaultxavi, YOhoho, bu5hm4n

Reviewed By: YOhoho

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8394

Differential Revision: https://phab.enlightenment.org/D10458
2019-10-28 20:34:25 -03:00
Yeongjong Lee 91ae0ea12f eina_mono: remove exceptions in unexpected locations
Summary:
Unexpected locations are listed in
https://docs.microsoft.com/en-us/visualstudio/code-quality/ca1065

fix CA1065
ref T8402

Test Plan:
meson setup -Dbindings=mono,cxx -Dmono-beta=true
ninja test

Reviewers: lauromoura, felipealmeida, brunobelo

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8402

Differential Revision: https://phab.enlightenment.org/D10461
2019-10-28 20:33:47 -03:00
Yeongjong Lee eb676e47af eina_array: add paramName argument of ArgumentNullException
Summary:
ArgumentNullException constructor included `message` is
`public ArgumentNullException (string paramName, string message);`

Fix CA2208
ref T8428

Test Plan:
meson setup -Dbindings=mono,cxx -Dmono-beta=true
ninja test

Reviewers: lauromoura, felipealmeida, brunobelo

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8428

Differential Revision: https://phab.enlightenment.org/D10464
2019-10-25 19:21:30 -03:00
Bruno da Silva Belo e17213a09b csharp: Changing Count() to Length on eina_value.
Summary: ref T8422

Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8422

Differential Revision: https://phab.enlightenment.org/D10499
2019-10-25 13:17:05 -03:00
Bruno da Silva Belo 68eefe1872 csharp: Using Count eina_promises.
Summary: ref T8422

Reviewers: lauromoura, felipealmeida, YOhoho, segfaultxavi

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8422

Differential Revision: https://phab.enlightenment.org/D10498
2019-10-25 13:16:57 -03:00
Yeongjong Lee 69261251a7 mono: implement dispose method based on dispose pattern
Summary:
Fix CA1063, CA1816
ref T8400, T8419

Test Plan:
meson setup -Dbindings=mono,cxx -Dmono-beta=true
ninja test

Reviewers: felipealmeida, brunobelo, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8419, T8400

Differential Revision: https://phab.enlightenment.org/D10460
2019-10-25 11:02:50 -03:00
Yeongjong Lee b8ba39f4cb eina_mono: re-throw exception to preserve stack details
Summary:
fix CA2200
ref T8426

Test Plan:
meson setup -Dbindings=mono,cxx -Dmono-beta=true
ninja test

Reviewers: lauromoura, felipealmeida, brunobelo

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8426

Differential Revision: https://phab.enlightenment.org/D10462
2019-10-24 18:34:30 -03:00
Yeongjong Lee 1158775084 eina_mono: Initialize UNHANDLED_EXCEPTION inline
Summary:
fix CA2207
ref T8427

Test Plan:
meson setup -Dbindings=mono,cxx -Dmono-beta=true
ninja test

Reviewers: lauromoura, felipealmeida, brunobelo

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8427

Differential Revision: https://phab.enlightenment.org/D10463
2019-10-24 18:34:30 -03:00
Lauro Moura 40a980174b csharp: Add licensing information.
Summary:
C# bindings will be lincensed under Apache Sofware License 2.0.

This commit adds the license text to the licenses folder and a copyright
notice to the binding files.

Fixes T8039

Reviewers: woohyun, felipealmeida, vitor.sousa

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8039

Differential Revision: https://phab.enlightenment.org/D9414
2019-10-24 10:10:56 -03:00
Yeongjong Lee c25ba58007 mono: encapsulate invoke method
Summary: This patch will fix compiler warning CA1401.

Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura, segfaultxavi, Jaehyun_Cho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, woohyun, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10338
2019-10-17 20:29:58 -03:00
Yeongjong Lee 0eb180b3ab mono: add static modifier to static holder types.
Summary: This patch will fix CA1052 compiler warnings.

Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura, Jaehyun_Cho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10434
2019-10-17 14:38:30 -03:00
Yeongjong Lee ee33f93743 mono: make public static field const or readonly
Summary: This patch will fix CA2211 compiler warnings.

Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura, Jaehyun_Cho

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10423
2019-10-16 10:46:23 -03:00
Lauro Moura 64e22aaada csharp: Fix promises docs and hide api
Summary: ref T8293

Reviewers: felipealmeida, brunobelo, segfaultxavi, woohyun

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10331
2019-10-15 10:10:53 -03:00
Lauro Moura 87e5fc4c6a csharp: Remove test dependency on internal funcs
Summary: This will help cleaninup the EFL# API.

Test Plan: run test suite

Reviewers: YOhoho, felipealmeida, segfaultxavi, woohyun, brunobelo

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10365
2019-10-14 17:19:12 -03:00
Bruno da Silva Belo 66a26a378b csharp: Updating eina_array docs and hide api.
Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10309
2019-10-14 17:08:09 -03:00
Bruno da Silva Belo def27320b3 csharp: updating eina_common docs and hide api.
Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10311
2019-10-14 16:43:01 -03:00
Bruno da Silva Belo 8ba2638f0e csharp: updating eina_config docs and hide api.
Reviewers: felipealmeida, lauromoura, woohyun, segfaultxavi

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10312
2019-10-14 12:40:13 -03:00
Bruno da Silva Belo 37e6430e46 csharp: updating eina_container_common doc and api
Reviewers: felipealmeida, lauromoura, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10314
2019-10-14 12:01:20 -03:00
Bruno da Silva Belo e4385c084c csharp: updating eina_error docs.
Reviewers: felipealmeida, lauromoura, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10323
2019-10-14 11:40:19 -03:00
Bruno da Silva Belo 3be9b6a129 csharp: updating eina_hash docs and hide api.
Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10324
2019-10-14 11:31:19 -03:00
Bruno da Silva Belo 4eee6f560c csharp: updating eina_list docs.
Summary: ref T8293

Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10351
2019-10-14 11:08:02 -03:00
Bruno da Silva Belo 0477a72560 csharp: updating eina_log docs.
Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10352
2019-10-14 11:03:05 -03:00
Lauro Moura dcb6380ab5 csharp: Add missing docs to slice.
Summary:
Also removed uneeded methods.

Slice also may need some API love to be actually useful later.

ref T8292

Reviewers: segfaultxavi, felipealmeida, brunobelo, woohyun

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8292

Differential Revision: https://phab.enlightenment.org/D10327
2019-10-11 11:23:22 +02:00
Lauro Moura 15933eb37b csharp: Fix doc and hide stuff from strbuf.
Summary: ref T8293

Reviewers: felipealmeida, brunobelo, woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10326
2019-10-10 10:31:13 +02:00