The test struct used to check mono bindings struct pack/unpack
is no longer available. Used a different one, and checked the same things.
Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11219
When a get and/or set from property is defined to return, explicitly,
a Eina.Success_Flag, the mono generator will check the return value
and generate an exception if the call fails.
Resolves T8383.
Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11281
Adds a special case for "accessor" complex types in `implicit operator` for
structs and `IntPtr`s, in which an IEnumerator must be converted to/from an
IntPtr.
Reviewed-by: YeongJong Lee <cleanlyj@naver.com>
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D11210
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
Adds documentation for tuple-value properties (properties with
multiple values), so the following Eo:
```
@property multi_valued_prop {
[[ A multi valued property. ]]
get {}
set {}
values {
prop1: int; [[ Dummy property's first element. ]]
prop2: int; [[ Dummy property's second element. ]]
}
}
```
Generates the following documentation:
```
/// <summary>A multi valued property.<br/>
/// Since EFL *current version*.</summary>
/// <value>A tuple containing the following information:
/// <list type="bullet">
/// <item><description><c>prop1</c> (<c>Item0</c>): Dummy property's first element.</description></item>
/// <item><description><c>prop2</c> (<c>Item1</c>): Dummy property's second element.</description></item>
/// </list></value>
```
Note: This commit also adds a default separator between tag name and
parameters in `generate_opening_tag`.
Ref T8468.
Differential Revision: https://phab.enlightenment.org/D10889
Story:
This revision got landed twice, I do not know what happend, but when i
wanted to land that initially with git phab, something reseted the state
of this revision to the initial version, and also changed the
authorship. This time, this commit contains all changes, and the correct
authorship, sorry for the noise.
Summary:
Add @since tags at stable (not tagged with @beta) `.eo` c#/c++ tests. Doing so,
eolian_enforce_since shouldn't accuse at stable tests.
Depends on D11264
Resolves T8600
Reviewers: zmike, segfaultxavi, woohyun, bu5hm4n
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8600
Differential Revision: https://phab.enlightenment.org/D11265
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
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
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
Summary:
Like other classes and methods, the classes and methods for extension
methods of ItemFactory are moved inside the namespace.
Consequently, the namespace in the class name for extension methods is
removed to avoid duplicate namespace name.
Reviewers: lauromoura, felipealmeida, YOhoho, woohyun
Reviewed By: YOhoho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10972
Checking null for generated code
ref T8399
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10970
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
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
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
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
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
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
Summary:
Also generates implicit conversion for 1-field structs.
Usage examples:
```
// With tuples
Point2D p = (1, 2);
obj.SetPoint((1, 2));
// With 1-field structs
StringWrapper sw = "Must be handled by wrapper.";
```
Due to limitations of MSC compiler, implicit conversions are generated
only if struct has 4 fields or less.
Ref T8489.
Reviewers: brunobelo, cedric, lauromoura, segfaultxavi
Reviewed By: lauromoura
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8489
Differential Revision: https://phab.enlightenment.org/D10801
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
Summary:
The inheritance test depends on the objects being actively destroyed.
Currently this happens in a two step process, where first the C#
object is collected from the GC. As this happens in a separate thread,
we schedule a callback to run in the main loop to actually unref the
EO object.
This commit adds more iterations to make sure the EO of the parent is
unref'd and releases the child.
This should be the last C#-related CI test failure
Ref T8313
Reviewers: stefan_schmidt, brunobelo, felipealmeida
Reviewed By: felipealmeida
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8313
Differential Revision: https://phab.enlightenment.org/D10612
Summary: Was failing if the suffix were equal to the source string
Reviewers: felipealmeida, segfaultxavi, YOhoho, brunobelo
Reviewed By: brunobelo
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10708
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
Summary:
`efl_part_get` is protected in C due to the presence of `efl_part`,
which does automatic refcount management in single method calls.
The C# binding has no limitation on this as it already handles the
lifetime for all objects.
Fixes T8462
Reviewers: brunobelo, segfaultxavi, SanghyeonLee
Reviewed By: SanghyeonLee
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8462
Differential Revision: https://phab.enlightenment.org/D10594
Summary: Make dotnet target also depend on the manual test files.
Test Plan: Modify one of the manual files and run the tests again. The test target should be rebuilt.
Reviewers: bu5hm4n, segfaultxavi, brunobelo, felipealmeida
Reviewed By: brunobelo
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10609
Summary:
Instead of building with a patched meson version, make use of custom
targets and generated csproj files so we can used upstream meson
normally.
This avoids digging into "non official" dotnet stuff like calling
the CSC.dll directly that the patched meson tried to do.
To enable, run meson with `-Ddotnet=true`.
Regarding source file dependencies, Meson has a limitation[1]
about generated artifacts being placed in subdirectories.
In order to correctly track these generated artifacts for dotnet, we
generated them in the same folder as the csproj file through
`dotnet build -o`.
Instead of installing the dll like we do for mono, a nupkg is generated
and installed in the same folder as the dll would be
(<prefix>/lib/x86_64-linux-gnu/efl-mono-1)
To avoid messing around with Nupkg caches, we reference the source
project for the library directly instead of the nupkg when building the
test suite.
[1] https://github.com/mesonbuild/meson/issues/2320
Fixes T8168
Reviewers: bu5hm4n, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Subscribers: cedric, brunobelo, felipealmeida, segfaultxavi
Tags: #efl, #do_not_merge
Maniphest Tasks: T8168
Differential Revision: https://phab.enlightenment.org/D9717
Summary:
This makes sure the user is warned if it ignores a return value that
could potentially be a memory leak.
This also makes possible to use `value {}` blocks with `@move` instead
of value-less properties with `@no_unused`.
Also removed the `@move` from canvas_text_async_layout as it is ignored
in the only place it is used.
Reviewers: q66
Reviewed By: q66
Subscribers: #reviewers, #committers, bu5hm4n, felipealmeida, cedric, segfaultxavi
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10601