Commit Graph

192 Commits

Author SHA1 Message Date
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 cfa8baa152 mono: merge namespaces
Summary:
This patch merge namespaces to improve readablity.
Before
```
namespace Efl {
namespace Canvas {
```

After
```
namespace Efl.Canvas {
```

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/D10436
2019-10-17 14:35:37 -03:00
Yeongjong Lee 711823cb1d mono: remove underscores of Efl_Op_Description, Efl_Object_Ops
Summary:
C# does not use underscore in type name.

ref T8333

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

Reviewers: lauromoura, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8333

Differential Revision: https://phab.enlightenment.org/D10422
2019-10-17 14:24:01 -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
Felipe Magno de Almeida 125f7b33ec csharp: Add since documentation to struct and struct fields
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D10385
2019-10-15 16:01:08 -03:00
Lauro Moura 31bc3beb22 csharp: Avoid direct usage of some dllimport funcs
Summary:
Instead of accessing them directly, generated code should access them
only through proper managed wrappers.

JIT should take care of inline them.

This would allow D10338 without depending on the friendly assembly feature.

Reviewers: YOhoho, felipealmeida, brunobelo, woohyun, segfaultxavi

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10366
2019-10-15 10:11:09 -03:00
Felipe Magno de Almeida e60ba39364 csharp: Add since documentation to Async methods
Reviewers: lauromoura

Reviewed By: lauromoura

After review, fixed formatting and indentation.

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8359

Differential Revision: https://phab.enlightenment.org/D10384
2019-10-14 00:48:19 -03:00
Lauro Moura 3358d9d475 csharp: Add since info to members related to events.
Like OnFooEvent, FooEvents, etc.

ref T8359

Differential Revision: https://phab.enlightenment.org/D10382
2019-10-12 19:20:58 -03:00
Lauro Moura b1a1cdc701 eolian-cxx: Rename fields to standard naming
Summary: bool fields were missing the `is_` prefix.

Reviewers: felipealmeida, brunobelo, segfaultxavi, woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10380
2019-10-12 18:36:44 -03:00
Lauro Moura fb7c35269c csharp: Respect beta for type aliases
Summary: Also add beta info to `alias_def` in eolian_cxx.

Reviewers: brunobelo, felipealmeida, woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10315
2019-10-09 16:45:30 +02:00
Xavi Artigas 9dcfe4bbbc mono-docs: Merge Property and getter/setter docs
Summary:
Property docs, when present, should always be included in Property and Accessor
(setter and getter) docs.
Accessor docs, when present, should be included in their accessor method, and
also in the property method, as a side note.
This patch does just that.

Depends on D10285
Ref T8309

Test Plan: Generate docs and take a look at `Efl.Ui.Calendar`, for example, which has a bit of everything.

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8309

Differential Revision: https://phab.enlightenment.org/D10298
2019-10-09 16:18:30 +02:00
Lauro Moura d5c8d05292 csharp: Move locks inside AddRemove native handlers
Summary:
Instead of using a lock block in every method definition, we just need
them inside the actual methods adding/removing the handlers.

Kudos to @herb for the suggestion.

Reviewers: felipealmeida, herb, brunobelo

Reviewed By: brunobelo

Subscribers: cedric, #reviewers, herb, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9758
2019-10-04 10:12:57 -03:00
Bruno da Silva Belo 04a49f5875 csharp: Standardizing doc tag.
Reviewers: felipealmeida, brunobelo, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10280
2019-10-04 08:51:04 +02:00
Xavi Artigas 09859cacf2 mono-docs: Formatting of @since tags
Use a line break <br/> now that we can properly escape these things.
Previously we appended (Since EFL X.XX) which didn't look very nice.
2019-09-30 18:05:07 +02:00
Jaehyun Cho 8937ee4cf6 eolian_mono: support beta for enum if mono-beta is enabled
Summary: this generates beta enum with `-Dmono-beta=true`.

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

Reviewers: lauromoura, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10246
2019-09-30 15:51:31 +09:00
Yeongjong Lee d1dd3c30b9 eolian_mono: Respect beta for enum
Summary: this prevent generating beta enum with `-Dmono-beta=false`.

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

Reviewers: lauromoura, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10245
2019-09-30 13:52:45 +09:00
Mike Blumenkrantz 9b0197e2af efl/player: pos -> playback_position
ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10112
2019-09-24 15:23:11 -07:00
Bruno da Silva Belo 91ac3774b5 eolian: fixing switch case.
Summary: Scope of the switch breaks compilation.

Reviewers: felipealmeida, segfaultxavi, brunobelo

Reviewed By: brunobelo

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

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10118
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
Bruno da Silva Belo 15897cd9c3 efl-mono: Additional blank line between all methods.
Summary:
For better indentation, adding a blank line in the end of
methods.

Test Plan:
using efl_ui_layout.eo.cs, efl_access_object.eo.cs, efl_part.eo.cs and efl_ui_factory_bind.eo.cs as references,
apply changes to the code then check the diffs of after and before of the references files

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

Subscribers: cedric, felipealmeida, lauromoura

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

Maniphest Tasks: T8167

Differential Revision: https://phab.enlightenment.org/D9712
2019-09-23 21:28:14 -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
Lauro Moura 32f92d3d86 csharp: Add support for default param references in documentation
Summary:
This also adds the information of default values in `parameter_def`.
This will help adding actual default parameter support in the C#
bindings.

Thanks to @segfaultxavi for improved formatting and escaping.

Fixes T8224

Reviewers: segfaultxavi, felipealmeida, brunobelo

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, segfaultxavi, #committers

