Commit Graph

18 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
Bruno da Silva Belo 09744f6c28 csharp: updating efl_csharp_application docs.
Summary: ref T8345

Reviewers: lauromoura, felipealmeida, segfaultxavi, woohyun

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8345

Differential Revision: https://phab.enlightenment.org/D10379
2019-10-14 00:59:20 -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
Lauro Moura b19953fe3a csharp: Add missing since docs to a bunch of classes.
Summary:
Proper documentation will come in later commits.

ref T8293

Reviewers: woohyun, felipealmeida, segfaultxavi, brunobelo

Reviewed By: felipealmeida

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8293

Differential Revision: https://phab.enlightenment.org/D10260
2019-10-01 00:10:15 -03:00
Bruno da Silva Belo c681b3a1b3 csharp: Registering events when using Components.Basic.
Summary:
With `Components.Basic`, it isn't registering events,
while `Components.Ui` do with `elm_init`

Fixes T7770
Thanks @lauromoura

Test Plan: Look T7770

Reviewers: lauromoura, felipealmeida

Reviewed By: lauromoura

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

Tags: #efl

Maniphest Tasks: T7770

Differential Revision: https://phab.enlightenment.org/D9909
2019-09-11 17:30:19 -03: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
Vitor Sousa 4496022a3c csharp: fix Eina_Stringshare support in containers for manual and generated API
Summary:
Both C strings and eina stringshares are bound as regular strings in EFL#, as
working directly with these types would demand unnecessary hassle from the user
viewpoint.
But for eina containers this distinction is important, and since C# generics
do not provide a convenient way of dealing with the same type requiring a
different management based on some other condition (at least not without
compromising the usability for other types), we added a simple `System.String`
wrapper named `Eina.Stringshare` that works as a placeholder for signaling
this distinction.

Working with this class should be transparent in most use cases because it
converts to and from `System.String` implicitly.
It also implements equality/inequality methods for easier comparison with
strings and other stringshare objects.

Add new methods and a new container element trait for dealing specifically
with `Eina_Stringshare` elements.

Adapt eolian_mono to identify and generate the proper placeholder in methods
that require stringshare containers.

Remove some direct uses of DllImport-ed functions in favor of more flexible
manual binding methods.

Move `Eina.Stringshare` DllImport directives to a static class named
`NativeMethods`, in accordance with the code design warning CA1060.
Also add a TODO comment to move all other DllImport directives to this class.

Change parameter of the method `Efl.Csharp.Application.OnInitialize` from
`Eina.Array<System.String>` to `string[]`.
This will make this API more similar with the default C# way of receiving
command line arguments.

Add tests for containers storing stringshare elements.

Reviewers: felipealmeida, lauromoura, segfaultxavi, bu5hm4n

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9178
2019-06-28 10:44:52 -03:00
Xavi Artigas 7f907ecd9d efl-mono: Use Efl.Ui.Win API instead of Elm.Policy
Summary:
This removes another bit of legacy API from the C# bindings.
This also reverts "elm: Put back Policy and Policy_Quit in EO files"
(a9132a9a66) so that these two Elm enums are
definitely out of the EO files.

Test Plan:
Everything, including mono bindings, continue to build.
At runtime, C# apps still exit when all windows are closed.

Reviewers: lauromoura, vitor.sousa, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8890
2019-05-14 14:33:21 +02:00
Jaehyun Cho 0d37e8ff49 mono: fix space and brace warnings of StyleCop
Summary:
The following warning rules of StyleCop are checked.
Space rules  : SA1000, SA1003, SA1008, SA1009, SA1010, SA1011
Brace rules  : SA1500, SA1501, SA1502, SA1503, SA1513

Indentation is also applied.

Reviewers: lauromoura, felipealmeida, vitor.sousa, woohyun

Reviewed By: vitor.sousa

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8485
2019-04-02 16:57:52 +02:00
Jaehyun Cho 2b9278c984 efl_mono: remove unnecessary external function import
ecore_init, ecore_shutdown, elm_init, elm_policy_set, elm_shutdown,
elm_exit are imported in efl_all.cs.
Moreover, efl_csharp_application.cs is using Efl.UnsafeNativeMethods.
Therefore, the unnecessary external function import is removed in
efl_all.cs.
2019-03-25 19:30:50 +09:00
Lauro Moura 0860c4f1d7 csharp: Remove missing doc warning by filling them.
Summary:
Added basic documentation for things that were missing.

Some other files are silent due to a pragma disabling CS1591. They
should be handled later.

Also, removed `Efl.Io.Positioner` from the blacklist as it is referenced
from the `Efl.Io.Reader.eos` event documentation.

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: felipealmeida, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8370
2019-03-20 11:35:58 +01:00
Lauro Moura f29ceef500 efl-csharp: Respect beta for classes and other stuff.
Summary:
In order to work around an issue with Efl.App, which is stable but
inherits from Efl.Core.Command_Line, @beta interfaces/mixins in the
inheritance chain are simply skipped.

