[EGIT] [core/efl] master 01/02: csharp: updating eina_accessor docs and hide api.
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3f4c7637dbee7d7ab0eac8aff5b21bb1ab2cf225 commit 3f4c7637dbee7d7ab0eac8aff5b21bb1ab2cf225 Author: Bruno da Silva Belo Date: Tue Oct 8 21:49:04 2019 -0300 csharp: updating eina_accessor docs and hide api. Reviewers: felipealmeida, lauromoura, segfaultxavi, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8293 Differential Revision: https://phab.enlightenment.org/D10308 --- src/bindings/mono/eina_mono/eina_accessor.cs | 66 +++- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/src/bindings/mono/eina_mono/eina_accessor.cs b/src/bindings/mono/eina_mono/eina_accessor.cs index 5880503062..c848a2cf97 100644 --- a/src/bindings/mono/eina_mono/eina_accessor.cs +++ b/src/bindings/mono/eina_mono/eina_accessor.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.ComponentModel; using static Eina.TraitFunctions; @@ -20,19 +21,23 @@ internal class AccessorNativeFunctions /// Accessors provide an uniform way of accessing Eina containers, /// similar to C++ STL's and C# IEnumerable. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class Accessor : IEnumerable, IDisposable { /// Pointer to the native accessor. +[EditorBrowsable(EditorBrowsableState.Never)] public IntPtr Handle { get; private set; } = IntPtr.Zero; -/// Who is in charge of releasing the resources wrapped by this instance. +/// Who is in charge of releasing the resources wrapped by this instance. +/// Since EFL 1.23. +/// private Ownership Ownership { get; set; } // FIXME Part of the implicit EFL Container interface. Need to make it explicit. -///Whether this wrapper owns the native accessor. +/// Whether this wrapper owns the native accessor. +/// Since EFL 1.23. +/// public bool Own { get @@ -45,31 +50,42 @@ public class Accessor : IEnumerable, IDisposable } } -/// Create a new accessor wrapping the given pointer. +/// Create a new accessor wrapping the given pointer. +/// Since EFL 1.23. +/// /// The native handle to be wrapped. /// Whether this wrapper owns the native accessor. +[EditorBrowsable(EditorBrowsableState.Never)] public Accessor(IntPtr handle, Ownership owner = Ownership.Managed) { Handle = handle; Ownership = owner; } -/// Create a new accessor wrapping the given pointer. +/// Create a new accessor wrapping the given pointer. +/// Since EFL 1.23. +/// /// The native handle to be wrapped. /// Whether this wrapper owns the native accessor. /// For compatibility with other EFL# containers. Ignored in acessors. +[EditorBrowsable(EditorBrowsableState.Never)] public Accessor(IntPtr handle, bool own, bool ownContent = false) : this(handle, own ? Ownership.Managed : Ownership.Unmanaged) { } -/// Release the native resources held by this instance. +/// Release the native resources held by this instance. +/// Since EFL 1.23. +/// public void Dispose() { Dispose(true); } -/// Disposes of this wrapper, releasing the native accessor if owned. +/// Disposes of this wrapper, releasing the native accessor if +/// owned. +/// Since EFL 1.23. +/// /// True if this was called from public method. False if /// called from the C# finalizer. protected virtual void Dispose(bool disposing) @@ -88,22 +104,28 @@ public class Accessor : IEnumerable, IDisposable } } -/// Finalizer to be called from the Garbage Collector. +/// Finalizer to be called from the Garbage Collector. +/// Since EFL 1.23. +/// ~Accessor() { Dispose(false); } /// Convert the native data into managed. This is used when returning the data through a -/// . +/// . +/// Since EFL 1.23. +/// /// The data to be converted /// The managed data representing data. -protected virtual T Convert(IntPtr data) +internal virtual T Convert(IntPtr data) { return NativeToManaged(data); } -/// Returns an enumerator that iterates throught this accessor. +/// Returns an enumerator that iterates throught this accessor. +/// Since EFL 1.23. +/// /// An enumerator to walk through the acessor items. public IEnumerator GetEnumerator() { @@ -137,14 +159,16 @@ public class Accessor : IEnumerable, IDisposable } /// Accessor for Inlists. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class AccessorInList : Accessor { -/// Create a new accessor wrapping the given pointer. +/// Cr
[EGIT] [core/efl] master 02/02: csharp: updating eina_binbuf docs and hide api.
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=85c57500ea8cbbea1ecb7b489060df8855ed1387 commit 85c57500ea8cbbea1ecb7b489060df8855ed1387 Author: Bruno da Silva Belo Date: Tue Oct 8 22:05:34 2019 -0300 csharp: updating eina_binbuf docs and hide api. Reviewers: felipealmeida, lauromoura, segfaultxavi, woohyun Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8293 Differential Revision: https://phab.enlightenment.org/D10310 --- src/bindings/mono/eina_mono/eina_binbuf.cs | 64 -- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/src/bindings/mono/eina_mono/eina_binbuf.cs b/src/bindings/mono/eina_mono/eina_binbuf.cs index e2c2d8436a..63b42e239d 100644 --- a/src/bindings/mono/eina_mono/eina_binbuf.cs +++ b/src/bindings/mono/eina_mono/eina_binbuf.cs @@ -2,14 +2,14 @@ using System; using System.Runtime.InteropServices; +using System.ComponentModel; namespace Eina { /// /// A Generic buffer designed to be a mutable string. -/// -/// Since EFL 1.23. +/// Since EFL 1.23. /// public class Binbuf : IDisposable { @@ -45,11 +45,16 @@ public class Binbuf : IDisposable eina_binbuf_slice_get(IntPtr buf); /// Pointer to the native buffer. +[EditorBrowsable(EditorBrowsableState.Never)] public IntPtr Handle {get;set;} = IntPtr.Zero; -///Whether this wrapper owns the native buffer. +/// Whether this wrapper owns the native buffer. +/// Since EFL 1.23. +/// public bool Own {get;set;} -/// Length of the buffer. +/// Length of the buffer. +/// Since EFL 1.23. +/// public int Length { get { return (int)GetLength(); } @@ -67,12 +72,17 @@ public class Binbuf : IDisposable /// /// Create a new buffer. +/// Since EFL 1.23. /// public Binbuf() { InitNew(); } +/// +/// Create a new buffer. +/// Since EFL 1.23. +/// public Binbuf(byte[] str, uint? length = null) { InitNew(); @@ -90,6 +100,7 @@ public class Binbuf : IDisposable /// /// Create a new buffer with elements. /// +/// Since EFL 1.23. /// Elements to initialize the new buffer. public Binbuf(Binbuf bb) { @@ -106,6 +117,7 @@ public class Binbuf : IDisposable /// /// The native handle to be wrapped. /// Whether this wrapper owns the native handle. +[EditorBrowsable(EditorBrowsableState.Never)] public Binbuf(IntPtr handle, bool own) { Handle = handle; @@ -117,8 +129,11 @@ public class Binbuf : IDisposable Dispose(false); } -/// Disposes of this wrapper, releasing the native buffer if owned. -/// True if this was called from public method. False if +/// Disposes of this wrapper, releasing the native buffer if owned. +/// Since EFL 1.23. +/// +/// True if this was called from +/// public method. False if /// called from the C# finalizer. protected virtual void Dispose(bool disposing) { @@ -137,14 +152,18 @@ public class Binbuf : IDisposable } } -/// Releases the native resources held by this instance. +/// Releases the native resources held by this instance. +/// Since EFL 1.23. +/// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } -/// Releases the native resources held by this instance. +/// Releases the native resources held by this instance. +/// Since EFL 1.23. +/// public void Free() { Dispose(); @@ -152,6 +171,7 @@ public class Binbuf : IDisposable /// /// Releases the native buffer. +/// Since EFL 1.23. /// /// The native buffer. public IntPtr Release() @@ -163,6 +183,7 @@ public class Binbuf : IDisposable /// /// Resets the buffer. +/// Since EFL 1.23. /// public void Reset() { @@ -170,7 +191,9 @@ public class Binbuf : IDisposable } /// -/// Appends a string of inputed buffer's length to the buffer, reallocating as necessary. +/// Appends a string of inputed buffer's length to the buffer, +/// reallocating as necessary. +/// Since EFL 1.23. /// /// The string buffer. /// true on success, false if data could not be appended. @@ -180,7 +203,9 @@ public class Binbuf : IDisposable } /// -/// Appends a string of exact length to the buffer, reallocating as necessary. +/// Appends a string of exact length to the buffer, reallocating +/// as necessary. +/// Since EFL 1.23. /// /// The string buffer. /// The exact length to use. @@ -192,6 +217,7 @@ public class Binbuf : IDisposable /// /// Appends a Binbuf to the buffer. +/// Since EFL 1.23. /
[EGIT] [core/enlightenment] master 01/01: bz5 - ensure we unref bluez dbus objects to free them
raster pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=acee84c8eb31777bda51a93f01cae53abe81572a commit acee84c8eb31777bda51a93f01cae53abe81572a Author: Carsten Haitzler (Rasterman) Date: Tue Oct 8 14:54:52 2019 +0100 bz5 - ensure we unref bluez dbus objects to free them --- src/modules/bluez5/bz.h | 1 + src/modules/bluez5/bz_agent.c | 12 ++--- src/modules/bluez5/bz_obj.c | 58 +-- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/src/modules/bluez5/bz.h b/src/modules/bluez5/bz.h index 2d099977f..63ebe00de 100644 --- a/src/modules/bluez5/bz.h +++ b/src/modules/bluez5/bz.h @@ -13,6 +13,7 @@ typedef struct _Obj Obj; struct _Obj { internal object data + Eldbus_Object *obj; Eldbus_Proxy *proxy; Eldbus_Proxy *prop_proxy; Eldbus_Signal_Handler *prop_sig; diff --git a/src/modules/bluez5/bz_agent.c b/src/modules/bluez5/bz_agent.c index 8eb0489cb..066b7a082 100644 --- a/src/modules/bluez5/bz_agent.c +++ b/src/modules/bluez5/bz_agent.c @@ -2,6 +2,7 @@ #include "e.h" static Eldbus_Service_Interface *agent_iface = NULL; +static Eldbus_Object *agent_obj = NULL; static Eldbus_Proxy *agent_proxy = NULL; static void (*fn_release) (void) = NULL; static void (*fn_cancel) (void) = NULL; @@ -149,6 +150,11 @@ cb_unregister(void *data EINA_UNUSED, const Eldbus_Message *msg, eldbus_proxy_unref(agent_proxy); agent_proxy = NULL; } + if (agent_obj) + { +eldbus_object_unref(agent_obj); +agent_obj = NULL; + } if (agent_iface) { eldbus_service_object_unregister(agent_iface); @@ -266,10 +272,8 @@ bz_agent_msg_u32_add(Eldbus_Message *msg, unsigned int u32) void bz_agent_init(void) { - Eldbus_Object *obj; - - obj = eldbus_object_get(bz_conn, "org.bluez", "/org/bluez"); - agent_proxy = eldbus_proxy_get(obj, "org.bluez.AgentManager1"); + agent_obj = eldbus_object_get(bz_conn, "org.bluez", "/org/bluez"); + agent_proxy = eldbus_proxy_get(agent_obj, "org.bluez.AgentManager1"); agent_iface = eldbus_service_interface_register (bz_conn, "/org/enlightenment/bluez5/agent", &agent_desc); if (agent_proxy) diff --git a/src/modules/bluez5/bz_obj.c b/src/modules/bluez5/bz_obj.c index 8bcf66625..b61dc698f 100644 --- a/src/modules/bluez5/bz_obj.c +++ b/src/modules/bluez5/bz_obj.c @@ -1,6 +1,7 @@ #include "bz.h" #include "e_mod_main.h" +static Eldbus_Object *objman_obj = NULL; static Eldbus_Proxy *objman_proxy = NULL; static Eldbus_Signal_Handler *sig_ifadd = NULL; static Eldbus_Signal_Handler *sig_ifdel = NULL; @@ -295,18 +296,16 @@ cb_obj_prop_changed(void *data EINA_UNUSED, const Eldbus_Message *msg EINA_UNUSE Obj * bz_obj_add(const char *path) { - Eldbus_Object *obj; - Obj *o = calloc(1, sizeof(Obj)); o->ref = 1; o->path = eina_stringshare_add(path); - obj = eldbus_object_get(bz_conn, "org.bluez", o->path); + o->obj = eldbus_object_get(bz_conn, "org.bluez", o->path); o->type = BZ_OBJ_UNKNOWN; o->in_table = EINA_TRUE; eina_hash_add(obj_table, o->path, o); if (!strcmp(o->path, "/org/bluez")) { -o->proxy = eldbus_proxy_get(obj, "org.bluez.AgentManager1"); +o->proxy = eldbus_proxy_get(o->obj, "org.bluez.AgentManager1"); o->type = BZ_OBJ_BLUEZ; o->add_called = EINA_TRUE; bz_obj_ref(o); @@ -317,12 +316,12 @@ bz_obj_add(const char *path) // all devices are /org/bluez/XXX/dev_XXX so look for /dev_ else if (strstr(o->path, "/dev_")) { -o->proxy = eldbus_proxy_get(obj, "org.bluez.Device1"); +o->proxy = eldbus_proxy_get(o->obj, "org.bluez.Device1"); o->type = BZ_OBJ_DEVICE; if (o->proxy) { eldbus_proxy_property_get_all(o->proxy, cb_obj_prop, o); - o->prop_proxy = eldbus_proxy_get(obj, + o->prop_proxy = eldbus_proxy_get(o->obj, "org.freedesktop.DBus.Properties"); if (o->prop_proxy) o->prop_sig = eldbus_proxy_signal_handler_add(o->prop_proxy, @@ -334,12 +333,12 @@ bz_obj_add(const char *path) // all dadapters begin with /org/bluez/ else if (!strncmp(o->path, "/org/bluez/", 11)) { -o->proxy = eldbus_proxy_get(obj, "org.bluez.Adapter1"); +o->proxy = eldbus_proxy_get(o->obj, "org.bluez.Adapter1"); o->type = BZ_OBJ_ADAPTER; if (o->proxy) { eldbus_proxy_property_get_all(o->proxy, cb_obj_prop, o); - o->prop_proxy = eldbus_proxy_get(obj, + o->prop_proxy = eldbus_proxy_get(o->obj, "org.freedesktop.DBus.Properties"); if (o->prop_proxy) o->prop_sig = eldbus_proxy_signal_handler_add(o->prop_proxy, @@ -742,16 +741,6 @@ bz_obj_unref(Obj *o) eldbus_signal_handler_del(o->prop_sig)
[EGIT] [core/efl] master 01/02: csharp: Do not use the System Bus for testing.
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=62a61c3c7c2ef593437b4de5e4653d9227e0b292 commit 62a61c3c7c2ef593437b4de5e4653d9227e0b292 Author: Lauro Moura Date: Tue Oct 8 17:56:37 2019 -0300 csharp: Do not use the System Bus for testing. Summary: To allow the C# bindings running on the CI Reviewers: zmike, brunobelo, felipealmeida, segfaultxavi, stefan_schmidt Reviewed By: stefan_schmidt Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8313 Differential Revision: https://phab.enlightenment.org/D10283 --- src/tests/efl_mono/Eldbus.cs | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/tests/efl_mono/Eldbus.cs b/src/tests/efl_mono/Eldbus.cs index 820c8984ef..0c63a8637d 100644 --- a/src/tests/efl_mono/Eldbus.cs +++ b/src/tests/efl_mono/Eldbus.cs @@ -54,12 +54,6 @@ class TestEldbusConnection conn.Dispose(); } -public static void eldbus_connection_new_system() -{ -var conn = new eldbus.Connection(eldbus.Connection.Type.System); -conn.Dispose(); -} - public static void eldbus_connection_new_starter() { var conn = new eldbus.Connection(eldbus.Connection.Type.Starter); @@ -72,12 +66,6 @@ class TestEldbusConnection conn.Dispose(); } -public static void eldbus_connection_new_private_system() -{ -var conn = eldbus.Connection.GetPrivate(eldbus.Connection.Type.System); -conn.Dispose(); -} - public static void eldbus_connection_new_private_starter() { var conn = eldbus.Connection.GetPrivate(eldbus.Connection.Type.Starter); @@ -96,7 +84,7 @@ class TestEldbusObject { public static void utc_eldbus_object_send_info_get_p() { -var conn = new eldbus.Connection(eldbus.Connection.Type.System); +var conn = new eldbus.Connection(eldbus.Connection.Type.Session); var obj = new eldbus.Object(conn, DBusBus, DBusPath); @@ -176,7 +164,7 @@ class TestEldbusObject public static void utc_eldbus_introspect_p() { -var conn = new eldbus.Connection(eldbus.Connection.Type.System); +var conn = new eldbus.Connection(eldbus.Connection.Type.Session); var obj = new eldbus.Object(conn, DBusBus, DBusPath); @@ -244,7 +232,7 @@ class TestEldbusMessage { isSuccess = false; -var conn = new eldbus.Connection(eldbus.Connection.Type.System); +var conn = new eldbus.Connection(eldbus.Connection.Type.Session); eldbus.Pending pending = conn.ActivatableList(messageCb); @@ -316,7 +304,7 @@ class TestEldbusMessage { isSuccess = false; -var conn = new eldbus.Connection(eldbus.Connection.Type.System); +var conn = new eldbus.Connection(eldbus.Connection.Type.Session); string methodName = "GetId"; eldbus.Message msg = eldbus.Message.NewMethodCall(DBusBus, DBusPath, DBusInterface, methodName); @@ -381,7 +369,7 @@ class TestEldbusMessage public static void utc_eldbus_message_ref_unref_p() { -var conn = new eldbus.Connection(eldbus.Connection.Type.System); +var conn = new eldbus.Connection(eldbus.Connection.Type.Session); eldbus.Message msg = eldbus.Message.NewMethodCall(DBusBus, DBusPath, DBusInterface, "GetId"); --
[EGIT] [core/efl] master 02/02: csharp: removing extra //
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=78cd5df179fe3865a637db946140c0496c9b02dd commit 78cd5df179fe3865a637db946140c0496c9b02dd Author: Bruno da Silva Belo Date: Tue Oct 8 18:01:11 2019 -0300 csharp: removing extra // Summary: dotnet warning about extras / Reviewers: lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8293 Differential Revision: https://phab.enlightenment.org/D10282 --- src/bindings/mono/eina_mono/eina_array.cs | 22 +++ src/bindings/mono/eina_mono/eina_binbuf.cs | 44 +++--- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs index 655fbab03a..0b96920fbd 100644 --- a/src/bindings/mono/eina_mono/eina_array.cs +++ b/src/bindings/mono/eina_mono/eina_array.cs @@ -107,7 +107,7 @@ public class Array : IEnumerable, IDisposable /// /// Create a new array. /// -/ Step size of the array. +/// Step size of the array. public Array(uint step) { InitNew(step); @@ -116,8 +116,8 @@ public class Array : IEnumerable, IDisposable /// /// Create a new array. /// -/ The native handle to be wrapped. -/ Whether this wrapper owns the native handle. +/// The native handle to be wrapped. +/// Whether this wrapper owns the native handle. public Array(IntPtr handle, bool own) { if (handle == IntPtr.Zero) @@ -133,9 +133,9 @@ public class Array : IEnumerable, IDisposable /// /// Create a new array /// -/ The native array to be wrapped. -/ Whether this wrapper owns the native array. -/ For compatibility with other EFL# containers. +/// The native array to be wrapped. +/// Whether this wrapper owns the native array. +/// For compatibility with other EFL# containers. public Array(IntPtr handle, bool own, bool ownContent) { if (handle == IntPtr.Zero) @@ -267,7 +267,7 @@ public class Array : IEnumerable, IDisposable /// /// Inserts the element of the array at the end. /// -/ The value of the element to be inserted. +/// The value of the element to be inserted. public bool Push(T val) { IntPtr ele = ManagedToNativeAlloc(val); @@ -308,7 +308,7 @@ public class Array : IEnumerable, IDisposable /// /// Returns the element of the array at the specified position. /// -/ The position of the desired element. +/// The position of the desired element. /// The element at the specified position public T DataGet(int idx) { @@ -319,7 +319,7 @@ public class Array : IEnumerable, IDisposable /// /// Returns the element of the array at the specified position. /// -/ The position of the desired element. +/// The position of the desired element. /// The element at the specified position public T At(int idx) { @@ -329,8 +329,8 @@ public class Array : IEnumerable, IDisposable /// /// Replaces the element at the specified position. /// -/ The position of the desired element. -/ The value of the element to be inserted. +/// The position of the desired element. +/// The value of the element to be inserted. public void DataSet(int idx, T val) { IntPtr ele = InternalDataGet(idx); // TODO: check bondaries ?? diff --git a/src/bindings/mono/eina_mono/eina_binbuf.cs b/src/bindings/mono/eina_mono/eina_binbuf.cs index 66b89e272d..e2c2d8436a 100644 --- a/src/bindings/mono/eina_mono/eina_binbuf.cs +++ b/src/bindings/mono/eina_mono/eina_binbuf.cs @@ -90,7 +90,7 @@ public class Binbuf : IDisposable /// /// Create a new buffer with elements. /// -/ Elements to initialize the new buffer. +/// Elements to initialize the new buffer. public Binbuf(Binbuf bb) { InitNew(); @@ -104,8 +104,8 @@ public class Binbuf : IDisposable /// /// Create a new buffer. /// -/ The native handle to be wrapped. -/ Whether this wrapper owns the native handle. +/// The native handle to be wrapped. +/// Whether this wrapper owns the native handle. public Binbuf(IntPtr handle, bool own) { Handle = handle; @@ -172,7 +172,7 @@ public class Binbuf : IDisposable /// /// Appends a string of inputed buffer's length to the buffer, reallocating as necessary. /// -/ The string buffer. +/// The string buffer. /// true on success, false if data could not be appended. public bool Append(byte[] str) { @@ -182,8 +182,8 @@ public class Binbuf : IDisposable /// /// Appends a string of exact length to the buffer,
[EGIT] [core/efl] master 01/01: Pyolian: rewritten tests for the pytest framework
davemds pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d2d1313f612f081195ec017f50f0dc4f29730bac commit d2d1313f612f081195ec017f50f0dc4f29730bac Author: Dave Andreoli Date: Tue Oct 8 22:50:55 2019 +0200 Pyolian: rewritten tests for the pytest framework ...much more readable now, worst the pain! :) --- src/scripts/pyolian/test_eolian.py | 895 ++--- 1 file changed, 446 insertions(+), 449 deletions(-) diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py index c6d8afe5c9..bc869c9370 100755 --- a/src/scripts/pyolian/test_eolian.py +++ b/src/scripts/pyolian/test_eolian.py @@ -1,17 +1,19 @@ #!/usr/bin/env python3 # encoding: utf-8 """ -Pyolian test suite. +Pyolian test suite +== -Just run this file to execute the full suite. - -A return value of 0 means all test passed successfully. +to run all the tests: +> pytest test_eolian.py """ import os -import unittest +import sys + +import pytest -import eolian +from . import eolian # Use .eo files from the source tree (not the installed ones) @@ -19,207 +21,233 @@ script_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.abspath(os.path.join(script_path, '..', '..', '..')) SCAN_FOLDER = os.path.join(root_path, 'src', 'lib') + # the main Eolian unit state eolian_db = None -class TestEolian(unittest.TestCase): +@pytest.fixture(scope='module') +def eolian_db(): +db = eolian.Eolian_State() +if not isinstance(db, eolian.Eolian_State): +raise (RuntimeError('Eolian, failed to create Eolian state')) + +# eolian system scan (BROKEN) +# if not eolian_db.system_directory_add(): +# raise(RuntimeError('Eolian, failed to scan system directories')) + +# eolian source tree scan +if not db.directory_add(SCAN_FOLDER): +raise (RuntimeError('Eolian, failed to scan source directory')) + +# Parse all known eo files +if not db.all_eot_files_parse(): +raise (RuntimeError('Eolian, failed to parse all EOT files')) + +if not db.all_eo_files_parse(): +raise (RuntimeError('Eolian, failed to parse all EO files')) + +# tests are executed here +yield db + +# cleanup eolian +del db + + +class TestEolian(object): def test_file_format(self): v = eolian.file_format_version -self.assertIsInstance(v, int) -self.assertGreaterEqual(v, 1) +assert isinstance(v, int) +assert v >= 1 -class TestBaseObject(unittest.TestCase): -def test_base_object_equality(self): +class TestBaseObject(object): +def test_base_object_equality(self, eolian_db): cls1 = eolian_db.class_by_name_get('Efl.Loop_Timer') cls2 = eolian_db.class_by_file_get('efl_loop_timer.eo') -self.assertIsInstance(cls1, eolian.Class) -self.assertIsInstance(cls2, eolian.Class) -self.assertEqual(cls1, cls2) -self.assertEqual(cls1, 'Efl.Loop_Timer') -self.assertEqual(cls2, 'Efl.Loop_Timer') -self.assertNotEqual(cls1, 'another string') -self.assertNotEqual(cls1, 1234) -self.assertNotEqual(cls1, None) -self.assertNotEqual(cls1, 0) +assert isinstance(cls1, eolian.Class) +assert isinstance(cls2, eolian.Class) +assert cls1 == cls2 +assert cls1 == 'Efl.Loop_Timer' +assert cls2 == 'Efl.Loop_Timer' +assert cls1 != 'another string' +assert cls1 != 1234 +assert cls1 is not None +assert cls1 != 0 enum1 = eolian_db.enum_by_name_get('Efl.Ui.Focus.Direction') enum2 = eolian_db.enum_by_name_get('Efl.Ui.Focus.Direction') -self.assertIsInstance(enum1, eolian.Typedecl) -self.assertIsInstance(enum2, eolian.Typedecl) -self.assertEqual(enum1, enum2) -self.assertEqual(enum1, 'Efl.Ui.Focus.Direction') -self.assertEqual(enum2, 'Efl.Ui.Focus.Direction') -self.assertNotEqual(enum1, 'another string') -self.assertNotEqual(enum1, 1234) -self.assertNotEqual(enum1, None) -self.assertNotEqual(enum1, 0) +assert isinstance(enum1, eolian.Typedecl) +assert isinstance(enum2, eolian.Typedecl) +assert enum1 == enum2 +assert enum1 == 'Efl.Ui.Focus.Direction' +assert enum2 == 'Efl.Ui.Focus.Direction' +assert enum1 != 'another string' +assert enum1 != 1234 +assert enum1 is not None +assert enum1 != 0 -self.assertNotEqual(cls1, enum1) +assert cls1 != enum1 -class TestEolianState(unittest.TestCase): -def test_unit_getters(self): +class TestEolianState(object): +def test_unit_getters(self, eolian_db): count = 0 for unit in eolian_db.units: -self.assertIsInstance(unit, eolian.Eolian_Unit) -self.assertTrue(unit.file.endswith(('.eo', '.eot'))) +assert isinstance(unit, eolian.E
[EGIT] [core/efl] master 01/01: efl_ui/container: remove erroneous negative value checks for uint params
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f09a3b5ca3b939c9683b0794eff35c73db75d24c commit f09a3b5ca3b939c9683b0794eff35c73db75d24c Author: Mike Blumenkrantz Date: Tue Oct 8 16:49:02 2019 +0200 efl_ui/container: remove erroneous negative value checks for uint params Summary: ../src/lib/elementary/efl_ui_box.c: In function ‘_efl_ui_box_efl_gfx_arrangement_content_padding_set’: ../src/lib/elementary/efl_ui_box.c:411:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limit ] 411 |if (h < 0) h = 0; | ^ ../src/lib/elementary/efl_ui_box.c:412:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limit ] 412 |if (v < 0) v = 0; | ^ ../src/lib/elementary/efl_ui_table.c: In function ‘_efl_ui_table_efl_gfx_arrangement_content_padding_set’: ../src/lib/elementary/efl_ui_table.c:272:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 272 |if (h < 0) h = 0; | ^ ../src/lib/elementary/efl_ui_table.c:273:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 273 |if (v < 0) v = 0; | ^ Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10304 --- src/lib/elementary/efl_ui_box.c | 3 --- src/lib/elementary/efl_ui_table.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 7d97ec3f85..4f3b29f068 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -408,9 +408,6 @@ _efl_ui_box_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, EOLIAN static void _efl_ui_box_efl_gfx_arrangement_content_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, unsigned int h, unsigned int v) { - if (h < 0) h = 0; - if (v < 0) v = 0; - if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v)) return; diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 9e70116953..db259b0dd3 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -269,9 +269,6 @@ _efl_ui_table_efl_object_invalidate(Eo *obj, Efl_Ui_Table_Data *pd) EOLIAN static void _efl_ui_table_efl_gfx_arrangement_content_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, unsigned int h, unsigned int v) { - if (h < 0) h = 0; - if (v < 0) v = 0; - if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v)) return; --
Re: [E-devel] RFC: Text interface + advice regarding interface splitting
Hey, On 03/10/2019 13:31, Marcel Hollerbach wrote: >> >>> - efl2_text_attribute_factory: >>> - Why having a struct here as handle, i fear that bindings will >>> have >>> a very hard time with this, where you actually pass in a struct to the >>> remove method, and this one is dead after it. >> >> What's your suggested alternative? Anyhow, why would bindings have a >> hard time? Structs have associated free functions and ref/unref, no? I'm >> happy with an alternative, but I'd need a lightweight handle for this. > > Lets say you have a situation in a binded language where you have stored > a reference to this struct in a variable, someone else frees it. What is > now happening when you access this variable in the binded language ? How > can the binded language protect against that while keeping the idea of > having it as a lightweight handle. (The problem is basically classic use > after free, with 2 people having a ref to the struct). I don't understand the problem you're describing. How can it be freed without the bindings knowing about it if they are holding a ref to it? > > For normal eo objects this is solved by invalidate etc. etc. If we now > start to use structs like this, we also need a solution to that problem > for the binded languages, which basically invalidates the argument of > them beeing leightweight handles. Not sure what you mean by "invalidate", but I'd expect this to be solved with eo objects using refcounts too. > > My suggested alternative is just making them a normal eo object, OR > making it not a struct pointer you return but rather some unique ID, > which does not have the problem of unprotected accessing (Definitly the > more leightweight option.) Making them normal eo objects is not really an option (as the whole point is them being lightweight). Having them as a unique ID is the same as having them as a pointer. It's just a matter of dealing with it differently internally (is it actually a pointer we deref or some value we analyse). So I'm not sure how is it any different from an API perspective. I'm actually changing this though, as discussed in a few phab tickets over the last week+, so this discussion is less relevant I guess. > >> >>> - Its also not clear to me how explicit remove plays well with >>> unref. >> >> Remove: removes it from the text object. This means the handle is still >> alive, just disassociated from the text object so it doesn't affect it >> anymore. >> >> Unref: reduces the refcount in case you reffed it before. Used for when >> you kept your own copies. > > Okay, and a handle that is not assosiated with a text object is just > waiting for complete deletion ? Yeah, or you can re-attach it to an object. > >> >>> - the `insert` method should return a owned struct handle ? Or is >>> the user never really owning any of the structs there ? >> >> It's not owned. If you want to use it, you need to immediately ref it >> after it's returned from there. It's done this way so you can safely >> ignore the return value when you don't want it, but also use it when >> you do. > > Oh okay, that was not clear to me. > >> >>> - efl2_text_font_properties / style_properties: (I have criticized the >>> names before, i like the new names.) However, hard to comment more, as i >>> do not know much about text property stuff itself. >> >> No worries, these ones are actually less of a problem for me. >> >>> - efl2_text_wrap_properties: Can you document what impact ellipsis and >>> wrap do have ? >> >> As in: you have questions, or just commenting about the lack of docs? > > As in: I do not understand what the different properties do result in. Wrap does text wrapping and ellipsis does ellipsis. I'm not sure what your question is if you're not just stating that docs should be better. These too are very common and well defined terms. > >>> - efl2_text_markup: >>> - I am not entirely sure how item_factory works here. Is the >>> item_factory knowing to which Efl2.Text_Markup they belong ? If so, >>> shoudnt that be expressed somehow ? >> >> Not sure I understand your question. > > If each item_factory belongs to exactly one Efl2.Text_Markup object. > Then the factory should probebly be owned by the Efl2.Text_Markup object > in order to support correct destruction etc. It's not the case, item_factories can be used multiple times, in tandem, and probably should, as it should just be a singleton. As above though, this is going to change a bit. > >> >>> - efl2_text_item_factory: >>> - Again, why having a struct here, same as above applies to this. >> >> Same answer as before. :) > > see above ... :P > Right back at ya. >> >>> - efl2_text_raw_editable: >>> - Where does this object belong ? We normally only have objects in >>> efl.canvas / ui / layout. But not in efl. itself. >> >> Happy to rename it, though dunno what to. It's somewhere between canvas >> and ui. It's above canvas as it handles input and deals with X, but >> below UI
[EGIT] [core/efl] master 01/01: evas_vg_cache: Hashkey of cache use value provider list
jsuya pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6b2504ba56467fa3409cbfc56214ef3c8b38bd76 commit 6b2504ba56467fa3409cbfc56214ef3c8b38bd76 Author: JunsuChoi Date: Tue Oct 8 18:13:43 2019 +0900 evas_vg_cache: Hashkey of cache use value provider list Summary: Even if the same window, the same file, and the same size, different images may be requested due to property changes caused by value_provider. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10303 --- src/lib/evas/canvas/efl_canvas_vg_object.c | 6 +++--- src/lib/evas/canvas/evas_vg_private.h | 3 ++- src/lib/evas/vg/evas_vg_cache.c| 20 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 660d1ebe1a..800dbefe6d 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -290,7 +290,7 @@ _efl_canvas_vg_object_efl_file_load(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd) pd->vg_entry = evas_cache_vg_entry_create(evas_object_evas_get(eo_obj), file, key, obj->cur->geometry.w, - obj->cur->geometry.h); + obj->cur->geometry.h, NULL); evas_object_change(eo_obj, obj); return 0; @@ -569,6 +569,8 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj, Eina_Bool drop_cache = EINA_FALSE; void *buffer = NULL; + evas_cache_vg_entry_value_provider_update(pd->vg_entry, efl_key_data_get(obj->object, "_vg_value_providers")); + // if the size changed in between path set and the draw call; if ((vg_entry->w != w) || (vg_entry->h != h)) @@ -616,8 +618,6 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj, h = size.h; } - if (pd->vg_entry->vfd) - pd->vg_entry->vfd->vp_list = efl_key_data_get(obj->object, "_vg_value_providers"); root = evas_cache_vg_tree_get(vg_entry, pd->frame_idx); if (!root) return; diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index 9ec89633c2..bbac468723 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -143,8 +143,9 @@ Efl_Gfx_Vg_Value_Provider_Change_Flag efl_gfx_vg_value_provider_changed_flag_get voidevas_cache_vg_init(void); voidevas_cache_vg_shutdown(void); Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *entry, int w, int h); -Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h); +Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, int w, int h, Eina_List *vp_list); Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry, unsigned int frame_num); +void evas_cache_vg_entry_value_provider_update(Vg_Cache_Entry *vg_entry, Eina_List *vp_list); voidevas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key); Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const Efl_File_Save_Info *info); diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index f6a1c1cab2..391d3cb2a9 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -365,14 +365,14 @@ evas_cache_vg_file_open(const Eina_File *file, const char *key) Vg_Cache_Entry* evas_cache_vg_entry_resize(Vg_Cache_Entry *vg_entry, int w, int h) { - return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h); + return evas_cache_vg_entry_create(vg_entry->evas, vg_entry->file, vg_entry->key, w, h, vg_entry->vfd->vp_list); } Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_File *file, const char *key, - int w, int h) + int w, int h, Eina_List *vp_list) { Vg_Cache_Entry* vg_entry; Eina_Strbuf *hash_key; @@ -380,9 +380,9 @@ evas_cache_vg_entry_create(Evas *evas, if (!vg_cache) return NULL; //TODO: zero-sized entry is useless. how to skip it? - + // hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d", evas, file, key, w, h); + eina_strbuf_append_printf(hash_key, "%p/%p/%s/%d/%d/%p", evas, file, key, w, h, vp_list); vg_entry = eina_hash_find(vg_cac
[EGIT] [website/www-content] master 01/01: Wiki page section changed with summary [created] by Xavi Artigas
WWW-www.enlightenment.org pushed a commit to branch master. http://git.enlightenment.org/website/www-content.git/commit/?id=d586f1fac501ff14107bb3661eec4001000994f6 commit d586f1fac501ff14107bb3661eec4001000994f6 Author: Xavi Artigas Date: Tue Oct 8 02:19:14 2019 -0700 Wiki page section changed with summary [created] by Xavi Artigas --- pages/develop/api-include/efl/ui/efl.ui.radio_box/section.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/develop/api-include/efl/ui/efl.ui.radio_box/section.txt b/pages/develop/api-include/efl/ui/efl.ui.radio_box/section.txt new file mode 100644 index 0..86b607d9e --- /dev/null +++ b/pages/develop/api-include/efl/ui/efl.ui.radio_box/section.txt @@ -0,0 +1 @@ +Testing. \ No newline at end of file --
[EGIT] [core/efl] master 01/01: csharp: Add some docs to MVVM infrastructure
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4867c4bdaf3fd2bef2d46b1e3bc872768431a0ea commit 4867c4bdaf3fd2bef2d46b1e3bc872768431a0ea Author: Lauro Moura Date: Tue Oct 8 10:04:57 2019 +0200 csharp: Add some docs to MVVM infrastructure Reviewers: SanghyeonLee, felipealmeida, cedric, segfaultxavi Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10301 --- src/bindings/mono/efl_mono/GenericModel.cs| 13 ++--- src/bindings/mono/efl_mono/UserModel.cs | 18 -- src/lib/efl_mono/efl_mono_model_internal.eo | 12 ++-- src/lib/efl_mono/efl_mono_model_internal_child.eo | 4 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/bindings/mono/efl_mono/GenericModel.cs b/src/bindings/mono/efl_mono/GenericModel.cs index 79cca5f2a5..b9ef325750 100644 --- a/src/bindings/mono/efl_mono/GenericModel.cs +++ b/src/bindings/mono/efl_mono/GenericModel.cs @@ -9,10 +9,17 @@ using Eina; namespace Efl { -/// Generic implementation for MVVM models based on +/// +/// Generic helper class to ease manual implementation of C# models. /// -/// Since EFL 1.23. +/// It provides an expanded API like async helpers to get children. +/// +/// For MVVM-based models, provides a simpler API. +/// +/// Since EFL 1.24. /// +/// The type of the child model. It is the type used when adding/removing/getting items to this +/// model. public class GenericModel : Efl.Object, Efl.IModel, IDisposable { private Efl.IModel model; @@ -78,7 +85,7 @@ public class GenericModel : Efl.Object, Efl.IModel, IDisposable ModelHelper.SetProperties(o, child); } - /// Adds a new childs to the model and returns it. + /// Adds a new child to the model and returns it. public Efl.Object AddChild() { return model.AddChild(); diff --git a/src/bindings/mono/efl_mono/UserModel.cs b/src/bindings/mono/efl_mono/UserModel.cs index 08e6f6e371..c2597cc421 100644 --- a/src/bindings/mono/efl_mono/UserModel.cs +++ b/src/bindings/mono/efl_mono/UserModel.cs @@ -49,8 +49,8 @@ internal class ModelHelper /// Helper class to simplify the creation of MVVM Models based on . /// -/// This class works together with to wrap user defined classes as MVVM models. -/// Example: +/// This class enables usage of simple model classes to define the data to be stored in the native model +/// and presented in a friendly manner to the C# developer. Example: /// /// /// public class PersonModel @@ -65,12 +65,18 @@ internal class ModelHelper /// PersonModel p = await model.GetAtAsync(0); /// /// -/// Since EFL 1.23. +/// Since EFL 1.24. /// +/// The enclosed C# model class with the properties to be added to the native model. [Efl.Eo.BindingEntity] public class UserModel : Efl.MonoModelInternal, IDisposable { - /// Creates a new model. + /// + /// Creates a new root model. + /// + /// The properties of T will be added to the underlying native model as properties the user can get/set on children + /// of this model. + /// /// The parent of the model. public UserModel (Efl.Object parent = null) : base(Efl.MonoModelInternal.efl_mono_model_internal_class_get(), parent) { @@ -87,9 +93,9 @@ public class UserModel : Efl.MonoModelInternal, IDisposable Dispose(false); } - /// Adds a new child to the model wrapping the properites of o + /// Adds a new child to the model wrapping the properties of o /// - /// Reflection is used to instantiate a new for this child and + /// Reflection is used to instantiate a new -based class for this child and /// set the mirroring properties correctly. /// /// diff --git a/src/lib/efl_mono/efl_mono_model_internal.eo b/src/lib/efl_mono/efl_mono_model_internal.eo index 3a639defe7..71b331378b 100644 --- a/src/lib/efl_mono/efl_mono_model_internal.eo +++ b/src/lib/efl_mono/efl_mono_model_internal.eo @@ -1,10 +1,18 @@ class @beta Efl.Mono_Model_Internal extends Efl.Loop_Consumer implements Efl.Model { + [[Internal @Efl.Model implementation for the root models in C# MVVM infrastructure. + +This represents the root model, containing @Efl.Mono_Model_Internal_Child elements. It is inherited from classes +like the C#-only Efl.UserModel, which the end user will actually instantiate. + ]] methods { add_property { + [[Adds a new property to the wrapped children models. + +When adding new children models, these children will have the properties that were added from this method.]] params { -@in name: string; -@in type: ptr(const(Eina.Value_Type)); +@in name: string; [[Name of the property being added.]] +@in type: ptr(const(Eina.Value_Type)); [[Type of the property being added, as an @Eina.Value_Type.]] } }
[EGIT] [core/enlightenment] master 01/01: ckpasswd: remove warning of unused var
raster pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=a0fc5a7c30d64d05b43c803b6bd2bfe11b6fd5e1 commit a0fc5a7c30d64d05b43c803b6bd2bfe11b6fd5e1 Author: Carsten Haitzler (Rasterman) Date: Tue Oct 8 08:48:30 2019 +0100 ckpasswd: remove warning of unused var --- src/bin/e_ckpasswd_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/bin/e_ckpasswd_main.c b/src/bin/e_ckpasswd_main.c index 173c5bd48..8884a68d3 100644 --- a/src/bin/e_ckpasswd_main.c +++ b/src/bin/e_ckpasswd_main.c @@ -192,7 +192,6 @@ polkit_auth(const char *cookie, unsigned int auth_uid) Eldbus_Proxy *proxy; Eldbus_Message *m; Eldbus_Message_Iter *iter, *subj, *array, *dict, *vari; - unsigned int uid; eina_init(); ecore_init(); @@ -208,7 +207,6 @@ polkit_auth(const char *cookie, unsigned int auth_uid) if (!m) return -1; iter = eldbus_message_iter_get(m); if (!iter) return -1; - uid = getuid(); if (eldbus_message_iter_arguments_append(iter, "us", auth_uid, cookie)) { if (eldbus_message_iter_arguments_append(iter, "(sa{sv})", &subj)) --