summaryrefslogtreecommitdiff
path: root/src/lib/eo (follow)
AgeCommit message (Collapse)Author
2017-09-26eo: Fix crashes with call cache after init cycleJean-Philippe Andre
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
2017-09-22eo: make more freefuncs implicitDaniel Kolesa
2017-09-22EFL For WIN32: Replace HAVE_EVIL define with _WIN32Vincent 'vtorri' Torri
2017-09-19efl: Add precise_position for input eventsJean-Philippe Andre
The previous commit removed useless delta
2017-09-18efl: Introduce Eina.Rect and switch EO APIs to itJean-Philippe Andre
It's a complex struct but defined in EO as a simple struct. ABI-wise it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle also work on Eina_Rect out of the box, most of the code dealing with x,y,w,h will require no modifications either. But Eina_Rect provides direct access to a size or position 2d component, as well as the usual x,y,w,h. The field "rect" is provided as a convenience for code dealing with both Eina_Rectangle and Eina_Rect. We may or may not require it. Note: Size2D could use unsigned values but I have spotted a few places in the code that actually use -1 to indicate invalid size (as opposed to 0x0). @feature
2017-09-16eo: fix doxygen typoJean Guyomarc'h
2017-09-15eo files: first batch of @owned conversionsDaniel Kolesa
2017-09-13eo: Add class name to error log (unref)Jean-Philippe Andre
2017-09-04export efl_future_then() for Eina_Future syntax sugar.Gustavo Sverzut Barbieri
This is actually written as efl_future_Eina_FutureXXX_then() as the old API clashes, after removing the old code we'll "sed" to fix those.
2017-09-04Efl_Object: Add integration with Eina_Future.Guilherme Iscaro
This commit adds the EO support for the new future infra. From now on there's no need to efl_future_link()/efl_future_unlink() object and futures since the new API already handles that internally.
2017-09-04Eina: Add Eina_Promise/Eina_Future.Guilherme Iscaro
This commit adds a new promise/future API which aims to replace efl_future.
2017-08-23eo: Mark name_find as constJean-Philippe Andre
The search should not require a mutable object. See the previous commit on elm_widget.
2017-08-23eo: Define Efl.Event in EOJean-Philippe Andre
This can be used in the widgets propagation mechanism later. I don't see any really good reason to not define this struct in EO anyway. Ref T5363
2017-08-13eo: only return NULL when the object is destructed.Cedric Bail
There is a problem with the previous version. The object can still be alive due to the use of manual_free in evas. So you wouldn't be able for example to remove a callback from an object that hasn't been destroyed yet. If that callback is triggered by the destruction of the object, you would end up with an unexpected and impossible to prevent effect of access after free on a callback that you had removed. Not sure if that still solve the original problem that the code was trying to prevent in Ecore_Evas.
2017-08-11eo: Check refs in efl_data_scope_safe_getJean-Philippe Andre
This makes sure the object is actually still alive and kicking before returning any data. Otherwise the "safe" word is a bit of an abuse... Ref T5869 @fix
2017-08-09eo: Add a space in documentationJean-Philippe Andre
This separates the brief and the content.
2017-08-08eo: Fix memory leak with overridesJean-Philippe Andre
See 0834511067a99faafc2c59f0aabcd58dab1cbc0b And b7840d9177b32f480087bd7f062cc66ab2583485 Ref T5580
2017-08-07eo: temporary prevent segfault.Cedric BAIL
In some case, detected during eo test suite, the vtable does fail to be fully assigned, but it is still being assigned as the new vtable. Of course when later destroying it, it has already been freed. Leading to a double free.
2017-08-04eo debug name: Use strbuf instead of slstrJean-Philippe Andre
This should be a little bit more efficient, even if more "risky" in terms of leaks. The final API still looks exactly the same.
2017-08-04eo: Add debug_name read-only property to ease debuggingJean-Philippe Andre
This will include the following information, by default: - class name - whether the class is an override - eo id (pointer) - refcount - name if one was set (Efl.Object property) This also supports classes, which is why it's an EAPI in eo.c and not only a method of Efl.Object This can be overriden by subclasses using the empty method Efl.Object.debug_name_override.get If the function is overriden, then the returned string is used as is and so it is left to the subclass to include all the necessary information (as above). This can easily be achieved by calling efl_debug_name_get(efl_super()) and then concatenating the strings. Think of this function as something like Java's toString(), but only for debugging (i.e. a string class should not just return its string value). @feature
2017-08-04Eo: Allow multiple functions overridesJean-Philippe Andre
This allows two things: - adding new override functions on an object that already has overrides - resetting a specific function (or list of functions) to the parent class implementation by passing NULL as implementation Fixes T5580 @feature
2017-07-19eo: Fix deadlock due to the shared mutexJean-Philippe Andre
Explicit lock / unlock of the shared mutex mixed with implicit lock / unlock when accessing the internal Eo_Object data lead to uncaught issues such as these. This was found by trying to run E with gfx filters under eo_debug.
2017-07-18eo: clarify what extensions are.Marcel Hollerbach
2017-07-12eo: Don't resolve function calls for NULL objectsJean-Philippe Andre
eo_function(NULL) always leads to a no-operation. A this point it is basically considered the normal operation with EO to just silently ignore NULL errors. If the API function "eo_function" belongs to a class that has not been loaded yet (eg. no object of this type has been created yet), then the op associated to the API func may not be defined yet. Fixes T5715
2017-06-22eo: Improve invalid EO ID error messageJean-Philippe Andre
This focus on the domain and ID bits is very confusing. Let's keep it at the end of the message, and also try to guess whether the object may have been deleted or simply doesn't belong to the current thread.
2017-06-14eo: Add API efl_data_scope_safe_getJean-Philippe Andre
This is a safe version of efl_data_scope_get, meaning that it will return NULL if the object is not of the required type, or if there is no data for that class, or if the given class was used as an interface (and isn't a mixin). @feature
2017-06-05Eo: add APIs to walk over classes and objectsDaniel Zaoui
These APIs are needed by Clouseau to get a list of classes and objects.
2017-05-29eo: Make efl_cast() return NULL if invalid castJean-Philippe Andre
This makes it work like C++ dynamic_cast<> operator, so that the return value will be NULL if the object is not an instance of the given class. In case of efl_super() we don't do it as efl_super is used A LOT inside EFL itself (all constructors & destructors, for a start) and efl_isa is in fact a bit expensive. efl_cast isn't really used and is intended to be something like dynamic_cast. For @cedric :)
2017-05-17eo - eoid - finally rtemove option to not have eoid. it doesn't workCarsten Haitzler (Rasterman)
we use too many bits for metadata now so eoid is broken... remove it as an option so people dont break out the foot guns
2017-05-04eo: fix missing event emissionMarcel Hollerbach
There have been cases where the logic of _event_callback_call break'ed too early in the event submission. Reason for that was the line ((const unsigned char *) desc - (const unsigned char *) it->desc) producing a overflow. This means the if statement if (!legacy_compare && ((const unsigned char *) desc - (const unsigned char *) it->desc) < 0) was true while the pointer desc was smaller than it->desc, which means the event subscription got aborted, even if it should not. This turned out on two 32 bit maschines. And led to not rendering apps anymore. It was introduced by commit in 605fec91ee7. @fix
2017-04-26eo: move all the key_ properties to CDaniel Kolesa
2017-04-26eo: move wref_add/wref_del to CDaniel Kolesa
2017-04-26eo: move future_link to CDaniel Kolesa
2017-04-21eo: hide dbg_info from eo filesDaniel Kolesa
Continues b780cf2af299ce17be260486bb7ab64badddbaec.
2017-04-21eo: move event related structures and callback to CDaniel Kolesa
We don't need to keep this in eo files anymore because the APIs using them are now fully in C. This also allows removal of the event callback builtin from Eolian.
2017-04-20eo: move unbindable event APIs to CDaniel Kolesa
In a few classes, this requires some manual expansion. This should not break anything but it's also fairly ugly; a better solution would be appreciated, for now we do this. Similar changes will be done to a few other Efl.Object APIs as well at later point.
2017-04-20eo: move Efl_Event definition back to CDaniel Kolesa
It's not used anywhere in eo files and has a void pointer.
2017-04-19eo: Micro-optimize function callsJean-Philippe Andre
This is related to the previous changes to efl_super.
2017-04-19eo: Remove super bit from eo idJean-Philippe Andre
It is not required anymore as the super class and super bit can be stored inside the object data. See the previous patches.
2017-04-19eo: Add docs for efl_super and efl_cast (doxygen)Jean-Philippe Andre
2017-04-19eo: Add new API efl_castJean-Philippe Andre
This is similar to efl_super but the specified class is the one we want to call the function on. This is similar to dynamic_cast<> in C++. Note: both efl_super() and efl_cast() need documentation! This is an experimental feature. Fixes T5311 @feature Maniphest Tasks: T5311 Differential Revision: https://phab.enlightenment.org/D4797
2017-04-19eo: Remove lock from efl_superJean-Philippe Andre
I've always really disliked this lock. If someone calls a non-eo function by accident with efl_super() then you'll most likely end up in a deadlock. This adds the cur_klass pointer to the object itself, exploiting the fact that we have 8 bytes of padding (on 64 bits, at least). Also, this opens the door to efl_cast() which would be similar to efl_super() except that only a dynamic cast is done, not a call to the parent function. make benchmark shows a performance improvement, surprisingly. This is a bit experimental. See also the following commit (efl_cast)
2017-04-18eo: Use COW to save 8~16 bytes per objectJean-Philippe Andre
Summary: This uses Eina_Cow to implement support for rarely used features in EO objects. This covers: - composite objects (eg. UI widgets: combobox, text, video, win) - vtable for efl_object_override - del_intercept All of these features are quite tricky to get right and while very useful, should still be used with great care. With this patch, the size of an _Eo_Object struct comes down from 80 bytes (rounded up from 72b) to 64 bytes (rounded up from 56b) on 64 bits. Also I haven't measured precisely but I don't expect any performance impact since the COW data is more likely to remain in L1/L2 cache, as the default one will be used most often. Unfortunately, the results of "make benchmark" have been quite inconsistent over multiple runs. This saves ~64kb in elementary_test (>4k objects) at the cost of ~100 calls to COW write (del intercept on some events). @optimization Reviewers: raster, cedric Differential Revision: https://phab.enlightenment.org/D4796
2017-04-18eo: Fix crash in case of API misuseJean-Philippe Andre
If efl_object_override() is called with a function that does not exist in the original class, it may lead to a crash on indexing an non-existing array in the vtable. This is really just a safety check, as the usage was wrong: * You are only allowed to override functions that are defined in the * class or any of its interfaces (that is, efl_isa returning true).
2017-02-21eo: Make _eo_obj_pointer_done an inline functionJean-Philippe Andre
@optimization
2017-02-16eo: ensure the generation is correctly clampedMarcel Hollerbach
Summary: when a few recursive event emissions are happening, and in some deep recursive level a subscription to the same object is happening, the subscription would just be executed when the complete recursion is done. that is wrong. The subscription needs to be executed when the event is called after the subscription is added, undepended from any recursive level. That fixes that and adds a regression test for it. This was discovered in e, since e gives a lot of error messages about a eo object that is already freed. It turned out this object is returned from evas, and exactly the above happened to the EFL_EVENT_DEL subscription of that object. Test Plan: make check Reviewers: tasn, cedric, stefan_schmidt Subscribers: stefan_schmidt, netstar, zmike, raster, jpeg Differential Revision: https://phab.enlightenment.org/D4656 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-15eo: Fix shadow variable warningJean-Philippe Andre
2017-02-15eo_debug: Remove some abusive goto where not neededJean-Philippe Andre
goto was used for micro-optimization. There is absolutely no need for those if we're using the slow path with eo_debug. Simplify the code.
2017-02-15eo_debug: Some more log improvementsJean-Philippe Andre
Nothing fancy here...
2017-02-15eo_debug: Improve dangling xref debug logs even moreJean-Philippe Andre
In case of manual free, as is heavily used by Evas, we can't really print an ERR if there are still references before free has been called. This may not be ideal from a pure EO point of view but considering how Evas uses manual free this is the best solution to avoid polluting debug logs.