Commit Graph

808 Commits

Author SHA1 Message Date
Lucas Cavalcante de Sousa 4797602e84 efl_mono: Use architecture independent ECANCELED
Summary:
`efl_mono` was assuming ECANCELED as in Linux, which made some tests
fail.

`test_simple_futere_cancel` and `test_cancel_after_resolve` checks if
the returned error code is `ECANCELED` but `Eina.Error.ECANCELED` was
base on Linux `ECANCELED` which is diferent from OSX causing:
```
[ ERROR       ] AssertionException: /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:138 (test_simple_future_cancel) Left hand side "Eina.Error(89)", right hand side "Eina.Error(125)"
at Test.AssertEquals[T](T lhs, T rhs, String msg, Int32 line, String file, String member) in /Users/lucas/expertise/efl1/src/tests/efl_mono/TestUtils.cs:line 73
at TestSuite.TestPromises.test_simple_future_cancel() in /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:line 138
[        FAIL ] TestPromises.test_simple_future_cancel
```
```
[ ERROR       ] AssertionException: /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:256 (test_cancel_after_resolve) Left hand side "Eina.Error(89)", right hand side "Eina.Error(125)"
at Test.AssertEquals[T](T lhs, T rhs, String msg, Int32 line, String file, String member) in /Users/lucas/expertise/efl1/src/tests/efl_mono/TestUtils.cs:line 73
at TestSuite.TestPromises.test_cancel_after_resolve() in /Users/lucas/expertise/efl1/src/tests/efl_mono/Promises.cs:line 256
[        FAIL ] TestPromises.test_cancel_after_resolve
```

And `iwraper.cs:WrapAssync` was only considering Linux `ECANCELED` thus causing
a rise of an `Efl.FutureException: Future failed` instead of the expected
`TaskCanceledException` making fail at `TestEoAsyncMethods.test_async_cancel`:
```
[ RUN         ] TestEoAsyncMethods.test_async_cancel
[ ERROR       ] AssertionException: Assertion failed: /Users/lucas/expertise/efl1/src/tests/efl_mono/EoPromises.cs:175 (test_async_cancel) AggregateException must have been TaskCanceledException
   at Test.Assert(Boolean res, String msg, Int32 line, String file, String member) in /Users/lucas/expertise/efl1/src/tests/efl_mono/TestUtils.cs:line 53
   at TestSuite.TestEoAsyncMethods.<>c.<test_async_cancel>b__1_0(Exception x) in /Users/lucas/expertise/efl1/src/tests/efl_mono/EoPromises.cs:line 175
   at System.AggregateException.Handle(Func`2 predicate)
   at TestSuite.TestEoAsyncMethods.test_async_cancel() in /Users/lucas/expertise/efl1/src/tests/efl_mono/EoPromises.cs:line 171
