Commit Graph

260 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 1c6f38aa74 dotnet: Ignore Efl.Object.parent as constructor
In C# we already have Efl.Object.parent as an implicit constructor. Ignore it if it is marked as a constructor.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11951
2020-06-09 10:29:26 +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 df0715a9aa C#: Add error checking for Eina.Success_Flag return type
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
2020-02-18 17:53:19 -03:00
João Paulo Taylor Ienczak Zanette eba07471a0 csharp: Add IntPtr to/from IEnumerable conversion for "accessor" types
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
2020-02-18 16:52:59 -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
Xavi Artigas cf02feb9ba mono: Add "out" as a reserved word
This will turn it into kw_out just like it is done for "in".
Otherwise it cannot be used as a parameter name, for example.
2020-02-17 12:35:00 +01:00
João Paulo Taylor Ienczak Zanette 651517808c csharp: Generating documentation for tuple-value properties.
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&apos;s first element.</description></item>
/// <item><description><c>prop2</c> (<c>Item1</c>): Dummy property&apos;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
2020-02-13 15:38:42 -03:00
João Paulo Taylor Ienczak Zanette 9510702ede csharp: Fix managed name when solving Get/SetType name clash
Summary:
If you declare a property called "type", the generated getter method
would be called "GetType", clashing with "System.Object.GetType" method. The
current workaround for that is to straight-forwardly insert the respective
class/abstract's Eolian name into the function name (becoming, for example
"GetMy_ClassType"), sometimes getting inconsistent to not only other methods
but also with documentation (leading to XML errors, since a cref doc would
reference "GetMyClassType", which doesn't exists).

This patch fixes that by wrapping the Eolian name with the already existing
`managed_name` function.

Test Plan: Run ninja tests.

Reviewers: zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11331
2020-02-12 16:43:25 +01: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 46c65ff0db eolian_mono: generate Efl.IPlayer.PlaybackPosition again
Summary: There is no reason that `efl_player_playback_position_get` is in blacklist..

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

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11152
2020-01-29 13:14:13 +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
João Paulo Taylor Ienczak Zanette 5d982dd985 csharp: Escape contents of struct fields' value tag.
Summary:
In structs' definition, field `<value>` tags weren't scaping
characters, so characters like "&" would lead to invalid XML errors.

Fixes T8588.

Test Plan: Run ninja test.

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8588

Differential Revision: https://phab.enlightenment.org/D11202
2020-01-27 17:56:06 +01: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 cade1b3c3c eolian_mono: avoid generating set-only property
Summary:
According to Property Design Guidelines of MS, set-only properties are not recommeneded.
(see more, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property)

Furthermore, there is stylecop warnings(CA1044)

ref T8396

List of removed set-only properies.
```
Efl.Access.Editable.IText.TextContent { set; }
Efl.App.CommandArray { set; }
Efl.App.CommandString { set; }
Efl.Canvas.Filter.IInternal.FilterChanged { set; }
Efl.Canvas.Filter.IInternal.FilterInvalid { set; }
Efl.Canvas.ImageInternal.FilterChanged { set; }
Efl.Canvas.ImageInternal.FilterInvalid { set; }
Efl.Canvas.Textblock.FilterChanged { set; }
Efl.Canvas.Textblock.FilterInvalid { set; }
Efl.Canvas.Vg.Image.Data { set; }
Efl.Canvas.Vg.Node.CompMethod { set; }
Efl.Core.ICommandLine.CommandArray { set; }
Efl.Core.ICommandLine.CommandString { set; }
Efl.Exe.CommandArray { set; }
Efl.Exe.CommandString { set; }
Efl.Ui.AlertPopup.Button { set; }
Efl.Ui.Collection.MatchContent { set; }
Efl.Ui.CollectionView.MatchContent { set; }
Efl.Ui.IScrollable.MatchContent { set; }
Efl.Ui.ImageZoomable.MatchContent { set; }
Efl.Ui.Panel.MatchContent { set; }
Efl.Ui.PositionManager.Grid.DataAccess { set; }
Efl.Ui.PositionManager.Grid.ScrollPosition { set; }
Efl.Ui.PositionManager.Grid.Viewport { set; }
Efl.Ui.PositionManager.IDataAccessV1.DataAccess { set; }
Efl.Ui.PositionManager.IEntity.ScrollPosition { set; }
Efl.Ui.PositionManager.IEntity.Viewport { set; }
Efl.Ui.PositionManager.List.DataAccess { set; }
Efl.Ui.PositionManager.List.ScrollPosition { set; }
Efl.Ui.PositionManager.List.Viewport { set; }
Efl.Ui.Scroll.Manager.MatchContent { set; }
Efl.Ui.Scroll.Manager.Pan { set; }
Efl.Ui.Scroller.MatchContent { set; }
Efl.Ui.Spotlight.Manager.Size { set; }
Efl.Ui.Textbox.TextContent { set; }
Efl.Ui.Widget.ResizeObject { set; }
Efl.Ui.Win.PropFocusSkip { set; }
```

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

Reviewers: woohyun, felipealmeida, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8396

Differential Revision: https://phab.enlightenment.org/D11138
2020-01-22 09:43:13 +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
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
Jaehyun Cho 66c485d232 eolian_mono: add missing tabs to apply indentation
Missing tabs are added to apply indentation.
2020-01-13 20:49:48 +09:00
Yeongjong Lee 3fc78f69eb eolian_mono: add 1 tab inside the namespace
Summary:
Also, this patch will fix indentation of enum, struct.

### Before
```
namespace Efl.Ui {
/// <summary>Define the move or resize mode of a window.
///
/// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed.
...
[Efl.Eo.BindingEntity]
public enum WinMoveResizeMode
{
/// <summary>Start moving window<br/>Since EFL 1.22.</summary>
Move = 1,
/// <summary>Start resizing window to the top<br/>Since EFL 1.22.</summary>
Top = 2,
...
}
}
```

### After
```
namespace Efl.Ui {
    /// <summary>Define the move or resize mode of a window.
    ///
    /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed.
...
    [Efl.Eo.BindingEntity]
    public enum WinMoveResizeMode
    {
        /// <summary>Start moving window<br/>Since EFL 1.22.</summary>
        Move = 1,
        /// <summary>Start resizing window to the top<br/>Since EFL 1.22.</summary>
        Top = 2,
...
    }
}
```

Reviewers: Jaehyun_Cho, felipealmeida

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11032
2020-01-13 10:16:24 +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
Jaehyun Cho 1507ade787 eolian_mono: add namespace to extension methods of ItemFactory
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
2020-01-06 19:07:28 +09:00
Bruno da Silva Belo 5c99f08511 c#: Checking null for parameters generated code.
Checking null for generated code
ref T8399

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10970
2020-01-02 22:06:24 -03:00
Yeongjong Lee 934a93e39f eolian_mono: check extension part/property existence before generate ExtensionMethods
Empty ExtensionMethods class won't be generated.

Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10954
2019-12-23 14:29:39 -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
SangHyeon Jade Lee b9b9287454 eolian_mono : add verb unselect on naming helper.
Summary:
currently select is verb and mono name is exposed SelectAll
but unselect is non-verb and mono name is exposed AllUnselect.
to fix this differencies, add unselect in the verb list.

Reviewers: segfaultxavi, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10952
2019-12-23 16:21:10 +09:00
Jaehyun Cho 8146728c78 eolian_mono: change Constants class to static class
Summary:
Since Constants class contains static readonly values only, the
Constants class is actually a static class.
Therefore, Constants class is changed from public partial class to
public static partial class.

ref T8398

Reviewers: YOhoho, lauromoura

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10929
2019-12-20 14:27:14 +09:00
Yeongjong Lee a9fa8da384 eolina_mono: prevent empty ExtensionMethods class
Test Plan:
Check the code below is removed from `efl_ui_box_stack.eo.cs`.
```
#if EFL_BETA
#pragma warning disable CS1591
public static class CoreUI_UIBoxStack_ExtensionMethods {
}
#pragma warning restore CS1591
#endif
```

Reviewers: lauromoura, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10905
2019-12-19 16:30:48 +09: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
Xavi Artigas bd0231e98b eolian_mono: proper parsing of doc notes and paragraphs
Summary:
The documentation tokenizer relies on proper separation of paragraphs,
and we were not doing that. This fixes detection of Note:, Warning:,
Remark: and TODO: tags.
Additionally, we were removing the blank line between the summary and
the description, artificially joining them.

Test Plan: Everything builds and passes tests, and docs with `Note:` tags are correctly rendered (like `Efl.Loop_Consumer.new_promise`, for example)

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10868
2019-12-12 19:07:59 -03: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
João Paulo Taylor Ienczak Zanette e617ff441a csharp: Add implicit conversion from tuples to structs.
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
2019-12-12 13:16:22 -03:00
Xavi Artigas 8a2ccfefe1 mono: suppress unused parameter warning 2019-12-12 16:38:04 +01:00
Xavi Artigas 0e46ecb003 mono-docs: Nicer formatting for notes
This has never been tested because so far EO "Note:" tags are only recognized
when they appear at the beginning of a comment block.
It turns out the note already includes the "Note:" prefix so we were adding it
twice.
This patch removes one of the prefixes and used a nicer formatting.

Also works for "Warning:", "Remark:" and "TODO:".
2019-12-12 16:25:43 +01:00
Xavi Artigas 8378b854a1 mono-docs: Allow property refs with keys
When an EO property had multiple values or keys the C# generator
didn't generate a wrapping C# property. Therefore property references
in the documentation were changed to references to the getter.
Now multiple values are handled through tuples so the wrapping properties
ARE generated.
This patch removes the restriction for multiple values to doc refs
can more naturally reference the property instead of the getter method.
Properties with keys still reference the getter, since these are not wrapped.
2019-12-12 16:02:14 +01:00
Yeongjong Lee c62a7dae63 csharp: remove Efl.IText.Text from the blacklist
Summary:
There is no conflict anymore.

ref T8093

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

Reviewers: lauromoura, woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8093

Differential Revision: https://phab.enlightenment.org/D10861
2019-12-12 16:07:41 +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 271b56889f csharp: Removed duplicated call_match implementations
Summary:
Small refactor. Keep it in a single header that other files could use.

Ref T8515

Reviewers: brunobelo, felipealmeida, jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8515

Differential Revision: https://phab.enlightenment.org/D10852
2019-12-10 15:05:43 -03:00
Lauro Moura f793939315 csharp: Refactor annotation selection function
Summary:
Better names to convey their intent and formatting.

Removing the hardcoded `return` from them will also free the return list
to be used for `@out` parameters as they have similar semantics to
`return`, different from regular `@in` parameters. This change in
behavior will come in a future commit, and explains why are are keeping
both lists for now despite being essentially the same.

Ref T8515

Test Plan: Run existing tests

Reviewers: felipealmeida, brunobelo, jptiz, YOhoho

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8515

Differential Revision: https://phab.enlightenment.org/D10827
2019-12-09 16:40:13 -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
Yeongjong Lee 5448c43bab eolian_mono: remove unused EventArgs parameter of OnXXXEvent
Summary:
if a event doesn't have `EventArgs`, parameter `EventArgs e` of its OnXXXEvent
is naver used.

ref T8414

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

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8414

Differential Revision: https://phab.enlightenment.org/D10656
2019-12-09 13:35:53 -03:00
Bruno da Silva Belo 6d62f66c08 c#: Suppressing warning for CA1724.
Summary: ref T8413

Reviewers: lauromoura, felipealmeida, YOhoho, jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8413

Differential Revision: https://phab.enlightenment.org/D10811
2019-12-09 08:33:52 -03:00
Lauro Moura dfae8c5185 csharp: Simplify field_argument_assignment
Summary: Avoid extra generator calls.

Reviewers: jptiz

Reviewed By: jptiz

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10774
2019-12-02 17:01:43 -03:00
Lauro Moura f10c91cda9 csharp: CA1717 - Add [Flags] for enums
Summary:
Using the naive approach of checking if the name ends with `Flags`.

Ref T8411

Depends on D10708

Reviewers: brunobelo, segfaultxavi, felipealmeida, YOhoho

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8411

Differential Revision: https://phab.enlightenment.org/D10709
2019-11-26 12:40:32 -03:00
Lauro Moura 11094aeaaf csharp: Add more since tags to members
Summary:
- Class constructors and other members
- Aliases fields

ref T8359

Reviewers: felipealmeida, segfaultxavi, brunobelo, woohyun

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8359

Differential Revision: https://phab.enlightenment.org/D10419
2019-11-26 12:40:32 -03:00
Lauro Moura 642b243df9 csharp: Fix helper function
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
2019-11-22 12:01:59 -03:00
Lauro Moura 0c9ddb0f34 csharp: CA1307 Add CultureInfo to generated code.
Summary:
For the struct fields with strings when implementing `GetHashCode`.

Ref T8405

Reviewers: brunobelo, felipealmeida, YOhoho

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8405

Differential Revision: https://phab.enlightenment.org/D10696
2019-11-20 18:34:08 -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