Also changed the class used int test for inheritance from C#

Efl.Loop is stable but internally it uses a @beta class as argument to
its Register() method in the constructor. When instantiating a
user-defined C# subclass, the binding calls the C# override in the
NativeInherit class and the marshalling fails as no code is generated
for the beta class.

Also moved Efl.Part test to a beta class. Efl.Part is still beta.

Regarding parts, they are skipped if its class is @beta too.

Also rejected all elm_* files in elm public eo files. They should get
back in as they are converted to Efl.Ui.* api. An exception is
elm_interface_scrollable.eo, as efl_ui_panel depends on it.

Fixes T7730

Test Plan: Run tests

Reviewers: vitor.sousa, segfaultxavi, felipealmeida, cedric, bu5hm4n, zmike

Reviewed By: vitor.sousa

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7730

Differential Revision: https://phab.enlightenment.org/D8268
2019-03-11 16:08:04 -03:00
Marcel Hollerbach 3b262340ba Revert "Revert command line array object because it's broken by design"
This reverts commit a57c7f7510.

I pretty much hate to just revert your revert, but you failed to read my
replies, and failed to understand what i was talking about.

And YES we talked at fosdem about the platform issue, and do you
remember my answer, that back in time this might be the case, today is
different freebsd suppoerts setenv, and for windows we have a setenv
implementation in evil. And yes, vtorri also created a issue how bad and
evil this commit is, however, i still fail to see the issue since setenv
unsetenv and clearenv usages are taken as needed. (T7693)

The ownership question is answered in
https://phab.enlightenment.org/D7516#137367.

Can we please get into a state of technical discussions, and not *oh
shit, i am going to revert this* this has been in review for a long
time, a lots of people have tested it, we discussed things on it, and
there was 3 weeks of no reply from you.

The issues that exist will be dealed with. Feel free to create tasks if
you want :)
2019-02-12 21:42:33 +01:00
Carsten Haitzler a57c7f7510 Revert command line array object because it's broken by design
Revert "ecore: get rid of commands in efl_task."
  This reverts commit 616381e9cf.
Revert "ecore: here comes a command line object"
  This reverts commit 48e5684b3c.

1. this is broken:

EOLIAN static const char*
_efl_core_command_line_command_get(const Eo *obj EINA_UNUSED, Efl_Core_Command_Line_Data *pd)
{
   return eina_strdup(pd->string_command);
}

it returns a const char * BUT it duplicates it on return. no. a big
fat honking NO. return a char * or don't duplicate. pick.

2. _efl_core_command_line_command_array_set() is broken by design. it
accepts an array of strings, but the strings are owned by the caller
who creates the array (requiring they free them up themselves after
this call) but the array becomes owned by the callee. the code here frees the
incoming array but doesn't care about the string content of it. it's
leak heaven waiting to happen (or bugs when someone wants to access
the array they create to walk it to free the strings they put into it
after it is set).

i brought this up and it was dismissed. now exactly he issue i brought
up is there with mixed ownership and the added complexity as well as
transfer of some ownership but not others.

go back and think about this so it isn't broken by design.
2019-02-12 19:54:35 +00:00
Marcel Hollerbach 616381e9cf ecore: get rid of commands in efl_task.
Note that the usage in efl_thread.c should and could be removed.
the problem with its usage is that when the ARGUMENTS event is fired,
noone ever had the chance to subscribe to the loop of the thread yet. So
all in all this is unneccessary, since noone could ever touch that.

Differential Revision: https://phab.enlightenment.org/D7517
2019-02-12 11:19:28 +01:00
Marcel Hollerbach 6a7c273ec7 csharp: add a interface to start apps
Summary:
until to today you had to call init functions and a run function which
were static function in a class called Efl.Ui.Config.

However, calling those init functions there is not really OOP style.
Right now things have changed into a manner where you are defining you
application class with inheriting from the Application /
SimpleApplication abstract.

This enables you to call launch() on your application class, calling
launch there leads to a call to the args function, you can call and use
the Efl classes in there, everything is booted up.
Option parsing and dependency start can still be done in the main method
or application constructor, just ensure that you never call any efl
class / function outside the launch function.

A commit that demonstrates the usage can be found at

ref T7204

https://git.enlightenment.org/tools/examples.git/log/?h=devs/bu5hm4n/POC

Reviewers: felipealmeida, segfaultxavi, Jaehyun_Cho, cedric

Reviewed By: segfaultxavi

Subscribers: zmike, woohyun, akanad, lauromoura, #reviewers, #committers

Tags: #efl_language_bindings

Maniphest Tasks: T7204

Differential Revision: https://phab.enlightenment.org/D7495
2019-01-16 12:49:47 +01:00