[        FAIL ] TestEoAsyncMethods.test_async_cancel
```

Depends on D12156

Test Plan:
Compare with master and note that with this diff all tests pass.
- Configure as especified by Enlightenment man page + `-Dbindigns=mono -Ddotnet=true`:
```
meson -Dsystemd=false -Dv4l2=false -Davahi=false -Deeze=false -Dx11=false -Dopengl=full -Dcocoa=true -Dnls=false -Demotion-loaders-disabler=gstreamer1,libvlc,xine -Decore-imf-loaders-disabler=scim,ibus -Dbindigns=cxx,mono -Ddotnet=true build
```
- Build normally
- Test `efl-mono-suite`

Reviewers: felipealmeida

Reviewed By: felipealmeida

Subscribers: ProhtMeyhet, cedric, #reviewers, #committers, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12157
2020-11-25 10:44:41 -03:00
Lucas Cavalcante de Sousa 4de94638a6 efl-mono: Correctly load dynamic libs for OSX
Summary:
OSX libs end with `.dylib`, so it made failed to load libs, for instance
dl name is `dl.dylib` making it unable to load as it was before
(`libdl.so`).

Test Plan:
Compare with master and note that this diff is able to fail on tests, and
not about importing libs.
- Configure as especified by Enlightenment man page + `-Dbindigns=mono -Ddotnet=true`:
```
meson -Dsystemd=false -Dv4l2=false -Davahi=false -Deeze=false -Dx11=false -Dopengl=full -Dcocoa=true -Dnls=false -Demotion-loaders-disabler=gstreamer1,libvlc,xine -Decore-imf-loaders-disabler=scim,ibus -Dbindigns=cxx,mono -Ddotnet=true --prefix=$PWD/prefix build
```
- Build normally
- Test `efl-mono-suite`

Reviewers: felipealmeida

Reviewed By: felipealmeida

Subscribers: stefan_schmidt, cedric, #reviewers, #committers, woohyun

Tags: #efl, #expertise_solutions

Differential Revision: https://phab.enlightenment.org/D12156
2020-11-25 10:43:47 -03:00
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
Felipe Magno de Almeida 15acb0586a cxx: Fix uses of intrinsic eolian binbuf type
Add special binbuf and Eina_Strbuf conversions

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11950
2020-06-09 10:29:32 +02:00
Daniel Kolesa c3a1060b94 build: disable elua by default, plus nicer detection
Elua is now disabled by default. There are some other changes:

1) Elua scripts are only installed if Elua is enabled
2) Lua bindings are only installed if Elua is enabled
3) Elua with interpreter is clearly experimental and will message
2020-06-06 19:28:26 +02:00
Daniel Kolesa 34e855c1f1 bindings/lua: simplify some eolian binding code 2020-05-31 07:27:01 +02:00
Daniel Kolesa 8cc2c419cb bindings/lua: fixes for cffi-lua 2020-05-31 06:39:50 +02:00
Daniel Kolesa 38bf0be7d0 bindings/lua: use new _fill api variants for expr values
The previous behavior was also invalid, since it was casting
a GC-managed pointer, which doesn't provide any guarantee that
it will stay valid. Fix that too, by using manually allocated
memory and assigning a finalizer at the end.
2020-05-31 02:32:35 +02:00
Daniel Kolesa aa3f1b67e7 bindings/lua: minor fixes to accommodate cffi-lua 2020-05-31 01:54:34 +02:00
Daniel Kolesa f78d54051c bindings: rename luajit -> lua 2020-05-29 17:06:22 +02:00
Daniel Kolesa b0203b3160 bindings/luajit/eolian: get rid of using bitops 2020-05-29 17:00:28 +02:00
Daniel Kolesa a928dba502 elua: prepare for compatibility with cffi-lua (use ffi.nullptr)
This is necessary because the LuaJIT FFI implements the null
pointer to nil equality behavior, which is not possible to
do in standard Lua (as equality metamethod needs identical types
to trigger).

So replace it with ffi.nullptr as cffi-lua implements; in luajit
ffi.nullptr will just become nil and it'll work like before.
2020-05-21 17:45:43 +02:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
João Paulo Taylor Ienczak Zanette de939ca64b cxx: Initialize _list and _node with nullptr
Fixes CID 1409576 pointing that _node was unitialized.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11770
2020-05-07 12:09:35 +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
Felipe Magno de Almeida 595cb754b3 eolian-mono: Make Get/Set internal for generated properties
Make Get and Set methods internal for properties that get the
property syntax generated.

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11252
2020-02-18 16:47:38 -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
João Paulo Taylor Ienczak Zanette 93d4ffc940 csharp: Prevent using system dll for eflcustomexportsmono
If EFL is installed system-wide, `CustomExports` would use the system
(`/usr`) dll instead of local build's, causing new implemented binding calls to
native functions to crash with no entry point found for them.

This patch fixes it by ensuring that the local build's
`libeflcustomexportsmono.dll` will be used.

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11343
2020-02-13 15:22:46 -03:00
Yeongjong Lee dd4bad3037 csharp: implement GetChildrenIndex for GenericModel
Summary: This patch will fix EFL# build error.

Reviewers: felipealmeida, woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11269
2020-02-04 17:17:27 +09:00
Yeongjong Lee b8f5d12d4e eolian_mono: blacklist c-only internal APIs
Summary: This patch prevent generating c-only internal APIs. C# doesn't need c-only APIs.

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

Reviewers: felipealmeida, Jaehyun_Cho, woohyun

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11151
2020-01-29 13:46:37 +09:00
Yeongjong Lee 5ddd384aee eolian_mono: change property name from args to Args
Summary: PascalCasing is always used for property names.

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

Reviewers: woohyun, felipealmeida, segfaultxavi

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11149
2020-01-29 13:45:56 +09:00
Yeongjong Lee 581bec9598 eolian_mono: make struct immutable
Summary:
Immutable value type is recommeneded for struct type in cs world.
`DO NOT define mutable value types.`
(see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/struct)

Also, this patch include refactoring of generated struct types.
1. Change field type to property type that have only getter. it will fix CA1051(ref T8397).
2. Remove internal NativeStruct. there is private field for marshalling struct instead.
3. Fix some test cases that change value inside struct. because struct is immutable.

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

Reviewers: woohyun, felipealmeida, Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8397

Differential Revision: https://phab.enlightenment.org/D11146
2020-01-28 14:46:10 +09: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
Jaehyun Cho 700d87b370 Revert "efl_mono: remove class ExtensionTag"
Extension Methods' classes have methods with same names and parameters.
e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac)

Although the where clause contains different classes, they cannot be
identified as different methods by C# compiler.
e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) where T : Efl.Ui.Button
e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac) where T : Efl.Ui.Check

As a result, to avoid ambiguous methods, ExtensionTag should be used as
a second parameter of each method.
e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac, ExtensionTag<Efl.Ui.Button, T>magic = null) where T : Efl.Ui.Button
e.g. Text<T>(this Efl.Ui.ItemFactory<T> fac, ExtensionTag<Efl.Ui.Check, T>magic = null) where T : Efl.Ui.Check

This reverts commit 76631f502a.
2020-01-22 14:44:08 +09:00
Yeongjong Lee 292f4bc0da Revert "csharp: Property Indexer implementation"
Summary:
This reverts commit 0954e501fd.

According to Framework Design Guidelines of MS, most of indexed properties are
not recommended in EFL#.
(see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property)

It is better to leave properties which have a key as methods.

Reviewers: woohyun, felipealmeida

Reviewed By: woohyun

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11114
2020-01-21 07:00:44 +09:00
Felipe Magno de Almeida 77db0820e3 c#: Remove warning about unused variable
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11097
2020-01-15 11:16:39 +01:00
Jaehyun Cho 76631f502a efl_mono: remove class ExtensionTag
Summary:
Since class BindablePart and class BindableProperty use generic type
constraint as "where T : <class name>", class ExtensionTag is no longer
needed.

Reviewers: SanghyeonLee, felipealmeida, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11101
2020-01-15 18:45:38 +09:00
Yeongjong Lee ae30d3c57b eina_mono: replace eina_list and eina_array with IList
Summary:
Eina.List<T> => System.Collections.Generic.IList<T>
Eina.Array<T> => System.Collections.Generic.IList<T>

ref T8486

Depends On D10785

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

Reviewers: felipealmeida, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8486, T8488

Differential Revision: https://phab.enlightenment.org/D10902
2020-01-14 17:17:05 +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
Lauro Moura e632c1334a csharp: Add StyleCop support to dotnet build
This patch adds support to run the StyleCop rules. To enable, -Ddotnet=true
is needed, You can pass -Ddotnet-stylecop=CAXXXX,CAXXYY where X and Y are digits for CAs
or SAs. You can also ask that the CAs and SAs cause errors instead of warnings.

Differential Revision: https://phab.enlightenment.org/D10969
2019-12-30 22:17:32 -03: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
Yeongjong Lee a56b96d33c eo_mono: make BindingEntityAttribute internal
`BindingEntityAttribute` is used internally to check whether the object is
generated binding classes or not.
API user should use protected `IsGeneratedBindingClass` instead.

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10937
2019-12-23 14:59:54 -03:00
Yeongjong Lee b4846c95a2 eo_mono: make Eo.Globals internal
All members of `Eo.Globals` are already `internal`.
It is unnecessary for `Eo.Globals` to be `public`.

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10938
2019-12-23 14:56:41 -03:00
Lauro Moura 0954e501fd csharp: Property Indexer implementation
Use Indexers to use brackets, eg [i], syntax.

Keys now can be used as following:

var someVal = obj.SomeProperty[key];
obj.SomeProperty[key] = someNewVal;

And for multiple keys:

var someVal = obj.SomeProperty[(key1, key2)];
obj.SomeProperty[(key1, key2)] = someNewVal;

T8384

Reviewed-by: WooHyun Jung <wh0705.jung@samsung.com>
Differential Revision: https://phab.enlightenment.org/D10791
2019-12-23 13:50:12 -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
Jaehyun Cho e16b32c376 csharp: add documentation of class Efl.Eo.Config in iwrapper
Summary: Description and since efl version of the class Efl.Eo.Config is added.

Reviewers: YOhoho, lauromoura, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10933
2019-12-20 09:45:42 +01:00
Felipe Magno de Almeida 3a385ccae0 Fix invalid XML comment in efl_mono.dll.config
Use <!-- and --> to comment the license files

Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10790
2019-12-19 18:29:44 -03:00
Yeongjong Lee fb301eea87 csharp: remove unused code in workaround
Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true

Reviewers: lauromoura, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10914
2019-12-19 16:30:54 +09: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 8e951504f5 csharp : add move tag info to EinaAccessor, EinaIterator converter
Summary:
Included commits in devs/lauromoura/remove_eina_mono-rebased
```
commit ed6679db19
Author: Lauro Moura <lauromoura@expertisesolutions.com.br>
Date:   Mon Dec 2 13:58:04 2019 -0300

    csharp: add move information to EnumerableToAccessor

    Still need to fix the converted accessor ownership, maybe by creating a
    custom accessor class that released the pinned memory when is freed.
