Refer to the previous commits for more context.
When an evas object is given to a container, be it with a variant of
efl_pack() or efl_content_set(), its "ownership" is given to the new
parent container. But ownership here means that the new container may
delete the child when it sees fit (i.e. when the container itself dies,
for instance). This does not mean that a reference was passed from the
calling context to the container. The actual EO owner of the child is
always the canvas or another canvas object, even if it the object is
unpacked.
Note: This means that invalid calls to efl_pack or efl_content_set will
not automatically delete the child object. This is the same as legacy,
and results in floating objects. Just check the return value! :)
Hopefully this is correct for bindings.
This comes back to an earlier situation where the fake event objects
created by efl_input_dup() had a parent (it should be the evas or maybe
the window). But that led to issues as efl_unref() would print error
messages. Using efl_allow_parent_unref_set() we hide the error message,
because in this situation we want the caller to use efl_unref() and not
efl_del() (eg. think of bindings...).
See d3436af616
See 6bed255fc4
See 96d94e0076 <-- main commit
This allows deleting an object by simply calling efl_unref() on it, even
if there is a parent. Normally the parent is in charge, and you can
request deletion by calling efl_del() or efl_parent_set(NULL).
But in some rare cases, you want to give ownership of an object (@owned)
and still give a parent to that object. efl_unref() should be used (and
would be used by bindings when going out of scope or on garbage
collection), which would then print an error message. This API allows
the specific behaviour.
@feature
export EO_LIFECYCLE_BACKTRACE=0
This means that the lifecycle can be tracked but we don't care about the
backtraces. Related to some recent eo_debug patches.
If an object still has a parent inside the del intercept, we shouldn't
reset the "parent_sunk" flag. This would indeed break logic as
parent_sunk == false implies that a parent was never set, which means
the parent must be null. Right now this case isn't used but it can be
imagined with caches of evas objects (they should remain parented to
their evas).
@fix
the count ?: 1 check is pointless as count is already checked above.
make it clearer that it's > 0 and remove the ? check. silence for
coverity CID 1380542
edje_object_part_text_style_user_push() doesnt need you to
stringshare_add a string... some other code did it because it "gets"
the string from an obj that might free/delete the string on push etc.
or before so it keeps a copy but then it stringshare_del's it
anyway... the _textpath_ellipsis_set() code creates a trsbuf that
wasn't freed if enabled was false and it never stringshare_del'd the
string is stringshare_added... all of this was pointless code anyway.
you could just pass the constant string directly.
fixes CID 1380543
efl_data_scope_safe_get() is often used to assert that an object is of a
certain type, but assuming it may be NULL or not of the required type.
This means that encountering an invalid type is an error handled by the
caller (we return NULL), and shouldn't print out extra ERR() logs.
This fixes issues with E run under eo_debug. E's code was safe as it's
using evas_object_smart_data_get() and verifies whether the returned
value is NULL (which is expected for a rectangle, for instance).
@fix
This solves issues with efl_input_dup() which didn't properly give a
reference to the caller, resulting in dangling eo ids.
Note: This may trigger leaks (instead of invalid refs), but this now
actually reflects the meaning of @owned. This should work with bindings
and C API users should know to call efl_unref().
This patch is the reason for the previous improvements on eo_debug.
@fix
This is done via the syntax (not documented yet):
EO_LIFECYCLE_DEBUG=N:<class names>
Where N is:
1. new/free
2. new/free/ref/unref
3. new/free/ref/unref/reuse
@feature
Summary:
If object just has update of map point without other changes included child,
the map surface can be reused.
Reviewers: jpeg, cedric
Differential Revision: https://phab.enlightenment.org/D5181
Summary:
In case of emile, unmap the memory of the image file when the image file is closing.
But closing of image file happen when the image is flushed from the cache, so the
mapped memory of image file remain for long period of time with no benefit (If it is
in cache, it won't get decoded again). So I think we don't need to keep the mapped
memory of image file.
Test Plan: self
Reviewers: cedric, jpeg, jypark
Reviewed By: cedric
Differential Revision: https://phab.enlightenment.org/D5210
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
If the main loop is destroyed a lot of companion information might already
have been so relying on EFL_EVENT_DEL might be way to late in the shutdown
process. terminate will be triggered as soon as the process of shutting down
is started, so all the data are still valid and have not been destroyed yet.
Summary:
The patch will adjust ascent/descent with considering main font's ascent/descent
as minimum value. Actually, this patch re-apply D5217 with resolving linegap issue
on the _layout_format_ascent_descent_adjust() function.
@fix
Test Plan: Put a text which will load smaller font. And put a text which will load primary font.
Reviewers: raster, cedric, herdsman, jpeg
Differential Revision: https://phab.enlightenment.org/D5227
After ecore_shutdown the main loop is dead, so the flag do_quit can be
safely reset to 0. This will fix issues with cycles of
elm_init/shutdown. This fixes:
CK_FORK=no tests/elementary/elm_suite elm_win
This patch relies on a few of the previous patches which ensure that
ecore is well shut down.
@fix
It's not enough to check the init generation count, if the cache data is
not reset properly.
This patch adds safety in two ways:
1. Actually reset the op call cache when we detect a new generation
2. Verify that we don't return NULL function pointer
The 1st point is absolutely necessary, 2nd is optional (extra cost of
one if()).
@fix
An old comment mentioned that this was explicitely not unregistered, but
I believe the comment isn't valid since ecore_event_type_flush() was
introduced.
ecore could not shut down properly in an elm_init()/elm_shutdown()
cycle, with 7 remaining references, all because of a typo.
This should help @cedric as well
The incomplete reset (array to NULL but max not reset) triggers errors
in evas_thread_queue_append() where eina_inarray_grow() returns NULL.
This shows up in:
CK_FORK=no elm_suite
@fix
Somehow I was seeing a ton of errors with "prefs_iface" not found in
make check. This code could not have worked since the merge of
elementary in EFL tree...
@fix
Summary:
elm_bg was supposed to be used only in legacy,
but since we need a common object to be used as a background of widgets,
it is now renamed as efl_ui_bg and supports EO APIs.
Reviewers: cedric, jpeg, woohyun
Differential Revision: https://phab.enlightenment.org/D5147
This removes the last remaining legacy-style part API from Widget.
I think this is redundant with the property "translatable_text"
introduced in Efl.Ui.Translatable.
Ref T5363