From 18218f50729fac5d27c004a504ef96d146d6f9e7 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Tue, 9 Jun 2020 10:25:10 +0900 Subject: [PATCH 01/14] evas_common_font: release reallocated glyphs bitmaps data Reviewers: woohyun, smohanty Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8743 Differential Revision: https://phab.enlightenment.org/D11945 --- src/lib/evas/common/evas_font_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c index 799f8a89d0..dfd7ef991b 100644 --- a/src/lib/evas/common/evas_font_main.c +++ b/src/lib/evas/common/evas_font_main.c @@ -597,6 +597,11 @@ _glyph_free(RGBA_Font_Glyph *fg) if ((fg->glyph_out->rle) && (fg->glyph_out->bitmap.rle_alloc)) free(fg->glyph_out->rle); + else if ((fg->glyph_out->bitmap.buffer) && (fg->glyph_out->bitmap.rle_alloc)) + { + free(fg->glyph_out->bitmap.buffer); + fg->glyph_out->bitmap.buffer = NULL; + } fg->glyph_out->rle = NULL; if (!fg->glyph_out->bitmap.no_free_glout) free(fg->glyph_out); fg->glyph_out = NULL; From 53991e0ef6efdbf7df2919bad75618cfbea85105 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Tue, 9 Jun 2020 10:57:20 +0900 Subject: [PATCH 02/14] evas_vg_cache: Don't caching vg file if value_provider is applied. Summary: value_provider can change the value of the property received from VG file. When a file is cached, the changed properties are applied to all other objects using the same file. So. If value provider is applied, evas_vg_cache is not caching vg file. Test Plan: N/A Reviewers: Hermet, herb, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11924 --- src/lib/evas/canvas/evas_vg_private.h | 2 +- src/lib/evas/include/evas_private.h | 2 ++ src/lib/evas/vg/evas_vg_cache.c | 52 +++++++++++++++++---------- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h index c20ed2a1eb..aba4e9d27b 100644 --- a/src/lib/evas/canvas/evas_vg_private.h +++ b/src/lib/evas/canvas/evas_vg_private.h @@ -137,7 +137,7 @@ Vg_Cache_Entry* evas_cache_vg_entry_create(Evas *evas, const Eina_Fi 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); void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry); -Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e); +Vg_File_Data * evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e, Eina_Bool shareable); 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); Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info); double evas_cache_vg_anim_duration_get(const Vg_Cache_Entry *vg_entry); diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 6d00cd7a21..147e2ae0d1 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1140,6 +1140,8 @@ struct _Vg_File_Data Eina_Bool static_viewbox: 1; Eina_Bool preserve_aspect : 1; //Used in SVG + + Eina_Bool shareable: 1; }; struct _Evas_Vg_Load_Func diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index 86c23dfb31..3b3bfaeb96 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -153,14 +153,21 @@ _evas_cache_vg_entry_free_cb(void *data) if (vg_entry->vfd->ref <= 0) { - Eina_Strbuf *hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%s/%s/%p", - eina_file_filename_get(vg_entry->file), - vg_entry->key, - vg_entry->evas); - if (!eina_hash_del(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vg_entry->vfd)) - ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd); - eina_strbuf_free(hash_key); + if (vg_entry->vfd->shareable) + { + Eina_Strbuf *hash_key = eina_strbuf_new(); + eina_strbuf_append_printf(hash_key, "%s/%s/%p", + eina_file_filename_get(vg_entry->file), + vg_entry->key, + vg_entry->evas); + if (!eina_hash_del(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vg_entry->vfd)) + ERR("Failed to delete vfd = (%p) from hash", vg_entry->vfd); + eina_strbuf_free(hash_key); + } + else + { + vg_entry->vfd->loader->file_close(vg_entry->vfd); + } } } @@ -322,21 +329,29 @@ evas_cache_vg_shutdown(void) } Vg_File_Data * -evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e) +evas_cache_vg_file_open(const Eina_File *file, const char *key, Evas *e, Eina_Bool shareable) { Vg_File_Data *vfd; Eina_Strbuf *hash_key; - hash_key = eina_strbuf_new(); - eina_strbuf_append_printf(hash_key, "%s/%s/%p", eina_file_filename_get(file), key, e); - vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key)); - if (!vfd) + if (shareable) + { + hash_key = eina_strbuf_new(); + eina_strbuf_append_printf(hash_key, "%s/%s/%p", eina_file_filename_get(file), key, e); + vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key)); + if (!vfd) + { + vfd = _vg_load_from_file(file, key); + //File exists. + if (vfd) eina_hash_add(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vfd); + } + eina_strbuf_free(hash_key); + } + else { vfd = _vg_load_from_file(file, key); - //File exists. - if (vfd) eina_hash_add(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vfd); } - eina_strbuf_free(hash_key); + if (vfd) vfd->shareable = shareable; return vfd; } @@ -380,7 +395,7 @@ evas_cache_vg_entry_create(Evas *evas, } eina_strbuf_free(hash_key); vg_entry->ref++; - vg_entry->vfd = evas_cache_vg_file_open(file, key, vg_entry->evas); + vg_entry->vfd = evas_cache_vg_file_open(file, key, vg_entry->evas, vp_list ? EINA_FALSE : EINA_TRUE); //No File?? if (!vg_entry->vfd) { @@ -536,7 +551,8 @@ Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const Efl_File_Save_Info *info) { Vg_File_Data *vfd = - evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas); + evas_cache_vg_file_open(vg_entry->file, vg_entry->key, vg_entry->evas + ,vg_entry->vfd ? (vg_entry->vfd->vp_list ? EINA_FALSE : EINA_TRUE): EINA_TRUE); if (!vfd) return EINA_FALSE; From 3c32ec527b3e1fccadad89dace76a25244159d61 Mon Sep 17 00:00:00 2001 From: "Myoungwoon Roy, Kim" Date: Tue, 9 Jun 2020 04:56:30 +0000 Subject: [PATCH 03/14] doxygen docs: Fix API reference group to Ecore_Eo This patch fixs a wrong group name in Ecore_Eo API reference Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11952 --- src/lib/ecore/Ecore_Eo.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h index 4e94344efe..90a0cc38e5 100644 --- a/src/lib/ecore/Ecore_Eo.h +++ b/src/lib/ecore/Ecore_Eo.h @@ -21,7 +21,7 @@ #include "efl_loop_message_future_handler.eo.h" /** - * @addtogroup Ecore_MainLoop_Group + * @addtogroup Ecore_Main_Loop_Group * * @{ */ @@ -93,6 +93,7 @@ EAPI Eo *efl_main_loop_get(void); */ /** + * @ingroup Ecore * @addtogroup Ecore_Fd_Io_Group * * @{ @@ -115,6 +116,7 @@ EAPI Eo *efl_main_loop_get(void); */ /** + * @ingroup Ecore * @addtogroup Ecore_Model_Group * * @{ From 4c2cbecc69c4c08ccacba7d2f6bef072addc3e33 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 9 Jun 2020 09:43:57 +0200 Subject: [PATCH 04/14] Revert "ci: disable wepb loader until we have a change to update the mingw cross env" This reverts commit 63b1334e2c98f0c0f08801ce77d66f372e7abb30. No longer needed as we have updated the mingw image to have 1.1.0 available. --- .ci/ci-configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh index b19f07e5cb..dced2544ff 100755 --- a/.ci/ci-configure.sh +++ b/.ci/ci-configure.sh @@ -37,7 +37,7 @@ if [ "$DISTRO" != "" ] ; then MINGW_COPTS="--cross-file .ci/cross_toolchain.txt -Davahi=false -Deeze=false -Dsystemd=false \ -Dpulseaudio=false -Dx11=false -Dopengl=none -Dlibmount=false \ - -Devas-loaders-disabler=json,pdf,ps,raw,svg,rsvg,webp \ + -Devas-loaders-disabler=json,pdf,ps,raw,svg,rsvg \ -Dharfbuzz=true -Dpixman=true -Dembedded-lz4=false " if [ "$1" = "default" ]; then From ee092073a3c4ce79c582e4467fcce10e51f4696f Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sun, 19 Apr 2020 21:34:17 +0200 Subject: [PATCH 05/14] eo: make the parent a optional constructor this is needed in order to sanely bind parent calls to some objejcts, but not all. However, from the canvas structure up we *need* a parent, so we can fetch the evas from it. So declare it there a none optional Reviewed-by: Felipe Magno de Almeida Differential Revision: https://phab.enlightenment.org/D11734 --- src/lib/eo/efl_object.eo | 3 +++ src/lib/evas/canvas/efl_canvas_object.eo | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 1bf1ea5e58..34460473ef 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -432,6 +432,9 @@ abstract Efl.Object class.constructor; class.destructor; } + constructors { + .parent @optional; + } events { del @hot: void; [[Object is being deleted. See @.destructor.]] invalidate @hot: void; [[Object is being invalidated and losing its parent. See @.invalidate.]] diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo index 21dd3df8ab..64aad581ea 100644 --- a/src/lib/evas/canvas/efl_canvas_object.eo +++ b/src/lib/evas/canvas/efl_canvas_object.eo @@ -483,6 +483,9 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity, } } } + constructors { + Efl.Object.parent; + } implements { Efl.Object.constructor; Efl.Object.finalize; From 1c6f38aa74466a7abdff144bf55937d2c90601d4 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Mon, 8 Jun 2020 18:32:22 -0300 Subject: [PATCH 06/14] dotnet: Ignore Efl.Object.parent as constructor In C# we already have Efl.Object.parent as an implicit constructor. Ignore it if it is marked as a constructor. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11951 --- src/bin/eolian_mono/eolian/mono/helpers.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh index f704ef00af..a13c26a1e8 100644 --- a/src/bin/eolian_mono/eolian/mono/helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/helpers.hh @@ -407,7 +407,15 @@ inline bool is_unique_event(attributes::event_def const& evt inline std::vector reorder_constructors(std::vector constructors) { auto is_required = [](attributes::constructor_def const& ctr) { return !ctr.is_optional; }; + auto is_object_parent = [](attributes::constructor_def const& ctr) + { + return (ctr.klass.namespaces.size() == 1 + && ctr.klass.namespaces[0] == "Efl" + && ctr.klass.eolian_name == "Object" + && ctr.name == "Efl.Object.parent"); + }; std::stable_partition(constructors.begin(), constructors.end(), is_required); + constructors.erase (std::remove_if (constructors.begin(), constructors.end(), is_object_parent), constructors.end()); return constructors; } From dade4fc2f7a75c1f54a4903c3bb9c4c5690f6fa9 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sun, 19 Apr 2020 15:14:12 +0200 Subject: [PATCH 07/14] eo-files: convert all Eina.Strbuf & Eina.Binbuf these structs should not be used, but rather the builtin types that exist for it. Reviewed-by: Felipe Magno de Almeida Differential Revision: https://phab.enlightenment.org/D11742 --- src/lib/ecore/efl_io_copier.eo | 4 ++-- src/lib/efl/interfaces/efl_io_buffer.eo | 2 +- src/lib/eio/efl_io_manager.eo | 4 ++-- src/lib/eo/eina_types.eot | 3 --- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/ecore/efl_io_copier.eo b/src/lib/ecore/efl_io_copier.eo index e172a0c41d..291bdbc0ef 100644 --- a/src/lib/ecore/efl_io_copier.eo +++ b/src/lib/ecore/efl_io_copier.eo @@ -148,7 +148,7 @@ class @beta Efl.Io.Copier extends Efl.Loop_Consumer implements Efl.Io.Closer { destination then the "done" event is emitted. If the destination is not set (ie: $NULL) then data is kept - in a internal @Eina.Binbuf, which can be stolen with + in a internal binbuf, which can be stolen with @.binbuf_steal once "data" or "line" events are emitted. It exists as a useful shortcut to easily drain readers and store all data in memory with no need to use an @@ -313,7 +313,7 @@ class @beta Efl.Io.Copier extends Efl.Loop_Consumer implements Efl.Io.Closer { which case you should wait for "done", "data" or "line" events and then call it to retrieve and own the data. ]] - return: ptr(Eina.Binbuf) @move @no_unused; [[Binbuf]] + return: binbuf @move @no_unused; [[Binbuf]] } @property pending_size { diff --git a/src/lib/efl/interfaces/efl_io_buffer.eo b/src/lib/efl/interfaces/efl_io_buffer.eo index 518a799a3a..58e0c7ab22 100644 --- a/src/lib/efl/interfaces/efl_io_buffer.eo +++ b/src/lib/efl/interfaces/efl_io_buffer.eo @@ -133,7 +133,7 @@ class @beta Efl.Io.Buffer extends Efl.Object On failure, for example a read-only backing store was adopted with @.adopt_readonly, $NULL is returned. ]] - return: ptr(Eina.Binbuf) @move @no_unused; [[Binbuf]] + return: binbuf @move @no_unused; [[Binbuf]] } } diff --git a/src/lib/eio/efl_io_manager.eo b/src/lib/eio/efl_io_manager.eo index be58b047c0..6d147d95b4 100644 --- a/src/lib/eio/efl_io_manager.eo +++ b/src/lib/eio/efl_io_manager.eo @@ -80,13 +80,13 @@ class @beta Efl.Io.Manager extends Efl.Loop_Consumer [[Retrieves or sets information of a given extended attribute.]] set { values { - data: ptr(Eina.Binbuf); [[Data to set as information]] + data: binbuf; [[Data to set as information]] flags: Eina.Xattr.Flags; [[Extended attributes flags]] } return: future @move; [[Future for asynchronous set operation]] } get { - return: future @move; [[Information]] + return: future @move; [[Information]] } keys { path: string; [[File path]] diff --git a/src/lib/eo/eina_types.eot b/src/lib/eo/eina_types.eot index 000a2567d9..cbb0981dc7 100644 --- a/src/lib/eo/eina_types.eot +++ b/src/lib/eo/eina_types.eot @@ -128,9 +128,6 @@ type @extern Eina.Error: int; [[Eina error type @since 1.22 ]] -struct @extern @beta @free(eina_binbuf_free) Eina.Binbuf; [[Eina binbuf data structure]] -struct @extern @beta @free(eina_strbuf_free) Eina.Strbuf; [[Eina strbuf data structure]] - struct @extern @beta Eina.Slice { [[A linear, read-only, memory segment]] len: size; [[Length of the memory segment]] From 15acb0586a3e8e6a17d074e1e0142403752aa41b Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Mon, 8 Jun 2020 18:05:49 -0300 Subject: [PATCH 08/14] cxx: Fix uses of intrinsic eolian binbuf type Add special binbuf and Eina_Strbuf conversions Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11950 --- src/bindings/cxx/eo_cxx/eo_cxx_interop.hh | 29 +++++++++++++++++++++++ src/lib/eolian_cxx/grammar/type_impl.hpp | 4 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh index 633d377b0b..3f4521fe66 100644 --- a/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh +++ b/src/bindings/cxx/eo_cxx/eo_cxx_interop.hh @@ -53,6 +53,10 @@ template <> struct in_traits { typedef efl::eina::strbuf type; }; template <> struct in_traits { typedef efl::eina::strbuf const type; }; +template <> +struct in_traits { typedef efl::eina::strbuf_view type; }; +template <> +struct in_traits { typedef efl::eina::strbuf_view const type; }; template struct in_traits { typedef T& type; }; template @@ -550,10 +554,22 @@ inline const char* convert_to_c_impl(efl::eina::stringshare x, tag) +{ + return x.native_handle(); +} inline Eina_Strbuf* convert_to_c_impl(efl::eina::strbuf& x, tag) { return x.native_handle(); } +inline Eina_Strbuf const* convert_to_c_impl(efl::eina::strbuf_view const& x, tag) +{ + return x.native_handle(); +} +inline Eina_Strbuf* convert_to_c_impl(efl::eina::strbuf_view const& x, tag) +{ + return const_cast(x.native_handle()); +} template T* convert_to_c_impl(std::unique_ptr& v, tag>) { @@ -732,6 +748,19 @@ T convert_to_return(U* value, tag, typename std::enable_if::v // const should be to the type if value is const return T{const_cast::type*>(value)}; } +inline eina::strbuf convert_to_return(Eina_Strbuf* value, tag) +{ + eina::strbuf_wrapper t{value}; + return t; +} +inline eina::strbuf_view convert_to_return(Eina_Strbuf* value, tag) +{ + return {value}; +} +inline eina::strbuf_view convert_to_return(Eina_Strbuf const* value, tag) +{ + return {value}; +} inline eina::stringshare convert_to_return(const Eina_Stringshare* value, tag) { return efl::eina::stringshare(value); diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index b43641a052..547132a31b 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -174,10 +174,10 @@ struct visitor_generate if (r.base_qualifier.qualifier & qualifier_info::is_const) { r.base_qualifier.qualifier ^= qualifier_info::is_const; - return replace_base_type(r, " Eina_Binbuf*"); + return replace_base_type(r, " ::efl::eina::strbuf"); } else - return replace_base_type(r, " Eina_Binbuf const*"); + return replace_base_type(r, " ::efl::eina::strbuf_view"); }} /* FIXME: handle any_value_ref */ , {"any_value", true, nullptr, nullptr, [&] From 29ae24cbf97e66e1d3985d2f515f0b02851120f7 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sat, 18 Apr 2020 19:43:11 +0200 Subject: [PATCH 09/14] efl_ui_win: declare constructors not optional they cannot be optional, or in later languages types will collide. Differential Revision: https://phab.enlightenment.org/D11741 --- src/lib/elementary/efl_ui_win.eo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 602acf506b..54686b0bae 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -835,9 +835,9 @@ class Efl.Ui.Win extends Efl.Ui.Widget implements Efl.Canvas.Scene, Efl.Access.W Efl.Part.part_get; } constructors { - .win_name @optional; + .win_name; .win_type @optional; - .accel_preference @optional; + .accel_preference; } events { delete,request: void; [[Called when the window receives a delete request]] From 3f26662390c625c94cea2bccd612a988031ad7c2 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 7 Jun 2020 01:28:18 +0100 Subject: [PATCH 10/14] eina - abstratc content - smaller stack buffer for limited size string no need for a 4k buffer when 128 bytes will be plenty - short string. --- src/lib/eina/eina_abstract_content.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/eina/eina_abstract_content.c b/src/lib/eina/eina_abstract_content.c index 7f54122a0f..8ed4dc5a48 100644 --- a/src/lib/eina/eina_abstract_content.c +++ b/src/lib/eina/eina_abstract_content.c @@ -321,7 +321,7 @@ _eina_value_type_content_convert_to(const Eina_Value_Type *type EINA_UNUSED, con } //create some fallback { - char buf[PATH_MAX]; + char buf[128]; char *tmp = (char*) &buf; snprintf(buf, sizeof(buf), "Content %p cannot be converted to \"text/plain;charset=utf-8\"", *ra); return eina_value_type_pset(convert, convert_mem, &tmp); From 0ab3575f700f961ba89a9477f010ca97294a0cf7 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 7 Jun 2020 01:33:43 +0100 Subject: [PATCH 11/14] eina - prefix - use smaller buffers for building strings use less stack space but no features as buffers are big enough for all content used or alloca'd now. --- src/lib/eina/eina_prefix.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/lib/eina/eina_prefix.c b/src/lib/eina/eina_prefix.c index dd483a085a..13b6e6d01d 100644 --- a/src/lib/eina/eina_prefix.c +++ b/src/lib/eina/eina_prefix.c @@ -301,8 +301,9 @@ _try_argv(Eina_Prefix *pfx, const char *argv0) { if (getcwd(buf2, sizeof(buf2))) { - char joined[PATH_MAX]; - eina_file_path_join(joined, sizeof(joined), buf2, argv0); + size_t len = strlen(buf2) + 1 + strlen(argv0) + 1; + char *joined = alloca(len); + eina_file_path_join(joined, len, buf2, argv0); if (realpath(joined, buf)) { if (access(buf, X_OK) == 0) @@ -371,7 +372,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0) static int _get_env_var(char **var, const char *envprefix, const char *envsuffix, const char *prefix, const char *dir) { - char env[1024]; + char env[64]; const char *s; #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) @@ -387,8 +388,11 @@ _get_env_var(char **var, const char *envprefix, const char *envsuffix, const cha } else if (prefix) { - char buf[PATH_MAX]; - eina_file_path_join(buf, sizeof(buf), prefix, dir); + size_t len = strlen(prefix) + 1 + strlen(dir) + 1; + char *buf; + + buf = alloca(len); + eina_file_path_join(buf, len, prefix, dir); INF("Have %s_PREFIX = %s, use %s = %s", envprefix, prefix, env, buf); STRDUP_REP(*var, buf); return 1; @@ -409,7 +413,7 @@ _get_env_vars(Eina_Prefix *pfx, const char *datadir, const char *localedir) { - char env[1024]; + char env[32]; const char *prefix; int ret = 0; From 9be9e9f5ffd50b0079143f18a9c99ff793daa81a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 9 Jun 2020 10:13:04 +0100 Subject: [PATCH 12/14] efreet - handle runtime relocation right with default XDG_DATA_DIRS XDG_DATA_DIRS was only set up to a default including where efl was installed prefix-wise as the compiled-=in prefix, not runtime determined prefix. it shouldn't actually affect most people except those making use of this. @fix --- src/lib/efreet/efreet_base.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c index 6497e8d955..736a3a05fc 100644 --- a/src/lib/efreet/efreet_base.c +++ b/src/lib/efreet/efreet_base.c @@ -51,6 +51,8 @@ static const char *xdg_pictures_dir = NULL; static const char *xdg_videos_dir = NULL; static const char *hostname = NULL; +static Eina_Prefix *pfx= NULL; + static void efreet_dirs_init(void); static const char *efreet_dir_get(const char *key, const char *fallback); static Eina_List *efreet_dirs_get(const char *key, @@ -72,6 +74,9 @@ efreet_base_init(void) EINA_LOG_ERR("Efreet: Could not create a log domain for efreet_base.\n"); return 0; } + if (!pfx) pfx = eina_prefix_new + (NULL, efreet_init, "EFREET", "efreet", "checkme", + PACKAGE_BIN_DIR, PACKAGE_LIB_DIR, PACKAGE_DATA_DIR, PACKAGE_DATA_DIR); efreet_dirs_init(); return 1; } @@ -105,6 +110,11 @@ efreet_base_shutdown(void) IF_RELEASE(hostname); + if (pfx) + { + eina_prefix_free(pfx); + pfx = NULL; + } eina_log_domain_unregister(_efreet_base_log_dom); _efreet_base_log_dom = -1; } @@ -280,6 +290,7 @@ efreet_dirs_reset(void) static void efreet_dirs_init(void) { + char *data_dir = DATA_DIR; char buf[PATH_MAX]; /* efreet_home_dir */ @@ -294,13 +305,27 @@ efreet_dirs_init(void) xdg_cache_home = efreet_dir_get("XDG_CACHE_HOME", "/.cache"); /* xdg_data_dirs */ + if (pfx) + { + const char *dir = eina_prefix_get(pfx); + if (dir) + { + size_t len = strlen(dir); + + data_dir = alloca(len + 1 + 5 /*"share" */ + 1); #ifdef _WIN32 - snprintf(buf, sizeof(buf), "%s\\Efl;" DATA_DIR ";", getenv("APPDATA")); - xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", buf); + snprintf(data_dir, len + 1 + 5 + 1, "%s\\share", dir); #else - xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", - DATA_DIR ":/usr/share:/usr/local/share"); + snprintf(data_dir, len + 1 + 5 + 1, "%s/share", dir); #endif + } + } +#ifdef _WIN32 + snprintf(buf, sizeof(buf), "%s\\Efl;%s;", data_dir, getenv("APPDATA")); +#else + snprintf(buf, sizeof(buf), "%s:/usr/share:/usr/local/share", data_dir); +#endif + xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS", buf); /* xdg_config_dirs */ #ifdef _WIN32 xdg_config_dirs = efreet_dirs_get("XDG_CONFIG_DIRS", getenv("APPDATA")); From 29c491b977543e9ef86147604ab3a297ece18327 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 9 Jun 2020 09:11:52 +0200 Subject: [PATCH 13/14] ci: travis: disable the webp loader on CI builds for now With the bump of the needed libwebp version to 1.1.0 we have have our Debian and Ubuntu builds failing with a to old version. Disable by default in CI for now and check back later. --- .ci/ci-configure.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh index dced2544ff..b6e99e9f96 100755 --- a/.ci/ci-configure.sh +++ b/.ci/ci-configure.sh @@ -6,7 +6,8 @@ travis_fold start "meson" travis_time_start "meson" if [ "$DISTRO" != "" ] ; then # Why do we need to disable the imf loaders here? - OPTS=" -Decore-imf-loaders-disabler=scim,ibus" + # Once libwebp 1.1.0 is available in more distros we can enable it by default again + OPTS=" -Decore-imf-loaders-disabler=scim,ibus -Devas-loaders-disabler=json,webp" MONO_LINUX_COPTS=" -Dbindings=cxx,mono -Dmono-beta=true" @@ -98,7 +99,7 @@ elif [ "$TRAVIS_OS_NAME" = "osx" ]; then export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig:$(pwd)/.ci" mkdir build && meson build -Dopengl=full -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Dgstreamer=false else # Native Ubuntu Linux Travis builds (non-docker) - OPTS=" -Decore-imf-loaders-disabler=scim,ibus" + OPTS=" -Decore-imf-loaders-disabler=scim,ibus -Devas-loaders-disabler=json,webp" if [ "$TRAVIS_CPU_ARCH" = "ppc64le" ]; then OPTS="$OPTS -Dbindings=" From 4f6a086f6ad9e0151e32930bafb6e85d5cb8f826 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 9 Jun 2020 12:09:25 +0200 Subject: [PATCH 14/14] mono: update window construction they simply missed parameters here Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11954 --- src/tests/efl_mono/Model.cs | 2 +- src/tests/efl_mono/Parts.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs index f566b91d04..bdf30b341d 100644 --- a/src/tests/efl_mono/Model.cs +++ b/src/tests/efl_mono/Model.cs @@ -69,7 +69,7 @@ public static class TestModel { { string propertyBound = null; bool callbackCalled = false; - var parent = new Efl.Ui.Win(null); + var parent = new Efl.Ui.Win(null, "", ""); parent.Visible = false; var factory = new Efl.Ui.ItemFactory(parent); factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => { diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs index c5de896053..e33ce96918 100644 --- a/src/tests/efl_mono/Parts.cs +++ b/src/tests/efl_mono/Parts.cs @@ -61,7 +61,7 @@ public static class TestMVVMParts { public static void mvvm_dynamic_parts() { - var parent = new Efl.Ui.Win(null); + var parent = new Efl.Ui.Win(null, "", ""); parent.Visible = false; var factory = new Efl.Ui.ItemFactory(parent); @@ -75,7 +75,7 @@ public static class TestMVVMParts public static void mvvm_factory_properties() { - var parent = new Efl.Ui.Win(null); + var parent = new Efl.Ui.Win(null, "", ""); parent.Visible = false; var factory = new Efl.Ui.ItemFactory(parent); var iconFactory = new Efl.Ui.ImageFactory(null);