```

ref T8486

Depends On D10878

Co-authored-by: Lauro Moura <lauromoura@expertisesolutions.com.br>

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

Reviewers: YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8486

Differential Revision: https://phab.enlightenment.org/D10879
2019-12-17 11:34:42 -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
João Paulo Taylor Ienczak Zanette ca3a913375 csharp: Implement Deconstruct for structs.
Summary:
Usage example:

```
var (x, y) = somePos2D;
```

Not available on Mono environment due to [`mcs` not implementing
it](a3de0304a1/mcs/mcs/tuples.cs (L590)).
To keep tests from breaking because of it, a `MONO` preprocessor variable is
defined and checked during test compilation.

Ref T8489.

Reviewers: brunobelo, lauromoura, segfaultxavi

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8489

Differential Revision: https://phab.enlightenment.org/D10809
2019-12-12 18:45:20 -03: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
Yeongjong Lee 06c2bbf798 eolian_mono: reduce duplicated code in OnXXXEvent
Summary:
`CallNativeEventCallback` is used to reduce duplicated code.

E.g.

Before
```
protected virtual void OnFullscreenChangedEvent(Efl.Ui.WinFullscreenChangedEventArgs e)
{
    var key = "_EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED";
    IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key);
    if (desc == IntPtr.Zero)
    {
        Eina.Log.Error($"Failed to get native event {key}");
        return;
    }

    IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
    try
    {
        Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info);
    }
    finally
    {
        Marshal.FreeHGlobal(info);
    }
}
```

After
```
protected virtual void OnFullscreenChangedEvent(Efl.Ui.WinFullscreenChangedEventArgs e)
{
    IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0);
    CallNativeEventCallback("elementary", "_EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED", info, (p) => Marshal.FreeHGlobal(p));
}
```

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

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10661
2019-12-09 13:56:19 -03:00