Tags: #efl

Maniphest Tasks: T8224

Differential Revision: https://phab.enlightenment.org/D10050
2019-09-20 16:23:54 +02:00
Xavi Artigas 4673120a19 mono-docs: Allow embedding examples in XML format
XML examples must provide their own <example> and <code> tags, and these
tags MUST be escaped: \< \> \" etc.
This is more inconvenient, but it allows adding explanatory text outside
the <code> and inside the <example>.
Examples are first looked for in XML format, and if not found, in CS format.
2019-09-17 12:02:19 +02:00
Xavi Artigas 6bac60262e eolian_gen: add missing param doc for event raising 2019-09-13 14:26:21 +02:00
Jaehyun Cho 993b337e67 eolian_mono: fix documentation warning by using "<" and ">"
Summary:
If type A: list<B>; is written in eo, then documentation warning
occurs because list<B> is written in the documentation without string
conversion.

To fix the warning, "<" and ">" are converted into "&lt;" and "&gt;".

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9891
2019-09-11 17:15:56 -03:00
Yeongjong Lee 4bacfe155f csharp: skip static members from interfaces
Summary:
Static methods of eo-interface are generated in c# interface-concrete. there are
4 methods
`efl_access_object_access_root_get`, `efl_access_object_event_emit`,
`efl_access_object_event_handler_add`, `efl_access_object_event_handler_del`

If a class that inherits that interface, static method can't be called via
classname.

This commit changes eolian_mono by removing those static members from the C#
interface-concretes. If a generated class implements the interface, the static
member is generated as static member of the class directly.

Depends on D9800

Test Plan: Check that `Efl.Ui.Widget` has `public static Efl.Object AccessRoot` property.

Reviewers: lauromoura, felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9893
2019-09-10 19:47:47 -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 6ce53b9c0f eolian-mono: Changing order of scope and modifier.
Summary: sealed public is now public sealed and virtual public is public virtual

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

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

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

Maniphest Tasks: T8172

Differential Revision: https://phab.enlightenment.org/D9725
2019-09-10 17:06:18 -03: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
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 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
Xavi Artigas aa4c59b0de mono-docs: Remove useless semicolon from doc comments 2019-08-28 13:42:28 +02: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 b4a6444473 csharp: Only build extension methods for beta
Reviewers: felipealmeida, SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9714
2019-08-23 14:26:24 -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
Felipe Magno de Almeida 1aa05ab41b eolian-mono: Add support for multi-value properties with tuples
Summary: T8133

Reviewers: woohyun, segfaultxavi, felipealmeida

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9577
2019-08-23 14:07:09 -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
Yeongjong Lee 97510fc571 efl_input_hold: replace hold property name with input_hold
Sorry to touch stable eo classes. there is name conflict issue between class and
property when binding language is generated from eo. for example in C#, compiler
error occurs.

```
src/bindings/mono/efl_input_hold.eo.cs(166,17): error CS0542:
`Efl.Input.Hold.Hold': member names cannot be the same as their enclosing type
```

This patch changes Efl.Input.Hold.GetHold/SetHold to
Efl.Input.Hold.GetInputHold/SetInputHold and generates Efl.Input.Hold.InputHold
property.

Note that CAPI is not changed.

ref T8093

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lauro Neto <lauromauro_>
Differential Revision: https://phab.enlightenment.org/D9484
2019-08-06 11:05:30 +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
Yeongjong Lee f2b1f312a9 efl_input_key: replace key property name with key_sym
Summary:
Sorry to touch stable eo classes. there is name conflict issue between class and
property when binding language is generated from eo. for example in C#, compiler
error occurs.

```
src/bindings/mono/efl_input_key.eo.cs(272,26): error CS0542:
`Efl.Input.Key.Key': member names cannot be the same as their enclosing type
```

This patch changes Efl.Input.Key.GetKey/SetKey method to
Efl.Input.Key.GetKeySym/SetKeySym and generates Efl.Input.Key.KeySym
property.

Note that CAPI is not changed.

ref T8093

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

Reviewers: lauromoura, woohyun, zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8093

Differential Revision: https://phab.enlightenment.org/D9483

zmike note: this class was not released at the point of this patch, the class
was only recently marked as stable
2019-08-05 08:51:22 -04:00
Xavi Artigas d13c59fb89 mono-docs: Add more event args link for event handlers
There were some events missing <value> tags (see f01b113401)
2019-08-02 17:29:27 +02:00
Xavi Artigas 6764535aae mono-docs: Escape the recently added docs
This is the second time I forget...
2019-08-02 16:15:20 +02:00
Xavi Artigas e4a2e7cb55 mono-docs: Add descriptions to event args
Event args structs had fields without description (missing <value> tag).
2019-08-02 14:03:26 +02:00
Xavi Artigas 3fd5542f6d mono-docs: Proper indentation for previous commit 2019-08-02 13:53:19 +02:00
Xavi Artigas f01b113401 mono-docs: Add event args link for event handlers
For some reason DocFX does not generate links for templated event handlers:
event EventHandler<Efl.Input.IInterfacePointerOutEvt_Args> PointerOutEvt;

After unsuccessfully trying to find out why, this patch adds the link to the
event arguments in a <value> tag, so at least it shows in the documentation
and the reader has somewhere to click to find out what arguments an event
is sending.
2019-08-02 13:49:20 +02:00
Lauro Moura ca813f41a6 csharp: Add a documentation_string generator
Summary:
Escapes a single string, without leading `///`

Depends on D9481

Reviewers: segfaultxavi, felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9482
2019-08-01 21:12:36 +02:00