summaryrefslogtreecommitdiff
path: root/src/bindings (follow)
AgeCommit message (Collapse)Author
2020-06-09cxx: Fix uses of intrinsic eolian binbuf typeFelipe Magno de Almeida
Add special binbuf and Eina_Strbuf conversions Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11950
2020-06-06build: disable elua by default, plus nicer detectionDaniel Kolesa
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-05-31bindings/lua: simplify some eolian binding codeDaniel Kolesa
2020-05-31bindings/lua: fixes for cffi-luaDaniel Kolesa
2020-05-31bindings/lua: use new _fill api variants for expr valuesDaniel Kolesa
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-31bindings/lua: minor fixes to accommodate cffi-luaDaniel Kolesa
2020-05-29bindings: rename luajit -> luaDaniel Kolesa
2020-05-29bindings/luajit/eolian: get rid of using bitopsDaniel Kolesa
2020-05-21elua: prepare for compatibility with cffi-lua (use ffi.nullptr)Daniel Kolesa
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-07Use __func__ C99 identifier instead of __FUNCTION__ compiler extensionVincent Torri
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-07cxx: Initialize _list and _node with nullptrJoão Paulo Taylor Ienczak Zanette
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-03-23C#: Update C# code-generation to use a new ICustomMarshaler in some string ↵Lucas Cavalcante de Sousa
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-02-18eolian-mono: Make Get/Set internal for generated propertiesFelipe Magno de Almeida
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-13efl_mono: Create insert list/array c# wrapper for eina_value.Lucas Cavalcante de Sousa
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-13csharp: Prevent using system dll for eflcustomexportsmonoJoão Paulo Taylor Ienczak Zanette
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-04csharp: implement GetChildrenIndex for GenericModelYeongjong Lee
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-01-29eolian_mono: blacklist c-only internal APIsYeongjong Lee
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-29eolian_mono: change property name from args to ArgsYeongjong Lee
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-28eolian_mono: make struct immutableYeongjong Lee
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-23csharp: cleanup concrete classYeongjong Lee
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-22Revert "efl_mono: remove class ExtensionTag"Jaehyun Cho
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 76631f502a8234c04ed8124bfdebe62ed5bdf954.
2020-01-21Revert "csharp: Property Indexer implementation"Yeongjong Lee
Summary: This reverts commit 0954e501fd4008c40b3848de1f2c91bcd53b2f71. 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-15c#: Remove warning about unused variableFelipe Magno de Almeida
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11097
2020-01-15efl_mono: remove class ExtensionTagJaehyun Cho
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-14eina_mono: replace eina_list and eina_array with IListYeongjong Lee
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-06csharp: rename ExtensionMethodsYeongjong Lee
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
2019-12-30csharp: Add StyleCop support to dotnet buildLauro Moura
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-26c#: Checking null for parameters.Bruno da Silva Belo
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-23eina_mono: make internal classes internalYeongjong Lee
This hide internal classes.. Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D10912
2019-12-23eo_mono: make BindingEntityAttribute internalYeongjong Lee
`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-23eo_mono: make Eo.Globals internalYeongjong Lee
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-23csharp: Property Indexer implementationLauro Moura
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-23c#: Fixing ca2208 for Eina.List.Bruno da Silva Belo
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-22c#: Implement IList to Eina.Array.Bruno da Silva Belo
ref T8488 Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D10785
2019-12-20csharp: add documentation of class Efl.Eo.Config in iwrapperJaehyun Cho
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-19Fix invalid XML comment in efl_mono.dll.configFelipe Magno de Almeida
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-19csharp: remove unused code in workaroundYeongjong Lee
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-18csharp: Fix passing acessor with ownershipLauro Moura
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-18csharp: Fix accessor IEnumerable implementation.Lauro Moura
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-17csharp : add move tag info to EinaAccessor, EinaIterator converterYeongjong Lee
Summary: Included commits in devs/lauromoura/remove_eina_mono-rebased ``` commit ed6679db1901c710cc6ddb50e7001cfd20caa77a 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-17eina_mono: replace EinaAccessor and EinaIerator with IEnumerableYeongjong Lee
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-17csharp: Suppressing non-events Raise methods.Bruno da Silva Belo
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-17csharp:Suppressing Warning and Add suffix collection.Bruno da Silva Belo
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-17csharp: apply same form of "Since EFL" to all manual bindings .cs filesJaehyun Cho
The following form of "Since EFL" is applied to descriptions of all manual bindings .cs files. /// <para>Since EFL 1.XX.</para>
2019-12-12csharp: Implement Deconstruct for structs.João Paulo Taylor Ienczak Zanette
Summary: Usage example: ``` var (x, y) = somePos2D; ``` Not available on Mono environment due to [`mcs` not implementing it](https://github.com/mono/mono/blob/a3de0304a190c54124df3486ce9c34b6262787a8/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-11c#: Implement IList<T> to Eina.List.Bruno da Silva Belo
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-09eolian_mono: reduce duplicated code in OnXXXEventYeongjong Lee
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-09c#: Suppressing warning for CA1724.Bruno da Silva Belo
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-09csharp: changing string literal with nameof.Lauro Moura
Summary: ref T8407 Reviewers: lauromoura, felipealmeida, YOhoho, jptiz Reviewed By: jptiz Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8407 Differential Revision: https://phab.enlightenment.org/D10668
2019-12-04charp: Require mono bindings when using dotnetLauro Moura
Allow using `-Ddotnet=true` to automatically pull `bindings=mono`. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10610